Update to 1.10.0-beta2

This commit is contained in:
dP
2020-01-06 18:49:34 +03:00
parent 599ccf0c2b
commit c7c3966eec
1366 changed files with 2926 additions and 5639 deletions

View File

@@ -1,5 +1,3 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
@@ -1885,10 +1883,9 @@ struct NetworkClientListWindow : Window {
bool CheckClientListHeight()
{
int num = 0;
const NetworkClientInfo *ci;
/* Should be replaced with a loop through all clients */
FOR_ALL_CLIENT_INFOS(ci) {
for (const NetworkClientInfo *ci : NetworkClientInfo::Iterate()) {
if (ci->client_playas != COMPANY_INACTIVE_CLIENT) num++;
}
@@ -1912,8 +1909,7 @@ struct NetworkClientListWindow : Window {
this->line_height = max(this->icon_size.height + 2U, (uint)FONT_HEIGHT_NORMAL);
uint width = 100; // Default width
const NetworkClientInfo *ci;
FOR_ALL_CLIENT_INFOS(ci) {
for (const NetworkClientInfo *ci : NetworkClientInfo::Iterate()) {
width = max(width, GetStringBoundingBox(ci->client_name).width);
}
@@ -1949,8 +1945,7 @@ struct NetworkClientListWindow : Window {
uint name_right = rtl ? right - type_icon_width : right;
int i = 0;
const NetworkClientInfo *ci;
FOR_ALL_CLIENT_INFOS(ci) {
for (const NetworkClientInfo *ci : NetworkClientInfo::Iterate()) {
TextColour colour;
if (this->selected_item == i++) { // Selected item, highlight it
GfxFillRect(r.left + 1, y, r.right - 1, y + this->line_height - 1, PC_BLACK);
@@ -1978,15 +1973,14 @@ struct NetworkClientListWindow : Window {
{
/* Show the popup with option */
if (this->selected_item != -1) {
NetworkClientInfo *ci;
int client_no = this->selected_item;
FOR_ALL_CLIENT_INFOS(ci) {
if (client_no == 0) break;
for (NetworkClientInfo *ci : NetworkClientInfo::Iterate()) {
if (client_no == 0) {
PopupClientList(ci->client_id, pt.x + this->left, pt.y + this->top);
break;
}
client_no--;
}
if (ci != nullptr) PopupClientList(ci->client_id, pt.x + this->left, pt.y + this->top);
}
}