diff options
Diffstat (limited to 'src/gui/widgets/playerbox.cpp')
-rw-r--r-- | src/gui/widgets/playerbox.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/gui/widgets/playerbox.cpp b/src/gui/widgets/playerbox.cpp index 57cbec6f..cc9e963e 100644 --- a/src/gui/widgets/playerbox.cpp +++ b/src/gui/widgets/playerbox.cpp @@ -22,9 +22,9 @@ #include "gui/widgets/playerbox.h" #include "animatedsprite.h" +#include "being.h" #include "configuration.h" #include "graphics.h" -#include "player.h" #include "gui/theme.h" @@ -36,8 +36,8 @@ int PlayerBox::instances = 0; float PlayerBox::mAlpha = 1.0; ImageRect PlayerBox::background; -PlayerBox::PlayerBox(const Player *player): - mPlayer(player) +PlayerBox::PlayerBox(const Being *being): + mBeing(being) { setFrameSize(2); @@ -57,7 +57,7 @@ PlayerBox::PlayerBox(const Player *player): bggridx[x], bggridy[y], bggridx[x + 1] - bggridx[x] + 1, bggridy[y + 1] - bggridy[y] + 1); - background.grid[a]->setAlpha(config.getValue("guialpha", 0.8)); + background.grid[a]->setAlpha(config.getFloatValue("guialpha")); a++; } } @@ -72,7 +72,7 @@ PlayerBox::~PlayerBox() { instances--; - mPlayer = 0; + mBeing = 0; if (instances == 0) { @@ -82,20 +82,20 @@ PlayerBox::~PlayerBox() void PlayerBox::draw(gcn::Graphics *graphics) { - if (mPlayer) + if (mBeing) { // Draw character const int bs = getFrameSize(); - const int x = getWidth() / 2 + bs; - const int y = getHeight() - bs; - mPlayer->drawSpriteAt(static_cast<Graphics*>(graphics), x, y); + const int x = getWidth() / 2 + bs - 16; + const int y = getHeight() - bs - 32; + mBeing->drawSpriteAt(static_cast<Graphics*>(graphics), x, y); } - if (config.getValue("guialpha", 0.8) != mAlpha) + if (config.getFloatValue("guialpha") != mAlpha) { for (int a = 0; a < 9; a++) { - background.grid[a]->setAlpha(config.getValue("guialpha", 0.8)); + background.grid[a]->setAlpha(config.getFloatValue("guialpha")); } } } |