diff options
| author | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:55:24 +0300 |
|---|---|---|
| committer | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:55:24 +0300 |
| commit | 628d33984d9228f1781d13a65fbb80f35facc899 (patch) | |
| tree | cd909141f87e14f22c3511549a9bc067d9ff8b50 /Client/Functions/Client_DisplayInventory.sqf | |
| download | a2wf_sara-628d33984d9228f1781d13a65fbb80f35facc899.tar.gz a2wf_sara-628d33984d9228f1781d13a65fbb80f35facc899.tar.bz2 a2wf_sara-628d33984d9228f1781d13a65fbb80f35facc899.zip | |
init
Diffstat (limited to 'Client/Functions/Client_DisplayInventory.sqf')
| -rw-r--r-- | Client/Functions/Client_DisplayInventory.sqf | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/Client/Functions/Client_DisplayInventory.sqf b/Client/Functions/Client_DisplayInventory.sqf new file mode 100644 index 0000000..7765609 --- /dev/null +++ b/Client/Functions/Client_DisplayInventory.sqf @@ -0,0 +1,98 @@ +Private ['_cost','_count','_get','_inventoryGUI','_inventorySlots','_items','_loadout','_misca','_miscInvGUI','_miscItemSlots','_primary','_secondary','_sidearm','_sidearmInvGUI','_sidearmInventorySlots','_slot','_sorted'];
+_loadout = _this select 0;
+_items = _this select 1;
+
+_inventoryGUI = 3503;
+_sidearmInvGUI = 3515;
+_miscInvGUI = 3523;
+
+for [{_count = 0},{_count < 12},{_count = _count + 1}] do {CtrlSetText[_inventoryGUI + _count,"\Ca\UI\Data\ui_gear_mag_gs.paa"]};
+for [{_count = 0},{_count < 8},{_count = _count + 1}] do {CtrlSetText[_sidearmInvGUI + _count,"\Ca\UI\Data\ui_gear_mag_gs.paa"]};
+for [{_count = 0},{_count < 12},{_count = _count + 1}] do {CtrlSetText[_miscInvGUI + _count,"\Ca\UI\Data\ui_gear_eq_gs.paa"]};
+
+_cost = 0;
+_slot = 0;
+_inventorySlots = [];
+_sidearmInventorySlots = [];
+_miscItemSlots = [];
+
+_primary = [];
+_secondary = [];
+_sidearm = [];
+_misca = [];
+
+{
+ _get = _x Call GetNamespace;
+
+ if !(isNil '_get') then {
+ switch (_get select QUERYGEARTYPE) do {
+ case 'primary': {_primary = _primary + [_x]};
+ case 'secondary': {_secondary = _secondary + [_x]};
+ case 'sidearm': {_sidearm = _sidearm + [_x]};
+ case 'CfgMagazines': {_misca = _misca + [_x]};
+ case 'CfgWeapons': {_misca = _misca + [_x]};
+ };
+ };
+
+} forEach _loadout;
+
+_sorted = _primary + _secondary + _misca;
+_sidearm = _sidearm + _misca;
+
+{
+ _get = _x Call GetNamespace;
+
+ if !(isNil '_get') then {
+ if (!(_get select QUERYGEARHANDGUNPOOL)) then {
+ ctrlSetText[_inventoryGUI + _slot,(_get select QUERYGEARPICTURE)];
+ _cost = _cost + (_get select QUERYGEARCOST);
+ _slot = _slot + 1;
+ _inventorySlots = _inventorySlots + [_x];
+ for [{_count = (_get Select QUERYGEARSPACE) - 1},{_count > 0},{_count = _count - 1}] do {
+ ctrlSetText[_inventoryGUI + _slot,""];
+ _slot = _slot + 1;
+ _inventorySlots = _inventorySlots + [""];
+ };
+ };
+ };
+} forEach _sorted;
+
+_slot = 0;
+
+{
+ _get = _x Call GetNamespace;
+
+ if !(isNil '_get') then {
+ if (_get select QUERYGEARHANDGUNPOOL) then {
+ ctrlSetText[_sidearmInvGUI + _slot,(_get select QUERYGEARPICTURE)];
+ _cost = _cost + (_get select QUERYGEARCOST);
+ _slot = _slot + 1;
+ _sidearmInventorySlots = _sidearmInventorySlots + [_x];
+ for [{_count = (_get Select QUERYGEARSPACE) - 1},{_count > 0},{_count = _count - 1}] do {
+ ctrlSetText[_sidearmInvGUI + _slot,""];
+ _slot = _slot + 1;
+ _sidearmInventorySlots = _sidearmInventorySlots + [""];
+ };
+ };
+ };
+} forEach _sidearm;
+
+_slot = 0;
+
+{
+ _get = _x Call GetNamespace;
+
+ if !(isNil '_get') then {
+ CtrlSetText[_miscInvGUI + _slot,(_get select QUERYGEARPICTURE)];
+ _slot = _slot + 1;
+ _miscItemSlots = _miscItemSlots + [_x];
+ _cost = _cost + (_get select QUERYGEARCOST);
+ for [{_count = (_get Select QUERYGEARSPACE) - 1},{_count > 0},{_count = _count - 1}] do {
+ ctrlSetText[_miscInvGUI + _slot,""];
+ _slot = _slot + 1;
+ _miscItemSlots = _miscItemSlots + [""];
+ };
+ };
+} forEach _items;
+
+[_inventorySlots,_sidearmInventorySlots,_miscItemSlots,_cost]
\ No newline at end of file |
