[editorKeysounds] Can add KS, but...
1) A physical note is shown in the editor. We do need a separate graphic for auto keysounds. 2) The keysound only plays if you "hit" the note. Auto keysound notes should play regardless of hit or miss. Time to make this branch public. Anyone want to help tackle this?
This commit is contained in:
@@ -1373,6 +1373,7 @@ Routine Player=Player
|
||||
Track %d=Track %d
|
||||
None=None
|
||||
New Sound=New Sound
|
||||
Enter New Keysound File=Enter the name of the new keysound file.\nPlease make sure it is spelt right.
|
||||
|
||||
[ScreenEditMenu]
|
||||
HeaderText=Edit Song/Steps
|
||||
|
||||
+34
-14
@@ -75,6 +75,7 @@ AutoScreenMessage( SM_BackFromInsertCourseAttack );
|
||||
AutoScreenMessage( SM_BackFromInsertCourseAttackPlayerOptions );
|
||||
AutoScreenMessage( SM_BackFromCourseModeMenu );
|
||||
AutoScreenMessage( SM_BackFromKeysoundTrack );
|
||||
AutoScreenMessage( SM_BackFromNewKeysound );
|
||||
AutoScreenMessage( SM_DoRevertToLastSave );
|
||||
AutoScreenMessage( SM_DoRevertFromDisk );
|
||||
AutoScreenMessage( SM_BackFromTimingDataInformation );
|
||||
@@ -2934,6 +2935,8 @@ void ScreenEdit::ScrollTo( float fDestinationBeat )
|
||||
m_soundChangeLine.Play();
|
||||
}
|
||||
|
||||
static LocalizedString NEW_KEYSOUND_FILE("ScreenEdit", "Enter New Keysound File");
|
||||
|
||||
void ScreenEdit::HandleMessage( const Message &msg )
|
||||
{
|
||||
if( msg == "Judgment" )
|
||||
@@ -3188,31 +3191,33 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
unsigned int sound = ScreenMiniMenu::s_viLastAnswers[track];
|
||||
vector<RString> &kses = m_pSong->m_vsKeysoundFile;
|
||||
if (sound == kses.size())
|
||||
{
|
||||
// create a new sound (filename), point it.
|
||||
// if it's empty, make it an auto keysound.
|
||||
ScreenTextEntry::TextEntry(SM_BackFromNewKeysound, NEW_KEYSOUND_FILE, "", 64);
|
||||
return;
|
||||
}
|
||||
const TapNote &oldNote = m_NoteDataEdit.GetTapNote(track, row);
|
||||
TapNote newNote = oldNote;
|
||||
TapNote newNote = oldNote; // need to lose the const. not feeling like casting.
|
||||
if (sound < kses.size())
|
||||
{
|
||||
// set note at this row to use this keysound file.
|
||||
// if it's empty, make it an auto keysound.
|
||||
newNote.iKeysoundIndex = sound;
|
||||
}
|
||||
else if (sound == kses.size())
|
||||
{
|
||||
// create a new sound (filename), point it.
|
||||
// if it's empty, make it an auto keysound.
|
||||
if (newNote.type == TapNote::empty)
|
||||
{
|
||||
newNote.type = TapNote::autoKeysound; // keysounds need something non empty.
|
||||
}
|
||||
}
|
||||
else // sound > kses.size()
|
||||
{
|
||||
// remove the sound. if it's an auto keysound, make it empty.
|
||||
newNote.iKeysoundIndex = -1;
|
||||
}
|
||||
if (newNote.type == TapNote::autoKeysound && newNote.iKeysoundIndex == -1)
|
||||
{
|
||||
newNote.type = TapNote::empty; // autoKeysound with no sound is pointless.
|
||||
}
|
||||
else if (newNote.type == TapNote::empty && newNote.iKeysoundIndex != -1)
|
||||
{
|
||||
newNote.type = TapNote::autoKeysound; // keysounds need something non empty.
|
||||
if (newNote.type == TapNote::autoKeysound)
|
||||
{
|
||||
newNote.type = TapNote::empty; // autoKeysound with no sound is pointless.
|
||||
}
|
||||
}
|
||||
m_NoteDataEdit.SetTapNote(track, row, newNote);
|
||||
}
|
||||
@@ -3222,6 +3227,21 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
|
||||
}
|
||||
SetDirty(true);
|
||||
}
|
||||
else if (SM == SM_BackFromNewKeysound && !ScreenTextEntry::s_bCancelledLast)
|
||||
{
|
||||
RString answer = ScreenTextEntry::s_sLastAnswer;
|
||||
const int track = ScreenMiniMenu::s_iLastRowCode; // still keeps the same value.
|
||||
const int row = this->GetRow();
|
||||
const TapNote &oldNote = m_NoteDataEdit.GetTapNote(track, row);
|
||||
TapNote newNote = oldNote; // need to lose the const. not feeling like casting.
|
||||
vector<RString> &kses = m_pSong->m_vsKeysoundFile;
|
||||
newNote.iKeysoundIndex = kses.size();
|
||||
kses.push_back(answer);
|
||||
if (newNote.type == TapNote::empty)
|
||||
newNote.type = TapNote::autoKeysound; // keysounds need something non empty.
|
||||
m_NoteDataEdit.SetTapNote(track, row, newNote);
|
||||
SetDirty(true);
|
||||
}
|
||||
else if( SM == SM_BackFromOptions )
|
||||
{
|
||||
// The options may have changed the note skin.
|
||||
|
||||
Reference in New Issue
Block a user