From f846979e11bcf55aedf406aa5f1ac0e8bc243744 Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Tue, 17 Nov 2026 18:55:28 +0900 Subject: [PATCH] . --- exp_scenario/module/gui/calculator.lua | 16 +++++----------- exp_scenario/module/locale/en.cfg | 3 +-- exp_scenario/module/locale/zh-CN.cfg | 3 +-- exp_scenario/module/locale/zh-TW.cfg | 3 +-- 4 files changed, 8 insertions(+), 17 deletions(-) diff --git a/exp_scenario/module/gui/calculator.lua b/exp_scenario/module/gui/calculator.lua index 40deb0c0..be2f4707 100644 --- a/exp_scenario/module/gui/calculator.lua +++ b/exp_scenario/module/gui/calculator.lua @@ -74,15 +74,6 @@ Elements.calculator_info_label = Gui.define("calculator/info_label") single_line = false } ---- Container Info -Elements.container_info = Gui.define("calculator/container_info") - :draw{function(def, parent) - local screen_frame = Gui.elements.screen_frame(parent, nil, true) - Gui.elements.header(screen_frame, { caption = { "exp-gui_calculator.info_tooltip" } }) - Elements.calculator_info_label(screen_frame) - return Gui.elements.screen_frame.get_root_element(screen_frame) - end} - --- Info button Elements.calculator_info_button = Gui.define("calculator/info_button") :draw{ @@ -93,8 +84,10 @@ Elements.calculator_info_button = Gui.define("calculator/info_button") name = "calculator_info_button", } :on_click(function(def, player) - Elements.container_info(player.gui.screen) - end) --[[@as any]] + for _, label in Elements.calculator_info_label:tracked_elements(player) do + label.visible = not label.visible + end + end) --- Input textfield Elements.calculator_input_textfield = Gui.define("calculator/input_textfield") @@ -122,6 +115,7 @@ Elements.container = Gui.define("calculator/container") Elements.calculator_info_button(header) Elements.calculator_input_textfield(screen_frame) Elements.calculator_result_label(screen_frame) + Elements.calculator_info_label(screen_frame).visible = false return Gui.elements.screen_frame.get_root_element(screen_frame) end) diff --git a/exp_scenario/module/locale/en.cfg b/exp_scenario/module/locale/en.cfg index 9b576a3e..0b21c793 100644 --- a/exp_scenario/module/locale/en.cfg +++ b/exp_scenario/module/locale/en.cfg @@ -271,8 +271,7 @@ inserted=Inserted __1__ __2__ into __3__ [exp-gui_calculator] tooltip=Calculator -info_tooltip=Calculator Info -info_caption=Supported Operators: + - * / % () ^ ** !\nPrefix: K M G T P\nBase: 0x 0b 0o\nFunction: ABS, CEIL, EXP, FLOOR, LN, LOG, ROUND, SQRT, TRUNC +caption=Supported Operators: + - * / % () ^ ** !\nPrefix: K M G T P\nBase: 0x 0b 0o\nFunction: ABS, CEIL, EXP, FLOOR, LN, LOG, ROUND, SQRT, TRUNC error=[ERROR] input_too_long=Input too long factorial_neg=Factorial of a negative number __1__ diff --git a/exp_scenario/module/locale/zh-CN.cfg b/exp_scenario/module/locale/zh-CN.cfg index 8c78f53f..7021f952 100644 --- a/exp_scenario/module/locale/zh-CN.cfg +++ b/exp_scenario/module/locale/zh-CN.cfg @@ -273,8 +273,7 @@ inserted=自動填入 __1__ __2__ 到 __3__ [exp-gui_calculator] tooltip=計算機 -info_tooltip=計算機資訊 -info_caption=支援的運算符: + - * / % () ^ ** !\n詞頭: K M G T P\n進制: 0x 0b 0o\n函數: ABS, CEIL, EXP, FLOOR, LN, LOG, ROUND, SQRT, TRUNC +caption=支援的運算符: + - * / % () ^ ** !\n詞頭: K M G T P\n進制: 0x 0b 0o\n函數: ABS, CEIL, EXP, FLOOR, LN, LOG, ROUND, SQRT, TRUNC error=[錯誤] input_too_long=輸入太長 factorial_neg=負數的階乘 __1__ diff --git a/exp_scenario/module/locale/zh-TW.cfg b/exp_scenario/module/locale/zh-TW.cfg index 8c78f53f..7021f952 100644 --- a/exp_scenario/module/locale/zh-TW.cfg +++ b/exp_scenario/module/locale/zh-TW.cfg @@ -273,8 +273,7 @@ inserted=自動填入 __1__ __2__ 到 __3__ [exp-gui_calculator] tooltip=計算機 -info_tooltip=計算機資訊 -info_caption=支援的運算符: + - * / % () ^ ** !\n詞頭: K M G T P\n進制: 0x 0b 0o\n函數: ABS, CEIL, EXP, FLOOR, LN, LOG, ROUND, SQRT, TRUNC +caption=支援的運算符: + - * / % () ^ ** !\n詞頭: K M G T P\n進制: 0x 0b 0o\n函數: ABS, CEIL, EXP, FLOOR, LN, LOG, ROUND, SQRT, TRUNC error=[錯誤] input_too_long=輸入太長 factorial_neg=負數的階乘 __1__