Rename API -> SYSTEM
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
"enables": [],
|
||||
"globals": [
|
||||
"core",
|
||||
"Smc",
|
||||
"table",
|
||||
"Events",
|
||||
"VoxelArea",
|
||||
|
||||
8
.gitmodules
vendored
8
.gitmodules
vendored
@@ -1,7 +1,7 @@
|
||||
[submodule "mods/API/Utf8"]
|
||||
path = mods/API/Utf8
|
||||
url = https://https://git.apancore.ru/Apancore.Studio/utf8_api
|
||||
branch = main
|
||||
#[submodule "mods/SYSTEM/Utf8"]
|
||||
# path = mods/SYSTEM/Utf8
|
||||
# url = https://https://git.apancore.ru/Apancore.Studio/utf8_api
|
||||
# branch = main
|
||||
[submodule "util/ide-helper"]
|
||||
path = util/ide-helper
|
||||
url = https://github.com/Voxrame/luanti-ide-helper.git
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
local modInfo = Mod.getInfo('smc__api__api')
|
||||
local require = modInfo.require
|
||||
|
||||
require('Api')
|
||||
@@ -1,3 +0,0 @@
|
||||
name = smc__api__api
|
||||
description = Include this mod in your `depends` to ensure all necessary APIs are loaded for your mod
|
||||
depends = smc__api__ensure, smc__api__math, smc__api__mod, smc__api__require, smc__api__table, smc__api__string, smc__api__utf8, smc__api__class
|
||||
@@ -1,6 +0,0 @@
|
||||
Api = {}
|
||||
|
||||
local modInfo = Mod.getInfo('smc__api__api')
|
||||
local require = modInfo.require
|
||||
|
||||
require('Api.globalStep')
|
||||
@@ -1 +0,0 @@
|
||||
name = smc__api__class
|
||||
@@ -1 +0,0 @@
|
||||
name = smc__api__ensure
|
||||
@@ -1,2 +0,0 @@
|
||||
name = smc__api__events
|
||||
depends = smc__api__table
|
||||
@@ -1 +0,0 @@
|
||||
name = smc__api__logger
|
||||
@@ -1 +0,0 @@
|
||||
name = smc__api__math
|
||||
@@ -1 +0,0 @@
|
||||
name = smc__api__mod
|
||||
@@ -1 +0,0 @@
|
||||
name = smc__api__require
|
||||
@@ -1,2 +0,0 @@
|
||||
name = smc__api__string
|
||||
depends = smc__api__ensure
|
||||
@@ -1,2 +0,0 @@
|
||||
name = smc__api__table
|
||||
depends = smc__api__ensure
|
||||
0
mods/API/Utf8/init.lua
Normal file
0
mods/API/Utf8/init.lua
Normal file
@@ -1 +0,0 @@
|
||||
name = smc__api
|
||||
@@ -1,2 +1,2 @@
|
||||
name = smc__core__control
|
||||
depends = smc__api__api
|
||||
depends = smc__system__system_loader
|
||||
|
||||
@@ -80,7 +80,7 @@ core.register_on_leaveplayer(function(player, timed_out)
|
||||
playersControlTimer[playerName] = nil
|
||||
end)
|
||||
|
||||
Api.registerGlobalStepForEachPlayer(0, function(deltaTime, player)
|
||||
Smc.registerGlobalStepForEachPlayer(0, function(deltaTime, player)
|
||||
if player == nil then
|
||||
return
|
||||
end
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
name = smc__core__craft_system
|
||||
depends = smc__api__api
|
||||
depends = smc__system__system_loader
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
name = smc__core__formspec
|
||||
depends = smc__api__api
|
||||
depends = smc__system__system_loader
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
name = smc__core__item
|
||||
depends = smc__api__api, smc__core__item_factory
|
||||
depends = smc__system__system_loader, smc__core__item_factory
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
name = smc__core__item_factory
|
||||
depends = smc__api__api
|
||||
depends = smc__system__system_loader
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
name = smc__core__map_gen
|
||||
depends = smc__api__api
|
||||
depends = smc__system__system_loader
|
||||
@@ -1,2 +1,2 @@
|
||||
name = smc__core__player
|
||||
depends = smc__api__api
|
||||
depends = smc__system__system_loader
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
name = smc__core__sound
|
||||
depends = smc__api__api
|
||||
depends = smc__system__system_loader
|
||||
@@ -1,2 +1,2 @@
|
||||
name = smc__core__tilesheet
|
||||
depends = smc__api__api
|
||||
depends = smc__system__system_loader
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
name = smc__core__admin_commands
|
||||
depends = smc__api__api, smc__core__formspec, smc__core__item
|
||||
depends = smc__system__system_loader, smc__core__formspec, smc__core__item
|
||||
|
||||
@@ -6,37 +6,37 @@
|
||||
|
||||
-- --- Global APIs load --
|
||||
-- Class
|
||||
dofile(core.get_modpath('smc__api__class')..'/init.lua')
|
||||
dofile(core.get_modpath('smc__system__class')..'/init.lua')
|
||||
|
||||
-- Ensure
|
||||
dofile(core.get_modpath('smc__api__ensure')..'/init.lua')
|
||||
dofile(core.get_modpath('smc__system__ensure')..'/init.lua')
|
||||
|
||||
-- Logger
|
||||
dofile(core.get_modpath('smc__api__logger')..'/init.lua')
|
||||
dofile(core.get_modpath('smc__system__logger')..'/init.lua')
|
||||
|
||||
-- Math
|
||||
dofile(core.get_modpath('smc__api__math')..'/init.lua')
|
||||
dofile(core.get_modpath('smc__system__math')..'/init.lua')
|
||||
|
||||
-- Require
|
||||
dofile(core.get_modpath('smc__api__require')..'/init.lua')
|
||||
dofile(core.get_modpath('smc__system__require')..'/init.lua')
|
||||
|
||||
-- Mod
|
||||
dofile(core.get_modpath('smc__api__mod')..'/init.lua')
|
||||
dofile(core.get_modpath('smc__system__mod')..'/init.lua')
|
||||
|
||||
-- TODO: исправить загрузку строковых библиотек (хотя они пока что не юзаются в мапгене)
|
||||
-- Они не работают из-за get_current_modname внутри utf8
|
||||
-- UTF-8
|
||||
-- dofile(core.get_modpath('smc__api__utf8')..'/init.lua')
|
||||
-- dofile(core.get_modpath('smc__system__utf8')..'/init.lua')
|
||||
|
||||
-- String
|
||||
-- dofile(core.get_modpath('smc__api__string')..'/init.lua')
|
||||
-- dofile(core.get_modpath('smc__system__string')..'/init.lua')
|
||||
|
||||
-- Table
|
||||
dofile(core.get_modpath('smc__api__table')..'/init.lua')
|
||||
dofile(core.get_modpath('smc__system__table')..'/init.lua')
|
||||
|
||||
-- TODO: пока что закоментировано, поскольку вызывает ошибку из-за global_step
|
||||
-- Api loader
|
||||
-- dofile(core.get_modpath('smc__api__api')..'/init.lua')
|
||||
-- Smc lib loader
|
||||
-- dofile(core.get_modpath('smc__system__helper_lib')..'/init.lua')
|
||||
|
||||
---@type MapGen
|
||||
local mapGenerator = dofile(core.get_modpath('smc__core__map_generator')..'/src/mapGenerator.lua')
|
||||
|
||||
1
mods/SYSTEM/Class/mod.conf
Normal file
1
mods/SYSTEM/Class/mod.conf
Normal file
@@ -0,0 +1 @@
|
||||
name = smc__system__class
|
||||
1
mods/SYSTEM/Ensure/mod.conf
Normal file
1
mods/SYSTEM/Ensure/mod.conf
Normal file
@@ -0,0 +1 @@
|
||||
name = smc__system__ensure
|
||||
2
mods/SYSTEM/Events/mod.conf
Normal file
2
mods/SYSTEM/Events/mod.conf
Normal file
@@ -0,0 +1,2 @@
|
||||
name = smc__system__events
|
||||
depends = smc__system__table
|
||||
4
mods/SYSTEM/HelperLib/init.lua
Normal file
4
mods/SYSTEM/HelperLib/init.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
local modInfo = Mod.getInfo('smc__system__helper_lib')
|
||||
local require = modInfo.require
|
||||
|
||||
require('Lib')
|
||||
2
mods/SYSTEM/HelperLib/mod.conf
Normal file
2
mods/SYSTEM/HelperLib/mod.conf
Normal file
@@ -0,0 +1,2 @@
|
||||
name = smc__system__helper_lib
|
||||
depends = smc__system__ensure
|
||||
6
mods/SYSTEM/HelperLib/src/Lib.lua
Normal file
6
mods/SYSTEM/HelperLib/src/Lib.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
Smc = {}
|
||||
|
||||
local modInfo = Mod.getInfo('smc__system__helper_lib')
|
||||
local require = modInfo.require
|
||||
|
||||
require('Lib.globalStep')
|
||||
@@ -3,7 +3,7 @@ local callsWithDelay = {}
|
||||
|
||||
---@param timeDelay number
|
||||
---@param callbackFunc fun(deltaTime:number)
|
||||
function Api.registerGlobalStepWithDelay(timeDelay, callbackFunc)
|
||||
function Smc.registerGlobalStepWithDelay(timeDelay, callbackFunc)
|
||||
table.insert(callsWithDelay, {
|
||||
timeDelay = timeDelay,
|
||||
callbackFunc = callbackFunc,
|
||||
@@ -40,7 +40,7 @@ local callsForEachPlayer = {}
|
||||
|
||||
---@param timeDelay number
|
||||
---@param callbackFunc fun(deltaTime:number, player:Player)
|
||||
function Api.registerGlobalStepForEachPlayer(timeDelay, callbackFunc)
|
||||
function Smc.registerGlobalStepForEachPlayer(timeDelay, callbackFunc)
|
||||
table.insert(callsWithDelay, {
|
||||
timeDelay = timeDelay,
|
||||
callbackFunc = callbackFunc,
|
||||
1
mods/SYSTEM/Logger/mod.conf
Normal file
1
mods/SYSTEM/Logger/mod.conf
Normal file
@@ -0,0 +1 @@
|
||||
name = smc__system__logger
|
||||
1
mods/SYSTEM/Math/mod.conf
Normal file
1
mods/SYSTEM/Math/mod.conf
Normal file
@@ -0,0 +1 @@
|
||||
name = smc__system__math
|
||||
1
mods/SYSTEM/Mod/mod.conf
Normal file
1
mods/SYSTEM/Mod/mod.conf
Normal file
@@ -0,0 +1 @@
|
||||
name = smc__system__mod
|
||||
1
mods/SYSTEM/Require/mod.conf
Normal file
1
mods/SYSTEM/Require/mod.conf
Normal file
@@ -0,0 +1 @@
|
||||
name = smc__system__require
|
||||
2
mods/SYSTEM/String/mod.conf
Normal file
2
mods/SYSTEM/String/mod.conf
Normal file
@@ -0,0 +1,2 @@
|
||||
name = smc__system__string
|
||||
depends = smc__system__ensure
|
||||
0
mods/SYSTEM/SystemLoader/init.lua
Normal file
0
mods/SYSTEM/SystemLoader/init.lua
Normal file
3
mods/SYSTEM/SystemLoader/mod.conf
Normal file
3
mods/SYSTEM/SystemLoader/mod.conf
Normal file
@@ -0,0 +1,3 @@
|
||||
name = smc__system__system_loader
|
||||
description = Include this mod in your `depends` to ensure all necessary Libs are loaded for your mod
|
||||
depends = smc__system__ensure, smc__system__math, smc__system__mod, smc__system__require, smc__system__table, smc__system__string, smc__system__utf8, smc__system__class, smc__system__helper_lib
|
||||
2
mods/SYSTEM/Table/mod.conf
Normal file
2
mods/SYSTEM/Table/mod.conf
Normal file
@@ -0,0 +1,2 @@
|
||||
name = smc__system__table
|
||||
depends = smc__system__ensure
|
||||
1
mods/SYSTEM/modpack.conf
Normal file
1
mods/SYSTEM/modpack.conf
Normal file
@@ -0,0 +1 @@
|
||||
name = smc__system
|
||||
Reference in New Issue
Block a user