diff --git a/exp_scenario/module/gui/calculator.lua b/exp_scenario/module/gui/calculator.lua index 0da20388..dea93358 100644 --- a/exp_scenario/module/gui/calculator.lua +++ b/exp_scenario/module/gui/calculator.lua @@ -69,11 +69,12 @@ Elements.calculator_result_label = Gui.define("calculator/result_label") style = "heading_2_label", } ---- Empty new line label -Elements.calculator_label_1 = Gui.define("calculator/label_1") +--- Info label +Elements.calculator_info_label = Gui.define("calculator/info_label") :draw{ type = "label", - caption = "", + caption = "[virtual-signal=signal-info]", + tooltip = {"exp-gui_calculator.info_tooltip"}, style = "heading_2_label", } @@ -85,7 +86,7 @@ Elements.container = Gui.define("calculator/container") Elements.calculator_function_label(screen_frame) Elements.calculator_input_textfield(screen_frame) Elements.calculator_result_label(screen_frame) - Elements.calculator_label_1(screen_frame) + Elements.calculator_info_label(screen_frame) return Gui.elements.screen_frame.get_root_element(screen_frame) end) @@ -94,7 +95,7 @@ Elements.container = Gui.define("calculator/container") Gui.toolbar.create_button{ name = "open_calculator", sprite = "entity/arithmetic-combinator", - tooltip = { "exp-gui_calculator.tooltip" }, + tooltip = {"exp-gui_calculator.tooltip"}, visible = function(player, element) return Roles.player_has_permission(player, "exp-gui_calculator") end @@ -319,7 +320,7 @@ function Elements.parse(expression) return value end) - return ok and format_number(result, false) or (type(result) == "table" and result or {"", {"exp-gui_calculator.error"}, tostring(result)}) + return ok and ("= " .. format_number(result, false)) or (type(result) == "table" and result or {"", {"exp-gui_calculator.error"}, tostring(result)}) end --- Value change diff --git a/exp_scenario/module/locale/en.cfg b/exp_scenario/module/locale/en.cfg index 2e55bca0..c63a97f1 100644 --- a/exp_scenario/module/locale/en.cfg +++ b/exp_scenario/module/locale/en.cfg @@ -260,6 +260,7 @@ inserted=Inserted __1__ __2__ into __3__ [exp-gui_calculator] tooltip=Calculator +info_tooltip=Supported Operators: + - * / % () ^ **\nSuffix: K M G T P\nBase: 0x 0b 0o\nFunction: ABS, CEIL, EXP, FLOOR, LN, LOG, ROUND, SQRT, TRUNC error=[ERROR] factorial_neg=Factorial of a negative number __1__ factorial_large=Factorial too large __1__ diff --git a/exp_scenario/module/locale/zh-CN.cfg b/exp_scenario/module/locale/zh-CN.cfg index 5b87b226..843db3bb 100644 --- a/exp_scenario/module/locale/zh-CN.cfg +++ b/exp_scenario/module/locale/zh-CN.cfg @@ -262,6 +262,7 @@ inserted=自動填入 __1__ __2__ 到 __3__ [exp-gui_calculator] tooltip=計算機 +info_tooltip=支援的運算符: + - * / % () ^ **\n後綴: K M G T P\n進制: 0x 0b 0o\n函數: ABS, CEIL, EXP, FLOOR, LN, LOG, ROUND, SQRT, TRUNC error=[錯誤] factorial_neg=負數的階乘 __1__ factorial_large=階乘太大 __1__ diff --git a/exp_scenario/module/locale/zh-TW.cfg b/exp_scenario/module/locale/zh-TW.cfg index 5b87b226..843db3bb 100644 --- a/exp_scenario/module/locale/zh-TW.cfg +++ b/exp_scenario/module/locale/zh-TW.cfg @@ -262,6 +262,7 @@ inserted=自動填入 __1__ __2__ 到 __3__ [exp-gui_calculator] tooltip=計算機 +info_tooltip=支援的運算符: + - * / % () ^ **\n後綴: K M G T P\n進制: 0x 0b 0o\n函數: ABS, CEIL, EXP, FLOOR, LN, LOG, ROUND, SQRT, TRUNC error=[錯誤] factorial_neg=負數的階乘 __1__ factorial_large=階乘太大 __1__