fn_playerDisplay.sqf 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #include "macro.sqf"
  2. /*
  3. @version: 1.2
  4. @file_name: fn_playerDisplay.sqf
  5. @file_author: TAW_Tonic
  6. @file_edit: 5/23/2013
  7. @file_description: When called, sort the call and display our targeted information.
  8. */
  9. private["_control","_info","_details"];
  10. disableSerialization;
  11. switch((uiNamespace getVariable "VAS_UI_FILTER")) do
  12. {
  13. case "guns": {_info = [([] call VAS_fnc_fetchPlayerGear),[1,2,4,5,4096]] call VAS_fnc_filter;};
  14. case "mags": {_info = [([] call VAS_fnc_fetchPlayerGear),"mag"] call VAS_fnc_filter;};
  15. case "items": {_info = [([] call VAS_fnc_fetchPlayerGear),"items"] call VAS_fnc_filter;};
  16. case "packs": {_info = [([] call VAS_fnc_fetchPlayerGear),"packs"] call VAS_fnc_filter;};
  17. case "glass": {_info = [([] call VAS_fnc_fetchPlayerGear),"glass"] call VAS_fnc_filter;};
  18. };
  19. if(!isNil {(uiNamespace getVariable "VAS_UI_FILTER_VAR")}) then
  20. {
  21. _info = [(uiNamespace getVariable "VAS_UI_FILTER_VAR"),true] call VAS_fnc_filterMenu;
  22. };
  23. waitUntil {typeName _info == "ARRAY"};
  24. _control = VAS_getControl(VAS_Main_Display,VAS_unit_list);
  25. lbClear _control;
  26. if((uiNamespace getVariable "VAS_UI_FILTER") == "mags") then
  27. {
  28. private["_mags","_mag"];
  29. _mags = [];
  30. {
  31. _details = [_x,"CfgMagazines"] call VAS_fnc_fetchCfgDetails;
  32. if(count _details > 0) then
  33. {
  34. if(!(_x in _mags)) then
  35. {
  36. _mags set[count _mags,_x];
  37. _mag = _x;
  38. _control lbAdd format["[%1] %2",({_x == _mag} count _info),(_details select 1)]; //Displayname on list
  39. _control lbSetData [(lbSize _control)-1,(_details select 0)]; //Data for index is classname
  40. _control lbSetPicture [(lbSize _control)-1,(_details select 2)];
  41. };
  42. };
  43. } foreach _info;
  44. }
  45. else
  46. {
  47. {
  48. _details = [_x] call VAS_fnc_fetchCfgDetails;
  49. if(count _details > 0) then
  50. {
  51. _control lbAdd format["%1", (_details select 1)]; //Displayname on list
  52. _control lbSetData [(lbSize _control)-1,(_details select 0)]; //Data for index is classname
  53. _control lbSetPicture [(lbSize _control)-1,(_details select 2)];
  54. };
  55. } foreach _info;
  56. };