Changeset - r14984:20790c44e000
[Not reviewed]
master
0 1 0
smatz - 15 years ago 2010-04-11 16:38:31
smatz@openttd.org
(svn r19606) -Codechange: remove global variable pw_type
1 file changed with 18 insertions and 18 deletions:
0 comments (0 inline, 0 general)
src/network/network_gui.cpp
Show inline comments
 
@@ -2116,23 +2116,6 @@ void ShowClientList()
 
	AllocateWindowDescFront<NetworkClientListWindow>(&_client_list_desc, 0);
 
}
 

	
 

	
 
static NetworkPasswordType pw_type;
 

	
 

	
 
void ShowNetworkNeedPassword(NetworkPasswordType npt)
 
{
 
	StringID caption;
 

	
 
	pw_type = npt;
 
	switch (npt) {
 
		default: NOT_REACHED();
 
		case NETWORK_GAME_PASSWORD:    caption = STR_NETWORK_NEED_GAME_PASSWORD_CAPTION; break;
 
		case NETWORK_COMPANY_PASSWORD: caption = STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION; break;
 
	}
 
	ShowQueryString(STR_EMPTY, caption, 20, 180, FindWindowById(WC_NETWORK_STATUS_WINDOW, 0), CS_ALPHANUMERAL, QSF_NONE);
 
}
 

	
 
/* Vars needed for the join-GUI */
 
NetworkJoinStatus _network_join_status;
 
uint8 _network_join_waiting;
 
@@ -2146,6 +2129,8 @@ enum NetworkJoinStatusWidgets {
 
};
 

	
 
struct NetworkJoinStatusWindow : Window {
 
	NetworkPasswordType password_type;
 

	
 
	NetworkJoinStatusWindow(const WindowDesc *desc) : Window()
 
	{
 
		this->parent = FindWindowById(WC_NETWORK_WINDOW, 0);
 
@@ -2226,7 +2211,7 @@ struct NetworkJoinStatusWindow : Window 
 
			NetworkDisconnect();
 
			ShowNetworkGameWindow();
 
		} else {
 
			SEND_COMMAND(PACKET_CLIENT_PASSWORD)(pw_type, str);
 
			SEND_COMMAND(PACKET_CLIENT_PASSWORD)(this->password_type, str);
 
		}
 
	}
 
};
 
@@ -2257,6 +2242,21 @@ void ShowJoinStatusWindow()
 
	new NetworkJoinStatusWindow(&_network_join_status_window_desc);
 
}
 

	
 
void ShowNetworkNeedPassword(NetworkPasswordType npt)
 
{
 
	NetworkJoinStatusWindow *w = (NetworkJoinStatusWindow *)FindWindowById(WC_NETWORK_STATUS_WINDOW, 0);
 
	if (w == NULL) return;
 
	w->password_type = npt;
 

	
 
	StringID caption;
 
	switch (npt) {
 
		default: NOT_REACHED();
 
		case NETWORK_GAME_PASSWORD:    caption = STR_NETWORK_NEED_GAME_PASSWORD_CAPTION; break;
 
		case NETWORK_COMPANY_PASSWORD: caption = STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION; break;
 
	}
 
	ShowQueryString(STR_EMPTY, caption, 20, 180, w, CS_ALPHANUMERAL, QSF_NONE);
 
}
 

	
 

	
 
/** Enum for NetworkGameWindow, referring to _network_game_window_widgets */
 
enum NetworkCompanyPasswordWindowWidgets {
0 comments (0 inline, 0 general)