mirror of
https://gitlab.com/4w/mtimer.git
synced 2024-12-01 03:33:56 +01:00
refactor init and automate formspec files loading
This commit is contained in:
parent
91c7ddd0b8
commit
caecb410e8
26
init.lua
26
init.lua
@ -1,6 +1,7 @@
|
|||||||
local modpath = minetest.get_modpath('mtimer')..DIR_DELIM
|
local modpath = minetest.get_modpath('mtimer')..DIR_DELIM
|
||||||
local syspath = modpath..'system'..DIR_DELIM
|
local syspath = modpath..'system'..DIR_DELIM
|
||||||
|
local fspath = syspath..'formspecs'..DIR_DELIM
|
||||||
|
local get_dir_list = minetest.get_dir_list
|
||||||
|
|
||||||
-- Set initial global `mtimer` table
|
-- Set initial global `mtimer` table
|
||||||
--
|
--
|
||||||
@ -17,18 +18,19 @@ mtimer = {
|
|||||||
dofile(syspath..'load_configuration.lua')
|
dofile(syspath..'load_configuration.lua')
|
||||||
|
|
||||||
|
|
||||||
-- Load formspec functionality
|
-- Load formspec-related files
|
||||||
dofile(syspath..'formspec'..DIR_DELIM..'formspec_helpers.lua')
|
dofile(syspath..'formspec_helpers.lua')
|
||||||
dofile(syspath..'formspec'..DIR_DELIM..'main_menu.lua')
|
|
||||||
dofile(syspath..'formspec'..DIR_DELIM..'real_time_universal.lua')
|
|
||||||
dofile(syspath..'formspec'..DIR_DELIM..'formspec_creation.lua')
|
|
||||||
|
|
||||||
|
|
||||||
-- Load system
|
|
||||||
dofile(syspath..'chat_command.lua')
|
|
||||||
dofile(syspath..'update_timer.lua')
|
|
||||||
dofile(syspath..'on_receive_fields.lua')
|
dofile(syspath..'on_receive_fields.lua')
|
||||||
dofile(syspath..'on_joinplayer.lua')
|
for _,f in pairs(get_dir_list(fspath, false)) do dofile(fspath..f) end
|
||||||
|
|
||||||
|
|
||||||
|
-- Load timer actions
|
||||||
dofile(syspath..'get_times.lua')
|
dofile(syspath..'get_times.lua')
|
||||||
dofile(syspath..'get_timer_data.lua')
|
dofile(syspath..'get_timer_data.lua')
|
||||||
|
dofile(syspath..'update_timer.lua')
|
||||||
|
|
||||||
|
|
||||||
|
-- Load player-related functionality
|
||||||
|
dofile(syspath..'chat_command.lua')
|
||||||
|
dofile(syspath..'on_joinplayer.lua')
|
||||||
dofile(syspath..'register_globalstep.lua')
|
dofile(syspath..'register_globalstep.lua')
|
||||||
|
Loading…
Reference in New Issue
Block a user