summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMatheus <matheus.guedes.mg.m@gmail.com>2025-09-15 12:57:19 -0300
committerMatheus <matheus.guedes.mg.m@gmail.com>2025-09-15 12:57:19 -0300
commitbefb39054656e3242e9408f2afe8c902df471ffa (patch)
treeafdcc958bd04f8fb92ae5f7dec5cda43421cff3b /scripts
parentbd88d4f04555a0619d06b2fc4e5ec9a0114716c1 (diff)
Finalmente atalhos
Diffstat (limited to 'scripts')
-rw-r--r--scripts/GUI/ItemMenuEntry.cs27
-rw-r--r--scripts/GUI/SpellMenuEntry.cs14
2 files changed, 41 insertions, 0 deletions
diff --git a/scripts/GUI/ItemMenuEntry.cs b/scripts/GUI/ItemMenuEntry.cs
index 7ee3fcd..7070b21 100644
--- a/scripts/GUI/ItemMenuEntry.cs
+++ b/scripts/GUI/ItemMenuEntry.cs
@@ -1,3 +1,4 @@
+using System.Xml;
using Godot;
using TheLegendOfGustav.Entities.Items;
@@ -38,6 +39,32 @@ public partial class ItemMenuEntry : HBoxContainer
if (shortcut != null)
{
ShortcutLabel.Text = $"{shortcut}";
+
+
+ int index = (int)shortcut - 'a';
+ InputEventKey activateEvent = new()
+ {
+ Keycode = Key.A + index
+ };
+
+ InputEventKey dropEvent = new()
+ {
+ Keycode = Key.A + index,
+ ShiftPressed = true
+ };
+
+ Shortcut shortie = new()
+ {
+ Events = [activateEvent]
+ };
+
+ Shortcut dropperino = new()
+ {
+ Events = [dropEvent]
+ };
+
+ ActivateBtn.Shortcut = shortie;
+ DropBtn.Shortcut = dropperino;
}
else
{
diff --git a/scripts/GUI/SpellMenuEntry.cs b/scripts/GUI/SpellMenuEntry.cs
index 2be0fcc..de71f2a 100644
--- a/scripts/GUI/SpellMenuEntry.cs
+++ b/scripts/GUI/SpellMenuEntry.cs
@@ -33,6 +33,20 @@ public partial class SpellMenuEntry : HBoxContainer
if (shortcut != null)
{
shortcutLabel.Text = $"{shortcut}";
+
+ int index = (int)shortcut - 'a';
+
+ InputEventKey activateEvent = new()
+ {
+ Keycode = Key.A + index
+ };
+
+ Shortcut shortie = new()
+ {
+ Events = [activateEvent]
+ };
+
+ castBtn.Shortcut = shortie;
}
else
{