diff --git a/FactorioSoftmodManager.lua b/FactorioSoftmodManager.lua index d78b8959..c29bfb15 100644 --- a/FactorioSoftmodManager.lua +++ b/FactorioSoftmodManager.lua @@ -274,9 +274,17 @@ Manager.loadModules = setmetatable({}, -- if you prefere module_exports can be used rather than returning the module if type(tbl[module_name]) == 'nil' then -- if it is a new module then creat the new index - 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 + if string.find(module_name,'GlobalLib') then + Manager.verbose('Extracting GlobalLib: '..module_name) + -- 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 -- if this module adds onto an existing one then append the keys if sandbox.module_exports and type(sandbox.module_exports) == 'table' diff --git a/control.lua b/control.lua index cf9409bd..c5e46030 100644 --- a/control.lua +++ b/control.lua @@ -1,16 +1,5 @@ -- not_luadoc=true ---- Root Script File --- @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----------------------------------------------------------- +function _log(...) log(...) end -- do not remove this is used for smaller verbose lines Manager = require("FactorioSoftmodManager") Manager.setVerbose{ selfInit=true, -- called while the manager is being set up diff --git a/modules/ExpGamingCore/Gui/control.lua b/modules/ExpGamingCore/Gui/control.lua index 3b3a851c..d558ddde 100644 --- a/modules/ExpGamingCore/Gui/control.lua +++ b/modules/ExpGamingCore/Gui/control.lua @@ -125,12 +125,6 @@ function Gui.cam_link(data) return data.cam 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) if Gui.left and ((event.tick+10)/(3600*game.speed)) % 15 == 0 then Gui.left.update() @@ -167,7 +161,12 @@ function Gui:on_init() Gui.toolbar.on_rank_change(event) Gui.center.on_rank_change(event) 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 function Gui:on_post() diff --git a/modules/ExpGamingCore/Ranking/src/core.lua b/modules/ExpGamingCore/Ranking/src/core.lua index b8707489..1e7ce466 100644 --- a/modules/ExpGamingCore/Ranking/src/core.lua +++ b/modules/ExpGamingCore/Ranking/src/core.lua @@ -90,7 +90,7 @@ root:add_rank{ name='Root', short_hand='Root', tag='[Root]', - colour=defines.color.white, + colour={r=255,b=255,g=255}, is_root=true, is_admin=true, is_spectator=true, diff --git a/modules/ExpGamingCore/softmod.json b/modules/ExpGamingCore/softmod.json index 48771e29..cdb366a6 100644 --- a/modules/ExpGamingCore/softmod.json +++ b/modules/ExpGamingCore/softmod.json @@ -1,16 +1,30 @@ { "name": "ExpGamingCore", + "version": "4.0.0", "module": "Collection", "description": "Explosive Gaming Core Files", - "keywords": ["Library","Lib","ExpGaming","Core"], - "version": "4.0.0", "location": "url", + "keywords": [ + "Library", + "Lib", + "ExpGaming", + "Core" + ], + "author": "Cooldude2606", + "contact": "Discord: Cooldude2606#5241", + "license": "https://github.com/explosivegaming/scenario/blob/master/LICENSE", "submodules": { "Commands": { "name": "Commands", "module": "commands", "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", "location": "url", "dependencies": { @@ -25,7 +39,14 @@ "name": "Gui", "module": "Gui", "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", "location": "url", "dependencies": { @@ -42,7 +63,16 @@ "name": "Ranking", "module": "Ranking", "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", "location": "url", "dependencies": { @@ -57,7 +87,16 @@ "name": "Server", "module": "Server", "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", "location": "url", "dependencies": { @@ -74,7 +113,16 @@ "name": "Sync", "module": "Sync", "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", "location": "url", "dependencies": { @@ -86,8 +134,5 @@ "ExpGamingCore.Gui": "?^4.0.0" } } - }, - "author": "Cooldude2606", - "contact": "Discord: Cooldude2606#5241", - "license": "https://github.com/explosivegaming/scenario/blob/master/LICENSE" + } } \ No newline at end of file diff --git a/modules/ExpGamingLib/control.lua b/modules/ExpGamingLib/control.lua index d65db0ac..8d8666ac 100644 --- a/modules/ExpGamingLib/control.lua +++ b/modules/ExpGamingLib/control.lua @@ -279,6 +279,5 @@ function table.keysort(tbl) return _tbl end --- bypasses the module sandbox and places functions into _G -ExpLib:unpack_to_G() +-- because this is marked as GlobalLib it will be auto extracted into _G return ExpLib \ No newline at end of file diff --git a/modules/ExpGamingLib/softmod.json b/modules/ExpGamingLib/softmod.json index 6d3fde97..744eee38 100644 --- a/modules/ExpGamingLib/softmod.json +++ b/modules/ExpGamingLib/softmod.json @@ -1,6 +1,6 @@ { "name": "ExpGamingLib", - "module": "ExpLib", + "module": "GlobalLib", "description": "Adds some common functions used though out all ExpGaming modules", "keywords": ["ExpGaming","Lib"], "version": "3.4.0", diff --git a/modules/FactorioStdLib/softmod.json b/modules/FactorioStdLib/softmod.json index 89af4963..af05ed21 100644 --- a/modules/FactorioStdLib/softmod.json +++ b/modules/FactorioStdLib/softmod.json @@ -17,7 +17,7 @@ }, "Game": { "name": "Game", - "module": "game", + "module": "Game", "description": "The game module.", "keywords": ["Standard Library","Lib","StdLib","Game","Extends"], "version": "0.8.0", diff --git a/modules/index.lua b/modules/index.lua index 8488de38..c5d24126 100644 --- a/modules/index.lua +++ b/modules/index.lua @@ -1,17 +1,16 @@ -- not_luadoc=true --- Used to index the files to be loaded --- @script index.lua return { - ['mod_gui']='/modules/FactorioModGui', - ['ExpLib']='/modules/ExpGamingLib', - ['Game']='/modules/FactorioStdLib/Game', - ['Time']='/modules/FactorioStdLib/Time', - ['Color']='/modules/FactorioStdLib/Color', - ['table']='/modules/FactorioStdLib/Table', - ['string']='/modules/FactorioStdLib/String', - ['Ranking']='/modules/ExpGamingCore/Ranking', - ['commands']='/modules/ExpGamingCore/Commands', - ['Gui']='/modules/ExpGamingCore/Gui', - ['Server']='/modules/ExpGamingCore/Server', - ['Sync']='/modules/ExpGamingCore/Sync', + ['GlobalLib-ExpGamingLib']='./modules/ExpGamingLib', + ['commands']='./modules/ExpGamingCore/Commands', + ['Gui']='./modules/ExpGamingCore/Gui', + ['Ranking']='./modules/ExpGamingCore/Ranking', + ['Server']='./modules/ExpGamingCore/Server', + ['Sync']='./modules/ExpGamingCore/Sync', + ['mod_gui']='./modules/FactorioModGui', + ['Color']='./modules/FactorioStdLib/Color', + ['Game']='./modules/FactorioStdLib/Game', + ['string']='./modules/FactorioStdLib/String', + ['table']='./modules/FactorioStdLib/Table', + ['Time']='./modules/FactorioStdLib/Time', } \ No newline at end of file diff --git a/softmod.json b/softmod.json new file mode 100644 index 00000000..5520e3b7 --- /dev/null +++ b/softmod.json @@ -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" + } +} \ No newline at end of file