diff options
| author | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:57:23 +0300 |
|---|---|---|
| committer | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:57:23 +0300 |
| commit | 3533c3aa9393fc6350178b196c813dc636ec9cf6 (patch) | |
| tree | 2f96a879c3935dea18e73410926b03c7eef1a751 /Client/Functions/Client_UIFillListBuyUnits.sqf | |
| download | a2wf_isladuala-3533c3aa9393fc6350178b196c813dc636ec9cf6.tar.gz a2wf_isladuala-3533c3aa9393fc6350178b196c813dc636ec9cf6.tar.bz2 a2wf_isladuala-3533c3aa9393fc6350178b196c813dc636ec9cf6.zip | |
init
Diffstat (limited to 'Client/Functions/Client_UIFillListBuyUnits.sqf')
| -rw-r--r-- | Client/Functions/Client_UIFillListBuyUnits.sqf | 35 |
1 files changed, 35 insertions, 0 deletions
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 |
