ScummVM API documentation
bark_gump.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef ULTIMA8_GUMPS_BARKGUMP_H
23 #define ULTIMA8_GUMPS_BARKGUMP_H
24 
25 #include "ultima/shared/std/string.h"
26 #include "ultima/ultima8/gumps/item_relative_gump.h"
27 #include "ultima/ultima8/misc/classtype.h"
28 
29 namespace Ultima {
30 namespace Ultima8 {
31 
35 class BarkGump : public ItemRelativeGump {
36 protected:
37  Std::string _barked;
38  int32 _counter;
39  ObjId _textWidget;
40  uint32 _speechShapeNum;
41  uint32 _speechLength;
42  bool _subtitles;
43  bool _speechMute;
44  int _talkSpeed;
45 
46 public:
47  ENABLE_RUNTIME_CLASSTYPE()
48 
49  BarkGump();
50  BarkGump(uint16 owner, const Std::string &msg, uint32 speechShapeNum = 0);
51  ~BarkGump() override;
52 
53  // Run the gump (decrement the counter)
54  void run() override;
55 
56  // Got to the next page on mouse click
57  Gump *onMouseDown(int button, int32 mx, int32 my) override;
58 
59  // Init the gump, call after construction
60  void InitGump(Gump *newparent, bool take_focus = true) override;
61 
62  // Close the gump
63  void Close(bool no_del = false) override;
64 
66  static int dialogFontForActor(uint16 actor);
67 
68  bool loadData(Common::ReadStream *rs, uint32 version);
69  void saveData(Common::WriteStream *ws) override;
70 
71 protected:
74  bool NextText();
75  int calculateTicks();
76 };
77 
78 } // End of namespace Ultima8
79 } // End of namespace Ultima
80 
81 #endif
void InitGump(Gump *newparent, bool take_focus=true) override
void Close(bool no_del=false) override
Definition: stream.h:77
void run() override
Run the gump.
Definition: gump.h:47
Definition: detection.h:27
Definition: bark_gump.h:35
static int dialogFontForActor(uint16 actor)
Get the font that should be used from dialog from this actor.
Definition: item_relative_gump.h:34
Definition: string.h:30
Definition: stream.h:385