xoreos  0.0.5
menu_map.cpp
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 
25 #include "src/aurora/talkman.h"
26 
28 
30 
32 
34 
35 namespace Engines {
36 
37 namespace KotOR {
38 
39 MenuMap::MenuMap(Console *console) : GUI(console) {
40  load("map");
41 }
42 
44  WidgetButton *btnReturn = getButton("BTN_RETURN");
45  if (btnReturn)
46  btnReturn->setText(TalkMan.getString(id));
47 }
48 
50  _returnQueryMessage = TalkMan.getString(id);
51 }
52 
53 void MenuMap::setReturnEnabled(bool enabled) {
54  WidgetButton *btnReturn = getButton("BTN_RETURN");
55  if (btnReturn)
56  btnReturn->setDisabled(!enabled);
57 }
58 
60  if (widget.getTag() == "BTN_RETURN") {
61  ConfirmDialog dialog(_console);
63 
64  sub(dialog, kStartCodeNone, true, false);
65 
66  // TODO: Return to the hideout/ebon hawk
67  }
68 
69  if (widget.getTag() == "BTN_EXIT") {
70  _returnCode = 1;
71  return;
72  }
73 }
74 
75 } // End of namespace KotOR
76 
77 } // End of namespace Engines
void load(const Common::UString &resref)
Definition: gui.cpp:103
void setReturnQueryStrref(uint32 id)
Definition: menu_map.cpp:49
#define TalkMan
Shortcut for accessing the talk manager.
Definition: talkman.h:111
uint32 _returnCode
The GUI&#39;s return code.
Definition: gui.h:75
Confirmation dialog.
A button widget for Star Wars: Knights of the Old Republic and Jade Empire.
virtual void setDisabled(bool disabled)
Disable/Enable the widget.
Definition: widget.cpp:154
Console * _console
Definition: gui.h:70
void callbackActive(Widget &widget)
Callback that&#39;s triggered when a widget was activated.
Definition: menu_map.cpp:59
WidgetButton * getButton(const Common::UString &tag, bool vital=false)
Definition: gui.cpp:228
void setReturnStrref(uint32 id)
Definition: menu_map.cpp:43
const Common::UString & getTag() const
Get the widget&#39;s tag.
Definition: widget.cpp:45
uint32 sub(GUI &gui, uint32 startCode=kStartCodeNone, bool showSelf=true, bool hideSelf=true)
Open up a sub GUI.
Definition: gui.cpp:349
Common::UString _returnQueryMessage
Definition: menu_map.h:43
MenuMap(::Engines::Console *console=0)
Definition: menu_map.cpp:39
A widget in a GUI.
void setReturnEnabled(bool enabled)
Definition: menu_map.cpp:53
A widget in a GUI.
Definition: widget.h:40
uint32_t uint32
Definition: types.h:204
The global talk manager for Aurora strings.
void setText(const Common::UString &text)
static const uint32 kStartCodeNone
Definition: gui.h:45
A KotOR GUI.
Definition: gui.h:57
void setText(const Common::UString &text)
Definition: confirm.cpp:44