// base class, not vanilla
class NiceLobbyMenu extends UT2k4MainPage;


// some constants
const MaxPlayersOnList=18;

// RIGHT part lables
var private string str_Beginner, str_Normal, str_Hard, str_Sui, str_HOE;
var private string str_CurrentMap, str_Difficulty, str_ServerName;
var private string SelectPerkInformationString, PerksDisabledString;
// LEFT part labels
var private string str_LvlAbbr;
var private string WaitingForServerStatus, WaitingForOtherPlayers, AutoCommence;

// player name-perk-ready boxes 
struct FPlayerBoxEntry
{
  var moCheckBox ReadyBox;
  var KFPlayerReadyBar PlayerBox;
  var GUIImage PlayerPerk;
  var GUILabel PlayerVetLabel;
  var bool bIsEmpty;
};
var array<FPlayerBoxEntry> PlayerBoxes;

var bool bShowProfilePage;

// swapped class
var automated KFLobbyChat t_ChatBox;

// diffculty / map name label
var automated AltSectionBackground GameInfoBG;
var automated GUILabel CurrentMapLabel;
var automated GUILabel DifficultyLabel;
var automated GUILabel ServerNameLabel;

// circle and current wave label
var automated GUIImage WaveBG;
var automated GUILabel WaveLabel;

var automated GUILabel label_TimeOutCounter;
var automated GUILabel PerkClickLabel;

var bool bAllowClose;

// Perks / Profile
var() string sChar, sCharD;
var() xUtil.PlayerRecord PlayerRec;

var automated GUISectionBackground  i_BGPerk;

var automated GUISectionBackground  i_BGPerkEffects;
var automated GUIScrollTextBox      lb_PerkEffects;

var automated GUIImage              i_Portrait;
var automated GUISectionBackground  PlayerPortraitBG;

var float IconBorder;         // Percent of Height to leave blank inside Icon Background
var float ItemBorder;         // Percent of Height to leave blank inside Item Background
var float ItemSpacing;        // Number of Pixels between Items
var float ProgressBarHeight;  // Percent of Height to make Progress Bar's Height
var float TextTopOffset;      // Percent of Height to off Progress String from top of Progress Bar(typically negative)
var float IconToInfoSpacing;  // Percent of Width to offset Info from right side of Icon

//var bool bAdminUse;  // If you're not an admin, gtfo!

var int  ActivateTimeoutTime;    // When was the lobby timeout turned on?
var bool bTimeoutTimeLogged;     // Was it already logged once?
var bool bTimedOut;              // Have we timed out out successfully?

var bool bShouldUpdateVeterancy;
var class<KFVeterancyTypes> CurrentVeterancy;
var int CurrentVeterancyLevel;


function InitComponent(GUIController MyC, GUIComponent MyO)
{
  super(UT2k4MainPage).InitComponent(MyC, MyO);

  FixPortrait();
  t_ChatBox.FocusInstead = PerkClickLabel;
}


event ResolutionChanged(int ResX, int ResY)
{
  super.ResolutionChanged(ResX, ResY);
  FixPortrait();
}


// FUCKING TWI, YOUR FUCKING BUGS
final private function bool FixPortrait()
{
  i_Portrait.WinTop = PlayerPortraitBG.RelativeTop(i_Portrait.WinTop); // ActualTop() + 30;
  i_Portrait.WinHeight = PlayerPortraitBG.RelativeHeight(i_Portrait.WinHeight); // ActualHeight() - 36;
  // log(">>> HideLobbyMenu: FixPortrait() called!!!");

  return false;
}


// Called when the Menu Owner is opened
event Opened(GUIComponent Sender)
{
  bShouldUpdateVeterancy = true;

  // disable some shit for story mode
  if (PlayerOwner().GameReplicationInfo.IsA('KF_StoryGRI'))
  {
    // disable background
    WaveBG.Image = none;
    WaveBG.DisableMe();
    // disable waves text
    WaveLabel.Caption = "";
    WaveLabel.Hide();
  }

  SetTimer(1, true);
}


// if we don't reset persistence, playerboxes will continue to pile
function bool NotifyLevelChange()
{
  bPersistent = false;
  bAllowClose = true;
  Controller.CloseMenu(true);

  return true;
}


