Advertisement
skotracker

ExileClient_gui_inventory_updatePopTabControls

Apr 19th, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 3.19 KB | None | 0 0
  1. /**
  2.  * ExileClient_gui_inventory_updatePopTabControls
  3.  *
  4.  * Exile Mod
  5.  * www.exilemod.com
  6.  * © 2015 Exile Mod Team
  7.  *
  8.  * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
  9.  * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
  10.  */
  11.  
  12. private["_enable","_display","_containerPopTabs","_containerPopTabsString","_playerPopTabs","_playerPopTabsString","_playerPopTabsLabel","_containerPopTabsLabel","_maximumCapacity","_maximumPopTabsToPut","_maximumLoad","_maximumCapacityString","_takePopTabsInput","_maximumPopTabsToPutString","_putPopTabsInput","_takePopTabsButton","_putPopTabsButton"];
  13. disableSerialization;
  14. _enable = _this;
  15. _display = findDisplay 602;
  16. if (isNull _display) then
  17. {
  18.     _display = uiNameSpace getVariable ["RscDisplayInventory", displayNull];
  19. };
  20. if (isNull _display) exitWith {};
  21. if (isNull ExileClientCurrentInventoryContainer) exitWith {};
  22. _containerPopTabs = ExileClientCurrentInventoryContainer getVariable ["ExileMoney", 0];
  23. _containerPopTabsString = _containerPopTabs call ExileClient_util_string_exponentToString;
  24. _playerPopTabs = player getVariable ["ExileMoney", 0];
  25. _playerPopTabsString = _playerPopTabs call ExileClient_util_string_exponentToString;
  26. _playerPopTabsLabel = _display displayCtrl 25001;
  27. _playerPopTabsLabel ctrlSetStructuredText (parseText format ["<t size='1' font='RobotoCondensed' align='right'>%1<img image='\exile_assets\texture\ui\poptab_inline_ca.paa' size='1' shadow='true' /></t>", _playerPopTabsString]);
  28. _containerPopTabsLabel = _display displayCtrl 25000;
  29. _maximumCapacity = -1;
  30. _maximumPopTabsToPut = _playerPopTabs;
  31. if !(ExileClientCurrentInventoryContainer isKindOf "man") then
  32. {
  33.     _maximumLoad = getNumber (configFile >> "CfgVehicles" >> typeOf ExileClientCurrentInventoryContainer >> "maximumLoad");
  34.     if (_maximumLoad > 0) then
  35.     {
  36.         _maximumCapacity = _maximumLoad * 40;
  37.         _maximumPopTabsToPut = _playerPopTabs min _maximumCapacity;
  38.     };
  39. };
  40. if !(_maximumCapacity isEqualTo -1) then
  41. {
  42.     _maximumCapacityString = _maximumCapacity call ExileClient_util_string_exponentToString;
  43.     _containerPopTabsLabel ctrlSetStructuredText (parseText format ["<t size='1' font='RobotoCondensed' align='right'>%1 / %2<img image='\exile_assets\texture\ui\poptab_inline_ca.paa' size='1' shadow='true' /></t>", _containerPopTabsString, _maximumCapacityString]);
  44. }
  45. else
  46. {
  47.     _containerPopTabsLabel ctrlSetStructuredText (parseText format ["<t size='1' font='RobotoCondensed' align='right'>%1<img image='\exile_assets\texture\ui\poptab_inline_ca.paa' size='1' shadow='true' /></t>", _containerPopTabsString]);
  48. };
  49. _takePopTabsInput = _display displayCtrl 25002;
  50. _takePopTabsInput ctrlSetText _containerPopTabsString;
  51. _maximumPopTabsToPutString = _maximumPopTabsToPut call ExileClient_util_string_exponentToString;
  52. _putPopTabsInput = _display displayCtrl 25005;
  53. _putPopTabsInput ctrlSetText _maximumPopTabsToPutString;
  54. _takePopTabsButton = _display displayCtrl 25003;
  55. _takePopTabsButton ctrlEnable !ExileClientIsWaitingForInventoryMoneyTransaction;
  56. _putPopTabsButton = _display displayCtrl 25004;
  57. _putPopTabsButton ctrlEnable !ExileClientIsWaitingForInventoryMoneyTransaction;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement