//----------------------------------------------------------- // //----------------------------------------------------------- class SRLobbyMenu extends LobbyMenu; struct FPlayerBoxEntry { var moCheckBox ReadyBox; var KFPlayerReadyBar PlayerBox; var GUIImage PlayerPerk; var GUILabel PlayerVetLabel; var bool bIsEmpty; }; var array PlayerBoxes; var automated GUIScrollTextBox tb_ServerMOTD; var int MaxPlayersOnList; var bool bMOTDInit,bMOTDHidden; function AddPlayer( KFPlayerReplicationInfo PRI, int Index, Canvas C ) { local float Top; local Material M; if( Index>=PlayerBoxes.Length ) { Top = Index*0.045; PlayerBoxes.Length = Index+1; PlayerBoxes[Index].ReadyBox = new (None) Class'moCheckBox'; PlayerBoxes[Index].ReadyBox.bValueReadOnly = true; PlayerBoxes[Index].ReadyBox.ComponentJustification = TXTA_Left; PlayerBoxes[Index].ReadyBox.CaptionWidth = 0.82; PlayerBoxes[Index].ReadyBox.LabelColor.B = 0; PlayerBoxes[Index].ReadyBox.WinTop = 0.0475+Top; PlayerBoxes[Index].ReadyBox.WinLeft = 0.075; PlayerBoxes[Index].ReadyBox.WinWidth = 0.4; PlayerBoxes[Index].ReadyBox.WinHeight = 0.045; PlayerBoxes[Index].ReadyBox.RenderWeight = 0.55; PlayerBoxes[Index].ReadyBox.bAcceptsInput = False; PlayerBoxes[Index].PlayerBox = new (None) Class'KFPlayerReadyBar'; PlayerBoxes[Index].PlayerBox.WinTop = 0.04+Top; PlayerBoxes[Index].PlayerBox.WinLeft = 0.04; PlayerBoxes[Index].PlayerBox.WinWidth = 0.35; PlayerBoxes[Index].PlayerBox.WinHeight = 0.045; PlayerBoxes[Index].PlayerBox.RenderWeight = 0.35; PlayerBoxes[Index].PlayerPerk = new (None) Class'GUIImage'; PlayerBoxes[Index].PlayerPerk.ImageStyle = ISTY_Justified; PlayerBoxes[Index].PlayerPerk.WinTop = 0.043+Top; PlayerBoxes[Index].PlayerPerk.WinLeft = 0.0418; PlayerBoxes[Index].PlayerPerk.WinWidth = 0.039; PlayerBoxes[Index].PlayerPerk.WinHeight = 0.039; PlayerBoxes[Index].PlayerPerk.RenderWeight = 0.56; PlayerBoxes[Index].PlayerVetLabel = new (None) Class'GUILabel'; PlayerBoxes[Index].PlayerVetLabel.TextAlign = TXTA_Right; PlayerBoxes[Index].PlayerVetLabel.TextColor = Class'Canvas'.Static.MakeColor(19,19,19); PlayerBoxes[Index].PlayerVetLabel.TextFont = "UT2SmallFont"; PlayerBoxes[Index].PlayerVetLabel.WinTop = 0.04+Top; PlayerBoxes[Index].PlayerVetLabel.WinLeft = 0.22907; PlayerBoxes[Index].PlayerVetLabel.WinWidth = 0.151172; PlayerBoxes[Index].PlayerVetLabel.WinHeight = 0.045; PlayerBoxes[Index].PlayerVetLabel.RenderWeight = 0.5; AppendComponent(PlayerBoxes[Index].ReadyBox, true); AppendComponent(PlayerBoxes[Index].PlayerBox, true); AppendComponent(PlayerBoxes[Index].PlayerPerk, true); AppendComponent(PlayerBoxes[Index].PlayerVetLabel, true); Top = (PlayerBoxes[Index].PlayerBox.WinTop+PlayerBoxes[Index].PlayerBox.WinHeight); if( !bMOTDHidden && Top>=ADBackground.WinTop ) { ADBackground.WinTop = Top+0.01; if( (ADBackground.WinTop+ADBackground.WinHeight)>t_ChatBox.WinTop ) { ADBackground.WinHeight = t_ChatBox.WinTop-ADBackground.WinTop; if( ADBackground.WinHeight<0.15 ) { RemoveComponent(ADBackground); RemoveComponent(tb_ServerMOTD); bMOTDHidden = true; } } } } PlayerBoxes[Index].ReadyBox.Checked(PRI.bReadyToPlay); PlayerBoxes[Index].ReadyBox.SetCaption(" "$Left(PRI.PlayerName,20)); if ( PRI.ClientVeteranSkill != none ) { PlayerBoxes[Index].PlayerVetLabel.Caption = "Lv" @ PRI.ClientVeteranSkillLevel @ PRI.ClientVeteranSkill.default.VeterancyName; if( Class(PRI.ClientVeteranSkill)!=None ) { Class(PRI.ClientVeteranSkill).Static.PreDrawPerk(C,PRI.ClientVeteranSkillLevel,PlayerBoxes[Index].PlayerPerk.Image,M); PlayerBoxes[Index].PlayerPerk.ImageColor = C.DrawColor; } else { PlayerBoxes[Index].PlayerPerk.Image = PRI.ClientVeteranSkill.default.OnHUDIcon; PlayerBoxes[Index].PlayerPerk.ImageColor = Class'Canvas'.Static.MakeColor(255,255,255); } } else { PlayerBoxes[Index].PlayerPerk.Image = None; PlayerBoxes[Index].PlayerVetLabel.Caption = ""; } PlayerBoxes[Index].bIsEmpty = false; } function EmptyPlayers( int Index ) { while( Index=MaxPlayersOnList ) GoTo'DoneIt'; } // Then comes rest. for ( i = 0; i < KFGRI.PRIArray.Length; i++ ) { if ( KFGRI.PRIArray[i]==none || KFGRI.PRIArray[i].bOnlySpectator || !KFGRI.PRIArray[i].bReadyToPlay || KFPlayerReplicationInfo(KFGRI.PRIArray[i])==None ) continue; if ( KFGRI.PRIArray[i].bReadyToPlay ) { if ( !bTimeoutTimeLogged ) { ActivateTimeoutTime = PC.Level.TimeSeconds; bTimeoutTimeLogged = true; } } AddPlayer(KFPlayerReplicationInfo(KFGRI.PRIArray[i]),j,C); if( ++j>=MaxPlayersOnList ) GoTo'DoneIt'; } if( j(KFPRI.ClientVeteranSkill)!=None ) Class(KFPRI.ClientVeteranSkill).Static.PreDrawPerk(Canvas,KFPRI.ClientVeteranSkillLevel,M,SM); else M = KFPRI.ClientVeteranSkill.default.OnHUDIcon; Canvas.DrawTile(M, IconSize, IconSize, 0, 0, M.MaterialUSize(), M.MaterialVSize()); TempX += IconSize + (IconToInfoSpacing * Width); TempY += TextTopOffset * Height; ProgressBarWidth = Width - (TempX - X) - (IconToInfoSpacing * Width); // Select Text Color Canvas.SetDrawColor(255, 255, 255, 255); // Draw the Perk's Level name Canvas.StrLen(PerkName, TempWidth, TempHeight); Canvas.SetPos(TempX, TempY); Canvas.DrawText(PerkName); // Draw the Perk's Level if ( PerkLevelString != "" ) { Canvas.StrLen(PerkLevelString, TempWidth, TempHeight); Canvas.SetPos(TempX + ProgressBarWidth - TempWidth, TempY); Canvas.DrawText(PerkLevelString); } TempY += TempHeight + (0.01 * Height); if( CurrentVeterancy!=KFPRI.ClientVeteranSkill || CurrentVeterancyLevel!=LevelIndex ) { CurrentVeterancy = KFPRI.ClientVeteranSkill; CurrentVeterancyLevel = LevelIndex; lb_PerkEffects.SetContent(Class(KFPRI.ClientVeteranSkill).Static.GetVetInfoText(LevelIndex,1)); } } function bool ShowPerkMenu(GUIComponent Sender) { if ( PlayerOwner() != none) PlayerOwner().ClientOpenMenu(string(Class'SRProfilePage'), false); return true; } defaultproperties { Begin Object Class=GUIScrollTextBox Name=MOTDScroll CharDelay=0.002500 EOLDelay=0.100000 OnCreateComponent=MOTDScroll.InternalOnCreateComponent WinTop=0.354102 WinLeft=0.072187 WinWidth=0.312375 WinHeight=0.335000 TabOrder=9 End Object tb_ServerMOTD=GUIScrollTextBox'ServerPerks.SRLobbyMenu.MOTDScroll' MaxPlayersOnList=18 ReadyBox(0)=None ReadyBox(1)=None ReadyBox(2)=None ReadyBox(3)=None ReadyBox(4)=None ReadyBox(5)=None PlayerBox(0)=None PlayerBox(1)=None PlayerBox(2)=None PlayerBox(3)=None PlayerBox(4)=None PlayerBox(5)=None PlayerPerk(0)=None PlayerPerk(1)=None PlayerPerk(2)=None PlayerPerk(3)=None PlayerPerk(4)=None PlayerPerk(5)=None PlayerVetLabel(0)=None PlayerVetLabel(1)=None PlayerVetLabel(2)=None PlayerVetLabel(3)=None PlayerVetLabel(4)=None PlayerVetLabel(5)=None Begin Object Class=SRLobbyChat Name=ChatBox OnCreateComponent=ChatBox.InternalOnCreateComponent WinTop=0.807600 WinLeft=0.016090 WinWidth=0.971410 WinHeight=0.100000 RenderWeight=0.010000 TabOrder=1 OnPreDraw=ChatBox.FloatingPreDraw OnRendered=ChatBox.FloatingRendered OnHover=ChatBox.FloatingHover OnMousePressed=ChatBox.FloatingMousePressed OnMouseRelease=ChatBox.FloatingMouseRelease End Object t_ChatBox=SRLobbyChat'ServerPerks.SRLobbyMenu.ChatBox' Begin Object Class=SRLobbyFooter Name=BuyFooter RenderWeight=0.300000 TabOrder=8 bBoundToParent=False bScaleToParent=False OnPreDraw=BuyFooter.InternalOnPreDraw End Object t_Footer=SRLobbyFooter'ServerPerks.SRLobbyMenu.BuyFooter' }