settings.c 750 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifdef GAME_TEMPLATE
  2. class Settings
  3. {
  4. static void OnChange(string variableName) {}
  5. static void OnAnyChange() {}
  6. static void OnLoad() {}
  7. static void OnSave() {}
  8. static void OnReset() {}
  9. static void OnRevert() {}
  10. static void OnApply() {}
  11. private void Settings() {}
  12. private void ~Settings() {}
  13. };
  14. class GameSettings: Settings
  15. {
  16. [Attribute("false", "checkbox", "Is debug mode enabled")]
  17. static bool Debug;
  18. override static void OnAnyChange()
  19. {
  20. GetGame().SetDebug(Debug);
  21. }
  22. }
  23. class SettingsMenu: MenuBase
  24. {
  25. proto native external bool AddSettings(typename settingsClass);
  26. proto native void Save();
  27. proto native void Reset();
  28. proto native void Revert();
  29. proto native void Apply();
  30. proto native void Back();
  31. };
  32. #endif