From d22d5070d1b847611786ca483055ea7348cda132 Mon Sep 17 00:00:00 2001 From: tobigun Date: Tue, 5 Feb 2008 21:33:30 +0000 Subject: cleanup git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@828 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'Game') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 6a5b4e90..2342d371 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -325,6 +325,8 @@ var NR: TRecR; //Line Bonus Mod Color: TRGB; + + success: boolean; begin Log.LogStatus('Begin', 'onShow'); FadeOut := false; // 0.5.0: early 0.5.0 problems were by this line commented @@ -433,34 +435,30 @@ begin {Static[StaticP3RScoreBG].Visible := V3R; Text[TextP3RScore].Visible := V3R; } + // FIXME: sets Path and Filename to '' ResetSingTemp; -// Log.LogWarning(CatSongs.Song[CatSongs.Selected].Path + CatSongs.Song[CatSongs.Selected].FileName, '!!!'); + CurrentSong := CatSongs.Song[CatSongs.Selected]; + // FIXME: bad style, put the try-except into LoadSong() and not here try - if not CurrentSong.LoadSong then -// if not LoadSong(CatSongs.Song[CatSongs.Selected].Path + CatSongs.Song[CatSongs.Selected].FileName) then - begin - //Error Loading Song -> Go back to Song Screen and Show some Error Message - FadeTo(@ScreenSong); - //Select New Song in Party Mode - if ScreenSong.Mode = smPartyMode then - ScreenSong.SelectRandomSong; - ScreenPopupError.ShowPopup (Language.Translate('ERROR_CORRUPT_SONG')); - Exit; - end; + success := CurrentSong.LoadSong(); except + success := false; + end; + if (not success) then + begin //Error Loading Song -> Go back to Song Screen and Show some Error Message FadeTo(@ScreenSong); //Select New Song in Party Mode if ScreenSong.Mode = smPartyMode then - ScreenSong.SelectRandomSong; + ScreenSong.SelectRandomSong(); ScreenPopupError.ShowPopup (Language.Translate('ERROR_CORRUPT_SONG')); + // FIXME: do we need this? + CurrentSong.Path := CatSongs.Song[CatSongs.Selected].Path; Exit; end; - CurrentSong.Path := CatSongs.Song[CatSongs.Selected].Path; -// CurrentSong.GAP := CurrentSong.GAP + 40 {4096 = 100ms for buffer} + 20 {microphone} + 60000 / CurrentSong.BPM[0].BPM / 2; // temporary until UMain will be fixed - + // set movie if (CurrentSong.Video <> '') and FileExists(CurrentSong.Path + CurrentSong.Video) then begin -- cgit v1.2.3