mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-29 04:06:39 +09:00
Updated Module to use require
This commit is contained in:
@@ -4,6 +4,12 @@
|
||||
-- @author Cooldude2606
|
||||
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||
|
||||
local Game = require('FactorioStdLib.Game')
|
||||
local Color = require('FactorioStdLib.Color')
|
||||
-- this is optional and is hanndled by it being present
|
||||
local success, Ranking = pcall(require,'ExpGamingCore.Ranking')
|
||||
if not success then Ranking = nil end success = nil
|
||||
|
||||
--- Used as an error constant for validation
|
||||
-- @field commands.error
|
||||
-- @usage return commands.error, 'err message'
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
{
|
||||
"name": "Commands",
|
||||
"version": "4.0.0",
|
||||
"module": "commands",
|
||||
"type": "Submodule",
|
||||
"description": "A better command handler than the base game.",
|
||||
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/ExpGamingCore.Commands.zip",
|
||||
"keywords": [
|
||||
"Library",
|
||||
"Lib",
|
||||
@@ -9,8 +12,9 @@
|
||||
"Core",
|
||||
"Commands"
|
||||
],
|
||||
"version": "4.0.0",
|
||||
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/ExpGamingCore.Commands.zip",
|
||||
"author": "<blank>",
|
||||
"contact": "<blank>",
|
||||
"license": "<blank>",
|
||||
"dependencies": {
|
||||
"ExpGamingLib": "^4.0.0",
|
||||
"FactorioStdLib.Table": "^0.8.0",
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
-- @author Cooldude2606
|
||||
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||
|
||||
local Game = require('FactorioStdLib.Game')
|
||||
local Color = require('FactorioStdLib.Color')
|
||||
|
||||
local Gui = {}
|
||||
local Gui_data = {}
|
||||
local global = global()
|
||||
@@ -154,8 +157,8 @@ script.on_event('on_player_respawned',function(event)
|
||||
end)
|
||||
|
||||
function Gui:on_init()
|
||||
if loaded_modules.Server then verbose('ExpGamingCore.Server is installed; Loading server src') require(module_path..'/src/server') end
|
||||
if loaded_modules.Ranking then
|
||||
if loaded_modules['ExpGamingCore.Server'] then verbose('ExpGamingCore.Server is installed; Loading server src') require(module_path..'/src/server') end
|
||||
if loaded_modules['ExpGamingCore.Ranking'] then
|
||||
verbose('ExpGamingCore.Ranking is installed; Loading ranking src')
|
||||
script.on_event('on_rank_change',function(event)
|
||||
Gui.toolbar.on_rank_change(event)
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
{
|
||||
"name": "Gui",
|
||||
"version": "4.0.0",
|
||||
"module": "Gui",
|
||||
"type": "Submodule",
|
||||
"description": "Adds a objective version to custom guis.",
|
||||
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/ExpGamingCore.Gui.zip",
|
||||
"keywords": [
|
||||
"Library",
|
||||
"Lib",
|
||||
@@ -10,8 +13,9 @@
|
||||
"Gui",
|
||||
"ExpGui"
|
||||
],
|
||||
"version": "4.0.0",
|
||||
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/ExpGamingCore.Gui.zip",
|
||||
"author": "<blank>",
|
||||
"contact": "<blank>",
|
||||
"license": "<blank>",
|
||||
"dependencies": {
|
||||
"ExpGamingLib": "^4.0.0",
|
||||
"FactorioStdLib.Table": "^0.8.0",
|
||||
|
||||
@@ -7,7 +7,10 @@
|
||||
--- This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module
|
||||
-- @function _comment
|
||||
|
||||
local Game = require('FactorioStdLib.Game')
|
||||
local Color = require('FactorioStdLib.Color')
|
||||
local mod_gui = require("mod-gui")
|
||||
|
||||
local center = {}
|
||||
center._center = {}
|
||||
|
||||
|
||||
@@ -7,7 +7,10 @@
|
||||
--- This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module
|
||||
-- @function _comment
|
||||
|
||||
local Game = require('FactorioStdLib.Game')
|
||||
local Color = require('FactorioStdLib.Color')
|
||||
local mod_gui = require("mod-gui")
|
||||
|
||||
local inputs = {}
|
||||
inputs._input = {}
|
||||
-- these are just so you can have short cuts to this
|
||||
|
||||
@@ -7,7 +7,12 @@
|
||||
--- This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module
|
||||
-- @function _comment
|
||||
|
||||
local Game = require('FactorioStdLib.Game')
|
||||
local Color = require('FactorioStdLib.Color')
|
||||
local success, Ranking = pcall(require,'ExpGamingCore.Ranking')
|
||||
if not success then Ranking = nil end success = nil
|
||||
local mod_gui = require("mod-gui")
|
||||
|
||||
local left = {}
|
||||
left._left = {}
|
||||
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
--- This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module
|
||||
-- @function _comment
|
||||
|
||||
local Game = require('FactorioStdLib.Game')
|
||||
local mod_gui = require("mod-gui")
|
||||
|
||||
local popup = {}
|
||||
popup._popup = {}
|
||||
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
--- This file will be loaded when ExpGamingCore.Commands is present
|
||||
-- @function _comment
|
||||
|
||||
local Game = require('FactorioStdLib.Game')
|
||||
local Server = require('ExpGamingCore.Server')
|
||||
|
||||
--- Adds a server thread that allows the camera follows to be toggled off and on
|
||||
-- @function __comment
|
||||
script.on_event(-1,function(event)
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
--- This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module
|
||||
-- @function _comment
|
||||
|
||||
local Gui = require('ExpGamingCore.Gui')
|
||||
local mod_gui = require("mod-gui")
|
||||
|
||||
local gui_tset_close = Gui.inputs.add{
|
||||
|
||||
@@ -7,7 +7,11 @@
|
||||
--- This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module
|
||||
-- @function _comment
|
||||
|
||||
local Game = require('FactorioStdLib.Game')
|
||||
local success, Ranking = pcall(require,'ExpGamingCore.Ranking')
|
||||
if not success then Ranking = nil end success = nil
|
||||
local mod_gui = require("mod-gui")
|
||||
|
||||
local toolbar = {}
|
||||
|
||||
--- Add a button to the toolbar, ranks need to be allowed to use these buttons if ranks is preset
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
-- @alias Ranking
|
||||
-- @author Cooldude2606
|
||||
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||
|
||||
local Game = require('FactorioStdLib.Game')
|
||||
local Color = require('FactorioStdLib.Color')
|
||||
|
||||
local Ranking = {}
|
||||
local module_verbose = false --true|false
|
||||
|
||||
@@ -427,15 +431,13 @@ script.on_event('on_tick',function(event)
|
||||
end
|
||||
end)
|
||||
|
||||
_G.Ranking = Ranking
|
||||
verbose('Loading rank core...')
|
||||
require(module_path..'/src/core')
|
||||
require(module_path..'/src/core',{Ranking=Ranking})
|
||||
verbose('Loading rank configs...')
|
||||
require(module_path..'/src/config')
|
||||
_G.Ranking = nil
|
||||
require(module_path..'/src/config',{Ranking=Ranking})
|
||||
|
||||
function Ranking:on_init()
|
||||
if loaded_modules.Server then verbose('ExpGamingCore.Server is installed; Loading server src') require(module_path..'/src/server') end
|
||||
if loaded_modules['ExpGamingCore.Server'] then verbose('ExpGamingCore.Server is installed; Loading server src') require(module_path..'/src/server',{Ranking=Ranking}) end
|
||||
end
|
||||
|
||||
function Ranking:on_post()
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
{
|
||||
"name": "Ranking",
|
||||
"version": "4.0.0",
|
||||
"module": "Ranking",
|
||||
"type": "Submodule",
|
||||
"description": "A full ranking system for factorio.",
|
||||
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/ExpGamingCore.Ranking.zip",
|
||||
"keywords": [
|
||||
"Library",
|
||||
"Lib",
|
||||
@@ -12,8 +15,9 @@
|
||||
"Permissions",
|
||||
"Roles"
|
||||
],
|
||||
"version": "4.0.0",
|
||||
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/ExpGamingCore.Ranking.zip",
|
||||
"author": "<blank>",
|
||||
"contact": "<blank>",
|
||||
"license": "<blank>",
|
||||
"dependencies": {
|
||||
"ExpGamingLib": "^4.0.0",
|
||||
"FactorioStdLib.Color": "^0.8.0",
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
--- This file will be loaded when ExpGamingCore.Server is present
|
||||
-- @function _comment
|
||||
|
||||
local Game = require('FactorioStdLib.Game')
|
||||
local Color = require('FactorioStdLib.Color')
|
||||
local Server = require('ExpGamingCore.Server')
|
||||
|
||||
--- Print a message to all players of this rank
|
||||
-- @usage rank:print('foo') -- prints to all members of this rank
|
||||
-- @param rtn any value you want to return
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
-- @author Cooldude2606
|
||||
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||
|
||||
local Game = require('FactorioStdLib.Game')
|
||||
local Color = require('FactorioStdLib.Color')
|
||||
|
||||
local Server = {}
|
||||
local module_verbose = false --true|false
|
||||
|
||||
@@ -464,7 +467,7 @@ end)
|
||||
|
||||
function Server:on_init()
|
||||
for name,id in pairs(defines.events) do if not script.get_event_handler(id) then script.on_event(id,Server._thread_handler) end end
|
||||
if loaded_modules.commands then verbose('ExpGamingCore.Commands is installed; Loading commands src') require(module_path..'/src/commands') end
|
||||
if loaded_modules['ExpGamingCore.Commands'] then verbose('ExpGamingCore.Commands is installed; Loading commands src') require(module_path..'/src/commands',{Server=Server}) end
|
||||
end
|
||||
|
||||
return Server
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
{
|
||||
"name": "Server",
|
||||
"version": "4.0.0",
|
||||
"module": "Server",
|
||||
"type": "Submodule",
|
||||
"description": "Adds a thread system and event listening and a admin bypass (recommend to disable /c and use optional /interface)",
|
||||
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/ExpGamingCore.Server.zip",
|
||||
"keywords": [
|
||||
"Library",
|
||||
"Lib",
|
||||
@@ -12,15 +15,15 @@
|
||||
"Interface",
|
||||
"Events"
|
||||
],
|
||||
"version": "4.0.0",
|
||||
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/ExpGamingCore.Server.zip",
|
||||
"author": "<blank>",
|
||||
"contact": "<blank>",
|
||||
"license": "<blank>",
|
||||
"dependencies": {
|
||||
"ExpGamingLib": "^4.0.0",
|
||||
"FactorioStdLib.Table": "^0.8.0",
|
||||
"FactorioStdLib.Color": "^0.8.0",
|
||||
"FactorioStdLib.String": "^0.8.0",
|
||||
"FactorioStdLib.Game": "^0.8.0",
|
||||
"ExpGamingCore.Ranking": "?^4.0.0",
|
||||
"ExpGamingCore.Commands": "?^4.0.0"
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,8 @@
|
||||
--- This file will be loaded when ExpGamingCore.Commands is present
|
||||
-- @function _comment
|
||||
|
||||
local Game = require('FactorioStdLib.Game')
|
||||
|
||||
--- Runs the given input from the script
|
||||
-- @command interface
|
||||
-- @param code The code that will be ran
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
-- @author Cooldude2606
|
||||
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||
|
||||
local Game = require('FactorioStdLib.Game')
|
||||
local Color = require('FactorioStdLib.Color')
|
||||
|
||||
local Sync = {}
|
||||
local Sync_updates = {}
|
||||
local module_verbose = false --true|false
|
||||
@@ -292,8 +295,8 @@ script.on_event('on_tick',function(event)
|
||||
end)
|
||||
|
||||
function Sync:on_init()
|
||||
if loaded_modules.Gui then verbose('ExpGamingCore.Gui is installed; Loading gui src') require(module_path..'/src/gui') end
|
||||
if loaded_modules.Ranking then verbose('ExpGamingCore.Ranking is installed; Loading ranking src') require(module_path..'/src/ranking') end
|
||||
if loaded_modules['ExpGamingCore.Gui'] then verbose('ExpGamingCore.Gui is installed; Loading gui src') require(module_path..'/src/gui',{Sync=Sync}) end
|
||||
if loaded_modules['ExpGamingCore.Ranking'] then verbose('ExpGamingCore.Ranking is installed; Loading ranking src') require(module_path..'/src/ranking',{Sync=Sync}) end
|
||||
end
|
||||
|
||||
function Sync:on_post()
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
{
|
||||
"name": "Sync",
|
||||
"version": "4.0.0",
|
||||
"module": "Sync",
|
||||
"type": "Submodule",
|
||||
"description": "Allows syncing with an outside server and info panle.",
|
||||
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/ExpGamingCore.Sync.zip",
|
||||
"keywords": [
|
||||
"Library",
|
||||
"Lib",
|
||||
@@ -12,8 +15,9 @@
|
||||
"External",
|
||||
"Discord"
|
||||
],
|
||||
"version": "4.0.0",
|
||||
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/ExpGamingCore.Sync.zip",
|
||||
"author": "<blank>",
|
||||
"contact": "<blank>",
|
||||
"license": "<blank>",
|
||||
"dependencies": {
|
||||
"ExpGamingLib": "^4.0.0",
|
||||
"FactorioStdLib.Color": "^0.8.0",
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
--- This file will be loaded when ExpGamingCore.Gui is present
|
||||
-- @function _comment
|
||||
|
||||
local Game = require('FactorioStdLib.Game')
|
||||
local Gui = require('ExpGamingCore.Gui')
|
||||
|
||||
local Sync_gui_functions = {}
|
||||
|
||||
--- Adds a emeltent to the sever info gui
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
|
||||
--- This file will be loaded when ExpGamingCore.Ranking is present
|
||||
-- @function _comment
|
||||
|
||||
|
||||
local Game = require('FactorioStdLib.Game')
|
||||
local Color = require('FactorioStdLib.Color')
|
||||
local Ranking = require('ExpGamingCore.Ranking')
|
||||
|
||||
--- Used as a redirect to Ranking._base_preset that will set the rank given to a player apon joining
|
||||
-- @usage Sync.set_ranks{player_name=rank_name,...}
|
||||
function Sync.set_ranks(...)
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
{
|
||||
"name": "ExpGamingCore",
|
||||
"version": "4.0.0",
|
||||
"module": "Collection",
|
||||
"module": "expGamingCore",
|
||||
"type": "Collection",
|
||||
"description": "Explosive Gaming Core Files",
|
||||
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/ExpGamingCore.zip",
|
||||
"keywords": [
|
||||
@@ -16,8 +17,11 @@
|
||||
"submodules": {
|
||||
"Commands": {
|
||||
"name": "Commands",
|
||||
"version": "4.0.0",
|
||||
"module": "commands",
|
||||
"type": "Submodule",
|
||||
"description": "A better command handler than the base game.",
|
||||
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/ExpGamingCore.Commands.zip",
|
||||
"keywords": [
|
||||
"Library",
|
||||
"Lib",
|
||||
@@ -25,8 +29,6 @@
|
||||
"Core",
|
||||
"Commands"
|
||||
],
|
||||
"version": "4.0.0",
|
||||
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/ExpGamingCore.Commands.zip",
|
||||
"dependencies": {
|
||||
"ExpGamingLib": "^4.0.0",
|
||||
"FactorioStdLib.Table": "^0.8.0",
|
||||
@@ -37,8 +39,10 @@
|
||||
},
|
||||
"Gui": {
|
||||
"name": "Gui",
|
||||
"version": "4.0.0",
|
||||
"module": "Gui",
|
||||
"description": "Adds a objective version to custom guis.",
|
||||
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/ExpGamingCore.Gui.zip",
|
||||
"keywords": [
|
||||
"Library",
|
||||
"Lib",
|
||||
@@ -47,8 +51,6 @@
|
||||
"Gui",
|
||||
"ExpGui"
|
||||
],
|
||||
"version": "4.0.0",
|
||||
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/ExpGamingCore.Gui.zip",
|
||||
"dependencies": {
|
||||
"ExpGamingLib": "^4.0.0",
|
||||
"FactorioStdLib.Table": "^0.8.0",
|
||||
@@ -56,12 +58,15 @@
|
||||
"FactorioStdLib.Game": "^0.8.0",
|
||||
"ExpGamingCore.Ranking": "?^4.0.0",
|
||||
"ExpGamingCore.Server": "?^4.0.0"
|
||||
}
|
||||
},
|
||||
"type": "Submodule"
|
||||
},
|
||||
"Ranking": {
|
||||
"name": "Ranking",
|
||||
"version": "4.0.0",
|
||||
"module": "Ranking",
|
||||
"description": "A full ranking system for factorio.",
|
||||
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/ExpGamingCore.Ranking.zip",
|
||||
"keywords": [
|
||||
"Library",
|
||||
"Lib",
|
||||
@@ -72,20 +77,21 @@
|
||||
"Permissions",
|
||||
"Roles"
|
||||
],
|
||||
"version": "4.0.0",
|
||||
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/ExpGamingCore.Ranking.zip",
|
||||
"dependencies": {
|
||||
"ExpGamingLib": "^4.0.0",
|
||||
"FactorioStdLib.Color": "^0.8.0",
|
||||
"FactorioStdLib.Table": "^0.8.0",
|
||||
"FactorioStdLib.Game": "^0.8.0",
|
||||
"ExpGamingCore.Server": "?^4.0.0"
|
||||
}
|
||||
},
|
||||
"type": "Submodule"
|
||||
},
|
||||
"Server": {
|
||||
"name": "Server",
|
||||
"version": "4.0.0",
|
||||
"module": "Server",
|
||||
"description": "Adds a thread system and event listening and a admin bypass (recommend to disable /c and use optional /interface)",
|
||||
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/ExpGamingCore.Server.zip",
|
||||
"keywords": [
|
||||
"Library",
|
||||
"Lib",
|
||||
@@ -96,8 +102,6 @@
|
||||
"Interface",
|
||||
"Events"
|
||||
],
|
||||
"version": "4.0.0",
|
||||
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/ExpGamingCore.Server.zip",
|
||||
"dependencies": {
|
||||
"ExpGamingLib": "^4.0.0",
|
||||
"FactorioStdLib.Table": "^0.8.0",
|
||||
@@ -106,12 +110,15 @@
|
||||
"FactorioStdLib.Game": "^0.8.0",
|
||||
"ExpGamingCore.Ranking": "?^4.0.0",
|
||||
"ExpGamingCore.Commands": "?^4.0.0"
|
||||
}
|
||||
},
|
||||
"type": "Submodule"
|
||||
},
|
||||
"Sync": {
|
||||
"name": "Sync",
|
||||
"version": "4.0.0",
|
||||
"module": "Sync",
|
||||
"description": "Allows syncing with an outside server and info panle.",
|
||||
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/ExpGamingCore.Sync.zip",
|
||||
"keywords": [
|
||||
"Library",
|
||||
"Lib",
|
||||
@@ -122,8 +129,6 @@
|
||||
"External",
|
||||
"Discord"
|
||||
],
|
||||
"version": "4.0.0",
|
||||
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/ExpGamingCore.Sync.zip",
|
||||
"dependencies": {
|
||||
"ExpGamingLib": "^4.0.0",
|
||||
"FactorioStdLib.Color": "^0.8.0",
|
||||
@@ -131,8 +136,8 @@
|
||||
"FactorioStdLib.Table": "^0.8.0",
|
||||
"ExpGamingCore.Ranking": "?^4.0.0",
|
||||
"ExpGamingCore.Gui": "?^4.0.0"
|
||||
}
|
||||
},
|
||||
"type": "Submodule"
|
||||
}
|
||||
},
|
||||
"dependencies": {}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user