Go to file
AntumDeluge 314c6d7ee0 Use built-in 'core.is_value' instead of checking for 'true' string 2017-08-10 10:44:35 -07:00
docs Rename function 'core.get_mod_defaults': 2017-08-08 06:32:35 -07:00
LICENSE.txt Add 'mod.conf', 'description.txt', & MIT licensing text 2017-08-05 14:35:32 -07:00
README.md Rename function 'core.get_mod_defaults': 2017-08-08 06:32:35 -07:00
api.lua Use built-in 'core.is_value' instead of checking for 'true' string 2017-08-10 10:44:35 -07:00
description.txt Add 'mod.conf', 'description.txt', & MIT licensing text 2017-08-05 14:35:32 -07:00
init.lua Remove call to old function 'readConfig' 2017-08-08 06:50:21 -07:00
mod.conf Add 'mod.conf', 'description.txt', & MIT licensing text 2017-08-05 14:35:32 -07:00

README.md

Mod Configuration Reader (modconf) mod for Minetest


Description:

A Minetest mod that reads data from mod.conf & settingtypes.txt files.

NOTE: This mod is a work-in-progress but is functional. Currently, in order to use modconf.getModMetaData, key-value instances in mod.conf must be delimited by an equals symbol with one whitespace on both sides (e.g. " = "). In the future, trimming out whitespace will be done automatically.


Example Usage:

depends.txt:

modconf?

init.lua (read mod.conf file using modconf.getModMetaData):

-- Main global object table
mymod = {}

-- Create settings object from core function
if minetest.global_exists('modconf') then
	modconf.getModMetaData(mymod)
end

-- Alternatively can be called in this manner
mymod = modconf.getModMetaData()

minetest.log('action', 'Loading ' .. mymod.name .. ' version ' .. mymod.version)

init.lua (reading settingtypes.txt file with modconf.getModDefaults):

-- Table object to read fields into
local defaults = {}

-- Read fields into table from 'settingtypes.txt'
if minetest.get_modpath('modconf') then
    modconf.getModDefaults(defaults)
end

-- Alternatively can be called in this manner
local defaults = modconf.getModDefaults()