CConfigHandler.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #ifndef __CCONFIGHANDLER_H__
  2. #define __CCONFIGHANDLER_H__
  3. #include "../global.h"
  4. class CAdvMapInt;
  5. /*
  6. * CConfighandler.h, part of VCMI engine
  7. *
  8. * Authors: listed in file AUTHORS in main folder
  9. *
  10. * License: GNU General Public License v2.0 or later
  11. * Full text of license available in license.txt file, in main folder
  12. *
  13. */
  14. namespace config
  15. {
  16. struct ClientConfig
  17. {
  18. int resx, resy, bpp, fullscreen; //client resolution/colours
  19. int port, localInformation;
  20. std::string server, //server address (e.g. 127.0.0.1)
  21. defaultAI; //dll name
  22. };
  23. struct ButtonInfo
  24. {
  25. std::string defName;
  26. std::vector<std::string> additionalDefs;
  27. int x, y; //position on the screen
  28. bool playerColoured; //if true button will be colored to main player's color (works properly only for appropriate 8bpp graphics)
  29. };
  30. struct AdventureMapConfig
  31. {
  32. //minimap properties
  33. int minimapX, minimapY, minimapW, minimapH;
  34. //statusbar
  35. int statusbarX, statusbarY; //pos
  36. std::string statusbarG; //graphic name
  37. //resdatabar
  38. int resdatabarX, resdatabarY, resDist, resDateDist, resOffsetX, resOffsetY; //pos
  39. std::string resdatabarG; //graphic name
  40. //infobox
  41. int infoboxX, infoboxY;
  42. //advmap
  43. int tilesW, tilesH, advmapX, advmapY, advmapTrimX, advmapTrimY;
  44. bool smoothMove;
  45. //general properties
  46. std::string mainGraphic;
  47. //buttons
  48. ButtonInfo kingOverview, underground, questlog, sleepWake, moveHero, spellbook, advOptions,
  49. sysOptions, nextHero, endTurn;
  50. //hero list
  51. int hlistX, hlistY, hlistSize;
  52. std::string hlistMB, hlistMN, hlistAU, hlistAD;
  53. //town list
  54. int tlistX, tlistY, tlistSize;
  55. std::string tlistAU, tlistAD;
  56. //gems
  57. int gemX[4], gemY[4];
  58. std::vector<std::string> gemG;
  59. };
  60. struct GUIOptions
  61. {
  62. AdventureMapConfig ac;
  63. };
  64. class CConfigHandler
  65. {
  66. public:
  67. ClientConfig cc;
  68. std::map<std::pair<int,int>, GUIOptions > guiOptions;
  69. GUIOptions *go(); //return pointer to gui options appropriate for used screen resolution
  70. void init();
  71. CConfigHandler(void);
  72. ~CConfigHandler(void);
  73. };
  74. }
  75. extern config::CConfigHandler conf;
  76. #endif // __CCONFIGHANDLER_H__