working on new course edit screens
This commit is contained in:
@@ -73,10 +73,7 @@ CString CourseEntry::GetTextDescription() const
|
|||||||
vsEntryDescription.push_back( "Sort: %d" + SongSortToThemedString(songSort) );
|
vsEntryDescription.push_back( "Sort: %d" + SongSortToThemedString(songSort) );
|
||||||
if( songSort != SongSort_Randomize && iChooseIndex != 0 )
|
if( songSort != SongSort_Randomize && iChooseIndex != 0 )
|
||||||
vsEntryDescription.push_back( "Choose " + FormatNumberAndSuffix(iChooseIndex) + " match" );
|
vsEntryDescription.push_back( "Choose " + FormatNumberAndSuffix(iChooseIndex) + " match" );
|
||||||
int iNumModChanges = 0;
|
int iNumModChanges = GetNumModChanges();
|
||||||
if( !sModifiers.empty() )
|
|
||||||
iNumModChanges++;
|
|
||||||
iNumModChanges += attacks.size();
|
|
||||||
if( iNumModChanges != 0 )
|
if( iNumModChanges != 0 )
|
||||||
vsEntryDescription.push_back( ssprintf("%d mod changes", iNumModChanges) );
|
vsEntryDescription.push_back( ssprintf("%d mod changes", iNumModChanges) );
|
||||||
if( fGainSeconds != 0 )
|
if( fGainSeconds != 0 )
|
||||||
@@ -86,6 +83,15 @@ CString CourseEntry::GetTextDescription() const
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int CourseEntry::GetNumModChanges() const
|
||||||
|
{
|
||||||
|
int iNumModChanges = 0;
|
||||||
|
if( !sModifiers.empty() )
|
||||||
|
iNumModChanges++;
|
||||||
|
iNumModChanges += attacks.size();
|
||||||
|
return iNumModChanges;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Course::Course()
|
Course::Course()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
CString GetTextDescription() const;
|
CString GetTextDescription() const;
|
||||||
|
int GetNumModChanges() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Course
|
class Course
|
||||||
|
|||||||
@@ -2039,6 +2039,8 @@ public:
|
|||||||
}
|
}
|
||||||
static int GetCurrentGame( T* p, lua_State *L ) { const_cast<Game*>(p->GetCurrentGame())->PushSelf( L ); return 1; }
|
static int GetCurrentGame( T* p, lua_State *L ) { const_cast<Game*>(p->GetCurrentGame())->PushSelf( L ); return 1; }
|
||||||
static int GetLastSelectedProfileID( T* p, lua_State *L ) { lua_pushstring(L, p->m_sLastSelectedProfileID ); return 1; }
|
static int GetLastSelectedProfileID( T* p, lua_State *L ) { lua_pushstring(L, p->m_sLastSelectedProfileID ); return 1; }
|
||||||
|
static int GetEditCourseEntryIndex( T* p, lua_State *L ) { lua_pushnumber(L, p->m_iEditCourseEntryIndex ); return 1; }
|
||||||
|
|
||||||
static void Register(lua_State *L)
|
static void Register(lua_State *L)
|
||||||
{
|
{
|
||||||
ADD_METHOD( IsPlayerEnabled )
|
ADD_METHOD( IsPlayerEnabled )
|
||||||
@@ -2092,6 +2094,7 @@ public:
|
|||||||
ADD_METHOD( IsWinner )
|
ADD_METHOD( IsWinner )
|
||||||
ADD_METHOD( GetCurrentGame )
|
ADD_METHOD( GetCurrentGame )
|
||||||
ADD_METHOD( GetLastSelectedProfileID )
|
ADD_METHOD( GetLastSelectedProfileID )
|
||||||
|
ADD_METHOD( GetEditCourseEntryIndex )
|
||||||
|
|
||||||
Luna<T>::Register( L );
|
Luna<T>::Register( L );
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ ScreenCenterImage.cpp ScreenCenterImage.h ScreenCredits.cpp ScreenCredits.h \
|
|||||||
ScreenDebugOverlay.cpp ScreenDebugOverlay.h \
|
ScreenDebugOverlay.cpp ScreenDebugOverlay.h \
|
||||||
ScreenDemonstration.cpp ScreenDemonstration.h ScreenDimensions.h \
|
ScreenDemonstration.cpp ScreenDemonstration.h ScreenDimensions.h \
|
||||||
ScreenEdit.cpp ScreenEdit.h \
|
ScreenEdit.cpp ScreenEdit.h \
|
||||||
|
ScreenEditCourseMods.cpp ScreenEditCourseMods.h \
|
||||||
ScreenEditMenu.cpp ScreenEditMenu.h ScreenEnding.cpp ScreenEnding.h \
|
ScreenEditMenu.cpp ScreenEditMenu.h ScreenEnding.cpp ScreenEnding.h \
|
||||||
ScreenEvaluation.cpp ScreenEvaluation.h ScreenExit.cpp ScreenExit.h ScreenNetEvaluation.cpp ScreenNetEvaluation.h \
|
ScreenEvaluation.cpp ScreenEvaluation.h ScreenExit.cpp ScreenExit.h ScreenNetEvaluation.cpp ScreenNetEvaluation.h \
|
||||||
ScreenNetSelectMusic.cpp ScreenNetSelectMusic.h ScreenNetSelectBase.cpp ScreenNetSelectBase.h ScreenNetRoom.cpp ScreenNetRoom.h \
|
ScreenNetSelectMusic.cpp ScreenNetSelectMusic.h ScreenNetSelectBase.cpp ScreenNetSelectBase.h ScreenNetRoom.cpp ScreenNetRoom.h \
|
||||||
|
|||||||
@@ -586,7 +586,6 @@ void ScreenEdit::Init()
|
|||||||
|
|
||||||
m_pSong = GAMESTATE->m_pCurSong;
|
m_pSong = GAMESTATE->m_pCurSong;
|
||||||
m_pSteps = GAMESTATE->m_pCurSteps[PLAYER_1];
|
m_pSteps = GAMESTATE->m_pCurSteps[PLAYER_1];
|
||||||
m_pAttacksFromCourse = NULL;
|
|
||||||
m_bReturnToRecordMenuAfterPlay = false;
|
m_bReturnToRecordMenuAfterPlay = false;
|
||||||
m_fBeatToReturnTo = 0;
|
m_fBeatToReturnTo = 0;
|
||||||
|
|
||||||
@@ -1571,7 +1570,7 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
|
|||||||
if( bUsesThisSong )
|
if( bUsesThisSong )
|
||||||
{
|
{
|
||||||
g_CourseMode.rows[0].choices.push_back( crs->GetDisplayFullTitle() );
|
g_CourseMode.rows[0].choices.push_back( crs->GetDisplayFullTitle() );
|
||||||
if( crs == m_pAttacksFromCourse )
|
if( crs == GAMESTATE->m_pCurCourse )
|
||||||
g_CourseMode.rows[0].iDefaultChoice = g_CourseMode.rows[0].choices.size()-1;
|
g_CourseMode.rows[0].iDefaultChoice = g_CourseMode.rows[0].choices.size()-1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2154,12 +2153,13 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
else if( SM == SM_BackFromCourseModeMenu )
|
else if( SM == SM_BackFromCourseModeMenu )
|
||||||
{
|
{
|
||||||
const int num = ScreenMiniMenu::s_viLastAnswers[0];
|
const int num = ScreenMiniMenu::s_viLastAnswers[0];
|
||||||
m_pAttacksFromCourse = NULL;
|
GAMESTATE->m_pCurCourse.Set( NULL );
|
||||||
if( num != 0 )
|
if( num != 0 )
|
||||||
{
|
{
|
||||||
const CString name = g_CourseMode.rows[0].choices[num];
|
const CString name = g_CourseMode.rows[0].choices[num];
|
||||||
m_pAttacksFromCourse = SONGMAN->FindCourse( name );
|
Course *pCourse = SONGMAN->FindCourse( name );
|
||||||
ASSERT( m_pAttacksFromCourse );
|
GAMESTATE->m_pCurCourse.Set( pCourse );
|
||||||
|
ASSERT( GAMESTATE->m_pCurCourse );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( SM == SM_BackFromOptions )
|
else if( SM == SM_BackFromOptions )
|
||||||
@@ -3036,17 +3036,17 @@ void ScreenEdit::SetupCourseAttacks()
|
|||||||
GAMESTATE->RemoveActiveAttacksForPlayer( PLAYER_1 );
|
GAMESTATE->RemoveActiveAttacksForPlayer( PLAYER_1 );
|
||||||
|
|
||||||
|
|
||||||
if( m_pAttacksFromCourse )
|
if( GAMESTATE->m_pCurCourse )
|
||||||
{
|
{
|
||||||
m_pAttacksFromCourse->LoadFromCRSFile( m_pAttacksFromCourse->m_sPath );
|
GAMESTATE->m_pCurCourse->LoadFromCRSFile( GAMESTATE->m_pCurCourse->m_sPath );
|
||||||
|
|
||||||
AttackArray Attacks;
|
AttackArray Attacks;
|
||||||
for( unsigned e = 0; e < m_pAttacksFromCourse->m_vEntries.size(); ++e )
|
for( unsigned e = 0; e < GAMESTATE->m_pCurCourse->m_vEntries.size(); ++e )
|
||||||
{
|
{
|
||||||
if( m_pAttacksFromCourse->m_vEntries[e].pSong != m_pSong )
|
if( GAMESTATE->m_pCurCourse->m_vEntries[e].pSong != m_pSong )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Attacks = m_pAttacksFromCourse->m_vEntries[e].attacks;
|
Attacks = GAMESTATE->m_pCurCourse->m_vEntries[e].attacks;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -240,7 +240,6 @@ protected:
|
|||||||
Player m_Player;
|
Player m_Player;
|
||||||
Background m_Background;
|
Background m_Background;
|
||||||
Foreground m_Foreground;
|
Foreground m_Foreground;
|
||||||
Course *m_pAttacksFromCourse;
|
|
||||||
bool m_bReturnToRecordMenuAfterPlay;
|
bool m_bReturnToRecordMenuAfterPlay;
|
||||||
|
|
||||||
// for MODE_RECORD and MODE_PLAY
|
// for MODE_RECORD and MODE_PLAY
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
#include "global.h"
|
||||||
|
#include "ScreenEditCourseMods.h"
|
||||||
|
#include "RageLog.h"
|
||||||
|
|
||||||
|
REGISTER_SCREEN_CLASS( ScreenEditCourseMods );
|
||||||
|
ScreenEditCourseMods::ScreenEditCourseMods( CString sName ) : ScreenEdit( sName )
|
||||||
|
{
|
||||||
|
LOG->Trace( "ScreenEditCourseMods::ScreenEditCourseMods()" );
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScreenEditCourseMods::Init()
|
||||||
|
{
|
||||||
|
ScreenEdit::Init();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (c) 2002-2005 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.
|
||||||
|
*/
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
#ifndef ScreenEditCourseMods_H
|
||||||
|
#define ScreenEditCourseMods_H
|
||||||
|
|
||||||
|
#include "ScreenEdit.h"
|
||||||
|
|
||||||
|
class ScreenEditCourseMods : public ScreenEdit
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ScreenEditCourseMods( CString sName );
|
||||||
|
|
||||||
|
void Init();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (c) 2003-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.
|
||||||
|
*/
|
||||||
@@ -894,7 +894,7 @@ void ScreenOptions::ProcessMenuStart( PlayerNumber pn, const InputEventType type
|
|||||||
if( row.GetFirstItemGoesDown() )
|
if( row.GetFirstItemGoesDown() )
|
||||||
{
|
{
|
||||||
// move to the first choice in the row
|
// move to the first choice in the row
|
||||||
ChangeValueInRow( pn, -row.GetChoiceInRowWithFocus(pn), type != IET_FIRST_PRESS );
|
ChangeValueInRowRelative( m_iCurrentRow[pn], pn, -row.GetChoiceInRowWithFocus(pn), type != IET_FIRST_PRESS );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // data.selectType != SELECT_MULTIPLE
|
else // data.selectType != SELECT_MULTIPLE
|
||||||
@@ -918,9 +918,9 @@ void ScreenOptions::ProcessMenuStart( PlayerNumber pn, const InputEventType type
|
|||||||
row.SetOneSelection( pn, iChoiceInRow );
|
row.SetOneSelection( pn, iChoiceInRow );
|
||||||
}
|
}
|
||||||
if( row.GetFirstItemGoesDown() )
|
if( row.GetFirstItemGoesDown() )
|
||||||
ChangeValueInRow( pn, -row.GetChoiceInRowWithFocus(pn), type != IET_FIRST_PRESS ); // move to the first choice
|
ChangeValueInRowRelative( m_iCurrentRow[pn], pn, -row.GetChoiceInRowWithFocus(pn), type != IET_FIRST_PRESS ); // move to the first choice
|
||||||
else
|
else
|
||||||
ChangeValueInRow( pn, 0, type != IET_FIRST_PRESS );
|
ChangeValueInRowRelative( m_iCurrentRow[pn], pn, 0, type != IET_FIRST_PRESS );
|
||||||
break;
|
break;
|
||||||
case NAV_THREE_KEY_MENU:
|
case NAV_THREE_KEY_MENU:
|
||||||
/* Don't accept START to go to the next screen if we're still transitioning in. */
|
/* Don't accept START to go to the next screen if we're still transitioning in. */
|
||||||
@@ -951,13 +951,28 @@ void ScreenOptions::StoreFocus( PlayerNumber pn )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Left/right */
|
/* Left/right */
|
||||||
void ScreenOptions::ChangeValueInRow( PlayerNumber pn, int iDelta, bool Repeat )
|
void ScreenOptions::ChangeValueInRowAbsolute( int iRow, PlayerNumber pn, int iChoiceIndex, bool bRepeat )
|
||||||
{
|
{
|
||||||
const int iCurRow = m_iCurrentRow[pn];
|
if( iRow == -1 ) // no row selected
|
||||||
if( iCurRow == -1 ) // no row selected
|
|
||||||
return; // don't allow a move
|
return; // don't allow a move
|
||||||
|
|
||||||
OptionRow &row = *m_pRows[iCurRow];
|
OptionRow &row = *m_pRows[iRow];
|
||||||
|
|
||||||
|
const int iNumChoices = row.GetRowDef().m_vsChoices.size();
|
||||||
|
ASSERT( iNumChoices >= 0 && iChoiceIndex < iNumChoices );
|
||||||
|
|
||||||
|
int iCurrentChoiceWithFocus = row.GetChoiceInRowWithFocus(pn);
|
||||||
|
int iDelta = iChoiceIndex - iCurrentChoiceWithFocus;
|
||||||
|
|
||||||
|
ChangeValueInRowRelative( iRow, pn, iDelta, bRepeat );
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScreenOptions::ChangeValueInRowRelative( int iRow, PlayerNumber pn, int iDelta, bool bRepeat )
|
||||||
|
{
|
||||||
|
if( iRow == -1 ) // no row selected
|
||||||
|
return; // don't allow a move
|
||||||
|
|
||||||
|
OptionRow &row = *m_pRows[iRow];
|
||||||
|
|
||||||
const int iNumChoices = row.GetRowDef().m_vsChoices.size();
|
const int iNumChoices = row.GetRowDef().m_vsChoices.size();
|
||||||
|
|
||||||
@@ -968,14 +983,14 @@ void ScreenOptions::ChangeValueInRow( PlayerNumber pn, int iDelta, bool Repeat )
|
|||||||
*
|
*
|
||||||
* XXX: Only allow repeats if the opposite key isn't pressed; otherwise, holding both
|
* XXX: Only allow repeats if the opposite key isn't pressed; otherwise, holding both
|
||||||
* directions will repeat in place continuously, which is weird. */
|
* directions will repeat in place continuously, which is weird. */
|
||||||
MoveRowRelative( pn, iDelta, Repeat );
|
MoveRowRelative( pn, iDelta, bRepeat );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( iNumChoices <= 1 ) // nowhere to move
|
if( iNumChoices <= 1 ) // nowhere to move
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if( Repeat && !ALLOW_REPEATING_CHANGE_VALUE_INPUT )
|
if( bRepeat && !ALLOW_REPEATING_CHANGE_VALUE_INPUT )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bool bOneChanged = false;
|
bool bOneChanged = false;
|
||||||
@@ -983,7 +998,6 @@ void ScreenOptions::ChangeValueInRow( PlayerNumber pn, int iDelta, bool Repeat )
|
|||||||
|
|
||||||
int iCurrentChoiceWithFocus = row.GetChoiceInRowWithFocus(pn);
|
int iCurrentChoiceWithFocus = row.GetChoiceInRowWithFocus(pn);
|
||||||
int iNewChoiceWithFocus = iCurrentChoiceWithFocus + iDelta;
|
int iNewChoiceWithFocus = iCurrentChoiceWithFocus + iDelta;
|
||||||
ASSERT( iNumChoices > 0 );
|
|
||||||
wrap( iNewChoiceWithFocus, iNumChoices );
|
wrap( iNewChoiceWithFocus, iNumChoices );
|
||||||
|
|
||||||
if( iCurrentChoiceWithFocus != iNewChoiceWithFocus )
|
if( iCurrentChoiceWithFocus != iNewChoiceWithFocus )
|
||||||
@@ -1049,9 +1063,9 @@ void ScreenOptions::ChangeValueInRow( PlayerNumber pn, int iDelta, bool Repeat )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateText( iCurRow );
|
UpdateText( iRow );
|
||||||
|
|
||||||
this->AfterChangeValueInRow( pn );
|
this->AfterChangeValueInRow( iRow, pn );
|
||||||
|
|
||||||
if( m_OptionsNavigation != NAV_THREE_KEY_MENU )
|
if( m_OptionsNavigation != NAV_THREE_KEY_MENU )
|
||||||
m_SoundChangeCol.Play();
|
m_SoundChangeCol.Play();
|
||||||
@@ -1061,11 +1075,11 @@ void ScreenOptions::ChangeValueInRow( PlayerNumber pn, int iDelta, bool Repeat )
|
|||||||
vector<PlayerNumber> vpns;
|
vector<PlayerNumber> vpns;
|
||||||
FOREACH_HumanPlayer( p )
|
FOREACH_HumanPlayer( p )
|
||||||
vpns.push_back( p );
|
vpns.push_back( p );
|
||||||
ExportOptions( iCurRow, vpns );
|
ExportOptions( iRow, vpns );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenOptions::AfterChangeValueInRow( PlayerNumber pn )
|
void ScreenOptions::AfterChangeValueInRow( int iRow, PlayerNumber pn )
|
||||||
{
|
{
|
||||||
AfterChangeValueOrRow( pn );
|
AfterChangeValueOrRow( pn );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,15 +66,16 @@ protected:
|
|||||||
|
|
||||||
virtual void BeginFadingOut() { this->PostScreenMessage( SM_BeginFadingOut, 0 ); }
|
virtual void BeginFadingOut() { this->PostScreenMessage( SM_BeginFadingOut, 0 ); }
|
||||||
|
|
||||||
void ChangeValueInRow( PlayerNumber pn, int iDelta, bool bRepeat );
|
void ChangeValueInRowRelative( int iRow, PlayerNumber pn, int iDelta, bool bRepeat );
|
||||||
virtual void AfterChangeValueInRow( PlayerNumber pn ); // override this to detect when the value in a row has changed
|
void ChangeValueInRowAbsolute( int iRow, PlayerNumber pn, int iChoiceIndex, bool bRepeat );
|
||||||
|
virtual void AfterChangeValueInRow( int iRow, PlayerNumber pn ); // override this to detect when the value in a row has changed
|
||||||
void MoveRowRelative( PlayerNumber pn, int iDir, bool bRepeat );
|
void MoveRowRelative( PlayerNumber pn, int iDir, bool bRepeat );
|
||||||
void MoveRowAbsolute( PlayerNumber pn, int iRow, bool bRepeat );
|
void MoveRowAbsolute( PlayerNumber pn, int iRow, bool bRepeat );
|
||||||
virtual void AfterChangeRow( PlayerNumber pn ); // override this to detect when the row has changed
|
virtual void AfterChangeRow( PlayerNumber pn ); // override this to detect when the row has changed
|
||||||
virtual void AfterChangeValueOrRow( PlayerNumber pn );
|
virtual void AfterChangeValueOrRow( PlayerNumber pn );
|
||||||
|
|
||||||
void MenuLeft( PlayerNumber pn, const InputEventType type ) { ChangeValueInRow(pn,-1,type != IET_FIRST_PRESS); }
|
void MenuLeft( PlayerNumber pn, const InputEventType type ) { ChangeValueInRowRelative(m_iCurrentRow[pn],pn,-1,type != IET_FIRST_PRESS); }
|
||||||
void MenuRight( PlayerNumber pn, const InputEventType type ) { ChangeValueInRow(pn,+1,type != IET_FIRST_PRESS); }
|
void MenuRight( PlayerNumber pn, const InputEventType type ) { ChangeValueInRowRelative(m_iCurrentRow[pn],pn,+1,type != IET_FIRST_PRESS); }
|
||||||
void MenuUp( PlayerNumber pn, const InputEventType type );
|
void MenuUp( PlayerNumber pn, const InputEventType type );
|
||||||
void MenuDown( PlayerNumber pn, const InputEventType type );
|
void MenuDown( PlayerNumber pn, const InputEventType type );
|
||||||
void MenuSelect( PlayerNumber pn, const InputEventType type );
|
void MenuSelect( PlayerNumber pn, const InputEventType type );
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#include "CommonMetrics.h"
|
#include "CommonMetrics.h"
|
||||||
#include "GameManager.h"
|
#include "GameManager.h"
|
||||||
#include "song.h"
|
#include "song.h"
|
||||||
#include "FontCharAliases.h"
|
#include "Steps.h"
|
||||||
|
|
||||||
enum EditCourseEntryRow
|
enum EditCourseEntryRow
|
||||||
{
|
{
|
||||||
@@ -24,6 +24,26 @@ enum EditCourseEntryRow
|
|||||||
};
|
};
|
||||||
#define FOREACH_EditCourseEntryRow( i ) FOREACH_ENUM( EditCourseEntryRow, NUM_EditCourseEntryRow, i )
|
#define FOREACH_EditCourseEntryRow( i ) FOREACH_ENUM( EditCourseEntryRow, NUM_EditCourseEntryRow, i )
|
||||||
|
|
||||||
|
static void FillSongsAndChoices( const CString &sSongGroup, vector<Song*> &vpSongsOut, vector<CString> &vsChoicesOut )
|
||||||
|
{
|
||||||
|
vpSongsOut.clear();
|
||||||
|
vsChoicesOut.clear();
|
||||||
|
|
||||||
|
if( sSongGroup.empty() )
|
||||||
|
SONGMAN->GetSongs( vpSongsOut );
|
||||||
|
else
|
||||||
|
SONGMAN->GetSongs( vpSongsOut, sSongGroup );
|
||||||
|
vpSongsOut.insert( vpSongsOut.begin(), NULL );
|
||||||
|
|
||||||
|
FOREACH_CONST( Song*, vpSongsOut, s )
|
||||||
|
{
|
||||||
|
if( *s == NULL )
|
||||||
|
vsChoicesOut.push_back( "(any)" );
|
||||||
|
else
|
||||||
|
vsChoicesOut.push_back( (*s)->GetTranslitFullTitle() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
REGISTER_SCREEN_CLASS( ScreenOptionsEditCourseEntry );
|
REGISTER_SCREEN_CLASS( ScreenOptionsEditCourseEntry );
|
||||||
ScreenOptionsEditCourseEntry::ScreenOptionsEditCourseEntry( CString sName ) : ScreenOptions( sName )
|
ScreenOptionsEditCourseEntry::ScreenOptionsEditCourseEntry( CString sName ) : ScreenOptions( sName )
|
||||||
@@ -38,7 +58,8 @@ void ScreenOptionsEditCourseEntry::Init()
|
|||||||
|
|
||||||
// save a backup that we'll use if we revert.
|
// save a backup that we'll use if we revert.
|
||||||
Course *pCourse = GAMESTATE->m_pCurCourse;
|
Course *pCourse = GAMESTATE->m_pCurCourse;
|
||||||
m_Original = pCourse->m_vEntries[ GAMESTATE->m_iEditCourseEntryIndex ];
|
const CourseEntry &ce = pCourse->m_vEntries[ GAMESTATE->m_iEditCourseEntryIndex ];
|
||||||
|
m_Original = ce;
|
||||||
|
|
||||||
|
|
||||||
vector<OptionRowDefinition> vDefs;
|
vector<OptionRowDefinition> vDefs;
|
||||||
@@ -59,9 +80,7 @@ void ScreenOptionsEditCourseEntry::Init()
|
|||||||
|
|
||||||
def.m_sName = "Song";
|
def.m_sName = "Song";
|
||||||
def.m_vsChoices.clear();
|
def.m_vsChoices.clear();
|
||||||
CString sStart = "&Start;";
|
FillSongsAndChoices( ce.sSongGroup, m_vpDisplayedSongs, def.m_vsChoices );
|
||||||
FontCharAliases::ReplaceMarkers( sStart );
|
|
||||||
def.m_vsChoices.push_back( sStart );
|
|
||||||
vDefs.push_back( def );
|
vDefs.push_back( def );
|
||||||
vHands.push_back( NULL );
|
vHands.push_back( NULL );
|
||||||
|
|
||||||
@@ -105,7 +124,8 @@ void ScreenOptionsEditCourseEntry::Init()
|
|||||||
|
|
||||||
def.m_sName = "Set Mods";
|
def.m_sName = "Set Mods";
|
||||||
def.m_vsChoices.clear();
|
def.m_vsChoices.clear();
|
||||||
def.m_vsChoices.push_back( "Set Mods" );
|
CString s = ssprintf( "%d mod changes", ce.GetNumModChanges() );
|
||||||
|
def.m_vsChoices.push_back( s );
|
||||||
vDefs.push_back( def );
|
vDefs.push_back( def );
|
||||||
vHands.push_back( NULL );
|
vHands.push_back( NULL );
|
||||||
|
|
||||||
@@ -115,12 +135,12 @@ void ScreenOptionsEditCourseEntry::Init()
|
|||||||
void ScreenOptionsEditCourseEntry::BeginScreen()
|
void ScreenOptionsEditCourseEntry::BeginScreen()
|
||||||
{
|
{
|
||||||
ScreenOptions::BeginScreen();
|
ScreenOptions::BeginScreen();
|
||||||
|
|
||||||
ImportAllOptions();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenOptionsEditCourseEntry::HandleScreenMessage( const ScreenMessage SM )
|
void ScreenOptionsEditCourseEntry::HandleScreenMessage( const ScreenMessage SM )
|
||||||
{
|
{
|
||||||
|
Course *pCourse = GAMESTATE->m_pCurCourse;
|
||||||
|
|
||||||
if( SM == SM_GoToNextScreen )
|
if( SM == SM_GoToNextScreen )
|
||||||
{
|
{
|
||||||
switch( m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber] )
|
switch( m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber] )
|
||||||
@@ -133,7 +153,20 @@ void ScreenOptionsEditCourseEntry::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
case ROW_CHOOSE_INDEX:
|
case ROW_CHOOSE_INDEX:
|
||||||
break;
|
break;
|
||||||
case ROW_SET_MODS:
|
case ROW_SET_MODS:
|
||||||
|
{
|
||||||
|
Trail *pTrail = pCourse->GetTrail( STEPS_TYPE_DANCE_SINGLE );
|
||||||
|
TrailEntry *pTrailEntry = &pTrail->m_vEntries[GAMESTATE->m_iEditCourseEntryIndex];
|
||||||
|
Song *pSong = pTrailEntry->pSong;
|
||||||
|
Steps *pSteps = pTrailEntry->pSteps;
|
||||||
|
|
||||||
|
// Set up for ScreenEdit
|
||||||
|
const Style *pStyle = GAMEMAN->GetEditorStyleForStepsType(pSteps->m_StepsType);
|
||||||
|
GAMESTATE->m_pCurStyle.Set( pStyle );
|
||||||
|
GAMESTATE->m_pCurSong.Set( pSong );
|
||||||
|
GAMESTATE->m_pCurSteps[PLAYER_1].Set( pSteps );
|
||||||
|
|
||||||
SCREENMAN->SetNewScreen( "ScreenEditCourseMods" );
|
SCREENMAN->SetNewScreen( "ScreenEditCourseMods" );
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case ROW_DONE:
|
case ROW_DONE:
|
||||||
SCREENMAN->SetNewScreen( "ScreenOptionsEditCourse" );
|
SCREENMAN->SetNewScreen( "ScreenOptionsEditCourse" );
|
||||||
@@ -144,7 +177,6 @@ void ScreenOptionsEditCourseEntry::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
else if( SM == SM_GoToPrevScreen )
|
else if( SM == SM_GoToPrevScreen )
|
||||||
{
|
{
|
||||||
// revert
|
// revert
|
||||||
Course *pCourse = GAMESTATE->m_pCurCourse;
|
|
||||||
pCourse->m_vEntries[ GAMESTATE->m_iEditCourseEntryIndex ] = m_Original;
|
pCourse->m_vEntries[ GAMESTATE->m_iEditCourseEntryIndex ] = m_Original;
|
||||||
|
|
||||||
SCREENMAN->SetNewScreen( "ScreenOptionsEditCourse" );
|
SCREENMAN->SetNewScreen( "ScreenOptionsEditCourse" );
|
||||||
@@ -154,149 +186,79 @@ void ScreenOptionsEditCourseEntry::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
ScreenOptions::HandleScreenMessage( SM );
|
ScreenOptions::HandleScreenMessage( SM );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenOptionsEditCourseEntry::AfterChangeValueInRow( PlayerNumber pn )
|
void ScreenOptionsEditCourseEntry::AfterChangeValueInRow( int iRow, PlayerNumber pn )
|
||||||
{
|
{
|
||||||
ScreenOptions::AfterChangeValueInRow( pn );
|
ScreenOptions::AfterChangeValueInRow( iRow, pn );
|
||||||
Course *pCourse = GAMESTATE->m_pCurCourse;
|
|
||||||
CourseEntry &ce = pCourse->m_vEntries[ GAMESTATE->m_iEditCourseEntryIndex ];
|
|
||||||
|
|
||||||
switch( m_iCurrentRow[pn] )
|
Course *pCourse = GAMESTATE->m_pCurCourse;
|
||||||
|
int iEntryIndex = GAMESTATE->m_iEditCourseEntryIndex;
|
||||||
|
ASSERT( iEntryIndex >= 0 && iEntryIndex < pCourse->m_vEntries.size() );
|
||||||
|
CourseEntry &ce = pCourse->m_vEntries[ iEntryIndex ];
|
||||||
|
|
||||||
|
switch( iRow )
|
||||||
{
|
{
|
||||||
case ROW_SONG_GROUP:
|
case ROW_SONG_GROUP:
|
||||||
// export song group
|
|
||||||
{
|
|
||||||
OptionRow &row = *m_pRows[ROW_SONG_GROUP];
|
|
||||||
int iChoice = row.GetChoiceInRowWithFocus( GAMESTATE->m_MasterPlayerNumber );
|
|
||||||
if( iChoice == 0 )
|
|
||||||
ce.sSongGroup = "";
|
|
||||||
else
|
|
||||||
ce.sSongGroup = row.GetRowDef().m_vsChoices[ iChoice ];
|
|
||||||
}
|
|
||||||
// refresh songs
|
// refresh songs
|
||||||
{
|
{
|
||||||
|
vector<PlayerNumber> vpns;
|
||||||
|
vpns.push_back( PLAYER_1 );
|
||||||
|
ExportOptions( ROW_SONG_GROUP, vpns );
|
||||||
|
|
||||||
OptionRow &row = *m_pRows[ROW_SONG];
|
OptionRow &row = *m_pRows[ROW_SONG];
|
||||||
OptionRowDefinition def = row.GetRowDef();
|
OptionRowDefinition def = row.GetRowDef();
|
||||||
def.m_vsChoices.clear();
|
FillSongsAndChoices( ce.sSongGroup, m_vpDisplayedSongs, def.m_vsChoices );
|
||||||
def.m_vsChoices.push_back( "(any)" );
|
|
||||||
vector<Song*> vpSongs;
|
|
||||||
if( ce.sSongGroup.empty() )
|
|
||||||
SONGMAN->GetSongs( vpSongs );
|
|
||||||
else
|
|
||||||
SONGMAN->GetSongs( vpSongs, ce.sSongGroup );
|
|
||||||
FOREACH_CONST( Song*, vpSongs, s )
|
|
||||||
def.m_vsChoices.push_back( (*s)->GetTranslitFullTitle() );
|
|
||||||
vector<Song*>::const_iterator iter = find( vpSongs.begin(), vpSongs.end(), ce.pSong );
|
|
||||||
if( iter != vpSongs.end() )
|
|
||||||
{
|
|
||||||
int iSongIndex = iter - vpSongs.begin();
|
|
||||||
row.SetOneSharedSelection( iSongIndex+1 );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
row.SetOneSharedSelection( 0 );
|
|
||||||
}
|
|
||||||
row.Reload( def );
|
row.Reload( def );
|
||||||
}
|
|
||||||
// fall through
|
vector<Song*>::const_iterator iter = find( m_vpDisplayedSongs.begin(), m_vpDisplayedSongs.end(), ce.pSong );
|
||||||
case ROW_SONG:
|
if( iter == m_vpDisplayedSongs.end() )
|
||||||
// export song
|
|
||||||
{
|
{
|
||||||
OptionRow &row = *m_pRows[ROW_SONG];
|
this->ChangeValueInRowAbsolute( ROW_SONG, PLAYER_1, 0, false );
|
||||||
int iChoice = row.GetChoiceInRowWithFocus( GAMESTATE->m_MasterPlayerNumber );
|
}
|
||||||
if( iChoice == 0 )
|
|
||||||
ce.pSong = NULL;
|
|
||||||
else
|
else
|
||||||
ce.pSong = SONGMAN->GetAllSongs()[iChoice-1];
|
|
||||||
}
|
|
||||||
// fall through
|
|
||||||
case ROW_BASE_DIFFICULTY:
|
|
||||||
// export difficulty
|
|
||||||
{
|
{
|
||||||
OptionRow &row = *m_pRows[ROW_BASE_DIFFICULTY];
|
int iSongIndex = iter - m_vpDisplayedSongs.begin();
|
||||||
int iChoice = row.GetChoiceInRowWithFocus( GAMESTATE->m_MasterPlayerNumber );
|
this->ChangeValueInRowAbsolute( ROW_SONG, PLAYER_1, iSongIndex, false );
|
||||||
ce.baseDifficulty = DIFFICULTIES_TO_SHOW.GetValue()[iChoice];
|
|
||||||
}
|
}
|
||||||
// fall through
|
|
||||||
case ROW_LOW_METER:
|
|
||||||
// export low meter
|
|
||||||
{
|
|
||||||
OptionRow &row = *m_pRows[ROW_LOW_METER];
|
|
||||||
int iChoice = row.GetChoiceInRowWithFocus( GAMESTATE->m_MasterPlayerNumber );
|
|
||||||
if( iChoice == 0 )
|
|
||||||
ce.iLowMeter = -1;
|
|
||||||
else
|
|
||||||
ce.iLowMeter = iChoice;
|
|
||||||
}
|
}
|
||||||
// fall through
|
break;
|
||||||
case ROW_HIGH_METER:
|
|
||||||
// export high meter
|
|
||||||
{
|
|
||||||
OptionRow &row = *m_pRows[ROW_HIGH_METER];
|
|
||||||
int iChoice = row.GetChoiceInRowWithFocus( GAMESTATE->m_MasterPlayerNumber );
|
|
||||||
if( iChoice == 0 )
|
|
||||||
ce.iHighMeter = -1;
|
|
||||||
else
|
|
||||||
ce.iHighMeter = iChoice;
|
|
||||||
}
|
|
||||||
// fall through
|
|
||||||
case ROW_SORT:
|
|
||||||
// export sort
|
|
||||||
{
|
|
||||||
OptionRow &row = *m_pRows[ROW_SORT];
|
|
||||||
int iChoice = row.GetChoiceInRowWithFocus( GAMESTATE->m_MasterPlayerNumber );
|
|
||||||
ce.songSort = (SongSort)iChoice;
|
|
||||||
}
|
|
||||||
// fall through
|
|
||||||
case ROW_CHOOSE_INDEX:
|
|
||||||
// export choose index
|
|
||||||
{
|
|
||||||
OptionRow &row = *m_pRows[ROW_CHOOSE_INDEX];
|
|
||||||
int iChoice = row.GetChoiceInRowWithFocus( GAMESTATE->m_MasterPlayerNumber );
|
|
||||||
ce.iChooseIndex = iChoice;
|
|
||||||
}
|
|
||||||
// fall through
|
|
||||||
case ROW_SET_MODS:
|
|
||||||
// fall through
|
|
||||||
default:
|
|
||||||
; // nothing left to do
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenOptionsEditCourseEntry::ImportAllOptions()
|
void ScreenOptionsEditCourseEntry::ImportOptions( int iRow, const vector<PlayerNumber> &vpns )
|
||||||
{
|
{
|
||||||
// fill choices before importing
|
|
||||||
AfterChangeValueInRow( GAMESTATE->m_MasterPlayerNumber );
|
|
||||||
|
|
||||||
|
|
||||||
Course *pCourse = GAMESTATE->m_pCurCourse;
|
Course *pCourse = GAMESTATE->m_pCurCourse;
|
||||||
CourseEntry &ce = pCourse->m_vEntries[ GAMESTATE->m_iEditCourseEntryIndex ];
|
int iEntryIndex = GAMESTATE->m_iEditCourseEntryIndex;
|
||||||
|
ASSERT( iEntryIndex >= 0 && iEntryIndex < pCourse->m_vEntries.size() );
|
||||||
|
CourseEntry &ce = pCourse->m_vEntries[ iEntryIndex ];
|
||||||
|
|
||||||
// import song group
|
OptionRow &row = *m_pRows[iRow];
|
||||||
|
|
||||||
|
switch( iRow )
|
||||||
{
|
{
|
||||||
OptionRow &row = *m_pRows[ROW_SONG_GROUP];
|
case ROW_SONG_GROUP:
|
||||||
FOREACH_CONST( CString, row.GetRowDef().m_vsChoices, s )
|
FOREACH_CONST( CString, row.GetRowDef().m_vsChoices, s )
|
||||||
{
|
{
|
||||||
if( *s == ce.sSongGroup )
|
if( *s == ce.sSongGroup )
|
||||||
{
|
{
|
||||||
int iChoice = s - row.GetRowDef().m_vsChoices.begin();
|
int iChoice = s - row.GetRowDef().m_vsChoices.begin();
|
||||||
row.SetOneSharedSelection( iChoice );
|
row.SetOneSharedSelection( iChoice );
|
||||||
AfterChangeValueInRow( GAMESTATE->m_MasterPlayerNumber );
|
AfterChangeValueInRow( iRow, GAMESTATE->m_MasterPlayerNumber );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
// import song
|
case ROW_SONG:
|
||||||
{
|
{
|
||||||
vector<Song*> vpSongs;
|
vector<Song*>::const_iterator iter = find( m_vpDisplayedSongs.begin(), m_vpDisplayedSongs.end(), ce.pSong );
|
||||||
SONGMAN->GetSongs( vpSongs, ce.sSongGroup );
|
|
||||||
vector<Song*>::const_iterator iter = find( vpSongs.begin(), vpSongs.end(), ce.pSong );
|
|
||||||
int iChoice = 0;
|
int iChoice = 0;
|
||||||
if( iter != vpSongs.end() )
|
if( iter != m_vpDisplayedSongs.end() )
|
||||||
iChoice = iter - vpSongs.begin() + 1;
|
iChoice = iter - m_vpDisplayedSongs.begin();
|
||||||
OptionRow &row = *m_pRows[ROW_SONG];
|
OptionRow &row = *m_pRows[ROW_SONG];
|
||||||
row.SetOneSharedSelection( iChoice );
|
row.SetOneSharedSelection( iChoice );
|
||||||
}
|
}
|
||||||
// import base difficulty
|
break;
|
||||||
|
case ROW_BASE_DIFFICULTY:
|
||||||
{
|
{
|
||||||
vector<Difficulty>::const_iterator iter = find( DIFFICULTIES_TO_SHOW.GetValue().begin(), DIFFICULTIES_TO_SHOW.GetValue().end(), ce.baseDifficulty );
|
vector<Difficulty>::const_iterator iter = find( DIFFICULTIES_TO_SHOW.GetValue().begin(), DIFFICULTIES_TO_SHOW.GetValue().end(), ce.baseDifficulty );
|
||||||
int iChoice = 0;
|
int iChoice = 0;
|
||||||
@@ -305,7 +267,8 @@ void ScreenOptionsEditCourseEntry::ImportAllOptions()
|
|||||||
OptionRow &row = *m_pRows[ROW_BASE_DIFFICULTY];
|
OptionRow &row = *m_pRows[ROW_BASE_DIFFICULTY];
|
||||||
row.SetOneSharedSelection( iChoice );
|
row.SetOneSharedSelection( iChoice );
|
||||||
}
|
}
|
||||||
// import low meter
|
break;
|
||||||
|
case ROW_LOW_METER:
|
||||||
{
|
{
|
||||||
int iChoice = 0;
|
int iChoice = 0;
|
||||||
if( ce.iLowMeter != -1 )
|
if( ce.iLowMeter != -1 )
|
||||||
@@ -313,7 +276,8 @@ void ScreenOptionsEditCourseEntry::ImportAllOptions()
|
|||||||
OptionRow &row = *m_pRows[ROW_LOW_METER];
|
OptionRow &row = *m_pRows[ROW_LOW_METER];
|
||||||
row.SetOneSharedSelection( iChoice );
|
row.SetOneSharedSelection( iChoice );
|
||||||
}
|
}
|
||||||
// import high meter
|
break;
|
||||||
|
case ROW_HIGH_METER:
|
||||||
{
|
{
|
||||||
int iChoice = 0;
|
int iChoice = 0;
|
||||||
if( ce.iHighMeter != -1 )
|
if( ce.iHighMeter != -1 )
|
||||||
@@ -321,23 +285,94 @@ void ScreenOptionsEditCourseEntry::ImportAllOptions()
|
|||||||
OptionRow &row = *m_pRows[ROW_HIGH_METER];
|
OptionRow &row = *m_pRows[ROW_HIGH_METER];
|
||||||
row.SetOneSharedSelection( iChoice );
|
row.SetOneSharedSelection( iChoice );
|
||||||
}
|
}
|
||||||
// import sort
|
break;
|
||||||
|
case ROW_SORT:
|
||||||
{
|
{
|
||||||
int iChoice = ce.songSort;
|
int iChoice = ce.songSort;
|
||||||
OptionRow &row = *m_pRows[ROW_SORT];
|
OptionRow &row = *m_pRows[ROW_SORT];
|
||||||
row.SetOneSharedSelection( iChoice );
|
row.SetOneSharedSelection( iChoice );
|
||||||
}
|
}
|
||||||
// import choose index
|
break;
|
||||||
|
case ROW_CHOOSE_INDEX:
|
||||||
{
|
{
|
||||||
int iChoice = ce.iChooseIndex;
|
int iChoice = ce.iChooseIndex;
|
||||||
OptionRow &row = *m_pRows[ROW_CHOOSE_INDEX];
|
OptionRow &row = *m_pRows[ROW_CHOOSE_INDEX];
|
||||||
row.SetOneSharedSelection( iChoice );
|
row.SetOneSharedSelection( iChoice );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenOptionsEditCourseEntry::ExportOptions( int iRow, const vector<PlayerNumber> &vpns )
|
void ScreenOptionsEditCourseEntry::ExportOptions( int iRow, const vector<PlayerNumber> &vpns )
|
||||||
{
|
{
|
||||||
|
Course *pCourse = GAMESTATE->m_pCurCourse;
|
||||||
|
int iEntryIndex = GAMESTATE->m_iEditCourseEntryIndex;
|
||||||
|
ASSERT( iEntryIndex >= 0 && iEntryIndex < pCourse->m_vEntries.size() );
|
||||||
|
CourseEntry &ce = pCourse->m_vEntries[ iEntryIndex ];
|
||||||
|
|
||||||
|
switch( iRow )
|
||||||
|
{
|
||||||
|
case ROW_SONG_GROUP:
|
||||||
|
{
|
||||||
|
OptionRow &row = *m_pRows[ROW_SONG_GROUP];
|
||||||
|
int iChoice = row.GetChoiceInRowWithFocus( GAMESTATE->m_MasterPlayerNumber );
|
||||||
|
if( iChoice == 0 )
|
||||||
|
ce.sSongGroup = "";
|
||||||
|
else
|
||||||
|
ce.sSongGroup = row.GetRowDef().m_vsChoices[ iChoice ];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ROW_SONG:
|
||||||
|
{
|
||||||
|
OptionRow &row = *m_pRows[ROW_SONG];
|
||||||
|
int iChoice = row.GetChoiceInRowWithFocus( GAMESTATE->m_MasterPlayerNumber );
|
||||||
|
if( iChoice == 0 )
|
||||||
|
ce.pSong = NULL;
|
||||||
|
else
|
||||||
|
ce.pSong = m_vpDisplayedSongs[iChoice-1];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ROW_BASE_DIFFICULTY:
|
||||||
|
{
|
||||||
|
OptionRow &row = *m_pRows[ROW_BASE_DIFFICULTY];
|
||||||
|
int iChoice = row.GetChoiceInRowWithFocus( GAMESTATE->m_MasterPlayerNumber );
|
||||||
|
ce.baseDifficulty = DIFFICULTIES_TO_SHOW.GetValue()[iChoice];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ROW_LOW_METER:
|
||||||
|
{
|
||||||
|
OptionRow &row = *m_pRows[ROW_LOW_METER];
|
||||||
|
int iChoice = row.GetChoiceInRowWithFocus( GAMESTATE->m_MasterPlayerNumber );
|
||||||
|
if( iChoice == 0 )
|
||||||
|
ce.iLowMeter = -1;
|
||||||
|
else
|
||||||
|
ce.iLowMeter = iChoice;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ROW_HIGH_METER:
|
||||||
|
{
|
||||||
|
OptionRow &row = *m_pRows[ROW_HIGH_METER];
|
||||||
|
int iChoice = row.GetChoiceInRowWithFocus( GAMESTATE->m_MasterPlayerNumber );
|
||||||
|
if( iChoice == 0 )
|
||||||
|
ce.iHighMeter = -1;
|
||||||
|
else
|
||||||
|
ce.iHighMeter = iChoice;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ROW_SORT:
|
||||||
|
{
|
||||||
|
OptionRow &row = *m_pRows[ROW_SORT];
|
||||||
|
int iChoice = row.GetChoiceInRowWithFocus( GAMESTATE->m_MasterPlayerNumber );
|
||||||
|
ce.songSort = (SongSort)iChoice;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ROW_CHOOSE_INDEX:
|
||||||
|
{
|
||||||
|
OptionRow &row = *m_pRows[ROW_CHOOSE_INDEX];
|
||||||
|
int iChoice = row.GetChoiceInRowWithFocus( GAMESTATE->m_MasterPlayerNumber );
|
||||||
|
ce.iChooseIndex = iChoice;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenOptionsEditCourseEntry::ProcessMenuStart( PlayerNumber pn, const InputEventType type )
|
void ScreenOptionsEditCourseEntry::ProcessMenuStart( PlayerNumber pn, const InputEventType type )
|
||||||
@@ -359,6 +394,7 @@ void ScreenOptionsEditCourseEntry::ProcessMenuStart( PlayerNumber pn, const Inpu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (c) 2002-2004 Chris Danford
|
* (c) 2002-2004 Chris Danford
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include "ScreenOptions.h"
|
#include "ScreenOptions.h"
|
||||||
#include "Course.h"
|
#include "Course.h"
|
||||||
|
class Song;
|
||||||
|
|
||||||
class ScreenOptionsEditCourseEntry : public ScreenOptions
|
class ScreenOptionsEditCourseEntry : public ScreenOptions
|
||||||
{
|
{
|
||||||
@@ -15,15 +16,16 @@ public:
|
|||||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void ImportOptions( int iRow, const vector<PlayerNumber> &vpns ) {}
|
|
||||||
|
virtual void ImportOptions( int iRow, const vector<PlayerNumber> &vpns );
|
||||||
virtual void ExportOptions( int iRow, const vector<PlayerNumber> &vpns );
|
virtual void ExportOptions( int iRow, const vector<PlayerNumber> &vpns );
|
||||||
|
|
||||||
virtual void AfterChangeValueInRow( PlayerNumber pn );
|
virtual void AfterChangeValueInRow( int iRow, PlayerNumber pn );
|
||||||
virtual void ProcessMenuStart( PlayerNumber pn, const InputEventType type );
|
virtual void ProcessMenuStart( PlayerNumber pn, const InputEventType type );
|
||||||
|
|
||||||
void ImportAllOptions();
|
vector<Song*> m_vpDisplayedSongs; // corresponds with the choices in the Song row
|
||||||
|
|
||||||
CourseEntry m_Original;
|
CourseEntry m_Original; // use this to revert when cancelling
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -303,6 +303,12 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\
|
|||||||
<File
|
<File
|
||||||
RelativePath="ScreenEdit.h">
|
RelativePath="ScreenEdit.h">
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\ScreenEditCourseMods.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\ScreenEditCourseMods.h">
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="ScreenEditMenu.cpp">
|
RelativePath="ScreenEditMenu.cpp">
|
||||||
</File>
|
</File>
|
||||||
|
|||||||
@@ -2542,6 +2542,14 @@ SOURCE=.\ScreenEdit.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\ScreenEditCourseMods.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\ScreenEditCourseMods.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\ScreenEditMenu.cpp
|
SOURCE=.\ScreenEditMenu.cpp
|
||||||
|
|
||||||
!IF "$(CFG)" == "StepMania - Win32 Debug"
|
!IF "$(CFG)" == "StepMania - Win32 Debug"
|
||||||
|
|||||||
@@ -283,6 +283,12 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\
|
|||||||
<File
|
<File
|
||||||
RelativePath="ScreenEdit.h">
|
RelativePath="ScreenEdit.h">
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="ScreenEditCourseMods.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="ScreenEditCourseMods.h">
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="ScreenEditMenu.cpp">
|
RelativePath="ScreenEditMenu.cpp">
|
||||||
</File>
|
</File>
|
||||||
|
|||||||
Reference in New Issue
Block a user