All error message fixed

This commit is contained in:
Cooldude2606
2017-10-16 19:14:13 +01:00
parent 8fbcd66b6c
commit 6473e15dea
15 changed files with 68 additions and 56 deletions

View File

@@ -7,6 +7,7 @@ Any changes that you may make to the code are yours but that does not make the s
Discord: https://discord.gg/XSsBV6b
]]
--Please Only Edit Below This Line-----------------------------------------------------------
local ExpGui = require("ExpGaming - Module Setup")
local add_frame = ExpGui.add_frame
local frames = ExpGui.frames
local draw_frame = ExpGui.draw_frame
@@ -76,4 +77,6 @@ function draw_frame.tab(player,element)
frames.tabs[element.name].event(player,element.parent.parent.parent.tab)
end
Event.register(Event.rank_change,function(event) event.player.gui.center.clear() end)
Event.register(Event.rank_change,function(event) event.player.gui.center.clear() end)
return ExpGui

View File

@@ -7,17 +7,18 @@ Any changes that you may make to the code are yours but that does not make the s
Discord: https://discord.gg/XSsBV6b
]]
--Please Only Edit Below This Line-----------------------------------------------------------
local ExpGui = require("ExpGaming - Module Setup")
local add_input = ExpGui.add_input
local inputs = ExpGui.inputs
--allows defining of new buttons;;name how to call button;;default_display what is shown on the button;;default_tooltip the tooltip display;;event function(player,element) that runs on click
function add_input.button(name,default_display,default_tooltip,event)
if not name then error('Button requires a name') end
inputs.buttons[name] = {name=name,display=default_display,tooltip=default_tooltip,event=event})
inputs.buttons[name] = {name=name,display=default_display,tooltip=default_tooltip,event=event}
end
--allows defining of text box inputs;;name how to call button;;default_display what is shown on the button;;event function(player,element) that runs on text change
function add_input.text(name,default_display,event)
if not name then error('Text Filed requires a name') end
inputs.text[name] = {name=name,display=default_display,event=event})
inputs.text[name] = {name=name,display=default_display,event=event}
end
--draws the button into a gui;;frame the frame to draw to;;name name of button to draw;;display(opptinal) overrides the default;;tooltip(opptinal) overrides the default
function add_input.draw_button(frame,name,display,tooltip)
@@ -68,4 +69,6 @@ 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)
end)
return ExpGui

View File

@@ -7,6 +7,7 @@ Any changes that you may make to the code are yours but that does not make the s
Discord: https://discord.gg/XSsBV6b
]]
--Please Only Edit Below This Line-----------------------------------------------------------
local ExpGui = require("ExpGaming - Module Setup")
local add_frame = ExpGui.add_frame
local frames = ExpGui.frames
local draw_frame = ExpGui.draw_frame
@@ -61,4 +62,6 @@ Event.register(Event.rank_change,function(event)
local left = mod_gui.get_frame_flow(event.player)
if left[frame_data.name] then left[frame_data.name].style.visible = frame_data.vis end
end
end)
end)
return ExpGui

View File

@@ -7,6 +7,7 @@ Any changes that you may make to the code are yours but that does not make the s
Discord: https://discord.gg/XSsBV6b
]]
--Please Only Edit Below This Line-----------------------------------------------------------
local ExpGui = require("ExpGaming - Module Setup")
local player_table_functions = ExpGui.player_table
--filters that are used. Feel free to add more
player_table_functions.filters = {
@@ -108,4 +109,6 @@ function player_table_functions.draw(player,frame,filters,input_location)
end
end
Event.register(Event.soft_init,function() global.exp_core.current_filters = {} end)
Event.register(Event.soft_init,function() global.exp_core.current_filters = {} end)
return ExpGui

View File

@@ -7,6 +7,7 @@ Any changes that you may make to the code are yours but that does not make the s
Discord: https://discord.gg/XSsBV6b
]]
--Please Only Edit Below This Line-----------------------------------------------------------
local ExpGui = require("ExpGaming - Module Setup")
local add_frame = ExpGui.add_frame
local frames = ExpGui.frames
local draw_frame = ExpGui.draw_frame
@@ -32,7 +33,7 @@ end
function add_frame.popup(style,default_display,default_tooltip,on_click,event)
if not style then error('Popup style requires a name') end
if not event or type(event) ~= 'function' then error('Popup style requires a draw function') end
frames.popup[style] = {style=style,display=default_display,on_click=on_click,event=event})
frames.popup[style] = {style=style,display=default_display,on_click=on_click,event=event}
if on_click and type(on_click) == 'function' then
ExpGui.toolbar.add_button(style,default_display,default_tooltip,draw_frame.popup_button)
end
@@ -61,4 +62,10 @@ function draw_frame.popup(style,args)
end
end
--used to make the popup area
Event.register(defines.events.on_player_joined_game,function(event) if not mod_gui.get_frame_flow(game.players[event.player_index]).popups then mod_gui.get_frame_flow(game.players[event.player_index]).add{name='popups',type='flow',direction='vertical'} end end)
Event.register(defines.events.on_player_joined_game,function(event)
if not mod_gui.get_frame_flow(game.players[event.player_index]).popups then
mod_gui.get_frame_flow(game.players[event.player_index]).add{name='popups',type='flow',direction='vertical'}
end
end)
return ExpGui

View File

@@ -7,6 +7,7 @@ Any changes that you may make to the code are yours but that does not make the s
Discord: https://discord.gg/XSsBV6b
]]
--Please Only Edit Below This Line-----------------------------------------------------------
local ExpGui = require("ExpGaming - Module Setup")
local toolbar = ExpGui.toolbar
--similar to ExpGui.add_input.button but it also accepts a restriction and button is drawn to the toolbar
function toolbar.add_button(name,default_display,default_tooltip,event)
@@ -29,4 +30,6 @@ function toolbar.draw(player)
end
end
--auto-redraw toolbar after new rank is given
Event.register(Event.rank_change,function(event) toolbar.draw(event.player) end)
Event.register(Event.rank_change,function(event) toolbar.draw(event.player) end)
return ExpGui

View File

@@ -7,11 +7,12 @@ Any changes that you may make to the code are yours but that does not make the s
Discord: https://discord.gg/XSsBV6b
]]
--Please Only Edit Below This Line-----------------------------------------------------------
local function merge(first_table,second_table) for k,v in pairs(second_table) do first_table[k] = v end end
local ExpGui = require("ExpGaming - Module Setup")
require("ExpGaming - Inputs")
require("ExpGaming - Toolbar")
require("ExpGaming - Center Gui")
require("ExpGaming - Left Gui")
require("ExpGaming - Popup")
require("ExpGaming - Player Table")
merge(ExpGui,require("ExpGaming - Inputs"))
merge(ExpGui,require("ExpGaming - Toolbar"))
merge(ExpGui,require("ExpGaming - Center Gui"))
merge(ExpGui,require("ExpGaming - Left Gui"))
merge(ExpGui,require("ExpGaming - Popup"))
merge(ExpGui,require("ExpGaming - Player Table"))
return ExpGui