コード例 #1
0
 /// <summary>Returns whether a known Tool Button is still being held.</summary>
 /// <param name="clickOnly">Whether to only check for mouse Tool Buttons.</param>
 public static bool holdingToolButton(bool clickOnly = false)
 {
     foreach (SButton button in knownToolButtons)
         if (myInput.IsDown(button)
          && (!clickOnly || button.ToString().Contains("Mouse"))
          && button.IsUseToolButton()) // Double-check in case it changed
             return true;
     
     return false;
 }
コード例 #2
0
ファイル: ModEntry.cs プロジェクト: somnomania/smapi-mod-dump
        /// <summary>Raised after the player presses a button on the keyboard, controller, or mouse.</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event data.</param>
        public void OnButtonPressed(object sender, EventArgs e)
        {
            if (!Context.IsPlayerFree || Game1.activeClickableMenu != null)
            {
                return;
            }

            IInputHelper input = this.Helper.Input;

            if (input.IsDown(config.DecreaseKey) && input.IsDown(config.IncreaseKey))
            {
                return;
            }
            else if (input.IsDown(config.DecreaseKey))
            {
                AddValueToHealing(-0.1);
            }
            else if (input.IsDown(config.IncreaseKey))
            {
                AddValueToHealing(0.1);
            }
        }
コード例 #3
0
 internal static bool IsCombineKeyHeld(IInputHelper InputHelper)
 {
     return(UserConfig.CombineKeys.Any(x => InputHelper.IsDown(x)));
 }