Passing a -3 as profile index to ScreenSelectProfile's SetProfileIndex now
allows a player to play without having a local or USB profile assigned.
Also adds a message (PlayerProfileSet) that's broadcast anytime a player selects
a profile or chooses to play as a guest and subscribes ScreenSelectMusic to it.
The LuaDocumentation.xml in the StepMania repository and
quietly-turning's 'Lua for SM5' diverged over time. This commit pulls in
a couple of documentation improvements from 'Lua for SM5'.
- Add documentation for previously undocumented functions
- Improved descriptions
- More crosslinking
Unzip zip file at `zipPath` to `targetPath`.
`strip` is optional and defaults to `0`. If set to a number larger than
`0`, that many components are removed from the paths of the extracted
files. e.g. `a/b/c` is replaced with `b/c` when stripping one component
or just `c` when stripping two.
Returns whether all files were extracted successfully.
package.loadlib() can be used to load a dynamic C library allowing
arbitrary code execution in mod charts and themes.
So far I haven't found any theme that depends on the library, so I think
removing it shouldn't break anything.
This adds two more methods:
- `NETWORK:UrlEncode()`: Encode a single string value.
- `NETWORK:EncodeQueryParameters()`: Encode a table as query string.
For now there are two methods:
- `NETWORK:IsUrlAllowed()`: Check whether access to a certain URL is allowed.
- `NETWORK:HttpRequest()`: Perform an HTTP request.
By default access to the network is disabled for all target hosts. It
can be enabled by setting `HttpEnable=1` in the preferences. Individual
hosts have to be added to `HttpAllowHosts` as a comma separated list to
allow access.
See included docs for more details on usage.
This adds Lua hooks to CryptManager for libtomcrypt's SHA256 hash
function. It follows along with the C++ patterns Glenn wrote a decade
and a half ago for CryptMananger's MD5 and SHA1 hooks.
StepMania's CMakeProject-tomcrypt file has been updated to build with
sha256 symbols. Invoking cmake to build with system tomcrypt works fine
as-is.
Note that these functions return binary formatted strings, but themers
can convert to hexadecimal format using the global Lua function
BinaryToHex().
These elements are normally automatically updated when a new Lua.xml is
generated using the --ExportLuaInformation command line argument, but
I've manually updated them here. It works for now.
Running --ExportLuaInformation will generate a new Lua.xml file with
everything available to Lua, including some repetitively-named functions
ported from notitg that were manually condensed down within Lua.xml.
We want to keep these condensed parts, so ExportLuaInformation should
probably be fixed/replaced in the future.
These "grouping"s aren't part of the spec in Docs/Luadoc/Lua.xsd, so
they won't appear when Lua.xml is viewed in a web browser, but can still
be used by external API doc applications until ExportLuaInformation is
improved.