Changeset - r13683:4720c228492b
[Not reviewed]
master
0 2 0
rubidium - 15 years ago 2009-11-22 13:12:31
rubidium@openttd.org
(svn r18218) -Codechange: make a few network windows big font aware
2 files changed with 8 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/intro_gui.cpp
Show inline comments
 
@@ -230,28 +230,28 @@ static const NWidgetPart _nested_select_
 
		/* 'online content' and 'ai settings' buttons */
 
		NWidget(NWID_HORIZONTAL, NC_EQUALSIZE),
 
			NWidget(WWT_PUSHTXTBTN, COLOUR_ORANGE, SGI_CONTENT_DOWNLOAD), SetMinimalSize(158, 12),
 
								SetDataTip(STR_INTRO_ONLINE_CONTENT, STR_INTRO_TOOLTIP_ONLINE_CONTENT), SetPadding(0, 0, 0, 10), SetFill(true, false),
 
			NWidget(WWT_PUSHTXTBTN, COLOUR_ORANGE, SGI_AI_SETTINGS), SetMinimalSize(158, 12),
 
								SetDataTip(STR_INTRO_AI_SETTINGS, STR_INTRO_TOOLTIP_AI_SETTINGS), SetPadding(0, 10, 0, 0), SetFill(true, false),
 
		EndContainer(),
 

	
 
		NWidget(NWID_SPACER), SetMinimalSize(0, 6),
 

	
 
		/* 'exit program' button */
 
		NWidget(NWID_HORIZONTAL),
 
			NWidget(NWID_SPACER), SetMinimalSize(104, 0),
 
			NWidget(NWID_SPACER), SetFill(true, false),
 
			NWidget(WWT_PUSHTXTBTN, COLOUR_ORANGE, SGI_EXIT), SetMinimalSize(128, 12),
 
								SetDataTip(STR_INTRO_QUIT, STR_INTRO_TOOLTIP_QUIT),
 
			NWidget(NWID_SPACER), SetMinimalSize(104, 0),
 
			NWidget(NWID_SPACER), SetFill(true, false),
 
		EndContainer(),
 

	
 
		NWidget(NWID_SPACER), SetMinimalSize(0, 8),
 

	
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _select_game_desc(
 
	WDP_CENTER, WDP_CENTER, 336, 213,
 
	WC_SELECT_GAME, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_nested_select_game_widgets, lengthof(_nested_select_game_widgets)
src/network/network_gui.cpp
Show inline comments
 
@@ -407,24 +407,27 @@ protected:
 
			}
 

	
 
			if (nwi_header->IsWidgetVisible(NGWW_YEARS)) {
 
				/* number of years the game is running */
 
				const NWidgetCore *nwi_years = this->GetWidget<NWidgetCore>(NGWW_YEARS);
 
				YearMonthDay ymd_cur, ymd_start;
 
				ConvertDateToYMD(cur_item->info.game_date, &ymd_cur);
 
				ConvertDateToYMD(cur_item->info.start_date, &ymd_start);
 
				SetDParam(0, ymd_cur.year - ymd_start.year);
 
				DrawString(nwi_years->pos_x, nwi_years->pos_x + nwi_years->current_x - 1, y, STR_JUST_INT, TC_BLACK, SA_CENTER);
 
			}
 

	
 
			/* Align the sprites */
 
			y += (FONT_HEIGHT_NORMAL - 10) / 2;
 

	
 
			/* draw a lock if the server is password protected */
 
			if (cur_item->info.use_password) DrawSprite(SPR_LOCK, PAL_NONE, nwi_info->pos_x + 5, y - 1);
 

	
 
			/* draw red or green icon, depending on compatibility with server */
 
			DrawSprite(SPR_BLOT, (cur_item->info.compatible ? PALETTE_TO_GREEN : (cur_item->info.version_compatible ? PALETTE_TO_YELLOW : PALETTE_TO_RED)), nwi_info->pos_x + 15, y);
 

	
 
			/* draw flag according to server language */
 
			DrawSprite(SPR_FLAGS_BASE + cur_item->info.server_lang, PAL_NONE, nwi_info->pos_x + 25, y);
 
		}
 
	}
 

	
 
	/**
 
@@ -1336,27 +1339,27 @@ static const NWidgetPart _nested_network
 
		NWidget(WWT_CAPTION, COLOUR_LIGHT_BLUE, NSSW_CAPTION), SetDataTip(STR_NETWORK_START_SERVER_CAPTION, STR_NULL),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_LIGHT_BLUE, NSSW_BACKGROUND),
 
		NWidget(NWID_HORIZONTAL), SetPIP(10, 8, 10),
 
			NWidget(NWID_VERTICAL), SetPIP(10, 0, 10),
 
				/* Game name widgets */
 
				NWidget(NWID_HORIZONTAL), SetPIP(0, 2, 0),
 
					NWidget(WWT_TEXT, COLOUR_LIGHT_BLUE, NSSW_GAMENAME_LABEL), SetDataTip(STR_NETWORK_START_SERVER_NEW_GAME_NAME, STR_NULL),
 
					NWidget(WWT_EDITBOX, COLOUR_LIGHT_BLUE, NSSW_GAMENAME), SetMinimalSize(10, 12), SetFill(true, false),
 
														SetDataTip(STR_NETWORK_START_SERVER_NEW_GAME_NAME_OSKTITLE, STR_NETWORK_START_SERVER_NEW_GAME_NAME_TOOLTIP),
 
				EndContainer(),
 
				/* List of playable scenarios. */
 
				NWidget(NWID_SPACER), SetMinimalSize(0, 8),
 
				NWidget(NWID_SPACER), SetMinimalSize(0, 8), SetFill(true, false),
 
				NWidget(WWT_TEXT, COLOUR_LIGHT_BLUE, NSSW_SELECT_MAP_LABEL), SetFill(true, false), SetDataTip(STR_NETWORK_START_SERVER_SELECT_MAP, STR_NULL),
 
				NWidget(NWID_SPACER), SetMinimalSize(0, 6),
 
				NWidget(NWID_SPACER), SetMinimalSize(0, 6), SetFill(true, false),
 
				NWidget(NWID_HORIZONTAL),
 
					NWidget(WWT_PANEL, COLOUR_LIGHT_BLUE, NSSW_SELMAP), SetMinimalSize(250, 0), SetFill(true, true), SetDataTip(STR_NULL, STR_NETWORK_START_SERVER_SELECT_MAP_TOOLTIP), EndContainer(),
 
					NWidget(WWT_SCROLLBAR, COLOUR_LIGHT_BLUE, NSSW_SCROLLBAR),
 
				EndContainer(),
 
			EndContainer(),
 
			NWidget(NWID_VERTICAL), SetPIP(10, 0, 10),
 
				/* Password widgets. */
 
				NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, NSSW_SETPWD), SetFill(true, false),
 
														SetDataTip(STR_NETWORK_START_SERVER_SET_PASSWORD, STR_NETWORK_START_SERVER_PASSWORD_TOOLTIP),
 
				/* Combo/selection boxes to control Connection Type / Max Clients / Max Companies / Max Observers / Language */
 
				NWidget(NWID_SPACER), SetFill(true, true),
 
				NWidget(WWT_TEXT, COLOUR_LIGHT_BLUE, NSSW_CONNTYPE_LABEL), SetFill(true, false), SetDataTip(STR_NETWORK_SERVER_LIST_CONNECTION, STR_NULL),
 
