Commit Graph

234 Commits

Author SHA1 Message Date
phantom10111 3266fda819 GameState: Expose GetPlayerFailType() to Lua
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.
2025-01-20 10:03:52 -08:00
Crash Cringle 6cd43782d5 Add lua docs for GetPreferredSortSongsBySectionName, update comment, remove duplicate code 2024-02-25 09:36:21 -08:00
Martin Natano 8dc471f874 Update version information in Lua.xml 2023-03-19 11:12:38 +01:00
Crash Cringle f60c1c7f82 Add new Sorting Capabilities for Profile list 2023-03-13 19:56:07 -07:00
tertu marybig 9b348090a7 HyperShuffle implementation
Also add it to _fallback
2022-06-23 11:09:40 -07:00
Martin Natano 6c5bb5f665 Update Lua.xml 2022-06-05 15:52:14 +02:00
Martin Natano d8586b02b2 Add NETWORK:WebSocket() 2022-05-27 23:42:37 +02:00
Martin Natano 4c0aef69dd Remove legacy network code 2022-04-11 14:50:00 -07:00
Martin Natano d8055e59ab Update Lua.xml documentation 2022-04-03 19:59:29 +02:00
Jose_Varela 1b27032a38 Add GaveUp() 2022-03-28 20:11:53 -07:00
Martin Natano 1036d20e11 Implement FILEMAN:Copy(string fromPath, string toPath)
Copies a file from `fromPath` to `toPath`. Returns `true` if the file
was copied successfully.
2022-03-13 12:37:11 -07:00
Martin Natano 67d1c78450 Implement FILEMAN:Unzip(string zipPath, string targetPath, int strip)
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.
2022-03-13 11:46:28 -07:00
Martin Natano ca86f80743 Add support for onProgress and downloadFile to NETWORK:HttpRequest() 2022-03-13 11:31:49 -07:00
Martin Natano afb3836367 Remove unsafe package library
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.
2022-03-04 21:27:55 +01:00
Martin Natano bb826dc0b2 Allow cancellation of HTTP requests
`NETWORK::HttpRequest()` now returns a HttpRequestFuture with a
`Cancel()` method.
2022-01-15 22:56:22 +01:00
Martin Natano bc4a275510 Add parameter encoding helpers to NETWORK
This adds two more methods:
- `NETWORK:UrlEncode()`: Encode a single string value.
- `NETWORK:EncodeQueryParameters()`: Encode a table as query string.
2022-01-15 22:56:08 +01:00
Martin Natano dc49af3c59 Implement NetworkManager
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.
2022-01-15 22:56:08 +01:00
teejusb 99ee1f2b84 Use bitset instead of map and adjust files accordingly. 2021-12-21 23:44:37 -08:00
Martin Natano b4f86a2052 Add json encoding/decoding functions to lua
This adds two global functions:

