mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-30 12:31:41 +09:00
Fixed lua ENV stuff and non saving globals
This commit is contained in:
@@ -27,11 +27,11 @@ Gui.data = setmetatable({},{
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
Gui.center = require(module_path..'/src/center')
|
Gui.center = require(module_path..'/src/center',{Gui=Gui})
|
||||||
Gui.inputs = require(module_path..'/src/inputs')
|
Gui.inputs = require(module_path..'/src/inputs',{Gui=Gui})
|
||||||
Gui.left = require(module_path..'/src/left')
|
Gui.left = require(module_path..'/src/left',{Gui=Gui})
|
||||||
Gui.popup = require(module_path..'/src/popup')
|
Gui.popup = require(module_path..'/src/popup',{Gui=Gui})
|
||||||
Gui.toolbar = require(module_path..'/src/toolbar')
|
Gui.toolbar = require(module_path..'/src/toolbar',{Gui=Gui})
|
||||||
|
|
||||||
--- Add a white bar to any gui frame
|
--- Add a white bar to any gui frame
|
||||||
-- @usage Gui.bar(frame,100)
|
-- @usage Gui.bar(frame,100)
|
||||||
@@ -157,7 +157,7 @@ script.on_event('on_player_respawned',function(event)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
function Gui:on_init()
|
function Gui:on_init()
|
||||||
if loaded_modules['ExpGamingCore.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',{Gui=Gui}) end
|
||||||
if loaded_modules['ExpGamingCore.Ranking'] then
|
if loaded_modules['ExpGamingCore.Ranking'] then
|
||||||
verbose('ExpGamingCore.Ranking is installed; Loading ranking src')
|
verbose('ExpGamingCore.Ranking is installed; Loading ranking src')
|
||||||
script.on_event('on_rank_change',function(event)
|
script.on_event('on_rank_change',function(event)
|
||||||
@@ -173,7 +173,7 @@ function Gui:on_init()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Gui:on_post()
|
function Gui:on_post()
|
||||||
Gui.test = require(module_path..'/src/test')
|
Gui.test = require(module_path..'/src/test',{Gui=Gui})
|
||||||
Gui.popup.load() Gui.popup.load = nil
|
Gui.popup.load() Gui.popup.load = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
local Game = require('FactorioStdLib.Game')
|
local Game = require('FactorioStdLib.Game')
|
||||||
local Color = require('FactorioStdLib.Color')
|
local Color = require('FactorioStdLib.Color')
|
||||||
local mod_gui = require("mod-gui")
|
local mod_gui = require("mod-gui")
|
||||||
|
local Gui = Gui -- this is to force gui to remain in the ENV
|
||||||
|
|
||||||
local center = {}
|
local center = {}
|
||||||
center._center = {}
|
center._center = {}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
local Game = require('FactorioStdLib.Game')
|
local Game = require('FactorioStdLib.Game')
|
||||||
local Color = require('FactorioStdLib.Color')
|
local Color = require('FactorioStdLib.Color')
|
||||||
local mod_gui = require("mod-gui")
|
local mod_gui = require("mod-gui")
|
||||||
|
local Gui = Gui -- this is to force gui to remain in the ENV
|
||||||
|
|
||||||
local inputs = {}
|
local inputs = {}
|
||||||
inputs._input = {}
|
inputs._input = {}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ local Color = require('FactorioStdLib.Color')
|
|||||||
local success, Ranking = pcall(require,'ExpGamingCore.Ranking')
|
local success, Ranking = pcall(require,'ExpGamingCore.Ranking')
|
||||||
if not success then Ranking = nil end success = nil
|
if not success then Ranking = nil end success = nil
|
||||||
local mod_gui = require("mod-gui")
|
local mod_gui = require("mod-gui")
|
||||||
|
local Gui = Gui -- this is to force gui to remain in the ENV
|
||||||
|
|
||||||
local left = {}
|
local left = {}
|
||||||
left._left = {}
|
left._left = {}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
local Game = require('FactorioStdLib.Game')
|
local Game = require('FactorioStdLib.Game')
|
||||||
local mod_gui = require("mod-gui")
|
local mod_gui = require("mod-gui")
|
||||||
|
local Gui = Gui -- this is to force gui to remain in the ENV
|
||||||
|
|
||||||
local popup = {}
|
local popup = {}
|
||||||
popup._popup = {}
|
popup._popup = {}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
local Game = require('FactorioStdLib.Game')
|
local Game = require('FactorioStdLib.Game')
|
||||||
local Server = require('ExpGamingCore.Server')
|
local Server = require('ExpGamingCore.Server')
|
||||||
|
local Gui = Gui -- this is to force gui to remain in the ENV
|
||||||
|
|
||||||
--- Adds a server thread that allows the camera follows to be toggled off and on
|
--- Adds a server thread that allows the camera follows to be toggled off and on
|
||||||
-- @function __comment
|
-- @function __comment
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
--- This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module
|
--- This is a submodule of ExpGamingCore.Gui but for ldoc reasons it is under its own module
|
||||||
-- @function _comment
|
-- @function _comment
|
||||||
|
|
||||||
local Gui = require('ExpGamingCore.Gui')
|
local Gui = Gui -- this is to force gui to remain in the ENV
|
||||||
local mod_gui = require("mod-gui")
|
local mod_gui = require("mod-gui")
|
||||||
|
|
||||||
local gui_tset_close = Gui.inputs.add{
|
local gui_tset_close = Gui.inputs.add{
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ local Game = require('FactorioStdLib.Game')
|
|||||||
local success, Ranking = pcall(require,'ExpGamingCore.Ranking')
|
local success, Ranking = pcall(require,'ExpGamingCore.Ranking')
|
||||||
if not success then Ranking = nil end success = nil
|
if not success then Ranking = nil end success = nil
|
||||||
local mod_gui = require("mod-gui")
|
local mod_gui = require("mod-gui")
|
||||||
|
local Gui = Gui -- this is to force gui to remain in the ENV
|
||||||
|
|
||||||
local toolbar = {}
|
local toolbar = {}
|
||||||
|
|
||||||
|
|||||||
@@ -143,6 +143,7 @@ end
|
|||||||
-- @function errorHandler
|
-- @function errorHandler
|
||||||
-- @tparam string err the error passed by the err control
|
-- @tparam string err the error passed by the err control
|
||||||
error.addHandler('Discord Emit',function(err)
|
error.addHandler('Discord Emit',function(err)
|
||||||
|
if not game then return error(error()) end
|
||||||
local color = Color and Color.to_hex(defines.textcolor.bg) or '0x0'
|
local color = Color and Color.to_hex(defines.textcolor.bg) or '0x0'
|
||||||
Sync.emit_embeded{title='SCRIPT ERROR',color=color,description='There was an error in the script @Developers ',Error=err}
|
Sync.emit_embeded{title='SCRIPT ERROR',color=color,description='There was an error in the script @Developers ',Error=err}
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
local Game = require('FactorioStdLib.Game')
|
local Game = require('FactorioStdLib.Game')
|
||||||
local Gui = require('ExpGamingCore.Gui')
|
local Gui = require('ExpGamingCore.Gui')
|
||||||
|
local Sync = Sync -- this is to force sync to remain in the ENV
|
||||||
|
|
||||||
local Sync_gui_functions = {}
|
local Sync_gui_functions = {}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user