From 2eba76c8731f941a2e8a9aa56c4fcc0e43d961ae Mon Sep 17 00:00:00 2001 From: Kyzentun Date: Sun, 31 Aug 2014 19:46:29 -0600 Subject: [PATCH] Localized Arbitrary Remap edit mode strings. Changed track ids for Arbitrary Remap to start at 1. --- Themes/_fallback/Languages/en.ini | 3 +++ src/ScreenEdit.cpp | 21 ++++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/Themes/_fallback/Languages/en.ini b/Themes/_fallback/Languages/en.ini index 48f1ce8fac..c00825ed22 100644 --- a/Themes/_fallback/Languages/en.ini +++ b/Themes/_fallback/Languages/en.ini @@ -1363,6 +1363,7 @@ or=or Zoom In Camera=Zoom In Camera [ScreenEdit] +'%s' is not a track id.='%s' is not a track id. Adding New Attack=Enter the new modifier for this attack.\nThe length can be adjusted later.\nLeave it blank to cancel. Adding New Mod=Please enter the new modifier for this attack.\n\nLeave it blank to cancel. Edit Existing Mod=Please adjust the present modifier below.\n\nLeave it blank to erase the mod. @@ -1407,6 +1408,7 @@ Enter a new preview length.=Enter how long the music sample lasts. Enter a new min BPM.=Enter the minimum displayed BPM. Enter a new max BPM.=Enter the maximum displayed BPM. Enter the new track mapping.=Enter the new track mapping. +Entry %d, '%d', is out of range 1 to %d.=Entry %d, '%d', is out of range 1 to %d. More than %d notes per measure is not allowed. This change has been reverted.=More than %d notes per measure is not allowed. This change has been reverted. No backgrounds available=No backgrounds available EditHelpText=Up/Down:\n change beat\nLeft/Right:\n change snap\nNumber keys:\n add/remove\n tap note\nN and M keys:\n swap tap notes\nCtrl + N/M:\n swap cycled segment\nCtrl + ,/.:\n cycle segments\nCreate hold note:\n Hold a number\n while moving\n Up or Down\nCreate roll note:\n Hold Shift,\n then create a\n hold note.\nSpace bar: Set area\n marker\nT key: Switch Timing\nEnter: Area Menu\nA Key: Alter Menu\nEscape: Main Menu\nF4: Timing Menu\nF1: Show help\n @@ -1419,6 +1421,7 @@ The change has been reverted.=The change has been reverted. This change creates more than %d notes in a measure.=This change creates more than %d notes in a measure. This change creates notes past the end of the music and is not allowed.=This change creates notes past the end of the music and is not allowed. This will destroy all unsaved changes.=This will destroy all unsaved changes. +Too many tracks specified.=Too many tracks specified. Undo=Undo You must be in Song Timing Mode to edit BG Changes.=You must be in Song Timing Mode to edit BG Changes. You must have an area selected to enter the Alter Menu.=You must have an area selected to enter the Alter Menu. diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 7fe8c4d02e..127daa46f8 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -4538,6 +4538,10 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector &iAns } static LocalizedString ENTER_ARBITRARY_MAPPING( "ScreenEdit", "Enter the new track mapping." ); +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 bool ConvertMappingInputToMapping(RString const& mapstr, int* mapping, RString& error) { vector mapping_input; @@ -4545,7 +4549,7 @@ static bool ConvertMappingInputToMapping(RString const& mapstr, int* mapping, RS int tracks_for_type= GAMEMAN->GetStepsTypeInfo(GAMESTATE->m_pCurSteps[0]->m_StepsType).iNumTracks; if(mapping_input.size() > tracks_for_type) { - error= "Too many tracks specified."; + error= TOO_MANY_TRACKS; return false; } // mapping_input.size() < tracks_for_type is not checked because @@ -4554,20 +4558,23 @@ static bool ConvertMappingInputToMapping(RString const& mapstr, int* mapping, RS // track will be used for filling in the unspecified part of the mapping. for(; track < mapping_input.size(); ++track) { - if(mapping_input[track].empty()) + if(mapping_input[track].empty() || mapping_input[track] == " ") { - mapping[track]= track; + // This allows blank entries to mean "pass through". + mapping[track]= track+1; } else if(!(mapping_input[track] >> mapping[track])) { - error= "'" + mapping_input[track] + "' is not a track id."; + error= ssprintf(NOT_A_TRACK.GetValue(), mapping_input[track].c_str()); return false; } - if(mapping[track] < 0 || mapping[track] >= tracks_for_type) + if(mapping[track] < 1 || mapping[track] > tracks_for_type) { - error= ssprintf("Entry %d, '%s', '%d' is out of range 0 to %d.", track, mapping_input[track].c_str(), mapping[track], tracks_for_type-1); + error= ssprintf(OUT_OF_RANGE_ID.GetValue(), track+1, mapping[track], tracks_for_type); return false; } + // Simpler for the user if they input track ids starting at 1. + --mapping[track]; } for(; track < tracks_for_type; ++track) { @@ -4745,7 +4752,7 @@ void ScreenEdit::HandleAlterMenuChoice(AlterMenuChoice c, const vector &iAn case arbitrary_remap: ScreenTextEntry::TextEntry( SM_BackFromArbitraryRemap, ENTER_ARBITRARY_MAPPING, - "0, 1, 2, 3", MAX_NOTE_TRACKS * 4, + "1, 2, 3, 4", MAX_NOTE_TRACKS * 4, // 2 chars for digit, one for comma, one for space. ArbitraryRemapValidate );