Beispiel #1
0
        //handler for speed HotKey
        private void SpeedOnKey(HotKey hotKey)
        {
            // Find index of pressed key.
            var keyIndex = Config.HotKeys.SpeedKeys.FindIndex(k => k.Key == hotKey.Key && k.KeyMod == hotKey.KeyModifiers);

            // Set slider to corresponding hotkey values.
            switch (Config.HotKeys.SpeedKeys[keyIndex].Direction)
            {
            case "Up":
                slider1.Value = slider1.Value + Config.HotKeys.SpeedKeys[keyIndex].Amount;
                break;

            case "Down":
                slider1.Value = slider1.Value - Config.HotKeys.SpeedKeys[keyIndex].Amount;
                break;

            case "Normal":
                slider1.Value = 0;
                break;

            case "Sprint":
                slider1.Value = 1.18852459016393;
                break;

            case "Max":
                slider1.Value = 10d;
                break;
            }
        }
Beispiel #2
0
        //handler for Move HotKey

        private void MoveOnKey(HotKey hotKey)
        {
            // Find index of pressed hotkey.
            var keyIndex = Config.HotKeys.MoveKeys.FindIndex(k => k.Key == hotKey.Key && k.KeyMod == hotKey.KeyModifiers);

            // Get distance to be moved.
            var distance = Config.HotKeys.MoveKeys[keyIndex].Distance;

            // Move in the direction dictated by the hotkey.
            switch (Config.HotKeys.MoveKeys[keyIndex].Direction)
            {
            case "N":
                InterProcessCom.Game.AddToPos(Axis.Y, distance, false);
                break;

            case "NE":
                InterProcessCom.Game.AddToPos(Axis.X, distance, true);
                InterProcessCom.Game.AddToPos(Axis.Y, distance, false);
                break;

            case "E":
                InterProcessCom.Game.AddToPos(Axis.X, distance, true);
                break;

            case "SE":
                InterProcessCom.Game.AddToPos(Axis.X, distance, true);
                InterProcessCom.Game.AddToPos(Axis.Y, distance, true);
                break;

            case "S":
                InterProcessCom.Game.AddToPos(Axis.Y, distance, true);
                break;

            case "SW":
                InterProcessCom.Game.AddToPos(Axis.X, distance, false);
                InterProcessCom.Game.AddToPos(Axis.X, distance, true);
                break;

            case "W":
                InterProcessCom.Game.AddToPos(Axis.X, distance, false);
                break;

            case "NW":
                InterProcessCom.Game.AddToPos(Axis.X, distance, false);
                InterProcessCom.Game.AddToPos(Axis.Y, distance, false);
                break;

            case "Up":
                InterProcessCom.Game.AddToPos(Axis.Z, distance, true);
                break;

            case "Down":
                InterProcessCom.Game.AddToPos(Axis.Z, distance, false);
                break;
            }
        }
Beispiel #3
0
        //Hander for POS hotkeys
        private void PosOnKey(HotKey hotKey)
        {
            // Find index of pressed key.
            var keyIndex = Config.HotKeys.POSKeys.FindIndex(k => k.Key == hotKey.Key && k.KeyMod == hotKey.KeyModifiers);

            // Find index of saved coordinates that corresponds to the key.
            var coordIndex =
                Config.saved_cords.FindIndex(
                    c => c.Name == Config.HotKeys.POSKeys[keyIndex].POSName && c.ZoneID == Config.HotKeys.POSKeys[keyIndex].ZoneName);

            //Set the new XYZ values.
            InterProcessCom.Game.WriteToPos(Axis.Z, Config.saved_cords[coordIndex].Z);
            InterProcessCom.Game.WriteToPos(Axis.X, Config.saved_cords[coordIndex].X);
            InterProcessCom.Game.WriteToPos(Axis.Y, Config.saved_cords[coordIndex].Y);
        }