From 514ece97aaeb8eaa8bf56e224826bc5e6169ce8b Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Sun, 3 Jun 2007 19:00:14 +0000 Subject: Some Code Cleanup in UScreenSong Add Procedure DeletePlaylist to TPlaylistManager Add automatic Playlist Deleting if last Song is deleted Fixed some Cover displaying Bugs when JumptoMenu is left git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@242 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSong.pas | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) (limited to 'Game/Code/Screens/UScreenSong.pas') diff --git a/Game/Code/Screens/UScreenSong.pas b/Game/Code/Screens/UScreenSong.pas index 45c7c2de..3924968f 100644 --- a/Game/Code/Screens/UScreenSong.pas +++ b/Game/Code/Screens/UScreenSong.pas @@ -95,6 +95,8 @@ type procedure DoJoker(Team: Byte); procedure SelectPlayers; + procedure UnLoadDetailedCover; + //Extensions procedure DrawExtensions; end; @@ -1379,13 +1381,7 @@ begin if VS > 0 then begin - CoverTime := 0; - Button[Interaction].Texture := Texture.GetTexture(Button[Interaction].Texture.Name, 'Plain', true); // 0.5.0: show cached texture - Button[Interaction].Texture2.Alpha := 0; - - //0.5.0: unload old full size texture - if Button[Interaction].Texture.Name <> Skin.GetTextureFileName('SongCover') then - Texture.UnloadTexture(Button[Interaction].Texture.Name, false); + UnLoadDetailedCover; Skip := 1; @@ -1417,13 +1413,7 @@ begin if VS > 0 then begin - CoverTime := 0; - Button[Interaction].Texture := Texture.GetTexture(Button[Interaction].Texture.Name, 'Plain', true); // 0.5.0: show cached texture - Button[Interaction].Texture2.Alpha := 0; - - //0.5.0: unload old full size texture - if Button[Interaction].Texture.Name <> Skin.GetTextureFileName('SongCover') then - Texture.UnloadTexture(Button[Interaction].Texture.Name, false); + UnLoadDetailedCover; Skip := 1; @@ -1470,12 +1460,7 @@ var Skip: integer; I: integer; begin - CoverTime := 0; - Button[Interaction].Texture := Texture.GetTexture(Button[Interaction].Texture.Name, 'Plain', true); // 0.5.0: show cached texture - Button[Interaction].Texture2.Alpha := 0; - - if Button[Interaction].Texture.Name <> Skin.GetTextureFileName('SongCover') then - Texture.UnloadTexture(Button[Interaction].Texture.Name, false); + UnLoadDetailedCover; Interaction := High(CatSongs.Song); SongTarget := 0; @@ -1809,6 +1794,18 @@ begin end; end; +//Detailed Cover Unloading. Unloads the Detailed, uncached Cover of the cur. Song +procedure TScreenSong.UnLoadDetailedCover; +begin + CoverTime := 0; + + Button[Interaction].Texture := Texture.GetTexture(Button[Interaction].Texture.Name, 'Plain', true); // 0.5.0: show cached texture + Button[Interaction].Texture2.Alpha := 0; + + if Button[Interaction].Texture.Name <> Skin.GetTextureFileName('SongCover') then + Texture.UnloadTexture(Button[Interaction].Texture.Name, false); +end; + procedure TScreenSong.Refresh; begin { CatSongs.Refresh; -- cgit v1.2.3