Merge branch 'master' into jgrpp
# Conflicts: # src/build_vehicle_gui.cpp # src/cheat_gui.cpp # src/company_gui.cpp # src/error_gui.cpp # src/fios_gui.cpp # src/gfx_func.h # src/graph_gui.cpp # src/group_gui.cpp # src/misc_gui.cpp # src/newgrf_debug_gui.cpp # src/order_gui.cpp # src/road_gui.cpp # src/roadveh_gui.cpp # src/settings_gui.cpp # src/ship_gui.cpp # src/station_gui.cpp # src/statusbar_gui.cpp # src/subsidy_gui.cpp # src/timetable_gui.cpp # src/town_gui.cpp # src/train_gui.cpp # src/tree_gui.cpp # src/vehicle_gui.cpp # src/widget.cpp # src/widgets/dropdown.cpp # src/window_gui.h
This commit is contained in:
@@ -571,7 +571,7 @@ public:
|
||||
}
|
||||
|
||||
case WID_NCL_MATRIX:
|
||||
resize->height = std::max(this->checkbox_size.height, (uint)FONT_HEIGHT_NORMAL) + WD_MATRIX_TOP + WD_MATRIX_BOTTOM;
|
||||
resize->height = std::max(this->checkbox_size.height, (uint)FONT_HEIGHT_NORMAL) + padding.height;
|
||||
size->height = 10 * resize->height;
|
||||
break;
|
||||
}
|
||||
@@ -614,17 +614,15 @@ public:
|
||||
*/
|
||||
void DrawMatrix(const Rect &r) const
|
||||
{
|
||||
const NWidgetBase *nwi_checkbox = this->GetWidget<NWidgetBase>(WID_NCL_CHECKBOX);
|
||||
const NWidgetBase *nwi_name = this->GetWidget<NWidgetBase>(WID_NCL_NAME);
|
||||
const NWidgetBase *nwi_type = this->GetWidget<NWidgetBase>(WID_NCL_TYPE);
|
||||
|
||||
int line_height = std::max(this->checkbox_size.height, (uint)FONT_HEIGHT_NORMAL);
|
||||
Rect checkbox = this->GetWidget<NWidgetBase>(WID_NCL_CHECKBOX)->GetCurrentRect();
|
||||
Rect name = this->GetWidget<NWidgetBase>(WID_NCL_NAME)->GetCurrentRect().Shrink(WD_FRAMERECT_LEFT, 0, WD_FRAMERECT_RIGHT, 0);
|
||||
Rect type = this->GetWidget<NWidgetBase>(WID_NCL_TYPE)->GetCurrentRect();
|
||||
|
||||
/* Fill the matrix with the information */
|
||||
int sprite_y_offset = WD_MATRIX_TOP + (line_height - this->checkbox_size.height) / 2 - 1;
|
||||
int text_y_offset = WD_MATRIX_TOP + (line_height - FONT_HEIGHT_NORMAL) / 2;
|
||||
uint y = r.top;
|
||||
int sprite_y_offset = (this->resize.step_height - this->checkbox_size.height) / 2;
|
||||
int text_y_offset = (this->resize.step_height - FONT_HEIGHT_NORMAL) / 2;
|
||||
|
||||
Rect mr = r.WithHeight(this->resize.step_height);
|
||||
auto iter = this->content.begin() + this->vscroll->GetPosition();
|
||||
size_t last = this->vscroll->GetPosition() + this->vscroll->GetCapacity();
|
||||
auto end = (last < this->content.size()) ? this->content.begin() + last : this->content.end();
|
||||
@@ -632,7 +630,7 @@ public:
|
||||
for (/**/; iter != end; iter++) {
|
||||
const ContentInfo *ci = *iter;
|
||||
|
||||
if (ci == this->selected) GfxFillRect(r.left + 1, y + 1, r.right - 1, y + this->resize.step_height - 1, PC_GREY);
|
||||
if (ci == this->selected) GfxFillRect(mr.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM), PC_GREY);
|
||||
|
||||
SpriteID sprite;
|
||||
SpriteID pal = PAL_NONE;
|
||||
@@ -644,13 +642,13 @@ public:
|
||||
case ContentInfo::DOES_NOT_EXIST: sprite = SPR_BLOT; pal = PALETTE_TO_RED; break;
|
||||
default: NOT_REACHED();
|
||||
}
|
||||
DrawSprite(sprite, pal, nwi_checkbox->pos_x + (pal == PAL_NONE ? 2 : 3), y + sprite_y_offset + (pal == PAL_NONE ? 1 : 0));
|
||||
DrawSprite(sprite, pal, checkbox.left + (sprite == SPR_BLOT ? 3 : 2), mr.top + sprite_y_offset + (sprite == SPR_BLOT ? 0 : 1));
|
||||
|
||||
StringID str = STR_CONTENT_TYPE_BASE_GRAPHICS + ci->type - CONTENT_TYPE_BASE_GRAPHICS;
|
||||
DrawString(nwi_type->pos_x, nwi_type->pos_x + nwi_type->current_x - 1, y + text_y_offset, str, TC_BLACK, SA_HOR_CENTER);
|
||||
DrawString(type.left, type.right, mr.top + text_y_offset, str, TC_BLACK, SA_HOR_CENTER);
|
||||
|
||||
DrawString(nwi_name->pos_x + WD_FRAMERECT_LEFT, nwi_name->pos_x + nwi_name->current_x - WD_FRAMERECT_RIGHT, y + text_y_offset, ci->name, TC_BLACK);
|
||||
y += this->resize.step_height;
|
||||
DrawString(name.left, name.right, mr.top + text_y_offset, ci->name, TC_BLACK);
|
||||
mr = mr.Translate(0, this->resize.step_height);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -660,60 +658,59 @@ public:
|
||||
*/
|
||||
void DrawDetails(const Rect &r) const
|
||||
{
|
||||
static const int DETAIL_LEFT = 5; ///< Number of pixels at the left
|
||||
static const int DETAIL_RIGHT = 5; ///< Number of pixels at the right
|
||||
static const int DETAIL_TOP = 5; ///< Number of pixels at the top
|
||||
|
||||
/* Height for the title banner */
|
||||
int DETAIL_TITLE_HEIGHT = 5 * FONT_HEIGHT_NORMAL;
|
||||
int HEADER_HEIGHT = 3 * FONT_HEIGHT_NORMAL + WD_FRAMETEXT_TOP + WD_FRAMETEXT_BOTTOM;
|
||||
|
||||
Rect hr = r.WithHeight(HEADER_HEIGHT).Shrink(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_BOTTOM);
|
||||
Rect tr = r.Shrink(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_BOTTOM);
|
||||
tr.top += HEADER_HEIGHT;
|
||||
|
||||
/* Create the nice grayish rectangle at the details top */
|
||||
GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.top + DETAIL_TITLE_HEIGHT, PC_DARK_BLUE);
|
||||
DrawString(r.left + WD_INSET_LEFT, r.right - WD_INSET_RIGHT, r.top + FONT_HEIGHT_NORMAL + WD_INSET_TOP, STR_CONTENT_DETAIL_TITLE, TC_FROMSTRING, SA_HOR_CENTER);
|
||||
GfxFillRect(r.WithHeight(HEADER_HEIGHT).Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, 0), PC_DARK_BLUE);
|
||||
DrawString(hr.left, hr.right, hr.top, STR_CONTENT_DETAIL_TITLE, TC_FROMSTRING, SA_HOR_CENTER);
|
||||
|
||||
/* Draw the total download size */
|
||||
SetDParam(0, this->filesize_sum);
|
||||
DrawString(r.left + DETAIL_LEFT, r.right - DETAIL_RIGHT, r.bottom - FONT_HEIGHT_NORMAL - WD_PAR_VSEP_NORMAL, STR_CONTENT_TOTAL_DOWNLOAD_SIZE);
|
||||
DrawString(tr.left, tr.right, tr.bottom - FONT_HEIGHT_NORMAL + 1, STR_CONTENT_TOTAL_DOWNLOAD_SIZE);
|
||||
|
||||
if (this->selected == nullptr) return;
|
||||
|
||||
/* And fill the rest of the details when there's information to place there */
|
||||
DrawStringMultiLine(r.left + WD_INSET_LEFT, r.right - WD_INSET_RIGHT, r.top + DETAIL_TITLE_HEIGHT / 2, r.top + DETAIL_TITLE_HEIGHT, STR_CONTENT_DETAIL_SUBTITLE_UNSELECTED + this->selected->state, TC_FROMSTRING, SA_CENTER);
|
||||
DrawStringMultiLine(hr.left, hr.right, hr.top + FONT_HEIGHT_NORMAL, hr.bottom, STR_CONTENT_DETAIL_SUBTITLE_UNSELECTED + this->selected->state, TC_FROMSTRING, SA_CENTER);
|
||||
|
||||
/* Also show the total download size, so keep some space from the bottom */
|
||||
const uint max_y = r.bottom - FONT_HEIGHT_NORMAL - WD_PAR_VSEP_WIDE;
|
||||
int y = r.top + DETAIL_TITLE_HEIGHT + DETAIL_TOP;
|
||||
tr.bottom -= FONT_HEIGHT_NORMAL + WD_PAR_VSEP_WIDE;
|
||||
|
||||
if (this->selected->upgrade) {
|
||||
SetDParam(0, STR_CONTENT_TYPE_BASE_GRAPHICS + this->selected->type - CONTENT_TYPE_BASE_GRAPHICS);
|
||||
y = DrawStringMultiLine(r.left + DETAIL_LEFT, r.right - DETAIL_RIGHT, y, max_y, STR_CONTENT_DETAIL_UPDATE);
|
||||
y += WD_PAR_VSEP_WIDE;
|
||||
tr.top = DrawStringMultiLine(tr, STR_CONTENT_DETAIL_UPDATE);
|
||||
tr.top += WD_PAR_VSEP_WIDE;
|
||||
}
|
||||
|
||||
SetDParamStr(0, this->selected->name);
|
||||
y = DrawStringMultiLine(r.left + DETAIL_LEFT, r.right - DETAIL_RIGHT, y, max_y, STR_CONTENT_DETAIL_NAME);
|
||||
tr.top = DrawStringMultiLine(tr, STR_CONTENT_DETAIL_NAME);
|
||||
|
||||
if (!this->selected->version.empty()) {
|
||||
SetDParamStr(0, this->selected->version);
|
||||
y = DrawStringMultiLine(r.left + DETAIL_LEFT, r.right - DETAIL_RIGHT, y, max_y, STR_CONTENT_DETAIL_VERSION);
|
||||
tr.top = DrawStringMultiLine(tr, STR_CONTENT_DETAIL_VERSION);
|
||||
}
|
||||
|
||||
if (!this->selected->description.empty()) {
|
||||
SetDParamStr(0, this->selected->description);
|
||||
y = DrawStringMultiLine(r.left + DETAIL_LEFT, r.right - DETAIL_RIGHT, y, max_y, STR_CONTENT_DETAIL_DESCRIPTION);
|
||||
tr.top = DrawStringMultiLine(tr, STR_CONTENT_DETAIL_DESCRIPTION);
|
||||
}
|
||||
|
||||
if (!this->selected->url.empty()) {
|
||||
SetDParamStr(0, this->selected->url);
|
||||
y = DrawStringMultiLine(r.left + DETAIL_LEFT, r.right - DETAIL_RIGHT, y, max_y, STR_CONTENT_DETAIL_URL);
|
||||
tr.top = DrawStringMultiLine(tr, STR_CONTENT_DETAIL_URL);
|
||||
}
|
||||
|
||||
SetDParam(0, STR_CONTENT_TYPE_BASE_GRAPHICS + this->selected->type - CONTENT_TYPE_BASE_GRAPHICS);
|
||||
y = DrawStringMultiLine(r.left + DETAIL_LEFT, r.right - DETAIL_RIGHT, y, max_y, STR_CONTENT_DETAIL_TYPE);
|
||||
tr.top = DrawStringMultiLine(tr, STR_CONTENT_DETAIL_TYPE);
|
||||
|
||||
y += WD_PAR_VSEP_WIDE;
|
||||
tr.top += WD_PAR_VSEP_WIDE;
|
||||
SetDParam(0, this->selected->filesize);
|
||||
y = DrawStringMultiLine(r.left + DETAIL_LEFT, r.right - DETAIL_RIGHT, y, max_y, STR_CONTENT_DETAIL_FILESIZE);
|
||||
tr.top = DrawStringMultiLine(tr, STR_CONTENT_DETAIL_FILESIZE);
|
||||
|
||||
if (!this->selected->dependencies.empty()) {
|
||||
/* List dependencies */
|
||||
@@ -731,7 +728,7 @@ public:
|
||||
}
|
||||
}
|
||||
SetDParamStr(0, buf);
|
||||
y = DrawStringMultiLine(r.left + DETAIL_LEFT, r.right - DETAIL_RIGHT, y, max_y, STR_CONTENT_DETAIL_DEPENDENCIES);
|
||||
tr.top = DrawStringMultiLine(tr, STR_CONTENT_DETAIL_DEPENDENCIES);
|
||||
}
|
||||
|
||||
if (!this->selected->tags.empty()) {
|
||||
@@ -742,7 +739,7 @@ public:
|
||||
p += seprintf(p, lastof(buf), p == buf ? "%s" : ", %s", tag.c_str());
|
||||
}
|
||||
SetDParamStr(0, buf);
|
||||
y = DrawStringMultiLine(r.left + DETAIL_LEFT, r.right - DETAIL_RIGHT, y, max_y, STR_CONTENT_DETAIL_TAGS);
|
||||
tr.top = DrawStringMultiLine(tr, STR_CONTENT_DETAIL_TAGS);
|
||||
}
|
||||
|
||||
if (this->selected->IsSelected()) {
|
||||
@@ -759,7 +756,7 @@ public:
|
||||
}
|
||||
if (p != buf) {
|
||||
SetDParamStr(0, buf);
|
||||
y = DrawStringMultiLine(r.left + DETAIL_LEFT, r.right - DETAIL_RIGHT, y, max_y, STR_CONTENT_DETAIL_SELECTED_BECAUSE_OF);
|
||||
tr.top = DrawStringMultiLine(tr, STR_CONTENT_DETAIL_SELECTED_BECAUSE_OF);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -127,7 +127,7 @@ public:
|
||||
/* First initialise some variables... */
|
||||
for (NWidgetBase *child_wid = this->head; child_wid != nullptr; child_wid = child_wid->next) {
|
||||
child_wid->SetupSmallestSize(w, init_array);
|
||||
this->smallest_y = std::max(this->smallest_y, child_wid->smallest_y + child_wid->padding_top + child_wid->padding_bottom);
|
||||
this->smallest_y = std::max(this->smallest_y, child_wid->smallest_y + child_wid->padding.Vertical());
|
||||
}
|
||||
|
||||
/* ... then in a second pass make sure the 'current' sizes are set. Won't change for most widgets. */
|
||||
@@ -647,15 +647,19 @@ public:
|
||||
{
|
||||
NetworkGameList *sel = this->server;
|
||||
|
||||
const int detail_height = 6 + 8 + 6 + 3 * FONT_HEIGHT_NORMAL;
|
||||
/* Height for the title banner */
|
||||
int HEADER_HEIGHT = 3 * FONT_HEIGHT_NORMAL + WD_FRAMETEXT_TOP + WD_FRAMETEXT_BOTTOM;
|
||||
|
||||
Rect hr = r.WithHeight(HEADER_HEIGHT).Shrink(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_BOTTOM);
|
||||
Rect tr = r.Shrink(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_BOTTOM);
|
||||
tr.top += HEADER_HEIGHT;
|
||||
|
||||
/* Draw the right menu */
|
||||
GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.top + detail_height - 1, PC_DARK_BLUE);
|
||||
/* Create the nice grayish rectangle at the details top */
|
||||
GfxFillRect(r.WithHeight(HEADER_HEIGHT).Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, 0), PC_DARK_BLUE);
|
||||
if (sel == nullptr) {
|
||||
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + 6 + 4 + FONT_HEIGHT_NORMAL, STR_NETWORK_SERVER_LIST_GAME_INFO, TC_FROMSTRING, SA_HOR_CENTER);
|
||||
DrawString(hr.left, hr.right, hr.top, STR_NETWORK_SERVER_LIST_GAME_INFO, TC_FROMSTRING, SA_HOR_CENTER);
|
||||
} else if (sel->status != NGLS_ONLINE) {
|
||||
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + 6 + 4 + FONT_HEIGHT_NORMAL, sel->info.server_name, TC_ORANGE, SA_HOR_CENTER); // game name
|
||||
|
||||
StringID message = INVALID_STRING_ID;
|
||||
switch (sel->status) {
|
||||
case NGLS_OFFLINE: message = STR_NETWORK_SERVER_LIST_SERVER_OFFLINE; break;
|
||||
@@ -666,63 +670,63 @@ public:
|
||||
/* Handled by the if-case above. */
|
||||
case NGLS_ONLINE: NOT_REACHED();
|
||||
}
|
||||
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + detail_height + 4, message, TC_FROMSTRING, SA_HOR_CENTER); // server offline
|
||||
|
||||
DrawString(hr.left, hr.right, hr.top, message, TC_FROMSTRING, SA_HOR_CENTER); // server offline
|
||||
DrawStringMultiLine(hr.left, hr.right, hr.top + FONT_HEIGHT_NORMAL, hr.bottom, sel->info.server_name, TC_ORANGE, SA_HOR_CENTER); // game name
|
||||
DrawString(tr.left, tr.right, tr.top, message, TC_FROMSTRING, SA_HOR_CENTER); // server offline
|
||||
} else { // show game info
|
||||
|
||||
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + 6, STR_NETWORK_SERVER_LIST_GAME_INFO, TC_FROMSTRING, SA_HOR_CENTER);
|
||||
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + 6 + 4 + FONT_HEIGHT_NORMAL, sel->info.server_name, TC_ORANGE, SA_HOR_CENTER); // game name
|
||||
|
||||
uint16 y = r.top + detail_height + 4;
|
||||
DrawString(hr.left, hr.right, hr.top, STR_NETWORK_SERVER_LIST_GAME_INFO, TC_FROMSTRING, SA_HOR_CENTER);
|
||||
DrawStringMultiLine(hr.left, hr.right, hr.top + FONT_HEIGHT_NORMAL, hr.bottom, sel->info.server_name, TC_ORANGE, SA_HOR_CENTER); // game name
|
||||
|
||||
SetDParam(0, sel->info.clients_on);
|
||||
SetDParam(1, sel->info.clients_max);
|
||||
SetDParam(2, sel->info.companies_on);
|
||||
SetDParam(3, sel->info.companies_max);
|
||||
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_NETWORK_SERVER_LIST_CLIENTS);
|
||||
y += FONT_HEIGHT_NORMAL;
|
||||
DrawString(tr, STR_NETWORK_SERVER_LIST_CLIENTS);
|
||||
tr.top += FONT_HEIGHT_NORMAL;
|
||||
|
||||
SetDParam(0, STR_CLIMATE_TEMPERATE_LANDSCAPE + sel->info.landscape);
|
||||
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_NETWORK_SERVER_LIST_LANDSCAPE); // landscape
|
||||
y += FONT_HEIGHT_NORMAL;
|
||||
DrawString(tr, STR_NETWORK_SERVER_LIST_LANDSCAPE); // landscape
|
||||
tr.top += FONT_HEIGHT_NORMAL;
|
||||
|
||||
SetDParam(0, sel->info.map_width);
|
||||
SetDParam(1, sel->info.map_height);
|
||||
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_NETWORK_SERVER_LIST_MAP_SIZE); // map size
|
||||
y += FONT_HEIGHT_NORMAL;
|
||||
DrawString(tr, STR_NETWORK_SERVER_LIST_MAP_SIZE); // map size
|
||||
tr.top += FONT_HEIGHT_NORMAL;
|
||||
|
||||
SetDParamStr(0, sel->info.server_revision);
|
||||
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_NETWORK_SERVER_LIST_SERVER_VERSION); // server version
|
||||
y += FONT_HEIGHT_NORMAL;
|
||||
DrawString(tr, STR_NETWORK_SERVER_LIST_SERVER_VERSION); // server version
|
||||
tr.top += FONT_HEIGHT_NORMAL;
|
||||
|
||||
SetDParamStr(0, sel->connection_string);
|
||||
StringID invite_or_address = StrStartsWith(sel->connection_string, "+") ? STR_NETWORK_SERVER_LIST_INVITE_CODE : STR_NETWORK_SERVER_LIST_SERVER_ADDRESS;
|
||||
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, invite_or_address); // server address / invite code
|
||||
y += FONT_HEIGHT_NORMAL;
|
||||
DrawString(tr, invite_or_address); // server address / invite code
|
||||
tr.top += FONT_HEIGHT_NORMAL;
|
||||
|
||||
SetDParam(0, sel->info.start_date);
|
||||
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_NETWORK_SERVER_LIST_START_DATE); // start date
|
||||
y += FONT_HEIGHT_NORMAL;
|
||||
DrawString(tr, STR_NETWORK_SERVER_LIST_START_DATE); // start date
|
||||
tr.top += FONT_HEIGHT_NORMAL;
|
||||
|
||||
SetDParam(0, sel->info.game_date);
|
||||
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_NETWORK_SERVER_LIST_CURRENT_DATE); // current date
|
||||
y += FONT_HEIGHT_NORMAL;
|
||||
DrawString(tr, STR_NETWORK_SERVER_LIST_CURRENT_DATE); // current date
|
||||
tr.top += FONT_HEIGHT_NORMAL;
|
||||
|
||||
if (sel->info.gamescript_version != -1) {
|
||||
SetDParamStr(0, sel->info.gamescript_name);
|
||||
SetDParam(1, sel->info.gamescript_version);
|
||||
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_NETWORK_SERVER_LIST_GAMESCRIPT); // gamescript name and version
|
||||
y += FONT_HEIGHT_NORMAL;
|
||||
tr.top = DrawStringMultiLine(tr, STR_NETWORK_SERVER_LIST_GAMESCRIPT); // gamescript name and version
|
||||
}
|
||||
|
||||
y += WD_PAR_VSEP_NORMAL;
|
||||
tr.top += WD_PAR_VSEP_WIDE;
|
||||
|
||||
if (!sel->info.compatible) {
|
||||
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, sel->info.version_compatible ? STR_NETWORK_SERVER_LIST_GRF_MISMATCH : STR_NETWORK_SERVER_LIST_VERSION_MISMATCH, TC_FROMSTRING, SA_HOR_CENTER); // server mismatch
|
||||
DrawString(tr, sel->info.version_compatible ? STR_NETWORK_SERVER_LIST_GRF_MISMATCH : STR_NETWORK_SERVER_LIST_VERSION_MISMATCH, TC_FROMSTRING, SA_HOR_CENTER); // server mismatch
|
||||
} else if (sel->info.clients_on == sel->info.clients_max) {
|
||||
/* Show: server full, when clients_on == max_clients */
|
||||
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_NETWORK_SERVER_LIST_SERVER_FULL, TC_FROMSTRING, SA_HOR_CENTER); // server full
|
||||
DrawString(tr, STR_NETWORK_SERVER_LIST_SERVER_FULL, TC_FROMSTRING, SA_HOR_CENTER); // server full
|
||||
} else if (sel->info.use_password) {
|
||||
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_NETWORK_SERVER_LIST_PASSWORD, TC_FROMSTRING, SA_HOR_CENTER); // password warning
|
||||
DrawString(tr, STR_NETWORK_SERVER_LIST_PASSWORD, TC_FROMSTRING, SA_HOR_CENTER); // password warning
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2102,8 +2106,8 @@ public:
|
||||
uint line = 0;
|
||||
|
||||
if (this->hover_index >= 0) {
|
||||
uint offset = this->hover_index * this->line_height;
|
||||
GfxFillRect(r.left + 2, r.top + offset, r.right - 1, r.top + offset + this->line_height - 2, GREY_SCALE(9));
|
||||
Rect br = r.WithHeight(this->line_height).Translate(0, this->hover_index * this->line_height);
|
||||
GfxFillRect(br.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM), GREY_SCALE(9));
|
||||
}
|
||||
|
||||
NetworkClientInfo *own_ci = NetworkClientInfo::GetByClientID(_network_own_client_id);
|
||||
@@ -2328,8 +2332,7 @@ struct NetworkCompanyPasswordWindow : public Window {
|
||||
{
|
||||
if (widget != WID_NCP_WARNING) return;
|
||||
|
||||
DrawStringMultiLine(r.left + WD_FRAMETEXT_LEFT, r.right - WD_FRAMETEXT_RIGHT,
|
||||
r.top + WD_FRAMERECT_TOP, r.bottom - WD_FRAMERECT_BOTTOM,
|
||||
DrawStringMultiLine(r.Shrink(WD_FRAMETEXT_LEFT, WD_FRAMERECT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMERECT_BOTTOM),
|
||||
STR_WARNING_PASSWORD_SECURITY, TC_FROMSTRING, SA_CENTER);
|
||||
}
|
||||
|
||||
@@ -2429,7 +2432,7 @@ struct NetworkAskRelayWindow : public Window {
|
||||
void DrawWidget(const Rect &r, int widget) const override
|
||||
{
|
||||
if (widget == WID_NAR_TEXT) {
|
||||
DrawStringMultiLine(r.left + WD_FRAMETEXT_LEFT, r.right - WD_FRAMETEXT_RIGHT, r.top + WD_FRAMETEXT_TOP, r.bottom - WD_FRAMETEXT_BOTTOM, STR_NETWORK_ASK_RELAY_TEXT, TC_FROMSTRING, SA_CENTER);
|
||||
DrawStringMultiLine(r.Shrink(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_BOTTOM), STR_NETWORK_ASK_RELAY_TEXT, TC_FROMSTRING, SA_CENTER);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user