Use attributes where possible

This commit is contained in:
Martin Natano
2023-04-19 20:55:30 +02:00
parent a93fc07896
commit 093675cdc3
23 changed files with 142 additions and 133 deletions
+14 -14
View File
@@ -185,7 +185,7 @@ void EditMenu::Load( const RString &sType )
// fill in data structures
GetGroupsToShow( m_sGroups );
// In EditMode_Practice this will be filled in by OnRowValueChanged()
if( EDIT_MODE.GetValue() != EditMode_Practice )
m_StepsTypes = CommonMetrics::STEPS_TYPES_TO_SHOW.GetValue();
@@ -384,7 +384,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
UpdateArrows();
EditMode mode = EDIT_MODE.GetValue();
switch( row )
{
case ROW_GROUP:
@@ -424,9 +424,9 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
GetSongsToShowForGroup(GetSelectedGroup(), m_pSongs);
}
}
m_iSelection[ROW_SONG] = 0;
// fall through
[[fallthrough]];
case ROW_SONG:
if(GetSelectedSong() == nullptr)
{
@@ -466,15 +466,15 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
{
if(SongUtil::GetStepsByDifficulty( GetSelectedSong(), st, Difficulty_Invalid, false) != nullptr)
m_StepsTypes.push_back(st);
// Try to preserve the user's StepsType selection.
if(st == orgSel)
m_iSelection[ROW_STEPS_TYPE] = m_StepsTypes.size() - 1;
}
}
}
// fall through
[[fallthrough]];
case ROW_STEPS_TYPE:
if(GetSelectedStepsType() == StepsType_Invalid)
{
@@ -569,7 +569,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
}
CLAMP( m_iSelection[ROW_STEPS], 0, m_vpSteps.size()-1 );
}
// fall through
[[fallthrough]];
case ROW_STEPS:
if(GetSelectedSteps() == nullptr && mode == EditMode_Practice)
{
@@ -590,8 +590,8 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
m_StepsDisplay.SetFromStepsTypeAndMeterAndDifficultyAndCourseType( GetSelectedSourceStepsType(), 0, GetSelectedDifficulty(), CourseType_Invalid );
}
}
// fall through
case ROW_SOURCE_STEPS_TYPE:
[[fallthrough]];
case ROW_SOURCE_STEPS_TYPE:
if(mode == EditMode_Practice)
{
m_textLabel[ROW_SOURCE_STEPS_TYPE].SetVisible(false);
@@ -626,7 +626,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
StripLockedStepsAndDifficulty( m_vpSteps );
CLAMP( m_iSelection[ROW_SOURCE_STEPS], 0, m_vpSourceSteps.size()-1 );
}
// fall through
[[fallthrough]];
case ROW_SOURCE_STEPS:
if(mode == EditMode_Practice)
{
@@ -690,7 +690,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
}
m_iSelection[ROW_ACTION] = 0;
}
// fall through
[[fallthrough]];
case ROW_ACTION:
if(GetSelectedAction() == EditMenuAction_Invalid)
{
@@ -709,7 +709,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
/*
* (c) 2001-2004 Chris Danford
* All rights reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@@ -719,7 +719,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF