sm124futures: Working tap note cycling.

The code in NoteTypes could use a review:
perhaps the Type definition should be taken out of
the struct to try to make it more consistent?
This commit is contained in:
Jason Felds
2011-03-13 22:24:43 -04:00
parent 8d42e1827c
commit f951a87068
3 changed files with 58 additions and 24 deletions
+22 -3
View File
@@ -204,9 +204,28 @@ extern TapNote TAP_ORIGINAL_FAKE; // 'F'
extern TapNote TAP_ADDITION_TAP;
extern TapNote TAP_ADDITION_MINE;
const RString& TapNoteTypeToString( TapNote::Type tn );
const RString& TapNoteTypeToLocalizedString( TapNote::Type tn );
LuaDeclareType( TapNote::Type );
/**
* @brief Retrieve the string representing the TapNote Type.
*
* TODO: Find a way to standardize this with the other enum string calls.
* @param tn the TapNote's type.
* @return the intended string. */
inline const RString TapNoteTypeToString( TapNote::Type tn )
{
switch( tn )
{
case TapNote::empty: return RString("empty");
case TapNote::tap: return RString("tap");
case TapNote::hold_head: return RString("hold_head");
case TapNote::hold_tail: return RString("hold_tail");
case TapNote::mine: return RString("mine");
case TapNote::lift: return RString("lift");
case TapNote::attack: return RString("attack");
case TapNote::autoKeysound: return RString("autoKeysound");
case TapNote::fake: return RString("fake");
default: return RString();
}
}
/**
* @brief The number of tracks allowed.
+32 -21
View File
@@ -16,6 +16,7 @@
#include "LocalizedString.h"
#include "NoteDataUtil.h"
#include "NoteSkinManager.h"
#include "NoteTypes.h"
#include "NotesWriterSM.h"
#include "PrefsManager.h"
#include "RageSoundManager.h"
@@ -733,6 +734,8 @@ void ScreenEdit::Init()
m_pSteps = GAMESTATE->m_pCurSteps[PLAYER_1];
m_bReturnToRecordMenuAfterPlay = false;
m_fBeatToReturnTo = 0;
m_selectedTap = TAP_ORIGINAL_TAP;
GAMESTATE->m_bGameplayLeadIn.Set( true );
GAMESTATE->m_EditMode = EDIT_MODE.GetValue();
@@ -1027,6 +1030,7 @@ static LocalizedString DESCRIPTION("ScreenEdit", "Description");
static LocalizedString CHART_STYLE("ScreenEdit", "Chart Style");
static LocalizedString MAIN_TITLE("ScreenEdit", "Main title");
static LocalizedString SUBTITLE("ScreenEdit", "Subtitle");
static LocalizedString TAP_NOTE_TYPE("ScreenEdit", "Tap Note");
static LocalizedString TAP_STEPS("ScreenEdit", "Tap Steps");
static LocalizedString JUMPS("ScreenEdit", "Jumps");
static LocalizedString HANDS("ScreenEdit", "Hands");
@@ -1051,6 +1055,7 @@ static ThemeMetric<RString> DESCRIPTION_FORMAT("ScreenEdit", "DescriptionFormat"
static ThemeMetric<RString> CHART_STYLE_FORMAT("ScreenEdit", "ChartStyleFormat");
static ThemeMetric<RString> MAIN_TITLE_FORMAT("ScreenEdit", "MainTitleFormat");
static ThemeMetric<RString> SUBTITLE_FORMAT("ScreenEdit", "SubtitleFormat");
static ThemeMetric<RString> TAP_NOTE_TYPE_FORMAT("ScreenEdit", "TapNoteTypeFormat");
static ThemeMetric<RString> NUM_STEPS_FORMAT("ScreenEdit", "NumStepsFormat");
static ThemeMetric<RString> NUM_JUMPS_FORMAT("ScreenEdit", "NumJumpsFormat");
static ThemeMetric<RString> NUM_HOLDS_FORMAT("ScreenEdit", "NumHoldsFormat");
@@ -1119,6 +1124,7 @@ void ScreenEdit::UpdateTextInfo()
sText += ssprintf( MAIN_TITLE_FORMAT.GetValue(), MAIN_TITLE.GetValue().c_str(), m_pSong->m_sMainTitle.c_str() );
if( m_pSong->m_sSubTitle.size() )
sText += ssprintf( SUBTITLE_FORMAT.GetValue(), SUBTITLE.GetValue().c_str(), m_pSong->m_sSubTitle.c_str() );
sText += ssprintf( TAP_NOTE_TYPE_FORMAT.GetValue(), TAP_NOTE_TYPE.GetValue().c_str(), TapNoteTypeToString( m_selectedTap.type ).c_str() );
break;
}
sText += ssprintf( NUM_STEPS_FORMAT.GetValue(), TAP_STEPS.GetValue().c_str(), m_NoteDataEdit.GetNumTapNotes() );
@@ -1299,43 +1305,48 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
m_NoteDataEdit.SetTapNote( iCol, iSongIndex, TAP_EMPTY );
// Don't CheckNumberOfNotesAndUndo. We don't want to revert any change that removes notes.
}
else if( EditIsBeingPressed(EDIT_BUTTON_LAY_MINE_OR_ROLL) )
{
m_soundAddNote.Play();
SetDirty( true );
SaveUndo();
TapNote tn = TAP_ORIGINAL_MINE;
tn.pn = m_InputPlayerNumber;
m_NoteDataEdit.SetTapNote( iCol, iSongIndex, tn );
CheckNumberOfNotesAndUndo();
}
else if( EditIsBeingPressed(EDIT_BUTTON_LAY_TAP_ATTACK) )
{
g_iLastInsertTapAttackTrack = iCol;
EditMiniMenu( &g_InsertTapAttack, SM_BackFromInsertTapAttack );
}
else if( EditIsBeingPressed(EDIT_BUTTON_LAY_LIFT) )
{
m_soundAddNote.Play();
SetDirty( true );
SaveUndo();
TapNote tn = TAP_ORIGINAL_LIFT;
tn.pn = m_InputPlayerNumber;
m_NoteDataEdit.SetTapNote( iCol, iSongIndex, tn );
CheckNumberOfNotesAndUndo();
}
else
{
m_soundAddNote.Play();
SetDirty( true );
SaveUndo();
TapNote tn = TAP_ORIGINAL_TAP;
TapNote tn = m_selectedTap;
tn.pn = m_InputPlayerNumber;
m_NoteDataEdit.SetTapNote(iCol, iSongIndex, tn );
CheckNumberOfNotesAndUndo();
}
}
break;
case EDIT_BUTTON_CYCLE_TAP_LEFT:
{
switch ( m_selectedTap.type )
{
case TapNote::tap: m_selectedTap = TAP_ORIGINAL_FAKE; break;
case TapNote::mine: m_selectedTap = TAP_ORIGINAL_TAP; break;
case TapNote::lift: m_selectedTap = TAP_ORIGINAL_MINE; break;
case TapNote::fake: m_selectedTap = TAP_ORIGINAL_LIFT; break;
DEFAULT_FAIL( m_selectedTap.type );
}
break;
}
case EDIT_BUTTON_CYCLE_TAP_RIGHT:
{
switch ( m_selectedTap.type )
{
case TapNote::tap: m_selectedTap = TAP_ORIGINAL_MINE; break;
case TapNote::mine: m_selectedTap = TAP_ORIGINAL_LIFT; break;
case TapNote::lift: m_selectedTap = TAP_ORIGINAL_FAKE; break;
case TapNote::fake: m_selectedTap = TAP_ORIGINAL_TAP; break;
DEFAULT_FAIL( m_selectedTap.type );
}
break;
}
case EDIT_BUTTON_SCROLL_SPEED_UP:
case EDIT_BUTTON_SCROLL_SPEED_DOWN:
{
+4
View File
@@ -9,6 +9,7 @@
#include "Background.h"
#include "Foreground.h"
#include "NoteField.h"
#include "NoteTypes.h"
#include "Song.h"
#include "Steps.h"
#include "ThemeMetric.h"
@@ -236,6 +237,9 @@ protected:
SnapDisplay m_SnapDisplay;
BitmapText m_textInputTips;
/** @brief The current TapNote that would be inserted. */
TapNote m_selectedTap;
void UpdateTextInfo();
BitmapText m_textInfo; // status information that changes