Skip to content

Commit

Permalink
KOTOR: Enable rotating of the map arrow in the hud
Browse files Browse the repository at this point in the history
  • Loading branch information
Nostritius committed Aug 9, 2018
1 parent 5b8b5bf commit f35811c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/engines/kotor/gui/ingame/hud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ HUD::HUD(Module &module, Engines::Console *console)
_menu(module, console) {

update(WindowMan.getWindowWidth(), WindowMan.getWindowHeight());

_minimapPointer = getLabel("LBL_ARROW");
}

void HUD::setReturnStrref(uint32 id) {
Expand Down Expand Up @@ -234,6 +236,10 @@ void HUD::setPosition(float x, float y) {
_minimap->setPosition(x, y);
}

void HUD::setRotation(float angle) {
_minimapPointer->setRotation(angle);
}

void HUD::showContainer(Inventory &inv) {
_container.reset(new ContainerMenu());
_container->fillFromInventory(inv);
Expand Down
2 changes: 2 additions & 0 deletions src/engines/kotor/gui/ingame/hud.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class HUD : public GUI, Events::Notifyable {
float mapPt1X, float mapPt1Y, float mapPt2X, float mapPt2Y);

void setPosition(float x, float y);
void setRotation(float angle);

void showContainer(Inventory &inv);

Expand All @@ -68,6 +69,7 @@ class HUD : public GUI, Events::Notifyable {
Common::ScopedPtr<ContainerMenu> _container;

Common::ScopedPtr<Minimap> _minimap;
WidgetLabel *_minimapPointer;

void update(int width, int height);

Expand Down

0 comments on commit f35811c

Please sign in to comment.