From 4131257e42ceb88fa4fb2849b5c40011e8b5635d Mon Sep 17 00:00:00 2001
From: whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>
Date: Fri, 8 Jun 2007 16:23:40 +0000
Subject: Added ability to delete a Playlist within the Menu Language Files
 updated

git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@248 b956fd51-792f-4845-bead-9b4dfca2ff2c
---
 Game/Code/Screens/UScreenSongMenu.pas | 55 ++++++++++++++++++++++++++++++-----
 1 file changed, 48 insertions(+), 7 deletions(-)

(limited to 'Game/Code/Screens')

diff --git a/Game/Code/Screens/UScreenSongMenu.pas b/Game/Code/Screens/UScreenSongMenu.pas
index 3814334c..06b8f183 100644
--- a/Game/Code/Screens/UScreenSongMenu.pas
+++ b/Game/Code/Screens/UScreenSongMenu.pas
@@ -27,9 +27,10 @@ const
   SM_Playlist_Add = 64 or 2;
   SM_Playlist_New = 64 or 3;
 
-  SM_Playlist_Del = 64 or 5;
+  SM_Playlist_DelItem = 64 or 5;
 
   SM_Playlist_Load = 64 or 8 or 1;
+  SM_Playlist_Del  = 64 or 8 or 5;
 
 
   SM_Party_Main = 128 or 1;
@@ -42,7 +43,7 @@ var
 
 implementation
 
-uses UGraphic, UMain, UIni, UTexture, ULanguage, UParty, UPlaylist;
+uses UGraphic, UMain, UIni, UTexture, ULanguage, UParty, UPlaylist, USongs;
 
 function TScreenSongMenu.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean;
 begin
@@ -265,10 +266,10 @@ begin
         Button[3].Text[0].Text := Language.Translate('SONG_MENU_CANCEL');
       end;
 
-    SM_PlayList_Del:
+    SM_Playlist_DelItem:
       begin
         CurMenu := sMenu;
-        Text[0].Text := Language.Translate('SONG_MENU_NAME_PLAYLIST_DEL');
+        Text[0].Text := Language.Translate('SONG_MENU_NAME_PLAYLIST_DELITEM');
 
         Button[0].Visible := True;
         Button[1].Visible := False;
@@ -285,12 +286,15 @@ begin
         CurMenu := sMenu;
         Text[0].Text := Language.Translate('SONG_MENU_NAME_PLAYLIST_LOAD');
 
-        Button[0].Visible := False;
+        //Show Delete Curent Playlist Button when Playlist is opened
+        Button[0].Visible := (CatSongs.CatNumShow = -3);
+
         Button[1].Visible := False;
         Button[2].Visible := False;
         Button[3].Visible := True;
         SelectsS[0].Visible := True;
 
+        Button[0].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_DELCURRENT');
         Button[3].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_LOAD');
 
         SetLength(ISelections, Length(PlaylistMan.Playlists));
@@ -311,6 +315,21 @@ begin
         end;
       end;
 
+    SM_Playlist_Del:
+      begin
+        CurMenu := sMenu;
+        Text[0].Text := Language.Translate('SONG_MENU_NAME_PLAYLIST_DEL');
+
+        Button[0].Visible := True;
+        Button[1].Visible := False;
+        Button[2].Visible := False;
+        Button[3].Visible := True;
+        SelectsS[0].Visible := False;
+
+        Button[0].Text[0].Text := Language.Translate('SONG_MENU_YES');
+        Button[3].Text[0].Text := Language.Translate('SONG_MENU_CANCEL');
+      end;
+
 
     SM_Party_Main:
       begin
@@ -421,7 +440,7 @@ begin
           2: //Button 3
             begin
               //Show add to Playlist Menu
-              MenuShow(SM_Playlist_Del);
+              MenuShow(SM_Playlist_DelItem);
             end;
 
           3: //SelectSlide 3
@@ -488,7 +507,7 @@ begin
         end;
       end;
 
-    SM_PlayList_Del:
+    SM_Playlist_DelItem:
       begin
         Visible := False;
         Case Interaction of
@@ -509,6 +528,10 @@ begin
     SM_Playlist_Load:
       begin
         Case Interaction of
+          0: //Button 1 (Delete Playlist)
+            begin
+              MenuShow(SM_Playlist_Del);
+            end;
           4: //Button 4
             begin
               //Load Playlist
@@ -518,6 +541,24 @@ begin
         end;
       end;
 
+    SM_Playlist_Del:
+      begin
+        Visible := False;
+        Case Interaction of
+          0: //Button 1
+            begin
+              //Delete
+              PlayListMan.DelPlaylist(PlaylistMan.CurPlayList);
+              Visible := False;
+            end;
+
+          4: //Button 4
+            begin
+              MenuShow(SM_Playlist_Load);
+            end;
+        end;
+      end;
+
     SM_Party_Main:
       begin
         Case Interaction of
-- 
cgit v1.2.3