course edit screen functional
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
ScreenEdit save
|
||||||
@@ -57,6 +57,7 @@ public:
|
|||||||
|
|
||||||
CourseEntry()
|
CourseEntry()
|
||||||
{
|
{
|
||||||
|
type = (CourseEntryType)0;
|
||||||
difficulty = DIFFICULTY_INVALID;
|
difficulty = DIFFICULTY_INVALID;
|
||||||
low_meter = -1;
|
low_meter = -1;
|
||||||
high_meter = -1;
|
high_meter = -1;
|
||||||
|
|||||||
@@ -45,6 +45,13 @@
|
|||||||
const ScreenMessage SM_BackFromCourseOptionsMenu = (ScreenMessage)(SM_User+1);
|
const ScreenMessage SM_BackFromCourseOptionsMenu = (ScreenMessage)(SM_User+1);
|
||||||
const ScreenMessage SM_BackFromCourseEntryOptionsMenu = (ScreenMessage)(SM_User+2);
|
const ScreenMessage SM_BackFromCourseEntryOptionsMenu = (ScreenMessage)(SM_User+2);
|
||||||
|
|
||||||
|
enum CourseEntryMenuRow
|
||||||
|
{
|
||||||
|
repeat,
|
||||||
|
randomize,
|
||||||
|
lives,
|
||||||
|
};
|
||||||
|
|
||||||
Menu g_CourseOptionsMenu
|
Menu g_CourseOptionsMenu
|
||||||
(
|
(
|
||||||
"Course Options",
|
"Course Options",
|
||||||
@@ -53,17 +60,18 @@ Menu g_CourseOptionsMenu
|
|||||||
MenuRow( "Lives", true, 4, "Use Bar Life","1","2","3","4","5","6","7","8","9","10" )
|
MenuRow( "Lives", true, 4, "Use Bar Life","1","2","3","4","5","6","7","8","9","10" )
|
||||||
);
|
);
|
||||||
|
|
||||||
enum CourseEntryOptionsMenuRow
|
enum CourseOptionsMenuRow
|
||||||
{
|
{
|
||||||
song,
|
song,
|
||||||
group,
|
group,
|
||||||
difficulty,
|
difficulty,
|
||||||
low_meter,
|
low_meter,
|
||||||
high_meter,
|
high_meter,
|
||||||
best_worst_value
|
best_worst_value,
|
||||||
|
NUM_COURSE_OPTIONS_MENU_ROWS
|
||||||
};
|
};
|
||||||
|
|
||||||
Menu g_CourseEntryOptionsMenu
|
Menu g_CourseEntryMenu
|
||||||
(
|
(
|
||||||
"Course Entry Options",
|
"Course Entry Options",
|
||||||
MenuRow( "Song", true, 0 ),
|
MenuRow( "Song", true, 0 ),
|
||||||
@@ -126,6 +134,7 @@ EditCoursesMenu::EditCoursesMenu()
|
|||||||
m_soundChangeValue.Load( THEME->GetPathToS("EditCoursesMenu value") );
|
m_soundChangeValue.Load( THEME->GetPathToS("EditCoursesMenu value") );
|
||||||
m_soundStart.Load( THEME->GetPathToS("Common start") );
|
m_soundStart.Load( THEME->GetPathToS("Common start") );
|
||||||
m_soundInvalid.Load( THEME->GetPathToS("Common invalid") );
|
m_soundInvalid.Load( THEME->GetPathToS("Common invalid") );
|
||||||
|
m_soundSave.Load( THEME->GetPathToS("EditCoursesMenu save") );
|
||||||
|
|
||||||
|
|
||||||
// fill in data structures
|
// fill in data structures
|
||||||
@@ -235,48 +244,175 @@ void EditCoursesMenu::Start()
|
|||||||
{
|
{
|
||||||
switch( m_SelectedRow )
|
switch( m_SelectedRow )
|
||||||
{
|
{
|
||||||
case ROW_COURSE_OPTIONS:
|
case ROW_COURSE_OPTIONS:
|
||||||
|
g_CourseOptionsMenu.rows[repeat].defaultChoice = GetSelectedCourse()->m_bRepeat ? 1 : 0;
|
||||||
|
g_CourseOptionsMenu.rows[randomize].defaultChoice = GetSelectedCourse()->m_bRandomize ? 1 : 0;
|
||||||
|
g_CourseOptionsMenu.rows[lives].defaultChoice = GetSelectedCourse()->m_iLives;
|
||||||
|
if( g_CourseOptionsMenu.rows[lives].defaultChoice == -1 )
|
||||||
|
g_CourseOptionsMenu.rows[lives].defaultChoice = 0;
|
||||||
SCREENMAN->MiniMenu( &g_CourseOptionsMenu, SM_BackFromCourseOptionsMenu );
|
SCREENMAN->MiniMenu( &g_CourseOptionsMenu, SM_BackFromCourseOptionsMenu );
|
||||||
break;
|
break;
|
||||||
case ROW_ACTION:
|
case ROW_ACTION:
|
||||||
m_soundStart.Play();
|
switch( GetSelectedAction() )
|
||||||
|
{
|
||||||
|
case save:
|
||||||
|
m_soundSave.Play();
|
||||||
|
GetSelectedCourse()->Save();
|
||||||
|
SCREENMAN->SystemMessage( "Course saved." );
|
||||||
|
break;
|
||||||
|
case add_entry:
|
||||||
|
m_soundStart.Play();
|
||||||
|
GetSelectedCourse()->m_entries.push_back( CourseEntry() );
|
||||||
|
m_iSelection[ROW_ENTRY] = GetSelectedCourse()->m_entries.size()-1;
|
||||||
|
OnRowValueChanged( ROW_ENTRY );
|
||||||
|
break;
|
||||||
|
case delete_selected_entry:
|
||||||
|
if( GetSelectedCourse()->m_entries.size() == 1 )
|
||||||
|
{
|
||||||
|
m_soundInvalid.Play();
|
||||||
|
SCREENMAN->SystemMessage( "Cannot delete the last entry from a course" );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_soundStart.Play();
|
||||||
|
GetSelectedCourse()->m_entries.erase( GetSelectedCourse()->m_entries.begin()+m_iSelection[ROW_ENTRY] );
|
||||||
|
CLAMP( m_iSelection[ROW_ENTRY], 0, GetSelectedCourse()->m_entries.size()-1 );
|
||||||
|
OnRowValueChanged( ROW_ENTRY );
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ASSERT(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
OnRowValueChanged( ROW_ENTRY );
|
||||||
break;
|
break;
|
||||||
case ROW_ENTRY_OPTIONS:
|
case ROW_ENTRY_OPTIONS:
|
||||||
{
|
{
|
||||||
|
unsigned i;
|
||||||
|
|
||||||
|
//
|
||||||
|
// populate songs list
|
||||||
|
//
|
||||||
|
g_CourseEntryMenu.rows[song].choices.clear();
|
||||||
|
g_CourseEntryMenu.rows[song].defaultChoice = 0;
|
||||||
|
|
||||||
|
vector<Song*> vSongs = SONGMAN->GetAllSongs();
|
||||||
|
for( i=0; i<vSongs.size(); i++ )
|
||||||
|
{
|
||||||
|
g_CourseEntryMenu.rows[song].choices.push_back( vSongs[i]->m_sGroupName + " - " + vSongs[i]->GetTranslitMainTitle() );
|
||||||
|
if( GetSelectedEntry()->pSong == vSongs[i] )
|
||||||
|
g_CourseEntryMenu.rows[song].defaultChoice = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// populate group list
|
||||||
|
//
|
||||||
|
g_CourseEntryMenu.rows[group].choices.clear();
|
||||||
|
g_CourseEntryMenu.rows[group].defaultChoice = 0;
|
||||||
|
|
||||||
|
CStringArray vGroups;
|
||||||
|
SONGMAN->GetGroupNames( vGroups );
|
||||||
|
for( i=0; i<vGroups.size(); i++ )
|
||||||
|
{
|
||||||
|
g_CourseEntryMenu.rows[group].choices.push_back( vGroups[i] );
|
||||||
|
if( GetSelectedEntry()->group_name == vGroups[i] )
|
||||||
|
g_CourseEntryMenu.rows[group].defaultChoice = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// populate difficulty list
|
||||||
|
//
|
||||||
|
g_CourseEntryMenu.rows[difficulty].choices.clear();
|
||||||
|
g_CourseEntryMenu.rows[difficulty].defaultChoice = NUM_DIFFICULTIES;
|
||||||
|
|
||||||
|
for( i=0; i<=NUM_DIFFICULTIES; i++ )
|
||||||
|
{
|
||||||
|
CString sDifficulty = (i==NUM_DIFFICULTIES) ? "Don't care" : DifficultyToString((Difficulty)i);
|
||||||
|
g_CourseEntryMenu.rows[difficulty].choices.push_back( sDifficulty );
|
||||||
|
if( GetSelectedEntry()->difficulty == i )
|
||||||
|
g_CourseEntryMenu.rows[difficulty].defaultChoice = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// populate difficulty list
|
||||||
|
//
|
||||||
|
g_CourseEntryMenu.rows[low_meter].choices.clear();
|
||||||
|
g_CourseEntryMenu.rows[low_meter].defaultChoice = 0;
|
||||||
|
g_CourseEntryMenu.rows[high_meter].choices.clear();
|
||||||
|
g_CourseEntryMenu.rows[high_meter].defaultChoice = 0;
|
||||||
|
|
||||||
|
for( i=0; i<=MAX_METER; i++ )
|
||||||
|
{
|
||||||
|
CString sMeter = (i==0) ? "Don't care" : ssprintf("%d", i);
|
||||||
|
g_CourseEntryMenu.rows[low_meter].choices.push_back( sMeter );
|
||||||
|
g_CourseEntryMenu.rows[high_meter].choices.push_back( sMeter );
|
||||||
|
if( GetSelectedEntry()->low_meter == i )
|
||||||
|
g_CourseEntryMenu.rows[low_meter].defaultChoice = i;
|
||||||
|
if( GetSelectedEntry()->high_meter == i )
|
||||||
|
g_CourseEntryMenu.rows[high_meter].defaultChoice = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// populate best/worst list
|
||||||
|
//
|
||||||
|
g_CourseEntryMenu.rows[best_worst_value].choices.clear();
|
||||||
|
g_CourseEntryMenu.rows[best_worst_value].defaultChoice = 7;
|
||||||
|
|
||||||
|
for( i=1; i<40; i++ )
|
||||||
|
{
|
||||||
|
CString sNum = ssprintf("%d", i);
|
||||||
|
g_CourseEntryMenu.rows[high_meter].choices.push_back( sNum );
|
||||||
|
if( GetSelectedEntry()->players_index == i-1 )
|
||||||
|
g_CourseEntryMenu.rows[best_worst_value].defaultChoice = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// update enabled/disabled lines
|
// update enabled/disabled lines
|
||||||
for( unsigned i=0; i<g_CourseEntryOptionsMenu.rows.size(); i++ )
|
for( i=0; i<g_CourseEntryMenu.rows.size(); i++ )
|
||||||
g_CourseEntryOptionsMenu.rows[i].enabled = false;
|
g_CourseEntryMenu.rows[i].enabled = false;
|
||||||
|
|
||||||
switch( GetSelectedEntry()->type )
|
switch( GetSelectedEntry()->type )
|
||||||
{
|
{
|
||||||
case COURSE_ENTRY_FIXED:
|
case COURSE_ENTRY_FIXED:
|
||||||
g_CourseEntryOptionsMenu.rows[song].enabled = true;
|
g_CourseEntryMenu.rows[song].enabled = true;
|
||||||
break;
|
break;
|
||||||
case COURSE_ENTRY_RANDOM:
|
case COURSE_ENTRY_RANDOM:
|
||||||
g_CourseEntryOptionsMenu.rows[low_meter].enabled = true;
|
g_CourseEntryMenu.rows[difficulty].enabled = true;
|
||||||
g_CourseEntryOptionsMenu.rows[high_meter].enabled = true;
|
g_CourseEntryMenu.rows[low_meter].enabled = true;
|
||||||
|
g_CourseEntryMenu.rows[high_meter].enabled = true;
|
||||||
break;
|
break;
|
||||||
case COURSE_ENTRY_RANDOM_WITHIN_GROUP:
|
case COURSE_ENTRY_RANDOM_WITHIN_GROUP:
|
||||||
g_CourseEntryOptionsMenu.rows[group].enabled = true;
|
g_CourseEntryMenu.rows[group].enabled = true;
|
||||||
g_CourseEntryOptionsMenu.rows[low_meter].enabled = true;
|
g_CourseEntryMenu.rows[difficulty].enabled = true;
|
||||||
g_CourseEntryOptionsMenu.rows[high_meter].enabled = true;
|
g_CourseEntryMenu.rows[low_meter].enabled = true;
|
||||||
|
g_CourseEntryMenu.rows[high_meter].enabled = true;
|
||||||
break;
|
break;
|
||||||
case COURSE_ENTRY_BEST:
|
case COURSE_ENTRY_BEST:
|
||||||
g_CourseEntryOptionsMenu.rows[best_worst_value].enabled = true;
|
g_CourseEntryMenu.rows[best_worst_value].enabled = true;
|
||||||
break;
|
break;
|
||||||
case COURSE_ENTRY_WORST:
|
case COURSE_ENTRY_WORST:
|
||||||
g_CourseEntryOptionsMenu.rows[best_worst_value].enabled = true;
|
g_CourseEntryMenu.rows[best_worst_value].enabled = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
ASSERT(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
SCREENMAN->MiniMenu( &g_CourseEntryOptionsMenu, SM_BackFromCourseEntryOptionsMenu );
|
SCREENMAN->MiniMenu( &g_CourseEntryMenu, SM_BackFromCourseEntryOptionsMenu );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ROW_ENTRY_PLAYER_OPTIONS:
|
case ROW_ENTRY_PLAYER_OPTIONS:
|
||||||
|
m_soundStart.Play();
|
||||||
|
|
||||||
|
GAMESTATE->m_PlayerOptions[PLAYER_1] = PlayerOptions();
|
||||||
|
GAMESTATE->m_PlayerOptions[PLAYER_1].FromString( GetSelectedEntry()->modifiers );
|
||||||
|
|
||||||
SCREENMAN->AddNewScreenToTop( "ScreenPlayerOptions" );
|
SCREENMAN->AddNewScreenToTop( "ScreenPlayerOptions" );
|
||||||
break;
|
break;
|
||||||
case ROW_ENTRY_SONG_OPTIONS:
|
case ROW_ENTRY_SONG_OPTIONS:
|
||||||
|
m_soundStart.Play();
|
||||||
|
|
||||||
|
GAMESTATE->m_SongOptions = SongOptions();
|
||||||
|
GAMESTATE->m_SongOptions.FromString( GetSelectedEntry()->modifiers );
|
||||||
|
|
||||||
SCREENMAN->AddNewScreenToTop( "ScreenSongOptions" );
|
SCREENMAN->AddNewScreenToTop( "ScreenSongOptions" );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -286,6 +422,49 @@ void EditCoursesMenu::Start()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void EditCoursesMenu::HandleScreenMessage( const ScreenMessage SM )
|
||||||
|
{
|
||||||
|
switch( SM )
|
||||||
|
{
|
||||||
|
case SM_BackFromCourseOptionsMenu:
|
||||||
|
GetSelectedCourse()->m_bRepeat = !!ScreenMiniMenu::s_iLastAnswers[repeat];
|
||||||
|
GetSelectedCourse()->m_bRandomize = !!ScreenMiniMenu::s_iLastAnswers[randomize];
|
||||||
|
GetSelectedCourse()->m_iLives = ScreenMiniMenu::s_iLastAnswers[lives];
|
||||||
|
if( GetSelectedCourse()->m_iLives == 0 )
|
||||||
|
GetSelectedCourse()->m_iLives = -1;
|
||||||
|
|
||||||
|
OnRowValueChanged( ROW_COURSE_OPTIONS );
|
||||||
|
break;
|
||||||
|
case SM_BackFromCourseEntryOptionsMenu:
|
||||||
|
{
|
||||||
|
vector<Song*> vSongs = SONGMAN->GetAllSongs();
|
||||||
|
CStringArray vGroups;
|
||||||
|
SONGMAN->GetGroupNames( vGroups );
|
||||||
|
|
||||||
|
GetSelectedEntry()->pSong = vSongs[ ScreenMiniMenu::s_iLastAnswers[song] ];
|
||||||
|
GetSelectedEntry()->group_name = vGroups[ ScreenMiniMenu::s_iLastAnswers[group] ];
|
||||||
|
GetSelectedEntry()->difficulty = (Difficulty)ScreenMiniMenu::s_iLastAnswers[difficulty];
|
||||||
|
if( GetSelectedEntry()->difficulty == NUM_DIFFICULTIES )
|
||||||
|
GetSelectedEntry()->difficulty = DIFFICULTY_INVALID;
|
||||||
|
GetSelectedEntry()->low_meter = ScreenMiniMenu::s_iLastAnswers[low_meter];
|
||||||
|
if( GetSelectedEntry()->low_meter == 0 )
|
||||||
|
GetSelectedEntry()->low_meter = -1;
|
||||||
|
GetSelectedEntry()->high_meter = ScreenMiniMenu::s_iLastAnswers[high_meter];
|
||||||
|
if( GetSelectedEntry()->high_meter == 0 )
|
||||||
|
GetSelectedEntry()->high_meter = -1;
|
||||||
|
GetSelectedEntry()->players_index = ScreenMiniMenu::s_iLastAnswers[best_worst_value];
|
||||||
|
|
||||||
|
OnRowValueChanged( ROW_ENTRY_OPTIONS );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SM_RegainingFocus:
|
||||||
|
// coming back from PlayerOptions or SongOptions
|
||||||
|
GetSelectedEntry()->modifiers = GAMESTATE->m_PlayerOptions[PLAYER_1].GetString() + "," + GAMESTATE->m_SongOptions.GetString();
|
||||||
|
OnRowValueChanged( ROW_ENTRY_PLAYER_OPTIONS );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void EditCoursesMenu::ChangeToRow( Row newRow )
|
void EditCoursesMenu::ChangeToRow( Row newRow )
|
||||||
{
|
{
|
||||||
m_SelectedRow = newRow;
|
m_SelectedRow = newRow;
|
||||||
@@ -319,9 +498,11 @@ void EditCoursesMenu::OnRowValueChanged( Row row )
|
|||||||
case ROW_COURSE_OPTIONS:
|
case ROW_COURSE_OPTIONS:
|
||||||
m_textValue[ROW_COURSE_OPTIONS].SetText(
|
m_textValue[ROW_COURSE_OPTIONS].SetText(
|
||||||
ssprintf(
|
ssprintf(
|
||||||
"(START) %s, %s, %d lives",
|
"(START) %s, %s, ",
|
||||||
pCourse->m_bRepeat ? "repeat" : "no repeat",
|
pCourse->m_bRepeat ? "repeat" : "no repeat",
|
||||||
pCourse->m_bRandomize ? "randomize" : "no randomize",
|
pCourse->m_bRandomize ? "randomize" : "no randomize" ) +
|
||||||
|
ssprintf(
|
||||||
|
(pCourse->m_iLives==-1) ? "use bar life" : "%d lives",
|
||||||
pCourse->m_iLives ) );
|
pCourse->m_iLives ) );
|
||||||
// fall through
|
// fall through
|
||||||
case ROW_ACTION:
|
case ROW_ACTION:
|
||||||
@@ -329,59 +510,74 @@ void EditCoursesMenu::OnRowValueChanged( Row row )
|
|||||||
// fall through
|
// fall through
|
||||||
case ROW_ENTRY:
|
case ROW_ENTRY:
|
||||||
m_textValue[ROW_ENTRY].SetText( ssprintf("%d of %d",m_iSelection[ROW_ENTRY]+1, (int)GetSelectedCourse()->m_entries.size()) );
|
m_textValue[ROW_ENTRY].SetText( ssprintf("%d of %d",m_iSelection[ROW_ENTRY]+1, (int)GetSelectedCourse()->m_entries.size()) );
|
||||||
|
m_iSelection[ROW_ENTRY_TYPE] = pEntry->type;
|
||||||
// fall through
|
// fall through
|
||||||
case ROW_ENTRY_TYPE:
|
case ROW_ENTRY_TYPE:
|
||||||
m_textValue[ROW_ENTRY_TYPE].SetText( pEntry ? CourseEntryTypeToString(pEntry->type) : "(none)" );
|
m_textValue[ROW_ENTRY_TYPE].SetText( pEntry ? CourseEntryTypeToString(pEntry->type) : "(none)" );
|
||||||
// fall through
|
// fall through
|
||||||
case ROW_ENTRY_OPTIONS:
|
case ROW_ENTRY_OPTIONS:
|
||||||
{
|
{
|
||||||
CString s = "(START) ";
|
CStringArray as;
|
||||||
if( pEntry )
|
bool bShow[NUM_COURSE_OPTIONS_MENU_ROWS];
|
||||||
|
ZERO( bShow );
|
||||||
|
|
||||||
|
switch( pEntry->type )
|
||||||
{
|
{
|
||||||
switch( pEntry->type )
|
case COURSE_ENTRY_FIXED:
|
||||||
{
|
bShow[song] = true;
|
||||||
case COURSE_ENTRY_FIXED:
|
break;
|
||||||
s += pEntry->pSong ? "(missing song)" : pEntry->pSong->GetFullTranslitTitle();
|
case COURSE_ENTRY_RANDOM:
|
||||||
break;
|
bShow[difficulty] = true;
|
||||||
case COURSE_ENTRY_RANDOM:
|
bShow[low_meter] = true;
|
||||||
s += "any group";
|
bShow[high_meter] = true;
|
||||||
break;
|
break;
|
||||||
case COURSE_ENTRY_RANDOM_WITHIN_GROUP:
|
case COURSE_ENTRY_RANDOM_WITHIN_GROUP:
|
||||||
s += "group: " + pEntry->group_name;
|
bShow[group] = true;
|
||||||
break;
|
bShow[difficulty] = true;
|
||||||
case COURSE_ENTRY_BEST:
|
bShow[low_meter] = true;
|
||||||
s += ssprintf( "rank %d", pEntry->players_index+1 );
|
bShow[high_meter] = true;
|
||||||
break;
|
break;
|
||||||
case COURSE_ENTRY_WORST:
|
case COURSE_ENTRY_BEST:
|
||||||
s += ssprintf( "rank %d", pEntry->players_index+1 );
|
bShow[best_worst_value] = true;
|
||||||
break;
|
break;
|
||||||
default:
|
case COURSE_ENTRY_WORST:
|
||||||
ASSERT(0);
|
bShow[best_worst_value] = true;
|
||||||
break;
|
break;
|
||||||
}
|
default:
|
||||||
}
|
ASSERT(0);
|
||||||
else
|
break;
|
||||||
{
|
|
||||||
s = "n/a";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_textValue[ROW_ENTRY_OPTIONS].SetText( s );
|
if( bShow[song] )
|
||||||
|
as.push_back( pEntry->pSong ? "(missing song)" : pEntry->pSong->GetFullTranslitTitle() );
|
||||||
|
if( bShow[group] )
|
||||||
|
as.push_back( "group: " + (pEntry->group_name.empty() ? "(none)" : pEntry->group_name) );
|
||||||
|
if( bShow[difficulty] )
|
||||||
|
if( pEntry->difficulty != DIFFICULTY_INVALID )
|
||||||
|
as.push_back( DifficultyToString(pEntry->difficulty) );
|
||||||
|
if( bShow[low_meter] )
|
||||||
|
if( pEntry->low_meter > 0 )
|
||||||
|
as.push_back( ssprintf("low meter %d", pEntry->low_meter) );
|
||||||
|
if( bShow[high_meter] )
|
||||||
|
if( pEntry->high_meter > 0 )
|
||||||
|
as.push_back( ssprintf("high meter %d", pEntry->high_meter) );
|
||||||
|
if( bShow[best_worst_value] )
|
||||||
|
if( pEntry->players_index != -1 )
|
||||||
|
as.push_back( ssprintf("rank %d", pEntry->players_index+1) );
|
||||||
|
|
||||||
|
m_textValue[ROW_ENTRY_OPTIONS].SetText( "(START) " + join(", ",as) );
|
||||||
}
|
}
|
||||||
// fall through
|
// fall through
|
||||||
case ROW_ENTRY_PLAYER_OPTIONS:
|
case ROW_ENTRY_PLAYER_OPTIONS:
|
||||||
{
|
{
|
||||||
CString s = "(START) ";
|
CString s = "(START) ";
|
||||||
if( pEntry )
|
|
||||||
{
|
PlayerOptions po;
|
||||||
if( pEntry->modifiers.empty() )
|
po.FromString( pEntry->modifiers );
|
||||||
s += "(none)";
|
if( po.GetString().empty() )
|
||||||
else
|
s += "(none)";
|
||||||
s += pEntry->modifiers;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
s += po.GetString();
|
||||||
s = "n/a";
|
|
||||||
}
|
|
||||||
|
|
||||||
m_textValue[ROW_ENTRY_PLAYER_OPTIONS].SetText( s );
|
m_textValue[ROW_ENTRY_PLAYER_OPTIONS].SetText( s );
|
||||||
}
|
}
|
||||||
@@ -389,18 +585,14 @@ void EditCoursesMenu::OnRowValueChanged( Row row )
|
|||||||
case ROW_ENTRY_SONG_OPTIONS:
|
case ROW_ENTRY_SONG_OPTIONS:
|
||||||
{
|
{
|
||||||
CString s = "(START) ";
|
CString s = "(START) ";
|
||||||
if( pEntry )
|
|
||||||
{
|
SongOptions so;
|
||||||
if( pEntry->modifiers.empty() )
|
so.FromString( pEntry->modifiers );
|
||||||
s += "(none)";
|
if( so.GetString().empty() )
|
||||||
else
|
s += "(none)";
|
||||||
s += pEntry->modifiers;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
s += so.GetString();
|
||||||
s = "n/a";
|
|
||||||
}
|
|
||||||
|
|
||||||
m_textValue[ROW_ENTRY_SONG_OPTIONS].SetText( s );
|
m_textValue[ROW_ENTRY_SONG_OPTIONS].SetText( s );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
#include "DifficultyMeter.h"
|
#include "DifficultyMeter.h"
|
||||||
#include "RageSound.h"
|
#include "RageSound.h"
|
||||||
#include "Course.h"
|
#include "Course.h"
|
||||||
|
#include "ScreenMessage.h"
|
||||||
|
|
||||||
|
|
||||||
class EditCoursesMenu: public ActorFrame
|
class EditCoursesMenu: public ActorFrame
|
||||||
@@ -38,6 +39,7 @@ public:
|
|||||||
void Left();
|
void Left();
|
||||||
void Right();
|
void Right();
|
||||||
void Start();
|
void Start();
|
||||||
|
void HandleScreenMessage( const ScreenMessage SM );
|
||||||
|
|
||||||
enum Row
|
enum Row
|
||||||
{
|
{
|
||||||
@@ -110,6 +112,7 @@ private:
|
|||||||
RageSound m_soundChangeValue;
|
RageSound m_soundChangeValue;
|
||||||
RageSound m_soundStart;
|
RageSound m_soundStart;
|
||||||
RageSound m_soundInvalid;
|
RageSound m_soundInvalid;
|
||||||
|
RageSound m_soundSave;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
//
|
//
|
||||||
// Note definitions
|
// Note definitions
|
||||||
//
|
//
|
||||||
|
const int MAX_METER = 12;
|
||||||
|
|
||||||
enum RadarCategory // starting from 12-o'clock rotating clockwise
|
enum RadarCategory // starting from 12-o'clock rotating clockwise
|
||||||
{
|
{
|
||||||
RADAR_STREAM = 0,
|
RADAR_STREAM = 0,
|
||||||
|
|||||||
@@ -176,28 +176,7 @@ void PlayerOptions::FromString( CString sOptions )
|
|||||||
int ret = sscanf( matches[0], "%f", &m_fScrollSpeed );
|
int ret = sscanf( matches[0], "%f", &m_fScrollSpeed );
|
||||||
ASSERT( ret == 1 );
|
ASSERT( ret == 1 );
|
||||||
}
|
}
|
||||||
/* This has two problems: it misparses .75 (anything where the fractional
|
|
||||||
* part is >= 10), and sscanf doesn't actually care about input after the
|
|
||||||
* last placeholder: "5" will match, the "x" won't be required. */
|
|
||||||
/*
|
|
||||||
|
|
||||||
int i1, i2;
|
|
||||||
if( sscanf( sBit, "%d.%dx", &i1, &i2 ) == 2 )
|
|
||||||
{
|
|
||||||
m_bTimeSpacing = false;
|
|
||||||
m_fScrollSpeed = i1 + (i2 / 10.f);
|
|
||||||
}
|
|
||||||
else if( sscanf( sBit, "%dx", &i1 ) == 1 )
|
|
||||||
{
|
|
||||||
m_bTimeSpacing = false;
|
|
||||||
m_fScrollSpeed = i1;
|
|
||||||
}
|
|
||||||
else if( sscanf( sBit, ".%dx", &i1 ) == 1 )
|
|
||||||
{
|
|
||||||
m_bTimeSpacing = false;
|
|
||||||
m_fScrollSpeed = i1 / 10.f;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
else if( sscanf( sBit, "C%d", &i1 ) == 1 )
|
else if( sscanf( sBit, "C%d", &i1 ) == 1 )
|
||||||
{
|
{
|
||||||
m_bTimeSpacing = true;
|
m_bTimeSpacing = true;
|
||||||
|
|||||||
@@ -79,6 +79,8 @@ void ScreenEditCoursesMenu::Input( const DeviceInput& DeviceI, const InputEventT
|
|||||||
|
|
||||||
void ScreenEditCoursesMenu::HandleScreenMessage( const ScreenMessage SM )
|
void ScreenEditCoursesMenu::HandleScreenMessage( const ScreenMessage SM )
|
||||||
{
|
{
|
||||||
|
m_Selector.HandleScreenMessage( SM );
|
||||||
|
|
||||||
switch( SM )
|
switch( SM )
|
||||||
{
|
{
|
||||||
case SM_GoToPrevScreen:
|
case SM_GoToPrevScreen:
|
||||||
|
|||||||
@@ -346,7 +346,11 @@ void ScreenPlayerOptions::ExportOptions()
|
|||||||
//
|
//
|
||||||
// apply difficulty selection
|
// apply difficulty selection
|
||||||
//
|
//
|
||||||
if( GAMESTATE->m_pCurCourse ) // playing a course
|
if( GAMESTATE->m_bEditing )
|
||||||
|
{
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
|
else if( GAMESTATE->m_pCurCourse ) // playing a course
|
||||||
{
|
{
|
||||||
if( m_iSelectedOption[p][PO_STEP] == 1 )
|
if( m_iSelectedOption[p][PO_STEP] == 1 )
|
||||||
{
|
{
|
||||||
@@ -387,14 +391,19 @@ void ScreenPlayerOptions::GoToPrevState()
|
|||||||
|
|
||||||
void ScreenPlayerOptions::GoToNextState()
|
void ScreenPlayerOptions::GoToNextState()
|
||||||
{
|
{
|
||||||
GAMESTATE->AdjustFailType();
|
|
||||||
|
|
||||||
if( GAMESTATE->m_bEditing )
|
if( GAMESTATE->m_bEditing )
|
||||||
|
{
|
||||||
SCREENMAN->PopTopScreen();
|
SCREENMAN->PopTopScreen();
|
||||||
else if( m_bGoToOptions )
|
}
|
||||||
SCREENMAN->SetNewScreen( NEXT_SCREEN(GAMESTATE->m_PlayMode) );
|
|
||||||
else
|
else
|
||||||
SCREENMAN->SetNewScreen( ScreenSongOptions::GetNextScreen() );
|
{
|
||||||
|
GAMESTATE->AdjustFailType();
|
||||||
|
|
||||||
|
if( m_bGoToOptions )
|
||||||
|
SCREENMAN->SetNewScreen( NEXT_SCREEN(GAMESTATE->m_PlayMode) );
|
||||||
|
else
|
||||||
|
SCREENMAN->SetNewScreen( ScreenSongOptions::GetNextScreen() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -85,8 +85,11 @@ void ScreenSongOptions::ImportOptions()
|
|||||||
|
|
||||||
m_iSelectedOption[0][SO_RATE] = 7; // in case we don't match below
|
m_iSelectedOption[0][SO_RATE] = 7; // in case we don't match below
|
||||||
for( unsigned i=0; i<g_SongOptionsLines[SO_RATE].choices.size(); i++ )
|
for( unsigned i=0; i<g_SongOptionsLines[SO_RATE].choices.size(); i++ )
|
||||||
if( so.m_fMusicRate == atof(g_SongOptionsLines[SO_RATE].choices[i]) )
|
{
|
||||||
|
float fThisRate = atof(g_SongOptionsLines[SO_RATE].choices[i]);
|
||||||
|
if( fThisRate == so.m_fMusicRate )
|
||||||
m_iSelectedOption[0][SO_RATE] = i;
|
m_iSelectedOption[0][SO_RATE] = i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenSongOptions::ExportOptions()
|
void ScreenSongOptions::ExportOptions()
|
||||||
|
|||||||
@@ -72,19 +72,18 @@ void SongOptions::FromString( CString sOptions )
|
|||||||
TrimLeft(sBit);
|
TrimLeft(sBit);
|
||||||
TrimRight(sBit);
|
TrimRight(sBit);
|
||||||
|
|
||||||
|
Regex mult("^([0-9]+(\\.[0-9]+)?)xmusic$");
|
||||||
|
vector<CString> matches;
|
||||||
|
if( mult.Compare(sBit, matches) )
|
||||||
|
{
|
||||||
|
int ret = sscanf( matches[0], "%f", &m_fMusicRate );
|
||||||
|
ASSERT( ret == 1 );
|
||||||
|
}
|
||||||
|
|
||||||
if( sBit == "norecover" ) m_DrainType = DRAIN_NO_RECOVER;
|
if( sBit == "norecover" ) m_DrainType = DRAIN_NO_RECOVER;
|
||||||
else if( sBit == "suddendeath" ) m_DrainType = DRAIN_SUDDEN_DEATH;
|
else if( sBit == "suddendeath" ) m_DrainType = DRAIN_SUDDEN_DEATH;
|
||||||
else if( sBit == "power-drop" ) m_DrainType = DRAIN_NO_RECOVER;
|
else if( sBit == "power-drop" ) m_DrainType = DRAIN_NO_RECOVER;
|
||||||
else if( sBit == "death" ) m_DrainType = DRAIN_SUDDEN_DEATH;
|
else if( sBit == "death" ) m_DrainType = DRAIN_SUDDEN_DEATH;
|
||||||
else if( sBit == "0.7xmusic" ) m_fMusicRate = 0.7f;
|
|
||||||
else if( sBit == "0.8xmusic" ) m_fMusicRate = 0.8f;
|
|
||||||
else if( sBit == "0.9xmusic" ) m_fMusicRate = 0.9f;
|
|
||||||
else if( sBit == "1.0xmusic" ) m_fMusicRate = 1.0f;
|
|
||||||
else if( sBit == "1.1xmusic" ) m_fMusicRate = 1.1f;
|
|
||||||
else if( sBit == "1.2xmusic" ) m_fMusicRate = 1.2f;
|
|
||||||
else if( sBit == "1.3xmusic" ) m_fMusicRate = 1.3f;
|
|
||||||
else if( sBit == "1.4xmusic" ) m_fMusicRate = 1.4f;
|
|
||||||
else if( sBit == "1.5xmusic" ) m_fMusicRate = 1.5f;
|
|
||||||
else if( sBit == "failendofsong" ) m_FailType = FAIL_END_OF_SONG;
|
else if( sBit == "failendofsong" ) m_FailType = FAIL_END_OF_SONG;
|
||||||
else if( sBit == "failoff" ) m_FailType = FAIL_OFF;
|
else if( sBit == "failoff" ) m_FailType = FAIL_OFF;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user