src/toolbar_gui.cpp
changeset 11092 e4fce2b3cded
parent 11089 21dfdfd9f70a
child 11105 bbcfdef0958e
equal deleted inserted replaced
11091:6b5352725f43 11092:e4fce2b3cded
   912 
   912 
   913 	virtual void OnPaint()
   913 	virtual void OnPaint()
   914 	{
   914 	{
   915 		/* Draw brown-red toolbar bg. */
   915 		/* Draw brown-red toolbar bg. */
   916 		GfxFillRect(0, 0, this->width - 1, this->height - 1, 0xB2);
   916 		GfxFillRect(0, 0, this->width - 1, this->height - 1, 0xB2);
   917 		GfxFillRect(0, 0, this->width - 1, this->height - 1, 0xB4 | (1 << PALETTE_MODIFIER_GREYOUT));
   917 		GfxFillRect(0, 0, this->width - 1, this->height - 1, 0xB4, FILLRECT_CHECKER);
   918 
   918 
   919 		/* If spectator, disable all construction buttons
   919 		/* If spectator, disable all construction buttons
   920 		* ie : Build road, rail, ships, airports and landscaping
   920 		* ie : Build road, rail, ships, airports and landscaping
   921 		* Since enabled state is the default, just disable when needed */
   921 		* Since enabled state is the default, just disable when needed */
   922 		this->SetWidgetsDisabledState(_current_player == PLAYER_SPECTATOR, TBN_RAILS, TBN_ROADS, TBN_WATER, TBN_AIR, TBN_LANDSCAPE, WIDGET_LIST_END);
   922 		this->SetWidgetsDisabledState(_current_player == PLAYER_SPECTATOR, TBN_RAILS, TBN_ROADS, TBN_WATER, TBN_AIR, TBN_LANDSCAPE, WIDGET_LIST_END);
  1116 		this->SetWidgetDisabledState(TBSE_DATEBACKWARD, _settings_newgame.game_creation.starting_year <= MIN_YEAR);
  1116 		this->SetWidgetDisabledState(TBSE_DATEBACKWARD, _settings_newgame.game_creation.starting_year <= MIN_YEAR);
  1117 		this->SetWidgetDisabledState(TBSE_DATEFORWARD, _settings_newgame.game_creation.starting_year >= MAX_YEAR);
  1117 		this->SetWidgetDisabledState(TBSE_DATEFORWARD, _settings_newgame.game_creation.starting_year >= MAX_YEAR);
  1118 
  1118 
  1119 		/* Draw brown-red toolbar bg. */
  1119 		/* Draw brown-red toolbar bg. */
  1120 		GfxFillRect(0, 0, this->width - 1, this->height - 1, 0xB2);
  1120 		GfxFillRect(0, 0, this->width - 1, this->height - 1, 0xB2);
  1121 		GfxFillRect(0, 0, this->width - 1, this->height - 1, 0xB4 | (1 << PALETTE_MODIFIER_GREYOUT));
  1121 		GfxFillRect(0, 0, this->width - 1, this->height - 1, 0xB4, FILLRECT_CHECKER);
  1122 
  1122 
  1123 		this->DrawWidgets();
  1123 		this->DrawWidgets();
  1124 
  1124 
  1125 		SetDParam(0, ConvertYMDToDate(_settings_newgame.game_creation.starting_year, 0, 1));
  1125 		SetDParam(0, ConvertYMDToDate(_settings_newgame.game_creation.starting_year, 0, 1));
  1126 		DrawStringCenteredTruncated(this->widget[TBSE_DATEBACKWARD].right, this->widget[TBSE_DATEFORWARD].left, 6, STR_00AF, TC_FROMSTRING);
  1126 		DrawStringCenteredTruncated(this->widget[TBSE_DATEBACKWARD].right, this->widget[TBSE_DATEFORWARD].left, 6, STR_00AF, TC_FROMSTRING);