From 839110b8abea8b835e1865c55b2f5ac3b6e17dc2 Mon Sep 17 00:00:00 2001 From: brunzelchen Date: Sat, 22 May 2010 22:40:14 +0000 Subject: changing tabs or sorting in song screen: info popup with actual sorting; the focus will remain on the actual song. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1 Challenge MOD@2399 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSong.pas | 144 ++++++++++++++++++++++++++++++-------- 1 file changed, 113 insertions(+), 31 deletions(-) (limited to 'Game/Code/Screens/UScreenSong.pas') diff --git a/Game/Code/Screens/UScreenSong.pas b/Game/Code/Screens/UScreenSong.pas index 6bbaacbb..ee6a8aaa 100644 --- a/Game/Code/Screens/UScreenSong.pas +++ b/Game/Code/Screens/UScreenSong.pas @@ -31,6 +31,7 @@ type lastIndex: integer; lastCat: integer; active: boolean; + txt: string; end; TScreenSong = class(TMenu) @@ -67,8 +68,11 @@ type MakeMedley: boolean; - //VideoAspect - AspectHandler: THandler; + //InfoHandler + InfoHandler: THandler; + + //AspectHandler + AspectHandler: THandler; //Wait timer WaitHandler: THandler; @@ -185,7 +189,7 @@ type procedure DoJokerM2; function getVisibleMedleyArr(MinS: TMedleySource): TVisArr; procedure StartMedley(num: integer; MinS: TMedleySource); - procedure DrawAspect; + procedure DrawInfo(text: string); function PartyPlayedSong(SongNr: integer): boolean; function PartyPlayedMedley(SongNr: integer): boolean; @@ -353,6 +357,11 @@ var SDL_ModState: Word; Letter: Char; VisArr: array of integer; + + Artist: string; + Title: string; + jump: boolean; + begin Result := true; @@ -1028,18 +1037,86 @@ begin Inc(Ini.Sorting) else Ini.Sorting := 0; + + InfoHandler.txt := 'Sorting: ' + ISorting[Ini.Sorting]; end else begin //Change Tabs (on/off) if (Ini.Tabs=1) then - Ini.Tabs := 0 - else + begin + Ini.Tabs := 0; + InfoHandler.txt := 'Tabs: off'; + end else + begin Ini.Tabs := 1; + InfoHandler.txt := 'Tabs: on'; + end; end; + if not CatSongs.Song[Interaction].Main then + begin + Artist := CatSongs.Song[Interaction].Artist; + Title := CatSongs.Song[Interaction].Title; + jump := true; + end else + jump := false; + Refresh(false); PlaylistMan.LoadPlayLists; - OnShow; + + if jump then + I2 := PlaylistMan.FindSong(Artist, Title) + else + begin + //Find Category + I := Interaction; + while not catsongs.Song[I].Main do + begin + Dec (I); + if (I < low(CatSongs.Song)) then + break; + end; + if (I<= 1) then + Interaction := high(catsongs.Song) + else + Interaction := I - 1; + + CatSongs.ShowCategoryList; + + //Show Cat in Top Left Mod + HideCatTL; + + //Show Wrong Song when Tabs on Fix + SelectNext; + FixSelected; + end; + + if (Ini.Tabs=1) and not (CatSongs.CatNumShow = -3) and jump then + begin + //Search Cat + for I := I2 downto low(CatSongs.Song) do + begin + if CatSongs.Song[I].Main then + break; + end; + + //Choose Cat + CatSongs.ShowCategoryList; + ShowCatTL(I); + CatSongs.ClickCategoryButton(I); + end else + HideCatTL; + + //Choose Song + if jump then + begin + SkipTo2(I2); + SongCurrent := SongTarget; + ChangeMusic; + end; + + InfoHandler.changed := true; + InfoHandler.change_time := 0; end; SDLK_1: @@ -1889,6 +1966,7 @@ begin StartTry := false; AspectHandler.changed := false; + InfoHandler.changed := false; MP3VolumeHandler.changed := false; SetLength(PlaylistMedley.Song, 0); @@ -2148,6 +2226,7 @@ var Window: TRectCoords; Blend: real; VisArr: array of integer; + txt: string; begin dx := SongTarget-SongCurrent; @@ -2361,11 +2440,25 @@ begin if (VidVis = full) and AspectHandler.changed and (AspectHandler.change_time+3>Czas.Teraz) then begin - DrawAspect; + case UVideo.fAspectCorrection of + acoStretch: txt := Language.Translate('VIDEO_ASPECT_STRETCH'); + acoCrop: txt := Language.Translate('VIDEO_ASPECT_CROP'); + acoLetterBox: txt := Language.Translate('VIDEO_ASPECT_LETTER_BOX'); + else + txt := 'error'; + end; + DrawInfo(txt); end else if AspectHandler.changed and (AspectHandler.change_time+3