function bool InternalOnKeyEvent(out byte Key, out byte State, float delta)
{
  local int i;
  local bool bVoiceChatKey;
  local array<string> BindKeyNames, LocalizedBindKeyNames;

  Controller.GetAssignedKeys("VoiceTalk", BindKeyNames, LocalizedBindKeyNames);

  for (i = 0; i < BindKeyNames.Length; i++)
  {
    if (Mid(GetEnum(enum'EInputKey', Key), 3) ~= BindKeyNames[i])
    {
      bVoiceChatKey = true;
      break;
    }
  }

  if (bVoiceChatKey)
  {
    if (state == 1 || state == 2)
    {
      if (PlayerOwner() != none)
      {
        PlayerOwner().bVoiceTalk = 1;
      }
    }
    else
    {
      if (PlayerOwner() != none)
      {
        PlayerOwner().bVoiceTalk = 0;
        return false;
      }
    }

    return true;
  }

  return false;
}


function TimedOut()
{
  bTimedOut = true;
  PlayerOwner().ServerRestartPlayer();
  bAllowClose = true;
}


function bool InternalOnPreDraw(Canvas C)
{
  local int i, j;
  local string StoryString;
  local String SkillString;
  local KFGameReplicationInfo KFGRI;
  local PlayerController PC;

  PC = PlayerOwner();

  if (PC == none || PC.Level == none) // Error?
    return false;

  if ((PC.PlayerReplicationInfo != none && (!PC.PlayerReplicationInfo.bWaitingPlayer || PC.PlayerReplicationInfo.bOnlySpectator)) || PC.Outer.Name == 'Entry')
  {
    bAllowClose = true;
    PC.ClientCloseMenu(true,false);
    return false;
  }

  t_Footer.InternalOnPreDraw(C);
  KFGRI = KFGameReplicationInfo(PC.GameReplicationInfo);

  if (KFGRI != none)
  {
    WaveLabel.Caption = string(KFGRI.WaveNumber + 1) $ "/" $ string(KFGRI.FinalWave);
  }
  else
  {
    WaveLabel.Caption = "?/?";
    return false;
  }
  C.DrawColor.A = 255;

  // CHECK ME LATER
  if (KFPlayerController(PC) != none && bShouldUpdateVeterancy)
  {
    if (KFPlayerController(PC).SelectedVeterancy == none)
    {
      bShowProfilePage = true;

      if (PC.SteamStatsAndAchievements == none)
      {
        if (PC.Level.NetMode != NM_Client)
        {
          PC.SteamStatsAndAchievements = PC.Spawn(PC.default.SteamStatsAndAchievementsClass, PC);
          if (!PC.SteamStatsAndAchievements.Initialize(PC))
          {
            Controller.OpenMenu(Controller.QuestionMenuClass);
            GUIQuestionPage(Controller.TopPage()).SetupQuestion(class'KFMainMenu'.default.UnknownSteamErrorText, QBTN_Ok, QBTN_Ok);
            PC.SteamStatsAndAchievements.Destroy();
            PC.SteamStatsAndAchievements = none;
          }
          else
          {
            PC.SteamStatsAndAchievements.OnDataInitialized = OnSteamStatsAndAchievementsReady;
          }
        }

        bShowProfilePage = false;
      }
      else if (!PC.SteamStatsAndAchievements.bInitialized)
      {
        PC.SteamStatsAndAchievements.OnDataInitialized = OnSteamStatsAndAchievementsReady;
        PC.SteamStatsAndAchievements.GetStatsAndAchievements();
        bShowProfilePage = false;
      }

      if (KFSteamStatsAndAchievements(PC.SteamStatsAndAchievements) != none)
      {
        for (i = 0; i < class'KFGameType'.default.LoadedSkills.Length; i++)
        {
          if (KFSteamStatsAndAchievements(PC.SteamStatsAndAchievements).GetPerkProgress(i) < 0.0)
          {
            PC.SteamStatsAndAchievements.OnDataInitialized = OnSteamStatsAndAchievementsReady;
            PC.SteamStatsAndAchievements.GetStatsAndAchievements();
            bShowProfilePage = false;
          }
        }
      }

      if (bShowProfilePage)
      {
        OnSteamStatsAndAchievementsReady();
      }

      bShouldUpdateVeterancy = false;
    }
    else if (PC.SteamStatsAndAchievements != none && PC.SteamStatsAndAchievements.bInitialized)
    {
      KFPlayerController(PC).SendSelectedVeterancyToServer();
      bShouldUpdateVeterancy = false;
    }
  }

  // First fill in non-ready players.
  for (i = 0; i < KFGRI.PRIArray.Length; i++)
  {
    if (!bValidPRI(KFGRI.PRIArray[i]) || KFGRI.PRIArray[i].bReadyToPlay)
      continue;

    // start from 0
    AddPlayer(KFPlayerReplicationInfo(KFGRI.PRIArray[i]), j, C);
    if (++j >= MaxPlayersOnList)
      GoTo'DoneIt';
  }

  // Then comes rest.
  for (i = 0; i < KFGRI.PRIArray.Length; i++)
  {
    if (!bValidPRI(KFGRI.PRIArray[i]) || !KFGRI.PRIArray[i].bReadyToPlay)
      continue;

    if (KFGRI.PRIArray[i].bReadyToPlay)
    {
      if (!bTimeoutTimeLogged)
      {
        ActivateTimeoutTime = PC.Level.TimeSeconds;
        bTimeoutTimeLogged = true;
      }
    }
    // continue from last idx
    AddPlayer(KFPlayerReplicationInfo(KFGRI.PRIArray[i]), j, C);
    if (++j >= MaxPlayersOnList)
      GoTo'DoneIt';
  }

  if (j < MaxPlayersOnList)
    EmptyPlayers(j);

DoneIt:
  StoryString = PC.Level.Description;

  if (KFGRI.BaseDifficulty <= 1)
    SkillString = str_Beginner;
  else if (KFGRI.BaseDifficulty <= 2)
    SkillString = str_Normal;
  else if (KFGRI.BaseDifficulty <= 4)
    SkillString = str_Hard;
  else if (KFGRI.BaseDifficulty <= 5)
    SkillString = str_Sui;
  else
    SkillString = str_HOE;

  CurrentMapLabel.Caption = str_CurrentMap @ PC.Level.Title;
  DifficultyLabel.Caption = str_Difficulty @ SkillString;

  // UT2K4PlayerLoginMenu copy-cat
  if (PC.Level.NetMode == NM_StandAlone || PC.GameReplicationInfo == None || PC.GameReplicationInfo.ServerName == "")
		ServerNameLabel.Caption = str_ServerName @ "SOLO MODE ACTIVE!";
	else
    ServerNameLabel.Caption = str_ServerName @ PC.GameReplicationInfo.ServerName;

  return false;
}


