Commit Graph

180 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
sukibaby e0b254968d std::size_t -> size_t
Removing std prefix from all size_t.
2024-10-01 01:46:26 -07:00
sukibaby abf89ec2b1 Replace SAFE_DELETE / SAFE_DELETE_ARRAY macros
SAFE_DELETE -> RageUtil::SafeDelete
SAFE_DELETE_ARRAY -> RageUtil::SafeDeleteArray

Update JsonUtil.h to include RageUtil.h - MSVC doesn't need it included for some reason, but GCC and XCode does.
2024-09-30 15:13:32 -07:00
Crash Cringle 667d27b361 Fix Level and Preferred Sorts to account for a song being in multiple sections
This commit properly returns you to the correct pack when leaving a folder or returning from another screen.
This is achieved by returning you to your last open section. Previously behavior searched for the first instance of the song in your sort and put you in that section.
2024-07-07 16:14:07 -07:00
Martin Natano bacecae1f7 Decouple <vector> 2023-04-21 22:13:41 +02:00
Martin Natano 78fb2e9fc3 Decouple <cstddef> 2023-04-20 11:21:29 +02:00
Martin Natano b68ca517e6 Clean up math functions
- Remove checking for standard functions from the build system
- Prefix all invocations with std::
- Replace suffixed functions with unprefixed versions
- Include <cmath> in all files that use it and remove the global include

