Few minnor chagnes while messing with FSM

This commit is contained in:
Cooldude2606
2018-06-12 16:53:00 +01:00
parent 13c5961d39
commit 864279377e
10 changed files with 102 additions and 51 deletions

View File

@@ -274,9 +274,17 @@ Manager.loadModules = setmetatable({},
-- if you prefere module_exports can be used rather than returning the module -- if you prefere module_exports can be used rather than returning the module
if type(tbl[module_name]) == 'nil' then if type(tbl[module_name]) == 'nil' then
-- if it is a new module then creat the new index -- if it is a new module then creat the new index
if sandbox.module_exports and type(sandbox.module_exports) == 'table' if string.find(module_name,'GlobalLib') then
then tbl[module_name] = sandbox.module_exports Manager.verbose('Extracting GlobalLib: '..module_name)
else tbl[module_name] = table.remove(module,1) end -- if it is named GlobalLib then it will be auto extracted into _G
if sandbox.module_exports and type(sandbox.module_exports) == 'table'
then for key,value in pairs(sandbox.module_exports) do _G[key] = value end
else for key,value in pairs(table.remove(module,1)) do _G[key] = value end end
else
if sandbox.module_exports and type(sandbox.module_exports) == 'table'
then tbl[module_name] = sandbox.module_exports
else tbl[module_name] = table.remove(module,1) end
end
elseif type(tbl[module_name]) == 'table' then elseif type(tbl[module_name]) == 'table' then
-- if this module adds onto an existing one then append the keys -- if this module adds onto an existing one then append the keys
if sandbox.module_exports and type(sandbox.module_exports) == 'table' if sandbox.module_exports and type(sandbox.module_exports) == 'table'

View File

@@ -1,16 +1,5 @@
-- not_luadoc=true -- not_luadoc=true
--- Root Script File function _log(...) log(...) end -- do not remove this is used for smaller verbose lines
-- @script control.lua
function _log(...) log(...) end
--[[
Explosive Gaming
This file can be used with permission but this and the credit below must remain in the file.
Contact a member of management on our discord to seek permission to use our code.
Any changes that you may make to the code are yours but that does not make the script yours.
Discord: https://discord.gg/r6dC2uK
]]
--Please Only Edit Below This Line-----------------------------------------------------------
Manager = require("FactorioSoftmodManager") Manager = require("FactorioSoftmodManager")
Manager.setVerbose{ Manager.setVerbose{
selfInit=true, -- called while the manager is being set up selfInit=true, -- called while the manager is being set up

View File

@@ -125,12 +125,6 @@ function Gui.cam_link(data)
return data.cam return data.cam
end end
script.on_event('on_player_joined_game',function(event)
Gui.toolbar.on_player_joined_game(event)
Gui.popup.on_player_joined_game(event)
Gui.left.on_player_joined_game(event)
end)
script.on_event('on_tick', function(event) script.on_event('on_tick', function(event)
if Gui.left and ((event.tick+10)/(3600*game.speed)) % 15 == 0 then if Gui.left and ((event.tick+10)/(3600*game.speed)) % 15 == 0 then
Gui.left.update() Gui.left.update()
@@ -167,7 +161,12 @@ function Gui:on_init()
Gui.toolbar.on_rank_change(event) Gui.toolbar.on_rank_change(event)
Gui.center.on_rank_change(event) Gui.center.on_rank_change(event)
end) end)
end end
script.on_event('on_player_joined_game',function(event)
Gui.toolbar.on_player_joined_game(event)
Gui.popup.on_player_joined_game(event)
Gui.left.on_player_joined_game(event)
end)
end end
function Gui:on_post() function Gui:on_post()

View File

@@ -90,7 +90,7 @@ root:add_rank{
name='Root', name='Root',
short_hand='Root', short_hand='Root',
tag='[Root]', tag='[Root]',
colour=defines.color.white, colour={r=255,b=255,g=255},
is_root=true, is_root=true,
is_admin=true, is_admin=true,
is_spectator=true, is_spectator=true,

View File

@@ -1,16 +1,30 @@
{ {
"name": "ExpGamingCore", "name": "ExpGamingCore",
"version": "4.0.0",
"module": "Collection", "module": "Collection",
"description": "Explosive Gaming Core Files", "description": "Explosive Gaming Core Files",
"keywords": ["Library","Lib","ExpGaming","Core"],
"version": "4.0.0",
"location": "url", "location": "url",
"keywords": [
"Library",
"Lib",
"ExpGaming",
"Core"
],
"author": "Cooldude2606",
"contact": "Discord: Cooldude2606#5241",
"license": "https://github.com/explosivegaming/scenario/blob/master/LICENSE",
"submodules": { "submodules": {
"Commands": { "Commands": {
"name": "Commands", "name": "Commands",
"module": "commands", "module": "commands",
"description": "A better command handler than the base game.", "description": "A better command handler than the base game.",
"keywords": ["Library","Lib","ExpGaming","Core","Commands"], "keywords": [
"Library",
"Lib",
"ExpGaming",
"Core",
"Commands"
],
"version": "3.4.0", "version": "3.4.0",
"location": "url", "location": "url",
"dependencies": { "dependencies": {
@@ -25,7 +39,14 @@
"name": "Gui", "name": "Gui",
"module": "Gui", "module": "Gui",
"description": "Adds a objective version to custom guis.", "description": "Adds a objective version to custom guis.",
"keywords": ["Library","Lib","ExpGaming","Core","Gui","ExpGui"], "keywords": [
"Library",
"Lib",
"ExpGaming",
"Core",
"Gui",
"ExpGui"
],
"version": "3.4.0", "version": "3.4.0",
"location": "url", "location": "url",
"dependencies": { "dependencies": {
@@ -42,7 +63,16 @@
"name": "Ranking", "name": "Ranking",
"module": "Ranking", "module": "Ranking",
"description": "A full ranking system for factorio.", "description": "A full ranking system for factorio.",
"keywords": ["Library","Lib","ExpGaming","Core","Ranking","Ranks","Permissions","Roles"], "keywords": [
"Library",
"Lib",
"ExpGaming",
"Core",
"Ranking",
"Ranks",
"Permissions",
"Roles"
],
"version": "3.4.0", "version": "3.4.0",
"location": "url", "location": "url",
"dependencies": { "dependencies": {
@@ -57,7 +87,16 @@
"name": "Server", "name": "Server",
"module": "Server", "module": "Server",
"description": "Adds a thread system and event listening and a admin bypass (recommend to disable /c and use optional /interface)", "description": "Adds a thread system and event listening and a admin bypass (recommend to disable /c and use optional /interface)",
"keywords": ["Library","Lib","ExpGaming","Core","Server","Thread","Interface","Events"], "keywords": [
"Library",
"Lib",
"ExpGaming",
"Core",
"Server",
"Thread",
"Interface",
"Events"
],
"version": "3.4.0", "version": "3.4.0",
"location": "url", "location": "url",
"dependencies": { "dependencies": {
@@ -74,7 +113,16 @@
"name": "Sync", "name": "Sync",
"module": "Sync", "module": "Sync",
"description": "Allows syncing with an outside server and info panle.", "description": "Allows syncing with an outside server and info panle.",
"keywords": ["Library","Lib","ExpGaming","Core","Info","Sync","External","Discord"], "keywords": [
"Library",
"Lib",
"ExpGaming",
"Core",
"Info",
"Sync",
"External",
"Discord"
],
"version": "3.4.0", "version": "3.4.0",
"location": "url", "location": "url",
"dependencies": { "dependencies": {
@@ -86,8 +134,5 @@
"ExpGamingCore.Gui": "?^4.0.0" "ExpGamingCore.Gui": "?^4.0.0"
} }
} }
}, }
"author": "Cooldude2606",
"contact": "Discord: Cooldude2606#5241",
"license": "https://github.com/explosivegaming/scenario/blob/master/LICENSE"
} }

View File

@@ -279,6 +279,5 @@ function table.keysort(tbl)
return _tbl return _tbl
end end
-- bypasses the module sandbox and places functions into _G -- because this is marked as GlobalLib it will be auto extracted into _G
ExpLib:unpack_to_G()
return ExpLib return ExpLib

View File

@@ -1,6 +1,6 @@
{ {
"name": "ExpGamingLib", "name": "ExpGamingLib",
"module": "ExpLib", "module": "GlobalLib",
"description": "Adds some common functions used though out all ExpGaming modules", "description": "Adds some common functions used though out all ExpGaming modules",
"keywords": ["ExpGaming","Lib"], "keywords": ["ExpGaming","Lib"],
"version": "3.4.0", "version": "3.4.0",

View File

@@ -17,7 +17,7 @@
}, },
"Game": { "Game": {
"name": "Game", "name": "Game",
"module": "game", "module": "Game",
"description": "The game module.", "description": "The game module.",
"keywords": ["Standard Library","Lib","StdLib","Game","Extends"], "keywords": ["Standard Library","Lib","StdLib","Game","Extends"],
"version": "0.8.0", "version": "0.8.0",

View File

@@ -1,17 +1,16 @@
-- not_luadoc=true -- not_luadoc=true
--- Used to index the files to be loaded --- Used to index the files to be loaded
-- @script index.lua
return { return {
['mod_gui']='/modules/FactorioModGui', ['GlobalLib-ExpGamingLib']='./modules/ExpGamingLib',
['ExpLib']='/modules/ExpGamingLib', ['commands']='./modules/ExpGamingCore/Commands',
['Game']='/modules/FactorioStdLib/Game', ['Gui']='./modules/ExpGamingCore/Gui',
['Time']='/modules/FactorioStdLib/Time', ['Ranking']='./modules/ExpGamingCore/Ranking',
['Color']='/modules/FactorioStdLib/Color', ['Server']='./modules/ExpGamingCore/Server',
['table']='/modules/FactorioStdLib/Table', ['Sync']='./modules/ExpGamingCore/Sync',
['string']='/modules/FactorioStdLib/String', ['mod_gui']='./modules/FactorioModGui',
['Ranking']='/modules/ExpGamingCore/Ranking', ['Color']='./modules/FactorioStdLib/Color',
['commands']='/modules/ExpGamingCore/Commands', ['Game']='./modules/FactorioStdLib/Game',
['Gui']='/modules/ExpGamingCore/Gui', ['string']='./modules/FactorioStdLib/String',
['Server']='/modules/ExpGamingCore/Server', ['table']='./modules/FactorioStdLib/Table',
['Sync']='/modules/ExpGamingCore/Sync', ['Time']='./modules/FactorioStdLib/Time',
} }

12
softmod.json Normal file
View File

@@ -0,0 +1,12 @@
{
"name": "ExpGaming",
"version": "4.0.0",
"module": "Scenario",
"description": "Explosive gaming's factorio secenario ran on every public server",
"modules": {
"ExpGamingCore": "^4.0.0",
"ExpGamingLib": "^3.4.0",
"FactorioModGui": "^1.0.0",
"FactorioStdLib": "^0.8.0"
}
}