*modpol.add_member() -- added a check if the member is already a member of that organized *storage -- fixed bug by moving storageref to top of file *added on_joinplayer to add players to instance *moved minetest specific code in init.lua to modpol_minetest, organized in folders. All overrides in one folder, all chatcommands in another, the on_joinplayer in modpol_minetest/orgs/instance.lua
48 lines
2.0 KiB
Lua
48 lines
2.0 KiB
Lua
modpol = {}
|
|
|
|
|
|
-- ===================================================================
|
|
--preoverrides: certain things must be predefined in the global table for them to have effect (or cmd line version defualts are used)
|
|
-- ===================================================================
|
|
-- ===================================================================
|
|
-- currently:
|
|
-- --get_script_dir: get modpol_minetest's version of directory
|
|
-- -- Persistent storage
|
|
-- -- -- must implement modpol.load_storage() and modpol.store_data()
|
|
-- -- -- defines the path for the lua file
|
|
|
|
|
|
|
|
-- get modpol_minetest's version of directory
|
|
modpol.get_script_dir = function()
|
|
return minetest.get_modpath("modpol")
|
|
end
|
|
|
|
-- TKTK: Implement minetest settingtypes for this... for now, the default is to use minetest mod storage.
|
|
-- However, the default for if modpol.lua is called from the cmd line is to use local storage
|
|
-- Any other implementation may with to make their own persistent storage file and declare it befoe calling modpol.lua in a similar manner
|
|
|
|
-- works with cmd line: "/storage/storage-local.lua", works with Minetest 5.0 and up: "/storage/storage-mod_storage.lua"
|
|
|
|
modpol.storage_file_path = minetest.get_modpath("modpol").."/storage/storage-mod_storage.lua"
|
|
|
|
-- ===================================================================
|
|
-- /init.lua
|
|
-- Modular Politics (modpol) for Minetest
|
|
-- TKTK Maybe make this just a quick ref file and locate MT files elsewhere?
|
|
-- TKTK need to add player to orgs.instance with on_joinplayer
|
|
|
|
-- ===================================================================
|
|
-- Load modpol system
|
|
|
|
dofile(minetest.get_modpath("modpol") .. "/modpol.lua")
|
|
|
|
|
|
-- ===================================================================
|
|
-- Modular Politics Minetest Specific Code
|
|
-- ===================================================================
|
|
dofile(minetest.get_modpath("modpol") .. "/modpol_minetest/api.lua")
|
|
|
|
-- ===================================================================
|
|
-- End of file.
|