Skip to content

Commit

Permalink
Fix for GUI bug that crashes headless server
Browse files Browse the repository at this point in the history
  • Loading branch information
jpanther committed Oct 5, 2017
1 parent 32fc539 commit c3f948c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,15 @@ local function showGui_sign(player)
local gui_scroll = gui_frame.add({type="scroll-pane", name="dect-gui-scroll", vertical_scroll_policy="auto", horizontal_scroll_policy="auto", style="dect-scroll"})
local gui_table = gui_scroll.add({type="table", name="dect-icons-table", colspan=20, style="dect-icon-table"})
for _, icon in pairs(global.icons) do
gui_table.add({type="sprite-button", name="dect-icon-"..icon.name, sprite=icon.type.."/"..icon.name, style="dect-icon-button", tooltip={"",icon.name}})
local match = false
for _, child in pairs(gui_table.children_names) do
if child.name == "dect-icon-"..icon.name then
match = true
end
end
if not match then
gui_table.add({type="sprite-button", name="dect-icon-"..icon.name, sprite=icon.type.."/"..icon.name, style="dect-icon-button", tooltip={"",icon.name}})
end
end
end

Expand Down

0 comments on commit c3f948c

Please sign in to comment.