Example #1
0
 /// <summary>The event called when the player presses a keyboard button.</summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event arguments.</param>
 private void ControlEvents_KeyPressed(object sender, EventArgsKeyPressed e)
 {
     // summon tractor
     if (e.KeyPressed == this.Config.TractorKey)
     {
         this.Tractor?.SetLocation(Game1.currentLocation, Game1.player.getTileLocation());
     }
 }
 private void ControlEvents_KeyPressed(object sender, EventArgsKeyPressed e)
 {
     if (e.KeyPressed == Keys.PageUp)
     {
         speedup = true;
         Program.gamePtr.TargetElapsedTime = new TimeSpan(0, 0, 0, 0, 1);
     }
 }
        private void ControlEvents_KeyPressed(object sender, EventArgsKeyPressed e)
        {
            string key = e.KeyPressed.ToString().ToLower();

            if (key == "h")
            {
            }
        }
Example #4
0
 private void ControlEvents_KeyPressed(object sender, EventArgsKeyPressed e)
 {
     if (e.KeyPressed == Keys.F5)
     {
         ModConfig = ModConfig.ReloadConfig();
         Log.Success("Config Reloaded for " + GetType().Name);
     }
 }
Example #5
0
 private static void ControlEvents_KeyPressed(object sender, EventArgsKeyPressed e)
 {
     if (e.KeyPressed == Keys.Escape && Game1.currentLocation is GameLocation gl && gl.Name.StartsWith("JoJaBanLevel"))
     {
         resetLevel(Game1.currentLocation);
         loadLevel(currentLevel);
     }
 }
Example #6
0
 public void Events_KeyPressed(object sender, EventArgsKeyPressed e)
 {
     //Console.WriteLine("Key pressed: " + e.KeyPressed.ToString());
     if (e.KeyPressed.ToString().Equals(NPCLocationsConfig.KeyboardKey))
     {
         HandleMenu();
     }
 }
Example #7
0
 /*********
 ** Private methods
 *********/
 private void ControlEvents_KeyReleased(object sender, EventArgsKeyPressed e)
 {
     if (e.KeyPressed == Keys.End)
     {
         this.Monitor.Log("test", LogLevel.Info);
         Game1.player.addItemToInventory(new GrindStone(Vector2.Zero));
     }
 }
Example #8
0
 private void ControlEvents_KeyReleased(object sender, EventArgsKeyPressed e)
 {
     if (e.KeyPressed == Microsoft.Xna.Framework.Input.Keys.End)
     {
         Log.Info("test");
         Game1.player.addItemToInventory(new GrindStone(Vector2.Zero));
     }
 }
 private static void ControlEvents_KeyPressed(object sender, EventArgsKeyPressed e)
 {
     if (e.KeyPressed.ToString() == "K")
     {
         gThread = new Thread(generateAllDialogs);
         gThread.Start();
     }
 }
 /// <summary>The method invoked when the presses a keyboard button.</summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event data.</param>
 private void ControlEvents_KeyPressed(object sender, EventArgsKeyPressed e)
 {
     // show birthday selection menu
     if (Context.IsPlayerFree && !this.HasChosenBirthday && e.KeyPressed.ToString() == this.Config.KeyBinding)
     {
         Game1.activeClickableMenu = new BirthdayMenu(this.PlayerData.BirthdaySeason, this.PlayerData.BirthdayDay, this.SetBirthday);
     }
 }
Example #11
0
 private void ControlEvents_KeyPressed(object sender, EventArgsKeyPressed e)
 {
     if (e.KeyPressed == Keys.F5)
     {
         this.Config = this.Helper.ReadConfig <ModConfig>();
         this.Monitor.Log("Config reloaded", LogLevel.Info);
     }
 }
Example #12
0
 private void ControlEvents_KeyPressed(object sender, EventArgsKeyPressed e)
 {
     if (e.KeyPressed == Keys.N)
     {
         Config.BalancedMode = !Config.BalancedMode;
         Game1.showGlobalMessage("Balanced Mode: " + Config.BalancedMode);
     }
 }
Example #13
0
 private void ControlEvents_KeyPressed(object sender, EventArgsKeyPressed e)
 {
     if (Game1.activeClickableMenu is TitleMenu &&
         e.KeyPressed == Keys.Escape)
     {
         (Game1.activeClickableMenu as TitleMenu)?.skipToTitleButtons();
         ControlEvents.KeyPressed -= ControlEvents_KeyPressed;
     }
 }
        /// <summary>The method invoked when the player presses a keyboard button.</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event arguments.</param>
        private void ControlEvents_KeyPressed(object sender, EventArgsKeyPressed e)
        {
            if (!Game1.hasLoadedGame)
            {
                return;
            }

            this.ReceiveKeyPress(e.KeyPressed, this.Config.Keyboard);
        }
 private void ControlEvents_KeyReleased(object sender, EventArgsKeyPressed e)
 {
     if (e.KeyPressed == Keys.PageUp)
     {
         speedup = false;
         seconds = 20;
         Game1.player.addedSpeed = 0;
     }
 }
