mirror of
https://github.com/glest/glest-source.git
synced 2025-08-29 10:49:48 +02:00
Added a more user friendly messagebox when network errors are encountered. Added fix for Fullscreen OpenGL Mode
This commit is contained in:
@@ -50,7 +50,7 @@ Program::ShowMessageProgramState::ShowMessageProgramState(Program *program, cons
|
|||||||
ProgramState(program) {
|
ProgramState(program) {
|
||||||
|
|
||||||
//if(Socket::enableDebugText) printf("In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
//if(Socket::enableDebugText) printf("In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
userWantsExit = false;
|
||||||
msgBox.init("Ok");
|
msgBox.init("Ok");
|
||||||
|
|
||||||
//if(Socket::enableDebugText) printf("In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
//if(Socket::enableDebugText) printf("In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
@@ -85,6 +85,7 @@ void Program::ShowMessageProgramState::mouseDownLeft(int x, int y) {
|
|||||||
|
|
||||||
//if(Socket::enableDebugText) printf("In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
//if(Socket::enableDebugText) printf("In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
program->exit();
|
program->exit();
|
||||||
|
userWantsExit = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if(Socket::enableDebugText) printf("In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
//if(Socket::enableDebugText) printf("In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
@@ -345,11 +346,14 @@ void Program::showMessage(const char *msg) {
|
|||||||
|
|
||||||
//if(Socket::enableDebugText) printf("In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
//if(Socket::enableDebugText) printf("In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
this->programState = new ShowMessageProgramState(this, msg);
|
SDL_ShowCursor(SDL_ENABLE);
|
||||||
|
//SDL_WM_ToggleFullScreen(SDL_GetVideoSurface());
|
||||||
|
ShowMessageProgramState *showMsg = new ShowMessageProgramState(this, msg);
|
||||||
|
this->programState = showMsg;
|
||||||
|
|
||||||
//if(Socket::enableDebugText) printf("In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
//if(Socket::enableDebugText) printf("In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
while(Window::handleEvent()) {
|
while(Window::handleEvent() && showMsg->wantExit() == false) {
|
||||||
loop();
|
loop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -360,7 +364,8 @@ void Program::showMessage(const char *msg) {
|
|||||||
|
|
||||||
//if(Socket::enableDebugText) printf("In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
//if(Socket::enableDebugText) printf("In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
init(window);
|
//MainWindow *mainWindow= new MainWindow(this);
|
||||||
|
init(this->window);
|
||||||
setState(originalState);
|
setState(originalState);
|
||||||
//this->programState = originalState;
|
//this->programState = originalState;
|
||||||
|
|
||||||
|
@@ -76,6 +76,7 @@ private:
|
|||||||
int mouseY;
|
int mouseY;
|
||||||
int mouse2dAnim;
|
int mouse2dAnim;
|
||||||
string msg;
|
string msg;
|
||||||
|
bool userWantsExit;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ShowMessageProgramState(Program *program, const char *msg);
|
ShowMessageProgramState(Program *program, const char *msg);
|
||||||
@@ -84,6 +85,7 @@ private:
|
|||||||
virtual void mouseDownLeft(int x, int y);
|
virtual void mouseDownLeft(int x, int y);
|
||||||
virtual void mouseMove(int x, int y, const MouseState &mouseState);
|
virtual void mouseMove(int x, int y, const MouseState &mouseState);
|
||||||
virtual void update();
|
virtual void update();
|
||||||
|
virtual bool wantExit() { return userWantsExit; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user