|
@@ -686,17 +686,13 @@ public:
|
|
|
}
|
|
|
this->ScrollToSelectedServer();
|
|
|
this->SetDirty();
|
|
|
break;
|
|
|
|
|
|
case NGWW_MATRIX: { // Matrix to show networkgames
|
|
|
uint32 id_v = (pt.y - this->GetWidget<NWidgetBase>(NGWW_MATRIX)->pos_y) / this->resize.step_height;
|
|
|
|
|
|
if (id_v >= this->vscroll.GetCapacity()) return; // click out of bounds
|
|
|
id_v += this->vscroll.GetPosition();
|
|
|
|
|
|
uint id_v = this->vscroll.GetScrolledRowFromWidget(pt.y, this, NGWW_MATRIX);
|
|
|
this->server = (id_v < this->servers.Length()) ? this->servers[id_v] : NULL;
|
|
|
this->list_pos = (server == NULL) ? SLP_INVALID : id_v;
|
|
|
this->SetDirty();
|
|
|
|
|
|
/* FIXME the disabling should go into some InvalidateData, which is called instead of the SetDirty */
|
|
|
if (click_count > 1 && !this->IsWidgetDisabled(NGWW_JOIN)) this->OnClick(pt, NGWW_JOIN, 1);
|
|
@@ -1167,15 +1163,13 @@ struct NetworkStartServerWindow : public
|
|
|
this->widget_id = NSSW_SETPWD;
|
|
|
SetDParamStr(0, _settings_client.network.server_password);
|
|
|
ShowQueryString(STR_JUST_RAW_STRING, STR_NETWORK_START_SERVER_SET_PASSWORD, 20, 250, this, CS_ALPHANUMERAL, QSF_NONE);
|
|
|
break;
|
|
|
|
|
|
case NSSW_SELMAP: { // Select map
|
|
|
int y = (pt.y - this->GetWidget<NWidgetBase>(NSSW_SELMAP)->pos_y - WD_FRAMERECT_TOP) / FONT_HEIGHT_NORMAL;
|
|
|
|
|
|
y += this->vscroll.GetPosition();
|
|
|
int y = this->vscroll.GetScrolledRowFromWidget(pt.y, this, NSSW_SELMAP, WD_FRAMERECT_TOP, FONT_HEIGHT_NORMAL);
|
|
|
if (y >= this->vscroll.GetCount()) return;
|
|
|
|
|
|
this->map = (y == 0) ? NULL : _fios_items.Get(y - 1);
|
|
|
this->SetDirty();
|
|
|
} break;
|
|
|
|
|
@@ -1628,17 +1622,13 @@ struct NetworkLobbyWindow : public Windo
|
|
|
switch (widget) {
|
|
|
case NLWW_CANCEL: // Cancel button
|
|
|
ShowNetworkGameWindow();
|
|
|
break;
|
|
|
|
|
|
case NLWW_MATRIX: { // Company list
|
|
|
uint32 id_v = (pt.y - this->GetWidget<NWidgetBase>(NLWW_MATRIX)->pos_y) / this->resize.step_height;
|
|
|
|
|
|
if (id_v >= this->vscroll.GetCapacity()) break;
|
|
|
|
|
|
id_v += this->vscroll.GetPosition();
|
|
|
uint id_v = this->vscroll.GetScrolledRowFromWidget(pt.y, this, NLWW_MATRIX);
|
|
|
this->company = (id_v >= this->server->info.companies_on) ? INVALID_COMPANY : NetworkLobbyFindCompanyIndex(id_v);
|
|
|
this->SetDirty();
|
|
|
|
|
|
/* FIXME the disabling should go into some InvalidateData, which is called instead of the SetDirty */
|
|
|
if (click_count > 1 && !this->IsWidgetDisabled(NLWW_JOIN)) this->OnClick(pt, NLWW_JOIN, 1);
|
|
|
} break;
|