From 6434b79df24296d8edf45c722d73b4971aab40c4 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Sat, 15 Jun 2019 15:47:46 +0100 Subject: [PATCH] Fixed rocket Gui Toggle Section --- locale/en/gui.cfg | 4 ++-- modules/gui/rocket-info.lua | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/locale/en/gui.cfg b/locale/en/gui.cfg index 7cb07a9a..6f59cf4c 100644 --- a/locale/en/gui.cfg +++ b/locale/en/gui.cfg @@ -44,8 +44,8 @@ data-caption-avg-launch=Avg Time data-tooltip-avg-launch=The average amount of time taken to launch a rocket data-caption-avg-launch-n=Avg Time __1__ data-tooltip-avg-launch-n=The average amount of time taken to launch the last __1__ rockets -data-caption-milstone-n=Milestone __1__ -data-tooltip-milstone-n=Time taken to each __1__ rockets +data-caption-milestone-n=Milestone __1__ +data-tooltip-milestone-n=Time taken to each __1__ rockets progress-x-pos=X __1__ progress-y-pos=Y __1__ progress-label-tooltip=View on map diff --git a/modules/gui/rocket-info.lua b/modules/gui/rocket-info.lua index 9e38475c..fc286ed3 100644 --- a/modules/gui/rocket-info.lua +++ b/modules/gui/rocket-info.lua @@ -129,7 +129,7 @@ Gui.new_button() style.width = 20 end) :on_click(function(player,element) - local flow_name = element.parent.name + local flow_name = element.parent.caption local flow = element.parent.parent.parent[flow_name] if Gui.toggle_visible(flow) then element.sprite = 'utility/collapse_dark' @@ -154,6 +154,7 @@ local function create_section(container,section_name,table_size) ) --- Right aligned button to toggle the section + header_area.caption = section_name toggle_section(header_area) --- Table used to store the data @@ -316,9 +317,9 @@ local function generate_milestones(player,frame) for _,milestone in ipairs(config.milestones) do if milestone <= force_rockets then local time = rocket_times[player.force.name][milestone] - create_label_value_pair_time(element,'milstone-n',time,false,milestone) + create_label_value_pair_time(element,'milestone-n',time,false,milestone) else - create_label_value_pair_time(element,'milstone-n',0,false,milestone) + create_label_value_pair_time(element,'milestone-n',0,false,milestone) break end end