Fixed rocket Gui Toggle Section

This commit is contained in:
Cooldude2606
2019-06-15 15:47:46 +01:00
parent 2372a55b28
commit 6434b79df2
2 changed files with 6 additions and 5 deletions

View File

@@ -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

View File

@@ -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