mirror of
https://github.com/glest/glest-source.git
synced 2025-08-28 18:29: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) {
|
||||
|
||||
//if(Socket::enableDebugText) printf("In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
|
||||
userWantsExit = false;
|
||||
msgBox.init("Ok");
|
||||
|
||||
//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__);
|
||||
program->exit();
|
||||
userWantsExit = true;
|
||||
}
|
||||
|
||||
//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__);
|
||||
|
||||
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__);
|
||||
|
||||
while(Window::handleEvent()) {
|
||||
while(Window::handleEvent() && showMsg->wantExit() == false) {
|
||||
loop();
|
||||
}
|
||||
|
||||
@@ -360,7 +364,8 @@ void Program::showMessage(const char *msg) {
|
||||
|
||||
//if(Socket::enableDebugText) printf("In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
|
||||
init(window);
|
||||
//MainWindow *mainWindow= new MainWindow(this);
|
||||
init(this->window);
|
||||
setState(originalState);
|
||||
//this->programState = originalState;
|
||||
|
||||
|
@@ -76,6 +76,7 @@ private:
|
||||
int mouseY;
|
||||
int mouse2dAnim;
|
||||
string msg;
|
||||
bool userWantsExit;
|
||||
|
||||
public:
|
||||
ShowMessageProgramState(Program *program, const char *msg);
|
||||
@@ -84,6 +85,7 @@ private:
|
||||
virtual void mouseDownLeft(int x, int y);
|
||||
virtual void mouseMove(int x, int y, const MouseState &mouseState);
|
||||
virtual void update();
|
||||
virtual bool wantExit() { return userWantsExit; }
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user