From 2694837a25941c737236b68dff23aafa76954c8a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 8 Jul 2012 23:05:26 +0300 Subject: Change playerbox theming. --- src/gui/widgets/playerbox.cpp | 33 +++------------------------------ 1 file changed, 3 insertions(+), 30 deletions(-) (limited to 'src/gui') diff --git a/src/gui/widgets/playerbox.cpp b/src/gui/widgets/playerbox.cpp index 90a9c9409..d505aa27e 100644 --- a/src/gui/widgets/playerbox.cpp +++ b/src/gui/widgets/playerbox.cpp @@ -47,35 +47,11 @@ PlayerBox::PlayerBox(Being *being): if (instances == 0) { - // Load the background skin - Image *textbox = Theme::getImageFromTheme("deepbox.png"); - int bggridx[4] = {0, 3, 28, 31}; - int bggridy[4] = {0, 3, 28, 31}; - int a = 0, x, y; - - for (y = 0; y < 3; y++) + if (Theme::instance()) { - for (x = 0; x < 3; x++) - { - if (textbox) - { - background.grid[a] = textbox->getSubImage( - bggridx[x], bggridy[y], - bggridx[x + 1] - bggridx[x] + 1, - bggridy[y + 1] - bggridy[y] + 1); - if (background.grid[a]) - background.grid[a]->setAlpha(Client::getGuiAlpha()); - } - else - { - background.grid[a] = nullptr; - } - a++; - } + Theme::instance()->loadRect(background, + "playerbox_background.xml"); } - - if (textbox) - textbox->decRef(); } instances++; @@ -86,9 +62,6 @@ PlayerBox::~PlayerBox() instances--; mBeing = nullptr; - - if (instances == 0) - for_each(background.grid, background.grid + 9, dtor()); } void PlayerBox::draw(gcn::Graphics *graphics) -- cgit v1.2.3-70-g09d2