From af7fb8a25cc3eeebeb4e4fd9750209ed7a8717d7 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 23 Feb 2006 23:50:32 +0000 Subject: [PATCH] Clean up some messages. I'm not too crazy about this; we should have parameters to messages, and unify them with actor messages instead of having two major, distinct, functionally similar messaging systems. This is an improvement over a chunk of messages that are handled differently than all other messages, though. --- stepmania/src/Inventory.h | 5 +++++ stepmania/src/Player.h | 15 +++++++++++++++ stepmania/src/ScoreKeeperNormal.h | 3 +++ stepmania/src/ScreenGameplay.cpp | 14 +++++++------- stepmania/src/ScreenMessage.h | 23 ----------------------- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/stepmania/src/Inventory.h b/stepmania/src/Inventory.h index 9669767b88..2fffe9144d 100644 --- a/stepmania/src/Inventory.h +++ b/stepmania/src/Inventory.h @@ -6,6 +6,11 @@ #include "Actor.h" #include "PlayerNumber.h" #include "RageSound.h" +#include "ScreenMessage.h" + +AutoScreenMessage( SM_BattleDamageLevel1 ); +AutoScreenMessage( SM_BattleDamageLevel2 ); +AutoScreenMessage( SM_BattleDamageLevel3 ); class PlayerState; diff --git a/stepmania/src/Player.h b/stepmania/src/Player.h index d9c7cb2370..544522a1e9 100644 --- a/stepmania/src/Player.h +++ b/stepmania/src/Player.h @@ -12,6 +12,7 @@ #include "AttackDisplay.h" #include "NoteData.h" #include "ControllerStateDisplay.h" +#include "ScreenMessage.h" class ScoreDisplay; class LifeMeter; @@ -22,6 +23,20 @@ class RageTimer; class NoteField; class PlayerStageStats; +AutoScreenMessage( SM_100Combo ); +AutoScreenMessage( SM_200Combo ); +AutoScreenMessage( SM_300Combo ); +AutoScreenMessage( SM_400Combo ); +AutoScreenMessage( SM_500Combo ); +AutoScreenMessage( SM_600Combo ); +AutoScreenMessage( SM_700Combo ); +AutoScreenMessage( SM_800Combo ); +AutoScreenMessage( SM_900Combo ); +AutoScreenMessage( SM_1000Combo ); +AutoScreenMessage( SM_ComboStopped ); +AutoScreenMessage( SM_ComboContinuing ); +AutoScreenMessage( SM_MissComboAborted ); + class Player: public ActorFrame { public: diff --git a/stepmania/src/ScoreKeeperNormal.h b/stepmania/src/ScoreKeeperNormal.h index b8976c4782..4f578f7567 100644 --- a/stepmania/src/ScoreKeeperNormal.h +++ b/stepmania/src/ScoreKeeperNormal.h @@ -5,10 +5,13 @@ #include "ScoreKeeper.h" #include "Attack.h" +#include "ScreenMessage.h" class Steps; class Song; struct RadarValues; +AutoScreenMessage( SM_PlayToasty ); + class ScoreKeeperNormal: public ScoreKeeper { int m_iScoreRemainder; diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 7ae977e617..f574d85310 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -82,6 +82,10 @@ AutoScreenMessage( SM_DoNextScreen ) AutoScreenMessage( SM_StartHereWeGo ) AutoScreenMessage( SM_StopHereWeGo ) +AutoScreenMessage( SM_BattleTrickLevel1 ); +AutoScreenMessage( SM_BattleTrickLevel2 ); +AutoScreenMessage( SM_BattleTrickLevel3 ); + static Preference g_fNetStartOffset( "NetworkStartOffset", -3.0 ); @@ -2485,13 +2489,9 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) { int iTrickLevel = SM-SM_BattleTrickLevel1+1; PlayAnnouncer( ssprintf("gameplay battle trick level%d",iTrickLevel), 3 ); - switch( SM ) - { - case SM_BattleTrickLevel1: m_soundBattleTrickLevel1.Play(); break; - case SM_BattleTrickLevel2: m_soundBattleTrickLevel2.Play(); break; - case SM_BattleTrickLevel3: m_soundBattleTrickLevel3.Play(); break; - default: ASSERT(0); - } + if( SM == SM_BattleTrickLevel1 ) m_soundBattleTrickLevel1.Play(); + else if( SM == SM_BattleTrickLevel2 ) m_soundBattleTrickLevel2.Play(); + else if( SM == SM_BattleTrickLevel3 ) m_soundBattleTrickLevel3.Play(); } else if( SM >= SM_BattleDamageLevel1 && SM <= SM_BattleDamageLevel3 ) { diff --git a/stepmania/src/ScreenMessage.h b/stepmania/src/ScreenMessage.h index 26b663c4da..14de019a7b 100644 --- a/stepmania/src/ScreenMessage.h +++ b/stepmania/src/ScreenMessage.h @@ -18,29 +18,6 @@ enum ScreenMessage { SM_Success, SM_Failure, - // messages sent by Combo - SM_PlayToasty, - SM_100Combo, - SM_200Combo, - SM_300Combo, - SM_400Combo, - SM_500Combo, - SM_600Combo, - SM_700Combo, - SM_800Combo, - SM_900Combo, - SM_1000Combo, - SM_ComboStopped, - SM_ComboContinuing, - SM_MissComboAborted, - - SM_BattleTrickLevel1, - SM_BattleTrickLevel2, - SM_BattleTrickLevel3, - SM_BattleDamageLevel1, - SM_BattleDamageLevel2, - SM_BattleDamageLevel3, - SM_User, SM_Invalid = 999999