CConfigHandler.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #pragma once
  2. #include "../global.h"
  3. class CAdvMapInt;
  4. namespace config
  5. {
  6. struct ClientConfig
  7. {
  8. int resx, resy, bpp, fullscreen; //client resolution/colours
  9. int port, localInformation;
  10. std::string server, //server address (e.g. 127.0.0.1)
  11. defaultAI; //dll name
  12. };
  13. struct AdventureMapConfig
  14. {
  15. struct ButtonInfo
  16. {
  17. std::string hoverName, //shows in statusbar when hovered
  18. helpBox, //shows in pop-up when r-clicked
  19. defName;
  20. std::vector<std::string> additionalDefs;
  21. void (CAdvMapInt::*func)(); //function in advmapint bound to that button
  22. int x, y; //position on the screen
  23. bool playerColoured; //if true button will be colored to main player's color (works properly only for appropriate 8bpp graphics)
  24. };
  25. struct Minimap
  26. {
  27. int x, y, w, h;
  28. } minimap;
  29. std::vector<ButtonInfo> buttons;
  30. };
  31. struct GUIOptions
  32. {
  33. AdventureMapConfig ac;
  34. };
  35. class CConfigHandler
  36. {
  37. public:
  38. ClientConfig cc;
  39. GUIOptions gc;
  40. void init();
  41. CConfigHandler(void);
  42. ~CConfigHandler(void);
  43. };
  44. }
  45. extern config::CConfigHandler conf;