Guest User

Untitled

a guest
Aug 14th, 2019
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. #include "..\..\script_macros.hpp"
  2. /*
  3. File: fn_updateEconomy.sqf
  4. Author: Worldtrade1101
  5. Edited by: Derek
  6. Base on Tonic script
  7.  
  8. Description:
  9. Update and fill the Economy gui menu.
  10. */
  11. private["_display","_name","_factor","_categories","_goodlist","_icon"];
  12. disableSerialization;
  13. params [
  14. ["_type", 0],
  15. ["_market", []]
  16. ];
  17. life_market = _market;
  18.  
  19. //Setup control vars.
  20. _display = findDisplay 39000;
  21. _goodlist = _display displayCtrl 39001;
  22.  
  23. //Purge list
  24. lbClear _goodlist;
  25.  
  26. if (count life_market isEqualTo 0) exitwith {};
  27.  
  28. _categories = LIFE_SETTINGS(getArray, "market_categories");
  29. _factor = 1;
  30. {
  31. _goodlist lbAdd _x;
  32. _goodlist lbSetValue [(lbSize _goodlist)-1,(_factor*2)-1];
  33. _factor = _factor + 1;
  34. } forEach _categories;
  35.  
  36. {
  37. if ((_x select 2) > 1 ) then {
  38. _name = ITEM_NAME((_x select 0));
  39. _icon = ITEM_ICON((_x select 0));
  40. _goodlist lbAdd format["%1",(localize _name)];
  41. _goodlist lbSetData [(lbSize _goodlist)-1,_x select 0];
  42. _goodlist lbSetValue [(lbSize _goodlist)-1,2*(_x select 6)];
  43. _goodlist lbSetPicture [(lbSize _goodlist)-1,_icon];
  44.  
  45. };
  46. } foreach life_market;
  47.  
  48. lbSortByValue _goodlist;
Add Comment
Please, Sign In to add comment