|
OpenTTD
|
Implementation of the Network related GUIs. More...
#include "../stdafx.h"#include "../strings_func.h"#include "../date_func.h"#include "../fios.h"#include "network_client.h"#include "network_gui.h"#include "network_gamelist.h"#include "network.h"#include "network_base.h"#include "network_content.h"#include "../gui.h"#include "network_udp.h"#include "../window_func.h"#include "../gfx_func.h"#include "../widgets/dropdown_func.h"#include "../querystring_gui.h"#include "../sortlist_type.h"#include "../company_func.h"#include "../core/geometry_func.hpp"#include "../genworld.h"#include "../map_type.h"#include "../widgets/network_widget.h"#include "table/strings.h"#include "../table/sprites.h"#include "../stringfilter_type.h"#include "../safeguards.h"Go to the source code of this file.
Data Structures | |
| class | NWidgetServerListHeader |
| Full blown container to make it behave exactly as we want :) More... | |
| class | NetworkGameWindow |
| struct | NetworkStartServerWindow |
| struct | NetworkLobbyWindow |
| struct | NetworkClientListPopupWindow |
| Popup selection window to chose an action to perform. More... | |
| struct | NetworkClientListPopupWindow::ClientListAction |
| Container for actions that can be executed. More... | |
| struct | NetworkClientListWindow |
| Main handle for clientlist. More... | |
| struct | NetworkJoinStatusWindow |
| struct | NetworkCompanyPasswordWindow |
Typedefs | |
|
typedef GUIList < NetworkGameList *, StringFilter & > | GUIGameServerList |
| typedef uint16 | ServerListPosition |
| typedef void | ClientList_Action_Proc (const NetworkClientInfo *ci) |
| Prototype for ClientList actions. | |
Functions | |
| static void | ShowNetworkStartServerWindow () |
| static void | ShowNetworkLobbyWindow (NetworkGameList *ngl) |
| Show the networklobbywindow with the selected server. | |
| void | SortNetworkLanguages () |
| void | UpdateNetworkGameWindow () |
| Update the network new window because a new server is found on the network. | |
| static NWidgetBase * | MakeResizableHeader (int *biggest_index) |
| void | ShowNetworkGameWindow () |
| NetworkCompanyInfo * | GetLobbyCompanyInfo (CompanyID company) |
| Get the company information of a given company to fill for the lobby. | |
| void | DrawCompanyIcon (CompanyID cid, int x, int y) |
| Draw the icon of a company. | |
| static void | ClientList_Kick (const NetworkClientInfo *ci) |
| static void | ClientList_Ban (const NetworkClientInfo *ci) |
| static void | ClientList_GiveMoney (const NetworkClientInfo *ci) |
| static void | ClientList_SpeakToClient (const NetworkClientInfo *ci) |
| static void | ClientList_SpeakToCompany (const NetworkClientInfo *ci) |
| static void | ClientList_SpeakToAll (const NetworkClientInfo *ci) |
| static void | PopupClientList (ClientID client_id, int x, int y) |
| Show the popup (action list) | |
| void | ShowClientList () |
| void | ShowJoinStatusWindow () |
| void | ShowNetworkNeedPassword (NetworkPasswordType npt) |
| void | ShowNetworkCompanyPasswordWindow (Window *parent) |
Variables | |
| static const StringID | _connection_types_dropdown [] |
| Advertisement options in the start server window. | |
| static const StringID | _lan_internet_types_dropdown [] |
| Advertisement options in the server list. | |
| static StringID | _language_dropdown [NETLANG_COUNT+1] = {STR_NULL} |
| static const ServerListPosition | SLP_INVALID = 0xFFFF |
| static const NWidgetPart | _nested_network_game_widgets [] |
| static WindowDesc | _network_game_window_desc (WDP_CENTER,"list_servers", 1000, 730, WC_NETWORK_WINDOW, WC_NONE, 0, _nested_network_game_widgets, lengthof(_nested_network_game_widgets)) |
| static const NWidgetPart | _nested_network_start_server_window_widgets [] |
| static WindowDesc | _network_start_server_window_desc (WDP_CENTER, NULL, 0, 0, WC_NETWORK_WINDOW, WC_NONE, 0, _nested_network_start_server_window_widgets, lengthof(_nested_network_start_server_window_widgets)) |
| static const NWidgetPart | _nested_network_lobby_window_widgets [] |
| static WindowDesc | _network_lobby_window_desc (WDP_CENTER, NULL, 0, 0, WC_NETWORK_WINDOW, WC_NONE, 0, _nested_network_lobby_window_widgets, lengthof(_nested_network_lobby_window_widgets)) |
| static const NWidgetPart | _nested_client_list_popup_widgets [] |
| static WindowDesc | _client_list_popup_desc (WDP_AUTO, NULL, 0, 0, WC_CLIENT_LIST_POPUP, WC_CLIENT_LIST, 0, _nested_client_list_popup_widgets, lengthof(_nested_client_list_popup_widgets)) |
| static const NWidgetPart | _nested_client_list_widgets [] |
| static WindowDesc | _client_list_desc (WDP_AUTO,"list_clients", 0, 0, WC_CLIENT_LIST, WC_NONE, 0, _nested_client_list_widgets, lengthof(_nested_client_list_widgets)) |
| NetworkJoinStatus | _network_join_status |
| The status of joining. | |
| uint8 | _network_join_waiting |
| The number of clients waiting in front of us. | |
| uint32 | _network_join_bytes |
| The number of bytes we already downloaded. | |
| uint32 | _network_join_bytes_total |
| The total number of bytes to download. | |
| static const NWidgetPart | _nested_network_join_status_window_widgets [] |
| static WindowDesc | _network_join_status_window_desc (WDP_CENTER, NULL, 0, 0, WC_NETWORK_STATUS_WINDOW, WC_NONE, WDF_MODAL, _nested_network_join_status_window_widgets, lengthof(_nested_network_join_status_window_widgets)) |
| static const NWidgetPart | _nested_network_company_password_window_widgets [] |
| static WindowDesc | _network_company_password_window_desc (WDP_AUTO, NULL, 0, 0, WC_COMPANY_PASSWORD_WINDOW, WC_NONE, 0, _nested_network_company_password_window_widgets, lengthof(_nested_network_company_password_window_widgets)) |
Implementation of the Network related GUIs.
Definition in file network_gui.cpp.
| typedef void ClientList_Action_Proc(const NetworkClientInfo *ci) |
Prototype for ClientList actions.
| ci | The information about the current client. |
Definition at line 1670 of file network_gui.cpp.
| void DrawCompanyIcon | ( | CompanyID | c, |
| int | x, | ||
| int | y | ||
| ) |
Draw the icon of a company.
| c | Company that needs its icon drawn. |
| x | Horizontal coordinate of the icon. |
| y | Vertical coordinate of the icon. |
Definition at line 141 of file company_cmd.cpp.
References DrawSprite().
Referenced by TownAuthorityWindow::DrawRatings(), GraphLegendWindow::DrawWidget(), LinkGraphLegendWindow::DrawWidget(), SignListWindow::DrawWidget(), CheatWindow::DrawWidget(), CompanyLeagueWindow::DrawWidget(), PerformanceRatingDetailWindow::DrawWidget(), NetworkClientListWindow::DrawWidget(), and AIDebugWindow::OnPaint().
| NetworkCompanyInfo* GetLobbyCompanyInfo | ( | CompanyID | company | ) |
Get the company information of a given company to fill for the lobby.
| company | the company to get the company info struct from. |
Definition at line 1654 of file network_gui.cpp.
References FindWindowById(), WC_NETWORK_WINDOW, and WN_NETWORK_WINDOW_LOBBY.
Referenced by NetworkLobbyWindow::OnPaint(), and ClientNetworkGameSocketHandler::Receive_SERVER_COMPANY_INFO().
|
static |
Show the networklobbywindow with the selected server.
| ngl | Selected game pointer which is passed to the new window. |
Definition at line 1638 of file network_gui.cpp.
References _settings_client, DeleteWindowById(), NetworkSettings::last_host, NetworkSettings::last_port, ClientSettings::network, NetworkUDPQueryServer(), WC_NETWORK_WINDOW, WN_NETWORK_WINDOW_GAME, and WN_NETWORK_WINDOW_START.
Referenced by NetworkGameWindow::OnClick().
|
static |
Advertisement options in the start server window.
Definition at line 51 of file network_gui.cpp.
Referenced by NetworkStartServerWindow::OnClick(), NetworkStartServerWindow::SetStringParameters(), and NetworkStartServerWindow::UpdateWidgetSize().
|
static |
Advertisement options in the server list.
Definition at line 60 of file network_gui.cpp.
Referenced by NetworkGameWindow::OnClick(), NetworkGameWindow::SetStringParameters(), and NetworkGameWindow::UpdateWidgetSize().
|
static |
Definition at line 1672 of file network_gui.cpp.
|
static |
Definition at line 1843 of file network_gui.cpp.
|
static |
Definition at line 2199 of file network_gui.cpp.
|
static |
Definition at line 2116 of file network_gui.cpp.
1.8.1.2