Browse Source

Change file structures so that the interior modpol folder IS the portable modpol.
Added documentation of how to pre-define the modpath and the storage file.

MisterE123 3 years ago
parent
commit
dc12ec50a9

+ 3 - 3
init.lua

@@ -15,7 +15,7 @@ modpol = {}
 
 -- get modpol_minetest's version of directory
 modpol.get_script_dir = function()
-   return minetest.get_modpath("modpol")
+   return minetest.get_modpath("modpol").."/modpol"
 end
 
 -- TKTK: Implement minetest settingtypes for this... for now, the default is to use minetest mod storage. 
@@ -24,7 +24,7 @@ end
 
 -- 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"
+modpol.storage_file_path = minetest.get_modpath("modpol").."/modpol_minetest/storage/storage-mod_storage.lua"
 
 -- ===================================================================
 -- /init.lua
@@ -35,7 +35,7 @@ modpol.storage_file_path = minetest.get_modpath("modpol").."/storage/storage-mod
 -- ===================================================================
 -- Load modpol system
 
-dofile(minetest.get_modpath("modpol") .. "/modpol.lua")
+dofile(minetest.get_modpath("modpol") .. "/modpol/modpol.lua")
 
 
 -- ===================================================================

+ 0 - 0
DOCS/GOVERNANCE.md → modpol/DOCS/GOVERNANCE.md


+ 35 - 0
modpol/DOCS/Predefinitions.txt

@@ -0,0 +1,35 @@
+When calling modpol.lua from another file, one may wish to use 
+different functions than those included by default. 
+
+So far, 2 definitions need to be made BEFORE calling modpol.lua, the rest can be overwritten
+after calling modpol.lua .
+
+setup:
+----------------
+Define the global modpol table:
+modpol = {}
+
+the following 2 items *may* be defined, if they are not, then defaults will be used:
+========================
+--------------------
+modpol.get_script_dir()
+--------------------
+type: function
+
+defaults to: a function that can only work in linux
+
+usage: must return the file path of the modpol directory. If modpol is in a
+larger directory, such as a mod filesystem, make sure that the path returned is the "base" 
+modpol folder, i.e. the folder with all the original modpol files.
+========================
+--------------------
+modpol.storage_file_path
+--------------------
+type: string
+
+defaults to: topdir .. "/storage/storage-local.lua", 
+where topdir is the directory defined by modpol.storage_file_path 
+
+usage: if you wish to use another method of storage than that provided by default, 
+then you can save a filepath to the storage script here. 
+

+ 1 - 1
modpol/api.lua

@@ -1,6 +1,6 @@
 --call all files in this directory
 
-local localdir = modpol.get_script_dir() .. "/modpol"
+local localdir = modpol.topdir
 
 --Users
 dofile (localdir .. "/users/users.lua")

+ 1 - 1
modpol.lua → modpol/modpol.lua

@@ -71,7 +71,7 @@ modpol.load_storage()
 -- ModPol core features
 
 
-dofile (topdir .. "/modpol/api.lua")
+dofile (topdir .. "/api.lua")
 
 
 -- ===================================================================

+ 0 - 0
storage/storage-local.lua → modpol/storage/storage-local.lua


+ 0 - 0
util/ocutil/ocutil.lua → modpol/util/ocutil/ocutil.lua


+ 0 - 0
util/serpent/LICENSE.txt → modpol/util/serpent/LICENSE.txt


+ 0 - 0
util/serpent/README.md → modpol/util/serpent/README.md


+ 0 - 0
util/serpent/serpent-git.tar.bz2 → modpol/util/serpent/serpent-git.tar.bz2


+ 0 - 0
util/serpent/serpent.lua → modpol/util/serpent/serpent.lua


+ 1 - 1
modpol_minetest/api.lua

@@ -7,7 +7,7 @@
 -- ===================================================================
 
 
-local localdir = modpol.get_script_dir() .. "/modpol_minetest"
+local localdir = minetest.get_modpath("modpol") .. "/modpol_minetest"
 
 --Users
 dofile (localdir .. "/overrides/users/users.lua")

+ 0 - 0
storage/storage-mod_storage.lua → modpol_minetest/storage/storage-mod_storage.lua