Advertisement
skotracker

ExileClient_gui_traderDialog_updateInventoryDropdown

Apr 19th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 3.65 KB | None | 0 0
  1. private["_dialog","_inventoryDropdown","_index","_nearVehicles","_crateTypes"];
  2. disableSerialization;
  3. _crateTypes = [
  4.         "CargoNet_01_box_F",
  5.         "Exile_Container_SupplyBox",
  6.         "I_CargoNet_01_ammo_F",
  7.         "O_CargoNet_01_ammo_F",
  8.         "B_CargoNet_01_ammo_F",
  9.         "I_supplyCrate_F",
  10.         "O_supplyCrate_F",
  11.         "B_supplyCrate_F",
  12.         "C_supplyCrate_F",
  13.         "IG_supplyCrate_F",
  14.         "Box_NATO_AmmoVeh_F",
  15.         "Box_East_AmmoVeh_F",
  16.         "Box_IND_AmmoVeh_F",
  17.         "I_CargoNET_01_F",
  18.         "O_CargoNET_01_F",
  19.         "B_CargoNET_01_F",
  20.         "Land_CargoBox_V1_F",
  21.         "ASC_B_box",
  22.         "Box_NATO_Wps_F",
  23.         "Box_East_Wps_F",
  24.         "Box_IND_Wps_F",
  25.         "Box_East_WpsLaunch_F",
  26.         "Box_NATO_WpsLaunch_F",
  27.         "Box_IND_WpsLaunch_F",
  28.         "Box_IND_WpsSpecial_F",
  29.         "Box_East_WpsSpecial_F",
  30.         "Box_NATO_WpsSpecial_F",
  31.         "Box_NATO_Wps_F",
  32.         "Box_East_Wps_F",
  33.         "Box_IND_Wps_F",
  34.         "Box_East_WpsLaunch_F",
  35.         "Box_NATO_WpsLaunch_F",
  36.         "Box_IND_WpsLaunch_F",
  37.         "Box_IND_WpsSpecial_F",
  38.         "Box_East_WpsSpecial_F",
  39.         "Box_NATO_WpsSpecial_F",
  40.         "Box_NATO_AmmoOrd_F",
  41.         "Box_East_AmmoOrd_F",
  42.         "Box_IND_AmmoOrd_F",
  43.         "Box_NATO_Grenades_F",
  44.         "Box_East_Grenades_F",
  45.         "Box_IND_Grenades_F",
  46.         "Box_NATO_Ammo_F",
  47.         "Box_East_Ammo_F",
  48.         "Box_IND_Ammo_F",
  49.         "Box_IND_Support_F",
  50.         "Box_East_Support_F",
  51.         "Box_NATO_Support_F"
  52.     ];
  53. _dialog = uiNameSpace getVariable ["RscExileTraderDialog", displayNull];
  54. _inventoryDropdown = _dialog displayCtrl 4004;
  55. lbClear _inventoryDropdown;
  56. _index = _inventoryDropdown lbAdd "Equipment";
  57. _inventoryDropdown lbSetValue [_index, 1];
  58. _inventoryDropdown lbSetPicture [_index, "a3\ui_f\data\gui\Rsc\RscDisplayArsenal\face_ca.paa"];
  59. _inventoryDropdown lbSetCurSel 0;
  60. if !((uniform player) isEqualTo "") then
  61. {
  62.     _index = _inventoryDropdown lbAdd "Uniform";
  63.     _inventoryDropdown lbSetPicture [_index, "a3\ui_f\data\gui\Rsc\RscDisplayArsenal\uniform_ca.paa"];
  64.     _inventoryDropdown lbSetValue [_index, 2];
  65. };
  66. if !((vest player) isEqualTo "") then
  67. {
  68.     _index = _inventoryDropdown lbAdd "Vest";
  69.     _inventoryDropdown lbSetPicture [_index, "a3\ui_f\data\gui\Rsc\RscDisplayArsenal\vest_ca.paa"];
  70.     _inventoryDropdown lbSetValue [_index, 3];
  71. };
  72. if !((backpack player) isEqualTo "") then
  73. {
  74.     _index = _inventoryDropdown lbAdd "Backpack";
  75.     _inventoryDropdown lbSetPicture [_index, "a3\ui_f\data\gui\Rsc\RscDisplayArsenal\backpack_ca.paa"];
  76.     _inventoryDropdown lbSetValue [_index, 4];
  77. };
  78. _nearVehicles = nearestObjects [player, ["LandVehicle","Air","Ship"] + _crateTypes, 80];
  79. {
  80.     if (local _x) then
  81.     {
  82.         if (alive _x) then
  83.         {
  84.             if (isNull attachedTo _x) then
  85.             {
  86.                 _index = _inventoryDropdown lbAdd getText(configFile >> "CfgVehicles" >> (typeOf _x) >> "displayName");
  87.                 _inventoryDropdown lbSetData [_index, netId _x];
  88.                 _inventoryDropdown lbSetValue [_index, 5];
  89.             };
  90.         };
  91.     } else {
  92.         if (typeOf _x in _crateTypes) then
  93.         {
  94.             if (alive _x) then
  95.             {
  96.                 if (isNull attachedTo _x) then
  97.                 {
  98.                     _index = _inventoryDropdown lbAdd getText(configFile >> "CfgVehicles" >> (typeOf _x) >> "displayName");
  99.                     _inventoryDropdown lbSetData [_index, netId _x];
  100.                     _inventoryDropdown lbSetValue [_index, 5];
  101.                 };
  102.             };
  103.         };
  104.     };
  105. }
  106. forEach _nearVehicles;
  107. true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement