|
|
@ -96,7 +96,11 @@ void UpdateNetworkGameWindow(bool unselect)
|
|
|
|
|
|
|
|
|
|
|
|
static void NetworkGameWindowWndProc(Window *w, WindowEvent *e)
|
|
|
|
static void NetworkGameWindowWndProc(Window *w, WindowEvent *e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch(e->event) {
|
|
|
|
switch (e->event) {
|
|
|
|
|
|
|
|
case WE_CREATE: /* focus input box */
|
|
|
|
|
|
|
|
_selected_field = 3;
|
|
|
|
|
|
|
|
_selected_item = NULL;
|
|
|
|
|
|
|
|
break;
|
|
|
|
case WE_PAINT: {
|
|
|
|
case WE_PAINT: {
|
|
|
|
w->disabled_state = 0;
|
|
|
|
w->disabled_state = 0;
|
|
|
|
|
|
|
|
|
|
|
@ -381,10 +385,6 @@ static void NetworkGameWindowWndProc(Window *w, WindowEvent *e)
|
|
|
|
NetworkAddServer(e->edittext.str);
|
|
|
|
NetworkAddServer(e->edittext.str);
|
|
|
|
NetworkRebuildHostList();
|
|
|
|
NetworkRebuildHostList();
|
|
|
|
} break;
|
|
|
|
} break;
|
|
|
|
|
|
|
|
|
|
|
|
case WE_CREATE: {
|
|
|
|
|
|
|
|
_selected_item = NULL;
|
|
|
|
|
|
|
|
} break;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -486,7 +486,12 @@ enum {
|
|
|
|
|
|
|
|
|
|
|
|
static void NetworkStartServerWindowWndProc(Window *w, WindowEvent *e)
|
|
|
|
static void NetworkStartServerWindowWndProc(Window *w, WindowEvent *e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch(e->event) {
|
|
|
|
switch (e->event) {
|
|
|
|
|
|
|
|
case WE_CREATE: /* focus input box */
|
|
|
|
|
|
|
|
_selected_field = 3;
|
|
|
|
|
|
|
|
_network_game_info.use_password = (_network_server_password[0] == '\0') ? 0 : 1;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case WE_PAINT: {
|
|
|
|
case WE_PAINT: {
|
|
|
|
int y = NSSWND_START, pos;
|
|
|
|
int y = NSSWND_START, pos;
|
|
|
|
const FiosItem *item;
|
|
|
|
const FiosItem *item;
|
|
|
@ -507,6 +512,8 @@ static void NetworkStartServerWindowWndProc(Window *w, WindowEvent *e)
|
|
|
|
DrawString(280, 95, STR_NETWORK_NUMBER_OF_CLIENTS, 2);
|
|
|
|
DrawString(280, 95, STR_NETWORK_NUMBER_OF_CLIENTS, 2);
|
|
|
|
DrawString(280, 127, STR_NETWORK_LANGUAGE_SPOKEN, 2);
|
|
|
|
DrawString(280, 127, STR_NETWORK_LANGUAGE_SPOKEN, 2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (_network_game_info.use_password) DoDrawString("*", 408, 23, 3);
|
|
|
|
|
|
|
|
|
|
|
|
// draw list of maps
|
|
|
|
// draw list of maps
|
|
|
|
pos = w->vscroll.pos;
|
|
|
|
pos = w->vscroll.pos;
|
|
|
|
while (pos < _fios_num + 1) {
|
|
|
|
while (pos < _fios_num + 1) {
|
|
|
@ -599,29 +606,20 @@ static void NetworkStartServerWindowWndProc(Window *w, WindowEvent *e)
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case WE_MOUSELOOP:
|
|
|
|
case WE_MOUSELOOP:
|
|
|
|
if(_selected_field == 3 || _selected_field == 4)
|
|
|
|
if (_selected_field == 3)
|
|
|
|
HandleEditBox(w, _selected_field);
|
|
|
|
HandleEditBox(w, 3);
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case WE_KEYPRESS:
|
|
|
|
case WE_KEYPRESS:
|
|
|
|
if(_selected_field != 3)
|
|
|
|
if (_selected_field == 3)
|
|
|
|
break;
|
|
|
|
HandleEditBoxKey(w, 3, e);
|
|
|
|
switch (HandleEditBoxKey(w, _selected_field, e)) {
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
|
|
|
|
HandleButtonClick(w, 9);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case WE_ON_EDIT_TEXT: {
|
|
|
|
case WE_ON_EDIT_TEXT: {
|
|
|
|
const char *b = e->edittext.str;
|
|
|
|
const char *b = e->edittext.str;
|
|
|
|
ttd_strlcpy(_network_server_password, b, sizeof(_network_server_password));
|
|
|
|
ttd_strlcpy(_network_server_password, b, sizeof(_network_server_password));
|
|
|
|
if (_network_server_password[0] == '\0') {
|
|
|
|
_network_game_info.use_password = (_network_server_password[0] == '\0') ? 0 : 1;
|
|
|
|
_network_game_info.use_password = 0;
|
|
|
|
SetWindowDirty(w);
|
|
|
|
} else {
|
|
|
|
|
|
|
|
_network_game_info.use_password = 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} break;
|
|
|
|
} break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|