@@ -1546,25 +1549,25 @@ struct NetworkLobbyWindow : public Windo
 
		while (pos < this->server->info.companies_on) {
 
			byte company = NetworkLobbyFindCompanyIndex(pos);
 
			bool income = false;
 
			if (this->company == company) {
 
				GfxFillRect(r.left + 1, y - 2, r.right - 1, y + FONT_HEIGHT_NORMAL, 10); // show highlighted item with a different colour
 
			}
 

	
 
			DrawString(text_left, text_right, y, this->company_info[company].company_name, TC_BLACK);
 
			if (this->company_info[company].use_password != 0) DrawSprite(SPR_LOCK, PAL_NONE, lock_left, y);
 

	
 
			/* If the company's income was positive puts a green dot else a red dot */
 
			if (this->company_info[company].income >= 0) income = true;
 
			DrawSprite(SPR_BLOT, income ? PALETTE_TO_GREEN : PALETTE_TO_RED, blob_left, y);
 
			DrawSprite(SPR_BLOT, income ? PALETTE_TO_GREEN : PALETTE_TO_RED, blob_left, y + (FONT_HEIGHT_NORMAL - 10) / 2);
 

	
 
			pos++;
 
			y += this->resize.step_height;
 
			if (pos >= this->vscroll.GetPosition() + this->vscroll.GetCapacity()) break;
 
		}
 
	}
 

	
 
	void DrawDetails(const Rect &r) const
 
	{
 
		const int detail_height = 12 + FONT_HEIGHT_NORMAL + 12;
 
		/* Draw info about selected company when it is selected in the left window */
 
		GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.top + detail_height - 1, 157);
0 comments (0 inline, 0 general)