unit UScreenPartyNewRoundM2; interface uses UMenu, SDL, UDisplay, UMusic, UFiles, SysUtils, UThemes; type TScreenPartyNewRoundM2 = class(TMenu) public //Texts: TextRound: array [1..9] of cardinal; TextWinner: array [1..9] of cardinal; TextNextRound: cardinal; TextNextPlayer1: cardinal; TextNextPlayer2: cardinal; TextHandicap: cardinal; //Statics StaticRound: array [1..9] of cardinal; StaticTable: array [1..9] of cardinal; StaticNextPlayer1: cardinal; StaticNextPlayer2: cardinal; StaticHandicap: cardinal; TextTableName: array[1..9,1..7] of cardinal; ScreenRound: Integer; constructor Create; override; function ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; override; function FillNulls(number: integer): String; procedure onShow; override; procedure SetAnimationProgress(Progress: real); override; procedure Update; end; const ID='ID_019'; //for help system implementation uses UGraphic, UMain, UIni, UTexture, UPartyM2, UDLLManager, ULanguage, ULog, UHelp; function TScreenPartyNewRoundM2.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; begin Result := true; If (PressedDown) Then begin // Key Down case PressedKey of SDLK_TAB: begin ScreenPopupHelp.ShowPopup(); end; SDLK_Q: begin Result := false; end; SDLK_ESCAPE, SDLK_BACKSPACE : begin Music.PlayBack; CheckFadeTo(@ScreenMain,'MSG_END_PARTY'); end; SDLK_RETURN: begin if(PartySessionM2.CurRound=1 then dec(ScreenRound); Update; end; SDLK_RIGHT: begin if ScreenRound<=(Length(PartySessionM2.Rounds)-9) then inc(ScreenRound); Update; end; SDLK_LEFT: begin if ScreenRound>=1 then dec(ScreenRound); Update; end; end; end; end; constructor TScreenPartyNewRoundM2.Create; var I, J: integer; begin inherited Create; LoadFromTheme(Theme.PartyNewRoundM2); for I := 1 to 9 do begin TextRound[I] := AddText (Theme.PartyNewRoundM2.TextRound[I]); TextWinner[I] := AddText (Theme.PartyNewRoundM2.TextWinner[I]); StaticRound[I] := AddStatic (Theme.PartyNewRoundM2.StaticRound[I]); StaticTable[I] := AddStatic (Theme.PartyNewRoundM2.StaticTable[I]); end; TextNextRound := AddText (Theme.PartyNewRoundM2.TextNextRound); TextNextPlayer1 := AddText (Theme.PartyNewRoundM2.TextNextPlayer1); TextNextPlayer2 := AddText (Theme.PartyNewRoundM2.TextNextPlayer2); TextHandicap := AddText (Theme.PartyNewRoundM2.TextHandicap); StaticNextPlayer1 := AddStatic (Theme.PartyNewRoundM2.StaticNextPlayer1); StaticNextPlayer2 := AddStatic (Theme.PartyNewRoundM2.StaticNextPlayer2); StaticHandicap := AddStatic (Theme.PartyNewRoundM2.StaticHandicap); //Table for I := 1 to 9 do begin for J := 1 to 7 do begin TextTableName[I,J] := AddText (Theme.PartyNewRoundM2.TextTableName[I,J]); end; end; end; procedure TScreenPartyNewRoundM2.onShow; var x,y: Integer; begin inherited; if not Help.SetHelpID(ID) then Log.LogError('No Entry for Help-ID ' + ID + ' (ScreenPartyNewRoundM2)'); PartySessionM2.StartRound; ScreenRound:=PartySessionM2.CurRound-2; if ScreenRound<0 then begin ScreenRound:=PartySessionM2.CurRound-1; if ScreenRound<0 then ScreenRound:=0; end; Update; //Display Scores for x := 1 to 9 do begin if x<=PartySessionM2.Players.NumPlayer then begin Static[StaticTable[x]].Visible := true; Text[TextTableName[x,1]].Text := IntToStr(x); Text[TextTableName[x,2]].Text := PartySessionM2.Players.Playerinfo[PartySessionM2.Order[x-1]].Name; Text[TextTableName[x,3]].Text := IntToStr(PartySessionM2.Players.Playerinfo[PartySessionM2.Order[x-1]].Wins); Text[TextTableName[x,4]].Text := IntToStr(PartySessionM2.Players.Playerinfo[PartySessionM2.Order[x-1]].Draws); Text[TextTableName[x,5]].Text := IntToStr(PartySessionM2.Players.Playerinfo[PartySessionM2.Order[x-1]].Defeats); Text[TextTableName[x,6]].Text := IntToStr(PartySessionM2.Players.Playerinfo[PartySessionM2.Order[x-1]].ScoreP - PartySessionM2.Players.Playerinfo[PartySessionM2.Order[x-1]].ScoreN); Text[TextTableName[x,7]].Text := IntToStr(PartySessionM2.Players.Playerinfo[PartySessionM2.Order[x-1]].Points); end else begin for y := 1 to 7 do begin Text[TextTableName[x,y]].Text := ''; Static[StaticTable[x]].Visible := false; end; end; end; //nextRound Texts if PartySessionM2.CurRound= T) then begin Static[StaticRound[T]].Visible := true; Text[TextRound[T]].Visible := true; if (N+T-1