-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMoneyList.sqf
109 lines (102 loc) · 3.81 KB
/
MoneyList.sqf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
//MoneyList.sqf
//Runs on players
//Called from player
//Called from GUI when MoneyList requested
//Sets up data in money list graphic
//pvs
private ["_control", "_lbID", "_i", "_money", "_moneyNum", "_steamName", "_chars", "_spaces", "_j", "_string", "_rankArray","_name"];
disableSerialization;
_control = _this select 0;
_lbID = 10002;
//formats row text
for [{_i = 0},{_i < count moneyMoney},{_i=_i+1}] do
{
_money = str (moneyMoney select _i);
_moneyNum = moneyMoney select _i;
moneynum = _moneyNum;
_name = moneyNames select _i;
_steamName = moneySteamNames select _i;
_chars = count (_money + _name + _steamName);
_spaces = "";
for [{_j = 0},{_j < (50 - _chars)},{_j=_j+1}] do
{
_spaces = _spaces + " ";
};
//name, gap, money
_string = format[" %4. %1 (%5)%2T$ %3",_name,_spaces,_money,(_i+1),_steamName];
lbAdd[_lbID,_string+"000"];
};
//assigns rank to money list
_rankArray = ("isClass _x" configClasses (configFile >> "CfgRanks"));
{
if (_x < 122) then
{
(_control displayCtrl _lbID) lbSetPicture [_foreachindex,"\A3\ui_f\data\GUI\Rsc\RscDisplayArcadeMap\icon_toolbox_units_ca.paa"];
(_control displayCtrl _lbID) lbSetTooltip [_foreachindex,"Civilian"];
}
else
{
if (_x < 243) then
{
(_control displayCtrl _lbID) lbSetPicture [_foreachindex,getText ((_rankArray select 0) >> "texture")];
(_control displayCtrl _lbID) lbSetTooltip [_foreachindex,getText ((_rankArray select 0) >> "displayName")];
}
else
{
if (_x < 487) then
{
(_control displayCtrl _lbID) lbSetPicture [_foreachindex,getText ((_rankArray select 1) >> "texture")];
(_control displayCtrl _lbID) lbSetTooltip [_foreachindex,getText ((_rankArray select 1) >> "displayName")];
}
else
{
if (_x < 973) then
{
(_control displayCtrl _lbID) lbSetPicture [_foreachindex,getText ((_rankArray select 2) >> "texture")];
(_control displayCtrl _lbID) lbSetTooltip [_foreachindex,getText ((_rankArray select 2) >> "displayName")];
}
else
{
if (_x < 1947) then
{
(_control displayCtrl _lbID) lbSetPicture [_foreachindex,getText ((_rankArray select 3) >> "texture")];
(_control displayCtrl _lbID) lbSetTooltip [_foreachindex,getText ((_rankArray select 3) >> "displayName")];
}
else
{
if (_x < 3894) then
{
(_control displayCtrl _lbID) lbSetPicture [_foreachindex,getText ((_rankArray select 4) >> "texture")];
(_control displayCtrl _lbID) lbSetTooltip [_foreachindex,getText ((_rankArray select 4) >> "displayName")];
}
else
{
if (_x < 7788) then
{
(_control displayCtrl _lbID) lbSetPicture [_foreachindex,getText ((_rankArray select 5) >> "texture")];
(_control displayCtrl _lbID) lbSetTooltip [_foreachindex,getText ((_rankArray select 5) >> "displayName")];
}
else
{
if (_x < 15575) then
{
(_control displayCtrl _lbID) lbSetPicture [_foreachindex,getText ((_rankArray select 6) >> "texture")];
(_control displayCtrl _lbID) lbSetTooltip [_foreachindex,getText ((_rankArray select 6) >> "displayName")];
}
else
{
(_control displayCtrl _lbID) lbSetPicture [_foreachindex,getText ((_rankArray select 7) >> "texture")];
(_control displayCtrl _lbID) lbSetTooltip [_foreachindex,getText ((_rankArray select 7) >> "displayName")];
};
};
};
};
};
};
};
};
(_control displayCtrl _lbID) lbSetPictureColor [_foreachindex, [1,1,1,0.7]];
(_control displayCtrl _lbID) lbSetPictureColorSelected [_foreachindex, [0.4,0.4,0,0.7]];
}forEach moneyMoney;
//Header with last update info
(_control displayCtrl 423) ctrlSetText format["Top Earners - Updated: %1 Minute(s) Ago",ceil((time - moneyTime)/60)];