Lua: set and get config options

Still needs more work, especially the error handling.
This commit is contained in:
Pasi Kallinen
2021-02-06 18:57:41 +02:00
parent c4d9ceda9d
commit d817564a6a
5 changed files with 276 additions and 126 deletions

View File

@@ -70,6 +70,16 @@ Example:
local loc = nh.getmap(x,y);
nh.pline("Map location at (" .. x .. "," .. y .. ) is " .. (loc.lit ? "lit" : "unlit") );
=== get_config
Get current value of a boolean or a compound configuration option.
Example:
local wt = nh.get_config("windowtype");
=== gettrap
Get trap info at x,y
@@ -158,6 +168,15 @@ Example:
local selected = nh.menu("prompt", default, pickX, { {key:"a", text:"option a"}, {key:"b", text:"option b"} } );
=== parse_config
Parse string as if it was read from a config file.
Example:
nh.parse_config("OPTIONS=color");
=== pline
Show the text in the message area.