mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-30 04:21:41 +09:00
Updated Module to use require
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user