Module loadconf
A module for loading LOVE conf.lua files.
love_config |
The configuration tables produced by running love.conf . |
options |
The optional table all loadconf functions take. |
defaults |
A table containing the default config tables for each version of love. |
stable_love |
The current stable love version, which right now is "11.3". |
-
parse_string (str, name, opts)
-
Given the string contents of a conf.lua, returns a table containing the
configuration it represents.
Parameters:
- str
The contents of conf.lua
- name
The name of conf.lua used in error messages. Uses same format as load. Optional.
- opts
options
A configuration table. Optional.
Returns:
love_config
Or
-
nil
-
string
-
parse_file (fname, opts)
-
Given the filename of a valid conf.lua file, returns a table containing the
configuration it represents.
Parameters:
- fname
The path to the conf.lua file
- opts
options
A configuration table. Optional.
Returns:
love_config
Or
-
nil
-
string
-
new (opts)
-
Create an instanced version of loadconf. This carries its configuration
state in object-oriented way, if you prefer that.
Parameters:
Returns:
a Loadconf instance
-
love_config
-
The configuration tables produced by running
love.conf
.
See also:
-
options
-
The optional table all loadconf functions take. customize according to your
use case.
Fields:
- program
What is the program called? Used for friendly errors
(default "loadconf")
- friendly
Enable user-friendly errors
(default false)
- include_defaults
Return default values in parsed configs
(default false)
-
defaults
-
A table containing the default config tables for each version of love.
Usage:
assert(loadconf.defaults["0.9.2"].window.fullscreentype == "normal")
-
stable_love
-
The current stable love version, which right now is "11.3". Please
submit an issue/pull request if this is out of date, sorry~
An object-oriented instance of the loadconf module. This carries
configuration state internally so you can set-and-forget the
options
table.
-
Loadconf:parse_string (str, name)
-
Parameters:
See also:
-
Loadconf:parse_file (fname)
-
Parameters:
See also: