From 5ed6620bad808381fce94f2cd67ee911b4d45bff Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Wed, 21 Mar 2007 19:19:04 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSongMenu.pas | 355 ++++++++++++++++++++++++++++++++++ 1 file changed, 355 insertions(+) create mode 100644 Game/Code/Screens/UScreenSongMenu.pas (limited to 'Game/Code/Screens/UScreenSongMenu.pas') diff --git a/Game/Code/Screens/UScreenSongMenu.pas b/Game/Code/Screens/UScreenSongMenu.pas new file mode 100644 index 00000000..2a03a7c2 --- /dev/null +++ b/Game/Code/Screens/UScreenSongMenu.pas @@ -0,0 +1,355 @@ +unit UScreenSongMenu; + +interface + +uses + UMenu, SDL, UDisplay, UMusic, UPliki, SysUtils, UThemes; + +type + TScreenSongMenu = class(TMenu) + private + CurMenu: Byte; //Num of the cur. Shown Menu + public + Visible: Boolean; //Whether the Menu should be Drawn + + constructor Create; override; + function ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; override; + procedure onShow; override; + function Draw: boolean; override; + procedure MenuShow(sMenu: Byte); + procedure HandleReturn; + end; + +const + SM_Main = 1; + SM_PlayList = 64 or 1; + SM_Party_Main = 128 or 1; + SM_Party_Joker = 128 or 2; + +var + ISelections: Array of String; + SelectValue: Integer; + + +implementation + +uses UGraphic, UMain, UIni, UTexture, ULanguage, UParty; + +function TScreenSongMenu.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; + function IsVisible: Boolean; + begin + Result := True; + if (Interactions[Interaction].Typ = 0) then + begin + Result := Button[Interactions[Interaction].Num].Visible; + end + else if (Interactions[Interaction].Typ = 1) then + begin + //Result := Selects[Interactions[Interaction].Num].Visible; + end + else if (Interactions[Interaction].Typ = 3) then + begin + Result := SelectsS[Interactions[Interaction].Num].Visible; + end; + end; + + Procedure SelectNext; + begin + repeat + InteractNext; + until IsVisible; + end; + + Procedure SelectPrev; + begin + repeat + InteractPrev; + until IsVisible; + end; +begin + Result := true; + If (PressedDown) Then + begin // Key Down + case PressedKey of + SDLK_Q: + begin + Result := false; + end; + + SDLK_ESCAPE : + begin + Music.PlayBack; + Visible := False; + end; + + SDLK_RETURN: + begin + HandleReturn; + end; + + // Up and Down could be done at the same time, + // but I don't want to declare variables inside + // functions like this one, called so many times + SDLK_DOWN: SelectNext; + SDLK_UP: SelectPrev; + + SDLK_RIGHT: + begin + if (Interaction=3) then + InteractInc; + end; + SDLK_LEFT: + begin + if (Interaction=3) then + InteractDec; + end; + end; + end + else // Key Up + case PressedKey of + SDLK_RETURN : + begin + end; + end; +end; + +constructor TScreenSongMenu.Create; +var + I: integer; +begin + inherited Create; + SetLength(ISelections, 1); + ISelections[0] := 'Dummy'; + + AddBackground(Theme.SongMenu.Background.Tex); + + AddButton(Theme.SongMenu.Button1); + if (Length(Button[0].Text) = 0) then + AddButtonText(14, 20, 'Button 1'); + + AddButton(Theme.SongMenu.Button2); + if (Length(Button[1].Text) = 0) then + AddButtonText(14, 20, 'Button 2'); + + AddButton(Theme.SongMenu.Button3); + if (Length(Button[2].Text) = 0) then + AddButtonText(14, 20, 'Button 3'); + + AddSelectSlide(Theme.SongMenu.SelectSlide3, SelectValue, ISelections); + + AddButton(Theme.SongMenu.Button4); + if (Length(Button[3].Text) = 0) then + AddButtonText(14, 20, 'Button 4'); + + AddText(Theme.SongMenu.TextMenu); + + for I := 0 to High(Theme.SongMenu.Static) do + AddStatic(Theme.SongMenu.Static[I]); + + for I := 0 to High(Theme.SongMenu.Text) do + AddText(Theme.SongMenu.Text[I]); + + Interaction := 0; +end; + +function TScreenSongMenu.Draw: boolean; +begin + inherited Draw; +end; + +procedure TScreenSongMenu.onShow; +begin + +end; + +procedure TScreenSongMenu.MenuShow(sMenu: Byte); +begin + Interaction := 0; //Reset Interaction + Case sMenu of + SM_Main: + begin + CurMenu := sMenu; + Text[0].Text := Language.Translate('SONG_MENU_NAME_MAIN'); + + Button[0].Visible := True; + Button[1].Visible := True; + Button[2].Visible := True; + Button[3].Visible := True; + SelectsS[0].Visible := False; + + Button[0].Text[0].Text := Language.Translate('SONG_MENU_PLAY'); + Button[1].Text[0].Text := Language.Translate('SONG_MENU_EDIT'); + Button[2].Text[0].Text := Language.Translate('SONG_MENU_PLAYMODI'); + Button[3].Text[0].Text := Language.Translate('SONG_MENU_CANCEL'); + end; + + SM_PlayList: + begin + CurMenu := sMenu; + Text[0].Text := Language.Translate('SONG_MENU_NAME_PLAYLIST'); + + 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_PLAYLIST_ADD'); + Button[1].Text[0].Text := ''; + Button[2].Text[0].Text := ''; + Button[3].Text[0].Text := Language.Translate('SONG_MENU_CANCEL'); + end; + + SM_Party_Main: + begin + CurMenu := sMenu; + Text[0].Text := Language.Translate('SONG_MENU_NAME_PARTY_MAIN'); + + 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_PLAY'); + Button[1].Text[0].Text := Language.Translate('SONG_MENU_JOKER'); + Button[2].Text[0].Text := Language.Translate('SONG_MENU_PLAYMODI'); + Button[3].Text[0].Text := Language.Translate('SONG_MENU_JOKER'); + end; + + SM_Party_Joker: + begin + CurMenu := sMenu; + Text[0].Text := Language.Translate('SONG_MENU_NAME_PARTY_JOKER'); + + Button[0].Visible := (PartySession.Teams.NumTeams >= 1) AND (PartySession.Teams.Teaminfo[0].Joker > 0); + Button[1].Visible := (PartySession.Teams.NumTeams >= 2) AND (PartySession.Teams.Teaminfo[1].Joker > 0); + Button[2].Visible := (PartySession.Teams.NumTeams >= 3) AND (PartySession.Teams.Teaminfo[2].Joker > 0); + Button[3].Visible := True; + SelectsS[0].Visible := False; + + Button[0].Text[0].Text := String(PartySession.Teams.Teaminfo[0].Name); + Button[1].Text[0].Text := String(PartySession.Teams.Teaminfo[1].Name); + Button[2].Text[0].Text := String(PartySession.Teams.Teaminfo[2].Name); + Button[3].Text[0].Text := Language.Translate('SONG_MENU_CANCEL'); + end; + end; +end; + +procedure TScreenSongMenu.HandleReturn; +begin + Case CurMenu of + SM_Main: + begin + Visible := False; + Case Interaction of + 0: //Button 1 + begin + ScreenSong.StartSong; + end; + + 1: //Button 2 + begin + ScreenSong.OpenEditor; + end; + + 2: //Button 3 + begin + //Todo: Add SingleRound Modi Support + end; + + 3: //SelectSlide 3 + begin + //Dummy + end; + + 4: //Button 4 + begin + //Cancel... (Do Nothing) + end; + end; + end; + + SM_PlayList: + begin + Visible := False; + Case Interaction of + 0: //Button 1 + begin + // + end; + + 1: //Button 2 + begin + // + end; + + 2: //Button 3 + begin + //Todo + end; + + 3: //SelectSlide 3 + begin + //Dummy + end; + + 4: //Button 4 + begin + // + end; + end; + end; + + SM_Party_Main: + begin + Case Interaction of + 0: //Button 1 + begin + //Start Singing + ScreenSong.StartSong; + Visible := False; + end; + + 4: //Button 4 + begin + //Joker + MenuShow(SM_Party_Joker); + end; + end; + end; + + SM_Party_Joker: + begin + Visible := False; + Case Interaction of + 0: //Button 1 + begin + //Joker Team 1 + ScreenSong.DoJoker(0); + end; + + 1: //Button 2 + begin + //Joker Team 2 + ScreenSong.DoJoker(1); + end; + + 2: //Button 3 + begin + //Joker Team 3 + ScreenSong.DoJoker(2); + end; + + 4: //Button 4 + begin + //Cancel... (Fo back to old Menu) + MenuShow(SM_Party_Main); + end; + end; + end; + end; +end; + +end. + \ No newline at end of file -- cgit v1.2.3 From 3ba33f8e920a9e9a3114f159e2b6fda4273a6efb Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Wed, 28 Mar 2007 13:08:41 +0000 Subject: Added Jumpto Ability to SongScreen (Press J) Fixed: Golden Notes are not shown in PartyMode git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@39 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSongMenu.pas | 1 + 1 file changed, 1 insertion(+) (limited to 'Game/Code/Screens/UScreenSongMenu.pas') diff --git a/Game/Code/Screens/UScreenSongMenu.pas b/Game/Code/Screens/UScreenSongMenu.pas index 2a03a7c2..a5ae2083 100644 --- a/Game/Code/Screens/UScreenSongMenu.pas +++ b/Game/Code/Screens/UScreenSongMenu.pas @@ -165,6 +165,7 @@ end; procedure TScreenSongMenu.MenuShow(sMenu: Byte); begin Interaction := 0; //Reset Interaction + Visible := True; //Set Visible Case sMenu of SM_Main: begin -- cgit v1.2.3 From e2cd03822f28a4866f98fb0893a73b02bd60ce03 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Thu, 5 Apr 2007 14:37:58 +0000 Subject: Added Playlist Support Working correct with Standard Mode Only for now Now working on Playlist Support for Party Mode git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@59 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSongMenu.pas | 242 +++++++++++++++++++++++++++++++--- 1 file changed, 224 insertions(+), 18 deletions(-) (limited to 'Game/Code/Screens/UScreenSongMenu.pas') diff --git a/Game/Code/Screens/UScreenSongMenu.pas b/Game/Code/Screens/UScreenSongMenu.pas index a5ae2083..849716c4 100644 --- a/Game/Code/Screens/UScreenSongMenu.pas +++ b/Game/Code/Screens/UScreenSongMenu.pas @@ -22,7 +22,16 @@ type const SM_Main = 1; + SM_PlayList = 64 or 1; + SM_Playlist_Add = 64 or 2; + SM_Playlist_New = 64 or 3; + + SM_Playlist_Del = 64 or 5; + + SM_Playlist_Load = 64 or 8 or 1; + + SM_Party_Main = 128 or 1; SM_Party_Joker = 128 or 2; @@ -33,7 +42,7 @@ var implementation -uses UGraphic, UMain, UIni, UTexture, ULanguage, UParty; +uses UGraphic, UMain, UIni, UTexture, ULanguage, UParty, UPlaylist; function TScreenSongMenu.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; function IsVisible: Boolean; @@ -70,6 +79,23 @@ begin Result := true; If (PressedDown) Then begin // Key Down + if (CurMenu = SM_Playlist_New) AND (Interaction=0) then + begin + case PressedKey of + SDLK_0..SDLK_9, SDLK_A..SDLK_Z, SDLK_SPACE, SDLK_MINUS, SDLK_EXCLAIM, SDLK_COMMA, SDLK_SLASH, SDLK_ASTERISK, SDLK_QUESTION, SDLK_QUOTE, SDLK_QUOTEDBL: + begin + Button[Interaction].Text[0].Text := Button[Interaction].Text[0].Text + chr(ScanCode); + exit; + end; + + SDLK_BACKSPACE: + begin + Button[Interaction].Text[0].DeleteLastL; + exit; + end; + end; + end; + case PressedKey of SDLK_Q: begin @@ -87,9 +113,6 @@ begin HandleReturn; end; - // Up and Down could be done at the same time, - // but I don't want to declare variables inside - // functions like this one, called so many times SDLK_DOWN: SelectNext; SDLK_UP: SelectPrev; @@ -179,9 +202,9 @@ begin SelectsS[0].Visible := False; Button[0].Text[0].Text := Language.Translate('SONG_MENU_PLAY'); - Button[1].Text[0].Text := Language.Translate('SONG_MENU_EDIT'); - Button[2].Text[0].Text := Language.Translate('SONG_MENU_PLAYMODI'); - Button[3].Text[0].Text := Language.Translate('SONG_MENU_CANCEL'); + Button[1].Text[0].Text := Language.Translate('SONG_MENU_CHANGEPLAYERS'); + Button[2].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_ADD'); + Button[3].Text[0].Text := Language.Translate('SONG_MENU_EDIT'); end; SM_PlayList: @@ -189,18 +212,111 @@ begin CurMenu := sMenu; Text[0].Text := Language.Translate('SONG_MENU_NAME_PLAYLIST'); + Button[0].Visible := True; + Button[1].Visible := True; + Button[2].Visible := True; + Button[3].Visible := True; + SelectsS[0].Visible := False; + + Button[0].Text[0].Text := Language.Translate('SONG_MENU_PLAY'); + Button[1].Text[0].Text := Language.Translate('SONG_MENU_CHANGEPLAYERS'); + Button[2].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_DEL'); + Button[3].Text[0].Text := Language.Translate('SONG_MENU_EDIT'); + end; + + SM_Playlist_Add: + begin + CurMenu := sMenu; + Text[0].Text := Language.Translate('SONG_MENU_NAME_PLAYLIST_ADD'); + + Button[0].Visible := True; + 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_ADD_NEW'); + Button[3].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_ADD_EXISTING'); + + SetLength(ISelections, Length(PlaylistMan.Playlists)); + PlaylistMan.GetNames(ISelections); + + if (Length(ISelections)>=1) then + begin + UpdateSelectSlideOptions(Theme.SongMenu.SelectSlide3, 0, ISelections, SelectValue); + end + else + begin + Button[3].Visible := False; + SelectsS[0].Visible := False; + Button[2].Visible := True; + Button[3].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_NOEXISTING'); + end; + end; + + SM_Playlist_New: + begin + CurMenu := sMenu; + Text[0].Text := Language.Translate('SONG_MENU_NAME_PLAYLIST_NEW'); + + Button[0].Visible := True; + Button[1].Visible := False; + Button[2].Visible := True; + Button[3].Visible := True; + SelectsS[0].Visible := False; + + Button[0].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_NEW_UNNAMED'); + Button[2].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_NEW_CREATE'); + Button[3].Text[0].Text := Language.Translate('SONG_MENU_CANCEL'); + 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_PLAYLIST_ADD'); - Button[1].Text[0].Text := ''; - Button[2].Text[0].Text := ''; + Button[0].Text[0].Text := Language.Translate('SONG_MENU_YES'); Button[3].Text[0].Text := Language.Translate('SONG_MENU_CANCEL'); end; + SM_Playlist_Load: + begin + CurMenu := sMenu; + Text[0].Text := Language.Translate('SONG_MENU_NAME_PLAYLIST_LOAD'); + + Button[0].Visible := False; + Button[1].Visible := False; + Button[2].Visible := False; + Button[3].Visible := True; + SelectsS[0].Visible := True; + + Button[3].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_LOAD'); + + SetLength(ISelections, Length(PlaylistMan.Playlists)); + PlaylistMan.GetNames(ISelections); + + if (Length(ISelections)>=1) then + begin + UpdateSelectSlideOptions(Theme.SongMenu.SelectSlide3, 0, ISelections, SelectValue); + Interaction := 4; + end + else + begin + Button[3].Visible := False; + SelectsS[0].Visible := False; + Button[2].Visible := True; + Button[3].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_NOEXISTING'); + Interaction := 3; + end; + end; + + SM_Party_Main: begin CurMenu := sMenu; @@ -242,21 +358,24 @@ begin Case CurMenu of SM_Main: begin - Visible := False; Case Interaction of 0: //Button 1 begin ScreenSong.StartSong; + Visible := False; end; 1: //Button 2 begin - ScreenSong.OpenEditor; + //Select New Players then Sing: + + Visible := False; end; 2: //Button 3 begin - //Todo: Add SingleRound Modi Support + //Show add to Playlist Menu + MenuShow(SM_Playlist_Add); end; 3: //SelectSlide 3 @@ -266,7 +385,8 @@ begin 4: //Button 4 begin - //Cancel... (Do Nothing) + ScreenSong.OpenEditor; + Visible := False; end; end; end; @@ -277,17 +397,21 @@ begin Case Interaction of 0: //Button 1 begin - // + ScreenSong.StartSong; + Visible := False; end; 1: //Button 2 begin - // + //Select New Players then Sing: + + Visible := False; end; 2: //Button 3 begin - //Todo + //Show add to Playlist Menu + MenuShow(SM_Playlist_Del); end; 3: //SelectSlide 3 @@ -297,7 +421,89 @@ begin 4: //Button 4 begin - // + ScreenSong.OpenEditor; + Visible := False; + end; + end; + end; + + SM_Playlist_Add: + begin + Case Interaction of + 0: //Button 1 + begin + MenuShow(SM_Playlist_New); + end; + + 3: //SelectSlide 3 + begin + //Dummy + end; + + 4: //Button 4 + begin + PlaylistMan.AddItem(ScreenSong.Interaction, SelectValue); + Visible := False; + end; + end; + end; + + SM_Playlist_New: + begin + Case Interaction of + 0: //Button 1 + begin + //Nothing, Button for Entering Name + end; + + 2: //Button 3 + begin + //Create Playlist and Add Song + PlaylistMan.AddItem( + ScreenSong.Interaction, + PlaylistMan.AddPlaylist(Button[0].Text[0].Text)); + Visible := False; + end; + + 3: //SelectSlide 3 + begin + //Cancel -> Go back to Add screen + MenuShow(SM_Playlist_Add); + end; + + 4: //Button 4 + begin + Visible := False; + end; + end; + end; + + SM_PlayList_Del: + begin + Visible := False; + Case Interaction of + 0: //Button 1 + begin + //Delete + PlayListMan.DelItem(PlayListMan.GetIndexbySongID(ScreenSong.Interaction)); + Visible := False; + end; + + 4: //Button 4 + begin + MenuShow(SM_Playlist); + end; + end; + end; + + SM_Playlist_Load: + begin + Case Interaction of + 4: //Button 4 + begin + //Load Playlist + PlaylistMan.SetPlayList(SelectValue); + Visible := False; end; end; end; -- cgit v1.2.3 From 966955d94331c4cf78e16215bf2c30268be035ed Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Thu, 5 Apr 2007 14:49:46 +0000 Subject: Fixed a spelling mistake in ScreenSongMenu Translation Texts Fixed Set wrong Interaction in Playlist Load Menu git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@60 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSongMenu.pas | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Game/Code/Screens/UScreenSongMenu.pas') diff --git a/Game/Code/Screens/UScreenSongMenu.pas b/Game/Code/Screens/UScreenSongMenu.pas index 849716c4..0b4a9d91 100644 --- a/Game/Code/Screens/UScreenSongMenu.pas +++ b/Game/Code/Screens/UScreenSongMenu.pas @@ -273,7 +273,7 @@ begin SM_PlayList_Del: begin CurMenu := sMenu; - Text[0].Text := Language.Translate('SONG_MENU_NAME_PLAYLIST_Del'); + Text[0].Text := Language.Translate('SONG_MENU_NAME_PLAYLIST_DEL'); Button[0].Visible := True; Button[1].Visible := False; @@ -304,7 +304,7 @@ begin if (Length(ISelections)>=1) then begin UpdateSelectSlideOptions(Theme.SongMenu.SelectSlide3, 0, ISelections, SelectValue); - Interaction := 4; + Interaction := 3; end else begin @@ -312,7 +312,7 @@ begin SelectsS[0].Visible := False; Button[2].Visible := True; Button[3].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_NOEXISTING'); - Interaction := 3; + Interaction := 2; end; end; -- cgit v1.2.3 From 9d01c8801db29d6ff3d64ef81b84321549d84688 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Thu, 5 Apr 2007 21:09:52 +0000 Subject: Added Advanced Screen and Options in TIni Options working now only for Effect Perfect and Effect Golden. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@65 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSongMenu.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Game/Code/Screens/UScreenSongMenu.pas') diff --git a/Game/Code/Screens/UScreenSongMenu.pas b/Game/Code/Screens/UScreenSongMenu.pas index 0b4a9d91..3ccba228 100644 --- a/Game/Code/Screens/UScreenSongMenu.pas +++ b/Game/Code/Screens/UScreenSongMenu.pas @@ -250,7 +250,7 @@ begin Button[3].Visible := False; SelectsS[0].Visible := False; Button[2].Visible := True; - Button[3].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_NOEXISTING'); + Button[2].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_NOEXISTING'); end; end; @@ -311,7 +311,7 @@ begin Button[3].Visible := False; SelectsS[0].Visible := False; Button[2].Visible := True; - Button[3].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_NOEXISTING'); + Button[2].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_NOEXISTING'); Interaction := 2; end; end; -- cgit v1.2.3 From e79530fd2165c92a9291076b05dfb0e0236fc222 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Tue, 24 Apr 2007 12:59:54 +0000 Subject: Added ability to Select Players before Song Make Option OnSongClick Work git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@131 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSongMenu.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Game/Code/Screens/UScreenSongMenu.pas') diff --git a/Game/Code/Screens/UScreenSongMenu.pas b/Game/Code/Screens/UScreenSongMenu.pas index 3ccba228..699e0b92 100644 --- a/Game/Code/Screens/UScreenSongMenu.pas +++ b/Game/Code/Screens/UScreenSongMenu.pas @@ -368,7 +368,7 @@ begin 1: //Button 2 begin //Select New Players then Sing: - + ScreenSong.SelectPlayers; Visible := False; end; -- cgit v1.2.3 From 4ca6b721c705fb98e3dd7f952403e600ddee9238 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Tue, 24 Apr 2007 13:09:36 +0000 Subject: Fixed: Select a not Visible Button in Joker Menu, if the first Team has no Joker git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@133 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSongMenu.pas | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'Game/Code/Screens/UScreenSongMenu.pas') diff --git a/Game/Code/Screens/UScreenSongMenu.pas b/Game/Code/Screens/UScreenSongMenu.pas index 699e0b92..d4ad8016 100644 --- a/Game/Code/Screens/UScreenSongMenu.pas +++ b/Game/Code/Screens/UScreenSongMenu.pas @@ -329,8 +329,8 @@ begin SelectsS[0].Visible := False; Button[0].Text[0].Text := Language.Translate('SONG_MENU_PLAY'); - Button[1].Text[0].Text := Language.Translate('SONG_MENU_JOKER'); - Button[2].Text[0].Text := Language.Translate('SONG_MENU_PLAYMODI'); + //Button[1].Text[0].Text := Language.Translate('SONG_MENU_JOKER'); + //Button[2].Text[0].Text := Language.Translate('SONG_MENU_PLAYMODI'); Button[3].Text[0].Text := Language.Translate('SONG_MENU_JOKER'); end; @@ -349,6 +349,21 @@ begin Button[1].Text[0].Text := String(PartySession.Teams.Teaminfo[1].Name); Button[2].Text[0].Text := String(PartySession.Teams.Teaminfo[2].Name); Button[3].Text[0].Text := Language.Translate('SONG_MENU_CANCEL'); + + //Set right Interaction + if (not Button[0].Visible) then + begin + if (not Button[1].Visible) then + begin + if (not Button[2].Visible) then + begin + Interaction := 4; + end + else Interaction := 2; + end + else Interaction := 1; + end; + end; end; end; -- cgit v1.2.3 From bda4fa8e57ca63a1d591433f120b4226d6a5d327 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Sun, 29 Apr 2007 17:50:29 +0000 Subject: Added 2 new Buttons to ScreenMain: Multi and Stats Updated Language Fiels to Fit with new Buttons Some CodeClean Up in Menu Class and in Screens Some minor Bug fixes I forgot about Added ability to group Buttons within a Screen New Theme Object: ButtonCollection: Same Attributes as a Button Plus FirstChild: Defining the First Button in the Group. For Example: SingSolo is 1, SingMulti Button is 2, in ScreenMain Added Attribute to Theme Button: Parent: Number of the assigned Group, 0 for no Group Used new Abilitys in MainScreen git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@149 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSongMenu.pas | 48 ++++++----------------------------- 1 file changed, 8 insertions(+), 40 deletions(-) (limited to 'Game/Code/Screens/UScreenSongMenu.pas') diff --git a/Game/Code/Screens/UScreenSongMenu.pas b/Game/Code/Screens/UScreenSongMenu.pas index d4ad8016..fd875527 100644 --- a/Game/Code/Screens/UScreenSongMenu.pas +++ b/Game/Code/Screens/UScreenSongMenu.pas @@ -45,36 +45,6 @@ implementation uses UGraphic, UMain, UIni, UTexture, ULanguage, UParty, UPlaylist; function TScreenSongMenu.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; - function IsVisible: Boolean; - begin - Result := True; - if (Interactions[Interaction].Typ = 0) then - begin - Result := Button[Interactions[Interaction].Num].Visible; - end - else if (Interactions[Interaction].Typ = 1) then - begin - //Result := Selects[Interactions[Interaction].Num].Visible; - end - else if (Interactions[Interaction].Typ = 3) then - begin - Result := SelectsS[Interactions[Interaction].Num].Visible; - end; - end; - - Procedure SelectNext; - begin - repeat - InteractNext; - until IsVisible; - end; - - Procedure SelectPrev; - begin - repeat - InteractPrev; - until IsVisible; - end; begin Result := true; If (PressedDown) Then @@ -113,8 +83,8 @@ begin HandleReturn; end; - SDLK_DOWN: SelectNext; - SDLK_UP: SelectPrev; + SDLK_DOWN: InteractNext; + SDLK_UP: InteractPrev; SDLK_RIGHT: begin @@ -141,10 +111,15 @@ var I: integer; begin inherited Create; + + //Create Dummy SelectSlide Entrys SetLength(ISelections, 1); ISelections[0] := 'Dummy'; - AddBackground(Theme.SongMenu.Background.Tex); + + AddText(Theme.SongMenu.TextMenu); + + LoadFromTheme(Theme.SongMenu); AddButton(Theme.SongMenu.Button1); if (Length(Button[0].Text) = 0) then @@ -164,13 +139,6 @@ begin if (Length(Button[3].Text) = 0) then AddButtonText(14, 20, 'Button 4'); - AddText(Theme.SongMenu.TextMenu); - - for I := 0 to High(Theme.SongMenu.Static) do - AddStatic(Theme.SongMenu.Static[I]); - - for I := 0 to High(Theme.SongMenu.Text) do - AddText(Theme.SongMenu.Text[I]); Interaction := 0; end; -- cgit v1.2.3 From b61e647b67ac0d449d764b89b117a3ac8b603403 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Tue, 8 May 2007 19:00:47 +0000 Subject: Readded Q Shortcut (Exit Application) on all Screens Clean up Popup Code a little bit git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@180 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSongMenu.pas | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'Game/Code/Screens/UScreenSongMenu.pas') diff --git a/Game/Code/Screens/UScreenSongMenu.pas b/Game/Code/Screens/UScreenSongMenu.pas index fd875527..73b38a05 100644 --- a/Game/Code/Screens/UScreenSongMenu.pas +++ b/Game/Code/Screens/UScreenSongMenu.pas @@ -97,13 +97,7 @@ begin InteractDec; end; end; - end - else // Key Up - case PressedKey of - SDLK_RETURN : - begin - end; - end; + end; end; constructor TScreenSongMenu.Create; -- cgit v1.2.3 From 66f4c5511f1cc61b68e75d874ea6a1dc88f9e75a Mon Sep 17 00:00:00 2001 From: mota23 Date: Tue, 15 May 2007 18:04:42 +0000 Subject: Added: Keys 1.2.3 to use Joker in Popup-Party-Menu Added: 2 sets of Statics for Song-Screen. (need work, just startet) Some Fixes in Deluxe Theme. (missing texts, fixed positions etc.) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@194 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSongMenu.pas | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'Game/Code/Screens/UScreenSongMenu.pas') diff --git a/Game/Code/Screens/UScreenSongMenu.pas b/Game/Code/Screens/UScreenSongMenu.pas index 73b38a05..537536bb 100644 --- a/Game/Code/Screens/UScreenSongMenu.pas +++ b/Game/Code/Screens/UScreenSongMenu.pas @@ -96,6 +96,39 @@ begin if (Interaction=3) then InteractDec; end; + + SDLK_1: + begin //Jocker + //Joker spielen + case CurMenu of + SM_Party_Main: + begin + ScreenSong.DoJoker(0) + end; + end; + end; + SDLK_2: + begin //Jocker + //Joker spielen + case CurMenu of + SM_Party_Main: + begin + ScreenSong.DoJoker(1) + end; + end; + end; + SDLK_3: + begin //Jocker + //Joker spielen + case CurMenu of + SM_Party_Main: + begin + ScreenSong.DoJoker(2) + end; + end; + end; + + end; end; end; -- cgit v1.2.3 From 4a731514163a14bd3a9222d99707880b56772663 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Wed, 16 May 2007 19:19:35 +0000 Subject: all SongFile Loading and Saving procedures moved to UFiles. Added Some Tolerance in Song File Loading and Song Header Loading. Fix: Programm doesn't Crash anymore when a coruppted Song is loaded for Singing or Editing. Now Jump back to SongScreen and show an Error Message. Also Party Mode is not Interupted, a new Song will be selected automatically. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@197 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSongMenu.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Game/Code/Screens/UScreenSongMenu.pas') diff --git a/Game/Code/Screens/UScreenSongMenu.pas b/Game/Code/Screens/UScreenSongMenu.pas index 537536bb..2469240f 100644 --- a/Game/Code/Screens/UScreenSongMenu.pas +++ b/Game/Code/Screens/UScreenSongMenu.pas @@ -3,7 +3,7 @@ unit UScreenSongMenu; interface uses - UMenu, SDL, UDisplay, UMusic, UPliki, SysUtils, UThemes; + UMenu, SDL, UDisplay, UMusic, UFiles, SysUtils, UThemes; type TScreenSongMenu = class(TMenu) -- cgit v1.2.3 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/UScreenSongMenu.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Game/Code/Screens/UScreenSongMenu.pas') diff --git a/Game/Code/Screens/UScreenSongMenu.pas b/Game/Code/Screens/UScreenSongMenu.pas index 2469240f..3814334c 100644 --- a/Game/Code/Screens/UScreenSongMenu.pas +++ b/Game/Code/Screens/UScreenSongMenu.pas @@ -414,7 +414,7 @@ begin 1: //Button 2 begin //Select New Players then Sing: - + ScreenSong.SelectPlayers; Visible := False; end; -- cgit v1.2.3 From 4131257e42ceb88fa4fb2849b5c40011e8b5635d Mon Sep 17 00:00:00 2001 From: whiteshark0 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/UScreenSongMenu.pas') 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 From 3043d3db91c3a541881aa951bbd4f8ccb5e3ce40 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Wed, 5 Sep 2007 12:35:19 +0000 Subject: modified ParseInput so Backspace will perform same function as ESC in most screens ( Except where text input is required, and backspace is used for text input ) This has been done, so that when used with Windows Media Center IR Remotes ( needs SDL 1.2 dll at runtime ) users can navigate throug the game without sitting in front of the PC keyboard. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@370 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSongMenu.pas | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Game/Code/Screens/UScreenSongMenu.pas') diff --git a/Game/Code/Screens/UScreenSongMenu.pas b/Game/Code/Screens/UScreenSongMenu.pas index 06b8f183..9fe70522 100644 --- a/Game/Code/Screens/UScreenSongMenu.pas +++ b/Game/Code/Screens/UScreenSongMenu.pas @@ -73,7 +73,9 @@ begin Result := false; end; - SDLK_ESCAPE : + + SDLK_ESCAPE, + SDLK_BACKSPACE : begin Music.PlayBack; Visible := False; -- cgit v1.2.3 From 433a1b7339e2bf96f3b0bb4c98b8c799c6540027 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Tue, 18 Sep 2007 13:19:20 +0000 Subject: changes in order to compile in lazarus... minor tidy ups and removal of big old comment blocks.. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@394 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSongMenu.pas | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Game/Code/Screens/UScreenSongMenu.pas') diff --git a/Game/Code/Screens/UScreenSongMenu.pas b/Game/Code/Screens/UScreenSongMenu.pas index 9fe70522..41432356 100644 --- a/Game/Code/Screens/UScreenSongMenu.pas +++ b/Game/Code/Screens/UScreenSongMenu.pas @@ -2,6 +2,10 @@ unit UScreenSongMenu; interface +{$IFDEF FPC} + {$MODE DELPHI} +{$ENDIF} + uses UMenu, SDL, UDisplay, UMusic, UFiles, SysUtils, UThemes; @@ -612,4 +616,4 @@ begin end; end. - \ No newline at end of file + -- cgit v1.2.3 From db82b7e30a1b58b56fdb4bfc6089b47200ca1da1 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Thu, 20 Sep 2007 06:36:58 +0000 Subject: Ultrastar-DX now compiles in linux (using lazarus) Bass etc is commented out.. but it compiles, and im working through the runtime errors. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@408 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSongMenu.pas | 1251 +++++++++++++++++---------------- 1 file changed, 632 insertions(+), 619 deletions(-) (limited to 'Game/Code/Screens/UScreenSongMenu.pas') diff --git a/Game/Code/Screens/UScreenSongMenu.pas b/Game/Code/Screens/UScreenSongMenu.pas index 41432356..ce331e2f 100644 --- a/Game/Code/Screens/UScreenSongMenu.pas +++ b/Game/Code/Screens/UScreenSongMenu.pas @@ -1,619 +1,632 @@ -unit UScreenSongMenu; - -interface - -{$IFDEF FPC} - {$MODE DELPHI} -{$ENDIF} - -uses - UMenu, SDL, UDisplay, UMusic, UFiles, SysUtils, UThemes; - -type - TScreenSongMenu = class(TMenu) - private - CurMenu: Byte; //Num of the cur. Shown Menu - public - Visible: Boolean; //Whether the Menu should be Drawn - - constructor Create; override; - function ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; override; - procedure onShow; override; - function Draw: boolean; override; - procedure MenuShow(sMenu: Byte); - procedure HandleReturn; - end; - -const - SM_Main = 1; - - SM_PlayList = 64 or 1; - SM_Playlist_Add = 64 or 2; - SM_Playlist_New = 64 or 3; - - 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; - SM_Party_Joker = 128 or 2; - -var - ISelections: Array of String; - SelectValue: Integer; - - -implementation - -uses UGraphic, UMain, UIni, UTexture, ULanguage, UParty, UPlaylist, USongs; - -function TScreenSongMenu.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; -begin - Result := true; - If (PressedDown) Then - begin // Key Down - if (CurMenu = SM_Playlist_New) AND (Interaction=0) then - begin - case PressedKey of - SDLK_0..SDLK_9, SDLK_A..SDLK_Z, SDLK_SPACE, SDLK_MINUS, SDLK_EXCLAIM, SDLK_COMMA, SDLK_SLASH, SDLK_ASTERISK, SDLK_QUESTION, SDLK_QUOTE, SDLK_QUOTEDBL: - begin - Button[Interaction].Text[0].Text := Button[Interaction].Text[0].Text + chr(ScanCode); - exit; - end; - - SDLK_BACKSPACE: - begin - Button[Interaction].Text[0].DeleteLastL; - exit; - end; - end; - end; - - case PressedKey of - SDLK_Q: - begin - Result := false; - end; - - - SDLK_ESCAPE, - SDLK_BACKSPACE : - begin - Music.PlayBack; - Visible := False; - end; - - SDLK_RETURN: - begin - HandleReturn; - end; - - SDLK_DOWN: InteractNext; - SDLK_UP: InteractPrev; - - SDLK_RIGHT: - begin - if (Interaction=3) then - InteractInc; - end; - SDLK_LEFT: - begin - if (Interaction=3) then - InteractDec; - end; - - SDLK_1: - begin //Jocker - //Joker spielen - case CurMenu of - SM_Party_Main: - begin - ScreenSong.DoJoker(0) - end; - end; - end; - SDLK_2: - begin //Jocker - //Joker spielen - case CurMenu of - SM_Party_Main: - begin - ScreenSong.DoJoker(1) - end; - end; - end; - SDLK_3: - begin //Jocker - //Joker spielen - case CurMenu of - SM_Party_Main: - begin - ScreenSong.DoJoker(2) - end; - end; - end; - - - end; - end; -end; - -constructor TScreenSongMenu.Create; -var - I: integer; -begin - inherited Create; - - //Create Dummy SelectSlide Entrys - SetLength(ISelections, 1); - ISelections[0] := 'Dummy'; - - - AddText(Theme.SongMenu.TextMenu); - - LoadFromTheme(Theme.SongMenu); - - AddButton(Theme.SongMenu.Button1); - if (Length(Button[0].Text) = 0) then - AddButtonText(14, 20, 'Button 1'); - - AddButton(Theme.SongMenu.Button2); - if (Length(Button[1].Text) = 0) then - AddButtonText(14, 20, 'Button 2'); - - AddButton(Theme.SongMenu.Button3); - if (Length(Button[2].Text) = 0) then - AddButtonText(14, 20, 'Button 3'); - - AddSelectSlide(Theme.SongMenu.SelectSlide3, SelectValue, ISelections); - - AddButton(Theme.SongMenu.Button4); - if (Length(Button[3].Text) = 0) then - AddButtonText(14, 20, 'Button 4'); - - - Interaction := 0; -end; - -function TScreenSongMenu.Draw: boolean; -begin - inherited Draw; -end; - -procedure TScreenSongMenu.onShow; -begin - -end; - -procedure TScreenSongMenu.MenuShow(sMenu: Byte); -begin - Interaction := 0; //Reset Interaction - Visible := True; //Set Visible - Case sMenu of - SM_Main: - begin - CurMenu := sMenu; - Text[0].Text := Language.Translate('SONG_MENU_NAME_MAIN'); - - Button[0].Visible := True; - Button[1].Visible := True; - Button[2].Visible := True; - Button[3].Visible := True; - SelectsS[0].Visible := False; - - Button[0].Text[0].Text := Language.Translate('SONG_MENU_PLAY'); - Button[1].Text[0].Text := Language.Translate('SONG_MENU_CHANGEPLAYERS'); - Button[2].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_ADD'); - Button[3].Text[0].Text := Language.Translate('SONG_MENU_EDIT'); - end; - - SM_PlayList: - begin - CurMenu := sMenu; - Text[0].Text := Language.Translate('SONG_MENU_NAME_PLAYLIST'); - - Button[0].Visible := True; - Button[1].Visible := True; - Button[2].Visible := True; - Button[3].Visible := True; - SelectsS[0].Visible := False; - - Button[0].Text[0].Text := Language.Translate('SONG_MENU_PLAY'); - Button[1].Text[0].Text := Language.Translate('SONG_MENU_CHANGEPLAYERS'); - Button[2].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_DEL'); - Button[3].Text[0].Text := Language.Translate('SONG_MENU_EDIT'); - end; - - SM_Playlist_Add: - begin - CurMenu := sMenu; - Text[0].Text := Language.Translate('SONG_MENU_NAME_PLAYLIST_ADD'); - - Button[0].Visible := True; - 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_ADD_NEW'); - Button[3].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_ADD_EXISTING'); - - SetLength(ISelections, Length(PlaylistMan.Playlists)); - PlaylistMan.GetNames(ISelections); - - if (Length(ISelections)>=1) then - begin - UpdateSelectSlideOptions(Theme.SongMenu.SelectSlide3, 0, ISelections, SelectValue); - end - else - begin - Button[3].Visible := False; - SelectsS[0].Visible := False; - Button[2].Visible := True; - Button[2].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_NOEXISTING'); - end; - end; - - SM_Playlist_New: - begin - CurMenu := sMenu; - Text[0].Text := Language.Translate('SONG_MENU_NAME_PLAYLIST_NEW'); - - Button[0].Visible := True; - Button[1].Visible := False; - Button[2].Visible := True; - Button[3].Visible := True; - SelectsS[0].Visible := False; - - Button[0].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_NEW_UNNAMED'); - Button[2].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_NEW_CREATE'); - Button[3].Text[0].Text := Language.Translate('SONG_MENU_CANCEL'); - end; - - SM_Playlist_DelItem: - begin - CurMenu := sMenu; - Text[0].Text := Language.Translate('SONG_MENU_NAME_PLAYLIST_DELITEM'); - - 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_Playlist_Load: - begin - CurMenu := sMenu; - Text[0].Text := Language.Translate('SONG_MENU_NAME_PLAYLIST_LOAD'); - - //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)); - PlaylistMan.GetNames(ISelections); - - if (Length(ISelections)>=1) then - begin - UpdateSelectSlideOptions(Theme.SongMenu.SelectSlide3, 0, ISelections, SelectValue); - Interaction := 3; - end - else - begin - Button[3].Visible := False; - SelectsS[0].Visible := False; - Button[2].Visible := True; - Button[2].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_NOEXISTING'); - Interaction := 2; - 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 - CurMenu := sMenu; - Text[0].Text := Language.Translate('SONG_MENU_NAME_PARTY_MAIN'); - - 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_PLAY'); - //Button[1].Text[0].Text := Language.Translate('SONG_MENU_JOKER'); - //Button[2].Text[0].Text := Language.Translate('SONG_MENU_PLAYMODI'); - Button[3].Text[0].Text := Language.Translate('SONG_MENU_JOKER'); - end; - - SM_Party_Joker: - begin - CurMenu := sMenu; - Text[0].Text := Language.Translate('SONG_MENU_NAME_PARTY_JOKER'); - - Button[0].Visible := (PartySession.Teams.NumTeams >= 1) AND (PartySession.Teams.Teaminfo[0].Joker > 0); - Button[1].Visible := (PartySession.Teams.NumTeams >= 2) AND (PartySession.Teams.Teaminfo[1].Joker > 0); - Button[2].Visible := (PartySession.Teams.NumTeams >= 3) AND (PartySession.Teams.Teaminfo[2].Joker > 0); - Button[3].Visible := True; - SelectsS[0].Visible := False; - - Button[0].Text[0].Text := String(PartySession.Teams.Teaminfo[0].Name); - Button[1].Text[0].Text := String(PartySession.Teams.Teaminfo[1].Name); - Button[2].Text[0].Text := String(PartySession.Teams.Teaminfo[2].Name); - Button[3].Text[0].Text := Language.Translate('SONG_MENU_CANCEL'); - - //Set right Interaction - if (not Button[0].Visible) then - begin - if (not Button[1].Visible) then - begin - if (not Button[2].Visible) then - begin - Interaction := 4; - end - else Interaction := 2; - end - else Interaction := 1; - end; - - end; - end; -end; - -procedure TScreenSongMenu.HandleReturn; -begin - Case CurMenu of - SM_Main: - begin - Case Interaction of - 0: //Button 1 - begin - ScreenSong.StartSong; - Visible := False; - end; - - 1: //Button 2 - begin - //Select New Players then Sing: - ScreenSong.SelectPlayers; - Visible := False; - end; - - 2: //Button 3 - begin - //Show add to Playlist Menu - MenuShow(SM_Playlist_Add); - end; - - 3: //SelectSlide 3 - begin - //Dummy - end; - - 4: //Button 4 - begin - ScreenSong.OpenEditor; - Visible := False; - end; - end; - end; - - SM_PlayList: - begin - Visible := False; - Case Interaction of - 0: //Button 1 - begin - ScreenSong.StartSong; - Visible := False; - end; - - 1: //Button 2 - begin - //Select New Players then Sing: - ScreenSong.SelectPlayers; - Visible := False; - end; - - 2: //Button 3 - begin - //Show add to Playlist Menu - MenuShow(SM_Playlist_DelItem); - end; - - 3: //SelectSlide 3 - begin - //Dummy - end; - - 4: //Button 4 - begin - ScreenSong.OpenEditor; - Visible := False; - end; - end; - end; - - SM_Playlist_Add: - begin - Case Interaction of - 0: //Button 1 - begin - MenuShow(SM_Playlist_New); - end; - - 3: //SelectSlide 3 - begin - //Dummy - end; - - 4: //Button 4 - begin - PlaylistMan.AddItem(ScreenSong.Interaction, SelectValue); - Visible := False; - end; - end; - end; - - SM_Playlist_New: - begin - Case Interaction of - 0: //Button 1 - begin - //Nothing, Button for Entering Name - end; - - 2: //Button 3 - begin - //Create Playlist and Add Song - PlaylistMan.AddItem( - ScreenSong.Interaction, - PlaylistMan.AddPlaylist(Button[0].Text[0].Text)); - Visible := False; - end; - - 3: //SelectSlide 3 - begin - //Cancel -> Go back to Add screen - MenuShow(SM_Playlist_Add); - end; - - 4: //Button 4 - begin - Visible := False; - end; - end; - end; - - SM_Playlist_DelItem: - begin - Visible := False; - Case Interaction of - 0: //Button 1 - begin - //Delete - PlayListMan.DelItem(PlayListMan.GetIndexbySongID(ScreenSong.Interaction)); - Visible := False; - end; - - 4: //Button 4 - begin - MenuShow(SM_Playlist); - end; - end; - end; - - SM_Playlist_Load: - begin - Case Interaction of - 0: //Button 1 (Delete Playlist) - begin - MenuShow(SM_Playlist_Del); - end; - 4: //Button 4 - begin - //Load Playlist - PlaylistMan.SetPlayList(SelectValue); - Visible := False; - end; - 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 - 0: //Button 1 - begin - //Start Singing - ScreenSong.StartSong; - Visible := False; - end; - - 4: //Button 4 - begin - //Joker - MenuShow(SM_Party_Joker); - end; - end; - end; - - SM_Party_Joker: - begin - Visible := False; - Case Interaction of - 0: //Button 1 - begin - //Joker Team 1 - ScreenSong.DoJoker(0); - end; - - 1: //Button 2 - begin - //Joker Team 2 - ScreenSong.DoJoker(1); - end; - - 2: //Button 3 - begin - //Joker Team 3 - ScreenSong.DoJoker(2); - end; - - 4: //Button 4 - begin - //Cancel... (Fo back to old Menu) - MenuShow(SM_Party_Main); - end; - end; - end; - end; -end; - -end. - +unit UScreenSongMenu; + +interface + +{$IFDEF FPC} + {$MODE DELPHI} +{$ENDIF} + +uses + UMenu, + SDL, + UDisplay, + UMusic, + UFiles, + SysUtils, + UThemes; + +type + TScreenSongMenu = class(TMenu) + private + CurMenu: Byte; //Num of the cur. Shown Menu + public + Visible: Boolean; //Whether the Menu should be Drawn + + constructor Create; override; + function ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; override; + procedure onShow; override; + function Draw: boolean; override; + procedure MenuShow(sMenu: Byte); + procedure HandleReturn; + end; + +const + SM_Main = 1; + + SM_PlayList = 64 or 1; + SM_Playlist_Add = 64 or 2; + SM_Playlist_New = 64 or 3; + + 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; + SM_Party_Joker = 128 or 2; + +var + ISelections: Array of String; + SelectValue: Integer; + + +implementation + +uses UGraphic, + UMain, + UIni, + UTexture, + ULanguage, + UParty, + UPlaylist, + USongs; + +function TScreenSongMenu.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; +begin + Result := true; + If (PressedDown) Then + begin // Key Down + if (CurMenu = SM_Playlist_New) AND (Interaction=0) then + begin + case PressedKey of + SDLK_0..SDLK_9, SDLK_A..SDLK_Z, SDLK_SPACE, SDLK_MINUS, SDLK_EXCLAIM, SDLK_COMMA, SDLK_SLASH, SDLK_ASTERISK, SDLK_QUESTION, SDLK_QUOTE, SDLK_QUOTEDBL: + begin + Button[Interaction].Text[0].Text := Button[Interaction].Text[0].Text + chr(ScanCode); + exit; + end; + + SDLK_BACKSPACE: + begin + Button[Interaction].Text[0].DeleteLastL; + exit; + end; + end; + end; + + case PressedKey of + SDLK_Q: + begin + Result := false; + end; + + + SDLK_ESCAPE, + SDLK_BACKSPACE : + begin + Music.PlayBack; + Visible := False; + end; + + SDLK_RETURN: + begin + HandleReturn; + end; + + SDLK_DOWN: InteractNext; + SDLK_UP: InteractPrev; + + SDLK_RIGHT: + begin + if (Interaction=3) then + InteractInc; + end; + SDLK_LEFT: + begin + if (Interaction=3) then + InteractDec; + end; + + SDLK_1: + begin //Jocker + //Joker spielen + case CurMenu of + SM_Party_Main: + begin + ScreenSong.DoJoker(0) + end; + end; + end; + SDLK_2: + begin //Jocker + //Joker spielen + case CurMenu of + SM_Party_Main: + begin + ScreenSong.DoJoker(1) + end; + end; + end; + SDLK_3: + begin //Jocker + //Joker spielen + case CurMenu of + SM_Party_Main: + begin + ScreenSong.DoJoker(2) + end; + end; + end; + + + end; + end; +end; + +constructor TScreenSongMenu.Create; +var + I: integer; +begin + inherited Create; + + //Create Dummy SelectSlide Entrys + SetLength(ISelections, 1); + ISelections[0] := 'Dummy'; + + + AddText(Theme.SongMenu.TextMenu); + + LoadFromTheme(Theme.SongMenu); + + AddButton(Theme.SongMenu.Button1); + if (Length(Button[0].Text) = 0) then + AddButtonText(14, 20, 'Button 1'); + + AddButton(Theme.SongMenu.Button2); + if (Length(Button[1].Text) = 0) then + AddButtonText(14, 20, 'Button 2'); + + AddButton(Theme.SongMenu.Button3); + if (Length(Button[2].Text) = 0) then + AddButtonText(14, 20, 'Button 3'); + + AddSelectSlide(Theme.SongMenu.SelectSlide3, SelectValue, ISelections); + + AddButton(Theme.SongMenu.Button4); + if (Length(Button[3].Text) = 0) then + AddButtonText(14, 20, 'Button 4'); + + + Interaction := 0; +end; + +function TScreenSongMenu.Draw: boolean; +begin + inherited Draw; +end; + +procedure TScreenSongMenu.onShow; +begin + +end; + +procedure TScreenSongMenu.MenuShow(sMenu: Byte); +begin + Interaction := 0; //Reset Interaction + Visible := True; //Set Visible + Case sMenu of + SM_Main: + begin + CurMenu := sMenu; + Text[0].Text := Language.Translate('SONG_MENU_NAME_MAIN'); + + Button[0].Visible := True; + Button[1].Visible := True; + Button[2].Visible := True; + Button[3].Visible := True; + SelectsS[0].Visible := False; + + Button[0].Text[0].Text := Language.Translate('SONG_MENU_PLAY'); + Button[1].Text[0].Text := Language.Translate('SONG_MENU_CHANGEPLAYERS'); + Button[2].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_ADD'); + Button[3].Text[0].Text := Language.Translate('SONG_MENU_EDIT'); + end; + + SM_PlayList: + begin + CurMenu := sMenu; + Text[0].Text := Language.Translate('SONG_MENU_NAME_PLAYLIST'); + + Button[0].Visible := True; + Button[1].Visible := True; + Button[2].Visible := True; + Button[3].Visible := True; + SelectsS[0].Visible := False; + + Button[0].Text[0].Text := Language.Translate('SONG_MENU_PLAY'); + Button[1].Text[0].Text := Language.Translate('SONG_MENU_CHANGEPLAYERS'); + Button[2].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_DEL'); + Button[3].Text[0].Text := Language.Translate('SONG_MENU_EDIT'); + end; + + SM_Playlist_Add: + begin + CurMenu := sMenu; + Text[0].Text := Language.Translate('SONG_MENU_NAME_PLAYLIST_ADD'); + + Button[0].Visible := True; + 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_ADD_NEW'); + Button[3].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_ADD_EXISTING'); + + SetLength(ISelections, Length(PlaylistMan.Playlists)); + PlaylistMan.GetNames(ISelections); + + if (Length(ISelections)>=1) then + begin + UpdateSelectSlideOptions(Theme.SongMenu.SelectSlide3, 0, ISelections, SelectValue); + end + else + begin + Button[3].Visible := False; + SelectsS[0].Visible := False; + Button[2].Visible := True; + Button[2].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_NOEXISTING'); + end; + end; + + SM_Playlist_New: + begin + CurMenu := sMenu; + Text[0].Text := Language.Translate('SONG_MENU_NAME_PLAYLIST_NEW'); + + Button[0].Visible := True; + Button[1].Visible := False; + Button[2].Visible := True; + Button[3].Visible := True; + SelectsS[0].Visible := False; + + Button[0].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_NEW_UNNAMED'); + Button[2].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_NEW_CREATE'); + Button[3].Text[0].Text := Language.Translate('SONG_MENU_CANCEL'); + end; + + SM_Playlist_DelItem: + begin + CurMenu := sMenu; + Text[0].Text := Language.Translate('SONG_MENU_NAME_PLAYLIST_DELITEM'); + + 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_Playlist_Load: + begin + CurMenu := sMenu; + Text[0].Text := Language.Translate('SONG_MENU_NAME_PLAYLIST_LOAD'); + + //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)); + PlaylistMan.GetNames(ISelections); + + if (Length(ISelections)>=1) then + begin + UpdateSelectSlideOptions(Theme.SongMenu.SelectSlide3, 0, ISelections, SelectValue); + Interaction := 3; + end + else + begin + Button[3].Visible := False; + SelectsS[0].Visible := False; + Button[2].Visible := True; + Button[2].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_NOEXISTING'); + Interaction := 2; + 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 + CurMenu := sMenu; + Text[0].Text := Language.Translate('SONG_MENU_NAME_PARTY_MAIN'); + + 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_PLAY'); + //Button[1].Text[0].Text := Language.Translate('SONG_MENU_JOKER'); + //Button[2].Text[0].Text := Language.Translate('SONG_MENU_PLAYMODI'); + Button[3].Text[0].Text := Language.Translate('SONG_MENU_JOKER'); + end; + + SM_Party_Joker: + begin + CurMenu := sMenu; + Text[0].Text := Language.Translate('SONG_MENU_NAME_PARTY_JOKER'); + + Button[0].Visible := (PartySession.Teams.NumTeams >= 1) AND (PartySession.Teams.Teaminfo[0].Joker > 0); + Button[1].Visible := (PartySession.Teams.NumTeams >= 2) AND (PartySession.Teams.Teaminfo[1].Joker > 0); + Button[2].Visible := (PartySession.Teams.NumTeams >= 3) AND (PartySession.Teams.Teaminfo[2].Joker > 0); + Button[3].Visible := True; + SelectsS[0].Visible := False; + + Button[0].Text[0].Text := String(PartySession.Teams.Teaminfo[0].Name); + Button[1].Text[0].Text := String(PartySession.Teams.Teaminfo[1].Name); + Button[2].Text[0].Text := String(PartySession.Teams.Teaminfo[2].Name); + Button[3].Text[0].Text := Language.Translate('SONG_MENU_CANCEL'); + + //Set right Interaction + if (not Button[0].Visible) then + begin + if (not Button[1].Visible) then + begin + if (not Button[2].Visible) then + begin + Interaction := 4; + end + else Interaction := 2; + end + else Interaction := 1; + end; + + end; + end; +end; + +procedure TScreenSongMenu.HandleReturn; +begin + Case CurMenu of + SM_Main: + begin + Case Interaction of + 0: //Button 1 + begin + ScreenSong.StartSong; + Visible := False; + end; + + 1: //Button 2 + begin + //Select New Players then Sing: + ScreenSong.SelectPlayers; + Visible := False; + end; + + 2: //Button 3 + begin + //Show add to Playlist Menu + MenuShow(SM_Playlist_Add); + end; + + 3: //SelectSlide 3 + begin + //Dummy + end; + + 4: //Button 4 + begin + ScreenSong.OpenEditor; + Visible := False; + end; + end; + end; + + SM_PlayList: + begin + Visible := False; + Case Interaction of + 0: //Button 1 + begin + ScreenSong.StartSong; + Visible := False; + end; + + 1: //Button 2 + begin + //Select New Players then Sing: + ScreenSong.SelectPlayers; + Visible := False; + end; + + 2: //Button 3 + begin + //Show add to Playlist Menu + MenuShow(SM_Playlist_DelItem); + end; + + 3: //SelectSlide 3 + begin + //Dummy + end; + + 4: //Button 4 + begin + ScreenSong.OpenEditor; + Visible := False; + end; + end; + end; + + SM_Playlist_Add: + begin + Case Interaction of + 0: //Button 1 + begin + MenuShow(SM_Playlist_New); + end; + + 3: //SelectSlide 3 + begin + //Dummy + end; + + 4: //Button 4 + begin + PlaylistMan.AddItem(ScreenSong.Interaction, SelectValue); + Visible := False; + end; + end; + end; + + SM_Playlist_New: + begin + Case Interaction of + 0: //Button 1 + begin + //Nothing, Button for Entering Name + end; + + 2: //Button 3 + begin + //Create Playlist and Add Song + PlaylistMan.AddItem( + ScreenSong.Interaction, + PlaylistMan.AddPlaylist(Button[0].Text[0].Text)); + Visible := False; + end; + + 3: //SelectSlide 3 + begin + //Cancel -> Go back to Add screen + MenuShow(SM_Playlist_Add); + end; + + 4: //Button 4 + begin + Visible := False; + end; + end; + end; + + SM_Playlist_DelItem: + begin + Visible := False; + Case Interaction of + 0: //Button 1 + begin + //Delete + PlayListMan.DelItem(PlayListMan.GetIndexbySongID(ScreenSong.Interaction)); + Visible := False; + end; + + 4: //Button 4 + begin + MenuShow(SM_Playlist); + end; + end; + end; + + SM_Playlist_Load: + begin + Case Interaction of + 0: //Button 1 (Delete Playlist) + begin + MenuShow(SM_Playlist_Del); + end; + 4: //Button 4 + begin + //Load Playlist + PlaylistMan.SetPlayList(SelectValue); + Visible := False; + end; + 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 + 0: //Button 1 + begin + //Start Singing + ScreenSong.StartSong; + Visible := False; + end; + + 4: //Button 4 + begin + //Joker + MenuShow(SM_Party_Joker); + end; + end; + end; + + SM_Party_Joker: + begin + Visible := False; + Case Interaction of + 0: //Button 1 + begin + //Joker Team 1 + ScreenSong.DoJoker(0); + end; + + 1: //Button 2 + begin + //Joker Team 2 + ScreenSong.DoJoker(1); + end; + + 2: //Button 3 + begin + //Joker Team 3 + ScreenSong.DoJoker(2); + end; + + 4: //Button 4 + begin + //Cancel... (Fo back to old Menu) + MenuShow(SM_Party_Main); + end; + end; + end; + end; +end; + +end. + -- cgit v1.2.3 From 44554c7908f7e2405a249331f00a35703f5939c2 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Thu, 11 Oct 2007 12:02:20 +0000 Subject: Added IAudioPlayback Interface and implementation for BASS. Created "AudioPlayback" Global Singleton, which removed the need for the "Music" Global variable. This was done because global singleton objects are a recognized better "design pattern" achieving the same thing as global variables, but in a nicer way. I will be working to a) separate IAudioPlayback in to separate "Playback" and "Input" Interfaces b) build a FFMpeg class that implements IAudioPlayback git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@504 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSongMenu.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Game/Code/Screens/UScreenSongMenu.pas') diff --git a/Game/Code/Screens/UScreenSongMenu.pas b/Game/Code/Screens/UScreenSongMenu.pas index ce331e2f..c6e16f60 100644 --- a/Game/Code/Screens/UScreenSongMenu.pas +++ b/Game/Code/Screens/UScreenSongMenu.pas @@ -94,7 +94,7 @@ begin SDLK_ESCAPE, SDLK_BACKSPACE : begin - Music.PlayBack; + AudioPlayback.PlayBack; Visible := False; end; -- cgit v1.2.3 From 391d30716d48dc709f6444b19c008e82311623b9 Mon Sep 17 00:00:00 2001 From: eddie-0815 Date: Thu, 1 Nov 2007 19:34:40 +0000 Subject: Mac OS X version compiles and links. I hope I didn't break too many files on windows/linux. Added switches.inc to all files. Changed many IFDEFs. For Windows-only code please use MSWINDOWS instead of WIN32 now. WIN32 is also used by the Mac port. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@546 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSongMenu.pas | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'Game/Code/Screens/UScreenSongMenu.pas') diff --git a/Game/Code/Screens/UScreenSongMenu.pas b/Game/Code/Screens/UScreenSongMenu.pas index c6e16f60..6f9b0c53 100644 --- a/Game/Code/Screens/UScreenSongMenu.pas +++ b/Game/Code/Screens/UScreenSongMenu.pas @@ -2,9 +2,7 @@ unit UScreenSongMenu; interface -{$IFDEF FPC} - {$MODE DELPHI} -{$ENDIF} +{$I switches.inc} uses UMenu, -- cgit v1.2.3 From 99955c78f63d1cb0d8bec666bc33953590a74c8a Mon Sep 17 00:00:00 2001 From: jaybinks Date: Thu, 1 Nov 2007 23:22:01 +0000 Subject: fixed failed builds build:USDX-LAZLIN-75 build:USDX-LAZLIN-76 for some reason we can not use {$MODE Delphi} in an included file. ( Probably because of the way the compier scopes this switch to each pas file ) ive had to revert this part of eddies changes. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@548 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSongMenu.pas | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Game/Code/Screens/UScreenSongMenu.pas') diff --git a/Game/Code/Screens/UScreenSongMenu.pas b/Game/Code/Screens/UScreenSongMenu.pas index 6f9b0c53..90e56a54 100644 --- a/Game/Code/Screens/UScreenSongMenu.pas +++ b/Game/Code/Screens/UScreenSongMenu.pas @@ -2,6 +2,10 @@ unit UScreenSongMenu; interface +{$IFDEF FPC} + {$MODE Delphi} +{$ENDIF} + {$I switches.inc} uses -- cgit v1.2.3 From 5e733f7e9cb2118651df90171db1892c9155e089 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Sun, 4 Nov 2007 21:00:20 +0000 Subject: Partymodule finished. All PartyScreens and SingScreen needs some adapting. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@583 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSongMenu.pas | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Game/Code/Screens/UScreenSongMenu.pas') diff --git a/Game/Code/Screens/UScreenSongMenu.pas b/Game/Code/Screens/UScreenSongMenu.pas index 90e56a54..88b0de32 100644 --- a/Game/Code/Screens/UScreenSongMenu.pas +++ b/Game/Code/Screens/UScreenSongMenu.pas @@ -373,16 +373,16 @@ begin begin CurMenu := sMenu; Text[0].Text := Language.Translate('SONG_MENU_NAME_PARTY_JOKER'); - - Button[0].Visible := (PartySession.Teams.NumTeams >= 1) AND (PartySession.Teams.Teaminfo[0].Joker > 0); + // to-do : Party + {Button[0].Visible := (PartySession.Teams.NumTeams >= 1) AND (PartySession.Teams.Teaminfo[0].Joker > 0); Button[1].Visible := (PartySession.Teams.NumTeams >= 2) AND (PartySession.Teams.Teaminfo[1].Joker > 0); - Button[2].Visible := (PartySession.Teams.NumTeams >= 3) AND (PartySession.Teams.Teaminfo[2].Joker > 0); + Button[2].Visible := (PartySession.Teams.NumTeams >= 3) AND (PartySession.Teams.Teaminfo[2].Joker > 0);} Button[3].Visible := True; SelectsS[0].Visible := False; - Button[0].Text[0].Text := String(PartySession.Teams.Teaminfo[0].Name); + {Button[0].Text[0].Text := String(PartySession.Teams.Teaminfo[0].Name); Button[1].Text[0].Text := String(PartySession.Teams.Teaminfo[1].Name); - Button[2].Text[0].Text := String(PartySession.Teams.Teaminfo[2].Name); + Button[2].Text[0].Text := String(PartySession.Teams.Teaminfo[2].Name);} Button[3].Text[0].Text := Language.Translate('SONG_MENU_CANCEL'); //Set right Interaction -- cgit v1.2.3 From dee94f5dae9e6b5ae6c7b54a12a567745abc8dc3 Mon Sep 17 00:00:00 2001 From: tobigun Date: Tue, 5 Feb 2008 20:36:19 +0000 Subject: General: - cleanup and adaption of SingDrawOscilloscope Portaudio/SDL audio output: - stuttering in portaudio output has been fixed (SDL_MixBuffers cannot be used without initializing the SDL audio stuff first, so it is not usable with portaudio. Now SDL is used for audio-output instead of portaudio (although the file-name is UAudioPlayback_Portaudio.pas at the moment). - cleaner file closing - volume adjustment UMusic: - cleanup of the audio-interfaces - introduced TNoteType = (ntFreestyle, ntNormal, ntGolden) - some bug-fixes - introduced TSoundLibrary. This is library for all in-game sounds used by USDX. Instead of calling AudioPlayer.PlaySwoosh you should call AudioPlayer.PlaySound(SoundLib.Swoosh) now. You might call SoundLib.Swoosh.Play too, but this is not recommended at the moment because SoundLib.Swoosh could be nil if the file was not found. The SoundLibrary approach is much cleaner than the previous one. The AudioPlayer does not have to specify a Play... and Stop... method for every available sound anymore. In addition it is not an AudioPlayers responsibility to init the in-game sounds. URecord: - polish to english translation of some variables - CaptureSoundLeft/Right is CaptureChannel[0/1] now - TSoundCardInput -> TAudioInputDeviceSource - TGenericSoundCard.Input -> TGenericSoundCard.Source - autocorrelation algorithm more readable now - Clean-up of the audio-input interface - moved cloned code of the input-classes to one base class (TAudioInputBase) - Cleaner finalization - Start-/StopCapture will not crash anymore in the recording-options menu - Fixed several bugs in the autocorrelation stuff (e.g. wrong usage of $10000) - SzczytJest (now ToneValid) was not used correctly. ToneValid is set to true if a valid tone was found (= the sound was louder than the threshold -> no background noise). If i remember correctly the sound was accepted although the tone was invalid. So the old data was used although noone was singing. This resulted in some sort of ghost-singer effect. UIni: - moved TIni.Card to TScreenOptionsRecord.Card because it is not stored in the ini-file and will not be in the future. - TIni.CardList ist now TIni.InputDeviceConfig. The name cardlist was misleading because it just specifies input- but no output-devices. In addition a soundcard can have multiple input-devices (at least in linux). - bugfix on InputDeviceConfig (formerly CardList) usage. USDX expected that the indices of the corresponding elements in TIni.InputDeviceConfig[] and TAudioInputProcessor.Device[] were the same. This is wrong. If device 2 was defined at first place in the ini and device 1 at the second, the indices of the two arrays didn't match (they were swapped) erroneously. To fix this and to support the item listed below the index to TIni.InputDeviceConfig[] is now stored in TAudioInputDevice.CfgIndex. NOTE: InputDeviceConfig[] contains configurations of non-available (unplugged) devices. Iterate over TAudioInputProcessor.Device[] for available devices. - configurations of external devices that are not plugged in will not be deleted anymore. - multiple definitions of one device in the ini-file will not crash USDX anymore - CardList[I].ChannelL/R now are InputDeviceConfig[I].ChannelToPlayerMap[0/1]. I think the new name is more intuitive because it maps a channel to a player number. Now the both vars are joint to one array. Now it is possible to use loops to process them and we might support more than two input channels on one device in the future (if such devices exist) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@827 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSongMenu.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Game/Code/Screens/UScreenSongMenu.pas') diff --git a/Game/Code/Screens/UScreenSongMenu.pas b/Game/Code/Screens/UScreenSongMenu.pas index 88b0de32..ae0bc9ba 100644 --- a/Game/Code/Screens/UScreenSongMenu.pas +++ b/Game/Code/Screens/UScreenSongMenu.pas @@ -96,7 +96,7 @@ begin SDLK_ESCAPE, SDLK_BACKSPACE : begin - AudioPlayback.PlayBack; + AudioPlayback.PlaySound(SoundLib.Back); Visible := False; end; -- cgit v1.2.3