From 68d4c9bbd80ed2e6528244569c79676b87295bd1 Mon Sep 17 00:00:00 2001 From: hybrid Date: Thu, 11 Jun 2026 19:54:45 +0300 Subject: init --- Client/Functions/Client_UIFillListBuyUnits.sqf | 35 ++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Client/Functions/Client_UIFillListBuyUnits.sqf (limited to 'Client/Functions/Client_UIFillListBuyUnits.sqf') diff --git a/Client/Functions/Client_UIFillListBuyUnits.sqf b/Client/Functions/Client_UIFillListBuyUnits.sqf new file mode 100644 index 0000000..78e8881 --- /dev/null +++ b/Client/Functions/Client_UIFillListBuyUnits.sqf @@ -0,0 +1,35 @@ +Private ['_addin','_c','_currentUpgrades','_filler','_filter','_i','_listBox','_listNames','_u','_value']; +_listNames = _this select 0; +_filler = _this select 1; +_listBox = _this select 2; +_value = _this select 3; +_u = 0; +_i = 0; + +_currentUpgrades = (sideJoinedText) Call GetSideUpgrades; +_filter = Format["WFBE_%1%2CURRENTFACTIONSELECTED",sideJoinedText,_filler] Call GetNamespace; +if (isNil '_filter') then {_filter = "nil"} else { + if (_filter == 0) then { + _filter = 'nil'; + } else { + _filter = ((Format["WFBE_%1%2FACTIONS",sideJoinedText,_filler] Call GetNamespace) select _filter); + }; +}; + +lnbClear _listBox; +{ + _addin = true; + _c = _x Call GetNamespace; + if (_filter != "nil") then { + if ((_c select QUERYUNITFACTION) != _filter) then {_addin = false}; + }; + if ((_c select QUERYUNITUPGRADE) <= (_currentUpgrades select _value) && _addin) then { + lnbAddRow [_listBox,['$'+str (_c select QUERYUNITPRICE),(_c select QUERYUNITLABEL)]]; + lnbSetData [_listBox,[_i,0],_filler]; + lnbSetValue [_listBox,[_i,0],_u]; + _i = _i + 1; + }; + _u = _u + 1; +} forEach _listNames; + +if (_i > 0) then {lnbSetCurSelRow [_listBox,0]} else {lnbSetCurSelRow [_listBox,-1]}; \ No newline at end of file -- cgit v1.3.1