1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-12 10:04:40 +02:00

visible_fixes

This commit is contained in:
grilledham 2019-02-24 23:07:15 +00:00
parent 76871eefbf
commit f2849b0fb8
2 changed files with 6 additions and 13 deletions

View File

@ -58,7 +58,7 @@ local function create_camera(args, player)
if not mainframe then
mainframe = mainframeflow.add {type = 'frame', name = mainframeid, direction = 'vertical', style = 'captionless_frame'}
mainframe.style.visible = true
mainframe.visible = true
end
local headerframe = mainframe.headerframe
@ -122,7 +122,7 @@ local function update_camera_render(target, targetframe, zoom, size, visible)
camera.position = position
camera.surface_index = surface_index
camera.zoom = zoom
camera.style.visible = visible
camera.visible = visible
camera.style.minimal_width = preview_size
camera.style.minimal_height = preview_size
camera.style.maximal_width = preview_size

View File

@ -230,14 +230,9 @@ Gui.on_click(
local name = top_elements[i]
local ele = top[name]
if ele and ele.valid then
local style = ele.style
-- if visible is not set it has the value of nil.
-- Hence nil is treated as is visible.
local v = style.visible
if v or v == nil then
if ele.visible then
custom_raise(on_pre_hidden_handlers, ele, player)
style.visible = false
ele.visible = false
end
end
end
@ -249,10 +244,8 @@ Gui.on_click(
local name = top_elements[i]
local ele = top[name]
if ele and ele.valid then
local style = ele.style
if not style.visible then
style.visible = true
if not ele.visible then
ele.visible = true
custom_raise(on_visible_handlers, ele, player)
end
end