mirror of
https://github.com/glest/glest-source.git
synced 2025-08-29 19:00:07 +02:00
Announcements from Matserserver
This commit is contained in:
@@ -43,7 +43,7 @@ ServerLine::ServerLine( MasterServerInfo *mServerInfo, int lineIndex, const char
|
|||||||
int lineOffset=25*lineIndex;
|
int lineOffset=25*lineIndex;
|
||||||
masterServerInfo=mServerInfo;
|
masterServerInfo=mServerInfo;
|
||||||
int i=10;
|
int i=10;
|
||||||
int startOffset=650;
|
int startOffset=630;
|
||||||
|
|
||||||
//general info:
|
//general info:
|
||||||
i+=10;
|
i+=10;
|
||||||
@@ -155,6 +155,7 @@ MenuStateMasterserver::MenuStateMasterserver(Program *program, MainMenu *mainMen
|
|||||||
|
|
||||||
autoRefreshTime=0;
|
autoRefreshTime=0;
|
||||||
playServerFoundSound=false;
|
playServerFoundSound=false;
|
||||||
|
announcementLoaded=false;
|
||||||
|
|
||||||
mainMessageBox.registerGraphicComponent(containerName,"mainMessageBox");
|
mainMessageBox.registerGraphicComponent(containerName,"mainMessageBox");
|
||||||
mainMessageBox.init(lang.get("Ok"));
|
mainMessageBox.init(lang.get("Ok"));
|
||||||
@@ -163,10 +164,16 @@ MenuStateMasterserver::MenuStateMasterserver(Program *program, MainMenu *mainMen
|
|||||||
|
|
||||||
lastRefreshTimer= time(NULL);
|
lastRefreshTimer= time(NULL);
|
||||||
|
|
||||||
|
// announcement
|
||||||
|
announcementLabel.registerGraphicComponent(containerName,"announcementLabel");
|
||||||
|
announcementLabel.init(10, 730);
|
||||||
|
announcementLabel.setFont(CoreData::getInstance().getMenuFontBig());
|
||||||
|
announcementLabel.setText("");
|
||||||
|
|
||||||
// header
|
// header
|
||||||
labelTitle.registerGraphicComponent(containerName,"labelTitle");
|
labelTitle.registerGraphicComponent(containerName,"labelTitle");
|
||||||
labelTitle.init(330, 700);
|
labelTitle.init(330, 670);
|
||||||
|
labelTitle.setFont(CoreData::getInstance().getMenuFontBig());
|
||||||
labelTitle.setText(lang.get("AvailableServers"));
|
labelTitle.setText(lang.get("AvailableServers"));
|
||||||
|
|
||||||
if(Config::getInstance().getString("Masterserver","") == "") {
|
if(Config::getInstance().getString("Masterserver","") == "") {
|
||||||
@@ -378,6 +385,7 @@ void MenuStateMasterserver::render(){
|
|||||||
renderer.renderButton(&buttonRefresh);
|
renderer.renderButton(&buttonRefresh);
|
||||||
renderer.renderButton(&buttonReturn);
|
renderer.renderButton(&buttonReturn);
|
||||||
renderer.renderLabel(&labelTitle);
|
renderer.renderLabel(&labelTitle);
|
||||||
|
renderer.renderLabel(&announcementLabel);
|
||||||
renderer.renderLabel(&labelAutoRefresh);
|
renderer.renderLabel(&labelAutoRefresh);
|
||||||
renderer.renderLabel(&labelChatUrl);
|
renderer.renderLabel(&labelChatUrl);
|
||||||
renderer.renderButton(&buttonCreateGame);
|
renderer.renderButton(&buttonCreateGame);
|
||||||
@@ -453,6 +461,13 @@ void MenuStateMasterserver::updateServerInfo() {
|
|||||||
clearServerLines();
|
clearServerLines();
|
||||||
safeMutex.ReleaseLock(true);
|
safeMutex.ReleaseLock(true);
|
||||||
|
|
||||||
|
if(!announcementLoaded)
|
||||||
|
{
|
||||||
|
std::string announcementTxt = SystemFlags::getHTTP(Config::getInstance().getString("AnnouncementURL","http://megaglest.pepper.freeit.org/announcement.txt"));
|
||||||
|
announcementLabel.setText(announcementTxt);
|
||||||
|
announcementLoaded=true;
|
||||||
|
}
|
||||||
|
|
||||||
if(Config::getInstance().getString("Masterserver","") != "") {
|
if(Config::getInstance().getString("Masterserver","") != "") {
|
||||||
std::string serverInfo = SystemFlags::getHTTP(Config::getInstance().getString("Masterserver") + "showServersForGlest.php");
|
std::string serverInfo = SystemFlags::getHTTP(Config::getInstance().getString("Masterserver") + "showServersForGlest.php");
|
||||||
|
|
||||||
|
@@ -82,10 +82,13 @@ private:
|
|||||||
ServerLines serverLines;
|
ServerLines serverLines;
|
||||||
GraphicLabel labelChatUrl;
|
GraphicLabel labelChatUrl;
|
||||||
|
|
||||||
|
GraphicLabel announcementLabel;
|
||||||
|
|
||||||
|
|
||||||
GraphicMessageBox mainMessageBox;
|
GraphicMessageBox mainMessageBox;
|
||||||
int mainMessageBoxState;
|
int mainMessageBoxState;
|
||||||
|
|
||||||
|
bool announcementLoaded;
|
||||||
bool needUpdateFromServer;
|
bool needUpdateFromServer;
|
||||||
int autoRefreshTime;
|
int autoRefreshTime;
|
||||||
time_t lastRefreshTimer;
|
time_t lastRefreshTimer;
|
||||||
|
Reference in New Issue
Block a user