Ejemplo n.º 1
0
        private void OnVariableClick()
        {
            this.Focus();

            bool isCtrlKeyHeld     = KeyboardUtilities.IsCtrlHeld();
            bool isShiftKeyHeld    = KeyboardUtilities.IsShiftHeld();
            bool isAltKeyHeld      = KeyboardUtilities.IsAltHeld();
            bool isFKeyHeld        = Keyboard.IsKeyDown(Key.F);
            bool isHKeyHeld        = Keyboard.IsKeyDown(Key.H);
            bool isLKeyHeld        = Keyboard.IsKeyDown(Key.L);
            bool isDKeyHeld        = Keyboard.IsKeyDown(Key.D);
            bool isRKeyHeld        = Keyboard.IsKeyDown(Key.R);
            bool isCKeyHeld        = Keyboard.IsKeyDown(Key.C);
            bool isBKeyHeld        = Keyboard.IsKeyDown(Key.B);
            bool isQKeyHeld        = Keyboard.IsKeyDown(Key.Q);
            bool isOKeyHeld        = Keyboard.IsKeyDown(Key.O);
            bool isTKeyHeld        = Keyboard.IsKeyDown(Key.T);
            bool isMKeyHeld        = Keyboard.IsKeyDown(Key.M);
            bool isNKeyHeld        = Keyboard.IsKeyDown(Key.N);
            bool isPKeyHeld        = Keyboard.IsKeyDown(Key.P);
            bool isXKeyHeld        = Keyboard.IsKeyDown(Key.X);
            bool isSKeyHeld        = Keyboard.IsKeyDown(Key.S);
            bool isDeletishKeyHeld = KeyboardUtilities.IsDeletishKeyHeld();
            bool isBacktickHeld    = Keyboard.IsKeyDown(Key.OemTilde);
            bool isZHeld           = Keyboard.IsKeyDown(Key.Z);
            bool isMinusHeld       = Keyboard.IsKeyDown(Key.OemMinus);
            bool isPlusHeld        = Keyboard.IsKeyDown(Key.OemPlus);
            bool isNumberHeld      = KeyboardUtilities.IsNumberHeld();

            if (isShiftKeyHeld && isNumberHeld)
            {
                _watchVariablePanel.UnselectAllVariables();
                BaseColor = ColorUtilities.GetColorForVariable();
            }
            //else if (isSKeyHeld)
            //{
            //    _watchVariablePanel.UnselectAllVariables();
            //    AddToTab(Config.CustomManager);
            //}
            //else if (isTKeyHeld)
            //{
            //    _watchVariablePanel.UnselectAllVariables();
            //    AddToTab(Config.TasManager);
            //}
            //else if (isMKeyHeld)
            //{
            //    _watchVariablePanel.UnselectAllVariables();
            //    AddToTab(Config.MemoryManager);
            //}
            else if (isNKeyHeld)
            {
                _watchVariablePanel.UnselectAllVariables();
                WatchVarWrapper.ViewInMemoryTab();
            }
            else if (isFKeyHeld)
            {
                _watchVariablePanel.UnselectAllVariables();
                ToggleFixedAddress();
            }
            else if (isHKeyHeld)
            {
                _watchVariablePanel.UnselectAllVariables();
                ToggleHighlighted();
            }
            else if (isNumberHeld)
            {
                _watchVariablePanel.UnselectAllVariables();
                Color?color = ColorUtilities.GetColorForHighlight();
                ToggleHighlighted(color);
            }
            else if (isLKeyHeld)
            {
                _watchVariablePanel.UnselectAllVariables();
                WatchVarWrapper.ToggleLocked(null, FixedAddressListGetter());
            }
            else if (isDKeyHeld)
            {
                _watchVariablePanel.UnselectAllVariables();
                WatchVarWrapper.ToggleDisplayAsHex();
            }
            else if (isRKeyHeld)
            {
                _watchVariablePanel.UnselectAllVariables();
                RenameMode = true;
            }
            else if (isCKeyHeld)
            {
                _watchVariablePanel.UnselectAllVariables();
                WatchVarWrapper.ShowControllerForm();
            }
            else if (isBKeyHeld)
            {
                _watchVariablePanel.UnselectAllVariables();
                WatchVarWrapper.ShowBitForm();
            }
            else if (isDeletishKeyHeld)
            {
                _watchVariablePanel.UnselectAllVariables();
                RemoveFromPanel();
            }
            else if (isXKeyHeld)
            {
                _watchVariablePanel.UnselectAllVariables();
                NotifyPanelOfReodering();
            }
            else if (isBacktickHeld)
            {
                _watchVariablePanel.UnselectAllVariables();
                AddToVarHackTab();
            }
            else if (isZHeld)
            {
                _watchVariablePanel.UnselectAllVariables();
                SetValue(0);
            }
            else if (isMinusHeld)
            {
                _watchVariablePanel.UnselectAllVariables();
                AddValue(1, false);
            }
            else if (isPlusHeld)
            {
                _watchVariablePanel.UnselectAllVariables();
                AddValue(1, true);
            }
            else if (isQKeyHeld)
            {
                _watchVariablePanel.UnselectAllVariables();
                Color?newColor = ColorUtilities.GetColorFromDialog(BaseColor);
                if (newColor.HasValue)
                {
                    BaseColor = newColor.Value;
                    ColorUtilities.LastCustomColor = newColor.Value;
                }
            }
            else if (isOKeyHeld)
            {
                _watchVariablePanel.UnselectAllVariables();
                BaseColor = ColorUtilities.LastCustomColor;
            }
            else
            {
                _watchVariablePanel.NotifySelectClick(this, isCtrlKeyHeld, isShiftKeyHeld);
            }
        }