Changeset - r19815:f6f84e811034
[Not reviewed]
master
0 1 0
frosch - 12 years ago 2012-11-27 21:54:11
frosch@openttd.org
(svn r24770) -Fix-ish: Calling GUIList::Sort repeatedly has no use without GUIList::NeedResort since the latter has the sideeffects.
1 file changed with 3 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/network/network_gui.cpp
Show inline comments
 
@@ -587,25 +587,27 @@ public:
 
			case WID_NG_INFO:
 
				if (widget - WID_NG_NAME == this->servers.SortType()) this->DrawSortButtonState(widget, this->servers.IsDescSortOrder() ? SBS_DOWN : SBS_UP);
 
				break;
 
		}
 
	}
 

	
 

	
 
	virtual void OnPaint()
 
	{
 
		if (this->servers.NeedRebuild()) {
 
			this->BuildGUINetworkGameList();
 
		}
 
		this->SortNetworkGameList();
 
		if (this->servers.NeedResort()) {
 
			this->SortNetworkGameList();
 
		}
 

	
 
		NetworkGameList *sel = this->server;
 
		/* 'Refresh' button invisible if no server selected */
 
		this->SetWidgetDisabledState(WID_NG_REFRESH, sel == NULL);
 
		/* 'Join' button disabling conditions */
 
		this->SetWidgetDisabledState(WID_NG_JOIN, sel == NULL || // no Selected Server
 
				!sel->online || // Server offline
 
				sel->info.clients_on >= sel->info.clients_max || // Server full
 
				!sel->info.compatible); // Revision mismatch
 

	
 
		/* 'NewGRF Settings' button invisible if no NewGRF is used */
 
		this->GetWidget<NWidgetStacked>(WID_NG_NEWGRF_SEL)->SetDisplayedPlane(sel == NULL || !sel->online || sel->info.grfconfig == NULL);
0 comments (0 inline, 0 general)