GUIClasses.h 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193
  1. #ifndef __GUICLASSES_H__
  2. #define __GUICLASSES_H__
  3. #include "../global.h"
  4. #include "GUIBase.h"
  5. #include "FunctionList.h"
  6. #include <set>
  7. #include <list>
  8. #include <boost/thread/mutex.hpp>
  9. #ifdef max
  10. #undef max
  11. #endif
  12. #ifdef min
  13. #undef min
  14. #endif
  15. /*
  16. * GUIClasses.h, part of VCMI engine
  17. *
  18. * Authors: listed in file AUTHORS in main folder
  19. *
  20. * License: GNU General Public License v2.0 or later
  21. * Full text of license available in license.txt file, in main folder
  22. *
  23. */
  24. class CStackBasicDescriptor;
  25. class CBonusSystemNode;
  26. class CArtifact;
  27. class CDefEssential;
  28. class AdventureMapButton;
  29. class CHighlightableButtonsGroup;
  30. class CDefHandler;
  31. struct HeroMoveDetails;
  32. class CDefEssential;
  33. class CGHeroInstance;
  34. class CAdvMapInt;
  35. class CCastleInterface;
  36. class CBattleInterface;
  37. class CStack;
  38. class SComponent;
  39. class CCreature;
  40. struct SDL_Surface;
  41. struct CPath;
  42. class CCreatureAnim;
  43. class CSelectableComponent;
  44. class CCreatureSet;
  45. class CGObjectInstance;
  46. class CGDwelling;
  47. class CSlider;
  48. struct UpgradeInfo;
  49. template <typename T> struct CondSh;
  50. class CInGameConsole;
  51. class CGarrisonInt;
  52. class CInGameConsole;
  53. struct Component;
  54. class CArmedInstance;
  55. class CGTownInstance;
  56. class StackState;
  57. class CPlayerInterface;
  58. class CHeroWindow;
  59. class CArtifact;
  60. class CArtifactsOfHero;
  61. class CResDataBar;
  62. struct SPuzzleInfo;
  63. class CGGarrison;
  64. class CStackInstance;
  65. class IMarket;
  66. class CTextBox;
  67. extern SDL_Color tytulowy, tlo, zwykly ;
  68. class CInfoWindow : public CSimpleWindow //text + comp. + ok button
  69. { //window able to delete its components when closed
  70. bool delComps; //whether comps will be deleted
  71. public:
  72. int ID; //for identification
  73. CTextBox *text;
  74. std::vector<AdventureMapButton *> buttons;
  75. std::vector<SComponent*> components;
  76. CSlider *slider;
  77. void setDelComps(bool DelComps);
  78. virtual void close();
  79. void show(SDL_Surface * to);
  80. void showAll(SDL_Surface * to);
  81. void sliderMoved(int to);
  82. CInfoWindow(std::string Text, int player, const std::vector<SComponent*> &comps, std::vector<std::pair<std::string,CFunctionList<void()> > > &Buttons, bool delComps); //c-tor
  83. CInfoWindow(); //c-tor
  84. ~CInfoWindow(); //d-tor
  85. static void showYesNoDialog( const std::string & text, const std::vector<SComponent*> *components, const CFunctionList<void( ) > &onYes, const CFunctionList<void()> &onNo, bool DelComps = true, int player = 1); //use only before the game starts! (showYesNoDialog in LOCPLINT must be used then)
  86. static CInfoWindow *create(const std::string &text, int playerID = 1, const std::vector<SComponent*> *components = NULL, bool DelComps = false);
  87. };
  88. class CSelWindow : public CInfoWindow //component selection window
  89. { //warning - this window deletes its components by closing!
  90. public:
  91. void selectionChange(unsigned to);
  92. void madeChoice(); //looks for selected component and calls callback
  93. CSelWindow(const std::string& text, int player, int charperline ,const std::vector<CSelectableComponent*> &comps, const std::vector<std::pair<std::string,CFunctionList<void()> > > &Buttons, int askID); //c-tor
  94. CSelWindow(){}; //c-tor
  95. //notification - this class inherits important destructor from CInfoWindow
  96. };
  97. class CRClickPopup : public CIntObject //popup displayed on R-click
  98. {
  99. public:
  100. virtual void activate();
  101. virtual void deactivate();
  102. virtual void close();
  103. void clickRight(tribool down, bool previousState);
  104. CRClickPopup();
  105. virtual ~CRClickPopup(); //d-tor
  106. static void createAndPush(const std::string &txt);
  107. static void createAndPush(const CGObjectInstance *obj, const Point &p, EAlignment alignment = BOTTOMRIGHT);
  108. };
  109. class CRClickPopupInt : public CRClickPopup //popup displayed on R-click
  110. {
  111. public:
  112. IShowActivable *inner;
  113. bool delInner;
  114. void show(SDL_Surface * to);
  115. CRClickPopupInt(IShowActivable *our, bool deleteInt); //c-tor
  116. virtual ~CRClickPopupInt(); //d-tor
  117. };
  118. class CInfoPopup : public CRClickPopup
  119. {
  120. public:
  121. bool free; //TODO: comment me
  122. SDL_Surface * bitmap; //popup background
  123. void close();
  124. void show(SDL_Surface * to);
  125. CInfoPopup(SDL_Surface * Bitmap, int x, int y, bool Free=false); //c-tor
  126. CInfoPopup(SDL_Surface * Bitmap, const Point &p, EAlignment alignment, bool Free=false); //c-tor
  127. CInfoPopup(SDL_Surface *Bitmap = NULL, bool Free = false); //default c-tor
  128. void init(int x, int y);
  129. ~CInfoPopup(); //d-tor
  130. };
  131. class SComponent : public virtual CIntObject //common popup window component
  132. {
  133. public:
  134. enum Etype
  135. {
  136. primskill, secskill, resource, creature, artifact, experience, secskill44, spell, morale, luck, building, hero, flag
  137. } type; //component type
  138. int subtype; //TODO: comment me
  139. int val; //TODO: comment me
  140. std::string description; //r-click
  141. std::string subtitle; //TODO: comment me
  142. SDL_Surface *img; //our image
  143. bool free; //should surface be freed on delete
  144. SDL_Surface * setSurface(std::string defName, int imgPos);
  145. void init(Etype Type, int Subtype, int Val);
  146. SComponent(Etype Type, int Subtype, int Val, SDL_Surface *sur=NULL, bool freeSur=false); //c-tor
  147. SComponent(const Component &c); //c-tor
  148. SComponent(){}; //c-tor
  149. virtual ~SComponent(); //d-tor
  150. void clickRight(tribool down, bool previousState); //call-in
  151. SDL_Surface * getImg();
  152. virtual void show(SDL_Surface * to);
  153. virtual void activate();
  154. virtual void deactivate();
  155. };
  156. class CSelectableComponent : public SComponent, public KeyShortcut
  157. {
  158. public:
  159. bool selected; //if true, this component is selected
  160. boost::function<void()> onSelect; //function called on selection change
  161. void clickLeft(tribool down, bool previousState); //call-in
  162. void init();
  163. CSelectableComponent(Etype Type, int Sub, int Val, boost::function<void()> OnSelect = 0); //c-tor
  164. CSelectableComponent(const Component &c, boost::function<void()> OnSelect = 0); //c-tor
  165. ~CSelectableComponent(); //d-tor
  166. virtual void show(SDL_Surface * to);
  167. void activate();
  168. void deactivate();
  169. void select(bool on);
  170. };
  171. class CGarrisonInt;
  172. class CGarrisonSlot : public CIntObject
  173. {
  174. public:
  175. int ID; //for identification
  176. CGarrisonInt *owner;
  177. const CStackInstance *myStack; //NULL if slot is empty
  178. const CCreature *creature;
  179. int count; //number of creatures
  180. int upg; //0 - up garrison, 1 - down garrison
  181. bool active; //TODO: comment me
  182. virtual void hover (bool on); //call-in
  183. const CArmedInstance * getObj();
  184. bool our();
  185. void clickRight(tribool down, bool previousState);
  186. void clickLeft(tribool down, bool previousState);
  187. void activate();
  188. void deactivate();
  189. void show(SDL_Surface * to);
  190. CGarrisonSlot(CGarrisonInt *Owner, int x, int y, int IID, int Upg=0, const CStackInstance * Creature=NULL);
  191. ~CGarrisonSlot(); //d-tor
  192. };
  193. class CGarrisonInt :public CIntObject
  194. {
  195. public:
  196. int interx; //space between slots
  197. Point garOffset, //offset between garrisons (not used if only one hero)
  198. surOffset; //offset between garrison position on the bg surface and position on the screen
  199. CGarrisonSlot *highlighted; //chosen slot
  200. std::vector<AdventureMapButton *> splitButtons; //may be empty if no buttons
  201. SDL_Surface *&sur; //bg surface
  202. int p2, //TODO: comment me
  203. shiftPos;//1st slot of the second row, set shiftPoint for effect
  204. bool splitting, pb,
  205. smallIcons, //true - 32x32 imgs, false - 58x64
  206. removableUnits,//player can remove units from up
  207. twoRows,//slots will be placed in 2 rows
  208. ourUp,ourDown;//player owns up or down army
  209. const CCreatureSet *set1; //top set of creatures
  210. const CCreatureSet *set2; //bottom set of creatures
  211. std::vector<CGarrisonSlot*> slotsUp, slotsDown; //slots of upper and lower garrison
  212. const CArmedInstance *oup, *odown; //upper and lower garrisons (heroes or towns)
  213. void addSplitBtn(AdventureMapButton * button);
  214. void createSet(std::vector<CGarrisonSlot*> &ret, const CCreatureSet * set, int posX, int distance, int posY, int Upg );
  215. void activate();
  216. void createSlots();
  217. void deleteSlots();
  218. void recreateSlots();
  219. void splitClick(); //handles click on split button
  220. void splitStacks(int am2); //TODO: comment me
  221. //x, y - position; inx - distance between slots; pomsur - background surface, SurOffset - ?; s1, s2 - top and bottom armies; removableUnits - you can take units from top; smallImgs - units images size 64x58 or 32x32; twoRows - display slots in 2 row (1st row = 4, 2nd = 3)
  222. CGarrisonInt(int x, int y, int inx, const Point &garsOffset, SDL_Surface *&pomsur, const Point &SurOffset, const CArmedInstance *s1, const CArmedInstance *s2=NULL, bool _removableUnits = true, bool smallImgs = false, bool _twoRows=false); //c-tor
  223. ~CGarrisonInt(); //d-tor
  224. };
  225. class CStatusBar
  226. : public CIntObject, public IStatusBar
  227. {
  228. public:
  229. SDL_Surface * bg; //background
  230. int middlex, middley; //middle of statusbar
  231. std::string current; //text currently printed
  232. CStatusBar(int x, int y, std::string name="ADROLLVR.bmp", int maxw=-1); //c-tor
  233. ~CStatusBar(); //d-tor
  234. void print(const std::string & text); //prints text and refreshes statusbar
  235. void clear();//clears statusbar and refreshes
  236. void show(SDL_Surface * to); //shows statusbar (with current text)
  237. std::string getCurrent(); //getter for current
  238. };
  239. class CLabel
  240. : public virtual CIntObject
  241. {
  242. public:
  243. EAlignment alignment;
  244. EFonts font;
  245. SDL_Color color;
  246. std::string text;
  247. CPicture *bg;
  248. bool autoRedraw; //whether control will redraw itself on setTxt
  249. Point textOffset; //text will be blitted at pos + textOffset with appropriate alignment
  250. bool ignoreLeadingWhitespace;
  251. virtual void setTxt(const std::string &Txt);
  252. void showAll(SDL_Surface * to); //shows statusbar (with current text)
  253. CLabel(int x=0, int y=0, EFonts Font = FONT_SMALL, EAlignment Align = TOPLEFT, const SDL_Color &Color = zwykly, const std::string &Text = "");
  254. };
  255. //a multi-line label that tries to fit text with given available width and height; if not possible, it creates a slider for scrolling text
  256. class CTextBox
  257. : public CLabel
  258. {
  259. public:
  260. int maxW; //longest line of text in px
  261. int maxH; //total height needed to print all lines
  262. int sliderStyle;
  263. bool redrawParentOnScrolling;
  264. std::vector<std::string> lines;
  265. CSlider *slider;
  266. //CTextBox( std::string Text, const Point &Pos, int w, int h, EFonts Font = FONT_SMALL, EAlignment Align = TOPLEFT, const SDL_Color &Color = zwykly);
  267. CTextBox(std::string Text, const Rect &rect, int SliderStyle, EFonts Font = FONT_SMALL, EAlignment Align = TOPLEFT, const SDL_Color &Color = zwykly);
  268. void showAll(SDL_Surface * to); //shows statusbar (with current text)
  269. void setTxt(const std::string &Txt);
  270. void setBounds(int limitW, int limitH);
  271. void recalculateLines(const std::string &Txt);
  272. void sliderMoved(int to);
  273. };
  274. class CGStatusBar
  275. : public CLabel, public IStatusBar
  276. {
  277. void init();
  278. public:
  279. IStatusBar *oldStatusBar;
  280. //statusbar interface overloads
  281. void print(const std::string & Text); //prints text and refreshes statusbar
  282. void clear();//clears statusbar and refreshes
  283. std::string getCurrent(); //returns currently displayed text
  284. void show(SDL_Surface * to); //shows statusbar (with current text)
  285. CGStatusBar(int x, int y, EFonts Font = FONT_SMALL, EAlignment Align = CENTER, const SDL_Color &Color = zwykly, const std::string &Text = "");
  286. CGStatusBar(CPicture *BG, EFonts Font = FONT_SMALL, EAlignment Align = CENTER, const SDL_Color &Color = zwykly); //given CPicture will be captured by created sbar and it's pos will be used as pos for sbar
  287. CGStatusBar(int x, int y, std::string name, int maxw=-1);
  288. ~CGStatusBar();
  289. void calcOffset();
  290. };
  291. class CFocusable
  292. : public virtual CIntObject
  293. {
  294. public:
  295. bool focus; //only one focusable control can have focus at one moment
  296. void giveFocus(); //captures focus
  297. void moveFocus(); //moves focus to next active control (may be used for tab switching)
  298. static std::list<CFocusable*> focusables; //all existing objs
  299. static CFocusable *inputWithFocus; //who has focus now
  300. CFocusable();
  301. ~CFocusable();
  302. };
  303. class CTextInput
  304. : public CLabel, public CFocusable
  305. {
  306. public:
  307. CFunctionList<void(const std::string &)> cb;
  308. void setText(const std::string &nText, bool callCb = false);
  309. CTextInput(const Rect &Pos, const Point &bgOffset, const std::string &bgName, const CFunctionList<void(const std::string &)> &CB);
  310. CTextInput(const Rect &Pos, SDL_Surface *srf = NULL);
  311. ~CTextInput();
  312. void showAll(SDL_Surface * to);
  313. void clickLeft(tribool down, bool previousState);
  314. void keyPressed(const SDL_KeyboardEvent & key);
  315. };
  316. class CList : public CIntObject
  317. {
  318. public:
  319. SDL_Surface * bg; //background bitmap
  320. CDefHandler *arrup, *arrdo; //button arrows for scrolling list
  321. SDL_Surface *empty, *selection;
  322. SDL_Rect arrupp, arrdop; //positions of arrows
  323. int posw, posh; //position width/height
  324. int selected, //id of selected position, <0 if none
  325. from;
  326. const int SIZE; //size of list
  327. tribool pressed; //true=up; false=down; indeterminate=none
  328. CList(int Size = 5); //c-tor
  329. void clickLeft(tribool down, bool previousState);
  330. void activate();
  331. void deactivate();
  332. virtual void mouseMoved (const SDL_MouseMotionEvent & sEvent)=0; //call-in
  333. virtual void genList()=0;
  334. virtual void select(int which)=0;
  335. virtual void draw(SDL_Surface * to)=0;
  336. virtual int size() = 0; //how many elements do we have
  337. void fixPos(); //scrolls list, so the selection will be visible
  338. };
  339. class CHeroList
  340. : public CList
  341. {
  342. public:
  343. CDefHandler *mobile, *mana; //mana and movement indicators
  344. int posmobx, posporx, posmanx, posmoby, pospory, posmany;
  345. CHeroList(int Size); //c-tor
  346. int getPosOfHero(const CGHeroInstance* h); //hero's position on list
  347. void genList();
  348. void select(int which); //call-in
  349. void mouseMoved (const SDL_MouseMotionEvent & sEvent); //call-in
  350. void clickLeft(tribool down, bool previousState); //call-in
  351. void clickRight(tribool down, bool previousState); //call-in
  352. void hover (bool on); //call-in
  353. void keyPressed (const SDL_KeyboardEvent & key); //call-in
  354. void updateHList(const CGHeroInstance *toRemove=NULL); //removes specific hero from the list or recreates it
  355. void updateMove(const CGHeroInstance* which); //draws move points bar
  356. void draw(SDL_Surface * to);
  357. void show(SDL_Surface * to);
  358. void init();
  359. int size(); //how many elements do we have
  360. };
  361. class CTownList
  362. : public CList
  363. {
  364. public:
  365. boost::function<void()> fun; //function called on selection change
  366. int posporx,pospory;
  367. CTownList(int Size, int x, int y, std::string arrupg, std::string arrdog); //c-tor
  368. ~CTownList(); //d-tor
  369. void genList();
  370. void select(int which); //call-in
  371. void mouseMoved (const SDL_MouseMotionEvent & sEvent); //call-in
  372. void clickLeft(tribool down, bool previousState); //call-in
  373. void clickRight(tribool down, bool previousState); //call-in
  374. void hover (bool on); //call-in
  375. void keyPressed (const SDL_KeyboardEvent & key); //call-in
  376. void draw(SDL_Surface * to);
  377. void show(SDL_Surface * to);
  378. int size(); //how many elements do we have
  379. };
  380. class CCreaturePic : public CIntObject //draws picture with creature on background, use Animated=true to get animation
  381. {
  382. private:
  383. const CCreature *c; //which creature's picture
  384. bool big; //big => 100x130; !big => 100x120
  385. CCreatureAnim *anim; //displayed animation
  386. public:
  387. CCreaturePic(int x, int y, const CCreature *cre, bool Big=true, bool Animated=true); //c-tor
  388. ~CCreaturePic(); //d-tor
  389. void show(SDL_Surface *to); //prints creature on screen
  390. };
  391. class CRecruitmentWindow : public CIntObject
  392. {
  393. public:
  394. static const int SPACE_BETWEEN = 18;
  395. static const int CREATURE_WIDTH = 102;
  396. static const int TOTAL_CREATURE_WIDTH = SPACE_BETWEEN + CREATURE_WIDTH;
  397. struct creinfo
  398. {
  399. SDL_Rect pos;
  400. CCreaturePic *pic; //creature's animation
  401. int ID, amount; //creature ID and available amount
  402. std::vector<std::pair<int,int> > res; //res_id - cost_per_unit
  403. };
  404. std::vector<int> amounts; //how many creatures we can afford
  405. std::vector<creinfo> creatures; //recruitable creatures
  406. boost::function<void(int,int)> recruit; //void (int ID, int amount) <-- call to recruit creatures
  407. CSlider *slider; //for selecting amount
  408. AdventureMapButton *max, *buy, *cancel;
  409. SDL_Surface *bitmap; //background
  410. CStatusBar *bar;
  411. int which; //which creature is active
  412. const CGDwelling *dwelling;
  413. int level;
  414. const CArmedInstance *dst;
  415. void close();
  416. void Max();
  417. void Buy();
  418. void Cancel();
  419. void sliderMoved(int to);
  420. void clickLeft(tribool down, bool previousState);
  421. void clickRight(tribool down, bool previousState);
  422. void activate();
  423. void deactivate();
  424. void show(SDL_Surface * to);
  425. void showAll(SDL_Surface * to){show(to);};
  426. void cleanCres();
  427. void initCres();
  428. CRecruitmentWindow(const CGDwelling *Dwelling, int Level, const CArmedInstance *Dst, const boost::function<void(int,int)> & Recruit, int y_offset = 0); //creatures - pairs<creature_ID,amount> //c-tor
  429. ~CRecruitmentWindow(); //d-tor
  430. };
  431. class CSplitWindow : public CIntObject
  432. {
  433. public:
  434. CGarrisonInt *gar;
  435. CSlider *slider;
  436. CCreaturePic *animLeft, *animRight; //creature's animation
  437. AdventureMapButton *ok, *cancel;
  438. SDL_Surface *bitmap; //background
  439. int a1, a2, c; //TODO: comment me
  440. bool which; //which creature is selected
  441. int last; //0/1/2 - at least one creature must be in the src/dst/both stacks; -1 - no restrictions
  442. CSplitWindow(int cid, int max, CGarrisonInt *Owner, int Last = -1, int val=0); //c-tor; val - initial amount of second stack
  443. ~CSplitWindow(); //d-tor
  444. void activate();
  445. void split();
  446. void close();
  447. void deactivate();
  448. void show(SDL_Surface * to);
  449. void clickLeft(tribool down, bool previousState); //call-in
  450. void keyPressed (const SDL_KeyboardEvent & key); //call-in
  451. void sliderMoved(int to);
  452. };
  453. class CLevelWindow : public CIntObject
  454. {
  455. public:
  456. int heroPortrait;
  457. SDL_Surface *bitmap; //background
  458. std::vector<CSelectableComponent *> comps; //skills to select
  459. AdventureMapButton *ok;
  460. boost::function<void(ui32)> cb;
  461. void close();
  462. CLevelWindow(const CGHeroInstance *hero, int pskill, std::vector<ui16> &skills, boost::function<void(ui32)> &callback); //c-tor
  463. ~CLevelWindow(); //d-tor
  464. void activate();
  465. void deactivate();
  466. void selectionChanged(unsigned to);
  467. void show(SDL_Surface * to);
  468. };
  469. class CMinorResDataBar : public CIntObject
  470. {
  471. public:
  472. SDL_Surface *bg; //background bitmap
  473. void show(SDL_Surface * to);
  474. void showAll(SDL_Surface * to);
  475. CMinorResDataBar(); //c-tor
  476. ~CMinorResDataBar(); //d-tor
  477. };
  478. class CObjectListWindow : public CIntObject
  479. {
  480. public:
  481. boost::function<void(int)> onSelect;//called when OK button is pressed, returns id of selected item.
  482. std::string title,descr;//text for title and description
  483. CPicture *bg; //background
  484. CSlider *slider;
  485. CPicture *titleImage;//title image (castle gate\town portal picture)
  486. AdventureMapButton *ok, *exit;
  487. std::vector<Rect> areas;//areas for each visible item
  488. std::vector<int> items;//id of all items present in list
  489. int selected;//currently selected item
  490. int length;//size of list (=9)
  491. bool init;//true = initialization completed
  492. /// Callback will be called when OK button is pressed, returns id of selected item. initState = initially selected item
  493. CObjectListWindow(const std::vector<int> &_items, CPicture * titlePic, std::string _title, std::string _descr,
  494. boost::function<void(int)> Callback, int initState=-1); //c-tor
  495. ~CObjectListWindow(); //d-tor
  496. void elementSelected();//call callback and exit
  497. void moveList(int which);//called when slider moves
  498. void clickLeft(tribool down, bool previousState); //call-in
  499. void keyPressed (const SDL_KeyboardEvent & key); //call-in
  500. void show(SDL_Surface * to);
  501. void showAll(SDL_Surface * to);
  502. };
  503. class CTradeWindow : public CIntObject //base for markets and altar of sacrifice
  504. {
  505. public:
  506. enum EType
  507. {
  508. RESOURCE, PLAYER, ARTIFACT, CREATURE, CREATURE_PLACEHOLDER,ARTIFACT_PLACEHOLDER
  509. };
  510. class CTradeableItem : public CIntObject
  511. {
  512. public:
  513. EType type;
  514. int id;
  515. int serial;
  516. bool left;
  517. std::string subtitle; //empty if default
  518. CFunctionList<void()> callback;
  519. bool downSelection;
  520. void showAllAt(const Point &dstPos, const std::string &customSub, SDL_Surface * to);
  521. void clickRight(tribool down, bool previousState);
  522. void hover (bool on);
  523. void showAll(SDL_Surface * to);
  524. void clickLeft(tribool down, bool previousState);
  525. SDL_Surface *getSurface();
  526. std::string getName(int number = -1) const;
  527. CTradeableItem(EType Type, int ID, bool Left, int Serial);
  528. };
  529. const IMarket *market;
  530. const CGHeroInstance *hero;
  531. CPicture *bg; //background
  532. CArtifactsOfHero *arts;
  533. //all indexes: 1 = left, 0 = right
  534. std::vector<CTradeableItem*> items[2];
  535. CTradeableItem *hLeft, *hRight; //highlighted items (NULL if no highlight)
  536. EType itemsType[2];
  537. EMarketMode mode;//0 - res<->res; 1 - res<->plauer; 2 - buy artifact; 3 - sell artifact
  538. AdventureMapButton *ok, *max, *deal;
  539. CSlider *slider; //for choosing amount to be exchanged
  540. bool readyToTrade;
  541. CTradeWindow(const IMarket *Market, const CGHeroInstance *Hero, EMarketMode Mode); //c
  542. void showAll(SDL_Surface * to);
  543. void initSubs(bool Left);
  544. void initTypes();
  545. void initItems(bool Left);
  546. std::vector<int> *getItemsIds(bool Left); //NULL if default
  547. void getPositionsFor(std::vector<Rect> &poss, bool Left, EType type) const;
  548. void removeItems(const std::set<CTradeableItem *> &toRemove);
  549. void removeItem(CTradeableItem * t);
  550. void getEmptySlots(std::set<CTradeableItem *> &toRemove);
  551. void setMode(EMarketMode Mode); //mode setter
  552. virtual void getBaseForPositions(EType type, int &dx, int &dy, int &x, int &y, int &h, int &w, bool Right, int &leftToRightOffset) const = 0;
  553. virtual void selectionChanged(bool side) = 0; //true == left
  554. virtual Point selectionOffset(bool Left) const = 0;
  555. virtual std::string selectionSubtitle(bool Left) const = 0;
  556. virtual void garrisonChanged() = 0;
  557. virtual void artifactsChanged(bool left) = 0;
  558. };
  559. class CMarketplaceWindow : public CTradeWindow
  560. {
  561. bool printButtonFor(EMarketMode M) const;
  562. public:
  563. int r1, r2; //suggested amounts of traded resources
  564. bool madeTransaction; //if player made at least one transaction
  565. CTextBox *traderText;
  566. void setMax();
  567. void sliderMoved(int to);
  568. void makeDeal();
  569. void selectionChanged(bool side); //true == left
  570. CMarketplaceWindow(const IMarket *Market, const CGHeroInstance *Hero = NULL, EMarketMode Mode = RESOURCE_RESOURCE); //c-tor
  571. ~CMarketplaceWindow(); //d-tor
  572. Point selectionOffset(bool Left) const;
  573. std::string selectionSubtitle(bool Left) const;
  574. void garrisonChanged(); //removes creatures with count 0 from the list (apparently whole stack has been sold)
  575. void artifactsChanged(bool left);
  576. void resourceChanged(int type, int val);
  577. void getBaseForPositions(EType type, int &dx, int &dy, int &x, int &y, int &h, int &w, bool Right, int &leftToRightOffset) const;
  578. void updateTraderText();
  579. };
  580. class CAltarWindow : public CTradeWindow
  581. {
  582. public:
  583. CAltarWindow(const IMarket *Market, const CGHeroInstance *Hero, EMarketMode Mode); //c-tor
  584. void getExpValues();
  585. ~CAltarWindow(); //d-tor
  586. std::vector<int> sacrificedUnits, //[slot_nr] -> how many creatures from that slot will be sacrificed
  587. expPerUnit;
  588. AdventureMapButton *sacrificeAll, *sacrificeBackpack;
  589. CLabel *expToLevel, *expOnAltar;
  590. void selectionChanged(bool side); //true == left
  591. void SacrificeAll();
  592. void SacrificeBackpack();
  593. void putOnAltar(int backpackIndex);
  594. bool putOnAltar(CTradeableItem* altarSlot, int artID);
  595. void makeDeal();
  596. void showAll(SDL_Surface * to);
  597. void blockTrade();
  598. void sliderMoved(int to);
  599. void getBaseForPositions(EType type, int &dx, int &dy, int &x, int &y, int &h, int &w, bool Right, int &leftToRightOffset) const;
  600. void mimicCres();
  601. Point selectionOffset(bool Left) const;
  602. std::string selectionSubtitle(bool Left) const;
  603. void garrisonChanged();
  604. void artifactsChanged(bool left);
  605. void calcTotalExp();
  606. void setExpToLevel();
  607. void updateRight(CTradeableItem *toUpdate);
  608. void artifactPicked();
  609. int firstFreeSlot();
  610. void moveFromSlotToAltar(int slotID, CTradeableItem* altarSlot, int artID);
  611. };
  612. class CSystemOptionsWindow : public CIntObject
  613. {
  614. private:
  615. SDL_Surface * background; //background of window
  616. AdventureMapButton *load, *save, *restart, *mainMenu, *quitGame, *backToMap; //load and restart are not used yet
  617. CHighlightableButtonsGroup * heroMoveSpeed;
  618. CHighlightableButtonsGroup * mapScrollSpeed;
  619. CHighlightableButtonsGroup * musicVolume, * effectsVolume;
  620. public:
  621. CSystemOptionsWindow(const SDL_Rect & pos, CPlayerInterface * owner); //c-tor
  622. ~CSystemOptionsWindow(); //d-tor
  623. //functions bound to buttons
  624. void bsavef(); //save game
  625. void bquitf(); //quit game
  626. void breturnf(); //return to game
  627. void bmainmenuf(); //return to main menu
  628. void pushSDLEvent(int type, int usercode);
  629. void activate();
  630. void deactivate();
  631. void show(SDL_Surface * to);
  632. };
  633. class CTavernWindow : public CIntObject
  634. {
  635. public:
  636. class HeroPortrait : public CIntObject
  637. {
  638. public:
  639. std::string hoverName;
  640. vstd::assigner<int,int> as;
  641. const CGHeroInstance *h;
  642. char descr[100]; // "XXX is a level Y ZZZ with N artifacts"
  643. void clickLeft(tribool down, bool previousState);
  644. void clickRight(tribool down, bool previousState);
  645. void hover (bool on);
  646. HeroPortrait(int &sel, int id, int x, int y, const CGHeroInstance *H);
  647. void show(SDL_Surface * to);
  648. } *h1, *h2; //recruitable heroes
  649. CPicture *bg; //background
  650. CGStatusBar *bar; //tavern's internal status bar
  651. int selected;//0 (left) or 1 (right)
  652. int oldSelected;//0 (left) or 1 (right)
  653. AdventureMapButton *thiefGuild, *cancel, *recruit;
  654. const CGObjectInstance *tavernObj;
  655. CTavernWindow(const CGObjectInstance *TavernObj); //c-tor
  656. ~CTavernWindow(); //d-tor
  657. void recruitb();
  658. void close();
  659. void thievesguildb();
  660. void show(SDL_Surface * to);
  661. };
  662. class CInGameConsole : public CIntObject
  663. {
  664. private:
  665. std::list< std::pair< std::string, int > > texts; //<text to show, time of add>
  666. boost::mutex texts_mx; // protects texts
  667. std::vector< std::string > previouslyEntered; //previously entered texts, for up/down arrows to work
  668. int prevEntDisp; //displayed entry from previouslyEntered - if none it's -1
  669. int defaultTimeout; //timeout for new texts (in ms)
  670. int maxDisplayedTexts; //hiw many texts can be displayed simultaneously
  671. public:
  672. std::string enteredText;
  673. void activate();
  674. void deactivate();
  675. void show(SDL_Surface * to);
  676. void print(const std::string &txt);
  677. void keyPressed (const SDL_KeyboardEvent & key); //call-in
  678. void startEnteringText();
  679. void endEnteringText(bool printEnteredText);
  680. void refreshEnteredText();
  681. CInGameConsole(); //c-tor
  682. };
  683. class HoverableArea: public virtual CIntObject
  684. {
  685. public:
  686. std::string hoverText;
  687. virtual void hover (bool on);
  688. HoverableArea();
  689. virtual ~HoverableArea();
  690. };
  691. class LRClickableAreaWText: public HoverableArea
  692. {
  693. public:
  694. std::string text;
  695. LRClickableAreaWText();
  696. LRClickableAreaWText(const Rect &Pos, const std::string &HoverText = "", const std::string &ClickText = "");
  697. virtual ~LRClickableAreaWText();
  698. void init();
  699. virtual void clickLeft(tribool down, bool previousState);
  700. virtual void clickRight(tribool down, bool previousState);
  701. };
  702. class LRClickableAreaWTextComp: public LRClickableAreaWText
  703. {
  704. public:
  705. int baseType;
  706. int bonusValue, type;
  707. virtual void clickLeft(tribool down, bool previousState);
  708. LRClickableAreaWTextComp(const Rect &Pos = Rect(0,0,0,0), int BaseType = -1);
  709. };
  710. class MoraleLuckBox : public LRClickableAreaWTextComp
  711. {
  712. public:
  713. bool morale; //true if morale, false if luck
  714. void set(const CBonusSystemNode *node);
  715. void showAll(SDL_Surface * to);
  716. MoraleLuckBox(bool Morale, const Rect &r);
  717. ~MoraleLuckBox();
  718. };
  719. class CHeroArea: public CIntObject
  720. {
  721. public:
  722. const CGHeroInstance * hero;
  723. CHeroArea(int x, int y, const CGHeroInstance * _hero);
  724. void clickLeft(tribool down, bool previousState);
  725. void clickRight(tribool down, bool previousState);
  726. void hover(bool on);
  727. void showAll(SDL_Surface * to);
  728. };
  729. class LRClickableAreaOpenTown: public LRClickableAreaWTextComp
  730. {
  731. public:
  732. const CGTownInstance * town;
  733. void clickLeft(tribool down, bool previousState);
  734. void clickRight(tribool down, bool previousState);
  735. LRClickableAreaOpenTown();
  736. };
  737. class CCreInfoWindow : public CIntObject
  738. {
  739. public:
  740. //bool active; //TODO: comment me
  741. int type;//0 - rclick popup; 1 - normal window
  742. CPicture *bitmap; //background
  743. std::string count; //creature count in text format
  744. boost::function<void()> dsm; //dismiss button callback
  745. CCreaturePic *anim; //related creature's animation
  746. const CCreature *c; //related creature
  747. std::vector<SComponent*> upgResCost; //cost of upgrade (if not possible then empty)
  748. MoraleLuckBox *luck, *morale;
  749. AdventureMapButton *dismiss, *upgrade, *ok;
  750. CCreInfoWindow(const CStackInstance &st, int Type = 0, boost::function<void()> Upg = 0, boost::function<void()> Dsm = 0, UpgradeInfo *ui = NULL); //c-tor
  751. CCreInfoWindow(const CStack &st, int Type = 0); //c-tor
  752. CCreInfoWindow(int Cid, int Type, int creatureCount); //c-tor
  753. void init(const CCreature *cre, const CBonusSystemNode *stackNode, const CGHeroInstance *heroOwner, int creatureCount);
  754. void printLine(int nr, const std::string &text, int baseVal, int val=-1, bool range=false);
  755. ~CCreInfoWindow(); //d-tor
  756. void activate();
  757. void close();
  758. void clickRight(tribool down, bool previousState); //call-in
  759. void dismissF();
  760. void keyPressed (const SDL_KeyboardEvent & key); //call-in
  761. void deactivate();
  762. void show(SDL_Surface * to);
  763. };
  764. namespace Arts
  765. {
  766. enum EPos
  767. {
  768. PRE_FIRST = -1,
  769. HEAD, SHOULDERS, NECK, RIGHT_HAND, LEFT_HAND, TORSO, RIGHT_RING, LEFT_RING, FEET, MISC1, MISC2, MISC3, MISC4,
  770. MACH1, MACH2, MACH3, MACH4, SPELLBOOK, MISC5,
  771. AFTER_LAST
  772. };
  773. }
  774. class CArtPlace: public LRClickableAreaWTextComp
  775. {
  776. public:
  777. int slotID; //0 head 1 shoulders 2 neck 3 right hand 4 left hand 5 torso 6 right ring 7 left ring 8 feet 9 misc. slot 1 10 misc. slot 2 11 misc. slot 3 12 misc. slot 4 13 ballista (war machine 1) 14 ammo cart (war machine 2) 15 first aid tent (war machine 3) 16 catapult 17 spell book 18 misc. slot 5 19+ backpack slots
  778. bool marked;
  779. bool selectedNo;
  780. CArtifactsOfHero * ourOwner;
  781. const CArtifact * ourArt;
  782. CArtPlace(const CArtifact * Art); //c-tor
  783. void clickLeft(tribool down, bool previousState);
  784. void clickRight(tribool down, bool previousState);
  785. void select ();
  786. void deselect ();
  787. void activate();
  788. void deactivate();
  789. void showAll(SDL_Surface * to);
  790. bool fitsHere (const CArtifact * art) const; //returns true if given artifact can be placed here
  791. bool locked () const;
  792. void userSelectedNo ();
  793. ~CArtPlace(); //d-tor
  794. };
  795. class CArtifactsOfHero : public CIntObject
  796. {
  797. CGHeroInstance * curHero; //local copy of hero on which we operate
  798. std::vector<CArtPlace *> artWorn; // 0 - head; 1 - shoulders; 2 - neck; 3 - right hand; 4 - left hand; 5 - torso; 6 - right ring; 7 - left ring; 8 - feet; 9 - misc1; 10 - misc2; 11 - misc3; 12 - misc4; 13 - mach1; 14 - mach2; 15 - mach3; 16 - mach4; 17 - spellbook; 18 - misc5
  799. std::vector<CArtPlace *> backpack; //hero's visible backpack (only 5 elements!)
  800. int backpackPos; //number of first art visible in backpack (in hero's vector)
  801. public:
  802. struct SCommonPart
  803. {
  804. std::set<CArtifactsOfHero *> participants; // Needed to mark slots.
  805. const CArtifact * srcArtifact; // Held artifact.
  806. const CArtifactsOfHero * srcAOH; // Following two needed to uniquely identify the source.
  807. int srcSlotID; //
  808. const CArtifactsOfHero * destAOH; // For swapping. (i.e. changing what is held)
  809. int destSlotID; // Needed to determine what kind of action was last taken in setHero
  810. const CArtifact * destArtifact; // For swapping.
  811. void reset();
  812. } * commonInfo; //when we have more than one CArtifactsOfHero in one window with exchange possibility, we use this (eg. in exchange window); to be provided externally
  813. bool updateState; // Whether the commonInfo should be updated on setHero or not.
  814. AdventureMapButton * leftArtRoll, * rightArtRoll;
  815. bool allowedAssembling;
  816. std::multiset<int> artifactsOnAltar; //artifacts id that are technically present in backpack but in GUI are moved to the altar - they'll be ommited in backpack slots
  817. void setHero(const CGHeroInstance * hero);
  818. void dispose(); //free resources not needed after closing windows and reset state
  819. void scrollBackpack(int dir); //dir==-1 => to left; dir==1 => to right
  820. void safeRedraw();
  821. void markPossibleSlots (const CArtifact* art);
  822. void unmarkSlots(bool withRedraw = true);
  823. void setSlotData (CArtPlace* artPlace, int slotID);
  824. void eraseSlotData (CArtPlace* artPlace, int slotID);
  825. CArtifactsOfHero(const Point& position, bool createCommonPart = false); //c-tor
  826. ~CArtifactsOfHero(); //d-tor
  827. void updateParentWindow();
  828. friend class CArtPlace;
  829. };
  830. class CGarrisonWindow : public CWindowWithGarrison
  831. {
  832. public:
  833. SDL_Surface *bg; //background surface
  834. AdventureMapButton *quit;
  835. void close();
  836. void activate();
  837. void deactivate();
  838. void show(SDL_Surface * to);
  839. void showAll(SDL_Surface * to){show(to);};
  840. CGarrisonWindow(const CArmedInstance *up, const CGHeroInstance *down, bool removableUnits); //c-tor
  841. ~CGarrisonWindow(); //d-tor
  842. };
  843. class CExchangeWindow : public CWindowWithGarrison
  844. {
  845. CStatusBar * ourBar; //internal statusbar
  846. SDL_Surface *bg; //background
  847. AdventureMapButton * quit, * questlogButton[2];
  848. std::vector<LRClickableAreaWTextComp *> secSkillAreas[2], primSkillAreas;
  849. MoraleLuckBox *morale[2], *luck[2];
  850. LRClickableAreaWText *speciality[2];
  851. LRClickableAreaWText *experience[2];
  852. LRClickableAreaWText *spellPoints[2];
  853. CHeroArea *portrait[2];
  854. public:
  855. const CGHeroInstance * heroInst[2];
  856. CArtifactsOfHero * artifs[2];
  857. void close();
  858. void activate();
  859. void deactivate();
  860. void show(SDL_Surface * to);
  861. void questlog(int whichHero); //questlog button callback; whichHero: 0 - left, 1 - right
  862. void prepareBackground(); //prepares or redraws bg
  863. CExchangeWindow(si32 hero1, si32 hero2); //c-tor
  864. ~CExchangeWindow(); //d-tor
  865. };
  866. class CShipyardWindow : public CIntObject
  867. {
  868. public:
  869. CStatusBar *bar;
  870. SDL_Surface *bg; //background
  871. AdventureMapButton *build, *quit;
  872. unsigned char frame; //frame of the boat animation
  873. int boat; //which boat graphic should be used
  874. void activate();
  875. void deactivate();
  876. void show(SDL_Surface * to);
  877. CShipyardWindow(const std::vector<si32> &cost, int state, int boatType, const boost::function<void()> &onBuy);
  878. ~CShipyardWindow();
  879. };
  880. class CPuzzleWindow : public CIntObject
  881. {
  882. private:
  883. SDL_Surface * background;
  884. AdventureMapButton * quitb;
  885. CResDataBar * resdatabar;
  886. std::vector<std::pair<SDL_Surface *, SPuzzleInfo *> > puzzlesToPullBack;
  887. ui8 animCount;
  888. public:
  889. void activate();
  890. void deactivate();
  891. void show(SDL_Surface * to);
  892. CPuzzleWindow(const int3 &grailPos, float discoveredRatio);
  893. ~CPuzzleWindow();
  894. };
  895. class CTransformerWindow : public CIntObject
  896. {
  897. public:
  898. class CItem : public CIntObject
  899. {
  900. public:
  901. int id;//position of creature in hero army
  902. bool left;//position of the item
  903. int size; //size of creature stack
  904. CTransformerWindow * parent;
  905. void move();
  906. void showAll(SDL_Surface * to);
  907. void clickLeft(tribool down, bool previousState);
  908. CItem(CTransformerWindow * _parent, int _size, int _id);
  909. ~CItem();
  910. };
  911. const CArmedInstance *army;//object with army for transforming (hero or town)
  912. const CGHeroInstance *hero;//only if we have hero in town
  913. const CGTownInstance *town;//market, town garrison is used if hero == NULL
  914. CPicture *bg; //background
  915. std::vector<CItem*> items;
  916. AdventureMapButton *all, *convert, *cancel;
  917. CGStatusBar *bar;
  918. void showAll(SDL_Surface * to);
  919. void makeDeal();
  920. void addAll();
  921. CTransformerWindow(const CGHeroInstance * _hero, const CGTownInstance * _town); //c-tor
  922. ~CTransformerWindow(); //d-tor
  923. };
  924. class CUniversityWindow : public CIntObject
  925. {
  926. class CItem : public CPicture
  927. {
  928. public:
  929. int ID;//id of selected skill
  930. CUniversityWindow * parent;
  931. void showAll(SDL_Surface * to);
  932. void clickLeft(tribool down, bool previousState);
  933. void clickRight(tribool down, bool previousState);
  934. void hover(bool on);
  935. int state();//0=can't learn, 1=learned, 2=can learn
  936. CItem(CUniversityWindow * _parent, int _ID, int X, int Y);
  937. };
  938. public:
  939. const CGHeroInstance *hero;
  940. const IMarket * market;
  941. CPicture * green, * yellow, * red;//colored bars near skills
  942. CPicture *bg; //background
  943. std::vector<CItem*> items;
  944. AdventureMapButton *cancel;
  945. CGStatusBar *bar;
  946. CUniversityWindow(const CGHeroInstance * _hero, const IMarket * _market); //c-tor
  947. ~CUniversityWindow(); //d-tor
  948. };
  949. class CUnivConfirmWindow : public CIntObject//Confirmation window for University
  950. {
  951. public:
  952. CUniversityWindow * parent;
  953. CPicture * bg;
  954. CGStatusBar *bar;
  955. AdventureMapButton *confirm, *cancel;
  956. CUnivConfirmWindow(CUniversityWindow * PARENT, int SKILL, bool available); //c-tor
  957. void makeDeal(int skill);
  958. };
  959. class CHillFortWindow : public CWindowWithGarrison
  960. {
  961. public:
  962. int slotsCount;//=7;
  963. CGStatusBar * bar;
  964. CDefEssential *resources;
  965. CPicture *bg; //background surface
  966. CHeroArea *heroPic;//clickable hero image
  967. AdventureMapButton *quit,//closes window
  968. *upgradeAll,//upgrade all creatures
  969. *upgrade[7];//upgrade single creature
  970. const CGObjectInstance * fort;
  971. const CGHeroInstance * hero;
  972. std::vector<int> currState;//current state of slot - to avoid calls to getState or updating buttons
  973. std::vector<std::map<int,int> > costs;// costs [slot ID] [resource ID] = resource count for upgrade
  974. std::vector<int> totalSumm; // totalSum[resource ID] = value
  975. CHillFortWindow(const CGHeroInstance *visitor, const CGObjectInstance *object); //c-tor
  976. ~CHillFortWindow(); //d-tor
  977. void activate();
  978. void showAll (SDL_Surface *to);
  979. std::string getDefForSlot(int slot);//return def name for this slot
  980. std::string getTextForSlot(int slot);//return hover text for this slot
  981. void makeDeal(int slot);//-1 for upgrading all creatures
  982. int getState(int slot); //-1 = no creature 0=can't upgrade, 1=upgraded, 2=can upgrade
  983. void updateGarrisons();//update buttons after garrison changes
  984. };
  985. class CThievesGuildWindow : public CIntObject
  986. {
  987. const CGObjectInstance * owner;
  988. CGStatusBar * statusBar;
  989. AdventureMapButton * exitb;
  990. SDL_Surface * background;
  991. CMinorResDataBar * resdatabar;
  992. public:
  993. void activate();
  994. void show(SDL_Surface * to);
  995. void bexitf();
  996. CThievesGuildWindow(const CGObjectInstance * _owner);
  997. ~CThievesGuildWindow();
  998. };
  999. #endif //__GUICLASSES_H__