From 90a2683e7ebeb1075cadce7241b774f969bcdf64 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Wed, 18 Mar 2026 23:13:15 +0300 Subject: [PATCH] update gui.ask --- res/modules/internal/gui_util.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/res/modules/internal/gui_util.lua b/res/modules/internal/gui_util.lua index 3309e94a0..0f53faaba 100644 --- a/res/modules/internal/gui_util.lua +++ b/res/modules/internal/gui_util.lua @@ -169,9 +169,11 @@ function gui.show_input_dialog(text, actual_callback, validator, confirm_text) end -function gui.ask(text, on_yes, on_no) +function gui.ask(text, on_yes, on_no, yes_text, no_text) on_yes = on_yes or function() end on_no = on_no or function() end + yes_text = yes_text == "" and "Yes" or (yes_text or "Yes") + no_text = no_text or "No" local id = "dialog_"..random.uuid() @@ -188,11 +190,12 @@ function gui.ask(text, on_yes, on_no) - - + + - ]], id, string.escape_xml(text)), {on_yes=yes_callback, on_no=no_callback}) + ]], id, string.escape_xml(text)), {on_yes=yes_callback, on_no=no_callback}, + string.escape_xml(yes_text), string.escape_xml(no_text)) input.add_callback("key:escape", no_callback, gui.root[id]) end