185 { 800, 600,
"mipc28x6" },
186 { 800, 600,
"mi8x6" },
187 { 1024, 768,
"mipc210x7" },
188 { 1280, 960,
"mipc212x9" },
189 { 1280, 1024,
"mipc212x10" },
190 { 1600, 1200,
"mipc216x12" },
196 _menu(module, console) {
200 _minimapPointer = getLabel(
"LBL_ARROW");
204 _menu.setReturnStrref(
id);
207 void HUD::setReturnQueryStrref(
uint32 id) {
208 _menu.setReturnQueryStrref(
id);
211 void HUD::setReturnEnabled(
bool enabled) {
212 _menu.setReturnEnabled(enabled);
216 float worldPt1X,
float worldPt1Y,
float worldPt2X,
float worldPt2Y,
217 float mapPt1X,
float mapPt1Y,
float mapPt2X,
float mapPt2Y) {
221 warning(
"No such GUI element \"LBL_MAPVIEW\"");
227 _minimap.reset(
new Minimap(map, northAxis, mapPt1X, mapPt1Y, mapPt2X, mapPt2Y, worldPt1X, worldPt1Y, worldPt2X, worldPt2Y));
233 void HUD::setPosition(
float x,
float y) {
235 _minimap->setPosition(x, y);
238 void HUD::setRotation(
float angle) {
239 switch (_minimap->getNorthAxis()) {
241 _minimapPointer->setRotation(angle);
244 _minimapPointer->setRotation(angle - 90.0f);
253 _container->fillFromInventory(inv);
255 if (sub(*_container, kStartCodeNone,
true,
false) == 1) {
256 Inventory &partyInventory = _module->getPC()->getInventory();
258 const std::map<Common::UString, InventoryItem> &items = inv.
getItems();
259 for (std::map<Common::UString, InventoryItem>::const_iterator i = items.begin();
260 i != items.end(); ++i) {
261 partyInventory.
addItem(i->first, i->second.count);
301 setPortrait(1, creature != 0, creature ? creature->
getPortrait() :
"");
305 setPortrait(3, creature != 0, creature ? creature->
getPortrait() :
"");
309 setPortrait(2, creature != 0, creature ? creature->
getPortrait() :
"");
312 void HUD::update(
int width,
int height) {
313 std::set<Resolution> availableRes;
319 const int wWidth = width;
320 const int wHeight = height;
323 for (std::set<Resolution>::const_iterator it = availableRes.begin(); it != availableRes.end(); ++it)
324 if (it->width == wWidth && it->height == wHeight)
329 for (std::set<Resolution>::const_iterator it = availableRes.begin(); it != availableRes.end(); ++it) {
330 if ((it->width == 800) && (it->height == 600)) {
355 widget->
setPosition(-wWidth/2 + (400 + x), wHeight/2 - (300 - y), z);
359 widget->
setPosition(wWidth/2 - (400 - x), wHeight/2 - (300 - y), z);
367 widget->
setPosition(-wWidth/2 + (400 + x), -wHeight/2 + (300 + y), z);
371 widget->
setPosition(wWidth/2 - (400 - x), -wHeight/2 + (300 + y), z);
386 if (widget.
getTag() ==
"LBL_MAP")
388 if (widget.
getTag() ==
"LBL_ARROW_MARGIN")
392 if (widget.
getTag() ==
"TGuiPanel")
408 void HUD::callbackActive(
Widget &widget) {
409 if (widget.
getTag() ==
"LBL_CHAR1") {
410 _module->switchPlayerCharacter(0);
413 if (widget.
getTag() ==
"LBL_CHAR2") {
414 _module->switchPlayerCharacter(2);
417 if (widget.
getTag() ==
"LBL_CHAR3") {
418 _module->switchPlayerCharacter(1);
422 _menu.showMenu(widget.
getTag());
426 void HUD::notifyResized(
int UNUSED(oldWidth),
int UNUSED(oldHeight),
int newWidth,
int newHeight) {
427 update(newWidth, newHeight);
#define ResMan
Shortcut for accessing the sound manager.
The global graphics manager.
A label widget for Star Wars: Knights of the Old Republic and Jade Empire.
A class holding an UTF-8 string.
const Common::UString & getPortrait() const
Return the object's portrait.
UString composeString(T value)
Convert any POD integer, float/double or bool type into a string.
static const KnownWidget kKnownWidgets[]
The global window manager.
#define ARRAYSIZE(x)
Macro which determines the number of entries in a fixed size array.
Utility templates and functions for working with strings and streams.
bool contains(const UString &what) const
HUD(Module &module, ::Engines::Console *console=0)
void warning(const char *s,...)
A progressbar widget for Star Wars: Knights of the Old Republic and Jade Empire.
void addItem(const Common::UString &tag, int count=1)
#define WindowMan
Shortcut for accessing the window manager.
static const Resolution kResolution[]
size_t size() const
Return the size of the string, in characters.
#define GfxMan
Shortcut for accessing the graphics manager.
The global resource manager for Aurora resources.
bool operator<(const Resolution &x) const
const std::map< Common::UString, InventoryItem > & getItems() const