summaryrefslogtreecommitdiffstats
path: root/Client/GUI/GUI_EASA.sqf
diff options
context:
space:
mode:
authorhybrid <hybrid@hybridlabs.pro>2026-06-11 19:54:45 +0300
committerhybrid <hybrid@hybridlabs.pro>2026-06-11 19:54:45 +0300
commit68d4c9bbd80ed2e6528244569c79676b87295bd1 (patch)
tree6efd42fbf6f1281874ae0ff1f8816b01fe0c7153 /Client/GUI/GUI_EASA.sqf
downloada2wf_takistan-68d4c9bbd80ed2e6528244569c79676b87295bd1.tar.gz
a2wf_takistan-68d4c9bbd80ed2e6528244569c79676b87295bd1.tar.bz2
a2wf_takistan-68d4c9bbd80ed2e6528244569c79676b87295bd1.zip
init
Diffstat (limited to 'Client/GUI/GUI_EASA.sqf')
-rw-r--r--Client/GUI/GUI_EASA.sqf50
1 files changed, 50 insertions, 0 deletions
diff --git a/Client/GUI/GUI_EASA.sqf b/Client/GUI/GUI_EASA.sqf
new file mode 100644
index 0000000..590a019
--- /dev/null
+++ b/Client/GUI/GUI_EASA.sqf
@@ -0,0 +1,50 @@
+
+private ["_i","_j","_listPrice","_listDesc","_cdata","_funds","_iddx","_type","_data","_listBox"];
+MenuAction = -1;
+
+_type = ('WFBE_EASA_Vehicles' Call GetNamespace) find (typeOf (vehicle player));
+if (_type == -1) exitWith {diag_log Format['[WFBE (ERROR)][frameno:%2 | ticktime:%3] GUI_EASA: The player vehicle was not found within the list (%1)',_type,diag_frameno,diag_tickTime]};
+_data = (('WFBE_EASA_Loadouts' Call GetNamespace) select _type);
+
+
+_listPrice = [];
+_listDesc = [];
+_listBox = 23003;
+for [{_i = 0},{_i < count(_data)},{_i = _i + 1}] do {
+ _cdata = _data select _i;
+ for [{_j = 0},{_j < count(_cdata)},{_j = _j + 1}] do {
+ if (_j == 0) then {_listPrice = _listPrice + [(_cdata select 0) select 0]};
+ if (_j == 1) then {
+ _listDesc = _listDesc + [(_cdata select 1) select 0];
+ lnbAddRow [_listBox,["$"+str((_cdata select 0) select 0)+".",(_cdata select 1) select 0]]};
+ if (_j > 1) then {
+ };
+ };
+};
+
+if (count _listPrice > 0) then {lnbSetCurSelRow [_listBox,0]} else {lnbSetCurSelRow [_listBox,-1]};
+
+while {alive player && dialog} do {
+ sleep 0.1;
+
+ if (side player != sideJoined) exitWith {closeDialog 0};
+ if !(dialog) exitWith {};
+
+ //--- Command AI.
+ if (MenuAction == 101) then {
+ MenuAction = -1;
+ _funds = Call GetPlayerFunds;
+
+ _iddx = lnbCurSelRow _listBox;
+ if (_iddx != -1) then {
+ if (_funds > (_listPrice select _iddx)) then {
+ [vehicle player, _iddx, true] Call EASA_Equip;
+ -(_listPrice select _iddx) Call ChangePlayerFunds;
+ hint parseText(Format[localize 'STR_WF_EASA_Purchase',(_listDesc select _iddx)]);
+ closeDialog 0;
+ } else {
+ hint parseText(Format[localize 'STR_WF_Funds_Missing',(_listPrice select _iddx) - _funds,_listDesc select _iddx]);
+ };
+ };
+ };
+}; \ No newline at end of file