diff --git a/Docs/Changelog_language.txt b/Docs/Changelog_language.txt index 8c55b3f1cc..c10b9942ba 100644 --- a/Docs/Changelog_language.txt +++ b/Docs/Changelog_language.txt @@ -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/06/06 +---------- +* [ScreenInitialScreenIsInvalid] InvalidScreenExplanation + 2015/05/09 ---------- * [OptionExplanations] AxisFix diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index e7146c1df8..4e22dff4dc 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -4,6 +4,11 @@ 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/06/06 +---------- +* [ScreenInitialScreenIsInvalid] Error screen for themes that set an invalid + initial screen. [kyzentun] + 2015/06/05 ---------- * [global] update_centering lua function exposed. [kyzentun] diff --git a/Themes/_fallback/BGAnimations/ScreenInitialScreenIsInvalid overlay.lua b/Themes/_fallback/BGAnimations/ScreenInitialScreenIsInvalid overlay.lua new file mode 100644 index 0000000000..32ec0bb38e --- /dev/null +++ b/Themes/_fallback/BGAnimations/ScreenInitialScreenIsInvalid overlay.lua @@ -0,0 +1,10 @@ +return Def.ActorFrame{ + Def.BitmapText{ + Font= "Common Normal", + Text= THEME:GetString("ScreenInitialScreenIsInvalid", "InvalidScreenExplanation"), + InitCommand= function(self) + self:xy(_screen.cx, _screen.cy):wrapwidthpixels(_screen.w-16) + :diffuse{1, 1, 1, 1}:strokecolor{0, 0, 0, 1} + end + } +} diff --git a/Themes/_fallback/Languages/en.ini b/Themes/_fallback/Languages/en.ini index 3e0b0a06c8..3bd711c735 100644 --- a/Themes/_fallback/Languages/en.ini +++ b/Themes/_fallback/Languages/en.ini @@ -1436,6 +1436,8 @@ Could not find '%s'.=Could not find '%s'. HeaderText= HeaderSubText= HelpText= +[ScreenInitialScreenIsInvalid] +InvalidScreenExplanation=The initial screen set by this theme is not valid. It is not defined anywhere in the theme or in the _fallback theme. This is an error in the theme and should be reported to the theme's author. You can press Scroll Lock (the operator key) to access the service menu and change to a different theme. [ScreenAppearanceOptions] HeaderText=Appearance HeaderSubText=Customize your game diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index dd63a26c2f..1ad1d97401 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -1533,6 +1533,10 @@ CancelCancelCommand= LightsMode="LightsMode_MenuStartAndDirections" ShowCreditDisplay=false +[ScreenInitialScreenIsInvalid] +Class="ScreenWithMenuElements" +Fallback="ScreenWithMenuElements" + [ScreenDebugOverlay] Class="ScreenDebugOverlay" Fallback="Screen" diff --git a/src/StepMania.cpp b/src/StepMania.cpp index 6f4e8020c1..06867c7863 100644 --- a/src/StepMania.cpp +++ b/src/StepMania.cpp @@ -354,9 +354,17 @@ void StepMania::ResetGame() ThemeMetric INITIAL_SCREEN ("Common","InitialScreen"); RString StepMania::GetInitialScreen() { - if( PREFSMAN->m_sTestInitialScreen.Get() != "" ) + if(PREFSMAN->m_sTestInitialScreen.Get() != "" && + SCREENMAN->IsScreenNameValid(PREFSMAN->m_sTestInitialScreen)) + { return PREFSMAN->m_sTestInitialScreen; - return INITIAL_SCREEN.GetValue(); + } + RString screen_name= INITIAL_SCREEN.GetValue(); + if(!SCREENMAN->IsScreenNameValid(screen_name)) + { + screen_name= "ScreenInitialScreenIsInvalid"; + } + return screen_name; } ThemeMetric SELECT_MUSIC_SCREEN ("Common","SelectMusicScreen"); RString StepMania::GetSelectMusicScreen()