summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2011-01-04 20:53:57 +0000
committerterkhen <terkhen@openttd.org>2011-01-04 20:53:57 +0000
commit5268d03abd7f84b842457c939a9de205145da119 (patch)
treef0c9f19ec67638cdaedc66527905d81937e03ea9 /src
parent73d26d3831bb5c250cbb4d29a79dd1444c31b22c (diff)
downloadopenttd-5268d03abd7f84b842457c939a9de205145da119.tar.xz
(svn r21715) -Fix: Use the correct land colour in the owner legend.
Diffstat (limited to 'src')
-rw-r--r--src/settings.cpp1
-rw-r--r--src/smallmap_gui.cpp14
-rw-r--r--src/smallmap_gui.h1
3 files changed, 14 insertions, 2 deletions
diff --git a/src/settings.cpp b/src/settings.cpp
index b2261f36e..1ba1d3b5c 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -720,6 +720,7 @@ static bool RedrawScreen(int32 p1)
static bool RedrawSmallmap(int32 p1)
{
BuildLandLegend();
+ BuildOwnerLegend();
SetWindowClassesDirty(WC_SMALLMAP);
return true;
}
diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp
index e63c3cc10..9ff94124f 100644
--- a/src/smallmap_gui.cpp
+++ b/src/smallmap_gui.cpp
@@ -138,13 +138,14 @@ static const LegendAndColour _legend_vegetation[] = {
MKEND()
};
-static const LegendAndColour _legend_land_owners[] = {
+static LegendAndColour _legend_land_owners[] = {
MK(0xCA, STR_SMALLMAP_LEGENDA_WATER),
- MK(0x54, STR_SMALLMAP_LEGENDA_NO_OWNER),
+ MK(0x00, STR_SMALLMAP_LEGENDA_NO_OWNER), // This colour will vary depending on settings.
MK(0xB4, STR_SMALLMAP_LEGENDA_TOWNS),
MK(0x20, STR_SMALLMAP_LEGENDA_INDUSTRIES),
MKEND()
};
+
#undef MK
#undef MC
#undef MS
@@ -285,6 +286,14 @@ void BuildLandLegend()
}
}
+/**
+ * Completes the array for the owned property legend.
+ */
+void BuildOwnerLegend()
+{
+ _legend_land_owners[1].colour = _heightmap_schemes[_settings_client.gui.smallmap_land_colour].default_colour;
+}
+
struct AndOr {
uint32 mor;
uint32 mand;
@@ -973,6 +982,7 @@ class SmallMapWindow : public Window {
public:
SmallMapWindow(const WindowDesc *desc, int window_number) : Window(), refresh(FORCE_REFRESH_PERIOD)
{
+ BuildOwnerLegend();
this->InitNested(desc, window_number);
this->LowerWidget(this->map_type + SM_WIDGET_CONTOUR);
diff --git a/src/smallmap_gui.h b/src/smallmap_gui.h
index 1a2bc54dd..572a17534 100644
--- a/src/smallmap_gui.h
+++ b/src/smallmap_gui.h
@@ -15,5 +15,6 @@
void BuildIndustriesLegend();
void ShowSmallMap();
void BuildLandLegend();
+void BuildOwnerLegend();
#endif /* SMALLMAP_GUI_H */