From 94e4421ad3a7615c7ce91beff95634c98b4edd49 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Sat, 2 May 2009 15:29:37 +0000 Subject: Display.AbortScreenChange added (used in ScreenSing and ScreenPartyOptions) some minor fixes in UParty, ULuaParty and ULuaUsdx adapting of UScreenPartyNewRound, UScreenPartyPlayer and UScreenPartyOption nearly finished git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@1705 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Lua/src/screens/UScreenMain.pas | 7 +- Lua/src/screens/UScreenPartyNewRound.pas | 255 ++++++++----------------------- Lua/src/screens/UScreenPartyOptions.pas | 26 ++-- Lua/src/screens/UScreenPartyPlayer.pas | 98 +++++++++--- Lua/src/screens/UScreenSing.pas | 20 ++- Lua/src/screens/UScreenSong.pas | 58 ++++--- Lua/src/screens/UScreenSongMenu.pas | 17 ++- 7 files changed, 207 insertions(+), 274 deletions(-) (limited to 'Lua/src/screens') diff --git a/Lua/src/screens/UScreenMain.pas b/Lua/src/screens/UScreenMain.pas index 2a2d0613..c0ab494e 100644 --- a/Lua/src/screens/UScreenMain.pas +++ b/Lua/src/screens/UScreenMain.pas @@ -155,12 +155,7 @@ begin begin if (Songs.SongList.Count >= 1) then begin - if (Length(DLLMan.Plugins) >= 1) then - begin - FadeTo(@ScreenPartyOptions, SoundLib.Start); - end - else //show error message, No Plugins Loaded - ScreenPopupError.ShowPopup(Language.Translate('ERROR_NO_PLUGINS')); + FadeTo(@ScreenPartyOptions, SoundLib.Start); end else //show error message, No Songs Loaded ScreenPopupError.ShowPopup(Language.Translate('ERROR_NO_SONGS')); diff --git a/Lua/src/screens/UScreenPartyNewRound.pas b/Lua/src/screens/UScreenPartyNewRound.pas index 01de9df7..0f5ffd5d 100644 --- a/Lua/src/screens/UScreenPartyNewRound.pas +++ b/Lua/src/screens/UScreenPartyNewRound.pas @@ -40,21 +40,9 @@ type TScreenPartyNewRound = class(TMenu) public //Texts: - TextRound1: Cardinal; - TextRound2: Cardinal; - TextRound3: Cardinal; - TextRound4: Cardinal; - TextRound5: Cardinal; - TextRound6: Cardinal; - TextRound7: Cardinal; - - TextWinner1: Cardinal; - TextWinner2: Cardinal; - TextWinner3: Cardinal; - TextWinner4: Cardinal; - TextWinner5: Cardinal; - TextWinner6: Cardinal; - TextWinner7: Cardinal; + TextRound: array [0..6] of Cardinal; + + TextWinner: array [0..6] of Cardinal; TextNextRound: Cardinal; TextNextRoundNo: Cardinal; @@ -63,13 +51,7 @@ type TextNextPlayer3: Cardinal; //Statics - StaticRound1: Cardinal; - StaticRound2: Cardinal; - StaticRound3: Cardinal; - StaticRound4: Cardinal; - StaticRound5: Cardinal; - StaticRound6: Cardinal; - StaticRound7: Cardinal; + StaticRound: array [0..6] of Cardinal; //Scores TextScoreTeam1: Cardinal; @@ -88,9 +70,7 @@ type StaticTeam3: Cardinal; StaticNextPlayer1: Cardinal; StaticNextPlayer2: Cardinal; - StaticNextPlayer3: Cardinal; - - + StaticNextPlayer3: Cardinal; constructor Create; override; @@ -137,16 +117,7 @@ begin SDLK_RETURN: begin AudioPlayback.PlaySound(SoundLib.Start); - if DLLMan.Selected.LoadSong then - begin - //Select PartyMode ScreenSong - ScreenSong.Mode := smPartyMode; - FadeTo(@ScreenSong); - end - else - begin - FadeTo(@ScreenSingModi); - end; + Party.CallBeforeSongSelect; end; end; end; @@ -156,21 +127,21 @@ constructor TScreenPartyNewRound.Create; begin inherited Create; - TextRound1 := AddText (Theme.PartyNewRound.TextRound1); - TextRound2 := AddText (Theme.PartyNewRound.TextRound2); - TextRound3 := AddText (Theme.PartyNewRound.TextRound3); - TextRound4 := AddText (Theme.PartyNewRound.TextRound4); - TextRound5 := AddText (Theme.PartyNewRound.TextRound5); - TextRound6 := AddText (Theme.PartyNewRound.TextRound6); - TextRound7 := AddText (Theme.PartyNewRound.TextRound7); - - TextWinner1 := AddText (Theme.PartyNewRound.TextWinner1); - TextWinner2 := AddText (Theme.PartyNewRound.TextWinner2); - TextWinner3 := AddText (Theme.PartyNewRound.TextWinner3); - TextWinner4 := AddText (Theme.PartyNewRound.TextWinner4); - TextWinner5 := AddText (Theme.PartyNewRound.TextWinner5); - TextWinner6 := AddText (Theme.PartyNewRound.TextWinner6); - TextWinner7 := AddText (Theme.PartyNewRound.TextWinner7); + TextRound[0] := AddText (Theme.PartyNewRound.TextRound1); + TextRound[1] := AddText (Theme.PartyNewRound.TextRound2); + TextRound[2] := AddText (Theme.PartyNewRound.TextRound3); + TextRound[3] := AddText (Theme.PartyNewRound.TextRound4); + TextRound[4] := AddText (Theme.PartyNewRound.TextRound5); + TextRound[5] := AddText (Theme.PartyNewRound.TextRound6); + TextRound[6] := AddText (Theme.PartyNewRound.TextRound7); + + TextWinner[0] := AddText (Theme.PartyNewRound.TextWinner1); + TextWinner[1] := AddText (Theme.PartyNewRound.TextWinner2); + TextWinner[2] := AddText (Theme.PartyNewRound.TextWinner3); + TextWinner[3] := AddText (Theme.PartyNewRound.TextWinner4); + TextWinner[4] := AddText (Theme.PartyNewRound.TextWinner5); + TextWinner[5] := AddText (Theme.PartyNewRound.TextWinner6); + TextWinner[6] := AddText (Theme.PartyNewRound.TextWinner7); TextNextRound := AddText (Theme.PartyNewRound.TextNextRound); TextNextRoundNo := AddText (Theme.PartyNewRound.TextNextRoundNo); @@ -178,13 +149,13 @@ begin TextNextPlayer2 := AddText (Theme.PartyNewRound.TextNextPlayer2); TextNextPlayer3 := AddText (Theme.PartyNewRound.TextNextPlayer3); - StaticRound1 := AddStatic (Theme.PartyNewRound.StaticRound1); - StaticRound2 := AddStatic (Theme.PartyNewRound.StaticRound2); - StaticRound3 := AddStatic (Theme.PartyNewRound.StaticRound3); - StaticRound4 := AddStatic (Theme.PartyNewRound.StaticRound4); - StaticRound5 := AddStatic (Theme.PartyNewRound.StaticRound5); - StaticRound6 := AddStatic (Theme.PartyNewRound.StaticRound6); - StaticRound7 := AddStatic (Theme.PartyNewRound.StaticRound7); + StaticRound[0] := AddStatic (Theme.PartyNewRound.StaticRound1); + StaticRound[1] := AddStatic (Theme.PartyNewRound.StaticRound2); + StaticRound[2] := AddStatic (Theme.PartyNewRound.StaticRound3); + StaticRound[3] := AddStatic (Theme.PartyNewRound.StaticRound4); + StaticRound[4] := AddStatic (Theme.PartyNewRound.StaticRound5); + StaticRound[5] := AddStatic (Theme.PartyNewRound.StaticRound6); + StaticRound[6] := AddStatic (Theme.PartyNewRound.StaticRound7); //Scores TextScoreTeam1 := AddText (Theme.PartyNewRound.TextScoreTeam1); @@ -215,15 +186,15 @@ var function GetTeamPlayers(const Num: Byte): String; var Players: Array of String; - //J: Byte; - begin // to-do : Party - if (Num-1 >= {PartySession.Teams.NumTeams}0) then + J: Integer; + begin + if (Num >= Length(Party.Teams)) then exit; - {//Create Players Array - SetLength(Players, PartySession.Teams.TeamInfo[Num-1].NumPlayers); - For J := 0 to PartySession.Teams.TeamInfo[Num-1].NumPlayers-1 do - Players[J] := String(PartySession.Teams.TeamInfo[Num-1].PlayerInfo[J].Name);} + //Create Players Array + SetLength(Players, Length(Party.Teams[Num-1].Players)); + For J := 0 to High(Party.Teams[Num-1].Players) do + Players[J] := Party.Teams[Num-1].Players[J].Name; //Implode and Return Result := Language.Implode(Players); @@ -235,126 +206,26 @@ begin //PartySession.StartRound; //Set Visibility of Round Infos - // to-do : Party - I := {Length(PartySession.Rounds)}0; - if (I >= 1) then - begin - Static[StaticRound1].Visible := True; - Text[TextRound1].Visible := True; - Text[TextWinner1].Visible := True; - - //Texts: - //Text[TextRound1].Text := Language.Translate(DllMan.Plugins[PartySession.Rounds[0].Plugin].Name); - //Text[TextWinner1].Text := PartySession.GetWinnerString(0); - end - else - begin - Static[StaticRound1].Visible := False; - Text[TextRound1].Visible := False; - Text[TextWinner1].Visible := False; - end; - - if (I >= 2) then - begin - Static[StaticRound2].Visible := True; - Text[TextRound2].Visible := True; - Text[TextWinner2].Visible := True; - - //Texts: - //Text[TextRound2].Text := Language.Translate(DllMan.Plugins[PartySession.Rounds[1].Plugin].Name); - //Text[TextWinner2].Text := PartySession.GetWinnerString(1); - end - else - begin - Static[StaticRound2].Visible := False; - Text[TextRound2].Visible := False; - Text[TextWinner2].Visible := False; - end; - - if (I >= 3) then - begin - Static[StaticRound3].Visible := True; - Text[TextRound3].Visible := True; - Text[TextWinner3].Visible := True; - - //Texts: - //Text[TextRound3].Text := Language.Translate(DllMan.Plugins[PartySession.Rounds[2].Plugin].Name); - //Text[TextWinner3].Text := PartySession.GetWinnerString(2); - end - else - begin - Static[StaticRound3].Visible := False; - Text[TextRound3].Visible := False; - Text[TextWinner3].Visible := False; - end; - - if (I >= 4) then - begin - Static[StaticRound4].Visible := True; - Text[TextRound4].Visible := True; - Text[TextWinner4].Visible := True; - - //Texts: - //Text[TextRound4].Text := Language.Translate(DllMan.Plugins[PartySession.Rounds[3].Plugin].Name); - //Text[TextWinner4].Text := PartySession.GetWinnerString(3); - end - else - begin - Static[StaticRound4].Visible := False; - Text[TextRound4].Visible := False; - Text[TextWinner4].Visible := False; - end; - - if (I >= 5) then - begin - Static[StaticRound5].Visible := True; - Text[TextRound5].Visible := True; - Text[TextWinner5].Visible := True; - - //Texts: - //Text[TextRound5].Text := Language.Translate(DllMan.Plugins[PartySession.Rounds[4].Plugin].Name); - //Text[TextWinner5].Text := PartySession.GetWinnerString(4); - end - else + for I := 0 to 6 do begin - Static[StaticRound5].Visible := False; - Text[TextRound5].Visible := False; - Text[TextWinner5].Visible := False; - end; - - if (I >= 6) then - begin - Static[StaticRound6].Visible := True; - Text[TextRound6].Visible := True; - Text[TextWinner6].Visible := True; - - //Texts: - //Text[TextRound6].Text := Language.Translate(DllMan.Plugins[PartySession.Rounds[5].Plugin].Name); - //Text[TextWinner6].Text := PartySession.GetWinnerString(5); - end - else - begin - Static[StaticRound6].Visible := False; - Text[TextRound6].Visible := False; - Text[TextWinner6].Visible := False; + if (I <= High(Party.Rounds)) then + begin + Static[StaticRound[I]].Visible := True; + Text[TextRound[I]].Visible := True; + Text[TextWinner[I]].Visible := True; + + // update texts: + Text[TextRound[I]].Text := Language.Translate('PLUGIN_' + uppercase(Party.Modes[Party.Rounds[I].Mode].Name) + '_NAME'); + Text[TextWinner[I]].Text := Party.GetWinnerString(I); + end + else + begin + Static[StaticRound[I]].Visible := False; + Text[TextRound[I]].Visible := False; + Text[TextWinner[I]].Visible := False; + end; end; - if (I >= 7) then - begin - Static[StaticRound7].Visible := True; - Text[TextRound7].Visible := True; - Text[TextWinner7].Visible := True; - - //Texts: - //Text[TextRound7].Text := Language.Translate(DllMan.Plugins[PartySession.Rounds[6].Plugin].Name); - //Text[TextWinner7].Text := PartySession.GetWinnerString(6); - end - else - begin - Static[StaticRound7].Visible := False; - Text[TextRound7].Visible := False; - Text[TextWinner7].Visible := False; - end; //Display Scores {if (PartySession.Teams.NumTeams >= 1) then @@ -418,34 +289,34 @@ begin Text[TextTeam3Players].Visible := False; Static[StaticTeam3].Visible := False; Static[StaticNextPlayer3].Visible := False; - end; + end; } //nextRound Texts - Text[TextNextRound].Text := Language.Translate(DllMan.Selected.PluginDesc); - Text[TextNextRoundNo].Text := InttoStr(PartySession.CurRound + 1); - if (PartySession.Teams.NumTeams >= 1) then + {Text[TextNextRound].Text := Language.Translate('PLUGIN_' + uppercase(Party.Modes[Party.Rounds[Party.CurrentRound].Mode].Name) + '_DESC'); + Text[TextNextRoundNo].Text := InttoStr(Party.CurrentRound + 1); + if (Length(Party.Teams) >= 1) then begin - Text[TextNextPlayer1].Text := PartySession.Teams.Teaminfo[0].Playerinfo[PartySession.Teams.Teaminfo[0].CurPlayer].Name; + Text[TextNextPlayer1].Text := Party.Teams[0].Players[Party.Teams[0].NextPlayer].Name; Text[TextNextPlayer1].Visible := True; end else Text[TextNextPlayer1].Visible := False; - - if (PartySession.Teams.NumTeams >= 2) then + + if (Length(Party.Teams) >= 2) then begin - Text[TextNextPlayer2].Text := PartySession.Teams.Teaminfo[1].Playerinfo[PartySession.Teams.Teaminfo[1].CurPlayer].Name; + Text[TextNextPlayer2].Text := Party.Teams[1].Players[Party.Teams[1].NextPlayer].Name; Text[TextNextPlayer2].Visible := True; end else Text[TextNextPlayer2].Visible := False; - if (PartySession.Teams.NumTeams >= 3) then + if (Length(Party.Teams) >= 3) then begin - Text[TextNextPlayer3].Text := PartySession.Teams.Teaminfo[2].Playerinfo[PartySession.Teams.Teaminfo[2].CurPlayer].Name; + Text[TextNextPlayer3].Text := Party.Teams[2].Players[Party.Teams[2].NextPlayer].Name; Text[TextNextPlayer3].Visible := True; end else - Text[TextNextPlayer3].Visible := False; } + Text[TextNextPlayer3].Visible := False; end; procedure TScreenPartyNewRound.SetAnimationProgress(Progress: real); diff --git a/Lua/src/screens/UScreenPartyOptions.pas b/Lua/src/screens/UScreenPartyOptions.pas index d6839778..5e2c1d5a 100644 --- a/Lua/src/screens/UScreenPartyOptions.pas +++ b/Lua/src/screens/UScreenPartyOptions.pas @@ -121,17 +121,7 @@ begin //Don'T start when Playlist is Selected and there are no Playlists if (Playlist = 2) and (Length(PlaylistMan.Playlists) = 0) then Exit; - // Don't start when SinglePlayer Teams but only Multiplayer Plugins available - OnlyMultiPlayer := true; - for I := 0 to High(DLLMan.Plugins) do - begin - OnlyMultiPlayer := (OnlyMultiPlayer and DLLMan.Plugins[I].TeamModeOnly); - end; - if (OnlyMultiPlayer) and ((NumPlayer1 = 0) or (NumPlayer2 = 0) or ((NumPlayer3 = 0) and (NumTeams = 1))) then - begin - ScreenPopupError.ShowPopup(Language.Translate('ERROR_NO_PLUGINS')); - Exit; - end; + //Save Difficulty Ini.Difficulty := SelectsS[SelectLevel].SelectedOption; Ini.SaveLevel; @@ -306,7 +296,19 @@ procedure TScreenPartyOptions.onShow; begin inherited; - Randomize; + Party.Clear; + + // check if there are loaded modes + if Party.ModesAvailable then + begin + // modes are loaded + Randomize; + end + else + begin // no modes found + ScreenPopupError.ShowPopup(Language.Translate('ERROR_NO_PLUGINS')); + Display.AbortScreenChange; + end; end; procedure TScreenPartyOptions.SetAnimationProgress(Progress: real); diff --git a/Lua/src/screens/UScreenPartyPlayer.pas b/Lua/src/screens/UScreenPartyPlayer.pas index d38a6435..9a5edca2 100644 --- a/Lua/src/screens/UScreenPartyPlayer.pas +++ b/Lua/src/screens/UScreenPartyPlayer.pas @@ -71,11 +71,14 @@ type implementation -uses UGraphic, UMain, UIni, UTexture, UParty; +uses UGraphic, UMain, UIni, UTexture, UParty, UScreenPartyOptions, ULanguage; function TScreenPartyPlayer.ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; var SDL_ModState: Word; + I, J: Integer; + HighPlayer: Integer; + Rounds: ARounds; procedure IntNext; begin repeat @@ -243,10 +246,57 @@ begin PartySession.Teams.Teaminfo[I].Playerinfo[J].Name := PChar(Button[I*5 + J+1].Text[0].Text); PartySession.Teams.Teaminfo[I].Playerinfo[J].TimesPlayed := 0; end; + end; } + + // add teams to party + + for I := 0 to ScreenPartyOptions.NumTeams + 1 do + begin + Party.AddTeam(Button[I * 5].Text[0].Text); + + case I of + 0: HighPlayer := ScreenPartyOptions.NumPlayer1; + 1: HighPlayer := ScreenPartyOptions.NumPlayer2; + 2: HighPlayer := ScreenPartyOptions.NumPlayer3; + end; + + for J := 0 to HighPlayer do + Party.AddPlayer(I, Button[I * 5 + 1 + J].Text[0].Text); + end; + + if (Party.ModesAvailable) then + begin //mode for current playersetup available + // to - do : add round select screen + // atm just add random rounds to the rounds array + SetLength(Rounds, ScreenPartyOptions.Rounds + 2); + + for I := 0 to High(Rounds) do + Rounds[I] := Party_Round_Random; + + // start party game + if (Party.StartGame(Rounds)) then + begin + FadeTo(@ScreenPartyNewRound, SoundLib.Start); + end + else + begin + //error starting party game + ScreenPopupError.ShowPopup(Language.Translate('ERROR_CAN_NOT_START_PARTY')); + + Party.Clear; + end; + + end + else + begin + // no mode available for current player setup + ScreenPopupError.ShowPopup(Language.Translate('ERROR_NO_MODES_FOR_CURRENT_SETUP')); + + Party.Clear; end; - AudioPlayback.PlayStart; - FadeTo(@ScreenPartyNewRound);} + + end; // Up and Down could be done at the same time, @@ -310,13 +360,13 @@ begin Button[10].Text[0].Text := Ini.NameTeam[2]; // Templates for Names Mod end - {If (PartySession.Teams.NumTeams>=1) then + If (ScreenPartyOptions.NumTeams + 2 >= 1) then begin - Button[0].Visible := True; - Button[1].Visible := (PartySession.Teams.Teaminfo[0].NumPlayers >=1); - Button[2].Visible := (PartySession.Teams.Teaminfo[0].NumPlayers >=2); - Button[3].Visible := (PartySession.Teams.Teaminfo[0].NumPlayers >=3); - Button[4].Visible := (PartySession.Teams.Teaminfo[0].NumPlayers >=4); + Button[0].Visible := true; + Button[1].Visible := (ScreenPartyOptions.NumPlayer1 + 1 >= 1); + Button[2].Visible := (ScreenPartyOptions.NumPlayer1 + 1 >= 2); + Button[3].Visible := (ScreenPartyOptions.NumPlayer1 + 1 >= 3); + Button[4].Visible := (ScreenPartyOptions.NumPlayer1 + 1 >= 4); end else begin @@ -327,13 +377,13 @@ begin Button[4].Visible := False; end; - If (PartySession.Teams.NumTeams>=2) then + If (ScreenPartyOptions.NumTeams + 2 >= 2) then begin - Button[5].Visible := True; - Button[6].Visible := (PartySession.Teams.Teaminfo[1].NumPlayers >=1); - Button[7].Visible := (PartySession.Teams.Teaminfo[1].NumPlayers >=2); - Button[8].Visible := (PartySession.Teams.Teaminfo[1].NumPlayers >=3); - Button[9].Visible := (PartySession.Teams.Teaminfo[1].NumPlayers >=4); + Button[5].Visible := true; + Button[6].Visible := (ScreenPartyOptions.NumPlayer2 + 1 >= 1); + Button[7].Visible := (ScreenPartyOptions.NumPlayer2 + 1 >= 2); + Button[8].Visible := (ScreenPartyOptions.NumPlayer2 + 1 >= 3); + Button[9].Visible := (ScreenPartyOptions.NumPlayer2 + 1 >= 4); end else begin @@ -344,13 +394,13 @@ begin Button[9].Visible := False; end; - If (PartySession.Teams.NumTeams>=3) then + If (ScreenPartyOptions.NumTeams + 2 >= 3) then begin - Button[10].Visible := True; - Button[11].Visible := (PartySession.Teams.Teaminfo[2].NumPlayers >=1); - Button[12].Visible := (PartySession.Teams.Teaminfo[2].NumPlayers >=2); - Button[13].Visible := (PartySession.Teams.Teaminfo[2].NumPlayers >=3); - Button[14].Visible := (PartySession.Teams.Teaminfo[2].NumPlayers >=4); + Button[10].Visible := true; + Button[11].Visible := (ScreenPartyOptions.NumPlayer3 + 1 >= 1); + Button[12].Visible := (ScreenPartyOptions.NumPlayer3 + 1 >= 2); + Button[13].Visible := (ScreenPartyOptions.NumPlayer3 + 1 >= 3); + Button[14].Visible := (ScreenPartyOptions.NumPlayer3 + 1 >= 4); end else begin @@ -359,7 +409,7 @@ begin Button[12].Visible := False; Button[13].Visible := False; Button[14].Visible := False; - end; } + end; end; @@ -367,8 +417,8 @@ procedure TScreenPartyPlayer.SetAnimationProgress(Progress: real); var I: integer; begin - for I := 0 to high(Button) do - Button[I].Texture.ScaleW := Progress; + {for I := 0 to high(Button) do + Button[I].Texture.ScaleW := Progress; } end; end. diff --git a/Lua/src/screens/UScreenSing.pas b/Lua/src/screens/UScreenSing.pas index d49ecc7c..001fa8a3 100644 --- a/Lua/src/screens/UScreenSing.pas +++ b/Lua/src/screens/UScreenSing.pas @@ -101,6 +101,14 @@ type fShowVisualization: boolean; fCurrentVideoPlaybackEngine: IVideoPlayback; + // some settings to be set by plugins + settings: record + + + + end; + procedure ClearSettings; + constructor Create; override; procedure onShow; override; procedure onShowFinish; override; @@ -126,6 +134,7 @@ uses UGraphic, Classes, URecord, ULanguage, + UDisplay, Math; // Method for input parsing. If False is returned, GetNextWindow @@ -433,8 +442,8 @@ begin if (not success) then begin - // error loading song -> go back to song screen and show some error message - FadeTo(@ScreenSong); + // error loading song -> go back to previous screen and show some error message + Display.AbortScreenChange; // select new song in party mode if ScreenSong.Mode = smPartyMode then ScreenSong.SelectRandomSong(); @@ -621,6 +630,11 @@ begin CountSkipTimeSet; end; +procedure TScreenSing.ClearSettings; +begin + +end; + procedure TScreenSing.onHide; begin // Unload background texture @@ -821,7 +835,7 @@ begin //Kill all Stars and Effects GoldenRec.KillAll; - + if (Ini.SavePlayback = 1) then begin Log.BenchmarkStart(0); diff --git a/Lua/src/screens/UScreenSong.pas b/Lua/src/screens/UScreenSong.pas index 6aa8e955..41c98228 100644 --- a/Lua/src/screens/UScreenSong.pas +++ b/Lua/src/screens/UScreenSong.pas @@ -142,7 +142,7 @@ type //procedures for Menu procedure StartSong; procedure OpenEditor; - procedure DoJoker(Team: Byte); + procedure DoJoker(Team: Integer); procedure SelectPlayers; procedure UnloadDetailedCover; @@ -587,7 +587,7 @@ begin if (Ini.PartyPopup = 1) then ScreenSongMenu.MenuShow(SM_Party_Main) else - ScreenSong.StartSong; + Party.CallAfterSongSelect; end; end; end; @@ -1733,17 +1733,15 @@ end; procedure TScreenSong.SetJoker; begin // If Party Mode - // to-do : Party if Mode = smPartyMode then //Show Joker that are available begin - (* - if (PartySession.Teams.NumTeams >= 1) then + if (Length(Party.Teams) >= 1) then begin - Static[StaticTeam1Joker1].Visible := (PartySession.Teams.Teaminfo[0].Joker >= 1); - Static[StaticTeam1Joker2].Visible := (PartySession.Teams.Teaminfo[0].Joker >= 2); - Static[StaticTeam1Joker3].Visible := (PartySession.Teams.Teaminfo[0].Joker >= 3); - Static[StaticTeam1Joker4].Visible := (PartySession.Teams.Teaminfo[0].Joker >= 4); - Static[StaticTeam1Joker5].Visible := (PartySession.Teams.Teaminfo[0].Joker >= 5); + Static[StaticTeam1Joker1].Visible := (Party.Teams[0].JokersLeft >= 1); + Static[StaticTeam1Joker2].Visible := (Party.Teams[0].JokersLeft >= 2); + Static[StaticTeam1Joker3].Visible := (Party.Teams[0].JokersLeft >= 3); + Static[StaticTeam1Joker4].Visible := (Party.Teams[0].JokersLeft >= 4); + Static[StaticTeam1Joker5].Visible := (Party.Teams[0].JokersLeft >= 5); end else begin @@ -1754,13 +1752,13 @@ begin Static[StaticTeam1Joker5].Visible := False; end; - if (PartySession.Teams.NumTeams >= 2) then + if (Length(Party.Teams) >= 2) then begin - Static[StaticTeam2Joker1].Visible := (PartySession.Teams.Teaminfo[1].Joker >= 1); - Static[StaticTeam2Joker2].Visible := (PartySession.Teams.Teaminfo[1].Joker >= 2); - Static[StaticTeam2Joker3].Visible := (PartySession.Teams.Teaminfo[1].Joker >= 3); - Static[StaticTeam2Joker4].Visible := (PartySession.Teams.Teaminfo[1].Joker >= 4); - Static[StaticTeam2Joker5].Visible := (PartySession.Teams.Teaminfo[1].Joker >= 5); + Static[StaticTeam2Joker1].Visible := (Party.Teams[1].JokersLeft >= 1); + Static[StaticTeam2Joker2].Visible := (Party.Teams[1].JokersLeft >= 2); + Static[StaticTeam2Joker3].Visible := (Party.Teams[1].JokersLeft >= 3); + Static[StaticTeam2Joker4].Visible := (Party.Teams[1].JokersLeft >= 4); + Static[StaticTeam2Joker5].Visible := (Party.Teams[1].JokersLeft >= 5); end else begin @@ -1771,13 +1769,13 @@ begin Static[StaticTeam2Joker5].Visible := False; end; - if (PartySession.Teams.NumTeams >= 3) then + if (Length(Party.Teams) >= 3) then begin - Static[StaticTeam3Joker1].Visible := (PartySession.Teams.Teaminfo[2].Joker >= 1); - Static[StaticTeam3Joker2].Visible := (PartySession.Teams.Teaminfo[2].Joker >= 2); - Static[StaticTeam3Joker3].Visible := (PartySession.Teams.Teaminfo[2].Joker >= 3); - Static[StaticTeam3Joker4].Visible := (PartySession.Teams.Teaminfo[2].Joker >= 4); - Static[StaticTeam3Joker5].Visible := (PartySession.Teams.Teaminfo[2].Joker >= 5); + Static[StaticTeam3Joker1].Visible := (Party.Teams[2].JokersLeft >= 1); + Static[StaticTeam3Joker2].Visible := (Party.Teams[2].JokersLeft >= 2); + Static[StaticTeam3Joker3].Visible := (Party.Teams[2].JokersLeft >= 3); + Static[StaticTeam3Joker4].Visible := (Party.Teams[2].JokersLeft >= 4); + Static[StaticTeam3Joker5].Visible := (Party.Teams[2].JokersLeft >= 5); end else begin @@ -1787,7 +1785,7 @@ begin Static[StaticTeam3Joker4].Visible := False; Static[StaticTeam3Joker5].Visible := False; end; - *) + end else begin //Hide all @@ -1845,7 +1843,7 @@ begin //Party Mode if (Mode = smPartyMode) then begin - FadeTo(@ScreenSingModi); + FadeTo(@ScreenSing); end else begin @@ -1876,19 +1874,19 @@ begin end; //Team No of Team (0-5) -procedure TScreenSong.DoJoker (Team: Byte); +procedure TScreenSong.DoJoker (Team: Integer); begin - { + if (Mode = smPartyMode) and - (PartySession.Teams.NumTeams >= Team + 1) and - (PartySession.Teams.Teaminfo[Team].Joker > 0) then + (High(Party.Teams) >= Team) and + (Party.Teams[Team].JokersLeft > 0) then begin //Use Joker - Dec(PartySession.Teams.Teaminfo[Team].Joker); + Dec(Party.Teams[Team].JokersLeft); SelectRandomSong; SetJoker; end; - } + end; //Detailed Cover Unloading. Unloads the Detailed, uncached Cover of the cur. Song diff --git a/Lua/src/screens/UScreenSongMenu.pas b/Lua/src/screens/UScreenSongMenu.pas index 7aa2e498..72be93db 100644 --- a/Lua/src/screens/UScreenSongMenu.pas +++ b/Lua/src/screens/UScreenSongMenu.pas @@ -404,15 +404,18 @@ begin CurMenu := sMenu; Text[0].Text := Language.Translate('SONG_MENU_NAME_PARTY_JOKER'); // 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[0].Visible := (Length(Party.Teams) >= 1) AND (Party.Teams[0].JokersLeft > 0); + Button[1].Visible := (Length(Party.Teams) >= 2) AND (Party.Teams[1].JokersLeft > 0); + Button[2].Visible := (Length(Party.Teams) >= 3) AND (Party.Teams[2].JokersLeft > 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);} + if (Button[0].Visible) then + Button[0].Text[0].Text := String(Party.Teams[0].Name); + if (Button[1].Visible) then + Button[1].Text[0].Text := String(Party.Teams[1].Name); + if (Button[2].Visible) then + Button[2].Text[0].Text := String(Party.Teams[2].Name); Button[3].Text[0].Text := Language.Translate('SONG_MENU_CANCEL'); //Set right Interaction @@ -616,7 +619,7 @@ begin 0: //Button 1 begin //Start Singing - ScreenSong.StartSong; + Party.CallAfterSongSelect; Visible := False; end; -- cgit v1.2.3