Commit Graph

279 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
quietly-turning f13abec73d fix typos in LuaDocumentation.xml 2024-03-20 13:29:43 -05:00
teejusb 0c1115350d Allow setting the alpha of the beatbars 2024-03-03 00:08:55 -08:00
Crash Cringle 6cd43782d5 Add lua docs for GetPreferredSortSongsBySectionName, update comment, remove duplicate code 2024-02-25 09:36:21 -08:00
tertu marybig acf8be530d Allow setting and getting beat bar status per NoteField from Lua 2024-02-15 13:22:26 -08:00
teejusb 971bcd84b4 This is version 0.6.0 2023-03-17 01:12:00 -07:00
teejusb fbed947b9c Allow PreferredSongs/PreferredCourses to be set from absolute paths 2023-03-17 01:12:00 -07:00
Crash Cringle f60c1c7f82 Add new Sorting Capabilities for Profile list 2023-03-13 19:56:07 -07:00
Martin Natano 61046ca539 Updates from quietly for lua docs 2022-06-29 19:11:05 +02:00
tertu marybig 9b348090a7 HyperShuffle implementation
Also add it to _fallback
2022-06-23 11:09:40 -07:00
Ivana Kellyerova 02b9925b12 Allow ScreenSelectProfile to Finish() with guest players
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.
2022-06-11 22:53:07 +02:00
Martin Natano 15b77ee278 Update documentation 2022-05-28 11:21:13 +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 2586eec53f Update lua docs 2022-04-06 21:13:16 +02:00
Martin Natano 65eb85b8e9 Sync LuaDocumentation.xml with 'Lua for SM5'
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
2022-04-03 21:35:21 +02:00
Martin Natano 02008eb469 Rename to ITGmania
- executable name:
  - linux: itgmania
  - windows: ITGmania.exe
  - macOS: ITGmania.app
- config path:
  - linux: ~/.itgmania
  - windows; %AppData%\ITGmania
  - macOS: ~/Library/Application Support/ITGmania
2022-04-02 20:14:57 -07: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 0861ed45c7 Merge /AdditionalSongs into /Songs, and /AdditionalCourses into /Courses
Includes a backwards-compatibility mechanism to adapt paths when loading
Stats.xml.
2022-03-11 22:35:31 +01: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 a48a5b73ad Remove returned timing window table 2022-01-05 18:21:28 -08: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 4635973799 add grouping attr to Class elements in LuaDoc
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.
2020-06-25 05:10:25 -04:00
quietly-turning 5574113d63 tidy preformatted code examples in LuaDoc 2020-06-25 05:06:16 -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 88f7d34632 Slightly more clear documentation 2020-05-26 23:15:16 -05:00
RhythmLunatic 6bcae89aaf Update documentation 2020-05-26 22:45:50 -05:00
quietly-turning 79272eedde fix+clarify multiple issues in LuaDocumentation
* 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
2020-04-17 17:30:26 -04:00
tertu c306c13112 fix documentation for lua.RunWithThreadVariables 2020-04-16 08:39:32 -05:00
Dan Guzek a268938a7b fix LuaDoc for SONGMAN:GetCoursesInGroup()
SONGMAN:GetCoursesInGroup() actually takes two arguments, a string and a boolean, but the existing Lua Docs only mention the first.  This fixes that.
2018-07-06 00:20:01 -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