From d987a6ca2cc50dca0f58ff8fc67f4b84feaa32a5 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Tue, 30 Mar 2021 03:35:43 +0100 Subject: [PATCH] Made requested locale changes --- locale/en/gui.cfg | 19 ++++++++++--------- modules/gui/warp-list.lua | 27 +++++++++++++++------------ 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/locale/en/gui.cfg b/locale/en/gui.cfg index 567e7220..9727629f 100644 --- a/locale/en/gui.cfg +++ b/locale/en/gui.cfg @@ -96,15 +96,15 @@ inserted=Inserted __1__ __2__ into __3__ main-caption=Warp List [img=info] main-tooltip=Warp List; Must be within __1__ tiles to use sub-tooltip=Warps can only be used every __1__ seconds and when within __2__ tiles\n__3__\n__4__\n__5__\n__6__\n__7__\n__8__ -sub-tooltip-current= - __1__ This is the warp you are currently standing on; -sub-tooltip-connected= - __1__ This warp is in the same electricity network; -sub-tooltip-different= - __1__ This warp is not connected to the one u are standing on; -sub-tooltip-bypass= - __1__ This warp is possible to go to because of your role; -sub-tooltip-not_available= - __1__ This warp is out of range; +sub-tooltip-current= - __1__ This is your current warp point; +sub-tooltip-connected= - __1__ You can travel to this warp point; +sub-tooltip-different= - __1__ This warp is on a different network; sub-tooltip-cooldown= - __1__ You are currently on cooldown; -too-close=Can't make warp; too close to warp: __1__ -too-close-to-water=Cannot create warp this close to water, please move __1__ tiles away from the water body -too-close-to-entities=Cannot create warp this close to entities, please move __1__ tiles away from the entities or destroy them +sub-tooltip-not_available= - __1__ You are not in range of a warp point; +sub-tooltip-bypass= - __1__ Your role allows you to travel here; +too-close=Cannot create warp; too close to existing warp point: __1__ +too-close-to-water=Cannot create warp; too close to water, please move __1__ tiles away from the water body or landfill it +too-close-to-entities=Cannot create warp; too close to other entities, please move __1__ tiles away from the entities or remove them last-edit=Last edited by __1__ at __2__\nClick to view on map add-tooltip=Add new warp confirm-tooltip=Save changes @@ -112,7 +112,8 @@ cancel-tooltip=Discard changes edit-tooltip=Currently being edited by: __1__ edit-tooltip-none=Currently being edited by: Nobody remove-tooltip=Remove warp -timer-tooltip=Warp cooldown takes __1__ seconds +timer-tooltip=Please wait __1__ seconds before you warp again +timer-tooltip-zero=After each warp you will need to wait __1__ seconds before you can warp again goto-tooltip=Go to x __1__ y __2__ goto-bypass=Go to x __1__ y __2__, bypass mode goto-bypass-different-network=Go to x __1__ y __2__, bypass mode different network diff --git a/modules/gui/warp-list.lua b/modules/gui/warp-list.lua index de0ab193..dbb8c401 100644 --- a/modules/gui/warp-list.lua +++ b/modules/gui/warp-list.lua @@ -402,7 +402,7 @@ end local warp_timer = Gui.element{ type = 'progressbar', - tooltip = {'warp-list.timer-tooltip', config.cooldown_duration}, + tooltip = {'warp-list.timer-tooltip-zero', config.cooldown_duration}, minimum_value = 0, maximum_value = config.cooldown_duration*config.update_smoothing } @@ -463,7 +463,7 @@ local function update_warp_elements(element, warp, warp_player_is_on, on_cooldow warp_status_element.tooltip = {'warp-list.goto-tooltip', position.x, position.y} warp_status_element.caption = warp_status_icons.connected label_style.font = 'default-semibold' - -- If the warp is not in the same network but the player is allowed to warp without being on a warp + -- If the warp is not on the same network but the player is allowed to warp without being on a warp elseif bypass_warp_proximity then local position = warp.position element.tooltip = {'warp-list.goto-bypass-different-network', position.x, position.y} @@ -471,7 +471,7 @@ local function update_warp_elements(element, warp, warp_player_is_on, on_cooldow warp_status_element.tooltip = {'warp-list.goto-bypass-different-network', position.x, position.y} warp_status_element.caption = warp_status_icons.bypass label_style.font = 'default-semibold' - -- If the warp is in a different network than the one the player is standing on + -- If the warp is on a different network than the one the player is standing on else element.tooltip = {'warp-list.goto-different-network'} element.enabled = false @@ -540,7 +540,6 @@ local function update_warp(player, warp_table, warp_id) -- Hide the edit button if the player is not allowed to edit the warp local player_allowed_edit = check_player_permissions(player, 'allow_edit_warp', warp) local players_editing = table.get_keys(warp.currently_editing) - -- button_flow.visible = player_allowed_edit edit_warp_element.visible = player_allowed_edit -- Set the tooltip of the edit button @@ -645,9 +644,9 @@ Gui.element(function(event_trigger, parent) {'warp-list.sub-tooltip-current',warp_status_icons.current}, {'warp-list.sub-tooltip-connected',warp_status_icons.connected}, {'warp-list.sub-tooltip-different',warp_status_icons.different}, - {'warp-list.sub-tooltip-bypass',warp_status_icons.bypass}, - {'warp-list.sub-tooltip-not_available',warp_status_icons.not_available}, {'warp-list.sub-tooltip-cooldown',warp_status_icons.cooldown}, + {'warp-list.sub-tooltip-not_available',warp_status_icons.not_available}, + {'warp-list.sub-tooltip-bypass',warp_status_icons.bypass}, }, true ) @@ -670,12 +669,14 @@ Gui.element(function(event_trigger, parent) local warp_timer_element = warp_timer(container) -- Change the progress of the warp timer - local progress = 1 local timer = PlayerCooldown:get(player) if timer > 0 then - progress = 1 - (timer/config.cooldown_duration) + warp_timer_element.tooltip = {'warp-list.timer-tooltip', timer} + warp_timer_element.value = 1 - (timer/config.cooldown_duration) + else + warp_timer_element.tooltip = {'warp-list.timer-tooltip-zero', config.cooldown_duration} + warp_timer_element.value = 1 end - warp_timer_element.value = progress -- Add any existing warps update_all_warps(player, scroll_table) @@ -725,11 +726,13 @@ PlayerCooldown:on_update(function(player_name, player_cooldown) local warp_timer_element = frame.container[warp_timer.name] -- Set the progress - local progress = 1 if player_cooldown and player_cooldown > 0 then - progress = 1 - (player_cooldown/config.cooldown_duration) + warp_timer_element.tooltip = {'warp-list.timer-tooltip', player_cooldown} + warp_timer_element.value = 1 - (player_cooldown/config.cooldown_duration) + else + warp_timer_element.tooltip = {'warp-list.timer-tooltip-zero', config.cooldown_duration} + warp_timer_element.value = 1 end - warp_timer_element.value = progress -- Trigger update of buttons if cooldown is now 0 if player_cooldown == 0 then