From b1c3386ca4032ac5925969d759ae2e5bc015d1f8 Mon Sep 17 00:00:00 2001 From: "U-DESKTOP-FOJ6TK1\\Alex" Date: Wed, 12 Feb 2025 17:25:25 -0600 Subject: Final commit --- client/data/init.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'client/data/init.lua') diff --git a/client/data/init.lua b/client/data/init.lua index d6ec4f0..fabd5f1 100644 --- a/client/data/init.lua +++ b/client/data/init.lua @@ -37,6 +37,7 @@ multibox:set_multiline(true) multibox:setvisible(false) multibox_donebut = gui.newbutton({{w-100,h-100},{w-20,h-80}},"Done") multibox_donebut:setvisible(false) +cmdbox:focus() --width=200,height=120 function out(text) @@ -69,6 +70,13 @@ local cmd_hooks = {} function add_cmdbox_hook(func) table.insert(cmd_hooks,func) end +local cmds +cmdbox.onChange = function() + for k,v in pairs(cmd_hooks) do + v(cmdbox) + end +end + local fail_anim = 0 local fail_queue = {} function fail_hint(...) @@ -102,12 +110,6 @@ function GAME.drawPostGui() end -local cmds -cmdbox.onChange = function() - for k,v in pairs(cmd_hooks) do - v(cmdbox) - end -end --function command_over(text) --end @@ -130,7 +132,7 @@ local function run_command() if command_over then command_over(command) else - if cmds[root] then + if cmds[root] and cmds["can_" .. root] and cmds["can_" .. root]() then print("found command, calling with:") for k,v in pairs(parts) do print(k,":",v) -- cgit v1.2.3-70-g09d2