summaryrefslogtreecommitdiff
path: root/src/widget.cpp
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2011-12-19 21:05:14 +0000
committertruebrain <truebrain@openttd.org>2011-12-19 21:05:14 +0000
commit403cd3acdb7b7fedf2b5e823326611bb32113385 (patch)
treedff28e68ec5c8015279ea1120dc822f2896f9ace /src/widget.cpp
parent3ada3b9cc5b63a593c2b2655aafedbcbdedcd041 (diff)
downloadopenttd-403cd3acdb7b7fedf2b5e823326611bb32113385.tar.xz
(svn r23631) -Add: ScriptWindow, to manipulate windows on the client (GameScript only)
Diffstat (limited to 'src/widget.cpp')
-rw-r--r--src/widget.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/widget.cpp b/src/widget.cpp
index ad8b18064..705ee105b 100644
--- a/src/widget.cpp
+++ b/src/widget.cpp
@@ -21,6 +21,7 @@
#include "table/sprites.h"
#include "table/strings.h"
+#include "table/palettes.h"
static const char *UPARROW = "\xEE\x8A\xA0"; ///< String containing an upwards pointing arrow.
static const char *DOWNARROW = "\xEE\x8A\xAA"; ///< String containing a downwards pointing arrow.
@@ -570,6 +571,26 @@ void Window::DrawWidgets() const
if (this->flags & WF_WHITE_BORDER) {
DrawFrameRect(0, 0, this->width - 1, this->height - 1, COLOUR_WHITE, FR_BORDERONLY);
}
+
+ if (this->flags & WF_HIGHLIGHTED) {
+ extern bool _window_highlight_colour;
+ for (uint i = 0; i < this->nested_array_size; i++) {
+ const NWidgetBase *widget = this->GetWidget<NWidgetBase>(i);
+ if (widget == NULL || !widget->IsHighlighted()) continue;
+
+ int left = widget->pos_x;
+ int top = widget->pos_y;
+ int right = left + widget->current_x - 1;
+ int bottom = top + widget->current_y - 1;
+
+ int colour = _string_colourmap[_window_highlight_colour ? widget->GetHighlightColour() : TC_WHITE];
+
+ GfxFillRect(left, top, left, bottom - WD_BEVEL_BOTTOM, colour);
+ GfxFillRect(left + WD_BEVEL_LEFT, top, right - WD_BEVEL_RIGHT, top, colour);
+ GfxFillRect(right, top, right, bottom - WD_BEVEL_BOTTOM, colour);
+ GfxFillRect(left, bottom, right, bottom, colour);
+ }
+ }
}
/**