e.g. floorf(x) -> std::floor(x)
2023-04-19 19:31:40 +02:00
Crash Cringle efaf38b8ed Fix for "10th score" leaderboard bug, Reduce load from GAMESTATE::StoreRankingName()
- Fixes bug where 10th scores get erased when two players play the same song multiple times and rank on the leaderboard more than once
- Only clamping leaderboards and deduping high scores for songs/courses once overall instead of once per player
- Instead of looping through every song and course on the machine multiple times -> Only loop through the songs/course played in the past session
2023-03-16 18:19:09 -07:00
Crash Cringle f60c1c7f82 Add new Sorting Capabilities for Profile list 2023-03-13 19:56:07 -07:00
Brian Phlipot 4a6b1a743c Enable more compiler warnings and treat them as errors. 2023-02-02 11:54:17 -08:00
Michael Sundqvist 0cba3579de Remove global "using namespace std;" declarations, use "std::" prefixes on all std elements
Fix whitespace changes
2022-07-31 22:14:38 +02:00
teejusb e0abda3d24 Make use of the m_fVisualDelay value 2021-10-22 17:17:48 -07:00
Gareth Francis aeb5c7598f Handle exceptions in int conversions (#2092)
* RageUtil: Add exception-safe wrappers around std::stoi, stol, stoll

* Replace use of std::stoi with exception-safe StringToInt
2021-02-15 12:36:51 -08:00
x0rbl 50de3a1f2d Fix two disqualification bugs: C-mods and rate mods now properly disqualify (#1965) 2020-02-11 12:15:16 -08:00
teejusb 7e3789b131 Integrate C++11 branch into 5_1-new 2019-06-22 12:35:38 -07:00
Kyzentun 2aee27a276 Backport custom song support. Prefs are CustomSongsEnable, CustomSongsMaxCount, CustomSongsLoadTimeout, CustomSongsMaxSeconds, CustomSongsMaxMegabytes. Metrics are NumProfileSongGroupColors and the colors with it. Profile custom load function is passed PlayerNumber now. Stepmania must run as root to save USB profile scores. (#1470) 2017-06-06 05:30:06 -07:00
Tyler Brekke 8f332653e1 Persistent Coins (#1405)
On Coin Insert, a file Save/Coin.ini is created if it does not exist, which stores the number of coins currrently in m_iCoins. Whenever m_iCoins is update, the Coin.ini is updated.

On boot, Coin.ini is read and m_iCoins is set to that value. If coins in coin.ini file is greater then MAX_NUM_CREDITS then reset the value to 0.
2017-02-17 08:21:38 -08:00
Jason Felds bec18a0d36 Fix minor windows pedantic warnings. 2016-03-27 22:03:15 -04:00
Flameshadowxeroshin d329c80ad3 remove guitar cruft
There was a bunch of code for handling guitar-specific input such as hammer-ons/pull-offs and strumming. Given that guitar was removed, and as far as I understand, will not be added back into SM5, it makes sense to remove code that had no other use.
2015-12-05 11:12:17 -06:00
Kyzentun Keeslala f182a04780 Fixed pausing on ScreenGameplay by making GameState have a pause variable and not force the song position forward if the game is paused. Implementing a working pause button that the player can press is left as an exercise for the reader. 2015-09-03 14:39:57 -06:00
Jason Felds 80542a5a7d Require reasons for checkpoints. 2015-06-08 18:37:13 -04:00
Kyzentun Keeslala c155ccffbc Change ForceOtherPlayersToCompatibleSteps to treat NULL steps as a failed match. 2015-05-20 23:22:51 -06:00
Kyzentun Keeslala cc2e166c18 Change JoinPlayer to look directly at SideIsJoined to avoid style-dependent logic in GetNumPlayersEnabled. 2015-05-20 22:26:47 -06:00
Kyzentun Keeslala e6e0dcff44 PlayersCanJoin does not check style anymore, see comment. IsHumanPlayer doesn't try to use PlayersCanJoin to guess the current screen anymore. 2015-05-19 21:58:56 -06:00
Kyzentun 9d1ba50c23 Fixed logic mistake in PlayersCanJoin. 2015-05-04 19:56:30 -06:00
Kyzentun 236947b346 Changed GetFirstCompatibleStyle to not crash SM so it can be used to check whether joining is allowed. JoinPlayer and PlayersCanJoin now use GetFirstCompatibleStyle to check whether there will be a style to change to. Changed logic in PlayersCanJoin to return false at the first failed requirement. 2015-05-02 23:36:28 -06:00
Kyzentun 846f79879c Added MUSIC tag to note data to allow each chart in a simfile to use a different music file. 2015-03-02 18:44:01 -07:00
Kyzentun 65a1551c6d Changed SetCurrentStyle to unjoin other player when setting OnePlayerTwoSides to fix crash from second joining on SSS and picking double. Changed MusicWheel FilterWheelItemDatas to clear the vector it's putting the filtered data in instead of appending to the end. Updated Polish translation. 2015-02-08 10:33:51 -07:00
Kyzentun c69cf1ef4e Special case kickbox autogen added. GameState now has a member for passing args from the theme to the autogen, only used by kickbox for kick recovery time. 2015-01-26 19:43:15 -07:00
Kyzentun b6e9d188c3 Added special case to JoinPlayer's style changing logic, see comment in code. Fixed mistake in hold logic that made holds never drop. 2015-01-22 12:37:48 -07:00
Kyzentun aeaead95c9 Changed default ScreenSelecStyle to use functions for choice names and positions instead of metrics. _fallback SSS remains the same for compatibility. Fixed style stomping bug in SetCompatibleStylesForPlayers. 2015-01-20 18:40:59 -07:00
Kyzentun f4a718a824 SetCompatibleStylesForPlayers and ForceSharedSidesMatch added to GameState for SSM to use to fix style mismatch problems.
StyleInputToGameInput changed to take a vector to return values in to handle multiple inputs mapped to a single column.  Associated adjustments to everything that uses it.
Player no longer drops holds in columns that have multiple inputs mapped to them if the wrong one is held.
Running out of stage tokens changed from assert to error.
2015-01-17 21:15:15 -07:00
Kyzentun 1890445ab3 Added SetStepsForEditMode lua function. 2014-12-09 22:27:00 -07:00
Kyzentun 3fb36af157 Separate styles for players. Notefields positioned between margins. Edit mode works for kickbox. 2014-12-09 22:27:00 -07:00
Kyzentun c9a17dc48e Added metrics for setting the screens Edit Mode uses for setting mods. Added functions for apply ModsLevel_Preferred to the other levels. 2014-12-09 21:59:01 -07:00
Kyzentun 4f95bf08ad Function chaining for actors and singletons. 2014-12-01 22:31:30 -07:00
Kyzentun 2f37e9d8a9 Merge branch 'DefaultHeart' of https://github.com/kyzentun/stepmania 2014-09-14 21:07:54 -06:00
Kyzentun 1dbdca6b0a Merge branch 'StageDispFixes' of https://github.com/kyzentun/stepmania 2014-09-14 21:06:27 -06:00
Kyzentun f87afa8a4b Added ScreenHeartEntry to default theme. 2014-09-12 15:07:46 -06:00
Kyzentun bcb2589114 Fixed endless courses to make them repick on repeats and not crash after repeating. 2014-09-10 02:44:49 -06:00
Kyzentun 2199e7aafb Fixed GAMESTATE:GetCurrentStage to use correct logic for determining if all human players are on final stage.
THEME:GetPath lua functions can now pass true for the third arg if the element is optional.
Fixes to various StageDisplay things in default.
thify_number and thified_curstage_index lua functions added to default/Scripts/04 Other.lua.
2014-09-07 04:05:10 -06:00
Dan Guzek d1ec94bcd7 touch up style to InsertCredit and InsertCoin
Third time's the charm.
2014-09-01 20:26:55 -04:00
Dan Guzek 6ccbbb4f6f update InsertCoin and InsertCredit functions
These should now agree with kyzentun's suggestions.
2014-09-01 20:03:45 -04:00
Dan Guzek eae5fcb3ba expose InsertCoin and InsertCredit to Lua
This commit exposes InsertCoin() and InsertCredit() to Lua under GAMESTATE.  It adds a check to ensure overall credits don't become negative when deducting and only plays sounds if credits are being added.

Themers are instructed to deduct credits by passing negative values to InsertCoin.
2014-09-01 19:00:00 -04:00
sigatrev 81080ce9ce Add SetCurrentPlayMode and SetCurrentStyle methods
because there needs to be a way other than using antiquated GameCommands
2014-08-13 22:04:54 -05:00
sigatrev acd3340c57 UpdateSongPositions
It is useful to have Player SongPositions update off of ScreenGameplay
for use with things like ArrowEffects.

ScreenGameplay, ScreenHowToPlay, and ScreenEdit stop GameSoundManager
from running GameState:UpdateSongPosition and do it themselves, so this
has no impact on the screen classes that cared about, and thus updated,
player SongPositions.
2014-07-24 19:45:17 -05:00
Kyzentun 0f72d7cc6b Changed NoteSkinManager to use new error reporting and avoid crashing. Fixed DoChangeTheme to switch to the InitialScreen if the screen doesn't exist in the theme being changed to. Fixed error reporting in MeterDisplay. 2014-07-15 13:28:06 -06:00
Kyzentun fb1a251b7a Changed many places that used RageException to use ReportScriptError instead. Wrote ScreenOptionsExample.ini as documentation example for the OptionRow system. Rewrote gamecommands.txt to include all GameCommands. Fixed Commands::GetOriginalCommandString to insert the semicolons that separated the original commands. Changed nonsensical boolean |= true statements in GameCommand.cpp to just use =. Added protection to ReportScriptError to keep it from recursing through itself when an error occurs in error reporting. Added UseAbort option to ReportScriptError for places that want to use an AbortRetryIgnore dialog to query the user. Added ScriptErrorMessage for places that need to handle the warning/dialog part separately. Added logging flag to MESSAGEMAN so that all messages broadcast can be logged when desired. Changed OptionRowHandler::LoadInternal to return a boolean success value as part of error handling. 2014-07-12 14:59:10 -06:00
Kyzentun 026f968fa4 Changed many uses of Dialog::OK and LOG->Warn to use ReportScriptError. 2014-07-07 00:39:27 -06:00
Kyzentun 6cb9dec854 Changed SetCompatibleStyle to only change when incompatible. 2014-06-27 21:11:34 -06:00