From e452e8c6d60af8e8a8eb957f1ef59d461f48c99a Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Tue, 8 May 2007 19:55:34 +0000 Subject: Fixed the "one Song too much" Bug Added 2 Error Messages: When Opening Sing or Party: No Songs Loaded When Opening Party: No Plugins loaded Added Messages to Language File git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@182 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/USongs.pas | 2 +- Game/Code/Screens/UScreenMain.pas | 35 ++++++++++++++++++++++++----------- 2 files changed, 25 insertions(+), 12 deletions(-) (limited to 'Game') diff --git a/Game/Code/Classes/USongs.pas b/Game/Code/Classes/USongs.pas index 0a319370..4b49127c 100644 --- a/Game/Code/Classes/USongs.pas +++ b/Game/Code/Classes/USongs.pas @@ -110,7 +110,7 @@ begin BrowseDir(SongPath); //Set Correct SongArray Length - SetLength(Song, BrowsePos + 1); + SetLength(Song, BrowsePos); // if Ini.Debug = 1 then BrowseDir('D:\Extract\Songs\'); end; diff --git a/Game/Code/Screens/UScreenMain.pas b/Game/Code/Screens/UScreenMain.pas index 6fd458d7..47a79496 100644 --- a/Game/Code/Screens/UScreenMain.pas +++ b/Game/Code/Screens/UScreenMain.pas @@ -93,22 +93,35 @@ begin SDLK_RETURN: begin //Solo - if (Interaction = 0) and (Length(Songs.Song) >= 1) then begin - Music.PlayStart; - if (Ini.Players >= 0) and (Ini.Players <= 3) then PlayersPlay := Ini.Players + 1; - if (Ini.Players = 4) then PlayersPlay := 6; - - ScreenName.Goto_SingScreen := False; - FadeTo(@ScreenName); + if (Interaction = 0) then + begin + if (Length(Songs.Song) >= 1) then + begin + Music.PlayStart; + if (Ini.Players >= 0) and (Ini.Players <= 3) then PlayersPlay := Ini.Players + 1; + if (Ini.Players = 4) then PlayersPlay := 6; + + ScreenName.Goto_SingScreen := False; + FadeTo(@ScreenName); + end + else //show error message + ScreenPopupError.ShowPopup(Language.Translate('ERROR_NO_SONGS')); end; //Multi if Interaction = 1 then begin - if (Ini.Players >= 1) AND (Length(DLLMan.Plugins)>=1) then + if (Length(Songs.Song) >= 1) then begin - Music.PlayStart; - FadeTo(@ScreenPartyOptions); - end; + if (Length(DLLMan.Plugins)>=1) then + begin + Music.PlayStart; + FadeTo(@ScreenPartyOptions); + end + else //show error message, No Plugins Loaded + ScreenPopupError.ShowPopup(Language.Translate('ERROR_NO_PLUGINS')); + end + else //show error message, No Songs Loaded + ScreenPopupError.ShowPopup(Language.Translate('ERROR_NO_SONGS')); end; //Stats -- cgit v1.2.3