Advertisement
Guest User

fn_marketUpdate.sqf

a guest
Jan 22nd, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 1.43 KB | None | 0 0
  1. #include "..\..\script_macros.hpp"
  2. /*
  3.     File: fn_marketUpdate.sqf
  4.     Author: Ilusionz
  5. 
  6.     Description:
  7.     Update and fill the market menu.
  8. */
  9. private ["_item_list","_shopItems","_name","_buyPrice","_sellPrice","_weight","_displayName"];
  10. disableSerialization;
  11.  
  12. //Setup control vars.
  13. _item_list = CONTROL(60700,67001);
  14. ctrlShow [60704,false];
  15. ctrlShow [60705,false];
  16. ctrlShow [60706,false];
  17. ctrlShow [60707,false];
  18. ctrlShow [60708,false];
  19. ctrlShow [60709,false];
  20. ctrlShow [60710,false];
  21. ctrlShow [60711,false];
  22. ctrlShow [60712,false];
  23.  
  24. //Purge list
  25. lbClear _item_list;
  26.  
  27. if (!isClass(missionConfigFile >> "VirtualShops" >> "ymarket")) exitWith {closeDialog 0; hint localize "STR_NOTF_ConfigDoesNotExist";};
  28. ctrlSetText[67003,localize (M_CONFIG(getText,"VirtualShops","ymarket","name"))];
  29. _shopItems = M_CONFIG(getArray,"VirtualShops","ymarket","items");
  30.  
  31. {
  32.     _displayName = M_CONFIG(getText,"VirtualItems",_x,"displayName");
  33.     _buyPrice = M_CONFIG(getNumber,"VirtualItems",_x,"buyPrice");
  34.     _sellPrice = M_CONFIG(getNumber,"VirtualItems",_x,"sellPrice");
  35.     _weight = M_CONFIG(getNumber,"VirtualItems",_x,"weight");
  36.     _item_list lbAdd format ["%1",(localize _displayName)];
  37.     _item_list lbSetData [(lbSize _item_list)-1,_x];
  38.     _icon = M_CONFIG(getText,"VirtualItems",_x,"icon");
  39.     if (!(_icon isEqualTo "")) then {
  40.     _item_list lbSetPicture [(lbSize _item_list)-1,_icon];
  41.     };
  42. } forEach _shopItems;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement