Add prompt for clearing an area in Edit Mode. Updated changelog.

This commit is contained in:
Kyzentun
2015-03-08 00:56:29 -07:00
parent 976f773f7c
commit d3367d6a16
10 changed files with 86 additions and 5 deletions
+15
View File
@@ -500,6 +500,21 @@ int NoteData::GetNumTapNotes( int iStartIndex, int iEndIndex ) const
return iNumNotes;
}
int NoteData::GetNumTapNotesNoTiming( int iStartIndex, int iEndIndex ) const
{
int iNumNotes = 0;
for( int t=0; t<GetNumTracks(); t++ )
{
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( *this, t, r, iStartIndex, iEndIndex )
{
if(GetTapNote(t, r).type != TapNoteType_Empty)
{ iNumNotes++; }
}
}
return iNumNotes;
}
int NoteData::GetNumTapNotesInRow( int iRow ) const
{
int iNumNotes = 0;
+1
View File
@@ -297,6 +297,7 @@ public:
float GetFirstBeat() const { return NoteRowToBeat( GetFirstRow() ); }
float GetLastBeat() const { return NoteRowToBeat( GetLastRow() ); }
int GetNumTapNotes( int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ) const;
int GetNumTapNotesNoTiming( int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ) const;
int GetNumTapNotesInRow( int iRow ) const;
int GetNumMines( int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ) const;
int GetNumRowsWithTap( int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ) const;
+1
View File
@@ -259,6 +259,7 @@ PrefsManager::PrefsManager() :
m_fPadStickSeconds ( "PadStickSeconds", 0 ),
m_EditRecordModeLeadIn("EditRecordModeLeadIn", 1.0f),
m_EditClearPromptThreshold("EditClearPromptThreshold", 50),
m_bForceMipMaps ( "ForceMipMaps", false ),
m_bTrilinearFiltering ( "TrilinearFiltering", false ),
m_bAnisotropicFiltering ( "AnisotropicFiltering", false ),
+2
View File
@@ -255,6 +255,8 @@ public:
// Lead in time before recording starts in edit mode.
Preference<float> m_EditRecordModeLeadIn;
// User is prompted on clearing an area with more than this note count.
Preference<int> m_EditClearPromptThreshold;
// Useful for non 4:3 displays and resolutions < 640x480 where texels don't
// map directly to pixels.
+21 -1
View File
@@ -90,6 +90,7 @@ AutoScreenMessage( SM_BackFromKeysoundTrack );
AutoScreenMessage( SM_BackFromNewKeysound );
AutoScreenMessage( SM_DoRevertToLastSave );
AutoScreenMessage( SM_DoRevertFromDisk );
AutoScreenMessage( SM_ConfirmClearArea );
AutoScreenMessage( SM_BackFromTimingDataInformation );
AutoScreenMessage( SM_BackFromDifficultyMeterChange );
AutoScreenMessage( SM_BackFromBeat0Change );
@@ -4131,6 +4132,14 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
SetDirty( false );
}
}
else if(SM == SM_ConfirmClearArea)
{
if(ScreenPrompt::s_LastAnswer == ANSWER_YES)
{
m_NoteDataEdit.ClearRange(
m_NoteFieldEdit.m_iBeginMarker, m_NoteFieldEdit.m_iEndMarker);
}
}
else if( SM == SM_DoEraseStepTiming )
{
if( ScreenPrompt::s_LastAnswer == ANSWER_YES )
@@ -4764,6 +4773,7 @@ static LocalizedString ENTER_ARBITRARY_MAPPING( "ScreenEdit", "Enter the new tra
static LocalizedString TOO_MANY_TRACKS("ScreenEdit", "Too many tracks specified.");
static LocalizedString NOT_A_TRACK("ScreenEdit", "'%s' is not a track id.");
static LocalizedString OUT_OF_RANGE_ID("ScreenEdit", "Entry %d, '%d', is out of range 1 to %d.");
static LocalizedString CONFIRM_CLEAR("ScreenEdit", "Are you sure you want to clear %d notes?");
static bool ConvertMappingInputToMapping(RString const& mapstr, int* mapping, RString& error)
{
@@ -4875,7 +4885,17 @@ void ScreenEdit::HandleAlterMenuChoice(AlterMenuChoice c, const vector<int> &iAn
break;
case clear:
{
m_NoteDataEdit.ClearRange( m_NoteFieldEdit.m_iBeginMarker, m_NoteFieldEdit.m_iEndMarker );
int note_count= m_NoteDataEdit.GetNumTapNotesNoTiming(
m_NoteFieldEdit.m_iBeginMarker, m_NoteFieldEdit.m_iEndMarker);
if(note_count >= PREFSMAN->m_EditClearPromptThreshold)
{
ScreenPrompt::Prompt(SM_ConfirmClearArea, ssprintf(CONFIRM_CLEAR.GetValue(), note_count), PROMPT_YES_NO);
}
else
{
m_NoteDataEdit.ClearRange(
m_NoteFieldEdit.m_iBeginMarker, m_NoteFieldEdit.m_iEndMarker);
}
}
break;
case quantize:
+7
View File
@@ -690,6 +690,12 @@ static void EditRecordModeLeadIn(int &sel, bool to_sel, const ConfOption* conf_o
MoveMap(sel, conf_option, to_sel, mapping, ARRAYLEN(mapping));
}
static void EditClearPromptThreshold(int& sel, bool to_sel, const ConfOption* conf_option)
{
int mapping[]= {-1, 10, 50, 100, 1000, 1000000};
MoveMap(sel, conf_option, to_sel, mapping, ARRAYLEN(mapping));
}
static vector<ConfOption> g_ConfOptions;
static void InitializeConfOptions()
{
@@ -743,6 +749,7 @@ static void InitializeConfOptions()
}
ADD(c);
}
ADD(ConfOption("EditClearPromptThreshold", EditClearPromptThreshold, "-1", "10", "50", "100", "1000", "1000000"));
// Background options
ADD( ConfOption( "RandomBackgroundMode", MovePref<RandomBackgroundMode>, "Off","Animations","Random Movies" ) );