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 "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.
* 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
* Implemented Dance Point setting
Methods added:
SetPossibleDancePoints
SetActualDancePoints
* Update luadocs to reflect changes
* Fix possible divide by zero
* Merge DP setting functions into one. (#5)
* Merge DP setting functions into one.
Also, ensure that scores of >100% aren't possible
Function usage: SetDancePointLimits(actual, possible)
Clamps to 100% if actual/possible >100%
* Update the luadocs again