xoreos  0.0.5
moviescamp.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/common/configman.h"
26 
29 
32 
33 namespace Engines {
34 
35 namespace NWN {
36 
38  load("pre_camp_movies");
39 
40  Widget *button = 0;
41 
42  button = getWidget("NWNXP1Button");
43  if (button)
44  button->setDisabled(!ConfigMan.getBool("NWN_hasXP1"));
45  button = getWidget("NWNXP2Button");
46  if (button)
47  button->setDisabled(!ConfigMan.getBool("NWN_hasXP2"));
48  button = getWidget("NWNXP3Button");
49  if (button)
50  button->setDisabled(true);
51 
52  _base.reset(new MoviesBaseMenu(_console));
53 }
54 
56 }
57 
59  if (widget.getTag() == "CancelButton") {
60  _returnCode = 1;
61  return;
62  }
63 
64  if (widget.getTag() == "NWNButton") {
65  sub(*_base);
66  return;
67  }
68 
69  if (widget.getTag() == "NWNXP1Button") {
70  // No GUI file? Hardcoded?
71 
72  // Just play them one after another for now...
73  playVideo("xp1_intro");
74  playVideo("xp1_chap1_chap2");
75  playVideo("xp1_chap2_chap3");
76  playVideo("xp1_closing");
77  } else if (widget.getTag() == "NWNXP2Button") {
78  // No GUI file? Harcoded?
79 
80  // Just play the intro for now...
81  // (Which is the only actual video anyway, the rest is in-game cinematics)
82  playVideo("xp2_intro");
83  }
84 
85  updateMouse();
86 }
87 
88 } // End of namespace NWN
89 
90 } // End of namespace Engines
Widget * getWidget(const Common::UString &tag, bool vital=false)
Return a widget in the GUI.
Definition: gui.cpp:314
void playVideo(const Common::UString &video)
Play this video resource.
Definition: util.cpp:54
The base game movies menu.
uint32 _returnCode
The GUI&#39;s return code.
Definition: gui.h:75
The global config manager.
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: moviescamp.cpp:58
#define ConfigMan
Shortcut for accessing the config manager.
Definition: configman.h:176
A NWN GUI.
Definition: gui.h:54
const Common::UString & getTag() const
Get the widget&#39;s tag.
Definition: widget.cpp:45
The NWN base game movies menu.
Definition: moviesbase.h:35
uint32 sub(GUI &gui, uint32 startCode=kStartCodeNone, bool showSelf=true, bool hideSelf=true)
Open up a sub GUI.
Definition: gui.cpp:349
MoviesCampMenu(::Engines::Console *console=0)
Definition: moviescamp.cpp:37
void load(const Common::UString &resref)
Definition: gui.cpp:77
The campaign movies menu.
A widget in a GUI.
A widget in a GUI.
Definition: widget.h:40
void updateMouse()
Force an update of the mouse position.
Definition: gui.cpp:426
Generic Aurora engines utility functions.
Common::ScopedPtr< GUI > _base
Definition: moviescamp.h:46