Merge branch 'master' into jgrpp
# Conflicts: # config.lib # projects/openttd_vs140.vcxproj # projects/openttd_vs140.vcxproj.filters # projects/openttd_vs141.vcxproj # projects/openttd_vs141.vcxproj.filters # projects/openttd_vs142.vcxproj # projects/openttd_vs142.vcxproj.filters # src/aircraft_cmd.cpp # src/base_station_base.h # src/core/pool_type.hpp # src/disaster_vehicle.cpp # src/economy.cpp # src/engine.cpp # src/group.h # src/group_cmd.cpp # src/group_gui.cpp # src/lang/english.txt # src/lang/german.txt # src/linkgraph/linkgraph_gui.cpp # src/network/network_command.cpp # src/network/network_server.cpp # src/openttd.cpp # src/order_cmd.cpp # src/road_cmd.cpp # src/saveload/afterload.cpp # src/saveload/cargopacket_sl.cpp # src/saveload/linkgraph_sl.cpp # src/saveload/order_sl.cpp # src/saveload/station_sl.cpp # src/saveload/town_sl.cpp # src/saveload/vehicle_sl.cpp # src/screenshot.cpp # src/screenshot.h # src/settings_gui.cpp # src/settings_type.h # src/smallmap_gui.cpp # src/station.cpp # src/station_cmd.cpp # src/table/settings.ini # src/toolbar_gui.cpp # src/town_cmd.cpp # src/train.h # src/train_cmd.cpp # src/train_gui.cpp # src/vehicle.cpp # src/vehicle_base.h # src/vehiclelist.cpp # src/window_type.h
This commit is contained in:
@@ -1872,10 +1872,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++;
|
||||
}
|
||||
|
||||
@@ -1899,8 +1898,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);
|
||||
}
|
||||
|
||||
@@ -1936,8 +1934,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);
|
||||
@@ -1965,15 +1962,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user