Guest User

Untitled

a guest
Jan 8th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. #include "..\..\script_macros.hpp"
  2. /*
  3. File: fn_changeClothes.sqf
  4. Author: Bryan "Tonic" Boardwine
  5.  
  6. Description:
  7. Used in the clothing store to show a 'preview' of the piece of clothing.
  8. */
  9. disableSerialization;
  10. private ["_control","_selection","_data","_price","_total","_totalPrice"];
  11. _control = (_this select 0) select 0;
  12. _selection = (_this select 0) select 1;
  13. _price = (findDisplay 3100) displayCtrl 3102;
  14. _total = (findDisplay 3100) displayCtrl 3106;
  15. if (_selection isEqualTo -1) exitWith {hint localize "STR_Shop_NoSelection";};
  16. if (isNull _control) exitWith {hint localize "STR_Shop_NoDisplay"};
  17. if (life_cMenu_lock) exitWith {};
  18. life_cMenu_lock = true;
  19.  
  20. life_clothing_purchase set[life_clothing_filter,(_control lbValue _selection)];
  21. _data = _control lbData _selection;
  22.  
  23. if (_data isEqualTo "NONE") then {
  24. _item = switch (life_clothing_filter) do {
  25. case 0: {uniform player};
  26. case 1: {headGear player};
  27. case 2: {goggles player};
  28. case 3: {vest player};
  29. case 4: {backpack player};
  30. };
  31.  
  32. [_item,false] call life_fnc_handleItem;
  33. } else {
  34. [_data,true,nil,nil,nil,nil,nil,true] call life_fnc_handleItem;
  35. };
  36.  
  37. life_cMenu_lock = false;
  38. _price ctrlSetStructuredText parseText format [(localize "STR_GNOTF_Price")+ " <t color='#8cff9b'>$%1</t>",[(_control lbValue _selection)] call life_fnc_numberText];
  39.  
  40. _totalPrice = 0;
  41. {
  42. if (_x != -1) then {
  43. _totalPrice = _totalPrice + _x;
  44. };
  45. } forEach life_clothing_purchase;
  46.  
  47. _total ctrlSetStructuredText parseText format [(localize "STR_Shop_Total")+ " <t color='#8cff9b'>$%1</t>",[_totalPrice] call life_fnc_numberText];
  48.  
  49. [] call life_fnc_playerSkins;
Add Comment
Please, Sign In to add comment