CConfigHandler.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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 advmapX, advmapY, advmapW, advmapH;
  44. bool smoothMove;
  45. bool puzzleSepia;
  46. //general properties
  47. std::string mainGraphic;
  48. //buttons
  49. ButtonInfo kingOverview, underground, questlog, sleepWake, moveHero, spellbook, advOptions,
  50. sysOptions, nextHero, endTurn;
  51. //hero list
  52. int hlistX, hlistY, hlistSize;
  53. std::string hlistMB, hlistMN, hlistAU, hlistAD;
  54. //town list
  55. int tlistX, tlistY, tlistSize;
  56. std::string tlistAU, tlistAD;
  57. //gems
  58. int gemX[4], gemY[4];
  59. std::vector<std::string> gemG;
  60. //in-game console
  61. int inputLineLength, outputLineLength;
  62. };
  63. struct GUIOptions
  64. {
  65. AdventureMapConfig ac;
  66. };
  67. class CConfigHandler
  68. {
  69. public:
  70. ClientConfig cc;
  71. std::map<std::pair<int,int>, GUIOptions > guiOptions;
  72. GUIOptions *go(); //return pointer to gui options appropriate for used screen resolution
  73. void init();
  74. CConfigHandler(void); //c-tor
  75. ~CConfigHandler(void); //d-tor
  76. };
  77. }
  78. extern config::CConfigHandler conf;
  79. #endif // __CCONFIGHANDLER_H__