Merge branch 'master' into jgrpp
# Conflicts: # src/airport_gui.cpp # src/build_vehicle_gui.cpp # src/direction_type.h # src/gfx_type.h # src/group_gui.cpp # src/misc_gui.cpp # src/rail_gui.cpp # src/road_gui.cpp # src/signs_gui.cpp # src/slope_func.h # src/smallmap_gui.cpp # src/terraform_gui.cpp # src/toolbar_gui.cpp # src/town_gui.cpp # src/town_type.h # src/vehicle_type.h # src/widget_type.h
This commit is contained in:
@@ -499,7 +499,7 @@ struct NetworkChatWindow : public Window {
|
||||
};
|
||||
|
||||
/** The widgets of the chat window. */
|
||||
static const NWidgetPart _nested_chat_window_widgets[] = {
|
||||
static constexpr NWidgetPart _nested_chat_window_widgets[] = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_GREY, WID_NC_CLOSE),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, WID_NC_BACKGROUND),
|
||||
|
@@ -81,7 +81,7 @@ void ShowContentTextfileWindow(TextfileType file_type, const ContentInfo *ci)
|
||||
}
|
||||
|
||||
/** Nested widgets for the download window. */
|
||||
static const NWidgetPart _nested_network_content_download_status_window_widgets[] = {
|
||||
static constexpr NWidgetPart _nested_network_content_download_status_window_widgets[] = {
|
||||
NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_CONTENT_DOWNLOAD_TITLE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY),
|
||||
NWidget(NWID_VERTICAL), SetPIP(0, WidgetDimensions::unscaled.vsep_wide, 0), SetPadding(WidgetDimensions::unscaled.modalpopup),
|
||||
@@ -1036,7 +1036,7 @@ void BuildContentTypeStringList()
|
||||
}
|
||||
|
||||
/** The widgets for the content list. */
|
||||
static const NWidgetPart _nested_network_content_list_widgets[] = {
|
||||
static constexpr NWidgetPart _nested_network_content_list_widgets[] = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE),
|
||||
NWidget(WWT_CAPTION, COLOUR_LIGHT_BLUE), SetDataTip(STR_CONTENT_TITLE, STR_NULL),
|
||||
|
@@ -881,7 +881,7 @@ static std::unique_ptr<NWidgetBase> MakeResizableHeader()
|
||||
return std::make_unique<NWidgetServerListHeader>();
|
||||
}
|
||||
|
||||
static const NWidgetPart _nested_network_game_widgets[] = {
|
||||
static constexpr NWidgetPart _nested_network_game_widgets[] = {
|
||||
/* TOP */
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE),
|
||||
@@ -1159,7 +1159,7 @@ struct NetworkStartServerWindow : public Window {
|
||||
}
|
||||
};
|
||||
|
||||
static const NWidgetPart _nested_network_start_server_window_widgets[] = {
|
||||
static constexpr NWidgetPart _nested_network_start_server_window_widgets[] = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE),
|
||||
NWidget(WWT_CAPTION, COLOUR_LIGHT_BLUE), SetDataTip(STR_NETWORK_START_SERVER_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
||||
@@ -1247,7 +1247,7 @@ static void ShowNetworkStartServerWindow()
|
||||
|
||||
extern void DrawCompanyIcon(CompanyID cid, int x, int y);
|
||||
|
||||
static const NWidgetPart _nested_client_list_widgets[] = {
|
||||
static constexpr NWidgetPart _nested_client_list_widgets[] = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
|
||||
NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_NETWORK_CLIENT_LIST_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
||||
@@ -2204,7 +2204,7 @@ struct NetworkJoinStatusWindow : Window {
|
||||
}
|
||||
};
|
||||
|
||||
static const NWidgetPart _nested_network_join_status_window_widgets[] = {
|
||||
static constexpr NWidgetPart _nested_network_join_status_window_widgets[] = {
|
||||
NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_NETWORK_CONNECTING_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY),
|
||||
NWidget(NWID_VERTICAL), SetPIP(0, WidgetDimensions::unscaled.vsep_wide, 0), SetPadding(WidgetDimensions::unscaled.modalpopup),
|
||||
@@ -2312,7 +2312,7 @@ struct NetworkCompanyPasswordWindow : public Window {
|
||||
}
|
||||
};
|
||||
|
||||
static const NWidgetPart _nested_network_company_password_window_widgets[] = {
|
||||
static constexpr NWidgetPart _nested_network_company_password_window_widgets[] = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
|
||||
NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_COMPANY_PASSWORD_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
||||
@@ -2429,7 +2429,7 @@ struct NetworkAskRelayWindow : public Window {
|
||||
}
|
||||
};
|
||||
|
||||
static const NWidgetPart _nested_network_ask_relay_widgets[] = {
|
||||
static constexpr NWidgetPart _nested_network_ask_relay_widgets[] = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_RED),
|
||||
NWidget(WWT_CAPTION, COLOUR_RED, WID_NAR_CAPTION), SetDataTip(STR_NETWORK_ASK_RELAY_CAPTION, STR_NULL),
|
||||
@@ -2524,7 +2524,7 @@ struct NetworkAskSurveyWindow : public Window {
|
||||
}
|
||||
};
|
||||
|
||||
static const NWidgetPart _nested_network_ask_survey_widgets[] = {
|
||||
static constexpr NWidgetPart _nested_network_ask_survey_widgets[] = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
|
||||
NWidget(WWT_CAPTION, COLOUR_GREY, WID_NAS_CAPTION), SetDataTip(STR_NETWORK_ASK_SURVEY_CAPTION, STR_NULL),
|
||||
|
@@ -10,6 +10,8 @@
|
||||
#ifndef NETWORK_TYPE_H
|
||||
#define NETWORK_TYPE_H
|
||||
|
||||
#include "../core/enum_type.hpp"
|
||||
|
||||
/** How many clients can we have */
|
||||
static const uint MAX_CLIENTS = 255;
|
||||
|
||||
@@ -86,12 +88,13 @@ enum NetworkPasswordType {
|
||||
* Destination of our chat messages.
|
||||
* @warning The values of the enum items are part of the admin network API. Only append at the end.
|
||||
*/
|
||||
enum DestType {
|
||||
enum DestType : byte {
|
||||
DESTTYPE_BROADCAST, ///< Send message/notice to all clients (All)
|
||||
DESTTYPE_TEAM, ///< Send message/notice to everyone playing the same company (Team)
|
||||
DESTTYPE_CLIENT, ///< Send message/notice to only a certain client (Private)
|
||||
DESTTYPE_BROADCAST_SS, ///< Send message/notice to all clients (All), but tag the broadcast to self as a self-send
|
||||
};
|
||||
DECLARE_ENUM_AS_ADDABLE(DestType)
|
||||
|
||||
/**
|
||||
* Actions that can be used for NetworkTextMessage.
|
||||
|
Reference in New Issue
Block a user