xoreos  0.0.5
dialog.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos 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 xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
26 #ifndef ENGINES_KOTOR_GUI_DIALOG_H
27 #define ENGINES_KOTOR_GUI_DIALOG_H
28 
29 #include "src/common/scopedptr.h"
30 #include "src/common/ustring.h"
31 
33 
35 
36 namespace Aurora {
37  class DLGFile;
38 }
39 
40 namespace Engines {
41 
42 namespace KotOR {
43 
44 class Module;
45 
47 public:
48  DialogGUIBase(bool k2);
49 
50  void startConversation(const Common::UString &name, Aurora::NWScript::Object *owner = 0);
51  bool isConversationActive() const;
52 
53  void show();
54  void hide();
55 
56  void callbackActive(Widget &widget);
57  void callbackKeyInput(const Events::Key &key,
58  const Events::EventType &type);
59 protected:
60  virtual void makeLookAtPC(const Common::UString &tag) = 0;
61  virtual void playDefaultAnimations(const Common::UString &tag) = 0;
62  virtual void playTalkAnimations(const Common::UString &tag) = 0;
63 private:
64  bool _kotor2;
65  bool _isActive;
68  std::vector<uint32> _replyIds;
73 
75  void update(int width, int height);
76 
77  void refresh();
78  void playSounds();
79  void stopSounds();
80  void pickReply(int index);
81 
86 
87  void notifyResized(int oldWidth, int oldHeight, int newWidth, int newHeight);
88 };
89 
90 class DialogGUI : public DialogGUIBase {
91 public:
92  DialogGUI(Module &module);
93 protected:
94  void makeLookAtPC(const Common::UString &tag);
95  void playDefaultAnimations(const Common::UString &tag);
96  void playTalkAnimations(const Common::UString &tag);
97 private:
99 };
100 
101 } // End of namespace KotOR
102 
103 } // End of namespace Engines
104 
105 #endif // ENGINES_KOTOR_GUI_DIALOG_H
void playDefaultAnimations(const Common::UString &tag)
Definition: dialog.cpp:313
void callbackKeyInput(const Events::Key &key, const Events::EventType &type)
Callback that&#39;s triggered when a key is pressed or released.
Definition: dialog.cpp:102
virtual void playTalkAnimations(const Common::UString &tag)=0
Common::UString _curSpeaker
Definition: dialog.h:72
A class holding an UTF-8 string.
Definition: ustring.h:48
void notifyResized(int oldWidth, int oldHeight, int newWidth, int newHeight)
Definition: dialog.cpp:283
void pickReply(int index)
Definition: dialog.cpp:252
Common::ScopedPtr< Sound::ChannelHandle > _voice
Definition: dialog.h:69
void eraseDeveloperNotes(Common::UString &str)
Some dialog entries in KotOR 2 contain developer notes in curly braces.
Definition: dialog.cpp:269
A simple scoped smart pointer template.
void playTalkAnimations(const Common::UString &tag)
Definition: dialog.cpp:326
DialogGUI(Module &module)
Definition: dialog.cpp:287
virtual void playDefaultAnimations(const Common::UString &tag)=0
void makeLookAtPC(const Common::UString &tag)
Definition: dialog.cpp:292
void show()
Show the GUI.
Definition: dialog.cpp:78
void callbackActive(Widget &widget)
Callback that&#39;s triggered when a widget was activated.
Definition: dialog.cpp:89
Common::ScopedPtr< Sound::ChannelHandle > _sound
Definition: dialog.h:70
void startConversation(const Common::UString &name, Aurora::NWScript::Object *owner=0)
Definition: dialog.cpp:63
virtual void makeLookAtPC(const Common::UString &tag)=0
A KotOR GUI.
Unicode string handling.
void update(int width, int height)
Updates the gui when a resize occurs or it is created.
Definition: dialog.cpp:140
A widget in a GUI.
Definition: widget.h:40
void hide()
Hide the GUI.
Definition: dialog.cpp:84
bool isConversationActive() const
Definition: dialog.cpp:74
EventType
Custom event types.
Definition: types.h:45
Key
Definition: types.h:78
A KotOR GUI.
Definition: gui.h:57
Frame for conversations/cutscenes in Star Wars: Knights of the Old Republic.
Common::UString _owner
Definition: dialog.h:71
Common::ScopedPtr< Graphics::Aurora::KotORDialogFrame > _frame
Definition: dialog.h:66
Common::ScopedPtr< Aurora::DLGFile > _dlg
Definition: dialog.h:67
std::vector< uint32 > _replyIds
Definition: dialog.h:68