Cleanup; Get rid of nasty repetitive code.
This commit is contained in:
@@ -322,6 +322,14 @@ void AutoActor::LoadAndSetName( const CString &sScreenName, const CString &sActo
|
|||||||
m_pActor->SetName( sActorName );
|
m_pActor->SetName( sActorName );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UtilSetQuadInit( Actor& actor, const CString &sClassName )
|
||||||
|
{
|
||||||
|
UtilSetXYAndOnCommand( actor, sClassName );
|
||||||
|
actor.SetDiffuse( THEME->GetMetricC( sClassName, actor.m_sName + "Color" ) );
|
||||||
|
actor.SetWidth( THEME->GetMetricF( sClassName, actor.m_sName + "Width" ) );
|
||||||
|
actor.SetHeight( THEME->GetMetricF( sClassName, actor.m_sName + "Height" ) );
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (c) 2003-2004 Chris Danford
|
* (c) 2003-2004 Chris Danford
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
#define OFF_COMMAND( actor ) UtilOffCommand( actor, m_sName )
|
#define OFF_COMMAND( actor ) UtilOffCommand( actor, m_sName )
|
||||||
#define SET_XY_AND_ON_COMMAND( actor ) UtilSetXYAndOnCommand( actor, m_sName )
|
#define SET_XY_AND_ON_COMMAND( actor ) UtilSetXYAndOnCommand( actor, m_sName )
|
||||||
#define COMMAND( actor, command_name ) UtilCommand( actor, m_sName, command_name )
|
#define COMMAND( actor, command_name ) UtilCommand( actor, m_sName, command_name )
|
||||||
|
#define SET_QUAD_INIT( actor ) UtilSetQuadInit( actor, m_sName );
|
||||||
|
|
||||||
|
|
||||||
void UtilSetXY( Actor& actor, const CString &sClassName );
|
void UtilSetXY( Actor& actor, const CString &sClassName );
|
||||||
@@ -25,6 +26,7 @@ inline void UtilSetXYAndOnCommand( Actor& actor, const CString &sClassName )
|
|||||||
UtilSetXY( actor, sClassName );
|
UtilSetXY( actor, sClassName );
|
||||||
UtilOnCommand( actor, sClassName );
|
UtilOnCommand( actor, sClassName );
|
||||||
}
|
}
|
||||||
|
void UtilSetQuadInit( Actor& actor, const CString &sClassName );
|
||||||
|
|
||||||
/* convenience */
|
/* convenience */
|
||||||
inline void UtilCommand( Actor* pActor, const CString &sClassName, const CString &sCommandName ) { if(pActor) UtilCommand( *pActor, sClassName, sCommandName ); }
|
inline void UtilCommand( Actor* pActor, const CString &sClassName, const CString &sCommandName ) { if(pActor) UtilCommand( *pActor, sClassName, sCommandName ); }
|
||||||
|
|||||||
@@ -8,20 +8,10 @@
|
|||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
|
|
||||||
#define TITLEBG_WIDTH THEME->GetMetricF(m_sName,"TitleBGWidth")
|
#define TITLEBG_WIDTH THEME->GetMetricF(m_sName,"TitleBGWidth")
|
||||||
#define TITLEBG_HEIGHT THEME->GetMetricF(m_sName,"TitleBGHeight")
|
|
||||||
#define TITLEBG_COLOR THEME->GetMetricC(m_sName,"TitleBGColor")
|
|
||||||
|
|
||||||
#define ROOMSBG_WIDTH THEME->GetMetricF(m_sName,"RoomsBGWidth")
|
#define ROOMSBG_WIDTH THEME->GetMetricF(m_sName,"RoomsBGWidth")
|
||||||
#define ROOMSBG_HEIGHT THEME->GetMetricF(m_sName,"RoomsBGHeight")
|
|
||||||
#define ROOMSBG_COLOR THEME->GetMetricC(m_sName,"RoomsBGColor")
|
|
||||||
|
|
||||||
#define NUM_ROOMS_SHOW THEME->GetMetricI(m_sName,"NumRoomsShow");
|
#define NUM_ROOMS_SHOW THEME->GetMetricI(m_sName,"NumRoomsShow");
|
||||||
|
|
||||||
#define SEL_WIDTH THEME->GetMetricF(m_sName,"SelWidth")
|
|
||||||
#define SEL_HEIGHT THEME->GetMetricF(m_sName,"SelHeight")
|
|
||||||
#define SEL_COLOR THEME->GetMetricC(m_sName,"SelColor")
|
|
||||||
|
|
||||||
|
|
||||||
const ScreenMessage SM_SMOnlinePack = ScreenMessage(SM_User+8); //Unused, but should be known
|
const ScreenMessage SM_SMOnlinePack = ScreenMessage(SM_User+8); //Unused, but should be known
|
||||||
|
|
||||||
|
|
||||||
@@ -32,11 +22,8 @@ ScreenNetRoom::ScreenNetRoom( const CString& sName ) : ScreenNetSelectBase( sNam
|
|||||||
|
|
||||||
m_iRoomPlace = 0;
|
m_iRoomPlace = 0;
|
||||||
|
|
||||||
m_rectTitleBG.SetDiffuse( TITLEBG_COLOR );
|
|
||||||
m_rectTitleBG.SetName( "TitleBG" );
|
m_rectTitleBG.SetName( "TitleBG" );
|
||||||
m_rectTitleBG.SetWidth( TITLEBG_WIDTH );
|
SET_QUAD_INIT( m_rectTitleBG );
|
||||||
m_rectTitleBG.SetHeight( TITLEBG_HEIGHT );
|
|
||||||
SET_XY_AND_ON_COMMAND( m_rectTitleBG );
|
|
||||||
this->AddChild( &m_rectTitleBG);
|
this->AddChild( &m_rectTitleBG);
|
||||||
|
|
||||||
m_textTitle.LoadFromFont( THEME->GetPathF(m_sName,"wheel") );
|
m_textTitle.LoadFromFont( THEME->GetPathF(m_sName,"wheel") );
|
||||||
@@ -46,11 +33,8 @@ ScreenNetRoom::ScreenNetRoom( const CString& sName ) : ScreenNetSelectBase( sNam
|
|||||||
SET_XY_AND_ON_COMMAND( m_textTitle );
|
SET_XY_AND_ON_COMMAND( m_textTitle );
|
||||||
this->AddChild( &m_textTitle);
|
this->AddChild( &m_textTitle);
|
||||||
|
|
||||||
m_rectRoomsBG.SetDiffuse( ROOMSBG_COLOR );
|
|
||||||
m_rectRoomsBG.SetName( "RoomsBG" );
|
m_rectRoomsBG.SetName( "RoomsBG" );
|
||||||
m_rectRoomsBG.SetWidth( ROOMSBG_WIDTH );
|
SET_QUAD_INIT( m_rectRoomsBG );
|
||||||
m_rectRoomsBG.SetHeight( ROOMSBG_HEIGHT );
|
|
||||||
SET_XY_AND_ON_COMMAND( m_rectRoomsBG );
|
|
||||||
this->AddChild( &m_rectRoomsBG);
|
this->AddChild( &m_rectRoomsBG);
|
||||||
|
|
||||||
m_textRooms.LoadFromFont( THEME->GetPathF(m_sName,"wheel") );
|
m_textRooms.LoadFromFont( THEME->GetPathF(m_sName,"wheel") );
|
||||||
@@ -60,11 +44,8 @@ ScreenNetRoom::ScreenNetRoom( const CString& sName ) : ScreenNetSelectBase( sNam
|
|||||||
SET_XY_AND_ON_COMMAND( m_textRooms );
|
SET_XY_AND_ON_COMMAND( m_textRooms );
|
||||||
this->AddChild( &m_textRooms );
|
this->AddChild( &m_textRooms );
|
||||||
|
|
||||||
m_rectRoomsSel.SetDiffuse( SEL_COLOR );
|
|
||||||
m_rectRoomsSel.SetName( "Sel" );
|
m_rectRoomsSel.SetName( "Sel" );
|
||||||
m_rectRoomsSel.SetWidth( SEL_WIDTH );
|
SET_QUAD_INIT( m_rectRoomsSel );
|
||||||
m_rectRoomsSel.SetHeight( SEL_HEIGHT );
|
|
||||||
SET_XY_AND_ON_COMMAND( m_rectRoomsSel );
|
|
||||||
this->AddChild( &m_rectRoomsSel );
|
this->AddChild( &m_rectRoomsSel );
|
||||||
|
|
||||||
NSMAN->ReportNSSOnOff(7);
|
NSMAN->ReportNSSOnOff(7);
|
||||||
|
|||||||
@@ -20,9 +20,6 @@
|
|||||||
#define CHATOUTPUT_COLOR THEME->GetMetricC(m_sName,"ChatOutputBoxColor")
|
#define CHATOUTPUT_COLOR THEME->GetMetricC(m_sName,"ChatOutputBoxColor")
|
||||||
#define SHOW_CHAT_LINES THEME->GetMetricI(m_sName,"ChatOutputLines")
|
#define SHOW_CHAT_LINES THEME->GetMetricI(m_sName,"ChatOutputLines")
|
||||||
|
|
||||||
#define USERSBG_WIDTH THEME->GetMetricF(m_sName,"UsersBGWidth")
|
|
||||||
#define USERSBG_HEIGHT THEME->GetMetricF(m_sName,"UsersBGHeight")
|
|
||||||
#define USERSBG_COLOR THEME->GetMetricC(m_sName,"UsersBGColor")
|
|
||||||
#define USERSALT_Y THEME->GetMetricF(m_sName,"UsersAY")
|
#define USERSALT_Y THEME->GetMetricF(m_sName,"UsersAY")
|
||||||
#define USERSDELT_X THEME->GetMetricF(m_sName,"UsersDX")
|
#define USERSDELT_X THEME->GetMetricF(m_sName,"UsersDX")
|
||||||
#define USERS_Y THEME->GetMetricF(m_sName,"UsersY")
|
#define USERS_Y THEME->GetMetricF(m_sName,"UsersY")
|
||||||
@@ -80,11 +77,8 @@ ScreenNetSelectBase::ScreenNetSelectBase( const CString& sName ) : ScreenWithMen
|
|||||||
|
|
||||||
//Users' Background
|
//Users' Background
|
||||||
|
|
||||||
m_rectUsersBG.SetDiffuse( USERSBG_COLOR );
|
|
||||||
m_rectUsersBG.SetName( "UsersBG" );
|
m_rectUsersBG.SetName( "UsersBG" );
|
||||||
m_rectUsersBG.SetWidth( USERSBG_WIDTH );
|
SET_QUAD_INIT( m_rectUsersBG );
|
||||||
m_rectUsersBG.SetHeight( USERSBG_HEIGHT );
|
|
||||||
SET_XY_AND_ON_COMMAND( m_rectUsersBG );
|
|
||||||
this->AddChild( &m_rectUsersBG );
|
this->AddChild( &m_rectUsersBG );
|
||||||
|
|
||||||
//Display users list
|
//Display users list
|
||||||
|
|||||||
@@ -18,33 +18,16 @@
|
|||||||
#include "StepsUtil.h"
|
#include "StepsUtil.h"
|
||||||
#include "RageUtil.h"
|
#include "RageUtil.h"
|
||||||
|
|
||||||
#define GROUPSBG_WIDTH THEME->GetMetricF(m_sName,"GroupsBGWidth")
|
|
||||||
#define GROUPSBG_HEIGHT THEME->GetMetricF(m_sName,"GroupsBGHeight")
|
|
||||||
#define GROUPSBG_COLOR THEME->GetMetricC(m_sName,"GroupsBGColor")
|
|
||||||
|
|
||||||
#define SONGSBG_WIDTH THEME->GetMetricF(m_sName,"SongsBGWidth")
|
|
||||||
#define SONGSBG_HEIGHT THEME->GetMetricF(m_sName,"SongsBGHeight")
|
|
||||||
#define SONGSBG_COLOR THEME->GetMetricC(m_sName,"SongsBGColor")
|
|
||||||
|
|
||||||
#define DIFFBG_WIDTH THEME->GetMetricF(m_sName,"DiffBGWidth")
|
|
||||||
#define DIFFBG_HEIGHT THEME->GetMetricF(m_sName,"DiffBGHeight")
|
|
||||||
#define DIFFBG_COLOR THEME->GetMetricC(m_sName,"DiffBGColor")
|
|
||||||
|
|
||||||
#define EXINFOBG_WIDTH THEME->GetMetricF(m_sName,"ExInfoBGWidth")
|
|
||||||
#define EXINFOBG_HEIGHT THEME->GetMetricF(m_sName,"ExInfoBGHeight")
|
|
||||||
#define EXINFOBG_COLOR THEME->GetMetricC(m_sName,"ExInfoBGColor")
|
|
||||||
|
|
||||||
#define NUM_GROUPS_SHOW THEME->GetMetricI(m_sName,"NumGroupsShow");
|
#define NUM_GROUPS_SHOW THEME->GetMetricI(m_sName,"NumGroupsShow");
|
||||||
#define NUM_SONGS_SHOW THEME->GetMetricI(m_sName,"NumSongsShow");
|
#define NUM_SONGS_SHOW THEME->GetMetricI(m_sName,"NumSongsShow");
|
||||||
|
|
||||||
#define SEL_WIDTH THEME->GetMetricF(m_sName,"SelWidth")
|
|
||||||
#define SEL_HEIGHT THEME->GetMetricF(m_sName,"SelHeight")
|
|
||||||
#define SEL_COLOR THEME->GetMetricC(m_sName,"SelColor")
|
|
||||||
|
|
||||||
#define SUBTITLE_WIDTH THEME->GetMetricF(m_sName,"SongsSubtitleWidth")
|
#define SUBTITLE_WIDTH THEME->GetMetricF(m_sName,"SongsSubtitleWidth")
|
||||||
#define ARTIST_WIDTH THEME->GetMetricF(m_sName,"SongsArtistWidth")
|
#define ARTIST_WIDTH THEME->GetMetricF(m_sName,"SongsArtistWidth")
|
||||||
#define GROUP_WIDTH THEME->GetMetricF(m_sName,"SongsGroupWidth")
|
#define GROUP_WIDTH THEME->GetMetricF(m_sName,"SongsGroupWidth")
|
||||||
|
|
||||||
|
#define GROUPSBG_WIDTH THEME->GetMetricF(m_sName,"GroupsBGWidth")
|
||||||
|
#define SONGSBG_WIDTH THEME->GetMetricF(m_sName,"SongsBGWidth")
|
||||||
|
|
||||||
const ScreenMessage SM_NoSongs = ScreenMessage(SM_User+3);
|
const ScreenMessage SM_NoSongs = ScreenMessage(SM_User+3);
|
||||||
const ScreenMessage SM_ChangeSong = ScreenMessage(SM_User+5);
|
const ScreenMessage SM_ChangeSong = ScreenMessage(SM_User+5);
|
||||||
const ScreenMessage SM_BackFromOpts = ScreenMessage(SM_User+6);
|
const ScreenMessage SM_BackFromOpts = ScreenMessage(SM_User+6);
|
||||||
@@ -58,11 +41,8 @@ ScreenNetSelectMusic::ScreenNetSelectMusic( const CString& sName ) : ScreenNetSe
|
|||||||
GAMESTATE->FinishStage();
|
GAMESTATE->FinishStage();
|
||||||
|
|
||||||
//Groups
|
//Groups
|
||||||
m_rectGroupsBackground.SetDiffuse( GROUPSBG_COLOR );
|
|
||||||
m_rectGroupsBackground.SetName( "GroupsBG" );
|
m_rectGroupsBackground.SetName( "GroupsBG" );
|
||||||
m_rectGroupsBackground.SetWidth( GROUPSBG_WIDTH );
|
SET_QUAD_INIT( m_rectGroupsBackground );
|
||||||
m_rectGroupsBackground.SetHeight( GROUPSBG_HEIGHT );
|
|
||||||
SET_XY_AND_ON_COMMAND( m_rectGroupsBackground );
|
|
||||||
this->AddChild( &m_rectGroupsBackground );
|
this->AddChild( &m_rectGroupsBackground );
|
||||||
|
|
||||||
m_textGroups.LoadFromFont( THEME->GetPathF(m_sName,"wheel") );
|
m_textGroups.LoadFromFont( THEME->GetPathF(m_sName,"wheel") );
|
||||||
@@ -73,11 +53,8 @@ ScreenNetSelectMusic::ScreenNetSelectMusic( const CString& sName ) : ScreenNetSe
|
|||||||
this->AddChild( &m_textGroups);
|
this->AddChild( &m_textGroups);
|
||||||
|
|
||||||
//Songs
|
//Songs
|
||||||
m_rectSongsBackground.SetDiffuse( SONGSBG_COLOR );
|
m_rectSongsBackground.SetName( "SongsBG" );
|
||||||
m_rectSongsBackground.SetName( "SongsBackground" );
|
SET_QUAD_INIT( m_rectSongsBackground );
|
||||||
m_rectSongsBackground.SetWidth( SONGSBG_WIDTH );
|
|
||||||
m_rectSongsBackground.SetHeight( SONGSBG_HEIGHT );
|
|
||||||
SET_XY_AND_ON_COMMAND( m_rectSongsBackground );
|
|
||||||
this->AddChild( &m_rectSongsBackground );
|
this->AddChild( &m_rectSongsBackground );
|
||||||
|
|
||||||
m_textSongs.LoadFromFont( THEME->GetPathF(m_sName,"wheel") );
|
m_textSongs.LoadFromFont( THEME->GetPathF(m_sName,"wheel") );
|
||||||
@@ -87,11 +64,8 @@ ScreenNetSelectMusic::ScreenNetSelectMusic( const CString& sName ) : ScreenNetSe
|
|||||||
SET_XY_AND_ON_COMMAND( m_textSongs );
|
SET_XY_AND_ON_COMMAND( m_textSongs );
|
||||||
this->AddChild( &m_textSongs);
|
this->AddChild( &m_textSongs);
|
||||||
|
|
||||||
m_rectExInfo.SetDiffuse( EXINFOBG_COLOR );
|
|
||||||
m_rectExInfo.SetName( "ExInfoBG" );
|
m_rectExInfo.SetName( "ExInfoBG" );
|
||||||
m_rectExInfo.SetWidth( EXINFOBG_WIDTH );
|
SET_QUAD_INIT( m_rectExInfo );
|
||||||
m_rectExInfo.SetHeight( EXINFOBG_HEIGHT );
|
|
||||||
SET_XY_AND_ON_COMMAND( m_rectExInfo );
|
|
||||||
this->AddChild( &m_rectExInfo );
|
this->AddChild( &m_rectExInfo );
|
||||||
|
|
||||||
m_textArtist.LoadFromFont( THEME->GetPathF(m_sName,"song") );
|
m_textArtist.LoadFromFont( THEME->GetPathF(m_sName,"song") );
|
||||||
@@ -122,11 +96,8 @@ ScreenNetSelectMusic::ScreenNetSelectMusic( const CString& sName ) : ScreenNetSe
|
|||||||
this->AddChild( &m_sprSelOptions );
|
this->AddChild( &m_sprSelOptions );
|
||||||
|
|
||||||
//Diff Icon background
|
//Diff Icon background
|
||||||
m_rectDiff.SetDiffuse( DIFFBG_COLOR );
|
|
||||||
m_rectDiff.SetName( "DiffBG" );
|
m_rectDiff.SetName( "DiffBG" );
|
||||||
m_rectDiff.SetWidth( DIFFBG_WIDTH );
|
SET_QUAD_INIT( m_rectDiff );
|
||||||
m_rectDiff.SetHeight( DIFFBG_HEIGHT );
|
|
||||||
SET_XY_AND_ON_COMMAND( m_rectDiff );
|
|
||||||
this->AddChild( &m_rectDiff );
|
this->AddChild( &m_rectDiff );
|
||||||
|
|
||||||
FOREACH_EnabledPlayer (p)
|
FOREACH_EnabledPlayer (p)
|
||||||
@@ -148,11 +119,8 @@ ScreenNetSelectMusic::ScreenNetSelectMusic( const CString& sName ) : ScreenNetSe
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_SelectMode = SelectGroup;
|
m_SelectMode = SelectGroup;
|
||||||
m_rectSelection.SetDiffuse( SEL_COLOR );
|
|
||||||
m_rectSelection.SetName( "Sel" );
|
m_rectSelection.SetName( "Sel" );
|
||||||
m_rectSelection.SetWidth( SEL_WIDTH );
|
SET_QUAD_INIT( m_rectSelection );
|
||||||
m_rectSelection.SetHeight( SEL_HEIGHT );
|
|
||||||
SET_XY_AND_ON_COMMAND( m_rectSelection );
|
|
||||||
this->AddChild( &m_rectSelection );
|
this->AddChild( &m_rectSelection );
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user