Changed Song and ScreenEdit to not save a .sm file when split timing is used.

This commit is contained in:
Kyzentun Keeslala
2015-10-02 16:26:59 -06:00
parent 751caba360
commit 2d64694f14
6 changed files with 48 additions and 6 deletions
+4
View File
@@ -16,6 +16,10 @@ Example:
This means that three strings were added to the "ScreenDebugOverlay" section,
"Mute actions", "Mute actions on", and "Mute actions off".
2015/10/02
----------
* [ScreenEdit] save_success_no_sm_split_timing
2015/07/09
----------
* [ScreenDebugOverlay] Show Recent Errors
+4
View File
@@ -4,6 +4,10 @@ The StepMania 5 Changelog covers all post-sm-ssc changes. For a list of changes
from StepMania 4 alpha 5 to sm-ssc v1.2.5, see Changelog_sm-ssc.txt.
________________________________________________________________________________
2015/10/02
----------
* [Edit Mode] .sm files will no longer be saved when split timing is used
because per-chart timing cannot be done in the .sm format. [kyzentun]
2015/09/21
----------
+1
View File
@@ -1579,6 +1579,7 @@ 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\nQ/W: Change record hold time.\nE/R: Toggle record holds
PlayRecordHelpText=Press START to end
Save successful.=Save successful.
save_success_no_sm_split_timing=Save successful. No SM saved because split timing was used.
Saved as SM and DWI.=Saved as SM and DWI.
Saved as SM.=Saved as SM.
Switched to=Switched to
+19 -4
View File
@@ -115,6 +115,7 @@ AutoScreenMessage( SM_DoSaveAndExit );
AutoScreenMessage( SM_DoExit );
AutoScreenMessage( SM_AutoSaveSuccessful );
AutoScreenMessage( SM_SaveSuccessful );
AutoScreenMessage( SM_SaveSuccessNoSM );
AutoScreenMessage( SM_SaveFailed );
static const char *EditStateNames[] = {
@@ -3596,6 +3597,7 @@ void ScreenEdit::HandleMessage( const Message &msg )
static LocalizedString SAVE_SUCCESSFUL ( "ScreenEdit", "Save successful." );
static LocalizedString AUTOSAVE_SUCCESSFUL ( "ScreenEdit", "Autosave successful." );
static LocalizedString SAVE_SUCCESS_NO_SM_SPLIT_TIMING("ScreenEdit", "save_success_no_sm_split_timing");
static LocalizedString ADD_NEW_MOD ("ScreenEdit", "Adding New Mod");
static LocalizedString ADD_NEW_ATTACK ("ScreenEdit", "Adding New Attack");
@@ -4311,17 +4313,27 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
break; // do nothing
}
}
else if( SM == SM_SaveSuccessful )
else if(SM == SM_SaveSuccessful || SM == SM_SaveSuccessNoSM)
{
LOG->Trace( "Save successful." );
CopyToLastSave();
SetDirty( false );
SONGMAN->Invalidate( GAMESTATE->m_pCurSong );
LocalizedString const* message= &SAVE_SUCCESSFUL;
if(SM == SM_SaveSuccessNoSM)
{
message= &SAVE_SUCCESS_NO_SM_SPLIT_TIMING;
}
if( m_CurrentAction == save_on_exit )
ScreenPrompt::Prompt( SM_DoExit, SAVE_SUCCESSFUL );
{
ScreenPrompt::Prompt( SM_DoExit, *message );
}
else
SCREENMAN->SystemMessage( SAVE_SUCCESSFUL );
{
SCREENMAN->SystemMessage( *message );
}
}
else if( SM == SM_AutoSaveSuccessful )
{
@@ -4425,8 +4437,11 @@ void ScreenEdit::PerformSave(bool autosave)
m_pSteps->m_Attacks = GAMESTATE->m_pCurSteps[PLAYER_1]->m_Attacks;
m_pSteps->m_sAttackString = GAMESTATE->m_pCurSteps[PLAYER_1]->m_Attacks.ToVectorString();
// If one of the charts uses split timing, then it cannot be accurately
// saved in the .sm format. So saving the .sm is disabled.
bool uses_split= m_pSong->AnyChartUsesSplitTiming();
const ScreenMessage save_message= autosave ? SM_AutoSaveSuccessful
: SM_SaveSuccessful;
: (uses_split ? SM_SaveSuccessNoSM : SM_SaveSuccessful);
switch( EDIT_MODE.GetValue() )
{
+19 -2
View File
@@ -1157,7 +1157,12 @@ void Song::Save(bool autosave)
return;
}
SaveToCacheFile();
SaveToSMFile();
// If one of the charts uses split timing, then it cannot be accurately
// saved in the .sm format. So saving the .sm is disabled.
if(!AnyChartUsesSplitTiming())
{
SaveToSMFile();
}
//SaveToDWIFile();
/* We've safely written our files and created backups. Rename non-SM and
@@ -1884,6 +1889,18 @@ bool Song::IsStepsUsingDifferentTiming(Steps *pSteps) const
return !pSteps->m_Timing.empty();
}
bool Song::AnyChartUsesSplitTiming() const
{
FOREACH_CONST(Steps*, m_vpSteps, s)
{
if(!(*s)->m_Timing.empty())
{
return true;
}
}
return false;
}
bool Song::HasSignificantBpmChangesOrStops() const
{
if( m_SongTiming.HasStops() || m_SongTiming.HasDelays() )
@@ -2377,4 +2394,4 @@ LUA_REGISTER_CLASS( Song )
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
*/
+1
View File
@@ -436,6 +436,7 @@ public:
bool IsEditAlreadyLoaded( Steps* pSteps ) const;
bool IsStepsUsingDifferentTiming(Steps *pSteps ) const;
bool AnyChartUsesSplitTiming() const;
/**
* @brief An array of keysound file names (e.g. "beep.wav").