Example #16
0
        public void checkToggle(object sender, EventArgs args)
        {
            EventArgsKeyPressed pressed = args as EventArgsKeyPressed;

            if (pressed.KeyPressed == Config.ToggleDisplay.key)
            {
                show = !show;
            }
        }
        private void ControlEvents_KeyPressed(object sender, EventArgsKeyPressed e)
        {
            string key = e.KeyPressed.ToString();

            if (key == "P" && Game1.activeClickableMenu is PortraitureDialogueBoxNew)
            {
                ImageHelper.nextFolder();
            }
        }
        private void KeyPressed(object sender, EventArgsKeyPressed e)
        {
            string key = e.KeyPressed.ToString().ToLower();

            if (key == this.config.ActivationKey.ToLower())
            {
                this.StackOwnInventory();
            }
        }
Example #19
0
        private void ReceiveKeyPress(object sender, EventArgsKeyPressed e)
        {
            Farmer f = Game1.player;

            if (e.KeyPressed == Microsoft.Xna.Framework.Input.Keys.LeftShift)
            {
                f.currentLocation.explode(f.getTileLocation(), config.radius, f);
            }
        }
Example #20
0
        private void Events_KeyPressed(object sender, EventArgsKeyPressed e)
        {
            if (!CJBCheatsMenu.IsLoaded)
            {
                return;
            }

            Cheats.OnKeyPress(e.KeyPressed);
        }
Example #21
0
        /// <summary>The method invoked when the player presses a keyboard button.</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event arguments.</param>
        private void ControlEvents_KeyPressed(object sender, EventArgsKeyPressed e)
        {
            if (!Context.IsWorldReady)
            {
                return;
            }

            this.ReceiveKeyPress(e.KeyPressed, this.Config.Keyboard);
        }
 private void ControlEvents_KeyReleased(object sender, EventArgsKeyPressed e)
 {
     if (e.KeyPressed == config.actionKey)
     {
         RingOfFire.active = false;
         StardewValley.Farmer f = Game1.player;
         f.stopJittering();
     }
 }
        /// <summary>The method invoked when the player presses a key.</summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The event arguments.</param>
        private void OnKeyPressed(object sender, EventArgsKeyPressed e)
        {
            bool handled = this.ReceiveKeyPress(e.KeyPressed);

            if (handled)
            {
                Game1.oldKBState = Keyboard.GetState();
            }
        }
Example #24
0
 private void ControlEvents_KeyPress(object sender, EventArgsKeyPressed e)
 {
     if (Context.IsWorldReady)   // save is loaded
     {
         if (e.KeyPressed == config.WarpKey)
         {
             WarpAllAnimalsHome();
         }
     }
 }
Example #25
0
 private void ControlEvents_KeyPressed(object sender, EventArgsKeyPressed e)
 {
     if (e.KeyPressed.ToString() == CJBEndlessInventory.Settings.MenuButton)
     {
         if (Game1.hasLoadedGame && Game1.activeClickableMenu == null && Game1.player.CanMove && !Game1.dialogueUp && !Game1.eventUp)
         {
             ItemMenu.Open();
         }
     }
 }
Example #26
0
 private void Events_KeyPressed(object sender, EventArgsKeyPressed e)
 {
     if (e.KeyPressed == Microsoft.Xna.Framework.Input.Keys.I)
     {
         if (Game1.hasLoadedGame && Game1.activeClickableMenu == null && Game1.player.CanMove && !Game1.dialogueUp && !Game1.eventUp)
         {
             ItemMenu.Open();
         }
     }
 }
 public static void ControlEvents_KeyPressed(object sender, EventArgsKeyPressed e)
 {
     if (Tests.RunningTests)
     {
         if (e.KeyPressed.Equals(Keys.G))
         {
             Tests.GiveFish();
         }
     }
 }
Example #28
0
 private void ControlEvents_KeyPressed(object sender, EventArgsKeyPressed e)
 {
     switch (e.KeyPressed)
     {
     case Keys.N:
         Config.BalancedMode = !Config.BalancedMode;
         Game1.showGlobalMessage("Balanced Mode: " + Config.BalancedMode);
         break;
     }
 }
Example #29
0
 private void ControlEvents_KeyPressed(object sender, EventArgsKeyPressed e)
 {
     if (e.KeyPressed == Global.Config.SaveBindingKey)
     {
         Save();
     }
     else if (e.KeyPressed == Global.Config.LoadBindingKey)
     {
         Load();
     }
 }
Example #30
0
        /// <summary>The method invoked when the player presses a keyboard button.</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event data.</param>
        private void ReceiveKeyPress(object sender, EventArgsKeyPressed e)
        {
            // handle hotkey
            this.HandleInput(e.KeyPressed, this.Config.Keyboard);

            // suppress dangerous actions
            if (this.DebugMode && !this.Config.AllowDangerousCommands)
            {
                this.SuppressKeyIfDangerous(e.KeyPressed);
            }
        }