Commit Graph

132 Commits

Author SHA1 Message Date
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
Kyzentun afc090ca73 Changed GAMESTATE:SetCurrentSteps and GAMESTATE:SetCurrentTrail to attempt to set a compatible style if AutoSetStyle is true. 2014-06-27 20:20:50 -06:00
Kyzentun 3a788651e5 Fixed bug that caused global fail setting to override setting the fail type from song options. Added GAMESTATE:SetFailTypeExplicitlySet so that a theme with a custom song options screen can protect its fail setting from being overridden the same way the engine ScreenSongOptions does. 2014-06-20 13:54:56 -06:00
Kyzentun e4f1682964 ASSERT broken into two lines, as per shakesoda's suggestion. 2014-06-16 23:05:31 -06:00
sigatrev 8fc5ae2cd4 fix GAMESTATE:SetCurrentSteps
assert was causing crash if steps were set to nil/null.
2014-06-01 19:23:56 -05:00
Kyzentun c8476738f5 Exposed GAMESTATE:StoreRankingName and Profile:SetLastUsedHighScoreName to Lua. StoreRankingName no longer forces uppercase. 2014-05-12 22:01:22 -06:00
Kyzentun 0dfb131291 Created SongOptions Lua interface with a similar design to the PlayerOptions interface. Moved enums that were inside SongOptions out and made them Lua accessible. Removed sAutosyncType and associated things from AdjustSync.cpp because it was unused. Added DefaultNilArgs and FArgGTEZero to LuaBinding as helpers. Moved INTERFACE defines from PlayerOptions.cpp to OptionsBinding.h. 2014-05-03 19:27:32 -06:00
Kyzentun 421a9be57b Ripped out existing PlayerOptions Lua interface and replaced it wholesale. Removed PrefsManager's DefaultFailType enum. Moved PlayerOptions::FailType enum to GameConstantsAndTypes and made it Lua accessible. Changed ModsLevel enum to include ModsLevel_Current to make accessing that ModsLevel easier to access. Rearranged ModsGroup appropriately. Added non-const Get functions to ModsGroup. Removed PlayerOptions.m_bSetTiltOrSkew because it had no reason to exist. Moved 200.0f to the const CMOD_DEFAULT because it was being used in more than one place. 2014-05-01 23:23:20 -06:00
Colby Klein b6570936f8 Merge pull request #123 from sigatrev/double-broadcast
removed SetCurrentSteps double-broadcast
2014-04-23 04:16:42 -07:00
sigatrev 7e5b651f1a removed SetCurrentSteps double-broadcast 2014-04-20 11:26:15 -05:00
sigatrev 99ba67acc7 spaces to tabs 2014-04-15 12:09:03 -05:00
Colby Klein 509f725d7e Merge pull request #96 from kyzentun/UnloadProfile_optimization
Unload profile optimization
2014-04-08 15:57:41 -07:00
sigatrev d059118935 Save/LoadProfiles
ScreenProfileLoad and ScreenProfileSave do nothing except use their own
lua methods to run GameState functions. Those functions might as well be
available as GameState methods.
2014-04-02 18:09:21 -05:00
Kyzentun 27dc958970 Changed GameState::UnjoinPlayer to actually follow its own comment and unjoin the player from STATSMAN first, instead of unjoining from PROFILEMAN, then STATSMAN, then PROFILEMAN again. Changed ProfileManager::UnloadProfile to skip unloading if the profile wasn't actually loaded in the first place. 2014-03-10 21:54:53 -06:00
Devin J. Pohly bb1b6a81c6 Special case player number 1/2 in ApplyGameCommand
This function, oddly, used to take a 1 or 2 for the player number where
other nearby functions (e.g. IsPlayerEnabled) would take the proper enum
value, 0 or 1.  If the old-style syntax (raw number) is used, also use
the old-style interpretation.
2014-02-23 16:41:19 -05:00
Colby Klein 5e52c4f37e Merge branch 'ComboContinuesBetweenSongs_readd' of https://github.com/kyzentun/stepmania into kyzentun-ComboContinuesBetweenSongs_readd 2014-02-17 14:41:33 -08:00
Kyzentun 3c7bb93bbc Added ComboContinuesBetweenSongs back in. And if that line in ResetStageStatistics is committed as FOREACH_HumanPlayer, I'm going to punch git. 2014-02-16 11:43:28 -07:00
Kyzentun 5bde20e897 Exposing GameState::JoinInput to Lua. 2014-02-12 15:45:26 -07:00
Ben "root" Anderson d654bd0142 Time to reopen this big 'ol bag of worms. 2014-02-02 12:53:26 -06:00
Ben "root" Anderson a040c4a586 1) SOMEONE can't spell "accessible" 2) Global commenting consistency 3) persistance -> persistence 2013-11-30 09:50:54 -06:00
Devin J. Pohly 00e6f6e924 Make Pay mode work like Free
Third time's a charm.  Removing Pay mode without causing breakage to the Lua API.
This is the first step.
2013-06-08 16:11:02 -04:00
Devin J. Pohly 259e9b1e00 Revert "Round 2 of this."
This reverts commit 1d7b5fe852.
2013-06-04 23:47:49 -04:00
Devin J. Pohly 1220dbe085 Revert "Round 2-2 of this."
This reverts commit 0ae4183f7b.
2013-06-04 23:47:22 -04:00
Jason Felds 0ae4183f7b Round 2-2 of this. 2013-04-16 00:16:02 -04:00
Jason Felds 1d7b5fe852 Round 2 of this. 2013-04-15 23:26:05 -04:00
Colby Klein 3f32d9114f Revert "CoinMode_Pay->CoinMode_Free, step 1."
This reverts commit 15b3ee1a9a.
2013-02-11 12:11:54 -08:00
Flameshadowxeroshin 15b3ee1a9a CoinMode_Pay->CoinMode_Free, step 1.
CoinMode_Pay is still a value for the CoinMode enum but is now the same as CoinMode_Free.
Any code that checks for CoinMode_Pay is gone.
2013-02-07 09:12:28 -06:00
Devin J. Pohly ce507b9800 use empty TimingData in Steps to signify fallback on Song timing.
This required using the new Steps::GetTimingData function and the allowEmpty
parameter to TimingData::TidyUpData when appropriate, as well as clearing the
TimingData to remove step timing rather than coping the song timing over it.

