From 22581815288ed2462063a8ac36e3818f95adfda2 Mon Sep 17 00:00:00 2001 From: brunzelchen Date: Sun, 15 Aug 2010 16:44:17 +0000 Subject: added check popup at startup if LoadFaultySongs=Off and if there are some defective songs. the user has now the ability to load them anyway. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1 Challenge MOD@2611 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenMain.pas | 7 +++---- Game/Code/Screens/UScreenPopup.pas | 24 ++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 6 deletions(-) (limited to 'Game/Code/Screens') diff --git a/Game/Code/Screens/UScreenMain.pas b/Game/Code/Screens/UScreenMain.pas index 156901e2..b92e59a2 100644 --- a/Game/Code/Screens/UScreenMain.pas +++ b/Game/Code/Screens/UScreenMain.pas @@ -261,7 +261,7 @@ begin AddButton(Theme.Main.ButtonExit); Interaction := 0; - ShowNumErrors := false; + ShowNumErrors := true; end; procedure TScreenMain.onShow; @@ -274,10 +274,9 @@ begin if not Help.SetHelpID(ID) then Log.LogError('No Entry for Help-ID ' + ID + ' (ScreenMain)'); - if ShowNumErrors then + if (Ini.LoadFaultySongs=0) and ShowNumErrors and (Songs.NumFaultySongs>0) then begin - ShowNumErrors := false; - ScreenPopupError.ShowPopup(IntToStr(Log.NumErrors) + ' errors on loading, see Error.log for details'); + ScreenPopupCheck.ShowPopup(Format(Language.Translate('MSG_ERROR_SONGLOADING'), [Songs.NumFaultySongs])); end; end; diff --git a/Game/Code/Screens/UScreenPopup.pas b/Game/Code/Screens/UScreenPopup.pas index e7d6ce00..aaed32ed 100644 --- a/Game/Code/Screens/UScreenPopup.pas +++ b/Game/Code/Screens/UScreenPopup.pas @@ -85,7 +85,7 @@ var implementation -uses Classes, TextGL, UGraphic, UMain, UIni, UTexture, ULanguage, UParty, UPlaylist, UDisplay; +uses Classes, TextGL, UGraphic, USongs, UMain, UIni, UTexture, ULanguage, UParty, UPlaylist, UDisplay; function TScreenPopupCheck.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; begin @@ -121,11 +121,31 @@ begin ScreenSingModi.Finish; end; - Display.CheckOK:=True; + //Hack to load faulty songs in main screen + if (Display.NextScreenWithCheck = NIL) then + begin + if (Display.ActualScreen = @ScreenMain) and (ScreenMain.ShowNumErrors) then + begin + Ini.LoadFaultySongs := 1; + Songs.LoadSongList(); + UGraphic.UnLoadScreens(); + UGraphic.LoadScreens( true ); + ScreenSong.Refresh(true); + PlaylistMan.LoadPlayLists; + Ini.LoadFaultySongs := 0; + ScreenMain.ShowNumErrors := false; + FadeTo(@ScreenMain); + end else + Display.CheckOK:=True; + end else + Display.CheckOK:=True; end; 1: begin Display.CheckOK:=False; Display.NextScreenWithCheck:=NIL; + + if (Display.ActualScreen = @ScreenMain) and (ScreenMain.ShowNumErrors) then + ScreenMain.ShowNumErrors := false; end; end; Visible:=False; -- cgit v1.2.3