| 643 | } |
| 644 | |
| 645 | private handleClick(): void { |
| 646 | if (this._mode === EButtonMode.Check) { |
| 647 | if (this._changeStateOnClick) { |
| 648 | this.selected = !this._selected; |
| 649 | this.emit(FGUIEvents.STATE_CHANGED); |
| 650 | } |
| 651 | } else if (this._mode === EButtonMode.Radio) { |
| 652 | if (this._changeStateOnClick && !this._selected) { |
| 653 | this.selected = true; |
| 654 | this.emit(FGUIEvents.STATE_CHANGED); |
| 655 | } |
| 656 | } else { |
| 657 | if (this._relatedController) { |
| 658 | this._relatedController.selectedPageId = this._relatedPageId; |
| 659 | } |
| 660 | } |
| 661 | } |
| 662 | } |