Automatically search internet when opening multiplayer window
This commit is contained in:
@@ -239,8 +239,6 @@ protected:
|
|||||||
GUITimer requery_timer; ///< Timer for network requery.
|
GUITimer requery_timer; ///< Timer for network requery.
|
||||||
bool searched_internet = false; ///< Did we ever press "Search Internet" button?
|
bool searched_internet = false; ///< Did we ever press "Search Internet" button?
|
||||||
|
|
||||||
bool UDP_CC_queried; ///< CityMania for buttons check
|
|
||||||
|
|
||||||
int lock_offset; ///< Left offset for lock icon.
|
int lock_offset; ///< Left offset for lock icon.
|
||||||
int blot_offset; ///< Left offset for green/yellow/red compatibility icon.
|
int blot_offset; ///< Left offset for green/yellow/red compatibility icon.
|
||||||
int flag_offset; ///< Left offset for language flag icon.
|
int flag_offset; ///< Left offset for language flag icon.
|
||||||
@@ -495,7 +493,6 @@ public:
|
|||||||
|
|
||||||
this->querystrings[WID_NG_FILTER] = &this->filter_editbox;
|
this->querystrings[WID_NG_FILTER] = &this->filter_editbox;
|
||||||
this->filter_editbox.cancel_button = QueryString::ACTION_CLEAR;
|
this->filter_editbox.cancel_button = QueryString::ACTION_CLEAR;
|
||||||
this->UDP_CC_queried = false;
|
|
||||||
this->SetFocusedWidget(WID_NG_FILTER);
|
this->SetFocusedWidget(WID_NG_FILTER);
|
||||||
|
|
||||||
/* As the Game Coordinator doesn't support "websocket" servers yet, we
|
/* As the Game Coordinator doesn't support "websocket" servers yet, we
|
||||||
@@ -515,6 +512,9 @@ public:
|
|||||||
this->servers.SetSortFuncs(this->sorter_funcs);
|
this->servers.SetSortFuncs(this->sorter_funcs);
|
||||||
this->servers.SetFilterFuncs(this->filter_funcs);
|
this->servers.SetFilterFuncs(this->filter_funcs);
|
||||||
this->servers.ForceRebuild();
|
this->servers.ForceRebuild();
|
||||||
|
|
||||||
|
_network_coordinator_client.GetListing();
|
||||||
|
this->searched_internet = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
~NetworkGameWindow()
|
~NetworkGameWindow()
|
||||||
@@ -814,18 +814,15 @@ public:
|
|||||||
case WID_NG_BTPRO:
|
case WID_NG_BTPRO:
|
||||||
case WID_NG_REDDIT:
|
case WID_NG_REDDIT:
|
||||||
case WID_NG_CITYMANIA:
|
case WID_NG_CITYMANIA:
|
||||||
if(!UDP_CC_queried){
|
_network_coordinator_client.GetListing();
|
||||||
// FIXME NetworkUDPQueryMasterServer();
|
if (widget == WID_NG_NICE) this->filter_editbox.text.Assign("n-ice");
|
||||||
UDP_CC_queried = true;
|
|
||||||
}
|
|
||||||
if(widget == WID_NG_NICE) this->filter_editbox.text.Assign("n-ice");
|
|
||||||
else if(widget == WID_NG_BTPRO) this->filter_editbox.text.Assign("BTPro");
|
else if(widget == WID_NG_BTPRO) this->filter_editbox.text.Assign("BTPro");
|
||||||
else if(widget == WID_NG_CITYMANIA) this->filter_editbox.text.Assign("citymania");
|
else if(widget == WID_NG_CITYMANIA) this->filter_editbox.text.Assign("citymania");
|
||||||
else if(widget == WID_NG_REDDIT) this->filter_editbox.text.Assign("reddit");
|
else if(widget == WID_NG_REDDIT) this->filter_editbox.text.Assign("reddit");
|
||||||
this->servers.ForceRebuild();
|
// this->servers.ForceRebuild();
|
||||||
this->BuildGUINetworkGameList();
|
// this->BuildGUINetworkGameList();
|
||||||
this->ScrollToSelectedServer();
|
// this->ScrollToSelectedServer();
|
||||||
this->SetDirty();
|
// this->SetDirty();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user