Example #1
0
        public override void SetDragPositionTopDownView(double?x = null, double?y = null, double?z = null)
        {
            if (!x.HasValue || !z.HasValue)
            {
                return;
            }

            PositionAngle posAngle = GetPositionAngle();
            double        dist     = MoreMath.GetDistanceBetween(posAngle.X, posAngle.Z, x.Value, z.Value);
            double        angle    = MoreMath.AngleTo_AngleUnits(posAngle.X, posAngle.Z, x.Value, z.Value);

            if (!KeyboardUtilities.IsCtrlHeld())
            {
                if (_useRecommendedArrowLength)
                {
                    SetRecommendedSize(dist);
                }
                else
                {
                    GetParentMapTracker().SetSize((float)(Scales ? dist : dist *Config.CurrentMapGraphics.MapViewScaleValue));
                }
            }
            if (!KeyboardUtilities.IsShiftHeld())
            {
                SetYaw(angle);
            }
        }
Example #2
0
        public override void SetDragPositionTopDownView(double?x = null, double?y = null, double?z = null)
        {
            if (!x.HasValue || !z.HasValue)
            {
                return;
            }

            PositionAngle posAngle = _posAngle.GetBasePositionAngle();
            double        dist     = MoreMath.GetDistanceBetween(posAngle.X, posAngle.Z, x.Value, z.Value);
            double        angle    = MoreMath.AngleTo_AngleUnits(posAngle.X, posAngle.Z, x.Value, z.Value);

            if (Rotates)
            {
                angle -= posAngle.Angle;
            }

            if (!KeyboardUtilities.IsCtrlHeld())
            {
                _posAngle.SetOffsetDist(dist);
            }
            if (!KeyboardUtilities.IsShiftHeld())
            {
                _posAngle.SetOffsetAngle(angle);
            }

            MapTracker mapTracker = GetParentMapTracker();

            mapTracker.SetSize((float)_posAngle.GetOffsetDist());
            mapTracker.SetLineWidth((float)_posAngle.GetOffsetAngle());
        }
 public override void SetDragPositionTopDownView(double?x = null, double?y = null, double?z = null)
 {
     if (KeyboardUtilities.IsCtrlHeld())
     {
         z = null;
     }
     if (KeyboardUtilities.IsShiftHeld())
     {
         x = null;
     }
     GetPositionAngle().SetValues(x, y, z);
 }
        private void OnSlotClick(object sender, EventArgs e)
        {
            // Make sure the tab has loaded
            if (_gui.TabControl.SelectedTab == null)
            {
                return;
            }

            ObjectSlot selectedSlot = sender as ObjectSlot;

            selectedSlot.Focus();

            bool isCtrlKeyHeld  = KeyboardUtilities.IsCtrlHeld();
            bool isShiftKeyHeld = KeyboardUtilities.IsShiftHeld();
            bool isAltKeyHeld   = KeyboardUtilities.IsAltHeld();

            DoSlotClickUsingInput(selectedSlot, isCtrlKeyHeld, isShiftKeyHeld, isAltKeyHeld);
        }
Example #5
0
        private void OnSlotClick(object sender, EventArgs e)
        {
            // Make sure the tab has loaded
            if (mainForm.tabControlMain.SelectedTab == null)
            {
                return;
            }

            ObjectSlot selectedSlot = sender as ObjectSlot;

            selectedSlot.Focus();

            bool isCtrlKeyHeld  = KeyboardUtilities.IsCtrlHeld();
            bool isShiftKeyHeld = KeyboardUtilities.IsShiftHeld();
            bool isAltKeyHeld   = KeyboardUtilities.IsAltHeld();
            int? numberHeld     = KeyboardUtilities.GetCurrentlyInputtedNumber();

            DoSlotClickUsingInput(selectedSlot, isCtrlKeyHeld, isShiftKeyHeld, isAltKeyHeld, numberHeld);
        }
        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);
            }
        }