summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMateusz Kaduk <mateusz.kaduk@gmail.com>2005-04-10 12:11:49 +0000
committerMateusz Kaduk <mateusz.kaduk@gmail.com>2005-04-10 12:11:49 +0000
commit7eeb04e1a8bf103e3f8717af1e3ec09f58441bd4 (patch)
tree22d584cba391e68058c6a182fad94c8b87b99339 /src
parent74c3b49c1242ef7449fe17198270e1b99b9289e2 (diff)
downloadmana-7eeb04e1a8bf103e3f8717af1e3ec09f58441bd4.tar.gz
mana-7eeb04e1a8bf103e3f8717af1e3ec09f58441bd4.tar.bz2
mana-7eeb04e1a8bf103e3f8717af1e3ec09f58441bd4.tar.xz
mana-7eeb04e1a8bf103e3f8717af1e3ec09f58441bd4.zip
Added inventory transparency
Diffstat (limited to 'src')
-rw-r--r--src/gui/inventory.cpp3
-rw-r--r--src/gui/inventory.h3
-rw-r--r--src/gui/scrollarea.cpp7
-rw-r--r--src/gui/scrollarea.h2
4 files changed, 13 insertions, 2 deletions
diff --git a/src/gui/inventory.cpp b/src/gui/inventory.cpp
index 7bf5971f..d6851347 100644
--- a/src/gui/inventory.cpp
+++ b/src/gui/inventory.cpp
@@ -26,6 +26,7 @@
#include "../resources/resourcemanager.h"
#include "../resources/image.h"
#include "button.h"
+#include "scrollarea.h"
#include "../being.h"
#include "../engine.h"
#include "item_amount.h"
@@ -43,7 +44,7 @@ InventoryWindow::InventoryWindow():
items = new ItemContainer();
items->setPosition(2, 2);
- invenScroll = new gcn::ScrollArea(items);
+ invenScroll = new ScrollArea(items);
invenScroll->setPosition(4, 4);
useButton->setEventId("use");
diff --git a/src/gui/inventory.h b/src/gui/inventory.h
index ab65c122..f4e814f0 100644
--- a/src/gui/inventory.h
+++ b/src/gui/inventory.h
@@ -30,6 +30,7 @@
#include "itemcontainer.h"
#include "gui.h"
#include "window.h"
+#include "scrollarea.h"
/**
* Inventory dialog.
@@ -93,7 +94,7 @@ class InventoryWindow : public Window, gcn::ActionListener {
private:
gcn::Button *useButton, *dropButton;
- gcn::ScrollArea *invenScroll;
+ ScrollArea *invenScroll;
int useItem(int index, int id);
void updateWidgets();
diff --git a/src/gui/scrollarea.cpp b/src/gui/scrollarea.cpp
index ffeb9a1d..d652c94c 100644
--- a/src/gui/scrollarea.cpp
+++ b/src/gui/scrollarea.cpp
@@ -24,6 +24,7 @@
#include "scrollarea.h"
#include "gui.h"
#include "../resources/resourcemanager.h"
+#include "../main.h"
ScrollArea::ScrollArea():
gcn::ScrollArea()
@@ -48,6 +49,12 @@ void ScrollArea::init()
int bggridy[4] = {0, 4, 19, 24};
int a = 0, x, y;
+ // Load GUI alpha setting
+ guiAlpha = config.getValue("guialpha", 0.8f);
+
+ // Set GUI alpha level
+ textbox->setAlpha(guiAlpha);
+
for (y = 0; y < 3; y++) {
for (x = 0; x < 3; x++) {
background.grid[a] = textbox->getSubImage(
diff --git a/src/gui/scrollarea.h b/src/gui/scrollarea.h
index 304e5b89..27f14372 100644
--- a/src/gui/scrollarea.h
+++ b/src/gui/scrollarea.h
@@ -26,6 +26,7 @@
#include <guichan.hpp>
#include "../graphics.h"
+#include "../configuration.h"
/**
* A scroll area.
@@ -71,6 +72,7 @@ class ScrollArea : public gcn::ScrollArea {
ImageRect background;
ImageRect vMarker;
+ float guiAlpha;
};
#endif