From e1b22223365644718cd32c85ecab23824288f286 Mon Sep 17 00:00:00 2001 From: Flameshadowxeroshin Date: Fri, 28 Dec 2012 11:22:47 -0600 Subject: [PATCH 01/11] dummy out internal scoring --- src/ScoreKeeperNormal.cpp | 29 ++--------------------------- src/ScoreKeeperNormal.h | 2 +- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/src/ScoreKeeperNormal.cpp b/src/ScoreKeeperNormal.cpp index 62743275db..4c6952fb56 100644 --- a/src/ScoreKeeperNormal.cpp +++ b/src/ScoreKeeperNormal.cpp @@ -204,34 +204,9 @@ void ScoreKeeperNormal::HandleTapScoreNone() // TODO: networking code } -void ScoreKeeperNormal::AddScoreInternal( TapNoteScore score ) +void ScoreKeeperNormal::AddScoreInternal( TapNoteScore ) { - int &iScore = m_pPlayerStageStats->m_iScore; - int &iCurMaxScore = m_pPlayerStageStats->m_iCurMaxScore; - - int p = 0; - - switch( score ) - { - case TNS_W1: p = 5; break; - case TNS_W2: p = 4; break; - case TNS_W3: p = 3; break; - case TNS_W4: p = 2; break; - case TNS_CheckpointHit: - case TNS_W5: p = 1; break; - case TNS_HitMine: p = -1; break; - default: p = 0; break; - } - - iScore += p; - iCurMaxScore += 5; - - if( iScore < 0 ) - iScore = 0; - - ASSERT_M( iScore >= 0, "iScore < 0" ); - - // LOG->Trace( "score: %i", iScore ); + //dummied out for proper custom scoring support } void ScoreKeeperNormal::HandleTapScore( const TapNote &tn ) diff --git a/src/ScoreKeeperNormal.h b/src/ScoreKeeperNormal.h index 20e8b78a42..7c00888e1b 100644 --- a/src/ScoreKeeperNormal.h +++ b/src/ScoreKeeperNormal.h @@ -16,7 +16,7 @@ AutoScreenMessage( SM_PlayToasty ); /** @brief The default ScoreKeeper implementation. */ class ScoreKeeperNormal: public ScoreKeeper { - void AddScoreInternal( TapNoteScore score ); + void AddScoreInternal( TapNoteScore ); int m_iScoreRemainder; int m_iMaxPossiblePoints; From 825886729c7d120cbfeb860b44ccdb9ee550e669 Mon Sep 17 00:00:00 2001 From: Flameshadowxeroshin Date: Fri, 28 Dec 2012 12:02:12 -0600 Subject: [PATCH 02/11] reimplement beta 1's scoring mode in Lua --- .../ScreenGameplay decorations/default.lua | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua b/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua index a8664db8b2..9edbc6fbe9 100644 --- a/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua +++ b/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua @@ -235,4 +235,28 @@ t[#t+1] = StandardDecorationFromFileOptional("BPMDisplay","BPMDisplay"); t[#t+1] = StandardDecorationFromFileOptional("StageDisplay","StageDisplay"); t[#t+1] = StandardDecorationFromFileOptional("SongTitle","SongTitle"); +do + local pointLookup={ + ['TapNoteScore_W1']=5, + ['TapNoteScore_W2']=4, + ['TapNoteScore_W3']=3, + ['TapNoteScore_W4']=2, + ['TapNoteScore_W5']=1, + ['TapNoteScore_HitMine']=-1} + local ignorableTapNoteScores = { + ['TapNoteScore_HitMine']=true, + ['TapNoteScore_AvoidMine']=true, + ['TapNoteScore_CheckpointHit']=true, + ['TapNoteScore_CheckpointMiss']=true + } + setmetatable(pointLookup,{__index=0}) + t[#t+1] = {Class="Actor", + JudgmentMessageCommand=function(self,params) + local PSS = STATSMAN:GetCurStageStats():GetPlayerStageStats(params.Player) + local holdNoteInfo = params.HoldNoteScore == nil and nil or params.HoldNoteScore == 'HoldNoteScore_Held' and true or false + PSS:SetScore(PSS:GetScore()+pointLookup[params.TapNoteScore]+(holdNoteInfo and 5 or 0)) + PSS:SetCurMaxScore(PSS:GetCurMaxScore()+(holdNoteInfo~=nil and 5 or 0)+(ignorableTapNoteScores[params.TapNoteScore] and 0 or 5)) + end + } +end return t From 28e5530357a5fde7e02d04c4aaaa19681b9ace8f Mon Sep 17 00:00:00 2001 From: Flameshadowxeroshin Date: Fri, 28 Dec 2012 13:55:54 -0600 Subject: [PATCH 03/11] mess with the scoring code a bit --- .../BGAnimations/ScreenGameplay decorations/default.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua b/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua index 9edbc6fbe9..68887a89ff 100644 --- a/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua +++ b/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua @@ -236,6 +236,8 @@ t[#t+1] = StandardDecorationFromFileOptional("StageDisplay","StageDisplay"); t[#t+1] = StandardDecorationFromFileOptional("SongTitle","SongTitle"); do + local w1PrefValue = PREFSMAN:GetPreference("AllowW1") + local showingW1 = w1PrefValue == 'AllowW1_Everywhere' or (w1PrefValue=='AllowW1_CoursesOnly' and GAMESTATE:IsCourseMode()) local pointLookup={ ['TapNoteScore_W1']=5, ['TapNoteScore_W2']=4, @@ -252,6 +254,10 @@ do setmetatable(pointLookup,{__index=0}) t[#t+1] = {Class="Actor", JudgmentMessageCommand=function(self,params) + if not showingW1 then + local withinW1Windows = math.abs(params.Offset)<=PREFSMAN:GetPreference("TimingWindowW1") + if withinW1Windows then params.TapNoteScore='TapNoteScore_W1' end + end local PSS = STATSMAN:GetCurStageStats():GetPlayerStageStats(params.Player) local holdNoteInfo = params.HoldNoteScore == nil and nil or params.HoldNoteScore == 'HoldNoteScore_Held' and true or false PSS:SetScore(PSS:GetScore()+pointLookup[params.TapNoteScore]+(holdNoteInfo and 5 or 0)) From b03b3adf415541fdb3f24e4cafa55069bace7a53 Mon Sep 17 00:00:00 2001 From: "Devin J. Pohly" Date: Fri, 28 Dec 2012 16:18:21 -0500 Subject: [PATCH 04/11] remove extra zeros from editor textentry --- src/ScreenEdit.cpp | 76 +++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index d6252def93..437d8e84aa 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -2511,7 +2511,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) if( iAttack >= 0 ) { - const RString sDuration = ssprintf( "%.6f", ce.attacks[iAttack].fSecsRemaining ); + const RString sDuration = FloatToString(ce.attacks[iAttack].fSecsRemaining ); g_InsertCourseAttack.rows[remove].bEnabled = true; if( g_InsertCourseAttack.rows[duration].choices.size() == 9 ) @@ -3653,14 +3653,14 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) { ScreenTextEntry::TextEntry(SM_BackFromEditingAttackStart, EDIT_ATTACK_START, - ssprintf("%.5f", attack.fStartSecond), + FloatToString(attack.fStartSecond), 10); } else if (option == 1) // adjusting the length of the attack { ScreenTextEntry::TextEntry(SM_BackFromEditingAttackLength, EDIT_ATTACK_LENGTH, - ssprintf("%.5f", attack.fSecsRemaining), + FloatToString(attack.fSecsRemaining), 10); } else if (option >= 2 + mods.size()) // adding a new mod @@ -3732,7 +3732,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) true, 0, NULL)); - g_IndividualAttack.rows[0].SetOneUnthemedChoice(ssprintf("%.5f", attack.fStartSecond)); + g_IndividualAttack.rows[0].SetOneUnthemedChoice(FloatToString(attack.fStartSecond)); g_IndividualAttack.rows.push_back(MenuRowDef(1, "Secs Remaining", true, @@ -3741,7 +3741,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) true, 0, NULL)); - g_IndividualAttack.rows[1].SetOneUnthemedChoice(ssprintf("%.5f", attack.fSecsRemaining)); + g_IndividualAttack.rows[1].SetOneUnthemedChoice(FloatToString(attack.fSecsRemaining)); vector mods; split(attack.sModifiers, ",", mods); for (unsigned i = 0; i < mods.size(); ++i) @@ -4218,10 +4218,10 @@ void ScreenEdit::DisplayTimingMenu() // bool bIsSelecting = ( (m_NoteFieldEdit.m_iEndMarker != -1) && (m_NoteFieldEdit.m_iBeginMarker != -1) ); - g_TimingDataInformation.rows[beat_0_offset].SetOneUnthemedChoice( ssprintf("%.6f", pTime.m_fBeat0OffsetInSeconds) ); - g_TimingDataInformation.rows[bpm].SetOneUnthemedChoice( ssprintf("%.6f", pTime.GetBPMAtRow( row ) ) ); - g_TimingDataInformation.rows[stop].SetOneUnthemedChoice( ssprintf("%.6f", pTime.GetStopAtRow( row ) ) ) ; - g_TimingDataInformation.rows[delay].SetOneUnthemedChoice( ssprintf("%.6f", pTime.GetDelayAtRow( row ) ) ); + g_TimingDataInformation.rows[beat_0_offset].SetOneUnthemedChoice( FloatToString(pTime.m_fBeat0OffsetInSeconds) ); + g_TimingDataInformation.rows[bpm].SetOneUnthemedChoice( FloatToString(pTime.GetBPMAtRow( row ) ) ); + g_TimingDataInformation.rows[stop].SetOneUnthemedChoice( FloatToString(pTime.GetStopAtRow( row ) ) ) ; + g_TimingDataInformation.rows[delay].SetOneUnthemedChoice( FloatToString(pTime.GetDelayAtRow( row ) ) ); g_TimingDataInformation.rows[time_signature].SetOneUnthemedChoice( ssprintf( "%d / %d", @@ -4235,15 +4235,15 @@ void ScreenEdit::DisplayTimingMenu() g_TimingDataInformation.rows[combo].SetOneUnthemedChoice( ssprintf("%d / %d", pTime.GetComboAtRow( row ), pTime.GetMissComboAtRow( row ) ) ); - g_TimingDataInformation.rows[warp].SetOneUnthemedChoice( ssprintf("%.6f", pTime.GetWarpAtRow( row ) ) ); - g_TimingDataInformation.rows[speed_percent].SetOneUnthemedChoice( bHasSpeedOnThisRow ? ssprintf("%.6f", pTime.GetSpeedPercentAtRow( row ) ) : "---" ); - g_TimingDataInformation.rows[speed_wait].SetOneUnthemedChoice( bHasSpeedOnThisRow ? ssprintf("%.6f", pTime.GetSpeedWaitAtRow( row ) ) : "---" ); + g_TimingDataInformation.rows[warp].SetOneUnthemedChoice( FloatToString(pTime.GetWarpAtRow( row ) ) ); + g_TimingDataInformation.rows[speed_percent].SetOneUnthemedChoice( bHasSpeedOnThisRow ? FloatToString(pTime.GetSpeedPercentAtRow( row ) ) : "---" ); + g_TimingDataInformation.rows[speed_wait].SetOneUnthemedChoice( bHasSpeedOnThisRow ? FloatToString(pTime.GetSpeedWaitAtRow( row ) ) : "---" ); RString starting = ( pTime.GetSpeedModeAtRow( row ) == 1 ? "Seconds" : "Beats" ); g_TimingDataInformation.rows[speed_mode].SetOneUnthemedChoice( starting.c_str() ); - g_TimingDataInformation.rows[scroll].SetOneUnthemedChoice( ssprintf("%.6f", pTime.GetScrollAtRow( row ) ) ); - g_TimingDataInformation.rows[fake].SetOneUnthemedChoice( ssprintf("%.6f", pTime.GetFakeAtRow( row ) ) ); + g_TimingDataInformation.rows[scroll].SetOneUnthemedChoice( FloatToString(pTime.GetScrollAtRow( row ) ) ); + g_TimingDataInformation.rows[fake].SetOneUnthemedChoice( FloatToString(pTime.GetFakeAtRow( row ) ) ); // g_TimingDataInformation.rows[speed_percent].bEnabled = !bIsSelecting; g_TimingDataInformation.rows[speed_wait].bEnabled = bHasSpeedOnThisRow; @@ -4347,8 +4347,8 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector &iAns g_StepsInformation.rows[step_credit].bEnabled = (EDIT_MODE.GetValue() >= EditMode_Full); g_StepsInformation.rows[step_credit].SetOneUnthemedChoice( pSteps->GetCredit() ); g_StepsInformation.rows[step_display_bpm].iDefaultChoice = pSteps->GetDisplayBPM(); - g_StepsInformation.rows[step_min_bpm].SetOneUnthemedChoice( ssprintf("%.6f", pSteps->GetMinBPM())); - g_StepsInformation.rows[step_max_bpm].SetOneUnthemedChoice( ssprintf("%.6f", pSteps->GetMaxBPM())); + g_StepsInformation.rows[step_min_bpm].SetOneUnthemedChoice( FloatToString(pSteps->GetMinBPM())); + g_StepsInformation.rows[step_max_bpm].SetOneUnthemedChoice( FloatToString(pSteps->GetMaxBPM())); EditMiniMenu( &g_StepsInformation, SM_BackFromStepsInformation, SM_None ); } break; @@ -4488,12 +4488,12 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector &iAns g_SongInformation.rows[main_title_transliteration].SetOneUnthemedChoice( pSong->m_sMainTitleTranslit ); g_SongInformation.rows[sub_title_transliteration].SetOneUnthemedChoice( pSong->m_sSubTitleTranslit ); g_SongInformation.rows[artist_transliteration].SetOneUnthemedChoice( pSong->m_sArtistTranslit ); - g_SongInformation.rows[last_second_hint].SetOneUnthemedChoice( ssprintf("%.6f", pSong->GetSpecifiedLastSecond()) ); - g_SongInformation.rows[preview_start].SetOneUnthemedChoice( ssprintf("%.6f", pSong->m_fMusicSampleStartSeconds) ); - g_SongInformation.rows[preview_length].SetOneUnthemedChoice( ssprintf("%.6f", pSong->m_fMusicSampleLengthSeconds) ); + g_SongInformation.rows[last_second_hint].SetOneUnthemedChoice( FloatToString(pSong->GetSpecifiedLastSecond()) ); + g_SongInformation.rows[preview_start].SetOneUnthemedChoice( FloatToString(pSong->m_fMusicSampleStartSeconds) ); + g_SongInformation.rows[preview_length].SetOneUnthemedChoice( FloatToString(pSong->m_fMusicSampleLengthSeconds) ); g_SongInformation.rows[display_bpm].iDefaultChoice = pSong->m_DisplayBPMType; - g_SongInformation.rows[min_bpm].SetOneUnthemedChoice( ssprintf("%.6f", pSong->m_fSpecifiedBPMMin) ); - g_SongInformation.rows[max_bpm].SetOneUnthemedChoice( ssprintf("%.6f", pSong->m_fSpecifiedBPMMax) ); + g_SongInformation.rows[min_bpm].SetOneUnthemedChoice( FloatToString(pSong->m_fSpecifiedBPMMin) ); + g_SongInformation.rows[max_bpm].SetOneUnthemedChoice( FloatToString(pSong->m_fSpecifiedBPMMax) ); EditMiniMenu( &g_SongInformation, SM_BackFromSongInformation ); } @@ -5096,7 +5096,7 @@ void ScreenEdit::HandleStepsInformationChoice( StepsInformationChoice c, const v case step_min_bpm: { ScreenTextEntry::TextEntry(SM_None, ENTER_MIN_BPM, - ssprintf("%.6f", pSteps->GetMinBPM()), 20, + FloatToString(pSteps->GetMinBPM()), 20, ScreenTextEntry::FloatValidate, ChangeStepsMinBPM, NULL); break; @@ -5104,7 +5104,7 @@ void ScreenEdit::HandleStepsInformationChoice( StepsInformationChoice c, const v case step_max_bpm: { ScreenTextEntry::TextEntry(SM_None, ENTER_MAX_BPM, - ssprintf("%.6f", pSteps->GetMaxBPM()), 20, + FloatToString(pSteps->GetMaxBPM()), 20, ScreenTextEntry::FloatValidate, ChangeStepsMaxBPM, NULL); break; @@ -5159,27 +5159,27 @@ void ScreenEdit::HandleSongInformationChoice( SongInformationChoice c, const vec break; case last_second_hint: ScreenTextEntry::TextEntry( SM_None, ENTER_LAST_SECOND_HINT, - ssprintf("%.6f", pSong->GetSpecifiedLastSecond()), 20, + FloatToString(pSong->GetSpecifiedLastSecond()), 20, ScreenTextEntry::FloatValidate, ChangeLastSecondHint, NULL ); break; case preview_start: ScreenTextEntry::TextEntry( SM_None, ENTER_PREVIEW_START, - ssprintf("%.6f", pSong->m_fMusicSampleStartSeconds), 20, + FloatToString(pSong->m_fMusicSampleStartSeconds), 20, ScreenTextEntry::FloatValidate, ChangePreviewStart, NULL ); break; case preview_length: ScreenTextEntry::TextEntry( SM_None, ENTER_PREVIEW_LENGTH, - ssprintf("%.6f", pSong->m_fMusicSampleLengthSeconds), 20, + FloatToString(pSong->m_fMusicSampleLengthSeconds), 20, ScreenTextEntry::FloatValidate, ChangePreviewLength, NULL ); break; case min_bpm: ScreenTextEntry::TextEntry( SM_None, ENTER_MIN_BPM, - ssprintf("%.6f", pSong->m_fSpecifiedBPMMin), 20, + FloatToString(pSong->m_fSpecifiedBPMMin), 20, ScreenTextEntry::FloatValidate, ChangeMinBPM, NULL ); break; case max_bpm: ScreenTextEntry::TextEntry( SM_None, ENTER_MAX_BPM, - ssprintf("%.6f", pSong->m_fSpecifiedBPMMax), 20, + FloatToString(pSong->m_fSpecifiedBPMMax), 20, ScreenTextEntry::FloatValidate, ChangeMaxBPM, NULL ); break; default: break; @@ -5210,14 +5210,14 @@ void ScreenEdit::HandleTimingDataInformationChoice( TimingDataInformationChoice DEFAULT_FAIL( c ); case beat_0_offset: ScreenTextEntry::TextEntry( SM_None, ENTER_BEAT_0_OFFSET, - ssprintf("%.6f", GetAppropriateTiming().m_fBeat0OffsetInSeconds), 20, + FloatToString(GetAppropriateTiming().m_fBeat0OffsetInSeconds), 20, ScreenTextEntry::FloatValidate, ChangeBeat0Offset, NULL ); break; case bpm: ScreenTextEntry::TextEntry( SM_BackFromBPMChange, ENTER_BPM_VALUE, - ssprintf( "%.4f", GetAppropriateTiming().GetBPMAtBeat( GetBeat() ) ), + FloatToString( GetAppropriateTiming().GetBPMAtBeat( GetBeat() ) ), 10 ); break; @@ -5225,7 +5225,7 @@ void ScreenEdit::HandleTimingDataInformationChoice( TimingDataInformationChoice ScreenTextEntry::TextEntry( SM_BackFromStopChange, ENTER_STOP_VALUE, - ssprintf( "%.4f", GetAppropriateTiming().GetStopAtBeat( GetBeat() ) ), + FloatToString( GetAppropriateTiming().GetStopAtBeat( GetBeat() ) ), 10 ); break; @@ -5233,7 +5233,7 @@ void ScreenEdit::HandleTimingDataInformationChoice( TimingDataInformationChoice ScreenTextEntry::TextEntry( SM_BackFromDelayChange, ENTER_DELAY_VALUE, - ssprintf( "%.4f", GetAppropriateTiming().GetDelayAtBeat( GetBeat() ) ), + FloatToString( GetAppropriateTiming().GetDelayAtBeat( GetBeat() ) ), 10 ); break; @@ -5279,7 +5279,7 @@ void ScreenEdit::HandleTimingDataInformationChoice( TimingDataInformationChoice ScreenTextEntry::TextEntry( SM_BackFromWarpChange, ENTER_WARP_VALUE, - ssprintf( "%.6f", GetAppropriateTiming().GetWarpAtBeat( GetBeat() ) ), + FloatToString( GetAppropriateTiming().GetWarpAtBeat( GetBeat() ) ), 10 ); break; @@ -5287,7 +5287,7 @@ void ScreenEdit::HandleTimingDataInformationChoice( TimingDataInformationChoice ScreenTextEntry::TextEntry( SM_BackFromSpeedPercentChange, ENTER_SPEED_PERCENT_VALUE, - ssprintf( "%.6f", GetAppropriateTiming().GetSpeedSegmentAtBeat( GetBeat() )->GetRatio() ), + FloatToString( GetAppropriateTiming().GetSpeedSegmentAtBeat( GetBeat() )->GetRatio() ), 10 ); break; @@ -5295,7 +5295,7 @@ void ScreenEdit::HandleTimingDataInformationChoice( TimingDataInformationChoice ScreenTextEntry::TextEntry( SM_BackFromScrollChange, ENTER_SCROLL_VALUE, - ssprintf( "%.6f", GetAppropriateTiming().GetScrollSegmentAtBeat( GetBeat() )->GetRatio() ), + FloatToString( GetAppropriateTiming().GetScrollSegmentAtBeat( GetBeat() )->GetRatio() ), 10 ); break; @@ -5303,7 +5303,7 @@ void ScreenEdit::HandleTimingDataInformationChoice( TimingDataInformationChoice ScreenTextEntry::TextEntry( SM_BackFromSpeedWaitChange, ENTER_SPEED_WAIT_VALUE, - ssprintf( "%.6f", GetAppropriateTiming().GetSpeedSegmentAtBeat( GetBeat() )->GetDelay() ), + FloatToString( GetAppropriateTiming().GetSpeedSegmentAtBeat( GetBeat() )->GetDelay() ), 10 ); break; @@ -5323,7 +5323,7 @@ void ScreenEdit::HandleTimingDataInformationChoice( TimingDataInformationChoice ScreenTextEntry::TextEntry( SM_BackFromFakeChange, ENTER_FAKE_VALUE, - ssprintf("%.6f", GetAppropriateTiming().GetFakeAtBeat( GetBeat() ) ), + FloatToString(GetAppropriateTiming().GetFakeAtBeat( GetBeat() ) ), 10 ); break; @@ -5780,7 +5780,7 @@ void ScreenEdit::DoStepAttackMenu() FOREACH(int, points, i) { const Attack &attack = attacks[*i]; - RString desc = ssprintf("%.5f -> %.5f (%d mod[s])", + RString desc = ssprintf("%g -> %g (%d mod[s])", startTime, startTime + attack.fSecsRemaining, attack.GetNumAttacks()); From 13c795d019cdf4c89139250f634142a7aab63949 Mon Sep 17 00:00:00 2001 From: Colby Klein Date: Fri, 28 Dec 2012 13:41:41 -0800 Subject: [PATCH 05/11] Revert "dummy out internal scoring" This reverts commit e1b22223365644718cd32c85ecab23824288f286. This is pretty much guaranteed to muck with themes. --- src/ScoreKeeperNormal.cpp | 29 +++++++++++++++++++++++++++-- src/ScoreKeeperNormal.h | 2 +- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/ScoreKeeperNormal.cpp b/src/ScoreKeeperNormal.cpp index 4c6952fb56..62743275db 100644 --- a/src/ScoreKeeperNormal.cpp +++ b/src/ScoreKeeperNormal.cpp @@ -204,9 +204,34 @@ void ScoreKeeperNormal::HandleTapScoreNone() // TODO: networking code } -void ScoreKeeperNormal::AddScoreInternal( TapNoteScore ) +void ScoreKeeperNormal::AddScoreInternal( TapNoteScore score ) { - //dummied out for proper custom scoring support + int &iScore = m_pPlayerStageStats->m_iScore; + int &iCurMaxScore = m_pPlayerStageStats->m_iCurMaxScore; + + int p = 0; + + switch( score ) + { + case TNS_W1: p = 5; break; + case TNS_W2: p = 4; break; + case TNS_W3: p = 3; break; + case TNS_W4: p = 2; break; + case TNS_CheckpointHit: + case TNS_W5: p = 1; break; + case TNS_HitMine: p = -1; break; + default: p = 0; break; + } + + iScore += p; + iCurMaxScore += 5; + + if( iScore < 0 ) + iScore = 0; + + ASSERT_M( iScore >= 0, "iScore < 0" ); + + // LOG->Trace( "score: %i", iScore ); } void ScoreKeeperNormal::HandleTapScore( const TapNote &tn ) diff --git a/src/ScoreKeeperNormal.h b/src/ScoreKeeperNormal.h index 7c00888e1b..20e8b78a42 100644 --- a/src/ScoreKeeperNormal.h +++ b/src/ScoreKeeperNormal.h @@ -16,7 +16,7 @@ AutoScreenMessage( SM_PlayToasty ); /** @brief The default ScoreKeeper implementation. */ class ScoreKeeperNormal: public ScoreKeeper { - void AddScoreInternal( TapNoteScore ); + void AddScoreInternal( TapNoteScore score ); int m_iScoreRemainder; int m_iMaxPossiblePoints; From 22a55b3ce9f4f2108ea77acc1c4cbe84178c161e Mon Sep 17 00:00:00 2001 From: Colby Klein Date: Fri, 28 Dec 2012 13:43:25 -0800 Subject: [PATCH 06/11] Revert "mess with the scoring code a bit" This reverts commit 28e5530357a5fde7e02d04c4aaaa19681b9ace8f. This kind of thing should be in global scripts. --- .../BGAnimations/ScreenGameplay decorations/default.lua | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua b/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua index 68887a89ff..9edbc6fbe9 100644 --- a/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua +++ b/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua @@ -236,8 +236,6 @@ t[#t+1] = StandardDecorationFromFileOptional("StageDisplay","StageDisplay"); t[#t+1] = StandardDecorationFromFileOptional("SongTitle","SongTitle"); do - local w1PrefValue = PREFSMAN:GetPreference("AllowW1") - local showingW1 = w1PrefValue == 'AllowW1_Everywhere' or (w1PrefValue=='AllowW1_CoursesOnly' and GAMESTATE:IsCourseMode()) local pointLookup={ ['TapNoteScore_W1']=5, ['TapNoteScore_W2']=4, @@ -254,10 +252,6 @@ do setmetatable(pointLookup,{__index=0}) t[#t+1] = {Class="Actor", JudgmentMessageCommand=function(self,params) - if not showingW1 then - local withinW1Windows = math.abs(params.Offset)<=PREFSMAN:GetPreference("TimingWindowW1") - if withinW1Windows then params.TapNoteScore='TapNoteScore_W1' end - end local PSS = STATSMAN:GetCurStageStats():GetPlayerStageStats(params.Player) local holdNoteInfo = params.HoldNoteScore == nil and nil or params.HoldNoteScore == 'HoldNoteScore_Held' and true or false PSS:SetScore(PSS:GetScore()+pointLookup[params.TapNoteScore]+(holdNoteInfo and 5 or 0)) From f1e3fae9f7be52b775867523003ad3f95130e3f8 Mon Sep 17 00:00:00 2001 From: Colby Klein Date: Fri, 28 Dec 2012 13:43:49 -0800 Subject: [PATCH 07/11] Revert "reimplement beta 1's scoring mode in Lua" This reverts commit 825886729c7d120cbfeb860b44ccdb9ee550e669. This kind of thing should be in global scripts. --- .../ScreenGameplay decorations/default.lua | 24 --------------- .../default.lua.orig | 29 ------------------- 2 files changed, 53 deletions(-) diff --git a/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua b/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua index 9edbc6fbe9..a8664db8b2 100644 --- a/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua +++ b/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua @@ -235,28 +235,4 @@ t[#t+1] = StandardDecorationFromFileOptional("BPMDisplay","BPMDisplay"); t[#t+1] = StandardDecorationFromFileOptional("StageDisplay","StageDisplay"); t[#t+1] = StandardDecorationFromFileOptional("SongTitle","SongTitle"); -do - local pointLookup={ - ['TapNoteScore_W1']=5, - ['TapNoteScore_W2']=4, - ['TapNoteScore_W3']=3, - ['TapNoteScore_W4']=2, - ['TapNoteScore_W5']=1, - ['TapNoteScore_HitMine']=-1} - local ignorableTapNoteScores = { - ['TapNoteScore_HitMine']=true, - ['TapNoteScore_AvoidMine']=true, - ['TapNoteScore_CheckpointHit']=true, - ['TapNoteScore_CheckpointMiss']=true - } - setmetatable(pointLookup,{__index=0}) - t[#t+1] = {Class="Actor", - JudgmentMessageCommand=function(self,params) - local PSS = STATSMAN:GetCurStageStats():GetPlayerStageStats(params.Player) - local holdNoteInfo = params.HoldNoteScore == nil and nil or params.HoldNoteScore == 'HoldNoteScore_Held' and true or false - PSS:SetScore(PSS:GetScore()+pointLookup[params.TapNoteScore]+(holdNoteInfo and 5 or 0)) - PSS:SetCurMaxScore(PSS:GetCurMaxScore()+(holdNoteInfo~=nil and 5 or 0)+(ignorableTapNoteScores[params.TapNoteScore] and 0 or 5)) - end - } -end return t diff --git a/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua.orig b/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua.orig index e7d4646b8f..a8664db8b2 100644 --- a/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua.orig +++ b/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua.orig @@ -234,34 +234,5 @@ end; t[#t+1] = StandardDecorationFromFileOptional("BPMDisplay","BPMDisplay"); t[#t+1] = StandardDecorationFromFileOptional("StageDisplay","StageDisplay"); t[#t+1] = StandardDecorationFromFileOptional("SongTitle","SongTitle"); -t[#t+1] = Def.ActorFrame { - Def.ActorFrame { - Name="LifeTest"; - Owner=PLAYER_1; - InitCommand=cmd(x,Center1Player() and SCREEN_CENTER_X or THEME:GetMetric(Var "LoadingScreen","PlayerP1OnePlayerOneSideX");y,SCREEN_TOP+80); - LifeChangedMessageCommand=function(self,params) - local c = self:GetChildren(); - if params.Player == PLAYER_1 then - local fLife = params.LifeMeter:GetLife(); - c.LifeText:settextf("%03i", fLife * 100); - end - end; - HealthStateChangedMessageCommand=function(self, params) - local c = self.GetChildren(); - if params.PlayerNumber == PLAYER_1 then - c.LifeText:settext( ToEnumShortString(params.HealthState) ); - end - end; - -- - LoadFont("Common Normal") .. { - Name="LifeText"; - InitCommand=cmd(shadowlength,1); - HotCommand=cmd(stopeffect;diffuse,Color.White;diffuseshift;effectcolor2,Color.White;effectcolor1,Color.Orange); - AliveCommand=cmd(stopeffect;diffuse,Color.White;); - DangerCommand=cmd(stopeffect;diffuse,Color.White;diffuseshift;effectcolor2,Color.Red;effectcolor2,BoostColor(Color.Red,0.5)); - DeadCommand=cmd(stopeffect;diffuse,Color.Black); - }; - }; -}; return t From 1d41b4a921d845d1dd797782cac2229919f1596a Mon Sep 17 00:00:00 2001 From: Colby Klein Date: Fri, 28 Dec 2012 17:02:49 -0800 Subject: [PATCH 08/11] Add Lua hook for WheelBase:Move. Useful for Mouse support/messing with people. --- src/WheelBase.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/WheelBase.cpp b/src/WheelBase.cpp index 51f8905e61..6775d87445 100644 --- a/src/WheelBase.cpp +++ b/src/WheelBase.cpp @@ -526,6 +526,7 @@ int WheelBase::FirstVisibleIndex() class LunaWheelBase: public Luna { public: + static int Move( T* p, lua_State *L ){ p->Move( IArg(1) ); return 0; } static int GetWheelItem( T* p, lua_State *L ) { int iItem = IArg(1); @@ -553,6 +554,7 @@ public: LunaWheelBase() { + ADD_METHOD( Move ); ADD_METHOD( GetWheelItem ); ADD_METHOD( IsSettled ); ADD_METHOD( IsLocked ); From f74a2a4707b81941e761c94cbb44b16d37bc04af Mon Sep 17 00:00:00 2001 From: Jonathan Payne Date: Fri, 28 Dec 2012 17:41:11 -0800 Subject: [PATCH 09/11] change this more --- .../LifeMeterBattery lives/default.lua | 50 ++++++++----------- 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/Themes/default/Graphics/LifeMeterBattery lives/default.lua b/Themes/default/Graphics/LifeMeterBattery lives/default.lua index b2b1485d99..e042e41c79 100755 --- a/Themes/default/Graphics/LifeMeterBattery lives/default.lua +++ b/Themes/default/Graphics/LifeMeterBattery lives/default.lua @@ -2,52 +2,46 @@ local player = Var "Player" local blinkTime = 1.2 local barWidth = 256; local barHeight = 32; -local c - -local function CreateLives(numLives) - local t = {}; - for i=1,numLives do - t[#t+1] = Def.Quad { - Name=i; - OnCommand=cmd(zoom,1024); - }; - end - return t -end +local c; +local LifeMeter, MaxLives, CurLives; +local LifeRatio; local t = Def.ActorFrame { - Def.ActorFrame { - Name="LifeContainer"; + Def.Quad { + Name="LifeFill"; + InitCommand=cmd(zoomto,barWidth,barHeight); + --OnCommand=cmd(diffuseramp;effectcolor2,PlayerColor(player);effectcolor1,ColorMidTone(PlayerColor(player)); + -- effectclock,'beatnooffset';effectperiod,1); }; InitCommand=function(self) - c = self:GetChildren(); + --c = self:GetChildren(); end; BeginCommand=function(self,param) - MESSAGEMAN:Broadcast("SystemMessage",{ Message = "TEST", NoAnimate = true}); - local c = self:GetChildren(); - local screen = SCREENMAN:GetTopScreen(); - local lifemeter = screen:GetLifeMeter(player); - MESSAGEMAN:Broadcast("SystemMessage",{ Message = "TEST2", NoAnimate = true}); - local TotalLives = lifemeter:GetTotalLives(); - local CurLives = lifemeter:GetLivesLeft(); - MESSAGEMAN:Broadcast("SystemMessage",{ Message = "ASSIGN CONTAINERS", NoAnimate = true}); - c.LifeContainer[#c.LifeContainer+1] = CreateLives(TotalLives); - MESSAGEMAN:Broadcast("SystemMessage",{ Message = "LIVES = " .. TotalLives .. " | CUR = " .. CurLives .. " | ACTORS: " .. self:GetNumChildren(), NoAnimate = true}); + local screen = SCREENMAN:GetTopScreen() or nil; + if screen ~= nil then + LifeMeter = screen:GetLifeMeter(player); + MaxLives = LifeMeter:GetTotalLives(); + CurLives = LifeMeter:GetLivesLeft(); + MESSAGEMAN:Broadcast("SystemMessage", + { Message = "(" .. MaxLives .. ", " .. CurLives ")", NoAnimate = true }); + else + MESSAGEMAN:Broadcast("SystemMessage", { Message = "WE DONE FUCKED UP"}); + end end; LifeChangedMessageCommand=function(self,param) if param.Player == player then - return + LifeRatio = CurLives / MaxLives; end end; StartCommand=function(self,param) if param.Player == player then - return + LifeRatio = CurLives / MaxLives; end end; FinishCommand=function(self,param) if param.Player == player then - return + LifeRatio = CurLives / MaxLives; end end; --[[ LoadActor("_lives")..{ From 49b029c3dd045cf1f2e28bbddd4dc3a8f37fdf06 Mon Sep 17 00:00:00 2001 From: Flameshadowxeroshin Date: Fri, 28 Dec 2012 19:46:53 -0600 Subject: [PATCH 10/11] try to fix ES double crash --- src/ScreenSelectMaster.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ScreenSelectMaster.cpp b/src/ScreenSelectMaster.cpp index 951febdadc..9b670e11ac 100644 --- a/src/ScreenSelectMaster.cpp +++ b/src/ScreenSelectMaster.cpp @@ -833,10 +833,10 @@ void ScreenSelectMaster::MenuStart( const InputEventPlus &input ) if( (bool)SHARED_SELECTION || GetCurrentPage() == PAGE_2 ) { // Only one player has to pick. Choose this for all the other players, too. - FOREACH_PlayerNumber( p ) + FOREACH_EnabledPlayer( p ) { ASSERT( !m_bChosen[p] ); - fSecs = max( fSecs, DoMenuStart(p) ); // no harm in calling this for an unjoined player + fSecs = max( fSecs, DoMenuStart(p) ); } } else From 6bf3c9ed37edf0bb6a054417d1f0e0652b409212 Mon Sep 17 00:00:00 2001 From: Colby Klein Date: Fri, 28 Dec 2012 17:49:53 -0800 Subject: [PATCH 11/11] Fix mouse events being eaten on SSMusic. --- src/ScreenSelectMusic.cpp | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/src/ScreenSelectMusic.cpp b/src/ScreenSelectMusic.cpp index 7c594519a6..7205408c8a 100644 --- a/src/ScreenSelectMusic.cpp +++ b/src/ScreenSelectMusic.cpp @@ -394,6 +394,18 @@ void ScreenSelectMusic::Update( float fDeltaTime ) } void ScreenSelectMusic::Input( const InputEventPlus &input ) { + // HACK: This screen eats mouse inputs if we don't check for them first. + bool mouse_evt = false; + for (int i = MOUSE_LEFT; i <= MOUSE_WHEELDOWN; i++) + { + if (input.DeviceI == DeviceInput( DEVICE_MOUSE, (DeviceButton)i )) + mouse_evt = true; + } + if (mouse_evt) + { + ScreenWithMenuElements::Input(input); + return; + } // LOG->Trace( "ScreenSelectMusic::Input()" ); // reset announcer timer @@ -505,23 +517,6 @@ void ScreenSelectMusic::Input( const InputEventPlus &input ) m_bStepsChosen[input.pn] ) return; // ignore - // todo: Allow mousewheel to scroll MusicWheel -aj - /* - if( input.DeviceI.device == DEVICE_MOUSE ) - { - if( input.DeviceI.button == MOUSE_WHEELUP ) - { - MESSAGEMAN->Broadcast( "PreviousSong" ); - m_MusicWheel.Move( -1 ); - } - else if( input.DeviceI.button == MOUSE_WHEELDOWN ) - { - MESSAGEMAN->Broadcast( "NextSong" ); - m_MusicWheel.Move( +1 ); - } - } - */ - if( USE_PLAYER_SELECT_MENU ) { if( input.type == IET_RELEASE && input.MenuI == GAME_BUTTON_SELECT )