xoreos  0.0.5
hud.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/graphics/windowman.h"
26 
28 
31 
32 namespace Engines {
33 
34 namespace KotOR2 {
35 
36 HUD::HUD(Module &UNUSED(module), ::Engines::Console *console) : GUI(console) {
37  load("mipc28x6_p");
38 }
39 
40 void HUD::initWidget(Widget &widget) {
42 
43  // Don't know what these two are doing, but they spawn over the complete screen blocking the 3d picking.
44  if (widget.getTag() == "LBL_MAP")
45  widget.setInvisible(true);
46  if (widget.getTag() == "LBL_ARROW_MARGIN")
47  widget.setInvisible(true);
48 
49  // Make the action stuff invisible.
50  if (widget.getTag().contains("TARGET"))
51  widget.setInvisible(true);
52  if (widget.getTag() == "LBL_NAMEBG")
53  widget.setInvisible(true);
54  if (widget.getTag() == "LBL_NAME")
55  widget.setInvisible(true);
56  if (widget.getTag().contains("HEALTH"))
57  widget.setInvisible(true);
58  if (widget.getTag().contains("ACTIONDESC"))
59  widget.setInvisible(true);
60 
61  // Make all combat related stuff invisible.
62  if (widget.getTag().contains("CMBTM") || widget.getTag().contains("COMBAT"))
63  widget.setInvisible(true);
64  if (widget.getTag().contains("CLEAR"))
65  widget.setInvisible(true);
66 
67  // Disable all portrait modifiers.
68  if (widget.getTag().contains("EFCT"))
69  widget.setInvisible(true);
70  if (widget.getTag().contains("LVLUP"))
71  widget.setInvisible(true);
72  if (widget.getTag().contains("LEVELUP"))
73  widget.setInvisible(true);
74  if (widget.getTag().contains("DISABLE"))
75  widget.setInvisible(true);
76  if (widget.getTag().contains("DEBILATATED"))
77  widget.setInvisible(true);
78 
79  // Make the event markers invisible.
80  if (widget.getTag() == "LBL_PLOTXP")
81  widget.setInvisible(true);
82  if (widget.getTag() == "LBL_STEALTHXP")
83  widget.setInvisible(true);
84  if (widget.getTag() == "LBL_CASH")
85  widget.setInvisible(true);
86  if (widget.getTag() == "LBL_JOURNAL")
87  widget.setInvisible(true);
88  if (widget.getTag() == "LBL_LIGHTSHIFT")
89  widget.setInvisible(true);
90  if (widget.getTag() == "LBL_DARKSHIFT")
91  widget.setInvisible(true);
92  if (widget.getTag() == "LBL_ITEMLOST")
93  widget.setInvisible(true);
94  if (widget.getTag() == "LBL_ITEMRCVD")
95  widget.setInvisible(true);
96 
97  // TGuiPanel needs to be disabled in order to ensure, it does not block 3d picking.
98  if (widget.getTag() == "TGuiPanel")
99  widget.setInvisible(true);
100 }
101 
102 } // End of namespace KotOR2
103 
104 } // End of namespace Engines
void load(const Common::UString &resref)
Definition: gui.cpp:103
virtual void setInvisible(bool invisible)
Make the widget invisible.
Definition: widget.cpp:168
The global window manager.
bool contains(const UString &what) const
Definition: ustring.cpp:335
#define UNUSED(x)
Definition: system.h:170
const Common::UString & getTag() const
Get the widget&#39;s tag.
Definition: widget.cpp:45
void initWidget(Widget &widget)
Definition: hud.cpp:40
The context needed to run a Star Wars: Knights of the Old Republic II - The Sith Lords module...
A widget in a GUI.
A widget in a GUI.
Definition: widget.h:40
HUD(Module &module, ::Engines::Console *console=0)
Definition: hud.cpp:36
The ingame HUD.
virtual void initWidget(Widget &widget)
Definition: gui.cpp:37