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 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'

View File

@@ -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

View File

@@ -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()

View File

@@ -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,

View File

@@ -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"
}
}

View File

@@ -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

View File

@@ -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",

View File

@@ -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",

View File

@@ -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',
}

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"
}
}