diff --git a/.vscode/launch.json b/.vscode/launch.json index 1cbe187..7d33ad6 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -8,9 +8,8 @@ "type": "factoriomod", "request": "launch", "name": "Factorio Mod Debug", - "modsPath": "C:/Program Files/Factorio/mods", - "configPath": "C:/Program Files/Factorio/config/config.ini", - "factorioPath": "C:/Program Files/Factorio/bin/x64/factorio.exe" + "modsPath": "C:\\Users\\stefa\\AppData\\Roaming\\Factorio\\mods", + "disableExtraMods": false // "hookSettings": true, // "hookData": true } diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..56e41ac --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,17 @@ +{ + "factorio.versions": [ + { + "name": "2.0", + "factorioPath": "C:\\Program Files\\Factorio\\bin\\x64\\factorio.exe", + "active": true + }, + { + "name": "Steam", + "factorioPath": "d:\\SteamLibrary\\steamapps\\common\\Factorio\\bin\\x64\\factorio.exe" + } + ], + "Lua.workspace.userThirdParty": [ + "c:\\Users\\stefa\\AppData\\Roaming\\Code\\User\\workspaceStorage\\35847ccd64cb986037e0824286320fb8\\justarandomgeek.factoriomod-debug\\sumneko-3rd" + ], + "Lua.workspace.checkThirdParty": "ApplyInMemory" +} \ No newline at end of file diff --git a/calcui-hotkey.lua b/calcui-hotkey.lua index 610d4df..71b4f3e 100644 --- a/calcui-hotkey.lua +++ b/calcui-hotkey.lua @@ -5,4 +5,4 @@ data:extend({ key_sequence = "CONTROL + SHIFT + C", consuming = "none" } -}) \ No newline at end of file +}) diff --git a/calcui-prototypes.lua b/calcui-prototypes.lua index 73f7e0e..6568086 100644 --- a/calcui-prototypes.lua +++ b/calcui-prototypes.lua @@ -7,13 +7,9 @@ data:extend({ order = "b[blueprints]-h[calculator-ui]", action = "lua", toggleable = true, - icon = - { - filename = "__calculator-ui__/graphics/calculator.png", - priority = "extra-high-no-scale", - size = 64, - scale = 1, - flags = {"icon"} - } + icon = "__calculator-ui__/graphics/calculator.png", + icon_size = 64, + small_icon = "__calculator-ui__/graphics/calculator.png", + small_icon_size = 64 } -}) \ No newline at end of file +}) diff --git a/calculator.lua b/calculator.lua index 1f1baa1..4b88d57 100644 --- a/calculator.lua +++ b/calculator.lua @@ -11,7 +11,7 @@ local nilaus_rant = { "calcui_nilaus_ugghhhh", "utility/cannot_build" } -- ---------------------------------------------------------------- local function play_sfx(player, sfx) if settings.get_player_settings(player)["calcui-sfx"].value then - player.play_sound{ + player.play_sound { path = sfx, volume_modifier = 1.0 } @@ -61,28 +61,28 @@ local function destroy_calculator(player) local root = get_gui_root(player) if root.calcui then root.calcui.destroy() - global.recent_results[player.index] = {} + storage.recent_results[player.index] = {} end end -- ---------------------------------------------------------------- local function fix_oob_ui(player) - if global.gui_position[player.index].x < 0 then - global.gui_position[player.index].x = 0 + if storage.gui_position[player.index].x < 0 then + storage.gui_position[player.index].x = 0 end - if global.gui_position[player.index].y < 0 then - global.gui_position[player.index].y = 0 + if storage.gui_position[player.index].y < 0 then + storage.gui_position[player.index].y = 0 end -- TODO fixed box size, because there is no API call for that local width = 255 local height = 350 - if global.gui_position[player.index].x + width > player.display_resolution.width then - global.gui_position[player.index].x = player.display_resolution.width - width + if storage.gui_position[player.index].x + width > player.display_resolution.width then + storage.gui_position[player.index].x = player.display_resolution.width - width end - if global.gui_position[player.index].y + height > player.display_resolution.height then - global.gui_position[player.index].y = player.display_resolution.height - height + if storage.gui_position[player.index].y + height > player.display_resolution.height then + storage.gui_position[player.index].y = player.display_resolution.height - height end end @@ -90,11 +90,11 @@ end function show_calculator(player) local root = get_gui_root(player) - if not global.recent_results then - global.recent_results = {} + if not storage.recent_results then + storage.recent_results = {} end - if not global.recent_results[player.index] then - global.recent_results[player.index] = {} + if not storage.recent_results[player.index] then + storage.recent_results[player.index] = {} end if not root.calcui then @@ -108,12 +108,12 @@ function show_calculator(player) type = "flow", name = "calcui_flow" }) - flow.style.horizontally_stretchable = "on" + flow.style.horizontally_stretchable = true flow.add({ type = "label", name = "calcui_title", - caption = {"calculator-ui.title"}, + caption = { "calculator-ui.title" }, style = "frame_title" }).drag_target = calcui @@ -123,13 +123,13 @@ function show_calculator(player) name = "calcui_drag" }) widget.drag_target = calcui - widget.style.horizontally_stretchable = "on" + widget.style.horizontally_stretchable = true widget.style.minimal_width = 24 widget.style.natural_height = 24 flow.add({ type = "sprite-button", - sprite = "utility/close_white", + sprite = "utility/close", style = "frame_action_button", name = "calcui_close" }) @@ -154,35 +154,61 @@ function show_calculator(player) }) display.style.width = 212 - local row1 = col1.add({type="flow", name="calcui_col1_row1", direction="horizontal"}) - row1.add({type="sprite-button", style="calcui_button_style_light", caption="CE", name="calcui_button_CE"}).sprite = "sprite_calcui_light" -- CE = Clear Entry (just this line) - row1.add({type="sprite-button", style="calcui_button_style_light", caption="C", name="calcui_button_C"}).sprite = "sprite_calcui_light" -- C = Clear (all, past results as well) - row1.add({type="sprite-button", style="calcui_button_style_light", caption="", name="calcui_button_BS"}).sprite = "sprite_calcui_backspace" - row1.add({type="sprite-button", style="calcui_button_style_light", caption="/", name="calcui_button_DIV"}).sprite = "sprite_calcui_light" - - local row2 = col1.add({type="flow", name="calcui_col1_row2", direction="horizontal"}) - row2.add({type="sprite-button", style="calcui_button_style_dark", caption="7", name="calcui_button_7"}).sprite = "sprite_calcui_dark" - row2.add({type="sprite-button", style="calcui_button_style_dark", caption="8", name="calcui_button_8"}).sprite = "sprite_calcui_dark" - row2.add({type="sprite-button", style="calcui_button_style_dark", caption="9", name="calcui_button_9"}).sprite = "sprite_calcui_dark" - row2.add({type="sprite-button", style="calcui_button_style_light", caption="*", name="calcui_button_MUL"}).sprite = "sprite_calcui_light" - - local row3 = col1.add({type="flow", name="calcui_col1_row3", direction="horizontal"}) - row3.add({type="sprite-button", style="calcui_button_style_dark", caption="4", name="calcui_button_4"}).sprite = "sprite_calcui_dark" - row3.add({type="sprite-button", style="calcui_button_style_dark", caption="5", name="calcui_button_5"}).sprite = "sprite_calcui_dark" - row3.add({type="sprite-button", style="calcui_button_style_dark", caption="6", name="calcui_button_6"}).sprite = "sprite_calcui_dark" - row3.add({type="sprite-button", style="calcui_button_style_light", caption="-", name="calcui_button_SUB"}).sprite = "sprite_calcui_light" - - local row4 = col1.add({type="flow", name="calcui_col1_row4", direction="horizontal"}) - row4.add({type="sprite-button", style="calcui_button_style_dark", caption="1", name="calcui_button_1"}).sprite = "sprite_calcui_dark" - row4.add({type="sprite-button", style="calcui_button_style_dark", caption="2", name="calcui_button_2"}).sprite = "sprite_calcui_dark" - row4.add({type="sprite-button", style="calcui_button_style_dark", caption="3", name="calcui_button_3"}).sprite = "sprite_calcui_dark" - row4.add({type="sprite-button", style="calcui_button_style_light", caption="+", name="calcui_button_ADD"}).sprite = "sprite_calcui_light" - - local row5 = col1.add({type="flow", name="calcui_col1_row5", direction="horizontal"}) - row5.add({type="sprite-button", style="calcui_button_style_light", caption="%", name="calcui_button_PERC"}).sprite = "sprite_calcui_light" - row5.add({type="sprite-button", style="calcui_button_style_dark", caption="0", name="calcui_button_0"}).sprite = "sprite_calcui_dark" - row5.add({type="sprite-button", style="calcui_button_style_dark", caption=".", name="calcui_button_DOT"}).sprite = "sprite_calcui_dark" - row5.add({type="sprite-button", style="calcui_button_style_red", caption="=", name="calcui_button_EQU"}).sprite = "sprite_calcui_red" + local row1 = col1.add({ type = "flow", name = "calcui_col1_row1", direction = "horizontal" }) + row1.add({ + type = "sprite-button", + style = "calcui_button_style_light", + caption = "CE", + tooltip = { "calculator-ui.button_CE" }, + name = + "calcui_button_CE" + }) --.sprite = "sprite_calcui_light" -- CE = Clear Entry (just this line) + row1.add({ type = "sprite-button", style = "calcui_button_style_light", caption = "C", tooltip = { "calculator-ui.button_C" }, name = "calcui_button_C" }).sprite = + "sprite_calcui_light" -- C = Clear (all, past results as well) + row1.add({ type = "sprite-button", style = "calcui_button_style_light", caption = "", tooltip = { "calculator-ui.button_BS" }, name = "calcui_button_BS" }).sprite = + "sprite_calcui_backspace" + row1.add({ type = "sprite-button", style = "calcui_button_style_light", caption = "/", tooltip = { "calculator-ui.button_DIV" }, name = "calcui_button_DIV" }).sprite = + "sprite_calcui_light" + + local row2 = col1.add({ type = "flow", name = "calcui_col1_row2", direction = "horizontal" }) + row2.add({ type = "sprite-button", style = "calcui_button_style_dark", caption = "7", tooltip = { "calculator-ui.button_7" }, name = "calcui_button_7" }).sprite = + "sprite_calcui_dark" + row2.add({ type = "sprite-button", style = "calcui_button_style_dark", caption = "8", tooltip = { "calculator-ui.button_8" }, name = "calcui_button_8" }).sprite = + "sprite_calcui_dark" + row2.add({ type = "sprite-button", style = "calcui_button_style_dark", caption = "9", tooltip = { "calculator-ui.button_9" }, name = "calcui_button_9" }).sprite = + "sprite_calcui_dark" + row2.add({ type = "sprite-button", style = "calcui_button_style_light", caption = "*", tooltip = { "calculator-ui.button_MUL" }, name = "calcui_button_MUL" }).sprite = + "sprite_calcui_light" + + local row3 = col1.add({ type = "flow", name = "calcui_col1_row3", direction = "horizontal" }) + row3.add({ type = "sprite-button", style = "calcui_button_style_dark", caption = "4", tooltip = { "calculator-ui.button_4" }, name = "calcui_button_4" }).sprite = + "sprite_calcui_dark" + row3.add({ type = "sprite-button", style = "calcui_button_style_dark", caption = "5", tooltip = { "calculator-ui.button_5" }, name = "calcui_button_5" }).sprite = + "sprite_calcui_dark" + row3.add({ type = "sprite-button", style = "calcui_button_style_dark", caption = "6", tooltip = { "calculator-ui.button_6" }, name = "calcui_button_6" }).sprite = + "sprite_calcui_dark" + row3.add({ type = "sprite-button", style = "calcui_button_style_light", caption = "-", tooltip = { "calculator-ui.button_SUB" }, name = "calcui_button_SUB" }).sprite = + "sprite_calcui_light" + + local row4 = col1.add({ type = "flow", name = "calcui_col1_row4", direction = "horizontal" }) + row4.add({ type = "sprite-button", style = "calcui_button_style_dark", caption = "1", tooltip = { "calculator-ui.button_1" }, name = "calcui_button_1" }).sprite = + "sprite_calcui_dark" + row4.add({ type = "sprite-button", style = "calcui_button_style_dark", caption = "2", tooltip = { "calculator-ui.button_2" }, name = "calcui_button_2" }).sprite = + "sprite_calcui_dark" + row4.add({ type = "sprite-button", style = "calcui_button_style_dark", caption = "3", tooltip = { "calculator-ui.button_3" }, name = "calcui_button_3" }).sprite = + "sprite_calcui_dark" + row4.add({ type = "sprite-button", style = "calcui_button_style_light", caption = "+", tooltip = { "calculator-ui.button_ADD" }, name = "calcui_button_ADD" }).sprite = + "sprite_calcui_light" + + local row5 = col1.add({ type = "flow", name = "calcui_col1_row5", direction = "horizontal" }) + row5.add({ type = "sprite-button", style = "calcui_button_style_light", caption = "%", tooltip = { "calculator-ui.button_PERC" }, name = "calcui_button_PERC" }).sprite = + "sprite_calcui_light" + row5.add({ type = "sprite-button", style = "calcui_button_style_dark", caption = "0", tooltip = { "calculator-ui.button_0" }, name = "calcui_button_0" }).sprite = + "sprite_calcui_dark" + row5.add({ type = "sprite-button", style = "calcui_button_style_dark", caption = ".", tooltip = { "calculator-ui.button_DOT" }, name = "calcui_button_DOT" }).sprite = + "sprite_calcui_dark" + row5.add({ type = "sprite-button", style = "calcui_button_style_red", caption = "=", tooltip = { "calculator-ui.button_EQU" }, name = "calcui_button_EQU" }).sprite = + "sprite_calcui_red" local col2 = table.add({ type = "flow", @@ -234,14 +260,14 @@ function show_calculator(player) -- use last saved location or center the gui - if not global.gui_position then - global.gui_position = {} + if not storage.gui_position then + storage.gui_position = {} end - if global.gui_position[player.index] then + if storage.gui_position[player.index] then -- fix weird saved positions (out of reach) fix_oob_ui(player) - calcui.location = global.gui_position[player.index] + calcui.location = storage.gui_position[player.index] else calcui.force_auto_center() end @@ -299,7 +325,7 @@ local function process_c_key(player, button) local root = get_gui_root(player) process_ce_key(player, button) root.calcui.calcui_table.calcui_table_col2.calcui_scroll_pane.calcui_result_table.clear() - global.recent_results[player.index] = {} + storage.recent_results[player.index] = {} end -- ---------------------------------------------------------------- @@ -318,12 +344,12 @@ local function draw_recent_table(player) -- drop old table recent.calcui_result_table.clear() - for i, result in ipairs(global.recent_results[player.index]) do + for i, result in ipairs(storage.recent_results[player.index]) do recent.calcui_result_table.add({ type = "label", name = "calcui_copy_equation_" .. i, caption = result["equation"], - tooltip = {"calculator-ui.recent_tooltip"} + tooltip = { "calculator-ui.recent_tooltip" } }) recent.calcui_result_table.add({ type = "label", @@ -394,11 +420,11 @@ local function fix_equation(equation, root) -- fix percentage -- complex equations like "20+10%" = 22, before it was 20.1 -- big thanks to GWulf - result = result:gsub("(%d+)(.)(%d+)%%", function (base, sign, perc) + result = result:gsub("(%d+)(.)(%d+)%%", function(base, sign, perc) if sign == "+" then return base .. "*1." .. perc elseif sign == "-" then - return base .. "*(1-0." ..perc .. ")" + return base .. "*(1-0." .. perc .. ")" elseif sign == "*" then return "(" .. base .. "/100)*" .. perc elseif sign == "/" then @@ -412,11 +438,26 @@ local function fix_equation(equation, root) result = result:gsub(",", ".") result = result:gsub(";", ",") + -- remove thousand separators + result = result:gsub("'", ""); return result, new_equation end -- ---------------------------------------------------------------- +function add_thousand_separator(result) + local left, num, right = string.match(result, '^([^%d]*%d)(%d*)(.-)$') + num = num:reverse():gsub("(%d%d%d)", "%1'"):reverse() + return left .. num .. right +end + +-- ---------------------------------------------------------------- +function is_scientific_notation(result) + -- Check if the number is in scientific notation + return string.match(result, "^[-+]?%d*%.?%d+e[-+]?%d+$") +end + +-- ---------------------------------------------------------------- function process_equal_key(player, button) local root = get_gui_root(player) local original_equation = root.calcui.calcui_table.calcui_table_col1.calcui_display.text; @@ -431,12 +472,34 @@ function process_equal_key(player, button) return load("return " .. equation)() end) root.calcui.calcui_table.calcui_table_col2.calcui_result.calcui_copy_display_result.tooltip = retval + if not (retval == math.huge or retval ~= retval) then status, retval_show = pcall(function() - local result = string.format("%0." .. settings.get_player_settings(player)["calcui-decimal-places"].value .. "f", retval) - if result:len() > tostring(retval):len() then - result = retval + -- Check if the result is in scientific notation + if is_scientific_notation(retval) then + return retval end + + local result = string.format( + "%0." .. settings.get_player_settings(player)["calcui-decimal-places"].value .. "f", retval) + + + -- Add thousand separators + result = add_thousand_separator(result) + + -- Check if extra decimal places need to be removed + local trimmed_result = tostring(retval) + if string.find(trimmed_result, '%.') then + local int, frac = trimmed_result:match("(%d+)%.(%d+)") + if frac then + local truncated_result = int .. + "." .. frac:sub(1, settings.get_player_settings(player)["calcui-decimal-places"].value) + result = add_thousand_separator(truncated_result) + end + else + result = add_thousand_separator(trimmed_result) + end + return result end) else @@ -460,8 +523,8 @@ function process_equal_key(player, button) -- only write in recent table if actually a result if status then -- check first equation and only insert if not the same - if #global.recent_results[player.index] == 0 or global.recent_results[player.index][1]["equation"] ~= original_equation then - table.insert(global.recent_results[player.index], 1, { + if #storage.recent_results[player.index] == 0 or storage.recent_results[player.index][1]["equation"] ~= original_equation then + table.insert(storage.recent_results[player.index], 1, { equation = original_equation, result = retval_show }) @@ -527,7 +590,7 @@ function handle_calcui_click(event, player) if string.sub(event_name, 1, button_prefix_len) == button_prefix then show_rant(player, false) - button = string.sub(event_name, button_prefix_len + 1 ) + button = string.sub(event_name, button_prefix_len + 1) debug_print("handle_calcui_click button " .. button) local dispatch_func = button_dispatch[button] if dispatch_func then @@ -538,23 +601,25 @@ function handle_calcui_click(event, player) if addchar then display_addchar(player, addchar) end - -- close button + -- close button elseif event_name == "calcui_close" then hide_calculator(player) - -- copy results + -- copy results elseif string.sub(event_name, 1, copy_prefix_len) == copy_prefix then if event.button == defines.mouse_button_type.left and - event.shift == true then + event.shift == true then -- copy equation or result to display local root = get_gui_root(player) if event_name == "calcui_copy_display_result" then - root.calcui.calcui_table.calcui_table_col1.calcui_display.text = root.calcui.calcui_table.calcui_table_col2.calcui_result.calcui_copy_display_result.caption + root.calcui.calcui_table.calcui_table_col1.calcui_display.text = root.calcui.calcui_table + .calcui_table_col2.calcui_result.calcui_copy_display_result.caption else - root.calcui.calcui_table.calcui_table_col1.calcui_display.text = root.calcui.calcui_table.calcui_table_col2.calcui_scroll_pane.calcui_result_table[event_name].caption + root.calcui.calcui_table.calcui_table_col1.calcui_display.text = root.calcui.calcui_table + .calcui_table_col2.calcui_scroll_pane.calcui_result_table[event_name].caption end end focus_on_input(player) - -- if else focus on focus on display + -- if else focus on focus on display else focus_on_input(player) end @@ -566,7 +631,8 @@ function calcui_on_gui_text_changed(event) local player = game.players[event.player_index] local root = get_gui_root(player) if string.find(root.calcui.calcui_table.calcui_table_col1.calcui_display.text, "=") then - root.calcui.calcui_table.calcui_table_col1.calcui_display.text = root.calcui.calcui_table.calcui_table_col1.calcui_display.text:gsub("=", "") + root.calcui.calcui_table.calcui_table_col1.calcui_display.text = root.calcui.calcui_table.calcui_table_col1 + .calcui_display.text:gsub("=", "") process_equal_key(player) end end @@ -575,9 +641,9 @@ end -- ---------------------------------------------------------------- function calcui_on_gui_location_changed(event) if event.element.name == "calcui" then - if not global.gui_position then - global.gui_position = {} + if not storage.gui_position then + storage.gui_position = {} end - global.gui_position[event.player_index] = event.element.location + storage.gui_position[event.player_index] = event.element.location end -end \ No newline at end of file +end diff --git a/changelog.txt b/changelog.txt index b2c7ca9..0b726f1 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,14 @@ --------------------------------------------------------------------------------------------------- +Version: 2.0.0 +Date: 2024-10-29 + Info: + - Updated the version for Factorio 2.0 + Features: + - Added thousand seperators for big numbers, to make it more readable + - Also is now able to display scientific notation correctly (like 1.69e+42) + - Added translations for French, Spanish and German (Thanks to ChatGPT, Feedback is welcome if + something is not sounding correct) +--------------------------------------------------------------------------------------------------- Version: 1.1.1 Date: 2020-11-28 Features: diff --git a/control.lua b/control.lua index 229e6ab..e33b821 100644 --- a/control.lua +++ b/control.lua @@ -13,7 +13,7 @@ end -- ---------------------------------------------------------------- function debug_print(str) - if global.marc_debug then + if storage.marc_debug then game.print(str) end end @@ -21,7 +21,7 @@ end function __FUNC__() return debug.getinfo(2, 'n').name end function debug_log(f, str) - if global.marc_debug then + if storage.marc_debug then game.print(f .. ": " .. str) end end @@ -62,11 +62,11 @@ end -- ---------------------------------------------------------------- local function on_calcui_command(event) if event.parameter == "debug" then - global.calcui_debug = true + storage.calcui_debug = true debug_print("calcui debugging is on") elseif event.parameter == "nodebug" then debug_print("calcui debugging is off") - global.calcui_debug = false + storage.calcui_debug = false elseif event.parameter == nil then game.players[event.player_index].print("please add a parameter") else diff --git a/info.json b/info.json index 131d14e..d9ae7c6 100644 --- a/info.json +++ b/info.json @@ -1,9 +1,11 @@ { "name": "calculator-ui", - "version": "1.1.1", + "version": "2.0.0", "title": "Calculator UI", "author": "Wichu", - "factorio_version": "1.1", - "dependencies": ["base >= 1.1.0"], + "factorio_version": "2.0", + "dependencies": [ + "base >= 2.0.13" + ], "description": "This mod adds a calculator with advanced controls to the UI." } \ No newline at end of file diff --git a/locale/de/config.cfg b/locale/de/config.cfg new file mode 100644 index 0000000..48a820e --- /dev/null +++ b/locale/de/config.cfg @@ -0,0 +1,43 @@ +[shortcut-name] +calcui_4func=Taschenrechner + +[controls] +calcui_hotkey=Fokus auf die Eingabe / Öffnen/Schliessen des Taschenrechners (je nach Eintstellung) + +[mod-setting-name] +calcui-decimal-places=Nachkommastellen +calcui-clear-on-calc=Gleichung nach Berechnung löschen +calcui-shortcut-close=Mit Shortcut schliessen +calcui-nilaus-mode=Nilaus-Modus +calcui-sfx=Soundeffekte + +[mod-settings-description] +calcui-decimal-places=Anzahl der Nachkommastellen im Ergebnis +calcui-clear-on-calc=Soll die Berechnung die Gleichung löschen? +calcui-shortcut-close=Soll das Fenster beim Drücken des Shortcuts geschlossen werden (wahr), oder soll das Eingabefeld fokussiert werden, wenn es bereits geöffnet ist (falsch)? +calcui-nilaus-mode=Bei aktiviertem Nilaus-Modus erscheinen einige spezielle Easter Eggs +calcui-sfx=Wenn aktiviert, werden bei ungewöhnlichen Ergebnissen Soundeffekte abgespielt + +[calculator-ui] +title=Taschenrechner +recent_tooltip=Drücke Umschalt+Linksklick, um es in die aktuelle Gleichung zu kopieren +button_CE=Eingabe löschen +button_C=Löschen +button_BS=Rücktaste +button_DIV=Division +button_7=7 +button_8=8 +button_9=9 +button_MUL=Multiplikation +button_4=4 +button_5=5 +button_6=6 +button_SUB=Subtraktion +button_1=1 +button_2=2 +button_3=3 +button_ADD=Addition +button_PERC=Prozent +button_0=0 +button_DOT=Komma +button_EQU=Gleich \ No newline at end of file diff --git a/locale/en/config.cfg b/locale/en/config.cfg index 9b5c330..833fec3 100644 --- a/locale/en/config.cfg +++ b/locale/en/config.cfg @@ -2,7 +2,7 @@ calcui_4func=Calculator [controls] -calcui_hotkey=Focus on input +calcui_hotkey=Focus on input / Open/Close the calculator (Depending on setting) [mod-setting-name] calcui-decimal-places=Decimal places @@ -13,11 +13,31 @@ calcui-sfx=Sound effects [mod-settings-description] calcui-decimal-places=Number of decimal places in the result -calcui-clear-on-calc=Should trigger the calculation delete the equation? -calcui-shortcut-close=Whether the UI should close as well by pressing the shortcut (when true), or focus on the inputfield when already open (when false) +calcui-clear-on-calc=Should the calculation trigger the equation to be deleted? +calcui-shortcut-close=Should the UI close when the shortcut is pressed (true), or focus on the input field if already open (false)? calcui-nilaus-mode=With Nilaus mode enabled some special easter eggs appear calcui-sfx=When enabled sound effects will be played on strange results [calculator-ui] title=Calculator -recent_tooltip=Press shift+left-click to copy it to current equation \ No newline at end of file +recent_tooltip=Press shift+left-click to copy it to current equation +button_CE=Clear Entry +button_C=Clear +button_BS=Backspace +button_DIV=Division +button_7=7 +button_8=8 +button_9=9 +button_MUL=Multiplication +button_4=4 +button_5=5 +button_6=6 +button_SUB=Subtraction +button_1=1 +button_2=2 +button_3=3 +button_ADD=Addition +button_PERC=Percentage +button_0=0 +button_DOT=Decimal point +button_EQU=Equals \ No newline at end of file diff --git a/locale/es/config.cfg b/locale/es/config.cfg new file mode 100644 index 0000000..8275512 --- /dev/null +++ b/locale/es/config.cfg @@ -0,0 +1,43 @@ +[shortcut-name] +calcui_4func=Calculadora + +[controls] +calcui_hotkey=Enfocar en la entrada / Abrir/Cerrar la calculadora (según la configuración) + +[mod-setting-name] +calcui-decimal-places=Lugares decimales +calcui-clear-on-calc=Limpiar la ecuación tras el cálculo +calcui-shortcut-close=Cerrar con atajo +calcui-nilaus-mode=Modo Nilaus +calcui-sfx=Efectos de sonido + +[mod-settings-description] +calcui-decimal-places=Número de lugares decimales en el resultado +calcui-clear-on-calc=¿Debe el cálculo borrar la ecuación? +calcui-shortcut-close=¿Debe la interfaz cerrarse al presionar el atajo (verdadero), o enfocar el campo de entrada si ya está abierto (falso)? +calcui-nilaus-mode=Con el modo Nilaus activado, aparecen algunos Easter Eggs especiales +calcui-sfx=Cuando está activado, se reproducen efectos de sonido en resultados extraños + +[calculator-ui] +title=Calculadora +recent_tooltip=Presiona shift+clic izquierdo para copiar en la ecuación actual +button_CE=Borrar entrada +button_C=Borrar +button_BS=Retroceso +button_DIV=División +button_7=7 +button_8=8 +button_9=9 +button_MUL=Multiplicación +button_4=4 +button_5=5 +button_6=6 +button_SUB=Sustracción +button_1=1 +button_2=2 +button_3=3 +button_ADD=Adición +button_PERC=Porcentaje +button_0=0 +button_DOT=Punto decimal +button_EQU=Igual \ No newline at end of file diff --git a/locale/fr/config.cfg b/locale/fr/config.cfg new file mode 100644 index 0000000..5feb6b0 --- /dev/null +++ b/locale/fr/config.cfg @@ -0,0 +1,43 @@ +[shortcut-name] +calcui_4func=Calculatrice + +[controls] +calcui_hotkey=Focus sur l'entrée / Ouvrir/Fermer la calculatrice (selon les paramètres) + +[mod-setting-name] +calcui-decimal-places=Décimales +calcui-clear-on-calc=Effacer l'équation après le calcul +calcui-shortcut-close=Fermer avec le raccourci +calcui-nilaus-mode=Mode Nilaus +calcui-sfx=Effets sonores + +[mod-settings-description] +calcui-decimal-places=Nombre de décimales dans le résultat +calcui-clear-on-calc=La calculatrice doit-elle effacer l'équation après le calcul? +calcui-shortcut-close=La fenêtre doit-elle se fermer lors de l'utilisation du raccourci (vrai), ou se focaliser sur le champ de saisie si déjà ouvert (faux) ? +calcui-nilaus-mode=Avec le mode Nilaus activé, quelques easter eggs spéciaux apparaissent +calcui-sfx=Si activé, des effets sonores seront joués pour des résultats étranges + +[calculator-ui] +title=Calculatrice +recent_tooltip=Appuyez sur shift+clic gauche pour copier dans l'équation actuelle +button_CE=Effacer l'entrée +button_C=Effacer +button_BS=Retour arrière +button_DIV=Division +button_7=7 +button_8=8 +button_9=9 +button_MUL=Multiplication +button_4=4 +button_5=5 +button_6=6 +button_SUB=Soustraction +button_1=1 +button_2=2 +button_3=3 +button_ADD=Addition +button_PERC=Pourcentage +button_0=0 +button_DOT=Virgule +button_EQU=Égal \ No newline at end of file