Center Gui clean

This commit is contained in:
Cooldude2606
2017-10-15 21:49:55 +01:00
parent 95b3acf271
commit 9b6ec9d1a7
4 changed files with 31 additions and 43 deletions

View File

@@ -26,8 +26,8 @@ function add_input.draw_button(frame,name,display,tooltip)
debug_write({'GUI','INPUT'},name)
if inputs.buttons[name] then
local button = inputs.buttons[name]
local display = display or button.display or button.name
local tooltip = tooltip or button.tooltip
local display = display or button.display or {'expgui.button-no-display'}
local tooltip = tooltip or button.tooltip or {'expgui.button-no-tooltip'}
if frame.gui.is_valid_sprite_path(display) then
frame.add{name=name, type = "sprite-button", sprite=display, tooltip=tooltip, style = mod_gui.button_style}
else
@@ -43,7 +43,7 @@ function add_input.draw_text(frame,name,display)
debug_write({'GUI','INPUT'},name)
if inputs.text[name] then
local text = inputs.text[name]
local display = display or text.display or text.name
local display = display or text.display or {'expgui.text-no-display'}
frame.add{name=name, type='textfield'}
frame[name].caption=display
return
@@ -68,6 +68,4 @@ Event.register(defines.events.on_gui_text_changed, function(event)
local text = inputs.text[event.element.name]
if text.event then text.event(player,event.element) end
end
end)
--Please Only Edit Above This Line-----------------------------------------------------------
return credits
end)