EditMenu: remove Autogen and consolidate Blank/Copy into Create

This commit is contained in:
Chris Danford
2005-03-25 09:49:34 +00:00
parent 441e86ac24
commit b684b3dd88
4 changed files with 15 additions and 38 deletions
+1 -7
View File
@@ -418,15 +418,9 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
m_Actions.push_back( EDIT_MENU_ACTION_EDIT );
m_Actions.push_back( EDIT_MENU_ACTION_DELETE );
}
else if( GetSelectedSourceSteps() )
{
m_Actions.push_back( EDIT_MENU_ACTION_COPY );
m_Actions.push_back( EDIT_MENU_ACTION_AUTOGEN );
m_Actions.push_back( EDIT_MENU_ACTION_BLANK );
}
else
{
m_Actions.push_back( EDIT_MENU_ACTION_BLANK );
m_Actions.push_back( EDIT_MENU_ACTION_CREATE );
}
m_iSelection[ROW_ACTION] = 0;
// fall through
+1 -3
View File
@@ -297,9 +297,7 @@ REGISTER_WITH_LUA_FUNCTION( LuaGoalType );
static const CString EditMenuActionNames[NUM_EDIT_MENU_ACTIONS] = {
"Edit",
"Delete",
"Copy",
"Autogen",
"Blank"
"Create",
};
XToString( EditMenuAction, NUM_EDIT_MENU_ACTIONS );
XToThemedString( EditMenuAction, NUM_EDIT_MENU_ACTIONS );
+1 -3
View File
@@ -373,9 +373,7 @@ enum EditMenuAction
{
EDIT_MENU_ACTION_EDIT,
EDIT_MENU_ACTION_DELETE,
EDIT_MENU_ACTION_COPY,
EDIT_MENU_ACTION_AUTOGEN,
EDIT_MENU_ACTION_BLANK,
EDIT_MENU_ACTION_CREATE,
NUM_EDIT_MENU_ACTIONS
};
#define FOREACH_EditMenuAction( ema ) FOREACH_ENUM( EditMenuAction, NUM_EDIT_MENU_ACTIONS, ema )
+12 -25
View File
@@ -227,36 +227,25 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
SCREENMAN->Prompt( SM_RefreshSelector, "These steps will be lost permanently.\n\nContinue with delete?", PROMPT_YES_NO, ANSWER_NO, DeleteCurSteps );
}
break;
case EDIT_MENU_ACTION_COPY:
case EDIT_MENU_ACTION_AUTOGEN:
case EDIT_MENU_ACTION_BLANK:
case EDIT_MENU_ACTION_CREATE:
ASSERT( !pSteps );
{
// Yuck. Doing the memory allocation doesn't seem right since
// Song allocates all of the other Steps.
pSteps = new Steps;
CString sEditName;
switch( action )
if( pSourceSteps )
{
case EDIT_MENU_ACTION_COPY:
ASSERT( pSourceSteps );
pSteps->CopyFrom( pSourceSteps, st );
sEditName = GetCopyDescription(pSourceSteps);
break;
case EDIT_MENU_ACTION_AUTOGEN:
ASSERT( pSourceSteps );
pSteps->AutogenFrom( pSourceSteps, st );
pSteps->DeAutogen();
sEditName = GetCopyDescription(pSourceSteps);
break;
case EDIT_MENU_ACTION_BLANK:
pSteps->CreateBlank( st );
pSteps->SetMeter( 1 );
sEditName = "Blank";
break;
default:
ASSERT(0);
pSteps->CopyFrom( pSourceSteps, st );
sEditName = GetCopyDescription(pSourceSteps);
}
else
{
pSteps->CreateBlank( st );
pSteps->SetMeter( 1 );
sEditName = "Blank";
}
pSteps->SetDifficulty( dc ); // override difficulty with the user's choice
pSong->MakeUniqueEditDescription( st, sEditName );
pSteps->SetDescription( sEditName );
@@ -279,9 +268,7 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
switch( action )
{
case EDIT_MENU_ACTION_EDIT:
case EDIT_MENU_ACTION_COPY:
case EDIT_MENU_ACTION_AUTOGEN:
case EDIT_MENU_ACTION_BLANK:
case EDIT_MENU_ACTION_CREATE:
{
// Prepare prepare for ScreenEdit
ASSERT( pSteps );