Updated Module to use require

This commit is contained in:
Cooldude2606
2018-06-22 19:17:36 +01:00
parent 5602a2aece
commit 90450056bf
47 changed files with 1042 additions and 504 deletions

View File

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

View File

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

View File

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