ControlsManager.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #pragma once
  2. #include "..\..\common_h\Mission.h"
  3. class ControlsManager : public MissionObject
  4. {
  5. struct Item
  6. {
  7. ConstString alias;
  8. ConstString value; const char *name;
  9. };
  10. struct Profile
  11. {
  12. Profile() : ctls(_FL_)
  13. {
  14. }
  15. int player; bool single;
  16. int index;
  17. const char *name;
  18. const char *title;
  19. bool stat;
  20. array<long> ctls;
  21. MissionTrigger onSelect;
  22. };
  23. public:
  24. ControlsManager();
  25. ~ControlsManager();
  26. public:
  27. bool Create (MOPReader &reader);
  28. bool EditMode_Update(MOPReader &reader);
  29. void Show (bool isShow);
  30. void Activate(bool isActive);
  31. void Command(const char *id, dword numParams, const char **params);
  32. private:
  33. void Update();
  34. void _cdecl Draw(float dltTime, long level);
  35. void __declspec(dllexport) InitParams(MOPReader &reader);
  36. void SetProfile(const char *name, int index, bool reset = false);
  37. // void Save();
  38. // void Load();
  39. private:
  40. array<Item> items;
  41. int curItem;
  42. float curTime;
  43. array<Profile> profiles;
  44. int curProfile;
  45. const char *title;
  46. const char *profile;
  47. int number;
  48. MissionTrigger defTrigger;
  49. MissionTrigger newTrigger;
  50. bool updated;
  51. bool m_locked;
  52. };