mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r21715) -Fix: Use the correct land colour in the owner legend.
This commit is contained in:
parent
73d26d3831
commit
5268d03abd
|
@ -720,6 +720,7 @@ static bool RedrawScreen(int32 p1)
|
||||||
static bool RedrawSmallmap(int32 p1)
|
static bool RedrawSmallmap(int32 p1)
|
||||||
{
|
{
|
||||||
BuildLandLegend();
|
BuildLandLegend();
|
||||||
|
BuildOwnerLegend();
|
||||||
SetWindowClassesDirty(WC_SMALLMAP);
|
SetWindowClassesDirty(WC_SMALLMAP);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,13 +138,14 @@ static const LegendAndColour _legend_vegetation[] = {
|
||||||
MKEND()
|
MKEND()
|
||||||
};
|
};
|
||||||
|
|
||||||
static const LegendAndColour _legend_land_owners[] = {
|
static LegendAndColour _legend_land_owners[] = {
|
||||||
MK(0xCA, STR_SMALLMAP_LEGENDA_WATER),
|
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(0xB4, STR_SMALLMAP_LEGENDA_TOWNS),
|
||||||
MK(0x20, STR_SMALLMAP_LEGENDA_INDUSTRIES),
|
MK(0x20, STR_SMALLMAP_LEGENDA_INDUSTRIES),
|
||||||
MKEND()
|
MKEND()
|
||||||
};
|
};
|
||||||
|
|
||||||
#undef MK
|
#undef MK
|
||||||
#undef MC
|
#undef MC
|
||||||
#undef MS
|
#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 {
|
struct AndOr {
|
||||||
uint32 mor;
|
uint32 mor;
|
||||||
uint32 mand;
|
uint32 mand;
|
||||||
|
@ -973,6 +982,7 @@ class SmallMapWindow : public Window {
|
||||||
public:
|
public:
|
||||||
SmallMapWindow(const WindowDesc *desc, int window_number) : Window(), refresh(FORCE_REFRESH_PERIOD)
|
SmallMapWindow(const WindowDesc *desc, int window_number) : Window(), refresh(FORCE_REFRESH_PERIOD)
|
||||||
{
|
{
|
||||||
|
BuildOwnerLegend();
|
||||||
this->InitNested(desc, window_number);
|
this->InitNested(desc, window_number);
|
||||||
this->LowerWidget(this->map_type + SM_WIDGET_CONTOUR);
|
this->LowerWidget(this->map_type + SM_WIDGET_CONTOUR);
|
||||||
|
|
||||||
|
|
|
@ -15,5 +15,6 @@
|
||||||
void BuildIndustriesLegend();
|
void BuildIndustriesLegend();
|
||||||
void ShowSmallMap();
|
void ShowSmallMap();
|
||||||
void BuildLandLegend();
|
void BuildLandLegend();
|
||||||
|
void BuildOwnerLegend();
|
||||||
|
|
||||||
#endif /* SMALLMAP_GUI_H */
|
#endif /* SMALLMAP_GUI_H */
|
||||||
|
|
Loading…
Reference in New Issue