|
|
/* $Id$ */
|
|
|
|
|
|
#ifdef ENABLE_NETWORK
|
|
|
#include "../stdafx.h"
|
|
|
#include "../openttd.h"
|
|
|
#include "../string.h"
|
|
|
#include "../strings.h"
|
|
|
#include "../table/sprites.h"
|
|
|
#include "network.h"
|
|
|
#include "../date.h"
|
|
|
|
|
|
#include "../fios.h"
|
|
|
#include "table/strings.h"
|
|
|
#include "../functions.h"
|
|
|
#include "network_data.h"
|
|
|
#include "network_client.h"
|
|
|
#include "network_gui.h"
|
|
|
#include "network_gamelist.h"
|
|
|
#include "../gui.h"
|
|
|
#include "../window_gui.h"
|
|
|
#include "../textbuf_gui.h"
|
|
|
#include "../gfx.h"
|
|
|
#include "../command.h"
|
|
|
#include "../variables.h"
|
|
|
#include "network_server.h"
|
|
|
#include "network_udp.h"
|
|
|
#include "../settings.h"
|
|
|
#include "../string.h"
|
|
|
#include "../town.h"
|
|
|
#include "../newgrf.h"
|
|
|
#include "../helpers.hpp"
|
|
|
|
|
|
#define BGC 5
|
|
|
#define BTC 15
|
|
|
|
|
|
struct chatquerystr_d : public querystr_d {
|
|
|
int dest;
|
|
|
};
|
|
|
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(chatquerystr_d));
|
|
|
|
|
|
struct network_d {
|
|
|
PlayerID company; // select company in network lobby
|
|
|
byte field; // select text-field in start-server and game-listing
|
|
|
byte widget_id; ///< The widget that has the pop-up input menu
|
|
|
NetworkGameList *server; // selected server in lobby and game-listing
|
|
|
FiosItem *map; // selected map in start-server
|
|
|
};
|
|
|
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(network_d));
|
|
|
|
|
|
struct network_ql_d {
|
|
|
network_d n; // see above; general stuff
|
|
|
querystr_d q; // text-input in start-server and game-listing
|
|
|
NetworkGameList **sort_list; // list of games (sorted)
|
|
|
list_d l; // accompanying list-administration
|
|
|
};
|
|
|
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(network_ql_d));
|
|
|
|
|
|
/* Global to remember sorting after window has been closed */
|
|
|
static Listing _ng_sorting;
|
|
|
|
|
|
static char _edit_str_buf[150];
|
|
|
static bool _chat_tab_completion_active;
|
|
|
|
|
|
static void ShowNetworkStartServerWindow();
|