KF2-Server-Extension/ServerExt/Classes/KFGUI_ListItem.uc

45 lines
859 B
Ucode
Raw Normal View History

2017-10-20 02:00:49 +00:00
Class KFGUI_ListItem extends Object
transient;
var KFGUI_ListItem Next;
var array<string> Columns,SortColumns;
var int Index,Value;
var transient string Temp; // Cache sorting key.
2020-11-28 20:04:55 +00:00
function SetValue(string S, int i, string SortStr)
2017-10-20 02:00:49 +00:00
{
ParseStringIntoArray(S,Columns,"\n",false);
2020-11-28 20:12:58 +00:00
if (SortStr=="")
2017-10-20 02:00:49 +00:00
SortColumns.Length = 0;
else ParseStringIntoArray(Caps(SortStr),SortColumns,"\n",false);
Value = i;
}
// Return string to draw on HUD.
2020-11-28 20:04:55 +00:00
function string GetDisplayStr(int Column)
2017-10-20 02:00:49 +00:00
{
2020-11-28 20:12:58 +00:00
if (Column<Columns.Length)
2017-10-20 02:00:49 +00:00
return Columns[Column];
return "";
}
// Return string to compare string with.
2020-11-28 20:04:55 +00:00
function string GetSortStr(int Column)
2017-10-20 02:00:49 +00:00
{
2020-11-28 20:12:58 +00:00
if (SortColumns.Length>0)
2017-10-20 02:00:49 +00:00
{
2020-11-28 20:12:58 +00:00
if (Column<SortColumns.Length)
2017-10-20 02:00:49 +00:00
return SortColumns[Column];
}
2020-11-28 20:12:58 +00:00
if (Column<Columns.Length)
2017-10-20 02:00:49 +00:00
return Caps(Columns[Column]);
return "";
}
// Clear
function Clear()
{
Columns.Length = 0;
}