summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-07-08 23:05:26 +0300
committerAndrei Karas <akaras@inbox.ru>2012-07-13 01:02:41 +0300
commit2694837a25941c737236b68dff23aafa76954c8a (patch)
tree927b0d51cd04b64c4fd6c9d009d7a18804356237
parent36b586e32474e0d21de2383aa106869cfef89902 (diff)
downloadmanaverse-2694837a25941c737236b68dff23aafa76954c8a.tar.gz
manaverse-2694837a25941c737236b68dff23aafa76954c8a.tar.bz2
manaverse-2694837a25941c737236b68dff23aafa76954c8a.tar.xz
manaverse-2694837a25941c737236b68dff23aafa76954c8a.zip
Change playerbox theming.
-rw-r--r--data/graphics/gui/CMakeLists.txt4
-rw-r--r--data/graphics/gui/Makefile.am4
-rw-r--r--data/graphics/gui/playerbox_background.xml18
-rw-r--r--src/gui/widgets/playerbox.cpp33
4 files changed, 29 insertions, 30 deletions
diff --git a/data/graphics/gui/CMakeLists.txt b/data/graphics/gui/CMakeLists.txt
index 67c1352d7..89c51478f 100644
--- a/data/graphics/gui/CMakeLists.txt
+++ b/data/graphics/gui/CMakeLists.txt
@@ -1,6 +1,9 @@
SET (FILES
bubble.png
button.xml
+ button_disabled.xml
+ button_highlighted.xml
+ button_pressed.xml
buttonplay.png
checkbox.png
circle-gray.png
@@ -11,6 +14,7 @@ SET (FILES
equipmentbox.png
item_shortcut_bgr.png
mouse.png
+ playerbox_background.xml
progress-indicator.png
radioin.png
radioin_highlight.png
diff --git a/data/graphics/gui/Makefile.am b/data/graphics/gui/Makefile.am
index e59e2d79a..4bebd6b4f 100644
--- a/data/graphics/gui/Makefile.am
+++ b/data/graphics/gui/Makefile.am
@@ -4,6 +4,9 @@ guidir = $(pkgdatadir)/data/graphics/gui
gui_DATA = \
bubble.png \
button.xml \
+ button_disabled.xml \
+ button_highlighted.xml \
+ button_pressed.xml \
buttonplay.png \
checkbox.png \
circle-gray.png \
@@ -14,6 +17,7 @@ gui_DATA = \
equipmentbox.png \
item_shortcut_bgr.png \
mouse.png \
+ playerbox_background.xml \
progress-indicator.png \
radioin.png \
radioin_highlight.png \
diff --git a/data/graphics/gui/playerbox_background.xml b/data/graphics/gui/playerbox_background.xml
new file mode 100644
index 000000000..4a63cf25c
--- /dev/null
+++ b/data/graphics/gui/playerbox_background.xml
@@ -0,0 +1,18 @@
+<skinset name="Default" image="window.png">
+ <widget type="Window" xpos="41" ypos="186">
+ <!-- Top Row -->
+ <part type="top-left-corner" xpos="0" ypos="0" width="4" height="4" />
+ <part type="top-edge" xpos="3" ypos="0" width="26" height="4" />
+ <part type="top-right-corner" xpos="28" ypos="0" width="4" height="4" />
+
+ <!-- Middle Row -->
+ <part type="left-edge" xpos="0" ypos="3" width="4" height="26" />
+ <part type="bg-quad" xpos="3" ypos="3" width="26" height="26" />
+ <part type="right-edge" xpos="28" ypos="3" width="4" height="26" />
+
+ <!-- Bottom Row -->
+ <part type="bottom-left-corner" xpos="0" ypos="28" width="4" height="4" />
+ <part type="bottom-edge" xpos="3" ypos="28" width="26" height="4" />
+ <part type="bottom-right-corner" xpos="28" ypos="28" width="4" height="4" />
+ </widget>
+</skinset>
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<Image*>());
}
void PlayerBox::draw(gcn::Graphics *graphics)