fn_onSaveSelectionChanged.sqf 879 B

12345678910111213141516171819202122232425262728
  1. #include "defines.h"
  2. /*
  3. Author: Bryan "Tonic" Boardwine
  4. Description:
  5. Updates the view distance dependant on whether the player
  6. is on foot, a car or an aircraft.
  7. */
  8. private "_saveData";
  9. params [["_control",controlNull,[controlNull]],["_index",-1,[0]]];
  10. /* Error checks */
  11. if(EQUAL(_index,-1) OR isNull _control) exitWith {};
  12. _saveData = GVAR_PNS format["tawvd_slot_%1",_index];
  13. if(isNil "_saveData") exitWith {};
  14. /* Set variables to chosen slot data */
  15. CONTROL(MENU_IDD,SLOT_NAME) ctrlSetText (SEL(_saveData,0));
  16. SVAR_MNS ["tawvd_foot",SEL(_saveData,1)];
  17. SVAR_MNS ["tawvd_car",SEL(_saveData,2)];
  18. SVAR_MNS ["tawvd_air",SEL(_saveData,3)];
  19. SVAR_MNS ["tawvd_drone",SEL(_saveData,4)];
  20. SVAR_MNS ["tawvd_object",SEL(_saveData,5)];
  21. SVAR_MNS ["tawvd_syncObject",SEL(_saveData,6)];
  22. /* Update Menu & View Distance */
  23. [] call TAWVD_fnc_updateViewDistance;
  24. [] call TAWVD_fnc_openMenu;