1203 Commits

Author SHA1 Message Date
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 3b9edd73d1 Merge pull request #2033 from RhythmLunatic/mainline-2
Add example courses and fix typo in Jupiter
2020-07-04 14:52:12 -04:00
RhythmLunatic a942ed628b remove forced noteskins course, it doesn't work 2020-07-04 13:27:22 -05:00
RhythmLunatic 4300e37dff Add example courses and fix typo in Jupiter 2020-07-04 13:24:19 -05: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 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
quietly-turning c57279f6b8 allow <pre> HTML elements in Luadoc via Lua.xsd
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.
2020-06-25 03:58:57 -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 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
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
Tracy Ward 8e7c4df49c backport legacy credits from master (#1906)
* Restore lost Stepmania Team credits

Back in 2009, an overhaul was made to the theme to replace the credits
screen. That new screen had a short list of credits, along with a note to
"remake this list". That never happened, and over time, the original credits
list was lost in the shuffle. People that worked on Stepmania in the past,
who felt their contributions were enough to warrant credit, should still
get credit.

This list was pulled directly from the git history under hash
fb1165e6be
It could probably be cleaned up a bit. (For instance, the theme has been
completely redone. Should we still include the Graphics and Theme sections?
Also, the web section. And the thanks section? Those are pretty much just
shoutouts.)

* Name change. Deal with it >8)

* Change encoding of restored credits to utf-8

The list used "fancy" quotes. I should have saved this at utf-8 to
begin with.
2019-10-04 07:37:07 -07:00
ListenerJubatus aa9d264a06 Update changelog, remove b2 tag from the cmake settings in preparation for future release. 2018-08-03 10:04:00 -06: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
ListenerJubatus 6a27a192b3 update changelog 2018-02-12 19:28:48 -06:00
ListenerJubatus 1015f3a0ae update changelog 2017-12-31 22:14:03 -06:00
concubidated c7dcdf95c7 Uodate user data directory to 5.1 for Linux
This has already been fixed for OSX and Windows
2017-12-30 18:16:03 -08: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 f4fd4f91d8 Updated Changelog_sm5 2017-06-06 12:53:22 -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
Colby Klein f5100aee0d Fix NOTESKIN:GetMetric() 2016-11-24 18:57:25 -08:00
Kyzentun Keeslala 7ca46bb93a Added PlayerOptions:FromString. 2016-09-16 18:02:08 -06:00
Kyzentun Keeslala ccc26c305a UsePauseMenuInsteadOfGiveUp wasn't necessary for making start not give up on a song. Changed png load back to use setjmp/longjmp. 2016-07-12 21:00:54 -06:00
Dan Guzek 1ca660f034 clean up ActorDef.txt
This should resolve issue #781.
2016-07-08 02:55:07 -04:00
Kyzentun Keeslala 2f39442ccd Added Docs/Themerdocs/pause_menu.md to explain pause menu logic. Updated changelog. 2016-06-28 21:00:17 -06:00
Kyzentun Keeslala a2337b7f01 Forgot to mention UsePauseMenuInsteadOfGiveUp metric in changelog. 2016-06-24 17:10:40 -06:00
Kyzentun Keeslala 7bd64c32af Added AllowHoldForOptions preference.
Back button now only backs out of a screen on a press.
Updated changelog.
2016-06-24 16:55:01 -06:00
Devin J. Pohly 0f8c5a4db1 that was kind of an understatement :) 2016-06-01 08:34:49 -04:00
Kyzentun Keeslala a4c1aa6f1c Updated changelog 2016-05-26 08:44:45 -06: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 d372a6c8fd Added timer to not update loading window after every song to speed up loading. 2016-04-18 13:08:20 -06:00
Kyzentun Keeslala 6a73cdd1ba Added DisableUploadDir preference. Updated changelog. 2016-03-22 09:22:52 -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