diff --git a/stepmania/src/Makefile.am b/stepmania/src/Makefile.am index 443ed562bb..9882cbe22f 100644 --- a/stepmania/src/Makefile.am +++ b/stepmania/src/Makefile.am @@ -320,8 +320,9 @@ GradeDisplay.cpp GradeDisplay.h GraphDisplay.cpp GraphDisplay.h \ GrooveRadar.cpp GrooveRadar.h GroupList.cpp GroupList.h HelpDisplay.cpp HelpDisplay.h \ MemoryCardDisplay.cpp MemoryCardDisplay.h \ MenuTimer.cpp MenuTimer.h MusicBannerWheel.cpp MusicBannerWheel.h \ +ModIcon.cpp ModIcon.h ModIconRow.cpp ModIconRow.h \ MusicList.cpp MusicList.h MusicWheel.cpp MusicWheel.h \ -MusicWheelItem.cpp MusicWheelItem.h OptionIcon.cpp OptionIcon.h OptionIconRow.cpp OptionIconRow.h \ +MusicWheelItem.cpp MusicWheelItem.h \ OptionRow.cpp OptionRow.h OptionsCursor.cpp OptionsCursor.h \ PaneDisplay.cpp PaneDisplay.h ScrollBar.cpp ScrollBar.h \ ScrollingList.cpp ScrollingList.h SnapDisplay.cpp SnapDisplay.h \ diff --git a/stepmania/src/ModIcon.cpp b/stepmania/src/ModIcon.cpp new file mode 100644 index 0000000000..81283d104c --- /dev/null +++ b/stepmania/src/ModIcon.cpp @@ -0,0 +1,88 @@ +#include "global.h" +#include "ModIcon.h" +#include "ThemeManager.h" +#include "PlayerOptions.h" +#include "RageUtil.h" +#include "ActorUtil.h" + +ModIcon::ModIcon() +{ +} + +ModIcon::ModIcon( const ModIcon &cpy ): + ActorFrame(cpy), + m_sprFilled(cpy.m_sprFilled), + m_sprEmpty(cpy.m_sprEmpty), + m_text(cpy.m_text) +{ + this->RemoveAllChildren(); + this->AddChild( m_sprFilled ); + this->AddChild( m_sprEmpty ); + this->AddChild( &m_text ); +} + +void ModIcon::Load( RString sMetricsGroup ) +{ + m_sprFilled.Load( THEME->GetPathG(sMetricsGroup,"Filled") ); + this->AddChild( m_sprFilled ); + + m_sprEmpty.Load( THEME->GetPathG(sMetricsGroup,"Empty") ); + this->AddChild( m_sprEmpty ); + + m_text.LoadFromFont( THEME->GetPathF(sMetricsGroup,"Text") ); + m_text.SetName( "Text" ); + ActorUtil::LoadAllCommandsAndSetXYAndOnCommand( m_text, sMetricsGroup ); + this->AddChild( &m_text ); + + Set(""); +} + +void ModIcon::Set( const RString &_sText ) +{ + RString sText = _sText; + + static const RString sStopWords[] = + { + "1X", + "DEFAULT", + "OVERHEAD", + "OFF", + }; + + for( unsigned i=0; iSetVisible( !bVacant ); + m_sprEmpty->SetVisible( bVacant ); + + m_text.SetText( sText ); +} + +/* + * (c) 2002-2004 Chris Danford + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, and/or sell copies of the Software, and to permit persons to + * whom the Software is furnished to do so, provided that the above + * copyright notice(s) and this permission notice appear in all copies of + * the Software and that both the above copyright notice(s) and this + * permission notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF + * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS + * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT + * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ diff --git a/stepmania/src/ModIcon.h b/stepmania/src/ModIcon.h new file mode 100644 index 0000000000..53a4ce2515 --- /dev/null +++ b/stepmania/src/ModIcon.h @@ -0,0 +1,50 @@ +/* ModIcon - Shows PlayerOptions and SongOptions in icon form. */ + +#ifndef ModIcon_H +#define ModIcon_H + +#include "ActorFrame.h" +#include "AutoActor.h" +#include "BitmapText.h" +#include "PlayerNumber.h" + +class ModIcon : public ActorFrame +{ +public: + ModIcon(); + ModIcon( const ModIcon &cpy ); + void Load( RString sMetricsGroup ); + void Set( const RString &sText ); + +protected: + BitmapText m_text; + AutoActor m_sprFilled; + AutoActor m_sprEmpty; +}; + +#endif + +/* + * (c) 2002-2004 Chris Danford + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, and/or sell copies of the Software, and to permit persons to + * whom the Software is furnished to do so, provided that the above + * copyright notice(s) and this permission notice appear in all copies of + * the Software and that both the above copyright notice(s) and this + * permission notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF + * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS + * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT + * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ diff --git a/stepmania/src/ModIconRow.cpp b/stepmania/src/ModIconRow.cpp new file mode 100644 index 0000000000..14fbe44129 --- /dev/null +++ b/stepmania/src/ModIconRow.cpp @@ -0,0 +1,209 @@ +#include "global.h" +#include "ModIconRow.h" +#include "ThemeManager.h" +#include "PlayerOptions.h" +#include "GameState.h" +#include "RageLog.h" +#include "PlayerState.h" +#include "ActorUtil.h" +#include "XmlFile.h" +#include "LuaManager.h" +#include "Foreach.h" + +REGISTER_ACTOR_CLASS( ModIconRow ) + +ModIconRow::ModIconRow() +{ + m_pn = PlayerNumber_Invalid; + + this->SubscribeToMessage( "PlayerOptionsChanged" ); +} + +ModIconRow::~ModIconRow() +{ + FOREACH( ModIcon*, m_vpModIcon, p ) + { + SAFE_DELETE( *p ); + } + this->RemoveAllChildren(); +} + +void ModIconRow::Load( const RString &sMetricsGroup, PlayerNumber pn ) +{ + ASSERT_M( m_pn == PlayerNumber_Invalid, "Multiple calls to Load" ); + + m_sMetricsGroup = sMetricsGroup; + m_pn = pn; + + SPACING_X.Load(sMetricsGroup,"SpacingX"); + SPACING_Y.Load(sMetricsGroup,"SpacingY"); + NUM_OPTION_ICONS.Load(sMetricsGroup,"NumModIcons"); + OPTION_ICON_METRICS_GROUP.Load(sMetricsGroup,"ModIconMetricsGroup"); + + for( int i=0; iSetName( "ModIcon" ); + p->SetXY( i*SPACING_X, i*SPACING_Y ); + p->Load( OPTION_ICON_METRICS_GROUP ); + ActorUtil::LoadAllCommands( p, sMetricsGroup ); + m_vpModIcon.push_back( p ); + this->AddChild( p ); + } + + SetFromGameState(); +} + +void ModIconRow::HandleMessage( const Message &msg ) +{ + if( msg.GetName() == "PlayerOptionsChanged" ) + SetFromGameState(); + + ActorFrame::HandleMessage( msg ); +} + + +struct OptionColumnEntry +{ + char szString[30]; + int iSlotIndex; +}; + +static const OptionColumnEntry g_OptionColumnEntries[] = +{ + {"Boost", 0}, + {"Brake", 0}, + {"Wave", 0}, + {"Expand", 0}, + {"Boomerang", 0}, + {"Drunk", 1}, + {"Dizzy", 1}, + {"Mini", 1}, + {"Flip", 1}, + {"Tornado", 1}, + {"Hidden", 2}, + {"Sudden", 2}, + {"Stealth", 2}, + {"Blink", 2}, + {"RandomVanish", 2}, + {"Mirror", 3}, + {"Left", 3}, + {"Right", 3}, + {"Shuffle", 3}, + {"SuperShuffle", 3}, + {"Little", 4}, + {"NoHolds", 4}, + {"Dark", 4}, + {"Blind", 4}, + {"Reverse", 5}, + {"Split", 5}, + {"Alternate", 5}, + {"Cross", 5}, + {"Centered", 5}, + {"Incoming", 6}, + {"Space", 6}, + {"Hallway", 6}, + {"Distant", 6}, +}; + +int OptionToPreferredColumn( RString sOptionText ) +{ + /* Speedups always go in column 0. digit ... x */ + if( sOptionText.size() > 1 && + isdigit(sOptionText[0]) && + tolower(sOptionText[sOptionText.size()-1]) == 'x' ) + { + return 0; + } + + for( unsigned i=0; iWarn("Unknown option: '%s'", sOptionText.c_str() ); + return 0; +} + +void ModIconRow::SetFromGameState() +{ + PlayerNumber pn = m_pn; + + RString sOptions = GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions.GetStage().GetString(); + vector vsOptions; + split( sOptions, ", ", vsOptions, true ); + + vector vsText; // fill these with what will be displayed on the tabs + vsText.resize( m_vpModIcon.size() ); + + // for each option, look for the best column to place it in + for( unsigned i=0; iSet( vsText[i] ); +} + +// lua start +#include "LuaBinding.h" + +class LunaModIconRow: public Luna +{ +public: + static int Load( T* p, lua_State *L ) { p->Load( SArg(1), Enum::Check(L, 2) ); return 0; } + + LunaModIconRow() + { + ADD_METHOD( Load ); + } +}; + +LUA_REGISTER_DERIVED_CLASS( ModIconRow, ActorFrame ) + +// lua end + +/* + * (c) 2002-2004 Chris Danford + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, and/or sell copies of the Software, and to permit persons to + * whom the Software is furnished to do so, provided that the above + * copyright notice(s) and this permission notice appear in all copies of + * the Software and that both the above copyright notice(s) and this + * permission notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF + * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS + * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT + * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ diff --git a/stepmania/src/ModIconRow.h b/stepmania/src/ModIconRow.h new file mode 100644 index 0000000000..335faabd07 --- /dev/null +++ b/stepmania/src/ModIconRow.h @@ -0,0 +1,68 @@ +/* ModIconRow - Shows PlayerOptions and SongOptions in icon form. */ + +#ifndef ModIconRow_H +#define ModIconRow_H + + +#include "ActorFrame.h" +#include "ModIcon.h" +#include "ThemeMetric.h" +class PlayerOptions; +struct lua_State; + +class ModIconRow : public ActorFrame +{ +public: + ModIconRow(); + ~ModIconRow(); + + void Load( const RString &sMetricsGroup, PlayerNumber pn ); + + virtual ModIconRow *Copy() const; + void SetFromGameState(); + + virtual void HandleMessage( const Message &msg ); + + // + // Commands + // + virtual void PushSelf( lua_State *L ); + +protected: + RString m_sMetricsGroup; + PlayerNumber m_pn; + + ThemeMetric SPACING_X; + ThemeMetric SPACING_Y; + ThemeMetric NUM_OPTION_ICONS; + ThemeMetric OPTION_ICON_METRICS_GROUP; + + vector m_vpModIcon; +}; + +#endif + +/* + * (c) 2002-2004 Chris Danford + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, and/or sell copies of the Software, and to permit persons to + * whom the Software is furnished to do so, provided that the above + * copyright notice(s) and this permission notice appear in all copies of + * the Software and that both the above copyright notice(s) and this + * permission notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF + * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS + * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT + * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ diff --git a/stepmania/src/OptionIcon.cpp b/stepmania/src/OptionIcon.cpp index 51c1925ed7..a97371cf2d 100644 --- a/stepmania/src/OptionIcon.cpp +++ b/stepmania/src/OptionIcon.cpp @@ -1,15 +1,15 @@ #include "global.h" -#include "OptionIcon.h" +#include "ModIcon.h" #include "ThemeManager.h" #include "PlayerOptions.h" #include "RageUtil.h" #include "ActorUtil.h" -OptionIcon::OptionIcon() +ModIcon::ModIcon() { } -OptionIcon::OptionIcon( const OptionIcon &cpy ): +ModIcon::ModIcon( const ModIcon &cpy ): ActorFrame(cpy), m_sprFilled(cpy.m_sprFilled), m_sprEmpty(cpy.m_sprEmpty), @@ -21,7 +21,7 @@ OptionIcon::OptionIcon( const OptionIcon &cpy ): this->AddChild( &m_text ); } -void OptionIcon::Load( RString sMetricsGroup ) +void ModIcon::Load( RString sMetricsGroup ) { m_sprFilled.Load( THEME->GetPathG(sMetricsGroup,"Filled") ); this->AddChild( m_sprFilled ); @@ -37,7 +37,7 @@ void OptionIcon::Load( RString sMetricsGroup ) Set(""); } -void OptionIcon::Set( const RString &_sText ) +void ModIcon::Set( const RString &_sText ) { RString sText = _sText; diff --git a/stepmania/src/OptionIcon.h b/stepmania/src/OptionIcon.h index 508017cc8a..6032a75246 100644 --- a/stepmania/src/OptionIcon.h +++ b/stepmania/src/OptionIcon.h @@ -1,4 +1,4 @@ -/* OptionIcon - Shows PlayerOptions and SongOptions in icon form. */ +/* ModIcon - Shows PlayerOptions and SongOptions in icon form. */ #ifndef OPTION_ICON_H #define OPTION_ICON_H @@ -8,11 +8,11 @@ #include "BitmapText.h" #include "PlayerNumber.h" -class OptionIcon : public ActorFrame +class ModIcon : public ActorFrame { public: - OptionIcon(); - OptionIcon( const OptionIcon &cpy ); + ModIcon(); + ModIcon( const ModIcon &cpy ); void Load( RString sMetricsGroup ); void Set( const RString &sText ); diff --git a/stepmania/src/OptionIconRow.cpp b/stepmania/src/OptionIconRow.cpp index 4afd0e179f..14fbe44129 100644 --- a/stepmania/src/OptionIconRow.cpp +++ b/stepmania/src/OptionIconRow.cpp @@ -1,5 +1,5 @@ #include "global.h" -#include "OptionIconRow.h" +#include "ModIconRow.h" #include "ThemeManager.h" #include "PlayerOptions.h" #include "GameState.h" @@ -10,25 +10,25 @@ #include "LuaManager.h" #include "Foreach.h" -REGISTER_ACTOR_CLASS( OptionIconRow ) +REGISTER_ACTOR_CLASS( ModIconRow ) -OptionIconRow::OptionIconRow() +ModIconRow::ModIconRow() { m_pn = PlayerNumber_Invalid; this->SubscribeToMessage( "PlayerOptionsChanged" ); } -OptionIconRow::~OptionIconRow() +ModIconRow::~ModIconRow() { - FOREACH( OptionIcon*, m_vpOptionIcon, p ) + FOREACH( ModIcon*, m_vpModIcon, p ) { SAFE_DELETE( *p ); } this->RemoveAllChildren(); } -void OptionIconRow::Load( const RString &sMetricsGroup, PlayerNumber pn ) +void ModIconRow::Load( const RString &sMetricsGroup, PlayerNumber pn ) { ASSERT_M( m_pn == PlayerNumber_Invalid, "Multiple calls to Load" ); @@ -37,24 +37,24 @@ void OptionIconRow::Load( const RString &sMetricsGroup, PlayerNumber pn ) SPACING_X.Load(sMetricsGroup,"SpacingX"); SPACING_Y.Load(sMetricsGroup,"SpacingY"); - NUM_OPTION_ICONS.Load(sMetricsGroup,"NumOptionIcons"); - OPTION_ICON_METRICS_GROUP.Load(sMetricsGroup,"OptionIconMetricsGroup"); + NUM_OPTION_ICONS.Load(sMetricsGroup,"NumModIcons"); + OPTION_ICON_METRICS_GROUP.Load(sMetricsGroup,"ModIconMetricsGroup"); for( int i=0; iSetName( "OptionIcon" ); + ModIcon *p = new ModIcon; + p->SetName( "ModIcon" ); p->SetXY( i*SPACING_X, i*SPACING_Y ); p->Load( OPTION_ICON_METRICS_GROUP ); ActorUtil::LoadAllCommands( p, sMetricsGroup ); - m_vpOptionIcon.push_back( p ); + m_vpModIcon.push_back( p ); this->AddChild( p ); } SetFromGameState(); } -void OptionIconRow::HandleMessage( const Message &msg ) +void ModIconRow::HandleMessage( const Message &msg ) { if( msg.GetName() == "PlayerOptionsChanged" ) SetFromGameState(); @@ -125,7 +125,7 @@ int OptionToPreferredColumn( RString sOptionText ) return 0; } -void OptionIconRow::SetFromGameState() +void ModIconRow::SetFromGameState() { PlayerNumber pn = m_pn; @@ -134,14 +134,14 @@ void OptionIconRow::SetFromGameState() split( sOptions, ", ", vsOptions, true ); vector vsText; // fill these with what will be displayed on the tabs - vsText.resize( m_vpOptionIcon.size() ); + vsText.resize( m_vpModIcon.size() ); // for each option, look for the best column to place it in for( unsigned i=0; iSet( vsText[i] ); + m_vpModIcon[i]->Set( vsText[i] ); } // lua start #include "LuaBinding.h" -class LunaOptionIconRow: public Luna +class LunaModIconRow: public Luna { public: static int Load( T* p, lua_State *L ) { p->Load( SArg(1), Enum::Check(L, 2) ); return 0; } - LunaOptionIconRow() + LunaModIconRow() { ADD_METHOD( Load ); } }; -LUA_REGISTER_DERIVED_CLASS( OptionIconRow, ActorFrame ) +LUA_REGISTER_DERIVED_CLASS( ModIconRow, ActorFrame ) // lua end diff --git a/stepmania/src/OptionIconRow.h b/stepmania/src/OptionIconRow.h index 9e36b03522..4fe4ec47c6 100644 --- a/stepmania/src/OptionIconRow.h +++ b/stepmania/src/OptionIconRow.h @@ -1,24 +1,24 @@ -/* OptionIconRow - Shows PlayerOptions and SongOptions in icon form. */ +/* ModIconRow - Shows PlayerOptions and SongOptions in icon form. */ #ifndef OPTION_ICON_ROW_H #define OPTION_ICON_ROW_H #include "ActorFrame.h" -#include "OptionIcon.h" +#include "ModIcon.h" #include "ThemeMetric.h" class PlayerOptions; struct lua_State; -class OptionIconRow : public ActorFrame +class ModIconRow : public ActorFrame { public: - OptionIconRow(); - ~OptionIconRow(); + ModIconRow(); + ~ModIconRow(); void Load( const RString &sMetricsGroup, PlayerNumber pn ); - virtual OptionIconRow *Copy() const; + virtual ModIconRow *Copy() const; void SetFromGameState(); virtual void HandleMessage( const Message &msg ); @@ -37,7 +37,7 @@ protected: ThemeMetric NUM_OPTION_ICONS; ThemeMetric OPTION_ICON_METRICS_GROUP; - vector m_vpOptionIcon; + vector m_vpModIcon; }; #endif diff --git a/stepmania/src/OptionRow.cpp b/stepmania/src/OptionRow.cpp index 4db0f12dd9..49608e0b6c 100644 --- a/stepmania/src/OptionRow.cpp +++ b/stepmania/src/OptionRow.cpp @@ -34,8 +34,8 @@ RString OptionRow::GetThemedItemText( int iChoice ) const return s; } -RString ITEMS_LONG_ROW_X_NAME( size_t p ) { return ssprintf("ItemsLongRowP%dX",int(p+1)); } -RString ICONS_X_NAME( size_t p ) { return ssprintf("IconsP%dX",int(p+1)); } +RString ITEMS_LONG_ROW_X_NAME( size_t p ) { return ssprintf("ItemsLongRowP%dX",int(p+1)); } +RString MOD_ICON_X_NAME( size_t p ) { return ssprintf("ModIconP%dX",int(p+1)); } OptionRow::OptionRow( const OptionRowType *pSource ) { @@ -43,7 +43,7 @@ OptionRow::OptionRow( const OptionRowType *pSource ) m_pHand = NULL; m_textTitle = NULL; - ZERO( m_OptionIcons ); + ZERO( m_ModIcons ); Clear(); this->AddChild( &m_Frame ); @@ -100,17 +100,17 @@ void OptionRowType::Load( const RString &sType, Actor *pParent ) ITEM_GAIN_FOCUS_COMMAND .Load(sType,"ItemGainFocusCommand"); ITEM_LOSE_FOCUS_COMMAND .Load(sType,"ItemLoseFocusCommand"); EXIT_HIDE_ITEM .Load(sType,"ExitHideItem"); - ICONS_X .Load(sType,ICONS_X_NAME,NUM_PLAYERS); - ICONS_ON_COMMAND .Load(sType,"IconsOnCommand"); + MOD_ICON_X .Load(sType,MOD_ICON_X_NAME,NUM_PLAYERS); + MOD_ICON_ON_COMMAND .Load(sType,"ModIconOnCommand"); COLOR_SELECTED .Load(sType,"ColorSelected"); COLOR_NOT_SELECTED .Load(sType,"ColorNotSelected"); COLOR_DISABLED .Load(sType,"ColorDisabled"); CAPITALIZE_ALL_OPTION_NAMES .Load(sType,"CapitalizeAllOptionNames"); TWEEN_SECONDS .Load(sType,"TweenSeconds"); SHOW_BPM_IN_SPEED_TITLE .Load(sType,"ShowBpmInSpeedTitle"); - SHOW_OPTION_ICONS .Load(sType,"ShowOptionIcons"); + SHOW_MOD_ICONS .Load(sType,"ShowModIcons"); SHOW_UNDERLINES .Load(sType,"ShowUnderlines"); - OPTION_ICON_METRICS_GROUP .Load(sType,"OptionIconMetricsGroup"); + MOD_ICON_METRICS_GROUP .Load(sType,"ModIconMetricsGroup"); m_textItem.LoadFromFont( THEME->GetPathF(sType,"item") ); if( SHOW_UNDERLINES ) @@ -121,8 +121,8 @@ void OptionRowType::Load( const RString &sType, Actor *pParent ) m_textTitle.LoadFromFont( THEME->GetPathF(sType,"title") ); m_sprFrameNormal.Load( ActorUtil::MakeActor( THEME->GetPathG(sType,"FrameNormal"), pParent ) ); m_sprFrameExit.Load( ActorUtil::MakeActor( THEME->GetPathG(sType,"FrameExit"), pParent ) ); - if( SHOW_OPTION_ICONS ) - m_OptionIcon.Load( OPTION_ICON_METRICS_GROUP ); + if( SHOW_MOD_ICONS ) + m_ModIcon.Load( MOD_ICON_METRICS_GROUP ); } void OptionRow::LoadNormal( OptionRowHandler *pHand, bool bFirstItemGoesDown ) @@ -265,21 +265,21 @@ void OptionRow::InitText( RowType type ) m_sprFrame->SetDrawOrder(-1); // under title m_Frame.AddChild( m_sprFrame ); - if( m_pParentType->SHOW_OPTION_ICONS ) + if( m_pParentType->SHOW_MOD_ICONS ) { switch( m_RowType ) { case RowType_Normal: FOREACH_PlayerNumber( p ) { - m_OptionIcons[p] = new OptionIcon( m_pParentType->m_OptionIcon ); - m_OptionIcons[p]->SetDrawOrder(-1); // under title - m_OptionIcons[p]->RunCommands( m_pParentType->ICONS_ON_COMMAND ); + m_ModIcons[p] = new ModIcon( m_pParentType->m_ModIcon ); + m_ModIcons[p]->SetDrawOrder(-1); // under title + m_ModIcons[p]->RunCommands( m_pParentType->MOD_ICON_ON_COMMAND ); - m_Frame.AddChild( m_OptionIcons[p] ); + m_Frame.AddChild( m_ModIcons[p] ); GameCommand gc; - SetOptionIcon( p, "", gc ); + SetModIcon( p, "", gc ); } break; case RowType_Exit: @@ -520,11 +520,11 @@ void OptionRow::PositionUnderlines( PlayerNumber pn ) void OptionRow::PositionIcons( PlayerNumber pn ) { - OptionIcon *pIcon = m_OptionIcons[pn]; + ModIcon *pIcon = m_ModIcons[pn]; if( pIcon == NULL ) return; - pIcon->SetX( m_pParentType->ICONS_X.GetValue(pn) ); + pIcon->SetX( m_pParentType->MOD_ICON_X.GetValue(pn) ); } /* This is called when the focus changes, to update "long row" text. */ @@ -672,14 +672,14 @@ void OptionRow::Update( float fDeltaTime ) m_Frame.SetBaseAlpha( fAlpha ); } -void OptionRow::SetOptionIcon( PlayerNumber pn, const RString &sText, GameCommand &gc ) +void OptionRow::SetModIcon( PlayerNumber pn, const RString &sText, GameCommand &gc ) { // update row frame Message msg( "Refresh" ); msg.SetParam( "GameCommand", &gc ); m_sprFrame->HandleMessage( msg ); - if( m_OptionIcons[pn] != NULL ) - m_OptionIcons[pn]->Set( sText ); + if( m_ModIcons[pn] != NULL ) + m_ModIcons[pn]->Set( sText ); } const BitmapText &OptionRow::GetTextItemForRow( PlayerNumber pn, int iChoiceOnRow ) const diff --git a/stepmania/src/OptionRow.h b/stepmania/src/OptionRow.h index 053d9336cc..65fae5f983 100644 --- a/stepmania/src/OptionRow.h +++ b/stepmania/src/OptionRow.h @@ -6,7 +6,7 @@ #include "ActorFrame.h" #include "BitmapText.h" #include "OptionsCursor.h" -#include "OptionIcon.h" +#include "ModIcon.h" #include "ThemeMetric.h" #include "AutoActor.h" @@ -27,7 +27,7 @@ private: AutoActor m_sprFrameNormal; AutoActor m_sprFrameExit; BitmapText m_textTitle; - OptionIcon m_OptionIcon; + ModIcon m_ModIcon; // metrics ThemeMetric FRAME_X; @@ -46,17 +46,17 @@ private: ThemeMetric ITEM_GAIN_FOCUS_COMMAND; ThemeMetric ITEM_LOSE_FOCUS_COMMAND; ThemeMetric EXIT_HIDE_ITEM; - ThemeMetric1D ICONS_X; - ThemeMetric ICONS_ON_COMMAND; + ThemeMetric1D MOD_ICON_X; + ThemeMetric MOD_ICON_ON_COMMAND; ThemeMetric COLOR_SELECTED; ThemeMetric COLOR_NOT_SELECTED; ThemeMetric COLOR_DISABLED; ThemeMetric CAPITALIZE_ALL_OPTION_NAMES; ThemeMetric TWEEN_SECONDS; ThemeMetric SHOW_BPM_IN_SPEED_TITLE; - ThemeMetric SHOW_OPTION_ICONS; + ThemeMetric SHOW_MOD_ICONS; ThemeMetric SHOW_UNDERLINES; - ThemeMetric OPTION_ICON_METRICS_GROUP; + ThemeMetric MOD_ICON_METRICS_GROUP; friend class OptionRow; }; @@ -72,7 +72,7 @@ public: void LoadNormal( OptionRowHandler *pHand, bool bFirstItemGoesDown ); void LoadExit(); - void SetOptionIcon( PlayerNumber pn, const RString &sText, GameCommand &gc ); + void SetModIcon( PlayerNumber pn, const RString &sText, GameCommand &gc ); void ImportOptions( const vector &vpns ); int ExportOptions( const vector &vpns, bool bRowHasFocus[NUM_PLAYERS] ); @@ -132,26 +132,26 @@ public: protected: RString GetRowTitle() const; - const OptionRowType *m_pParentType; - RowType m_RowType; - OptionRowHandler* m_pHand; + const OptionRowType *m_pParentType; + RowType m_RowType; + OptionRowHandler* m_pHand; - ActorFrame m_Frame; + ActorFrame m_Frame; - vector m_textItems; // size depends on m_bRowIsLong and which players are joined - vector m_Underline[NUM_PLAYERS]; // size depends on m_bRowIsLong and which players are joined + vector m_textItems; // size depends on m_bRowIsLong and which players are joined + vector m_Underline[NUM_PLAYERS]; // size depends on m_bRowIsLong and which players are joined - Actor *m_sprFrame; - BitmapText *m_textTitle; - OptionIcon *m_OptionIcons[NUM_PLAYERS]; + Actor *m_sprFrame; + BitmapText *m_textTitle; + ModIcon *m_ModIcons[NUM_PLAYERS]; - bool m_bFirstItemGoesDown; - bool m_bRowHasFocus[NUM_PLAYERS]; + bool m_bFirstItemGoesDown; + bool m_bRowHasFocus[NUM_PLAYERS]; - int m_iChoiceInRowWithFocus[NUM_PLAYERS]; // this choice has input focus + int m_iChoiceInRowWithFocus[NUM_PLAYERS]; // this choice has input focus // Only one will true at a time if m_pHand->m_Def.bMultiSelect - vector m_vbSelected[NUM_PLAYERS]; // size = m_pHand->m_Def.choices.size() - Actor::TweenState m_tsDestination; // this should approach m_tsDestination. + vector m_vbSelected[NUM_PLAYERS]; // size = m_pHand->m_Def.choices.size() + Actor::TweenState m_tsDestination; // this should approach m_tsDestination. public: void SetDestination( Actor::TweenState &ts, bool bTween ); diff --git a/stepmania/src/OptionsList.h b/stepmania/src/OptionsList.h index d7e2591828..2c5adb40b5 100644 --- a/stepmania/src/OptionsList.h +++ b/stepmania/src/OptionsList.h @@ -1,3 +1,5 @@ +/* OptionsList - A popup options list. */ + #ifndef SCREEN_OPTIONS_LIST_H #define SCREEN_OPTIONS_LIST_H diff --git a/stepmania/src/ScreenNetSelectMusic.cpp b/stepmania/src/ScreenNetSelectMusic.cpp index 52913590c1..174921e488 100644 --- a/stepmania/src/ScreenNetSelectMusic.cpp +++ b/stepmania/src/ScreenNetSelectMusic.cpp @@ -89,11 +89,11 @@ void ScreenNetSelectMusic::Init() FOREACH_EnabledPlayer( p ) { - m_OptionIconRow[p].SetName( ssprintf("OptionIconsP%d",p+1) ); - m_OptionIconRow[p].Load( "OptionIconRowSelectMusic", p ); - m_OptionIconRow[p].SetFromGameState(); - LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_OptionIconRow[p] ); - this->AddChild( &m_OptionIconRow[p] ); + m_ModIconRow[p].SetName( ssprintf("ModIconsP%d",p+1) ); + m_ModIconRow[p].Load( "ModIconRowSelectMusic", p ); + m_ModIconRow[p].SetFromGameState(); + LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_ModIconRow[p] ); + this->AddChild( &m_ModIconRow[p] ); } //Load SFX next @@ -278,7 +278,7 @@ void ScreenNetSelectMusic::HandleScreenMessage( const ScreenMessage SM ) //Update changes FOREACH_EnabledPlayer(p) - m_OptionIconRow[p].SetFromGameState(); + m_ModIconRow[p].SetFromGameState(); } else if( SM == SM_SongChanged ) { @@ -454,7 +454,7 @@ void ScreenNetSelectMusic::TweenOffScreen() { OFF_COMMAND( m_DifficultyDisplays[pn] ); OFF_COMMAND( m_DifficultyIcon[pn] ); - OFF_COMMAND( m_OptionIconRow[pn] ); + OFF_COMMAND( m_ModIconRow[pn] ); } OFF_COMMAND( m_MusicWheel ); diff --git a/stepmania/src/ScreenNetSelectMusic.h b/stepmania/src/ScreenNetSelectMusic.h index 6ae4f9a9ac..ecb3e46dc3 100644 --- a/stepmania/src/ScreenNetSelectMusic.h +++ b/stepmania/src/ScreenNetSelectMusic.h @@ -10,7 +10,7 @@ #include "Difficulty.h" #include "DifficultyDisplay.h" #include "MusicWheel.h" -#include "OptionIconRow.h" +#include "ModIconRow.h" #include "BPMDisplay.h" class ScreenNetSelectMusic : public ScreenNetSelectBase @@ -74,7 +74,7 @@ private: RageSound m_soundChangeSel; BPMDisplay m_BPMDisplay; - OptionIconRow m_OptionIconRow[NUM_PLAYERS]; + ModIconRow m_ModIconRow[NUM_PLAYERS]; Song * m_cSong; diff --git a/stepmania/src/ScreenOptions.cpp b/stepmania/src/ScreenOptions.cpp index f02fb844c3..406eb755f2 100644 --- a/stepmania/src/ScreenOptions.cpp +++ b/stepmania/src/ScreenOptions.cpp @@ -416,7 +416,7 @@ void ScreenOptions::RefreshIcons( int iRow, PlayerNumber pn ) if( def.m_bOneChoiceForAllPlayers ) sIcon = ""; - m_pRows[iRow]->SetOptionIcon( pn, sIcon, gc ); + m_pRows[iRow]->SetModIcon( pn, sIcon, gc ); } void ScreenOptions::PositionCursor( PlayerNumber pn ) diff --git a/stepmania/src/ScreenSelectCharacter.h b/stepmania/src/ScreenSelectCharacter.h index b3d467608c..b2959a1a42 100644 --- a/stepmania/src/ScreenSelectCharacter.h +++ b/stepmania/src/ScreenSelectCharacter.h @@ -7,7 +7,7 @@ #include "Sprite.h" #include "RageSound.h" #include "GameConstantsAndTypes.h" -#include "OptionIcon.h" +#include "ModIcon.h" #include "Banner.h" @@ -59,7 +59,7 @@ private: Sprite m_sprCardArrows[NUM_PLAYERS]; Sprite m_sprAttackFrame[NUM_PLAYERS]; - OptionIcon m_AttackIcons[NUM_PLAYERS][NUM_ATTACK_LEVELS][NUM_ATTACKS_PER_LEVEL]; + ModIcon m_AttackIcons[NUM_PLAYERS][NUM_ATTACK_LEVELS][NUM_ATTACKS_PER_LEVEL]; Sprite m_sprExplanation; diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index 065d3b913c..c1b9a3cc66 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -37,7 +37,7 @@ static const char *SelectionStateNames[] = { XToString( SelectionState ); -const int NUM_SCORE_DIGITS = 9; +const int NUM_SCORE_DIGITS = 9; #define SHOW_OPTIONS_MESSAGE_SECONDS THEME->GetMetricF( m_sName, "ShowOptionsMessageSeconds" ) diff --git a/stepmania/src/StepMania-net2003.vcproj b/stepmania/src/StepMania-net2003.vcproj index c9d76d7c0e..219eb007c5 100644 --- a/stepmania/src/StepMania-net2003.vcproj +++ b/stepmania/src/StepMania-net2003.vcproj @@ -1430,6 +1430,18 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\ + + + + + + + + @@ -1454,18 +1466,6 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\ - - - - - - - -