// filter none, spectators, non-KFPRI ones
final private function bool bValidPRI(PlayerReplicationInfo PRI)
{
  if (PRI == none || PRI.bOnlySpectator || KFPlayerReplicationInfo(PRI) == none)
    return false;
  else
    return true;
}


final private function AddPlayer(KFPlayerReplicationInfo PRI, int Index, Canvas C)
{
  local float Top;
  local Material M;
  local ScrnBalance Mut;
  local String PlayerName;

  if (Index >= PlayerBoxes.Length)
  {
    Top = Index * 0.045;
    PlayerBoxes.Length = Index + 1;
    // create GUIComponents and set defaults
    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;

    // finally add the GUIComponents
    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);
  }
  PlayerBoxes[Index].ReadyBox.Checked(PRI.bReadyToPlay);
  Mut = class'ScrnBalance'.default.Mut;
  if ( Mut != none )
    PlayerName = Mut.LeftCol(Mut.ColoredPlayerName(PRI), 20);
  else
    PlayerName = Left(PRI.PlayerName, 20);

  PlayerBoxes[Index].ReadyBox.SetCaption(" "$PlayerName);

  if (PRI.ClientVeteranSkill != none)
  {
    PlayerBoxes[Index].PlayerVetLabel.Caption = str_LvlAbbr @ PRI.ClientVeteranSkillLevel @ PRI.ClientVeteranSkill.default.VeterancyName;
    if (Class<SRVeterancyTypes>(PRI.ClientVeteranSkill) != None)
    {
      Class<SRVeterancyTypes>(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;
}


final private function EmptyPlayers(int Index)
{
  local int i;

  while (Index < PlayerBoxes.Length && !PlayerBoxes[Index].bIsEmpty)
  {
    PlayerBoxes[Index].ReadyBox.Checked(false);
    PlayerBoxes[Index].PlayerPerk.Image = none;
    PlayerBoxes[Index].PlayerVetLabel.Caption = "";
    PlayerBoxes[Index].ReadyBox.SetCaption("");
    PlayerBoxes[Index].bIsEmpty = true;
    ++Index;
  }

  for (i = 0; i < PlayerBoxes.Length; i++)
  {
    if (PlayerBoxes[i].bIsEmpty)
    {
      // remove GUIComponents
      RemoveComponent(PlayerBoxes[i].ReadyBox, false);
      RemoveComponent(PlayerBoxes[i].PlayerBox, false);
      RemoveComponent(PlayerBoxes[i].PlayerPerk, false);
      RemoveComponent(PlayerBoxes[i].PlayerVetLabel, false);
      // remove refs
      PlayerBoxes[i].ReadyBox = none;
      PlayerBoxes[i].PlayerBox = none;
      PlayerBoxes[i].PlayerPerk = none;
      PlayerBoxes[i].PlayerVetLabel = none;
      // remove from array
      PlayerBoxes.remove(i, 1);
      // everything works fine this way, do not log
      // log(">>> NiceLobbyMenu: EmptyPlayers executed.");
    }
  }
}


function bool StopClose(optional bool bCancelled)
{
  // clean chat box
  t_ChatBox.lb_Chat.SetContent("");

  // this is for the OnCanClose delegate
  // can't close now unless done by call to CloseAll,
  // or the bool has been set to true by LobbyFooter
  return false;
}


function InternalOnClosed(bool bCancelled)
{
  if (PlayerOwner() != none)
  {
    PlayerOwner().Advertising_ExitZone();
  }
}


event Timer()
{
  local KFGameReplicationInfo KF;

  if (PlayerOwner().PlayerReplicationInfo == none)
    return;

  if (PlayerOwner().PlayerReplicationInfo.bOnlySpectator)
  {
    label_TimeOutCounter.caption = "You are a spectator.";
    return;
  }

  KF = KFGameReplicationInfo(PlayerOwner().GameReplicationInfo);

  if (KF == none)
  {
    label_TimeOutCounter.caption = WaitingForServerStatus;
  }
  else if (KF.LobbyTimeout <= 0)
  {
    label_TimeOutCounter.caption = WaitingForOtherPlayers;
  }
  else
  {
    label_TimeOutCounter.caption = AutoCommence $ KF.LobbyTimeout;
  }
}


final private function DrawPerk(Canvas Canvas)
{
  local float X, Y, Width, Height;
  local int LevelIndex;
  local float TempX, TempY;
  local float TempWidth, TempHeight;
  local float IconSize, ProgressBarWidth;
  local string PerkName, PerkLevelString;
  local KFPlayerReplicationInfo KFPRI;
  local Material M, SM;

  DrawPortrait();

  KFPRI = KFPlayerReplicationInfo(PlayerOwner().PlayerReplicationInfo);

  if (KFPRI == none || KFPRI.ClientVeteranSkill == None)
  {
    if (CurrentVeterancyLevel != 255)
    {
      CurrentVeterancyLevel = 255;
      lb_PerkEffects.SetContent("None perk active");
    }
    return;
  }

  LevelIndex = KFPRI.ClientVeteranSkillLevel;
	PerkName = KFPRI.ClientVeteranSkill.default.VeterancyName;
	PerkLevelString = str_LvlAbbr @ LevelIndex;

  //Get the position size etc in pixels
  X = (i_BGPerk.WinLeft + 0.003) * Canvas.ClipX;
  Y = (i_BGPerk.WinTop + 0.040) * Canvas.ClipY;

  Width = (i_BGPerk.WinWidth - 0.006) * Canvas.ClipX;
  Height = (i_BGPerk.WinHeight - 0.043) * Canvas.ClipY;

  // Offset for the Background
  TempX = X;
  TempY = Y;

  // Initialize the Canvas
  Canvas.Style = 1;
  Canvas.Font = class'ROHUD'.Static.GetSmallMenuFont(Canvas);
  Canvas.SetDrawColor(255, 255, 255, 255);

  // Draw Item Background
  Canvas.SetPos(TempX, TempY);

  // Offset and Calculate Icon's Size
  TempX += ItemBorder * Height;
  TempY += ItemBorder * Height;
  IconSize = Height - (ItemBorder * 2.0 * Height);

  // Draw Icon
  Canvas.SetPos(TempX, TempY);
  if( Class<SRVeterancyTypes>(KFPRI.ClientVeteranSkill)!=None )
		Class<SRVeterancyTypes>(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<SRVeterancyTypes>(KFPRI.ClientVeteranSkill).Static.GetVetInfoText(LevelIndex,1));
  }
}


final private function DrawPortrait()
{
  if (PlayerOwner().PlayerReplicationInfo != none)
    sChar = PlayerOwner().PlayerReplicationInfo.CharacterName;
  else
    sChar = PlayerOwner().GetUrlOption("Character");

  if (sCharD != sChar)
  {
    sCharD = sChar;
    SetPlayerRec();
  }
}


final private function SetPlayerRec()
{
  PlayerRec = Class'xUtil'.Static.FindPlayerRecord(sChar);
  i_Portrait.Image = PlayerRec.Portrait;
}


final private function bool ShowPerkMenu(GUIComponent Sender)
{
  if (PlayerOwner() != none)
  {
    if (ScrnPlayerController(PlayerOwner()) != none )
      PlayerOwner().ClientOpenMenu(ScrnPlayerController(PlayerOwner()).ProfilePageClassString, false);
    else
      PlayerOwner().ClientOpenMenu(string(class'ScrnProfilePage'), false);
  }

  return true;
}


final private function OnSteamStatsAndAchievementsReady()
{
  Controller.OpenMenu("KFGUI.KFProfilePage");

  Controller.OpenMenu(Controller.QuestionMenuClass);
  GUIQuestionPage(Controller.TopPage()).SetupQuestion(SelectPerkInformationString, QBTN_Ok, QBTN_Ok);
}


//=============================================================================
//                             DEFAULTPROPERTIES
//=============================================================================
defaultproperties
{
  str_Beginner="Beginner"
  str_Normal="Normal"
  str_Hard="Hard"
  str_Sui="Suicidal"
  str_HOE="Hell on Earth"

  str_LvlAbbr="Lv"
  str_CurrentMap="Current Map:"
  str_Difficulty="Difficulty:"
  str_ServerName="Server Name:"

  SelectPerkInformationString="Perks enhance certain abilities of your character.|There are 6 Perks to choose from in the center of the screen.|Each has different Effects shown in the upper right.|Perks improve as you complete the Level Requirements shown on the right."
  PerksDisabledString="Perk Progress has been disabled because the Game Length is set to Custom, Sandbox Mode is on, or you have previously used Cheats."

  WaitingForServerStatus="Awaiting server status..."
  WaitingForOtherPlayers="Waiting for players to be ready..."
  AutoCommence="Game will auto-commence in: "

  // replace LobbyChat
  Begin Object Class=NiceLobbyChat Name=ChatBox
    OnCreateComponent=ChatBox.InternalOnCreateComponent
    TabOrder=1
    RenderWeight=0.01
    OnHover=ChatBox.FloatingHover
    WinTop=0.80760
    WinLeft=0.016090
    WinWidth=0.971410
    WinHeight=0.100000
    ToolTip=none
  End Object
  t_ChatBox=ChatBox

  // replace LobbyFooter
  Begin Object Class=NiceLobbyFooter Name=BuyFooter
    RenderWeight=0.300000
    TabOrder=8
    bBoundToParent=false
    bScaleToParent=false
    OnPreDraw=BuyFooter.InternalOnPreDraw
  End Object
  t_Footer=BuyFooter

  // RIGHT part, server name - map name - difficulty - waves
  Begin Object Class=AltSectionBackground Name=GameInfoB
    WinTop=0.037851
    WinLeft=0.489062
    WinWidth=0.487374
    WinHeight=0.100000
    OnPreDraw=GameInfoB.InternalPreDraw
  End Object
  GameInfoBG=GameInfoB

  Begin Object Class=GUILabel Name=ServerNameL
    Caption="tmp name"
    TextColor=(B=158,G=176,R=175)
    WinTop=0.042179
    WinLeft=0.496524
    WinWidth=0.360000
    WinHeight=0.035714
    RenderWeight=0.900000
  End Object
  ServerNameLabel=ServerNameL

  Begin Object Class=GUILabel Name=CurrentMapL
    Caption="tmp Map"
    TextColor=(B=158,G=176,R=175)
    WinTop=0.072381
    WinLeft=0.496524
    WinWidth=0.360000
    WinHeight=0.035714
    RenderWeight=0.900000
  End Object
  CurrentMapLabel=CurrentMapL

  Begin Object Class=GUILabel Name=DifficultyL
    Caption="tmp diff"
    TextColor=(B=158,G=176,R=175)
    WinTop=0.102583
    WinLeft=0.496524
    WinWidth=0.360000
    WinHeight=0.035714
    RenderWeight=0.900000
  End Object
  DifficultyLabel=DifficultyL

  Begin Object Class=GUIImage Name=WaveB
    Image=Texture'KillingFloorHUD.HUD.Hud_Bio_Circle'
    ImageStyle=ISTY_Justified
    ImageRenderStyle=MSTY_Normal
    WinTop=0.043810
    WinLeft=0.923238
    WinWidth=0.051642
    WinHeight=0.061783
    RenderWeight=0.800000
  End Object
  WaveBG=WaveB

  Begin Object Class=GUILabel Name=WaveL
    Caption="1/4"
    TextAlign=TXTA_Center
    TextColor=(B=158,G=176,R=175)
    VertAlign=TXTA_Center
    FontScale=FNS_Small
    WinTop=0.043810
    WinLeft=0.923238
    WinWidth=0.051642
    WinHeight=0.061783
    RenderWeight=0.900000
  End Object
  WaveLabel=WaveL

  // LEFT part
  Begin Object Class=GUILabel Name=TimeOutCounter
    Caption="Game will auto-commence in: "
    TextAlign=TXTA_Center
    TextColor=(B=158,G=176,R=175)
    WinTop=0.000010
    WinLeft=0.059552
    WinWidth=0.346719
    WinHeight=0.045704
    TabOrder=6
  End Object
  label_TimeOutCounter=TimeOutCounter

  Begin Object Class=GUILabel Name=PerkClickArea
    WinTop=0.432395
    WinLeft=0.488851
    WinWidth=0.444405
    WinHeight=0.437312
    bAcceptsInput=true
    OnClickSound=CS_Click
    OnClick=NiceLobbyMenu.ShowPerkMenu
  End Object
  PerkClickLabel=PerkClickArea

  Begin Object Class=GUISectionBackground Name=BGPerk
    bFillClient=true
    Caption="Current Perk"
    WinTop=0.432291
    WinLeft=0.650976
    WinWidth=0.325157
    WinHeight=0.138086
    OnPreDraw=BGPerk.InternalPreDraw
  End Object
  i_BGPerk=BGPerk

  Begin Object Class=GUISectionBackground Name=BGPerkEffects
    bFillClient=true
    Caption="Perk Effects"
    WinTop=0.568448
    WinLeft=0.650976
    WinWidth=0.325157
    WinHeight=0.307442
    OnPreDraw=BGPerkEffects.InternalPreDraw
  End Object
  i_BGPerkEffects=BGPerkEffects

  Begin Object Class=GUIScrollTextBox Name=PerkEffectsScroll
    CharDelay=0.002500
    EOLDelay=0.100000
    OnCreateComponent=PerkEffectsScroll.InternalOnCreateComponent
    WinTop=0.626094
    WinLeft=0.659687
    WinWidth=0.309454
    WinHeight=0.244961
    TabOrder=9
    ToolTip=none
  End Object
  lb_PerkEffects=PerkEffectsScroll

  Begin Object Class=GUIImage Name=PlayerPortrait
    Image=Texture'InterfaceArt_tex.Menu.changeme_texture'
    ImageStyle=ISTY_Scaled
    ImageRenderStyle=MSTY_Normal
    IniOption="@Internal"
    WinTop=0.472396
    WinLeft=0.492522
    WinWidth=0.156368
    WinHeight=0.397022
    RenderWeight=0.300000
  End Object
  i_Portrait=PlayerPortrait

  Begin Object Class=GUISectionBackground Name=PlayerPortraitB
    WinTop=0.432291
    WinLeft=0.489062
    WinWidth=0.163305
    WinHeight=0.443451
    OnPreDraw=PlayerPortraitB.InternalPreDraw
  End Object
  PlayerPortraitBG=PlayerPortraitB

  IconBorder=0.050000
  ItemBorder=0.110000
  ProgressBarHeight=0.300000
  TextTopOffset=0.050000
  IconToInfoSpacing=0.050000

  c_Tabs=GUITabControl'KFGui.GUILibraryMenu.PageTabs'

  Begin Object Class=GUIHeader Name=ServerBrowserHeader
    bVisible=false
  End Object
  t_Header=ServerBrowserHeader

  i_Background=none
  i_bkChar=none

  bRenderWorld=true
  bAllowedAsLast=true
  OnClose=NiceLobbyMenu.InternalOnClosed
  OnCanClose=NiceLobbyMenu.StopClose
  WinHeight=0.500000
  OnPreDraw=NiceLobbyMenu.InternalOnPreDraw
  OnRendered=NiceLobbyMenu.DrawPerk
  OnKeyEvent=NiceLobbyMenu.InternalOnKeyEvent
}