From 0dca56e6ae14d17ba374dd50879f1ba4ba176778 Mon Sep 17 00:00:00 2001 From: TheGreenTie Date: Sat, 29 Feb 2020 19:37:42 -0600 Subject: [PATCH] Plus and minus shortcuts work now. --- Project/DexTool/DexTool.yyp | 23 +++++++++++------ .../button_plusminus_shortcut.gml | 25 +++++++++++++++++++ .../button_plusminus_shortcut.yy | 8 ++++++ .../scripts/shortcut_check/shortcut_check.gml | 14 ++++++++++- .../e8dd30c9-50fd-43ce-9594-4568eb99fad7.yy | 3 ++- 5 files changed, 64 insertions(+), 9 deletions(-) create mode 100644 Project/DexTool/scripts/button_plusminus_shortcut/button_plusminus_shortcut.gml create mode 100644 Project/DexTool/scripts/button_plusminus_shortcut/button_plusminus_shortcut.yy diff --git a/Project/DexTool/DexTool.yyp b/Project/DexTool/DexTool.yyp index 40f7cea..58000e8 100644 --- a/Project/DexTool/DexTool.yyp +++ b/Project/DexTool/DexTool.yyp @@ -7490,7 +7490,7 @@ "Key": "4a34078c-7fa4-d9ca-eb35-df0a0ce93667", "Value": { "id": "a4aed7b8-3569-686e-86ea-ff5c94787515", - "resourcePath": "scripts/box_gen_jump/box_gen_jump.yy", + "resourcePath": "scripts\/box_gen_jump\/box_gen_jump.yy", "resourceType": "GMScript" } }, @@ -8178,7 +8178,7 @@ "Key": "51d00fa8-eb85-4086-a732-a161d9d217d8", "Value": { "id": "85207e30-7cc0-3776-b034-06e06a4b170a", - "resourcePath": "scripts/button_set/button_set.yy", + "resourcePath": "scripts\/button_set\/button_set.yy", "resourceType": "GMScript" } }, @@ -11138,7 +11138,7 @@ "Key": "6ee30c99-62bc-bcf5-3853-e159533ab6d0", "Value": { "id": "c2bb0f39-a2d2-3f48-0435-8f8ddcd09621", - "resourcePath": "scripts/button_align_x/button_align_x.yy", + "resourcePath": "scripts\/button_align_x\/button_align_x.yy", "resourceType": "GMScript" } }, @@ -14674,7 +14674,7 @@ "Key": "9081971b-e1be-521f-34be-38fcfa32f684", "Value": { "id": "5556752a-d72e-8013-c6ef-9fc461634e8e", - "resourcePath": "scripts/button_align_y/button_align_y.yy", + "resourcePath": "scripts\/button_align_y\/button_align_y.yy", "resourceType": "GMScript" } }, @@ -15210,7 +15210,7 @@ "Key": "961739d9-bcef-9d3d-a9a7-6d0487191e8e", "Value": { "id": "cf68e563-92be-d148-9a63-2bb86baa8cc2", - "resourcePath": "scripts/icon_path_get/icon_path_get.yy", + "resourcePath": "scripts\/icon_path_get\/icon_path_get.yy", "resourceType": "GMScript" } }, @@ -17950,6 +17950,14 @@ "resourceType": "GMIncludedFile" } }, + { + "Key": "b0a1886d-571c-9ed1-098f-65abb5bf18f6", + "Value": { + "id": "243c92c8-0408-f017-20a5-e72b33590e32", + "resourcePath": "scripts\\button_plusminus_shortcut\\button_plusminus_shortcut.yy", + "resourceType": "GMScript" + } + }, { "Key": "b0a8a7ac-b59f-4507-a4cc-ebea07d4862f", "Value": { @@ -22714,7 +22722,7 @@ "Key": "e10f4338-d865-41ce-6c7c-ffe8b9302bc2", "Value": { "id": "bc9ef1b6-6c89-650e-c291-a4ffb4d4cd96", - "resourcePath": "scripts/savedata_read_real/savedata_read_real.yy", + "resourcePath": "scripts\/savedata_read_real\/savedata_read_real.yy", "resourceType": "GMScript" } }, @@ -25688,7 +25696,8 @@ "e10f4338-d865-41ce-6c7c-ffe8b9302bc2", "5d6dc131-402b-45b8-c0ee-331d3e8a9908", "c6341f0c-570d-0e72-8439-2672f5cbb32e", - "4a34078c-7fa4-d9ca-eb35-df0a0ce93667" + "4a34078c-7fa4-d9ca-eb35-df0a0ce93667", + "b0a1886d-571c-9ed1-098f-65abb5bf18f6" ], "tutorial": "" } \ No newline at end of file diff --git a/Project/DexTool/scripts/button_plusminus_shortcut/button_plusminus_shortcut.gml b/Project/DexTool/scripts/button_plusminus_shortcut/button_plusminus_shortcut.gml new file mode 100644 index 0000000..072567e --- /dev/null +++ b/Project/DexTool/scripts/button_plusminus_shortcut/button_plusminus_shortcut.gml @@ -0,0 +1,25 @@ +///button_plusminus_shortcut(button, pressed?) + +var button = argument0; +var pressed = argument1; + +if (instance_exists(obj_lock)) +{ + switch(button) + { + case but.plus: var hold = obj_lock.plus; break; + case but.minus: var hold = obj_lock.minus; break; + + default: + show_debug_message("ERROR: Wrong parameter assignment."); + return; + break; + } + + hold.hover = true; + hold.pressed = pressed; + + if (pressed) + with (hold) + button_do(type); +} \ No newline at end of file diff --git a/Project/DexTool/scripts/button_plusminus_shortcut/button_plusminus_shortcut.yy b/Project/DexTool/scripts/button_plusminus_shortcut/button_plusminus_shortcut.yy new file mode 100644 index 0000000..d355dc8 --- /dev/null +++ b/Project/DexTool/scripts/button_plusminus_shortcut/button_plusminus_shortcut.yy @@ -0,0 +1,8 @@ +{ + "id": "b0a1886d-571c-9ed1-098f-65abb5bf18f6", + "modelName": "GMScript", + "mvc": "1.0", + "name": "button_plusminus_shortcut", + "IsCompatibility": false, + "IsDnD": false +} \ No newline at end of file diff --git a/Project/DexTool/scripts/shortcut_check/shortcut_check.gml b/Project/DexTool/scripts/shortcut_check/shortcut_check.gml index 4ea839c..ca23116 100644 --- a/Project/DexTool/scripts/shortcut_check/shortcut_check.gml +++ b/Project/DexTool/scripts/shortcut_check/shortcut_check.gml @@ -1,9 +1,21 @@ ///shortcut_check() +// Letters if (keyboard_check_pressed(ord("G"))) show_galar_toggle(); else if (keyboard_check_pressed(ord("I"))) make_screenshot(); else if (keyboard_check_pressed(ord("S"))) show_shiny_toggle(); -else for (var i=ord("0"); i<=ord("9"); i++) +// Plus and Minus +var key_plus = 107; +var key_minus = 109; + + if (keyboard_check_pressed( key_plus)) button_plusminus_shortcut(but.plus, true); +else if (keyboard_check_released(key_plus)) button_plusminus_shortcut(but.plus, false); + + if (keyboard_check_pressed( key_minus)) button_plusminus_shortcut(but.minus, true); +else if (keyboard_check_released(key_minus)) button_plusminus_shortcut(but.minus, false); + +// Numbers 0-9 +for (var i=ord("0"); i<=ord("9"); i++) if (keyboard_check_pressed(i)) box_gen_jump(i - ord("0")); \ No newline at end of file diff --git a/Project/DexTool/views/e8dd30c9-50fd-43ce-9594-4568eb99fad7.yy b/Project/DexTool/views/e8dd30c9-50fd-43ce-9594-4568eb99fad7.yy index 1cbc517..5735078 100644 --- a/Project/DexTool/views/e8dd30c9-50fd-43ce-9594-4568eb99fad7.yy +++ b/Project/DexTool/views/e8dd30c9-50fd-43ce-9594-4568eb99fad7.yy @@ -61,7 +61,8 @@ "e10f4338-d865-41ce-6c7c-ffe8b9302bc2", "5d6dc131-402b-45b8-c0ee-331d3e8a9908", "c6341f0c-570d-0e72-8439-2672f5cbb32e", - "4a34078c-7fa4-d9ca-eb35-df0a0ce93667" + "4a34078c-7fa4-d9ca-eb35-df0a0ce93667", + "b0a1886d-571c-9ed1-098f-65abb5bf18f6" ], "filterType": "GMScript", "folderName": "scripts",