Class xUI_MapVote extends KFGUI_FloatingWindow; var xVotingReplication RepInfo; var KFGUI_ColumnList CurrentVotes,MapList; var KFGUI_ComboBox GameModeCombo; var KFGUI_RightClickMenu MapRClicker; var KFGUI_Button CloseButton; var int SelectedMapIndex; var editinline export KFGUI_RightClickMenu MapRightClick; var bool bFirstTime; var localized string CloseButtonText; var localized string CloseButtonToolTip; var localized string ColumnMapName; var localized string ColumnSequence; var localized string ColumnPlayCount; var localized string ColumnRating; var localized string ColumnGame; var localized string ColumnNumVotes; var localized string Title; function FColumnItem newFColumnItem(string Text, float Width) { local FColumnItem newItem; newItem.Text=Text; newItem.Width=Width; return newItem; } function FRowItem newFRowItem(string Text, bool isDisabled) { local FRowItem newItem; newItem.Text=Text; newItem.bDisabled=isDisabled; return newItem; } function InitMenu() { Super.InitMenu(); CurrentVotes = KFGUI_ColumnList(FindComponentID('Votes')); MapList = KFGUI_ColumnList(FindComponentID('Maps')); GameModeCombo = KFGUI_ComboBox(FindComponentID('Filter')); MapRClicker = KFGUI_RightClickMenu(FindComponentID('RClick')); CloseButton = KFGUI_Button(FindComponentID('Close')); // TODO: i18n this // I don't know why it's not working // MapRClicker.ItemRows.AddItem(newFRowItem("Vote this map", false)); // MapRClicker.ItemRows.AddItem(newFRowItem("Admin force this map", true)); // And this too: // GameModeCombo.LableString="Game mode:"; // GameModeCombo.ToolTip="Select game mode to vote for."; CloseButton.ButtonText=CloseButtonText; CloseButton.ToolTip=CloseButtonToolTip; MapList.Columns.AddItem(newFColumnItem(ColumnMapName,0.5)); MapList.Columns.AddItem(newFColumnItem(ColumnSequence,0.18)); MapList.Columns.AddItem(newFColumnItem(ColumnPlayCount,0.18)); MapList.Columns.AddItem(newFColumnItem(ColumnRating,0.14)); CurrentVotes.Columns.AddItem(newFColumnItem(ColumnGame,0.2)); CurrentVotes.Columns.AddItem(newFColumnItem(ColumnMapName,0.5)); CurrentVotes.Columns.AddItem(newFColumnItem(ColumnNumVotes,0.15)); CurrentVotes.Columns.AddItem(newFColumnItem(ColumnRating,0.15)); WindowTitle=Title; } function CloseMenu() { Super.CloseMenu(); RepInfo = None; } function InitMapvote(xVotingReplication R) { RepInfo = R; } function DrawMenu() { Super.DrawMenu(); if(RepInfo!=None && RepInfo.bListDirty) { RepInfo.bListDirty = false; UpdateList(); } } final function UpdateList() { local int i,g,m,Sel; local float V; local KFGUI_ListItem Item,SItem; if(GameModeCombo.Values.Length!=RepInfo.GameModes.Length) { GameModeCombo.Values.Length = RepInfo.GameModes.Length; for(i=0; i=0 && Sel==m) SItem = Item; } // Keep same row selected if possible. CurrentVotes.SelectedRowIndex = (SItem!=None ? SItem.Index : -1); } function ChangeToMaplist(KFGUI_ComboBox Sender) { local int i,g; local float V; if(RepInfo!=None) { MapList.EmptyList(); g = Sender.SelectedIndex; for(i=0; i