fn_SaveLoad.sqf 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #include "macro.sqf"
  2. /*
  3. @version: 1.1
  4. @file_name: fn_SaveLoad.sqf
  5. @file_author: TAW_Tonic
  6. @file_edit: 5/27/2013
  7. @file_description: Pulls up Save / Load Dialog
  8. */
  9. private["_type","_control","_slot"];
  10. disableSerialization;
  11. _type = _this select 0;
  12. _show = if(isNil {_this select 1}) then {false} else {true};
  13. switch (_type) do
  14. {
  15. case 0: {_control = VAS_getControl(VAS_save_Display,VAS_save_list);};
  16. case 1: {_control = VAS_getControl(VAS_load_Display,VAS_load_list);};
  17. };
  18. lbClear _control; //Flush the control/list
  19. if(vas_disableLoadSave) then
  20. {
  21. for "_i" from 0 to vas_customslots do
  22. {
  23. if(!isNil {missionNamespace getVariable format["vas_gear_new_%1",_i]}) then
  24. {
  25. _control lbAdd format["%1",(missionNamespace getVariable format["vas_gear_new_%1",_i]) select 0];
  26. }
  27. else
  28. {
  29. _control lbAdd format["%1 %2",localize "STR_VAS_Main_CL", _i+1];
  30. };
  31. };
  32. }
  33. else
  34. {
  35. for "_i" from 0 to vas_customslots do
  36. {
  37. if(!isNil {profileNamespace getVariable format["vas_gear_new_%1",_i]}) then
  38. {
  39. _control lbAdd format["%1",(profileNamespace getVariable format["vas_gear_new_%1",_i]) select 0];
  40. }
  41. else
  42. {
  43. _control lbAdd format["%1 %2",localize "STR_VAS_Main_CL", _i+1];
  44. };
  45. };
  46. };
  47. if(_show) then
  48. {
  49. [_type] spawn VAS_fnc_loadoutInfo;
  50. };