From 01eb56d42ddda170e147f50024804383da1df34d Mon Sep 17 00:00:00 2001 From: John Alanbrook Date: Sun, 5 Feb 2023 17:40:59 +0000 Subject: [PATCH] add grid, window ffi commands --- source/engine/ffi.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/source/engine/ffi.c b/source/engine/ffi.c index e9128db..15a44c0 100644 --- a/source/engine/ffi.c +++ b/source/engine/ffi.c @@ -172,6 +172,7 @@ duk_ret_t duk_nuke(duk_context *duk) int cmd = duk_to_int(duk, 0); float editnum; int editint; + char textbox[130]; switch(cmd) { case 0: @@ -205,6 +206,12 @@ duk_ret_t duk_nuke(duk_context *duk) case 6: duk_push_boolean(duk, nuke_btn(duk_to_string(duk, 1))); return 1; + + case 7: + strncpy(textbox, duk_to_string(duk, 1), 130); + nuke_edit_str(textbox); + duk_push_string(duk, textbox); + return 1; } return 0; @@ -464,6 +471,18 @@ duk_ret_t duk_cmd(duk_context *duk) { case 46: set_mouse_mode(duk_to_int(duk, 1)); return 0; + + case 47: + draw_grid(duk_to_int(duk, 1), duk_to_int(duk, 2)); + return 0; + + case 48: + duk_push_int(duk, mainwin->width); + return 1; + + case 49: + duk_push_int(duk, mainwin->height); + return 1; } return 0;