small fixes + new util

This commit is contained in:
Doze-Zoze authored and Cameron Ewell committed 2026-07-07 21:05:24 -04:00
1 parent 193a1e3593
commit 6bd8325bde
2 files changed
+13

No files matched your search

+11
View File
@@ -1,7 +1,9 @@
using System;
using System.Linq;
using CalamityMod.Systems.Collections;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.GameInput;
using Terraria.ModLoader;
namespace CalamityMod
@@ -212,5 +214,14 @@ namespace CalamityMod
return CalamityKeybinds.AccessoryKeybinds[keybindToUse];
}
public static bool HasBoundDynamicHotkey(this Item item)
{
var h = item.GetDynamicModHotkey();
if (h == null) return false;
if (h?.GetAssignedKeysOrEmpty(PlayerInput.CurrentInputMode).Count() == 0)
return false;
return true;
}
}
}
+2
View File
@@ -314,6 +314,8 @@ namespace CalamityMod
try
{
if (mode == InputMode.Mouse)
mode = InputMode.Keyboard;
return keybind.GetAssignedKeys(mode);
}
catch