Some changed external ports for ftp; switch ftp ports according to external port; Menu looks a bit more friendly(less fog)

This commit is contained in:
Titus Tscharntke 2011-01-12 19:42:25 +00:00
parent 0a01f98c4e
commit fec68c872a
3 changed files with 39 additions and 24 deletions

View File

@ -53,7 +53,7 @@ FontSizeAdjustment=0
Lang=english Lang=english
MaxLights=3 MaxLights=3
Masterserver=http://master.megaglest.org/ Masterserver=http://master.megaglest.org/
MasterServerExternalPortList=61357,61358,61359,61360,61000,80,1080,8000,8080,443,21,22,25,110,143,587,993,995 MasterServerExternalPortList=61357,61367,61377,61387,61397,80,1080,8000,8080,443,21,22,25,110,143,587,993,995
NetPlayerName=newbie NetPlayerName=newbie
NetworkConsistencyChecks=true NetworkConsistencyChecks=true
PhotoMode=false PhotoMode=false

View File

@ -503,7 +503,17 @@ void MenuStateOptions::mouseClick(int x, int y, MouseButton mouseButton){
listBoxScreenModes.mouseClick(x, y); listBoxScreenModes.mouseClick(x, y);
listFontSizeAdjustment.mouseClick(x, y); listFontSizeAdjustment.mouseClick(x, y);
checkBoxFullscreenWindowed.mouseClick(x, y); checkBoxFullscreenWindowed.mouseClick(x, y);
listBoxPublishServerExternalPort.mouseClick(x, y); if(listBoxPublishServerExternalPort.mouseClick(x, y)){
int selectedPort=strToInt(listBoxPublishServerExternalPort.getSelectedItem());
if(selectedPort<10000){
selectedPort=GameConstants::serverPort;
}
// use the following ports for ftp
char szBuf[1024]="";
sprintf(szBuf,"%d - %d",selectedPort + 1, selectedPort + GameConstants::maxPlayers);
labelFTPServerPort.setText(intToStr(selectedPort));
labelFTPServerDataPorts.setText(szBuf);
}
checkBoxEnableFTP.mouseClick(x, y); checkBoxEnableFTP.mouseClick(x, y);
checkBoxEnableFTPServer.mouseClick(x, y); checkBoxEnableFTPServer.mouseClick(x, y);
@ -680,6 +690,7 @@ void MenuStateOptions::saveConfig(){
CoreData::getInstance().getMenuMusic()->setVolume(strToInt(listBoxVolumeMusic.getSelectedItem())/100.f); CoreData::getInstance().getMenuMusic()->setVolume(strToInt(listBoxVolumeMusic.getSelectedItem())/100.f);
config.setString("SoundVolumeMusic", listBoxVolumeMusic.getSelectedItem()); config.setString("SoundVolumeMusic", listBoxVolumeMusic.getSelectedItem());
config.setString("MasterServerExternalPort", listBoxPublishServerExternalPort.getSelectedItem()); config.setString("MasterServerExternalPort", listBoxPublishServerExternalPort.getSelectedItem());
config.setInt("FTPServerPort",config.getInt("MasterServerExternalPort")+1);
config.setBool("EnableFTPXfer", checkBoxEnableFTP.getValue()); config.setBool("EnableFTPXfer", checkBoxEnableFTP.getValue());
config.setBool("EnableFTPServer", checkBoxEnableFTPServer.getValue()); config.setBool("EnableFTPServer", checkBoxEnableFTPServer.getValue());

View File

@ -39,25 +39,37 @@ MenuStateRoot::MenuStateRoot(Program *program, MainMenu *mainMenu):
{ {
containerName = "MainMenu"; containerName = "MainMenu";
Lang &lang= Lang::getInstance(); Lang &lang= Lang::getInstance();
int i=375; int yPos=440;
labelVersion.registerGraphicComponent(containerName,"labelVersion");
if(EndsWith(glestVersionString, "-dev") == false){
labelVersion.init(525, yPos);
labelVersion.setText(glestVersionString);
}
else {
labelVersion.init(405, yPos);
labelVersion.setText(glestVersionString + " [" + getCompileDateTime() + ", " + getSVNRevisionString() + "]");
}
yPos-=55;
buttonNewGame.registerGraphicComponent(containerName,"buttonNewGame"); buttonNewGame.registerGraphicComponent(containerName,"buttonNewGame");
buttonNewGame.init(425, i, 150); buttonNewGame.init(425, yPos, 150);
i-=40; yPos-=40;
buttonJoinGame.registerGraphicComponent(containerName,"buttonJoinGame"); buttonJoinGame.registerGraphicComponent(containerName,"buttonJoinGame");
buttonJoinGame.init(425, i, 150); buttonJoinGame.init(425, yPos, 150);
i-=40; yPos-=40;
buttonMasterserverGame.registerGraphicComponent(containerName,"buttonMasterserverGame"); buttonMasterserverGame.registerGraphicComponent(containerName,"buttonMasterserverGame");
buttonMasterserverGame.init(425, i, 150); buttonMasterserverGame.init(425, yPos, 150);
i-=40; yPos-=40;
buttonOptions.registerGraphicComponent(containerName,"buttonOptions"); buttonOptions.registerGraphicComponent(containerName,"buttonOptions");
buttonOptions.init(425, i, 150); buttonOptions.init(425, yPos, 150);
i-=40; yPos-=40;
buttonAbout.registerGraphicComponent(containerName,"buttonAbout"); buttonAbout.registerGraphicComponent(containerName,"buttonAbout");
buttonAbout.init(425, i , 150); buttonAbout.init(425, yPos , 150);
i-=40; yPos-=40;
buttonExit.registerGraphicComponent(containerName,"buttonExit"); buttonExit.registerGraphicComponent(containerName,"buttonExit");
buttonExit.init(425, i, 150); buttonExit.init(425, yPos, 150);
buttonNewGame.setText(lang.get("NewGame")); buttonNewGame.setText(lang.get("NewGame"));
buttonJoinGame.setText(lang.get("JoinGame")); buttonJoinGame.setText(lang.get("JoinGame"));
@ -66,15 +78,6 @@ MenuStateRoot::MenuStateRoot(Program *program, MainMenu *mainMenu):
buttonAbout.setText(lang.get("About")); buttonAbout.setText(lang.get("About"));
buttonExit.setText(lang.get("Exit")); buttonExit.setText(lang.get("Exit"));
labelVersion.registerGraphicComponent(containerName,"labelVersion");
if(EndsWith(glestVersionString, "-dev") == false){
labelVersion.init(525, 420);
labelVersion.setText(glestVersionString);
}
else {
labelVersion.init(405, 420);
labelVersion.setText(glestVersionString + " [" + getCompileDateTime() + ", " + getSVNRevisionString() + "]");
}
//mesage box //mesage box
mainMessageBox.registerGraphicComponent(containerName,"mainMessageBox"); mainMessageBox.registerGraphicComponent(containerName,"mainMessageBox");
mainMessageBox.init(lang.get("Yes"), lang.get("No")); mainMessageBox.init(lang.get("Yes"), lang.get("No"));
@ -150,9 +153,10 @@ void MenuStateRoot::render() {
int w= 300; int w= 300;
int h= 150; int h= 150;
int yPos=495;
renderer.renderTextureQuad( renderer.renderTextureQuad(
(metrics.getVirtualW()-w)/2, 475-h/2, w, h, (metrics.getVirtualW()-w)/2, yPos-h/2, w, h,
coreData.getLogoTexture(), GraphicComponent::getFade()); coreData.getLogoTexture(), GraphicComponent::getFade());
int maxLogoWidth=0; int maxLogoWidth=0;