hopefully the masterserver listing works now ...

This commit is contained in:
Titus Tscharntke 2011-02-17 00:54:17 +00:00
parent 69a7f8f1d6
commit 050a604390

View File

@ -19,18 +19,17 @@
#include "auto_test.h"
#include "masterserver_info.h"
#include "leak_dumper.h"
namespace Glest{ namespace Game{
namespace Glest {
namespace Game {
// =====================================================
// class ServerLine
// =====================================================
ServerLine::ServerLine( MasterServerInfo *mServerInfo, int lineIndex, int baseY, int lineHeight, const char * containerName) {
ServerLine::ServerLine(MasterServerInfo *mServerInfo, int lineIndex, int baseY, int lineHeight,
const char * containerName){
this->containerName= containerName;
this->countryTexture= NULL;
Lang &lang= Lang::getInstance();
@ -111,7 +110,8 @@ ServerLine::ServerLine( MasterServerInfo *mServerInfo, int lineIndex, int baseY,
// i+=100;
activeSlotsLabel.init(i, baseY - lineOffset);
activeSlotsLabel.setText(intToStr(masterServerInfo.getActiveSlots())+"/"+intToStr(masterServerInfo.getNetworkSlots())+"/"+intToStr(masterServerInfo.getConnectedClients()));
activeSlotsLabel.setText(intToStr(masterServerInfo.getActiveSlots()) + "/" + intToStr(
masterServerInfo.getNetworkSlots()) + "/" + intToStr(masterServerInfo.getConnectedClients()));
i+= 50;
externalConnectPort.init(i, baseY - lineOffset);
@ -161,10 +161,12 @@ void ServerLine::render() {
bool joinEnabled= (masterServerInfo.getNetworkSlots() > masterServerInfo.getConnectedClients());
if(joinEnabled == true){
if(compatible){
selectButton.setEnabled(true);
selectButton.setVisible(true);
renderer.renderButton(&selectButton);
}
}
else{
selectButton.setEnabled(false);
selectButton.setVisible(false);
@ -175,21 +177,19 @@ void ServerLine::render() {
renderer.renderLabel(&platformLabel);
//renderer.renderLabel(&binaryCompileDateLabel);
//game info:
renderer.renderLabel(&serverTitleLabel);
if(countryTexture != NULL){
renderer.renderTextureQuad(country.getX() + 20,country.getY(),countryTexture->getTextureWidth(),countryTexture->getTextureHeight(),countryTexture,0.7f);
renderer.renderTextureQuad(country.getX() + 20, country.getY(), countryTexture->getTextureWidth(),
countryTexture->getTextureHeight(), countryTexture, 0.7f);
}
else{
renderer.renderLabel(&country);
}
if(compatible){
renderer.renderLabel(&status);
}
if(selectButton.getEnabled() == true){
if (compatible) {
//renderer.renderLabel(&ipAddressLabel);
//game setup info:
renderer.renderLabel(&techLabel);
renderer.renderLabel(&mapLabel);
@ -198,12 +198,13 @@ void ServerLine::render() {
renderer.renderLabel(&externalConnectPort);
renderer.renderLabel(&status);
}
}
else{
renderer.renderLabel(&wrongVersionLabel);
}
renderer.renderLabel(&status);
}
}
void ServerLine::setY(int y){
selectButton.setY(y);
@ -229,4 +230,5 @@ void ServerLine::setY(int y) {
}
}}//end namespace
}
}//end namespace