Fixes some odd editor behavior when changing song timing, and is overall a
slightly less hacky way of doing things.
2013-01-23 14:51:18 -05:00
Marcio Barrientos b39137e1be Stop the musicwheel when the optionslist is oppened, this fixes a bug when you call the optionslist using a custom code detector
Small fix in gamestate
2013-01-03 03:17:30 -06:00
Devin J. Pohly 9e6d161743 fix crash on double ES.
code should ensure that a call to SetCurrentSteps passes steps that match the
current StyleType
2013-01-02 14:07:03 -05:00
Devin J. Pohly bd0e2074ad replace ASSERT(0) with useful fail messages 2012-12-27 16:59:35 -05:00
Jason Felds 52df8ea981 War on -Werror, part 13: hodgehodge. 2012-12-27 12:07:02 -05:00
Jason Felds 1fc16698ba War on -Werror, part 12: explicit bool usage.
It may save a few cycles, but it's best to be
explicit on boolean operations, especially with
ASSERT.
2012-12-27 11:38:53 -05:00
Colby Klein bfba3a6fe8 (mostly) Fix arrow stuttering from repeated positions from audio drivers.
As far as I could tell, this fixed any issues I was having with PulseAudio,
it should also fix up DSound on Windows although I've yet to test that.
2012-12-17 16:43:31 -08:00
AJ Kelly 05a410321e formatting 2012-05-27 12:55:57 -05:00
AJ Kelly 59b43867c1 [GameState] Added GetStageResult(pn) Lua binding. 2012-03-28 18:55:17 -05:00
AJ Kelly 73bdb7fd54 [GameState] Set Premium to Premium_DoubleFor1Credit by default. 2012-03-01 17:20:10 -06:00
Marcio Barrientos 4fd32f1259 Change the style after you change the steps with
SetCurrentSteps( PlayerNumber pn, Steps steps ) lua binding
2012-01-07 17:26:18 -06:00
Flameshadowxeroshin b2c3454428 add GameState:GetEnabledPlayers 2012-01-02 06:07:24 +00:00
Jason Felds 1376a46b01 Add the GAMESTATE:InStepEditor LUA binding. 2011-12-12 18:49:10 -05:00
Jason Felds 34f3ff2c31 Add RefreshNoteSkinData lua binding.
If anyone recalls the other ways of getting
arbitrary games, a similar binding could be
added to NoteSkinManager.
2011-11-06 10:36:08 -05:00