Updated Json File To Remove module atibute

This commit is contained in:
Cooldude2606
2018-06-23 10:07:26 +01:00
parent f3d6d20ed5
commit 593d484f37
18 changed files with 22 additions and 33 deletions

View File

@@ -6,9 +6,7 @@
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
local Ranking -- this is optional and is hanndled by it being present, it is loaded on init
--- Used as an error constant for validation
-- @field commands.error
@@ -226,6 +224,10 @@ commands.add_command = function(name, description, inputs, callback)
end)
end
function commands:on_init()
if loaded_modules['ExpGamingCore.Ranking'] then Ranking = require('ExpGamingCore.Ranking') end
end
--[[
command example

View File

@@ -1,7 +1,6 @@
{
"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",

View File

@@ -157,6 +157,8 @@ script.on_event('on_player_respawned',function(event)
end)
function Gui:on_init()
self.left:on_init(); self.left.on_init = nil
self.toolbar:on_init(); self.toolbar.on_init = nil
if loaded_modules['ExpGamingCore.Server'] then verbose('ExpGamingCore.Server is installed; Loading server src') require(module_path..'/src/server',{Gui=Gui}) end
if loaded_modules['ExpGamingCore.Ranking'] then
verbose('ExpGamingCore.Ranking is installed; Loading ranking src')

View File

@@ -1,7 +1,6 @@
{
"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",

View File

@@ -9,8 +9,7 @@
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 Ranking -- this is optional and is hanndled by it being present, it is loaded on init
local mod_gui = require("mod-gui")
local Gui = Gui -- this is to force gui to remain in the ENV
@@ -181,4 +180,8 @@ left.on_player_joined_game = function(event)
end
end
function left:on_init()
if loaded_modules['ExpGamingCore.Ranking'] then Ranking = require('ExpGamingCore.Ranking') end
end
return left

View File

@@ -8,8 +8,7 @@
-- @function _comment
local Game = require('FactorioStdLib.Game')
local success, Ranking = pcall(require,'ExpGamingCore.Ranking')
if not success then Ranking = nil end success = nil
local Ranking -- this is optional and is hanndled by it being present, it is loaded on init
local mod_gui = require("mod-gui")
local Gui = Gui -- this is to force gui to remain in the ENV
@@ -49,6 +48,10 @@ function toolbar.draw(player)
end
end
function toolbar:on_init()
if loaded_modules['ExpGamingCore.Ranking'] then Ranking = require('ExpGamingCore.Ranking') end
end
toolbar.on_rank_change = toolbar.draw
toolbar.on_player_joined_game = toolbar.draw
return toolbar

View File

@@ -1,7 +1,6 @@
{
"name": "Ranking",
"version": "4.0.0",
"module": "Ranking",
"version": "4.0.0",
"type": "Submodule",
"description": "A full ranking system for factorio.",
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/ExpGamingCore.Ranking.zip",

View File

@@ -1,7 +1,6 @@
{
"name": "Server",
"version": "4.0.0",
"module": "Server",
"version": "4.0.0",
"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",

View File

@@ -27,7 +27,8 @@ commands.add_command('interface',{'Server.interface-description'}, {
env.position = game.player.position
env.entity = game.player.selected
env.tile = game.player.surface.get_tile(game.player.position)
if Ranking and Ranking.get_rank then env.rank = Ranking.get_rank(game.player) end
-- this works if loaded modules is not present as Mamager will always have the modules
if Manager['ExpGamingCore.Ranking'] then env.rank = Manager['ExpGamingCore.Ranking'].get_rank(game.player) end
end
-- runs the function
local success, err = Server.interface(callback,false,env)

View File

@@ -1,7 +1,6 @@
{
"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",

View File

@@ -1,7 +1,6 @@
{
"name": "ExpGamingCore",
"version": "4.0.0",
"module": "expGamingCore",
"type": "Collection",
"description": "Explosive Gaming Core Files",
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/ExpGamingCore.zip",
@@ -18,7 +17,6 @@
"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",
@@ -40,7 +38,6 @@
"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": [
@@ -64,7 +61,6 @@
"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": [
@@ -89,7 +85,6 @@
"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": [
@@ -108,7 +103,6 @@
"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"
},
"type": "Submodule"
@@ -116,7 +110,6 @@
"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": [

View File

@@ -1,7 +1,6 @@
{
"name": "ExpGamingLib",
"version": "4.0.0",
"module": "GlobalLib",
"type": "Module",
"description": "Adds some common functions used though out all ExpGaming modules",
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/ExpGamingLib.zip",

View File

@@ -1,7 +1,6 @@
{
"name": "Color",
"version": "0.8.0",
"module": "Color",
"type": "Submodule",
"description": "A defines module for retrieving colors by name.",
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/FactorioStdLib.Color.zip",

View File

@@ -1,7 +1,6 @@
{
"name": "Game",
"version": "0.8.0",
"module": "Game",
"type": "Submodule",
"description": "The game module.",
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/FactorioStdLib.Game.zip",

View File

@@ -1,7 +1,6 @@
{
"name": "String",
"version": "0.8.0",
"module": "string",
"type": "Submodule",
"description": "Extends Lua 5.2 string.",
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/FactorioStdLib.String.zip",

View File

@@ -1,7 +1,6 @@
{
"name": "Table",
"version": "0.8.0",
"module": "table",
"type": "Submodule",
"description": "Extends Lua 5.2 table.",
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/FactorioStdLib.Table.zip",

View File

@@ -1,7 +1,6 @@
{
"name": "FactorioStdLib",
"version": "0.8.0",
"module": "factorioStdLib",
"type": "Collection",
"description": "Factorio Standard Library Projects",
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/FactorioStdLib.zip",
@@ -17,7 +16,6 @@
"Color": {
"name": "Color",
"version": "0.8.0",
"module": "Color",
"type": "Submodule",
"description": "A defines module for retrieving colors by name.",
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/FactorioStdLib.Color.zip",
@@ -33,7 +31,6 @@
"Game": {
"name": "Game",
"version": "0.8.0",
"module": "Game",
"type": "Submodule",
"description": "The game module.",
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/FactorioStdLib.Game.zip",
@@ -49,7 +46,6 @@
"String": {
"name": "String",
"version": "0.8.0",
"module": "string",
"type": "Submodule",
"description": "Extends Lua 5.2 string.",
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/FactorioStdLib.String.zip",
@@ -65,7 +61,6 @@
"Table": {
"name": "Table",
"version": "0.8.0",
"module": "table",
"type": "Submodule",
"description": "Extends Lua 5.2 table.",
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/FactorioStdLib.Table.zip",

View File

@@ -1,7 +1,7 @@
{
"name": "ExpGamingScenario",
"version": "0.16.51",
"module": "expGamingScenario",
"type": "Scenario",
"description": "Explosive gaming's factorio secenario ran on every public server",
"modules": {