45 lines
859 B
Ucode
Raw Normal View History

2017-10-19 21:00:49 -05: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 23:04:55 +03:00
function SetValue(string S, int i, string SortStr)
2017-10-19 21:00:49 -05:00
{
ParseStringIntoArray(S,Columns,"\n",false);
2020-11-28 23:12:58 +03:00
if (SortStr=="")
2017-10-19 21:00:49 -05:00
SortColumns.Length = 0;
else ParseStringIntoArray(Caps(SortStr),SortColumns,"\n",false);
Value = i;
}
// Return string to draw on HUD.
2020-11-28 23:04:55 +03:00
function string GetDisplayStr(int Column)
2017-10-19 21:00:49 -05:00
{
2020-11-28 23:12:58 +03:00
if (Column<Columns.Length)
2017-10-19 21:00:49 -05:00
return Columns[Column];
return "";
}
// Return string to compare string with.
2020-11-28 23:04:55 +03:00
function string GetSortStr(int Column)
2017-10-19 21:00:49 -05:00
{
2020-11-28 23:12:58 +03:00
if (SortColumns.Length>0)
2017-10-19 21:00:49 -05:00
{
2020-11-28 23:12:58 +03:00
if (Column<SortColumns.Length)
2017-10-19 21:00:49 -05:00
return SortColumns[Column];
}
2020-11-28 23:12:58 +03:00
if (Column<Columns.Length)
2017-10-19 21:00:49 -05:00
return Caps(Columns[Column]);
return "";
}
// Clear
function Clear()
{
Columns.Length = 0;
}