- `JsonEncode()`: Encode data as JSON. Optionally "minify" the result.
- `JsonDecode()`: Decode JSON data.
2021-10-13 19:33:02 +02:00
Martin Natano f18695df59 Track held misses
This adds a `HeldMiss` attribute to judgment messages and a GetHeld()
method to TapNoteResult.
2021-08-31 18:25:09 +02:00
quietly-turning 72cd6edf5c give Lua access to tomcrypt's SHA256
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().
2020-09-09 15:37:01 -04:00
quietly-turning df07b4c649 update Version, Date in Lua.xml
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.
2020-06-25 05:14:11 -04:00
quietly-turning 91bf61a178 update LuaDocs for Classes
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.
2020-06-25 04:55:13 -04:00
quietly-turning d62797973f update LuaDocs for Singletons, Enums for 5.1-new 2020-06-25 04:49:09 -04:00
quietly-turning 7804efb103 update GlobalFunctions prose in LuaDocumentation
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.
2020-06-25 04:24:24 -04:00
RhythmLunatic 6bcae89aaf Update documentation 2020-05-26 22:45:50 -05:00
quietly-turning a892cbc4dd update Classes and Enums in bundled Lua.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.
2020-05-11 05:59:08 -04:00
Alexander Griffin c0981c42ec Changing BannerCache into ImageCache to support more imagetypes (#1532) 2017-09-19 14:49:42 -07:00
MrThatKid cf2b25fdcc Implemented SetActualDancePoints & SetPossibleDancePoints (#1527)
* 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
2017-08-30 11:57:23 -07:00
MrThatKid 921a617a64 Added nITG's Tangent Modifiers (#1495)
* Implemented nITG's TanDrunk modifiers.

RageMath functions added:
RageFastTan
RageFastCsc
Modifers added:
GlitchyTan
TanDrunk
TanDrunkSpeed
TanDrunkOffset
TanDrunkPeriod
TanDrunkZ
TanDrunkZSpeed
TanDrunkZOffset
TanDrunkZPeriod

* Implemented nITG's TanTipsy and TanTornado mods

Also, the Drunk code and Tipsy update code was deduplicated.
Modifiers Added:
TanTipsy
TanTipsySpeed
TanTipsyOffset
TanTornado
TanTornadoPeriod
TanTornadoOffset
TanTornadoZ
TanTornadoZPeriod
TanTornadoZOffset

* Implemented nITG's remaining tan mods.

Modifiers added:
TanExpand
TanExpandPeriod
TanBumpy
TanBumpyPeriod
TanBumpyOffset
TanBumpyX
TanBumpyXPeriod
TanBumpyXOffset
TanDigital
TanDigitalPeriod
TanDigitalSteps
TanDigitalOffset
TanDigitalZ
TanDigitalZPeriod
TanDigitalZSteps
TanDigitalZOffset

* Updated luadocs to reference new modifiers

* Rename GlitchyTan to Cosecant (#4)

* Rename GlitchyTan to Cosecant

* Update luadocs to reflect change
2017-07-14 22:32:58 -07:00
Drew Barbarello 557be7cf1b 5 1 new backport x11 fs rework (#1485)
* Use XRandR 1.2 to set fullscreen resolution for single output

Squash of roothorick's PR #497
(also includes Kyzentun's CMake changes from PR #716)

* Cherry-pick json c++1x stuff (b9e3d7174e)

* Cherry-pick c++11 support from 5bba5c0038 and 9f8b045309

* rework Linux (X11) fullscreen, improve display-related Graphics Options

Implement option to select between monitors for exclusive fullscreen mode
on X11 (using XRandR 1.2), or use a fullscreen borderless window.

Reimplement resolution/refresh rate/display mode-related option rows
using Lua, update choices dynamically so only known-good groupings of
resolution/refresh rate/aspect ratio can be selected.

Minimally update Windows/MacOS LowLevelWindow implementations to support
changes made for Linux side. Fullscreen Borderless Window/multi monitor
support from X11 not implemented for those in this commit.

* allow forcibly disabling xinerama use on Linux

When libXinerama is available, SM tries to use it to find the proper
monitor indexes to use to set _NET_WM_FULLSCREEN_MONITORS (on borderless
fullscreen). xfwm4 seems to assume that monitors are numbered in increasing
order from left to right (rather than using the Xinerama-assigned numbers),
so _NET_WM_FULLSCREEN_MONITORS misbehaves on Xfce.

This commit bypasses use of libXinerama, and instead forces SM to induce fullscreen
on the desired monitor in the backup, hacky way: remove all window hints, move window
to desired monitor, then add _NET_WM_STATE_FULLSCREEN hint. This works on
mutter and Xfce.

* Remove multiple warnings on redundant define.

This used to be hard-coded due to pthread related items, but now it's dynamically determined.

* fix _fallback menu behavior for unrecognized aspect ratios

* Fix error recreating existing FS texture

* Bump deployment target to 10.7 to use libc++ on XCode 8

* Add explicit casts to please clang

* Update changelog
2017-06-18 08:55:16 -07:00
MrThatKid a3eab2e7ab Added nITG's various column specific & other misc modifiers (#1468)
* Added stealth control, ZBuffer & DizzyHolds mod

Modifiers added:
StealthPastReceptors
DizzyHolds
StealthType
ZBuffer

* Removed theme metrics that are now mods.

Removed metrics:
DrawHiddenNotesAfterReceptor
DizzyHoldHeads

* Implemented nITG's Shrink modifiers

Modifiers Added:
ShrinkLinear
ShrinkMult

* Implemented nITG's Attenuate mods.

Modifiers added:
AttenuateX
AttenuateY
AttenuateZ

* Implemented nITG's pulse modifiers

Modifiers added:
PulseInner
PulseOuter
PulsePeriod
PulseOffset

* Implemented nITG's DrawSize and Bounce modifiers.

Modifiers Added:
Bounce
BouncePeriod
BounceOffset
BounceZ
BounceZPeriod
BounceZOffset
DrawSize
DrawSizeBack

* Added nITG's column specific Dark & Stealth mods

Modifiers added:
Stealth<1-n>
Dark<1-n>

* Finish adding nITG's column specific mods

Modifiers added:
ConfusionXOffset<1-n>
ConfusionYOffset<1-n>
ConfusionzOffset<1-n>
Reverse<1-n>
Tiny<1-n>
Bumpy<1-n>

* Documented new modififers

* Changelog housekeeping

Fixed a typo and added this branch's PR into the changelog.

* Last bit of clean up. (#3)

* Fixed up one line of the changelog

* Add MrThatKid to credits.
2017-06-09 21:10:17 -07:00
MrThatKid e15e0e68be Add nITG's various path shape & other modifiers - V2 (#1435)
* Implemented nITG's Square modifiers

Modifiers added:
Square
SquareOffset
SquarePeriod
SquareZ
SquareZOffset
SquareZPeriod

* Implemented nITG's BumpyX Modifiers

Also fixes up some tiny bits pertaining to the square modifiers.
Modifiers Added:
BumpyX
BumpyXPeriod
BumpyXOffset

* Implemented nITG's TornadoZ Modifiers

Modifiers Added:
TornadoZ
TornadoZPeriod
TornadoZOffset

Another commit is needed to update fallback's metrics

* Update fallback's metrics to accommodate TornadoX

* Implemented nITG's Parabola Modifiers

Modifiers Added:
ParabolaX
ParabolaY
ParabolaZ

* Implemented nITG's Sawtooth Modifiers

Modifiers Added:
Sawtooth
SawtoothPeriod
SawtoothZ
SawtoothZPeriod

* Implemented nITG's Zigzag Modifiers

Modifiers Added:
Zigzag
ZigzagPeriod
ZigzagOffset
ZigzagZ
ZigzagZPeriod
ZigzagZOffset

* Implemented nITG's ModTimer modifiers

Modifiers Added:
ModTimer (Lua method name is ModTimerSetting (takes enums. Ex: 'ModTimerType_Song'). Can be activated with mod strings 'modtimer(song/beat/game/default)' )
ModTimerOffset
ModTimerMult

* Remove Log use from ArrowEffects::GetTime()

* Accidentally removed a CPY(m_BatteryLives)

* Implemented nITG's DrunkZ modifiers

Modifiers added:
drunkz
drunkzspeed
drunkzoffset
drunkzperiod

Another commit is needed to update fallback's metrics

* Update fallback's metrics to accommodate DrunkZ

* Implemented nITG's BeatY & BeatZ Modifers

Modifiers Added:
beaty
beatyoffset
beatyperiod
beatymult	
beatz
beatzoffset
beatzperiod
beatzmult

Another commit is needed to update fallback's metrics

* Updated fallback's metrics to accommodate ...

the new Beat modifiers.

* Implemented nITG's Digital Modifiers

Modifers Added:
digital
digitalsteps
digitalperiod
digitaloffset
digitalz
digitalzsteps
digitalzperiod
digitalzoffset

* Removed duplicate zbuffer check.

* Updated Luadocs with the new modifiers

* Removed accidental duplicate Mini from Luadocs

* Split up long modifier lines.

Hopefully, this makes it a bit easier to read.

* Remove accidental commit to root of repo.

* Split up long modifier lines

Hopefully, this makes it easier to read.

* Redid Square functions to not use FastSin

This implementation is based off of 5.2's square_wave function from ModValue.

* Redid zigzag functions to not use FastSin

This implementation is based off of 5.2's triangle_wave function from ModValue.

* Moved square & zigzag calculation to RageMath.

New RageMath functions:
RageSquare
RageTriangle

* Made Square & Digital have the same period...

as Zigzag and Sawtooth.

* Deduplicate tornado calculations.

* Fixed typo in UpdateTornado, and moved UpdateTornado logic to ArrowEffects::Init because it doesn't depend on anything that changes every frame.  Tornado metrics are also loaded in ArrowEffects::Init.

* Deduplicated Beat mod update logic.

The logic is now placed into a function called UpdateBeat.
The m_fBeatFactor members are now a 1D array, similar to m_MaxTornado and m_MinTornado.
2017-05-13 11:34:34 -07:00
MrThatKid 86dbab0100 Added nITG's various sub-modifiers (#1419)
* Added nITG's Bumpy sub-mods and ...

reorganized PlayerOptions::FromOneModString's Confusion checks
This is to help avoid the nesting level of 128 under Windows

* Added nITG's Tipsy sub-mods

Modifiers added:
TipsySpeed
TipsyOffset

* Add nITG's Drunk sub-mods

Modifiers added:
DrunkSpeed
DrunkOffset
DrunkPeriod

* Added nITG's Wave & Expand sub-mods

Modifiers added:
WavePeriod
ExpandPeriod

* Added nITG's Tornado sub-mods

Modifiers Added:
TornadoPeriod
TornadoOffset

* Added nITG's Beat sub-mods

Modifiers added:
BeatOffset
BeatPeriod
BeatMult

* Documented the new sub-mods
2017-03-14 03:27:18 -07:00
MrThatKid 1c9227db22 Add nITG's new Move modifiers (#1411)
* Implemented NITG's MoveX/Y/Z modifiers

Added modifiers:
MoveX1-n: Moves a column in the x direction, 100% = move left one arrow size. 
MoveY1-n: Moves a column in the y direction
MoveZ1-n: Moves a column in the z direction.
2017-02-25 15:48:03 -08:00
MrThatKid 388d4ac8ea Add nITG's new Confusion modifiers (#1395)
* Implemented nITG's Confusion modifiers.

Modifiers added:
ConfusionOffset
ConfusionX
ConfusionXOffset
ConfusionY
ConfusionYOffset

* Documented new Confusion modifiers.

* Make ConfusionX mods apply to hold heads
2017-02-08 05:44:33 -08:00
Kyzentun Keeslala 2b6768aed9 Remove UndocumentedFeature lua function. It has no legitimate purpose and just crashes with a message. 2016-05-20 19:02:54 -06:00
Kyzentun Keeslala a4ecf15ce3 Added flag for making an actor use the effect delta for tweening. Updated changelog. 2016-03-17 19:37:27 -06:00
Kyzentun Keeslala 88227dd610 Added stats prefix feature to ProfileManager for managing scores that need to be separated. 2016-03-15 18:13:53 -06:00
Kyzentun Keeslala bd19b1b29a Added global lua function for fetching the list of available sound drivers. Moved WaveOut to the front of the list to make it the first driver to try on Windows. 2016-03-05 18:11:59 -07:00
Kyzentun Keeslala 55e161336a Added lua bindings for playing sounds in SCREENMAN. Added input redirection functions to SCREENMAN for disabling non-lua screen input processing. Added OF_FALSE, OV_EOF, and OV_HOLE to error string list in RageSound for more understandable messages. Made sure RageSound doesn't delete null pointers. Updated changelog. 2016-02-03 13:05:23 -07:00
Kyzentun Keeslala 0de66f6e1a Added pause menu to ScreenGameplay in default theme. Added SetPrevScreenName lua binding to Screen. Added begin_backing_out lua binding to ScreenGameplay. 2016-01-09 11:40:22 -07:00
Kyzentun Keeslala 4e0fa012c1 Added SetLife and ChangeLife lua functions to Player. Updated changelog. 2015-12-16 15:08:36 -07:00
Kyzentun Keeslala bd3da6a46d Added GetMainTitle to Song to bypass ShowNativeLanguage pref. 2015-10-26 13:38:23 -06:00
Kyzentun Keeslala 9f40c6d044 Added mult_attrs_with_diffuse to BitmapText. Added some convenience macros to LuaBinding for generic get/set functions. Updated changelog. 2015-10-18 14:09:08 -06:00
Kyzentun Keeslala a10c0c4f01 Added set_use_effect_clock_for_texcoords to Sprite. Updated changelog. 2015-09-21 20:42:56 -06:00
Kyzentun Keeslala 87d0687457 Added lua interface for using bezier curves. 2015-06-22 21:08:55 -06:00
Kyzentun Keeslala 5f50a8ea26 Added get_music_file_length and RageSound:get_length lua functions. Updated changelog. 2015-06-10 14:41:28 -06:00
Kyzentun Keeslala e6dc4307b5 Exposed update_centering lua function. Added ScreenOverscanConfig. Added case to RageDisplay_D3D so that BLEND_SUBTRACT doesn't crash. Updated changelog. 2015-06-05 08:48:58 -06:00
Kyzentun Keeslala 0a3a555cab Exposed RageFile Flush function to Lua. Updated changelog. 2015-06-03 16:41:10 -06:00