mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-31 21:01:39 +09:00
Inproved global init
This commit is contained in:
@@ -18,9 +18,15 @@ local credits = {{
|
|||||||
}}
|
}}
|
||||||
local function credit_loop(reg) for _,cred in pairs(reg) do table.insert(credits,cred) end end
|
local function credit_loop(reg) for _,cred in pairs(reg) do table.insert(credits,cred) end end
|
||||||
--Please Only Edit Below This Line-----------------------------------------------------------
|
--Please Only Edit Below This Line-----------------------------------------------------------
|
||||||
|
--set up to run other code and events
|
||||||
require("mod-gui")
|
require("mod-gui")
|
||||||
credit_loop(require("locale/StdLib/event"))
|
credit_loop(require("locale/StdLib/event"))
|
||||||
Event.register(defines.events.on_player_joined_game,function() if not global.credits then Event.dispatch({name = Event.core_events.init, tick = 0}) end end)
|
--allows the code to be ran on a map where the code has just been added (ie init after init)
|
||||||
|
local function init() if not global.credits then Event.dispatch({name = Event.core_events.init, tick = 0}) end
|
||||||
|
Event.register(defines.events.on_player_joined_game,init)
|
||||||
|
Event.register(defines.events.on_tick,init)
|
||||||
|
Event.register(-2,init) Event.register(-3,init)
|
||||||
|
--loads all the other scripts
|
||||||
Event.gui_update = script.generate_event_name()
|
Event.gui_update = script.generate_event_name()
|
||||||
credit_loop(require("locale/file-header"))
|
credit_loop(require("locale/file-header"))
|
||||||
--below 'game.tick/(3600*game.speed)) % 15 == 0' raises the gui_update event every 15 minutes fell free to change the update time on that
|
--below 'game.tick/(3600*game.speed)) % 15 == 0' raises the gui_update event every 15 minutes fell free to change the update time on that
|
||||||
|
|||||||
Reference in New Issue
Block a user