mirror of
https://github.com/glest/glest-source.git
synced 2025-08-29 10:49:48 +02:00
since now you can write also port number in the 'LAN menu'
This commit is contained in:
@@ -154,7 +154,7 @@ void MenuStateJoinGame::CommonInit(bool connect, Ip serverIp,int portNumberOverr
|
|||||||
//server ip
|
//server ip
|
||||||
labelServerIp.registerGraphicComponent(containerName,"labelServerIp");
|
labelServerIp.registerGraphicComponent(containerName,"labelServerIp");
|
||||||
labelServerIp.setEditable(true);
|
labelServerIp.setEditable(true);
|
||||||
labelServerIp.setMaxEditWidth(20);
|
labelServerIp.setMaxEditWidth(26);
|
||||||
labelServerIp.setMaxEditRenderWidth(210);
|
labelServerIp.setMaxEditRenderWidth(210);
|
||||||
labelServerIp.init(labelXright, 460);
|
labelServerIp.init(labelXright, 460);
|
||||||
|
|
||||||
@@ -696,7 +696,7 @@ void MenuStateJoinGame::keyPress(SDL_KeyboardEvent c) {
|
|||||||
ClientInterface* clientInterface= NetworkManager::getInstance().getClientInterface();
|
ClientInterface* clientInterface= NetworkManager::getInstance().getClientInterface();
|
||||||
|
|
||||||
if(clientInterface->isConnected() == false) {
|
if(clientInterface->isConnected() == false) {
|
||||||
int maxTextSize= 16;
|
int maxTextSize= 22;
|
||||||
|
|
||||||
//Config &configKeys = Config::getInstance(std::pair<ConfigType,ConfigType>(cfgMainKeys,cfgUserKeys));
|
//Config &configKeys = Config::getInstance(std::pair<ConfigType,ConfigType>(cfgMainKeys,cfgUserKeys));
|
||||||
|
|
||||||
@@ -708,8 +708,8 @@ void MenuStateJoinGame::keyPress(SDL_KeyboardEvent c) {
|
|||||||
if((int)labelServerIp.getText().size() < maxTextSize) {
|
if((int)labelServerIp.getText().size() < maxTextSize) {
|
||||||
string text= labelServerIp.getText();
|
string text= labelServerIp.getText();
|
||||||
//text.insert(text.end()-1, key);
|
//text.insert(text.end()-1, key);
|
||||||
char szCharText[20]="";
|
char szCharText[26]="";
|
||||||
snprintf(szCharText,20,"%c",key);
|
snprintf(szCharText,26,"%c",key);
|
||||||
char *utfStr = ConvertToUTF8(&szCharText[0]);
|
char *utfStr = ConvertToUTF8(&szCharText[0]);
|
||||||
if(text.size() > 0) {
|
if(text.size() > 0) {
|
||||||
text.insert(text.end() -1, utfStr[0]);
|
text.insert(text.end() -1, utfStr[0]);
|
||||||
@@ -734,6 +734,20 @@ void MenuStateJoinGame::keyPress(SDL_KeyboardEvent c) {
|
|||||||
text = ".";
|
text = ".";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
labelServerIp.setText(text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//else if (c==':') {
|
||||||
|
else if (key == SDLK_COLON) {
|
||||||
|
if((int)labelServerIp.getText().size() < maxTextSize) {
|
||||||
|
string text= labelServerIp.getText();
|
||||||
|
if(text.size() > 0) {
|
||||||
|
text.insert(text.end() -1, ':');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
text = ":";
|
||||||
|
}
|
||||||
|
|
||||||
labelServerIp.setText(text);
|
labelServerIp.setText(text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user