GUIClasses.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. /*
  2. * GUIClasses.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #include "CWindowObject.h"
  12. #include "../lib/GameConstants.h"
  13. #include "../lib/ResourceSet.h"
  14. #include "../lib/CConfigHandler.h"
  15. #include "../lib/int3.h"
  16. #include "../widgets/CArtifactHolder.h"
  17. #include "../widgets/CGarrisonInt.h"
  18. #include "../widgets/Images.h"
  19. VCMI_LIB_NAMESPACE_BEGIN
  20. class CGDwelling;
  21. class IMarket;
  22. VCMI_LIB_NAMESPACE_END
  23. class CreatureCostBox;
  24. class CCreaturePic;
  25. class MoraleLuckBox;
  26. class CHeroArea;
  27. class CMinorResDataBar;
  28. class CSlider;
  29. class CComponentBox;
  30. class CTextInput;
  31. class CListBox;
  32. class CLabelGroup;
  33. class CToggleButton;
  34. class CToggleGroup;
  35. class CVolumeSlider;
  36. class CGStatusBar;
  37. class CTextBox;
  38. class CResDataBar;
  39. class CHeroWithMaybePickedArtifact;
  40. enum class EUserEvent;
  41. /// Recruitment window where you can recruit creatures
  42. class CRecruitmentWindow : public CStatusbarWindow
  43. {
  44. class CCreatureCard : public CIntObject, public std::enable_shared_from_this<CCreatureCard>
  45. {
  46. CRecruitmentWindow * parent;
  47. std::shared_ptr<CCreaturePic> animation;
  48. bool selected;
  49. public:
  50. const CCreature * creature;
  51. si32 amount;
  52. void select(bool on);
  53. CCreatureCard(CRecruitmentWindow * window, const CCreature * crea, int totalAmount);
  54. void clickLeft(tribool down, bool previousState) override;
  55. void clickRight(tribool down, bool previousState) override;
  56. void showAll(SDL_Surface * to) override;
  57. };
  58. std::function<void(CreatureID,int)> onRecruit; //void (int ID, int amount) <-- call to recruit creatures
  59. int level;
  60. const CArmedInstance * dst;
  61. std::shared_ptr<CCreatureCard> selected;
  62. std::vector<std::shared_ptr<CCreatureCard>> cards;
  63. std::shared_ptr<CSlider> slider;
  64. std::shared_ptr<CButton> maxButton;
  65. std::shared_ptr<CButton> buyButton;
  66. std::shared_ptr<CButton> cancelButton;
  67. std::shared_ptr<CLabel> title;
  68. std::shared_ptr<CLabel> availableValue;
  69. std::shared_ptr<CLabel> toRecruitValue;
  70. std::shared_ptr<CLabel> availableTitle;
  71. std::shared_ptr<CLabel> toRecruitTitle;
  72. std::shared_ptr<CreatureCostBox> costPerTroopValue;
  73. std::shared_ptr<CreatureCostBox> totalCostValue;
  74. void select(std::shared_ptr<CCreatureCard> card);
  75. void buy();
  76. void sliderMoved(int to);
  77. void showAll(SDL_Surface * to) override;
  78. public:
  79. const CGDwelling * const dwelling;
  80. CRecruitmentWindow(const CGDwelling * Dwelling, int Level, const CArmedInstance * Dst, const std::function<void(CreatureID,int)> & Recruit, int y_offset = 0);
  81. void availableCreaturesChanged();
  82. };
  83. /// Split window where creatures can be split up into two single unit stacks
  84. class CSplitWindow : public CWindowObject
  85. {
  86. std::function<void(int, int)> callback;
  87. int leftAmount;
  88. int rightAmount;
  89. int leftMin;
  90. int rightMin;
  91. std::shared_ptr<CLabel> title;
  92. std::shared_ptr<CSlider> slider;
  93. std::shared_ptr<CCreaturePic> animLeft;
  94. std::shared_ptr<CCreaturePic> animRight;
  95. std::shared_ptr<CButton> ok;
  96. std::shared_ptr<CButton> cancel;
  97. std::shared_ptr<CTextInput> leftInput;
  98. std::shared_ptr<CTextInput> rightInput;
  99. void setAmountText(std::string text, bool left);
  100. void setAmount(int value, bool left);
  101. void sliderMoved(int value);
  102. void apply();
  103. public:
  104. /**
  105. * creature - displayed creature
  106. * callback(leftAmount, rightAmount) - function to call on close
  107. * leftMin, rightMin - minimal amount of creatures in each stack
  108. * leftAmount, rightAmount - amount of creatures in each stack
  109. */
  110. CSplitWindow(const CCreature * creature, std::function<void(int, int)> callback, int leftMin, int rightMin, int leftAmount, int rightAmount);
  111. };
  112. /// Raised up level window where you can select one out of two skills
  113. class CLevelWindow : public CWindowObject
  114. {
  115. std::shared_ptr<CAnimImage> portrait;
  116. std::shared_ptr<CButton> ok;
  117. std::shared_ptr<CLabel> mainTitle;
  118. std::shared_ptr<CLabel> levelTitle;
  119. std::shared_ptr<CAnimImage> skillIcon;
  120. std::shared_ptr<CLabel> skillValue;
  121. std::shared_ptr<CComponentBox> box; //skills to select
  122. std::function<void(ui32)> cb;
  123. void selectionChanged(unsigned to);
  124. public:
  125. CLevelWindow(const CGHeroInstance *hero, PrimarySkill::PrimarySkill pskill, std::vector<SecondarySkill> &skills, std::function<void(ui32)> callback);
  126. ~CLevelWindow();
  127. };
  128. /// Town portal, castle gate window
  129. class CObjectListWindow : public CWindowObject
  130. {
  131. class CItem : public CIntObject
  132. {
  133. CObjectListWindow * parent;
  134. std::shared_ptr<CLabel> text;
  135. std::shared_ptr<CPicture> border;
  136. public:
  137. const size_t index;
  138. CItem(CObjectListWindow * parent, size_t id, std::string text);
  139. void select(bool on);
  140. void clickLeft(tribool down, bool previousState) override;
  141. void onDoubleClick() override;
  142. };
  143. std::function<void(int)> onSelect;//called when OK button is pressed, returns id of selected item.
  144. std::shared_ptr<CIntObject> titleWidget;
  145. std::shared_ptr<CLabel> title;
  146. std::shared_ptr<CLabel> descr;
  147. std::shared_ptr<CListBox> list;
  148. std::shared_ptr<CButton> ok;
  149. std::shared_ptr<CButton> exit;
  150. std::vector< std::pair<int, std::string> > items;//all items present in list
  151. void init(std::shared_ptr<CIntObject> titleWidget_, std::string _title, std::string _descr);
  152. void exitPressed();
  153. public:
  154. size_t selected;//index of currently selected item
  155. std::function<void()> onExit;//optional exit callback
  156. /// Callback will be called when OK button is pressed, returns id of selected item. initState = initially selected item
  157. /// Image can be nullptr
  158. ///item names will be taken from map objects
  159. CObjectListWindow(const std::vector<int> &_items, std::shared_ptr<CIntObject> titleWidget_, std::string _title, std::string _descr, std::function<void(int)> Callback, size_t initialSelection = 0);
  160. CObjectListWindow(const std::vector<std::string> &_items, std::shared_ptr<CIntObject> titleWidget_, std::string _title, std::string _descr, std::function<void(int)> Callback, size_t initialSelection = 0);
  161. std::shared_ptr<CIntObject> genItem(size_t index);
  162. void elementSelected();//call callback and close this window
  163. void changeSelection(size_t which);
  164. void keyPressed(const SDL_Keycode & key) override;
  165. };
  166. class CSystemOptionsWindow : public CWindowObject
  167. {
  168. private:
  169. std::shared_ptr<CLabel> title;
  170. std::shared_ptr<CLabelGroup> leftGroup;
  171. std::shared_ptr<CLabelGroup> rightGroup;
  172. std::shared_ptr<CButton> load;
  173. std::shared_ptr<CButton> save;
  174. std::shared_ptr<CButton> restart;
  175. std::shared_ptr<CButton> mainMenu;
  176. std::shared_ptr<CButton> quitGame;
  177. std::shared_ptr<CButton> backToMap; //load and restart are not used yet
  178. std::shared_ptr<CToggleGroup> heroMoveSpeed;
  179. std::shared_ptr<CToggleGroup> enemyMoveSpeed;
  180. std::shared_ptr<CToggleGroup> mapScrollSpeed;
  181. std::shared_ptr<CVolumeSlider> musicVolume;
  182. std::shared_ptr<CVolumeSlider> effectsVolume;
  183. std::shared_ptr<CToggleButton> showReminder;
  184. std::shared_ptr<CToggleButton> quickCombat;
  185. std::shared_ptr<CToggleButton> spellbookAnim;
  186. std::shared_ptr<CToggleButton> fullscreen;
  187. std::shared_ptr<CButton> gameResButton;
  188. std::shared_ptr<CLabel> gameResLabel;
  189. SettingsListener onFullscreenChanged;
  190. std::vector<Point> supportedResolutions;
  191. std::vector<Point> selectableResolutions;
  192. //functions bound to buttons
  193. void bloadf(); //load game
  194. void bsavef(); //save game
  195. void bquitf(); //quit game
  196. void breturnf(); //return to game
  197. void brestartf(); //restart game
  198. void bmainmenuf(); //return to main menu
  199. void setFullscreenMode( bool on);
  200. void fillSelectableResolutions();
  201. bool isResolutionSupported(const Point & resolution);
  202. bool isResolutionSupported(const Point & resolution, bool fullscreen);
  203. void selectGameRes();
  204. void setGameRes(int index);
  205. void closeAndPushEvent(EUserEvent code);
  206. public:
  207. CSystemOptionsWindow();
  208. };
  209. class CTavernWindow : public CStatusbarWindow
  210. {
  211. public:
  212. class HeroPortrait : public CIntObject
  213. {
  214. public:
  215. std::string hoverName;
  216. std::string description; // "XXX is a level Y ZZZ with N artifacts"
  217. const CGHeroInstance * h;
  218. void clickLeft(tribool down, bool previousState) override;
  219. void clickRight(tribool down, bool previousState) override;
  220. void hover (bool on) override;
  221. HeroPortrait(int & sel, int id, int x, int y, const CGHeroInstance * H);
  222. private:
  223. int *_sel;
  224. const int _id;
  225. std::shared_ptr<CAnimImage> portrait;
  226. };
  227. //recruitable heroes
  228. std::shared_ptr<HeroPortrait> h1;
  229. std::shared_ptr<HeroPortrait> h2; //recruitable heroes
  230. int selected;//0 (left) or 1 (right)
  231. int oldSelected;//0 (left) or 1 (right)
  232. std::shared_ptr<CButton> thiefGuild;
  233. std::shared_ptr<CButton> cancel;
  234. std::shared_ptr<CButton> recruit;
  235. const CGObjectInstance * tavernObj;
  236. std::shared_ptr<CLabel> title;
  237. std::shared_ptr<CLabel> cost;
  238. std::shared_ptr<CTextBox> rumor;
  239. CTavernWindow(const CGObjectInstance * TavernObj);
  240. ~CTavernWindow();
  241. void recruitb();
  242. void thievesguildb();
  243. void show(SDL_Surface * to) override;
  244. };
  245. class CCallback;
  246. class CExchangeWindow;
  247. struct HeroArtifact
  248. {
  249. const CGHeroInstance * hero;
  250. const CArtifactInstance * artifact;
  251. ArtifactPosition artPosition;
  252. HeroArtifact(const CGHeroInstance * hero, const CArtifactInstance * artifact, ArtifactPosition artPosition)
  253. :hero(hero), artifact(artifact), artPosition(artPosition)
  254. {
  255. }
  256. };
  257. class CExchangeController
  258. {
  259. private:
  260. const CGHeroInstance * left;
  261. const CGHeroInstance * right;
  262. std::shared_ptr<CCallback> cb;
  263. CExchangeWindow * view;
  264. public:
  265. CExchangeController(CExchangeWindow * view, ObjectInstanceID hero1, ObjectInstanceID hero2);
  266. std::function<void()> onMoveArmyToRight();
  267. std::function<void()> onSwapArmy();
  268. std::function<void()> onMoveArmyToLeft();
  269. std::function<void()> onSwapArtifacts();
  270. std::function<void()> onMoveArtifactsToLeft();
  271. std::function<void()> onMoveArtifactsToRight();
  272. std::function<void()> onMoveStackToLeft(SlotID slotID);
  273. std::function<void()> onMoveStackToRight(SlotID slotID);
  274. private:
  275. void moveArmy(bool leftToRight);
  276. void moveArtifacts(bool leftToRight);
  277. void moveArtifact(const CGHeroInstance * source, const CGHeroInstance * target, ArtifactPosition srcPosition);
  278. void moveStack(const CGHeroInstance * source, const CGHeroInstance * target, SlotID sourceSlot);
  279. };
  280. class CExchangeWindow : public CStatusbarWindow, public CGarrisonHolder, public CWindowWithArtifacts
  281. {
  282. std::array<std::shared_ptr<CHeroWithMaybePickedArtifact>, 2> herosWArt;
  283. std::array<std::shared_ptr<CLabel>, 2> titles;
  284. std::vector<std::shared_ptr<CAnimImage>> primSkillImages;//shared for both heroes
  285. std::array<std::vector<std::shared_ptr<CLabel>>, 2> primSkillValues;
  286. std::array<std::vector<std::shared_ptr<CAnimImage>>, 2> secSkillIcons;
  287. std::array<std::shared_ptr<CAnimImage>, 2> specImages;
  288. std::array<std::shared_ptr<CAnimImage>, 2> expImages;
  289. std::array<std::shared_ptr<CLabel>, 2> expValues;
  290. std::array<std::shared_ptr<CAnimImage>, 2> manaImages;
  291. std::array<std::shared_ptr<CLabel>, 2> manaValues;
  292. std::array<std::shared_ptr<CAnimImage>, 2> portraits;
  293. std::vector<std::shared_ptr<LRClickableAreaWTextComp>> primSkillAreas;
  294. std::array<std::vector<std::shared_ptr<LRClickableAreaWTextComp>>, 2> secSkillAreas;
  295. std::array<std::shared_ptr<CHeroArea>, 2> heroAreas;
  296. std::array<std::shared_ptr<LRClickableAreaWText>, 2> specialtyAreas;
  297. std::array<std::shared_ptr<LRClickableAreaWText>, 2> experienceAreas;
  298. std::array<std::shared_ptr<LRClickableAreaWText>, 2> spellPointsAreas;
  299. std::array<std::shared_ptr<MoraleLuckBox>, 2> morale;
  300. std::array<std::shared_ptr<MoraleLuckBox>, 2> luck;
  301. std::shared_ptr<CButton> quit;
  302. std::array<std::shared_ptr<CButton>, 2> questlogButton;
  303. std::shared_ptr<CGarrisonInt> garr;
  304. std::shared_ptr<CButton> moveAllGarrButtonLeft;
  305. std::shared_ptr<CButton> echangeGarrButton;
  306. std::shared_ptr<CButton> moveAllGarrButtonRight;
  307. std::shared_ptr<CButton> moveArtifactsButtonLeft;
  308. std::shared_ptr<CButton> echangeArtifactsButton;
  309. std::shared_ptr<CButton> moveArtifactsButtonRight;
  310. std::vector<std::shared_ptr<CButton>> moveStackLeftButtons;
  311. std::vector<std::shared_ptr<CButton>> moveStackRightButtons;
  312. CExchangeController controller;
  313. public:
  314. std::array<const CGHeroInstance *, 2> heroInst;
  315. std::array<std::shared_ptr<CArtifactsOfHero>, 2> artifs;
  316. void updateGarrisons() override;
  317. void questlog(int whichHero); //questlog button callback; whichHero: 0 - left, 1 - right
  318. void updateWidgets();
  319. const CGarrisonSlot * getSelectedSlotID() const;
  320. CExchangeWindow(ObjectInstanceID hero1, ObjectInstanceID hero2, QueryID queryID);
  321. };
  322. /// Here you can buy ships
  323. class CShipyardWindow : public CStatusbarWindow
  324. {
  325. std::shared_ptr<CPicture> bgWater;
  326. std::shared_ptr<CAnimImage> bgShip;
  327. std::shared_ptr<CLabel> title;
  328. std::shared_ptr<CLabel> costLabel;
  329. std::shared_ptr<CAnimImage> woodPic;
  330. std::shared_ptr<CAnimImage> goldPic;
  331. std::shared_ptr<CLabel> woodCost;
  332. std::shared_ptr<CLabel> goldCost;
  333. std::shared_ptr<CButton> build;
  334. std::shared_ptr<CButton> quit;
  335. public:
  336. CShipyardWindow(const std::vector<si32> & cost, int state, int boatType, const std::function<void()> & onBuy);
  337. };
  338. /// Puzzle screen which gets uncovered when you visit obilisks
  339. class CPuzzleWindow : public CWindowObject
  340. {
  341. private:
  342. int3 grailPos;
  343. std::shared_ptr<CPicture> logo;
  344. std::shared_ptr<CLabel> title;
  345. std::shared_ptr<CButton> quitb;
  346. std::shared_ptr<CResDataBar> resDataBar;
  347. std::vector<std::shared_ptr<CPicture>> piecesToRemove;
  348. std::vector<std::shared_ptr<CPicture>> visiblePieces;
  349. ui8 currentAlpha;
  350. public:
  351. void showAll(SDL_Surface * to) override;
  352. void show(SDL_Surface * to) override;
  353. CPuzzleWindow(const int3 & grailPos, double discoveredRatio);
  354. };
  355. /// Creature transformer window
  356. class CTransformerWindow : public CStatusbarWindow, public CGarrisonHolder
  357. {
  358. class CItem : public CIntObject
  359. {
  360. public:
  361. int id;//position of creature in hero army
  362. bool left;//position of the item
  363. int size; //size of creature stack
  364. CTransformerWindow * parent;
  365. std::shared_ptr<CAnimImage> icon;
  366. std::shared_ptr<CLabel> count;
  367. void move();
  368. void clickLeft(tribool down, bool previousState) override;
  369. void update();
  370. CItem(CTransformerWindow * parent, int size, int id);
  371. };
  372. const CArmedInstance * army;//object with army for transforming (hero or town)
  373. const CGHeroInstance * hero;//only if we have hero in town
  374. const CGTownInstance * town;//market, town garrison is used if hero == nullptr
  375. std::shared_ptr<CLabel> titleLeft;
  376. std::shared_ptr<CLabel> titleRight;
  377. std::shared_ptr<CTextBox> helpLeft;
  378. std::shared_ptr<CTextBox> helpRight;
  379. std::vector<std::shared_ptr<CItem>> items;
  380. std::shared_ptr<CButton> all;
  381. std::shared_ptr<CButton> convert;
  382. std::shared_ptr<CButton> cancel;
  383. public:
  384. void makeDeal();
  385. void addAll();
  386. void updateGarrisons() override;
  387. CTransformerWindow(const CGHeroInstance * _hero, const CGTownInstance * _town);
  388. };
  389. class CUniversityWindow : public CStatusbarWindow
  390. {
  391. class CItem : public CIntObject
  392. {
  393. std::shared_ptr<CAnimImage> icon;
  394. std::shared_ptr<CAnimImage> topBar;
  395. std::shared_ptr<CAnimImage> bottomBar;
  396. std::shared_ptr<CLabel> name;
  397. std::shared_ptr<CLabel> level;
  398. public:
  399. int ID;//id of selected skill
  400. CUniversityWindow * parent;
  401. void showAll(SDL_Surface * to) override;
  402. void clickLeft(tribool down, bool previousState) override;
  403. void clickRight(tribool down, bool previousState) override;
  404. void hover(bool on) override;
  405. int state();//0=can't learn, 1=learned, 2=can learn
  406. CItem(CUniversityWindow * _parent, int _ID, int X, int Y);
  407. };
  408. const CGHeroInstance * hero;
  409. const IMarket * market;
  410. std::shared_ptr<CAnimation> bars;
  411. std::vector<std::shared_ptr<CItem>> items;
  412. std::shared_ptr<CButton> cancel;
  413. std::shared_ptr<CIntObject> titlePic;
  414. std::shared_ptr<CLabel> title;
  415. std::shared_ptr<CTextBox> clerkSpeech;
  416. public:
  417. CUniversityWindow(const CGHeroInstance * _hero, const IMarket * _market);
  418. void makeDeal(int skill);
  419. };
  420. /// Confirmation window for University
  421. class CUnivConfirmWindow : public CStatusbarWindow
  422. {
  423. std::shared_ptr<CTextBox> clerkSpeech;
  424. std::shared_ptr<CLabel> name;
  425. std::shared_ptr<CLabel> level;
  426. std::shared_ptr<CAnimImage> icon;
  427. CUniversityWindow * owner;
  428. std::shared_ptr<CButton> confirm;
  429. std::shared_ptr<CButton> cancel;
  430. std::shared_ptr<CAnimImage> costIcon;
  431. std::shared_ptr<CLabel> cost;
  432. void makeDeal(int skill);
  433. public:
  434. CUnivConfirmWindow(CUniversityWindow * PARENT, int SKILL, bool available);
  435. };
  436. /// Garrison window where you can take creatures out of the hero to place it on the garrison
  437. class CGarrisonWindow : public CWindowObject, public CGarrisonHolder
  438. {
  439. std::shared_ptr<CLabel> title;
  440. std::shared_ptr<CAnimImage> banner;
  441. std::shared_ptr<CAnimImage> portrait;
  442. std::shared_ptr<CGarrisonInt> garr;
  443. public:
  444. std::shared_ptr<CButton> quit;
  445. CGarrisonWindow(const CArmedInstance * up, const CGHeroInstance * down, bool removableUnits);
  446. void updateGarrisons() override;
  447. };
  448. /// Hill fort is the building where you can upgrade units
  449. class CHillFortWindow : public CStatusbarWindow, public CGarrisonHolder
  450. {
  451. private:
  452. static const int slotsCount = 7;
  453. //todo: mithril support
  454. static const int resCount = 7;
  455. const CGObjectInstance * fort;
  456. const CGHeroInstance * hero;
  457. std::shared_ptr<CLabel> title;
  458. std::shared_ptr<CHeroArea> heroPic;
  459. std::array<std::shared_ptr<CAnimImage>, resCount> totalIcons;
  460. std::array<std::shared_ptr<CLabel>, resCount> totalLabels;
  461. std::array<std::shared_ptr<CButton>, slotsCount> upgrade;//upgrade single creature
  462. std::array<int, slotsCount + 1> currState;//current state of slot - to avoid calls to getState or updating buttons
  463. //there is a place for only 2 resources per slot
  464. std::array< std::array<std::shared_ptr<CAnimImage>, 2>, slotsCount> slotIcons;
  465. std::array< std::array<std::shared_ptr<CLabel>, 2>, slotsCount> slotLabels;
  466. std::shared_ptr<CButton> upgradeAll;
  467. std::shared_ptr<CButton> quit;
  468. std::shared_ptr<CGarrisonInt> garr;
  469. std::string getDefForSlot(SlotID slot);
  470. std::string getTextForSlot(SlotID slot);
  471. void makeDeal(SlotID slot);//-1 for upgrading all creatures
  472. int getState(SlotID slot); //-1 = no creature 0=can't upgrade, 1=upgraded, 2=can upgrade
  473. public:
  474. CHillFortWindow(const CGHeroInstance * visitor, const CGObjectInstance * object);
  475. void updateGarrisons() override;//update buttons after garrison changes
  476. };
  477. class CThievesGuildWindow : public CStatusbarWindow
  478. {
  479. const CGObjectInstance * owner;
  480. std::shared_ptr<CButton> exitb;
  481. std::shared_ptr<CMinorResDataBar> resdatabar;
  482. std::vector<std::shared_ptr<CLabel>> rowHeaders;
  483. std::vector<std::shared_ptr<CAnimImage>> columnBackgrounds;
  484. std::vector<std::shared_ptr<CLabel>> columnHeaders;
  485. std::vector<std::shared_ptr<CAnimImage>> cells;
  486. std::vector<std::shared_ptr<CPicture>> banners;
  487. std::vector<std::shared_ptr<CAnimImage>> bestHeroes;
  488. std::vector<std::shared_ptr<CTextBox>> primSkillHeaders;
  489. std::vector<std::shared_ptr<CLabel>> primSkillValues;
  490. std::vector<std::shared_ptr<CAnimImage>> bestCreatures;
  491. std::vector<std::shared_ptr<CLabel>> personalities;
  492. public:
  493. CThievesGuildWindow(const CGObjectInstance * _owner);
  494. };