FailType for a given Player can be overriden with respect to preferences, but
Lua has no way to check it. Expose a function to allow doing that, in order to
not accidentally submit invalid scores to GrooveStats.
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.
Fix, clarify, and expand prose in LuaDocumentation.xml for classes made
available to Lua.
Add elements for DeviceList, InputList, Quad, and SongMeterDisplay to
Lua.xml.
Expand and clarify the prose for many gloabl Lua functions described in
in LuaDocumentation.xml.
Get Lua.xml's GlobalFunctions listing current with 5_1-new. Remove old
global functions (those moved to 5.1's "legacy" theme) from Lua.xml.
MDN's web docs describe the "HTML <pre> elements represents preformatted
text which is to be presented exactly as written in the HTML file."
It's handy for formatting multiline code examples in
LuaDocumentation.xml.
This updates Actor classes, class methods, and Enums listed in the
bundled copy of Lua.xml to be current.
I used the command-line arg --ExportLuaInformation, to generate a wholly
new file, then manually removed some methods (e.g. literally numbered
PlayerOptions methods ported from notitg, CamelCase aliases of
spline-related methods) to keep previous manual modifications intact.
This doesn't touch GlobalFunctions in Lua.xml; those need further
review.
* removed ClearEnterMappedKeys from global functions
* typo fix in rawequal
* fix explanations of global SecondsToXXXX functions
* add to explanation of lua.ReportScriptError
* explain how ActorSound class can be used in Lua as "Sound"
* fix explanation for Course.GetCouseDir
* fix specified args for GAMESTATE.GetPreferredDifficulty
* remove HighScore.GetHighScore since it doesn't exist
* document special args for ScreenSelectProfile.SetProfileIndex
* fix specified args for Style.GetColumnInfo
* add examples of return value for Style.GetColumnInfo
* remove lingering mentions of SM4