Working on course editor.

This commit is contained in:
Steve Checkoway
2006-02-20 06:18:57 +00:00
parent c3246da6b7
commit d691fe9919
3 changed files with 37 additions and 20 deletions
+3 -2
View File
@@ -4541,12 +4541,12 @@ WrapValueInRow=0
NavigationMode=menu NavigationMode=menu
ForceAllPlayers=1 ForceAllPlayers=1
InputMode=together InputMode=together
TitleX=SCREEN_CENTER_X-180 TitleX=SCREEN_LEFT+32
TitleOnCommand=zoom,0.5;horizalign,left;ShadowLength,0 TitleOnCommand=zoom,0.5;horizalign,left;ShadowLength,0
TitleGainFocusCommand=diffuseshift;EffectColor1,1.3,1.3,1.3,1;EffectColor2,0.3,0.3,0.3,1 TitleGainFocusCommand=diffuseshift;EffectColor1,1.3,1.3,1.3,1;EffectColor2,0.3,0.3,0.3,1
TitleLoseFocusCommand=stopeffect TitleLoseFocusCommand=stopeffect
HelpText= HelpText=
BulletOnCommand=hidden,1
[ScreenOptionsManageEditSteps] [ScreenOptionsManageEditSteps]
Class=ScreenOptionsManageEditSteps Class=ScreenOptionsManageEditSteps
@@ -4580,6 +4580,7 @@ NavigationMode=menu
ForceAllPlayers=1 ForceAllPlayers=1
InputMode=together InputMode=together
HelpText= HelpText=
ShowUnderlines=0
[ScreenOptionsEditCourseEntry] [ScreenOptionsEditCourseEntry]
Class=ScreenOptionsEditCourseEntry Class=ScreenOptionsEditCourseEntry
+26 -10
View File
@@ -89,6 +89,7 @@ void ScreenOptionsEditCourse::BeginScreen()
pHand->m_Def.m_sName = ssprintf( ENTRY.GetValue(), iEntryIndex+1 ); pHand->m_Def.m_sName = ssprintf( ENTRY.GetValue(), iEntryIndex+1 );
pHand->m_Def.m_bAllowThemeItems = false; pHand->m_Def.m_bAllowThemeItems = false;
pHand->m_Def.m_bAllowThemeTitle = false; pHand->m_Def.m_bAllowThemeTitle = false;
pHand->m_Def.m_vsChoices.push_back( "RANDOM" ); // XXX Localize?
FOREACH_CONST( Song*, m_vpDisplayedSongs, s ) FOREACH_CONST( Song*, m_vpDisplayedSongs, s )
pHand->m_Def.m_vsChoices.push_back( (*s)->GetTranslitFullTitle() ); pHand->m_Def.m_vsChoices.push_back( (*s)->GetTranslitFullTitle() );
vHands.push_back( pHand ); vHands.push_back( pHand );
@@ -98,7 +99,6 @@ void ScreenOptionsEditCourse::BeginScreen()
pHand->m_Def.m_sName = ""; pHand->m_Def.m_sName = "";
pHand->m_Def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW; pHand->m_Def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
pHand->m_Def.m_bExportOnChange = true; pHand->m_Def.m_bExportOnChange = true;
pHand->m_Def.m_vsChoices.clear();
pHand->m_Def.m_vsChoices.push_back( "Insert Entry" ); pHand->m_Def.m_vsChoices.push_back( "Insert Entry" );
vHands.push_back( pHand ); vHands.push_back( pHand );
@@ -107,7 +107,7 @@ void ScreenOptionsEditCourse::BeginScreen()
ScreenOptions::BeginScreen(); ScreenOptions::BeginScreen();
if( GAMESTATE->m_iEditCourseEntryIndex > -1 ) if( GAMESTATE->m_iEditCourseEntryIndex > -1 )
this->MoveRowAbsolute( PLAYER_1, NUM_EditCourseRow + GAMESTATE->m_iEditCourseEntryIndex ); this->MoveRowAbsolute( GAMESTATE->m_MasterPlayerNumber, NUM_EditCourseRow + GAMESTATE->m_iEditCourseEntryIndex );
AfterChangeRow( GAMESTATE->m_MasterPlayerNumber ); AfterChangeRow( GAMESTATE->m_MasterPlayerNumber );
} }
@@ -196,12 +196,12 @@ void ScreenOptionsEditCourse::AfterChangeValueInRow( int iRow, PlayerNumber pn )
Course *pCourse = GAMESTATE->m_pCurCourse; Course *pCourse = GAMESTATE->m_pCurCourse;
// Regenerate Trails so that the new values propagate // Regenerate Trails so that the new values propagate
GAMESTATE->m_pCurTrail[PLAYER_1].Set( NULL ); GAMESTATE->m_pCurTrail[GAMESTATE->m_MasterPlayerNumber].Set( NULL );
Trail *pTrail = pCourse->GetTrailForceRegenCache( GAMESTATE->m_stEdit, GAMESTATE->m_cdEdit ); Trail *pTrail = pCourse->GetTrailForceRegenCache( GAMESTATE->m_stEdit, GAMESTATE->m_cdEdit );
// cause overlay elements to refresh by changing the course // cause overlay elements to refresh by changing the course
GAMESTATE->m_pCurCourse.Set( pCourse ); GAMESTATE->m_pCurCourse.Set( pCourse );
GAMESTATE->m_pCurTrail[PLAYER_1].Set( pTrail ); GAMESTATE->m_pCurTrail[GAMESTATE->m_MasterPlayerNumber].Set( pTrail );
} }
void ScreenOptionsEditCourse::ImportOptions( int iRow, const vector<PlayerNumber> &vpns ) void ScreenOptionsEditCourse::ImportOptions( int iRow, const vector<PlayerNumber> &vpns )
@@ -213,17 +213,33 @@ void ScreenOptionsEditCourse::ImportOptions( int iRow, const vector<PlayerNumber
{ {
case EditCourseRow_Type: case EditCourseRow_Type:
row.SetOneSharedSelection( pCourse->GetCourseType() ); row.SetOneSharedSelection( pCourse->GetCourseType() );
break; return;
case EditCourseRow_Meter: case EditCourseRow_Meter:
{ {
int iMeter = pCourse->m_iCustomMeter[DIFFICULTY_MEDIUM]; int iMeter = pCourse->m_iCustomMeter[GAMESTATE->m_cdEdit];
if( iMeter == -1 ) if( iMeter == -1 )
row.SetOneSharedSelection( 0 ); row.SetOneSharedSelection( 0 );
else else
row.SetOneSharedSelection( iMeter + 1 - MIN_METER ); row.SetOneSharedSelection( iMeter + 1 - MIN_METER );
break; return;
} }
} }
const CourseEntry& ce = pCourse->m_vEntries[iRow - NUM_EditCourseRow];
if( ce.IsRandomSong() )
{
row.SetOneSharedSelection( 0 );
}
else
{
vector<Song *>::const_iterator iter = find( m_vpDisplayedSongs.begin(), m_vpDisplayedSongs.end(), ce.pSong );
if( iter == m_vpDisplayedSongs.end() )
row.SetOneSharedSelection( 0 );
else
row.SetOneSharedSelection( iter - m_vpDisplayedSongs.begin() + 1 );
}
} }
void ScreenOptionsEditCourse::ExportOptions( int iRow, const vector<PlayerNumber> &vpns ) void ScreenOptionsEditCourse::ExportOptions( int iRow, const vector<PlayerNumber> &vpns )
@@ -243,9 +259,9 @@ void ScreenOptionsEditCourse::ExportOptions( int iRow, const vector<PlayerNumber
{ {
int iSel = row.GetOneSharedSelection(); int iSel = row.GetOneSharedSelection();
if( iSel == 0 ) // "auto" if( iSel == 0 ) // "auto"
pCourse->m_iCustomMeter[DIFFICULTY_MEDIUM] = -1; pCourse->m_iCustomMeter[GAMESTATE->m_cdEdit] = -1;
else else
pCourse->m_iCustomMeter[DIFFICULTY_MEDIUM] = iSel - 1 + MIN_METER; pCourse->m_iCustomMeter[GAMESTATE->m_cdEdit] = iSel - 1 + MIN_METER;
break; break;
} }
} }
@@ -289,7 +305,7 @@ void ScreenOptionsEditCourse::ProcessMenuStart( const InputEventPlus &input )
} }
int iWidth, iX, iY; int iWidth, iX, iY;
this->GetWidthXY( PLAYER_1, iCurRow, 0, iWidth, iX, iY ); this->GetWidthXY( GAMESTATE->m_MasterPlayerNumber, iCurRow, 0, iWidth, iX, iY );
ScreenMiniMenu::MiniMenu( &g_TempMenu, SM_BackFromContextMenu, SM_BackFromContextMenu, (float)iX, (float)iY ); ScreenMiniMenu::MiniMenu( &g_TempMenu, SM_BackFromContextMenu, SM_BackFromContextMenu, (float)iX, (float)iY );
} }
+8 -8
View File
@@ -21,7 +21,7 @@ static void RefreshTrail()
return; return;
GAMESTATE->m_pCurCourse.Set( pCourse ); GAMESTATE->m_pCurCourse.Set( pCourse );
Trail *pTrail = pCourse->GetTrail( GAMESTATE->m_stEdit, GAMESTATE->m_cdEdit ); Trail *pTrail = pCourse->GetTrail( GAMESTATE->m_stEdit, GAMESTATE->m_cdEdit );
GAMESTATE->m_pCurTrail[PLAYER_1].Set( pTrail ); GAMESTATE->m_pCurTrail[GAMESTATE->m_MasterPlayerNumber].Set( pTrail );
} }
struct StepsTypeAndDifficulty struct StepsTypeAndDifficulty
@@ -188,11 +188,11 @@ void ScreenOptionsManageCourses::BeginScreen()
if( (*c)->IsAnEdit() ) if( (*c)->IsAnEdit() )
def.m_sName = "Edit"; def.m_sName = "Edit";
else else
def.m_sName = (*c)->m_sGroupName; def.m_sName = SONGMAN->ShortenGroupName( (*c)->m_sGroupName );
break; break;
} }
def.m_sName = ssprintf("%d",iIndex) + " " + def.m_sName; def.m_sName = ssprintf( "%3d %s", iIndex, def.m_sName.c_str() );
def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW; def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
def.m_bAllowThemeItems = false; def.m_bAllowThemeItems = false;
def.m_bAllowThemeTitle = false; def.m_bAllowThemeTitle = false;
@@ -212,11 +212,11 @@ void ScreenOptionsManageCourses::BeginScreen()
if( iter != m_vpCourses.end() ) if( iter != m_vpCourses.end() )
{ {
int iIndex = iter - m_vpCourses.begin(); int iIndex = iter - m_vpCourses.begin();
this->MoveRowAbsolute( PLAYER_1, 1 + iIndex ); this->MoveRowAbsolute( GAMESTATE->m_MasterPlayerNumber, 1 + iIndex );
} }
} }
AfterChangeRow( PLAYER_1 ); AfterChangeRow( GAMESTATE->m_MasterPlayerNumber );
} }
static LocalizedString COURSE_WILL_BE_LOST ("ScreenOptionsManageCourses", "This course will be lost permanently."); static LocalizedString COURSE_WILL_BE_LOST ("ScreenOptionsManageCourses", "This course will be lost permanently.");
@@ -289,7 +289,7 @@ void ScreenOptionsManageCourses::HandleScreenMessage( const ScreenMessage SM )
Course *pCourse = GetCourseWithFocus(); Course *pCourse = GetCourseWithFocus();
Trail *pTrail = pCourse->GetTrail( STEPS_TYPE_DANCE_SINGLE ); Trail *pTrail = pCourse->GetTrail( STEPS_TYPE_DANCE_SINGLE );
GAMESTATE->m_pCurCourse.Set( pCourse ); GAMESTATE->m_pCurCourse.Set( pCourse );
GAMESTATE->m_pCurTrail[PLAYER_1].Set( pTrail ); GAMESTATE->m_pCurTrail[GAMESTATE->m_MasterPlayerNumber].Set( pTrail );
ScreenOptions::BeginFadingOut(); ScreenOptions::BeginFadingOut();
break; break;
@@ -325,7 +325,7 @@ void ScreenOptionsManageCourses::AfterChangeRow( PlayerNumber pn )
Trail *pTrail = pCourse ? pCourse->GetTrail( STEPS_TYPE_DANCE_SINGLE ) : NULL; Trail *pTrail = pCourse ? pCourse->GetTrail( STEPS_TYPE_DANCE_SINGLE ) : NULL;
GAMESTATE->m_pCurCourse.Set( pCourse ); GAMESTATE->m_pCurCourse.Set( pCourse );
GAMESTATE->m_pCurTrail[PLAYER_1].Set( pTrail ); GAMESTATE->m_pCurTrail[GAMESTATE->m_MasterPlayerNumber].Set( pTrail );
ScreenOptions::AfterChangeRow( pn ); ScreenOptions::AfterChangeRow( pn );
} }
@@ -379,7 +379,7 @@ void ScreenOptionsManageCourses::ProcessMenuStart( const InputEventPlus &input )
} }
int iWidth, iX, iY; int iWidth, iX, iY;
this->GetWidthXY( PLAYER_1, iCurRow, 0, iWidth, iX, iY ); this->GetWidthXY( GAMESTATE->m_MasterPlayerNumber, iCurRow, 0, iWidth, iX, iY );
ScreenMiniMenu::MiniMenu( &g_TempMenu, SM_BackFromContextMenu, SM_BackFromContextMenu, (float)iX, (float)iY ); ScreenMiniMenu::MiniMenu( &g_TempMenu, SM_BackFromContextMenu, SM_BackFromContextMenu, (float)iX, (float)iY );
} }
} }