CConfigHandler.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 screenx, screeny; //real screen resolution
  20. int pregameResx, pregameResy; //real screen resolution of preGame
  21. int port, localInformation;
  22. std::string server, //server address (e.g. 127.0.0.1)
  23. defaultAI; //dll name
  24. };
  25. struct ButtonInfo
  26. {
  27. std::string defName;
  28. std::vector<std::string> additionalDefs;
  29. int x, y; //position on the screen
  30. bool playerColoured; //if true button will be colored to main player's color (works properly only for appropriate 8bpp graphics)
  31. };
  32. struct AdventureMapConfig
  33. {
  34. //minimap properties
  35. int minimapX, minimapY, minimapW, minimapH;
  36. //statusbar
  37. int statusbarX, statusbarY; //pos
  38. std::string statusbarG; //graphic name
  39. //resdatabar
  40. int resdatabarX, resdatabarY, resDist, resDateDist, resOffsetX, resOffsetY; //pos
  41. std::string resdatabarG; //graphic name
  42. //infobox
  43. int infoboxX, infoboxY;
  44. //advmap
  45. int advmapX, advmapY, advmapW, advmapH;
  46. bool smoothMove;
  47. bool puzzleSepia;
  48. //general properties
  49. std::string mainGraphic;
  50. //buttons
  51. ButtonInfo kingOverview, underground, questlog, sleepWake, moveHero, spellbook, advOptions,
  52. sysOptions, nextHero, endTurn;
  53. //hero list
  54. int hlistX, hlistY, hlistSize;
  55. std::string hlistMB, hlistMN, hlistAU, hlistAD;
  56. //town list
  57. int tlistX, tlistY, tlistSize;
  58. std::string tlistAU, tlistAD;
  59. //gems
  60. int gemX[4], gemY[4];
  61. std::vector<std::string> gemG;
  62. //in-game console
  63. int inputLineLength, outputLineLength;
  64. //kingdom overview
  65. int overviewPics, overviewSize; //pic count in def and count of visible slots
  66. std::string overviewBg; //background name
  67. };
  68. struct GUIOptions
  69. {
  70. AdventureMapConfig ac;
  71. };
  72. class CConfigHandler
  73. {
  74. public:
  75. ClientConfig cc;
  76. std::map<std::pair<int,int>, GUIOptions > guiOptions;
  77. GUIOptions *go(); //return pointer to gui options appropriate for used screen resolution
  78. void init();
  79. CConfigHandler(void); //c-tor
  80. ~CConfigHandler(void); //d-tor
  81. };
  82. }
  83. extern config::CConfigHandler conf;
  84. #endif // __CCONFIGHANDLER_H__