mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 11:35:22 +09:00
Change to require
This commit is contained in:
@@ -17,11 +17,11 @@ Pass a table with the names of the objects you want and it will be return in tha
|
|||||||
|
|
||||||
local StdExpCoreLib = {}
|
local StdExpCoreLib = {}
|
||||||
|
|
||||||
require('/commands')
|
require('commands')
|
||||||
StdExpCoreLib.Ranking = require('/ranking')
|
StdExpCoreLib.Ranking = require('ranking')
|
||||||
StdExpCoreLib.Server = require('/server')
|
StdExpCoreLib.Server = require('server')
|
||||||
StdExpCoreLib.Sync = require('/sync')
|
StdExpCoreLib.Sync = require('sync')
|
||||||
StdExpCoreLib.Gui = require('/gui')
|
StdExpCoreLib.Gui = require('gui')
|
||||||
verbose('Begain Gui Part Loading')
|
verbose('Begain Gui Part Loading')
|
||||||
StdExpCoreLib.Gui:_load_parts{
|
StdExpCoreLib.Gui:_load_parts{
|
||||||
'inputs',
|
'inputs',
|
||||||
|
|||||||
@@ -17,12 +17,12 @@ Pass a table with the names of the objects you want and it will be return in tha
|
|||||||
|
|
||||||
local StdLib = {}
|
local StdLib = {}
|
||||||
|
|
||||||
require('/table')
|
require('table')
|
||||||
require('/string')
|
require('string')
|
||||||
require('/time')
|
require('time')
|
||||||
StdLib.Color = require('/color')
|
StdLib.Color = require('color')
|
||||||
StdLib.Game = require('/game')
|
StdLib.Game = require('game')
|
||||||
StdLib.Event = require('/event')
|
StdLib.Event = require('event')
|
||||||
|
|
||||||
return function(rtn)
|
return function(rtn)
|
||||||
local _return = {}
|
local _return = {}
|
||||||
|
|||||||
11
control.lua
11
control.lua
@@ -33,9 +33,16 @@ verbose('============================= START =============================')
|
|||||||
require_return_err = false -- Set to false when removing files; set to true for debuging
|
require_return_err = false -- Set to false when removing files; set to true for debuging
|
||||||
_require = require
|
_require = require
|
||||||
require = function(path)
|
require = function(path)
|
||||||
|
local _path = path
|
||||||
|
if not string.sub(path,1) == '/' then path = '/'..path end
|
||||||
local _return = {pcall(_require,path)}
|
local _return = {pcall(_require,path)}
|
||||||
if not table.remove(_return, 1) then verbose('Failed to load: '..path..' ('.._return[1]..')') if require_return_err then error(unpack(_return)) end
|
if not table.remove(_return, 1) then
|
||||||
else verbose('Loaded: '..path) end
|
local __return = {pcall(_require,'/..'..path)}
|
||||||
|
if not table.remove(__return, 1) then
|
||||||
|
verbose('Failed to load: '.._path..' ('.._return[1]..')')
|
||||||
|
if require_return_err then error(unpack(_return)) end
|
||||||
|
else verbose('Loaded: '.._path) return unpack(__return) end
|
||||||
|
else verbose('Loaded: '.._path) end
|
||||||
return unpack(_return)
|
return unpack(_return)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user