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

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

View File

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

View File

@@ -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 = {}

View File

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

View File

@@ -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 = {}

View File

@@ -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 = {}

View File

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

View File

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

View File

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