From 55b44767b419e83aef1fbf16de1a403ceaf3319a Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Mon, 31 Jan 2005 02:32:08 +0000 Subject: [PATCH] require "[Screen] Class=foo" so that derived classes can inhereit "Class=" and not have to redefine it --- stepmania/Themes/default/metrics.ini | 24 ++++++++++++++++++++++++ stepmania/src/ScreenManager.cpp | 5 +---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index 8cca0bc61d..da8886b6e5 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -189,6 +189,7 @@ BounceJoinMessage=1 FoldOnJoin=1 [ScreenSelectStyle] +Class=ScreenSelectStyle Fallback=ScreenWithMenuElements ChoiceNames=1,2,3,4,5 # The "name" here affects the announcer, eg. "ScreenSelectStyle comment single". @@ -309,6 +310,7 @@ TimerSeconds=0 TimerStealth=0 [ScreenSelectDifficulty] +Class=ScreenSelectDifficulty Fallback=ScreenWithMenuElements ChoiceNames=1,2,3,4,5,6,7,8 Choice1=PlayMode,regular;Difficulty,beginner;name,beginner @@ -436,6 +438,7 @@ OKOffCommand=sleep,0.2;linear,0.3;zoom,0 DisabledColor=0.2,0.2,0.2,1 [ScreenSelectGroup] +Class=ScreenSelectGroup NextScreen=ScreenInstructions PrevScreen=ScreenTitleBranch Fallback=ScreenWithMenuElements @@ -499,6 +502,7 @@ CropWidth=146 InitCommand=horizalign,left;vertalign,top;shadowlength,2;zoom,0.5; [ScreenInstructions] +Class=ScreenInstructions Fallback=ScreenWithMenuElements NextScreen=ScreenSelectCharacter PrevScreen=ScreenTitleBranch @@ -507,6 +511,7 @@ StyleIcon=1 MemoryCardIcons=1 [ScreenSelectMusic] +Class=ScreenSelectMusic Fallback=ScreenWithMenuElements NonPresenceP1X=-128 NonPresenceP1Y=SCREEN_CENTER_Y+0 @@ -983,6 +988,7 @@ StyleIcon=0 MemoryCardIcons=0 [ScreenStage] +Class=ScreenStage NextScreen=@SelectGameplayScreen() PrevScreen=@SongSelectionScreen() // This is the minimum delay after the "in" transition before the @@ -1016,6 +1022,7 @@ OverlayOnCommand= OverlayOffCommand= [ScreenGameplay] +Class=ScreenGameplay ShowEvaluationOnFail=0 StaticBGY=SCREEN_CENTER_Y+0 StaticBGX=SCREEN_CENTER_X+0 @@ -2226,7 +2233,9 @@ TextZoom=0.8 NextScreen=ScreenRanking [ScreenEditMenu] +Class=ScreenEditMenu Fallback=ScreenWithMenuElements +PrevScreen=ScreenTitleBranch ExplanationX=SCREEN_CENTER_X+0 ExplanationY=SCREEN_CENTER_Y+170 ExplanationOnCommand=wrapwidthpixels,900;zoom,0.7 @@ -2251,6 +2260,7 @@ Line3=Difficulties Line4=list,RandomModifiers [ScreenEditCoursesMenu] +Class=ScreenEditCoursesMenu Fallback=ScreenWithMenuElements NextScreen=ScreenTitleBranch ExplanationX=SCREEN_CENTER_X+0 @@ -2499,6 +2509,7 @@ MoreExitUnselectedP1Command= MoreExitUnselectedP2Command= [ScreenMapControllers] +Class=ScreenMapControllers Fallback=ScreenOperatorMenu EvenLineIn=addx,-SCREEN_WIDTH;decelerate,0.5;addx,SCREEN_WIDTH; OddLineIn=addx,SCREEN_WIDTH;decelerate,0.5;addx,-SCREEN_WIDTH; @@ -2506,18 +2517,23 @@ EvenLineOut=stoptweening;accelerate,0.3;addx,-SCREEN_WIDTH; OddLineOut=stoptweening;accelerate,0.3;addx,SCREEN_WIDTH; [ScreenCenterImage] +Class=ScreenCenterImage Fallback=ScreenOperatorMenu [ScreenTestInput] +Class=ScreenTestInput Fallback=ScreenOperatorMenu [ScreenTestLights] +Class=ScreenTestLights Fallback=ScreenOperatorMenu [ScreenNetworkOptions] +Class=ScreenNetworkOptions Fallback=ScreenOperatorMenu [ScreenBookkeeping] +Class=ScreenBookkeeping Fallback=ScreenOperatorMenu [ScreenPackages] @@ -3023,6 +3039,7 @@ Line2=conf,AttractSoundFrequency Line3=conf,SoundVolume [ScreenProfileOptions] +Class=ScreenProfileOptions Fallback=ScreenOperatorMenu Player1Profile= Player2Profile= @@ -3253,6 +3270,7 @@ Fallback=ScreenAttract NextScreen=ScreenLogo [ScreenLogo] +Class=ScreenLogo Fallback=ScreenAttract //Not used in default theme, but without, will cause warning LogoY=0 @@ -3293,6 +3311,7 @@ DifficultiesToShow=easy,medium ShowCourseModifiers=0 [ScreenNameEntry] +Class=ScreenNameEntry TimerX=SCREEN_CENTER_X+0 TimerY=SCREEN_CENTER_Y-210 CategoryY=SCREEN_CENTER_Y+190 @@ -3491,6 +3510,7 @@ NextScreen2=screen,ScreenNetSelectMusic NextScreen3=screen,ScreenSelectMusic [ScreenPlayerOptions] +Class=ScreenPlayerOptions Fallback=ScreenOptions PrevScreen=@SongSelectionScreen() NextScreen=ScreenSongOptions @@ -3542,6 +3562,7 @@ Line4=list,Persp Line5=Steps [ScreenSongOptions] +Class=ScreenSongOptions Fallback=ScreenOptions PrevScreen=@SelectFirstOptionsScreen() NextScreen=ScreenStage @@ -3587,6 +3608,7 @@ Class=ScreenAttract NextScreen=ScreenCompany [ScreenSelectCharacter] +Class=ScreenSelectCharacter Fallback=ScreenWithMenuElements TitleP1OnCommand=x,140;y,80;addx,-SCREEN_WIDTH*0.6;bounceend,0.5;addx,SCREEN_WIDTH*0.6 TitleP1OffCommand=sleep,0.2;bouncebegin,0.5;addx,-SCREEN_WIDTH*0.6 @@ -3878,6 +3900,7 @@ RandomModifiers,1=name,Off RandomModifiers,2=mod,random;name,Random [ScreenReloadSongs] +Class=ScreenReloadSongs NextScreen=ScreenTitleBranch [DancingCharacters] @@ -3948,6 +3971,7 @@ Fallback=DifficultyMeter Fallback=DifficultyMeter [ScreenEdit] +Class=ScreenEdit OverlayX=0 OverlayY=0 OverlayOnCommand= diff --git a/stepmania/src/ScreenManager.cpp b/stepmania/src/ScreenManager.cpp index 964cece300..9e750a78b6 100644 --- a/stepmania/src/ScreenManager.cpp +++ b/stepmania/src/ScreenManager.cpp @@ -232,10 +232,7 @@ Screen* ScreenManager::MakeNewScreen( const CString &sScreenName ) RageTimer t; LOG->Trace( "Loading screen name '%s'", sScreenName.c_str() ); - CString sClassName = sScreenName; - // Look up the class in the metrics group sName - if( THEME->HasMetric(sClassName,"Class") ) - sClassName = THEME->GetMetric(sClassName,"Class"); + CString sClassName = THEME->GetMetric(sScreenName,"Class"); map::iterator iter = g_pmapRegistrees->find( sClassName ); ASSERT_M( iter != g_pmapRegistrees->end(), ssprintf("Screen '%s' has an invalid class '%s'",sScreenName.c_str(),sClassName.c_str()) )