[editorKeysounds] Modifying KS works.
This commit is contained in:
+12
-7
@@ -3188,10 +3188,13 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
{
|
{
|
||||||
unsigned int sound = ScreenMiniMenu::s_viLastAnswers[track];
|
unsigned int sound = ScreenMiniMenu::s_viLastAnswers[track];
|
||||||
vector<RString> &kses = m_pSong->m_vsKeysoundFile;
|
vector<RString> &kses = m_pSong->m_vsKeysoundFile;
|
||||||
|
const TapNote &oldNote = m_NoteDataEdit.GetTapNote(track, row);
|
||||||
|
TapNote newNote = oldNote;
|
||||||
if (sound < kses.size())
|
if (sound < kses.size())
|
||||||
{
|
{
|
||||||
// set note at this row to use this keysound file.
|
// set note at this row to use this keysound file.
|
||||||
// if it's empty, make it an auto keysound.
|
// if it's empty, make it an auto keysound.
|
||||||
|
newNote.iKeysoundIndex = sound;
|
||||||
}
|
}
|
||||||
else if (sound == kses.size())
|
else if (sound == kses.size())
|
||||||
{
|
{
|
||||||
@@ -3201,15 +3204,17 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
else // sound > kses.size()
|
else // sound > kses.size()
|
||||||
{
|
{
|
||||||
// remove the sound. if it's an auto keysound, make it empty.
|
// remove the sound. if it's an auto keysound, make it empty.
|
||||||
const TapNote &oldNote = m_NoteDataEdit.GetTapNote(track, row);
|
|
||||||
TapNote newNote = oldNote;
|
|
||||||
newNote.iKeysoundIndex = -1;
|
newNote.iKeysoundIndex = -1;
|
||||||
if (newNote.type == TapNote::autoKeysound)
|
|
||||||
{
|
|
||||||
newNote.type = TapNote::empty; // autoKeysound with no sound is pointless.
|
|
||||||
}
|
|
||||||
m_NoteDataEdit.SetTapNote(track, row, newNote);
|
|
||||||
}
|
}
|
||||||
|
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.
|
||||||
|
}
|
||||||
|
m_NoteDataEdit.SetTapNote(track, row, newNote);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user