示例#1
0
        protected override void OnButtonUp(object sender, ButtonEventArgs eventArguments)
        {
            if (eventArguments.Button == ButtonType.HmdMenu)
            {
                if (IsWaitingForAnimationToComplete == true)
                {
                    return;
                }

                CurrentElement = null;
                ToggleVisiblity(!shown);

                // Auto Show Holocron mastery
                if (shown && Game == Game.ForceVision)
                {
                    HolocronMasterController.HolocronMasterButton.OnClicked();
                    LastElement = HolocronMasterController.HolocronMasterButton;
                }
                else if (shown)
                {
                    OptionsController.OptionsButton.OnClicked();
                    LastElement = OptionsController.OptionsButton;
                }

                return;
            }

            if (!ButtonIsActivateOrControl(eventArguments.Button))
            {
                return;
            }

            if (CurrentElement != null && CurrentElement.Interactable)
            {
                if (LastElement != null && LastElement != CurrentElement)
                {
                    LastElement.OnClicked();
                }

                CurrentElement.OnClicked();
                LastElement = (LastElement == CurrentElement) ? null : CurrentElement;
            }

            base.OnButtonUp(sender, eventArguments);
        }
示例#2
0
        protected override void OnButtonUp(object sender, ButtonEventArgs eventArguments)
        {
            if (eventArguments.Button != ButtonType.SaberActivate && eventArguments.Button != ButtonType.SaberControl && eventArguments.Button != ButtonType.HmdSelect)
            {
                return;
            }

            if (CurrentElement != null && CurrentElement.Interactable)
            {
                if (LastElement != null && LastElement != CurrentElement)
                {
                    LastElement.OnClicked();
                }

                CurrentElement.OnClicked();
                LastElement = (LastElement == CurrentElement) ? null : CurrentElement;
            }

            base.OnButtonUp(sender, eventArguments);
        }