From 604663f466f10c31583842834f8946480b78583f Mon Sep 17 00:00:00 2001 From: Andrew Wong Date: Fri, 11 Jul 2003 12:01:25 +0000 Subject: [PATCH] cleaned up unlock data so it appears in MemCard.ini and is no longer in preferences (note to whoever builds uninstaller - don't delete memcard.ini on uninstall, please :) --- stepmania/src/PrefsManager.cpp | 31 ------------------------------ stepmania/src/PrefsManager.h | 8 -------- stepmania/src/ScoreKeeperMAX2.cpp | 5 ++++- stepmania/src/ScreenEvaluation.cpp | 8 ++++++-- 4 files changed, 10 insertions(+), 42 deletions(-) diff --git a/stepmania/src/PrefsManager.cpp b/stepmania/src/PrefsManager.cpp index 3f37c9a20a..502d387358 100644 --- a/stepmania/src/PrefsManager.cpp +++ b/stepmania/src/PrefsManager.cpp @@ -99,17 +99,6 @@ PrefsManager::PrefsManager() m_bAutoMapJoysticks = true; m_fGlobalOffsetSeconds = 0; - // unlock system initializations - m_fDancePointsAccumulated = 0; - m_fArcadePointsAccumulated = 0; - m_fSongPointsAccumulated = 0; - m_fExtraStagesCleared = 0; - m_fExtraStagesFailed = 0; - m_fTotalStagesCleared = 0; - m_fTotalToastysSeen = 0; - m_RouletteSeeds = "10000000000000000"; - - /* DDR Extreme-style extra stage support. * Default off so people used to the current behavior (or those with extra * stage CRS files) don't get it changed around on them. */ @@ -217,16 +206,7 @@ void PrefsManager::ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame ) ini.GetValueB( "Options", "Timestamping", m_bTimestamping ); ini.GetValueB( "Options", "BreakComboToGetItem", m_bBreakComboToGetItem ); ini.GetValueB( "Options", "ShowDancingCharacters", m_bShowDancingCharacters ); - /* XXX: This belongs in the memcard code, not prefs. */ - ini.GetValueF( "Options", "DancePointsAccumulated", m_fDancePointsAccumulated ); ini.GetValueB( "Options", "UseUnlockSystem", m_bUseUnlockSystem ); - ini.GetValueF( "Options", "ArcadePointsAccumulated", m_fArcadePointsAccumulated ); - ini.GetValueF( "Options", "SongPointsAccumulated", m_fSongPointsAccumulated ); - ini.GetValueF( "Options", "ExtraStagesCleared", m_fExtraStagesCleared ); - ini.GetValueF( "Options", "ExtraStagesFailed", m_fExtraStagesFailed ); - ini.GetValueF( "Options", "TotalStagesCleared", m_fTotalStagesCleared ); - ini.GetValueF( "Options", "TotalToastysSeen", m_fTotalToastysSeen ); - ini.GetValue ( "Options", "RouletteSeeds", m_RouletteSeeds ); ini.GetValueB( "Options", "FirstRun", m_bFirstRun ); ini.GetValueB( "Options", "AutoMapJoysticks", m_bAutoMapJoysticks ); @@ -320,7 +300,6 @@ void PrefsManager::SaveGlobalPrefsToDisk() ini.SetValueB( "Options", "Timestamping", m_bTimestamping ); ini.SetValueB( "Options", "BreakComboToGetItem", m_bBreakComboToGetItem ); ini.SetValueB( "Options", "ShowDancingCharacters", m_bShowDancingCharacters ); - ini.SetValueF( "Options", "DancePointsAccumulated", m_fDancePointsAccumulated ); ini.SetValueB( "Options", "UseUnlockSystem", m_bUseUnlockSystem ); ini.SetValueB( "Options", "FirstRun", m_bFirstRun ); ini.SetValueB( "Options", "AutoMapJoysticks", m_bAutoMapJoysticks ); @@ -332,16 +311,6 @@ void PrefsManager::SaveGlobalPrefsToDisk() ini.SetValueB( "Options", "AntiAliasing", m_bAntiAliasing ); ini.SetValueF( "Options", "GlobalOffsetSeconds", m_fGlobalOffsetSeconds ); - // unlock system values - ini.SetValueF( "Options", "ArcadePointsAccumulated", m_fArcadePointsAccumulated ); - ini.SetValueF( "Options", "SongPointsAccumulated", m_fSongPointsAccumulated ); - ini.SetValueF( "Options", "ExtraStagesCleared", m_fExtraStagesCleared ); - ini.SetValueF( "Options", "ExtraStagesFailed", m_fExtraStagesFailed ); - ini.SetValueF( "Options", "TotalStagesCleared", m_fTotalStagesCleared ); - ini.SetValueF( "Options", "TotalToastysSeen", m_fTotalToastysSeen ); - ini.SetValue ( "Options", "RouletteSeeds", m_RouletteSeeds ); - - /* Only write these if they aren't the default. This ensures that we can change * the default and have it take effect for everyone (except people who * tweaked this value). */ diff --git a/stepmania/src/PrefsManager.h b/stepmania/src/PrefsManager.h index 02770872f1..18934c8184 100644 --- a/stepmania/src/PrefsManager.h +++ b/stepmania/src/PrefsManager.h @@ -77,18 +77,10 @@ public: bool m_bAutogenGroupCourses; bool m_bBreakComboToGetItem; bool m_bShowDancingCharacters; - float m_fDancePointsAccumulated; bool m_bUseUnlockSystem; bool m_bFirstRun; bool m_bAutoMapJoysticks; float m_fGlobalOffsetSeconds; - float m_fArcadePointsAccumulated; - float m_fSongPointsAccumulated; - float m_fExtraStagesCleared; - float m_fExtraStagesFailed; - float m_fTotalStagesCleared; - float m_fTotalToastysSeen; - CString m_RouletteSeeds; /* 0 = no; 1 = yes; -1 = auto (do whatever is appropriate for the arch). */ int m_iBoostAppPriority; diff --git a/stepmania/src/ScoreKeeperMAX2.cpp b/stepmania/src/ScoreKeeperMAX2.cpp index bf93c2440a..4df8999940 100644 --- a/stepmania/src/ScoreKeeperMAX2.cpp +++ b/stepmania/src/ScoreKeeperMAX2.cpp @@ -18,6 +18,7 @@ #include "ScreenGameplay.h" #include "GameState.h" #include "Course.h" +#include "unlocksystem.h" ScoreKeeperMAX2::ScoreKeeperMAX2( const vector& apNotes_, PlayerNumber pn_ ): @@ -305,8 +306,10 @@ void ScoreKeeperMAX2::HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTa m_iCurToastyCombo += iNumTapsInRow; if( m_iCurToastyCombo==250 && !GAMESTATE->m_bDemonstrationOrJukebox ) + { SCREENMAN->PostMessageToTopScreen( SM_PlayToasty, 0 ); - PREFSMAN->m_fTotalToastysSeen += 1; + GAMESTATE->m_pUnlockingSys->UnlockToasty(); + } break; default: m_iCurToastyCombo = 0; diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index 55ecc8e093..8e357c4ee9 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -669,13 +669,17 @@ ScreenEvaluation::ScreenEvaluation( CString sClassName, Type type ) : Screen(sCl const float ArcadePoints[NUM_GRADES] = { -1 /* unused */, 0, 0, 1, 1, 1, 1, 10, 10 }; const float SongPoints[NUM_GRADES] = { -1, 0, 1, 2, 3, 4, 5, 10, 20 }; - /* XXX: This should use stageStats.GetGrade, not m_Grades. */ + + + // this is already done on lines 272-274 + + /* XXX: This should use stageStats.GetGrade, not m_Grades. const Grade g = m_Grades[p].GetGrade(); PREFSMAN->m_fArcadePointsAccumulated += ArcadePoints[g]; PREFSMAN->m_fSongPointsAccumulated += SongPoints[g]; - PREFSMAN->SaveGlobalPrefsToDisk(); + PREFSMAN->SaveGlobalPrefsToDisk(); */ } bool bOneHasNewRecord = false;