From 7eeb04e1a8bf103e3f8717af1e3ec09f58441bd4 Mon Sep 17 00:00:00 2001 From: Mateusz Kaduk Date: Sun, 10 Apr 2005 12:11:49 +0000 Subject: Added inventory transparency --- src/gui/inventory.cpp | 3 ++- src/gui/inventory.h | 3 ++- src/gui/scrollarea.cpp | 7 +++++++ src/gui/scrollarea.h | 2 ++ 4 files changed, 13 insertions(+), 2 deletions(-) (limited to 'src') 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 #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 -- cgit v1.2.3-70-g09d2