EditMenu: remove Autogen and consolidate Blank/Copy into Create
This commit is contained in:
@@ -418,15 +418,9 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
|
|||||||
m_Actions.push_back( EDIT_MENU_ACTION_EDIT );
|
m_Actions.push_back( EDIT_MENU_ACTION_EDIT );
|
||||||
m_Actions.push_back( EDIT_MENU_ACTION_DELETE );
|
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
|
else
|
||||||
{
|
{
|
||||||
m_Actions.push_back( EDIT_MENU_ACTION_BLANK );
|
m_Actions.push_back( EDIT_MENU_ACTION_CREATE );
|
||||||
}
|
}
|
||||||
m_iSelection[ROW_ACTION] = 0;
|
m_iSelection[ROW_ACTION] = 0;
|
||||||
// fall through
|
// fall through
|
||||||
|
|||||||
@@ -297,9 +297,7 @@ REGISTER_WITH_LUA_FUNCTION( LuaGoalType );
|
|||||||
static const CString EditMenuActionNames[NUM_EDIT_MENU_ACTIONS] = {
|
static const CString EditMenuActionNames[NUM_EDIT_MENU_ACTIONS] = {
|
||||||
"Edit",
|
"Edit",
|
||||||
"Delete",
|
"Delete",
|
||||||
"Copy",
|
"Create",
|
||||||
"Autogen",
|
|
||||||
"Blank"
|
|
||||||
};
|
};
|
||||||
XToString( EditMenuAction, NUM_EDIT_MENU_ACTIONS );
|
XToString( EditMenuAction, NUM_EDIT_MENU_ACTIONS );
|
||||||
XToThemedString( EditMenuAction, NUM_EDIT_MENU_ACTIONS );
|
XToThemedString( EditMenuAction, NUM_EDIT_MENU_ACTIONS );
|
||||||
|
|||||||
@@ -373,9 +373,7 @@ enum EditMenuAction
|
|||||||
{
|
{
|
||||||
EDIT_MENU_ACTION_EDIT,
|
EDIT_MENU_ACTION_EDIT,
|
||||||
EDIT_MENU_ACTION_DELETE,
|
EDIT_MENU_ACTION_DELETE,
|
||||||
EDIT_MENU_ACTION_COPY,
|
EDIT_MENU_ACTION_CREATE,
|
||||||
EDIT_MENU_ACTION_AUTOGEN,
|
|
||||||
EDIT_MENU_ACTION_BLANK,
|
|
||||||
NUM_EDIT_MENU_ACTIONS
|
NUM_EDIT_MENU_ACTIONS
|
||||||
};
|
};
|
||||||
#define FOREACH_EditMenuAction( ema ) FOREACH_ENUM( EditMenuAction, NUM_EDIT_MENU_ACTIONS, ema )
|
#define FOREACH_EditMenuAction( ema ) FOREACH_ENUM( EditMenuAction, NUM_EDIT_MENU_ACTIONS, ema )
|
||||||
|
|||||||
@@ -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 );
|
SCREENMAN->Prompt( SM_RefreshSelector, "These steps will be lost permanently.\n\nContinue with delete?", PROMPT_YES_NO, ANSWER_NO, DeleteCurSteps );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EDIT_MENU_ACTION_COPY:
|
case EDIT_MENU_ACTION_CREATE:
|
||||||
case EDIT_MENU_ACTION_AUTOGEN:
|
|
||||||
case EDIT_MENU_ACTION_BLANK:
|
|
||||||
ASSERT( !pSteps );
|
ASSERT( !pSteps );
|
||||||
{
|
{
|
||||||
// Yuck. Doing the memory allocation doesn't seem right since
|
// Yuck. Doing the memory allocation doesn't seem right since
|
||||||
// Song allocates all of the other Steps.
|
// Song allocates all of the other Steps.
|
||||||
pSteps = new Steps;
|
pSteps = new Steps;
|
||||||
CString sEditName;
|
CString sEditName;
|
||||||
switch( action )
|
if( pSourceSteps )
|
||||||
{
|
{
|
||||||
case EDIT_MENU_ACTION_COPY:
|
|
||||||
ASSERT( pSourceSteps );
|
|
||||||
pSteps->CopyFrom( pSourceSteps, st );
|
pSteps->CopyFrom( pSourceSteps, st );
|
||||||
sEditName = GetCopyDescription(pSourceSteps);
|
sEditName = GetCopyDescription(pSourceSteps);
|
||||||
break;
|
}
|
||||||
case EDIT_MENU_ACTION_AUTOGEN:
|
else
|
||||||
ASSERT( pSourceSteps );
|
{
|
||||||
pSteps->AutogenFrom( pSourceSteps, st );
|
|
||||||
pSteps->DeAutogen();
|
|
||||||
sEditName = GetCopyDescription(pSourceSteps);
|
|
||||||
break;
|
|
||||||
case EDIT_MENU_ACTION_BLANK:
|
|
||||||
pSteps->CreateBlank( st );
|
pSteps->CreateBlank( st );
|
||||||
pSteps->SetMeter( 1 );
|
pSteps->SetMeter( 1 );
|
||||||
sEditName = "Blank";
|
sEditName = "Blank";
|
||||||
break;
|
|
||||||
default:
|
|
||||||
ASSERT(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pSteps->SetDifficulty( dc ); // override difficulty with the user's choice
|
pSteps->SetDifficulty( dc ); // override difficulty with the user's choice
|
||||||
pSong->MakeUniqueEditDescription( st, sEditName );
|
pSong->MakeUniqueEditDescription( st, sEditName );
|
||||||
pSteps->SetDescription( sEditName );
|
pSteps->SetDescription( sEditName );
|
||||||
@@ -279,9 +268,7 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
|
|||||||
switch( action )
|
switch( action )
|
||||||
{
|
{
|
||||||
case EDIT_MENU_ACTION_EDIT:
|
case EDIT_MENU_ACTION_EDIT:
|
||||||
case EDIT_MENU_ACTION_COPY:
|
case EDIT_MENU_ACTION_CREATE:
|
||||||
case EDIT_MENU_ACTION_AUTOGEN:
|
|
||||||
case EDIT_MENU_ACTION_BLANK:
|
|
||||||
{
|
{
|
||||||
// Prepare prepare for ScreenEdit
|
// Prepare prepare for ScreenEdit
|
||||||
ASSERT( pSteps );
|
ASSERT( pSteps );
|
||||||
|
|||||||
Reference in New Issue
Block a user