skotracker

ExileClient_gui_wasteDumpDialog_event_onModeDropDownSelectio

Apr 19th, 2018
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 2.77 KB | None | 0 0
  1. private["_display","_dropdown","_index","_vehicleObject","_mode","_cargo","_revenue","_revenueControl","_sellButton"];
  2. disableSerialization;
  3. _display = uiNameSpace getVariable ["RscExileWasteDumpDialog", displayNull];
  4. _dropdown = _this select 0;
  5. _index = _this select 1;
  6. _vehicleObject = objectFromNetId (_dropdown lbData _index);
  7. if (isNull _vehicleObject) then
  8. {
  9.     closeDialog 0;
  10. }
  11. else
  12. {
  13.     _mode = _dropdown lbValue _index;
  14.     if !(_mode isEqualTo 3)then{
  15.  
  16.  
  17.         _cargo = _vehicleObject call ExileClient_util_containerCargo_list;
  18.         _revenue = _cargo call ExileClient_util_gear_calculateTotalSellPrice;
  19.  
  20.         if (_mode isEqualTo 2) then
  21.         {
  22.             _crateCheck = attachedObjects _vehicleObject;
  23.             _count = count _crateCheck;
  24.             switch _count do{
  25.             case 1:{
  26.                 _crate = attachedObjects _vehicleObject select 0;
  27.                 _crateCargo = _crate call ExileClient_util_containerCargo_list;
  28.                 _cratePrice = _crateCargo call ExileClient_util_gear_calculateTotalSellPrice;
  29.                 _revenue = _revenue + _cratePrice;
  30.                 };
  31.             case 2:{
  32.                 _crate = attachedObjects _vehicleObject select 1;
  33.                 _crateCargo = _crate call ExileClient_util_containerCargo_list;
  34.                 _cratePrice = _crateCargo call ExileClient_util_gear_calculateTotalSellPrice;
  35.                 _revenue = _revenue + _cratePrice;
  36.                 };
  37.             };
  38.  
  39.             _revenue = _revenue + ([(typeOf _vehicleObject)] call ExileClient_util_gear_calculateTotalSellPrice);
  40.         };
  41.     }else{
  42.         _crateCheck = attachedObjects _vehicleObject;
  43.         _count = count _crateCheck;
  44.         switch _count do{
  45.         case 1:{
  46.             _crate = attachedObjects _vehicleObject select 0;
  47.             _crateCargo = _crate call ExileClient_util_containerCargo_list;
  48.             _revenue = _crateCargo call ExileClient_util_gear_calculateTotalSellPrice;
  49.             };
  50.         case 2:{
  51.             _crate = attachedObjects _vehicleObject select 1;
  52.             _crateCargo = _crate call ExileClient_util_containerCargo_list;
  53.             _revenue = _crateCargo call ExileClient_util_gear_calculateTotalSellPrice;
  54.             };
  55.         case 0:{ _revenue = 0; _revenue};
  56.         default { _revenue = 0; _revenue};
  57.         };
  58.     };
  59.     _revenueControl = _display displayCtrl 4001;
  60.     _revenueControl ctrlSetStructuredText (parseText (format ["<t size='1.4'>%1<img image='\exile_assets\texture\ui\poptab_notification_ca.paa' size='1' shadow='true' /></t>", _revenue]));
  61.     _sellButton = _display displayCtrl 4000;
  62.     if(_revenue > 0)then
  63.     {
  64.         _sellButton ctrlEnable true;
  65.     }
  66.     else
  67.     {
  68.         _sellButton ctrlEnable false;
  69.     };
  70. };
  71. true
Add Comment
Please, Sign In to add comment