Changeset - r16969:2c7fbcf16d78
[Not reviewed]
master
0 3 0
terkhen - 13 years ago 2011-01-04 20:53:57
terkhen@openttd.org
(svn r21715) -Fix: Use the correct land colour in the owner legend.
3 files changed with 14 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/settings.cpp
Show inline comments
 
@@ -717,12 +717,13 @@ static bool RedrawScreen(int32 p1)
 
 * @param p1 Callback parameter.
 
 * @return Always true.
 
 */
 
static bool RedrawSmallmap(int32 p1)
 
{
 
	BuildLandLegend();
 
	BuildOwnerLegend();
 
	SetWindowClassesDirty(WC_SMALLMAP);
 
	return true;
 
}
 

	
 
static bool InvalidateDetailsWindow(int32 p1)
 
{
src/smallmap_gui.cpp
Show inline comments
 
@@ -135,19 +135,20 @@ static const LegendAndColour _legend_veg
 
	MK(0x98, STR_SMALLMAP_LEGENDA_SNOW),
 
	MK(0xD7, STR_SMALLMAP_LEGENDA_TRANSPORT_ROUTES),
 
	MK(0xB5, STR_SMALLMAP_LEGENDA_BUILDINGS_INDUSTRIES),
 
	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
 
#undef MKEND
 

	
 
/**
 
@@ -282,12 +283,20 @@ void BuildLandLegend()
 
{
 
	for (LegendAndColour *lc = _legend_land_contours; lc->legend == STR_TINY_BLACK_HEIGHT; lc++) {
 
		lc->colour = _heightmap_schemes[_settings_client.gui.smallmap_land_colour].height_colours[lc->u.height];
 
	}
 
}
 

	
 
/**
 
 * 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;
 
};
 

	
 
static inline uint32 ApplyMask(uint32 colour, const AndOr *mask)
 
@@ -970,12 +979,13 @@ class SmallMapWindow : public Window {
 
		_cur_dpi = old_dpi;
 
	}
 

	
 
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);
 

	
 
		_smallmap_industry_show_heightmap = false;
 
		BuildLandLegend();
 
		this->SetWidgetLoweredState(SM_WIDGET_SHOW_HEIGHT, _smallmap_industry_show_heightmap);
src/smallmap_gui.h
Show inline comments
 
@@ -12,8 +12,9 @@
 
#ifndef SMALLMAP_GUI_H
 
#define SMALLMAP_GUI_H
 

	
 
void BuildIndustriesLegend();
 
void ShowSmallMap();
 
void BuildLandLegend();
 
void BuildOwnerLegend();
 

	
 
#endif /* SMALLMAP_GUI_H */
0 comments (0 inline, 0 general)