forked from Mirrors/openclonk
Move Game.pGUI to ::pGUI
parent
96080bd839
commit
760df013ba
|
@ -119,7 +119,6 @@ class C4Game
|
|||
C4GroupSet GroupSet;
|
||||
C4Group *pParentGroup;
|
||||
C4Extra Extra;
|
||||
C4GUIScreen *pGUI;
|
||||
C4ScenarioSection *pScenarioSections, *pCurrentScenarioSection;
|
||||
C4Effect *pGlobalEffects;
|
||||
#ifndef USE_CONSOLE
|
||||
|
|
|
@ -2732,5 +2732,5 @@ namespace C4GUI {
|
|||
}; // end of namespace
|
||||
|
||||
typedef C4GUI::Screen C4GUIScreen;
|
||||
|
||||
extern C4GUIScreen *pGUI;
|
||||
#endif
|
||||
|
|
|
@ -986,15 +986,15 @@ C4ChatDlg::~C4ChatDlg()
|
|||
|
||||
C4ChatDlg *C4ChatDlg::ShowChat()
|
||||
{
|
||||
if (!Game.pGUI) return NULL;
|
||||
if (!::pGUI) return NULL;
|
||||
if (!pInstance)
|
||||
{
|
||||
pInstance = new C4ChatDlg();
|
||||
pInstance->Show(Game.pGUI, true);
|
||||
pInstance->Show(::pGUI, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
Game.pGUI->ActivateDialog(pInstance);
|
||||
::pGUI->ActivateDialog(pInstance);
|
||||
}
|
||||
return pInstance;
|
||||
}
|
||||
|
|
|
@ -645,7 +645,7 @@ void C4ControlClientRemove::Execute() const
|
|||
::Network.ResList.RemoveAtClient(iID);
|
||||
// lobby callback
|
||||
C4GameLobby::MainDlg *pLobby = ::Network.GetLobby();
|
||||
if (pLobby && Game.pGUI) pLobby->OnClientPart(pClient);
|
||||
if (pLobby && ::pGUI) pLobby->OnClientPart(pClient);
|
||||
// player list callback
|
||||
::Network.Players.OnClientPart(pClient);
|
||||
// console callback
|
||||
|
|
|
@ -99,8 +99,8 @@ LRESULT APIENTRY FullScreenWinProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
|
|||
c[0] = (char)wParam;
|
||||
c[1] = 0;
|
||||
// GUI: forward
|
||||
if (Game.pGUI)
|
||||
if (Game.pGUI->CharIn(c))
|
||||
if (::pGUI)
|
||||
if (::pGUI->CharIn(c))
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ LRESULT APIENTRY FullScreenWinProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
|
|||
return DefWindowProc(hwnd, uMsg, wParam, lParam);
|
||||
}
|
||||
|
||||
void C4FullScreen::CharIn(const char * c) { Game.pGUI->CharIn(c); }
|
||||
void C4FullScreen::CharIn(const char * c) { ::pGUI->CharIn(c); }
|
||||
|
||||
#elif defined(USE_X11)
|
||||
#include <X11/Xlib.h>
|
||||
|
@ -328,8 +328,8 @@ void C4FullScreen::HandleMessage (SDL_Event &e)
|
|||
char c[2];
|
||||
c[0] = e.key.keysym.unicode;
|
||||
c[1] = 0;
|
||||
if (Game.pGUI && !isSpecialKey(e.key.keysym.unicode))
|
||||
Game.pGUI->CharIn(c);
|
||||
if (::pGUI && !isSpecialKey(e.key.keysym.unicode))
|
||||
::pGUI->CharIn(c);
|
||||
Game.DoKeyboardInput(e.key.keysym.sym, KEYEV_Down,
|
||||
e.key.keysym.mod & (KMOD_LALT | KMOD_RALT),
|
||||
e.key.keysym.mod & (KMOD_LCTRL | KMOD_RCTRL),
|
||||
|
@ -368,10 +368,10 @@ void C4FullScreen::HandleMessage (SDL_Event &e)
|
|||
#ifndef _WIN32
|
||||
void C4FullScreen::CharIn(const char *c)
|
||||
{
|
||||
if (Game.pGUI)
|
||||
if (::pGUI)
|
||||
{
|
||||
StdStrBuf c2; c2.Take(Languages.IconvClonk(c));
|
||||
Game.pGUI->CharIn(c2.getData());
|
||||
::pGUI->CharIn(c2.getData());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -463,13 +463,13 @@ BOOL C4FullScreen::ViewportCheck()
|
|||
bool C4FullScreen::ShowAbortDlg()
|
||||
{
|
||||
// no gui?
|
||||
if (!Game.pGUI) return false;
|
||||
if (!::pGUI) return false;
|
||||
// abort dialog already shown
|
||||
if (C4AbortGameDialog::IsShown()) return false;
|
||||
// not while game over dialog is open
|
||||
if (C4GameOverDlg::IsShown()) return false;
|
||||
// show abort dialog
|
||||
return Game.pGUI->ShowRemoveDlg(new C4AbortGameDialog());
|
||||
return ::pGUI->ShowRemoveDlg(new C4AbortGameDialog());
|
||||
}
|
||||
|
||||
bool C4FullScreen::ActivateMenuMain()
|
||||
|
|
|
@ -3525,12 +3525,12 @@ BOOL C4Game::InitNetworkFromAddress(const char *szAddress)
|
|||
Log(Message.getData());
|
||||
// Set up wait dialog
|
||||
C4GUI::MessageDialog *pDlg = NULL;
|
||||
if(Game.pGUI && !Console.Active)
|
||||
if(::pGUI && !Console.Active)
|
||||
{
|
||||
// create & show
|
||||
pDlg = new C4GUI::MessageDialog(Message.getData(), LoadResStr("IDS_NET_REFQUERY_QUERYTITLE"),
|
||||
C4GUI::MessageDialog::btnAbort, C4GUI::Ico_NetWait, C4GUI::MessageDialog::dsMedium);
|
||||
if(!pDlg || !pDlg->Show(Game.pGUI, true)) return FALSE;
|
||||
if(!pDlg || !pDlg->Show(::pGUI, true)) return FALSE;
|
||||
}
|
||||
// Wait for response
|
||||
while(RefClient.isBusy())
|
||||
|
@ -3539,7 +3539,7 @@ BOOL C4Game::InitNetworkFromAddress(const char *szAddress)
|
|||
if(!Application.ScheduleProcs(100) ||
|
||||
(pDlg && pDlg->IsAborted()))
|
||||
{
|
||||
if(Game.pGUI && pDlg) delete pDlg;
|
||||
if(::pGUI && pDlg) delete pDlg;
|
||||
return FALSE;
|
||||
}
|
||||
// Check if reference is received
|
||||
|
@ -3547,7 +3547,7 @@ BOOL C4Game::InitNetworkFromAddress(const char *szAddress)
|
|||
break;
|
||||
}
|
||||
// Close dialog
|
||||
if(Game.pGUI && pDlg) delete pDlg;
|
||||
if(::pGUI && pDlg) delete pDlg;
|
||||
// Error?
|
||||
if(!RefClient.isSuccess())
|
||||
{ LogFatal(FormatString(strRefQueryFailed.getData(), RefClient.GetError()).getData()); return FALSE; }
|
||||
|
|
|
@ -151,23 +151,23 @@ void C4GraphicsSystem::Execute()
|
|||
bool fBGDrawn = false;
|
||||
|
||||
// If lobby running, message board only (page flip done by startup message board)
|
||||
if (!Game.pGUI || !Game.pGUI->HasFullscreenDialog(true)) // allow for message board behind GUI
|
||||
if (!::pGUI || !::pGUI->HasFullscreenDialog(true)) // allow for message board behind GUI
|
||||
if(::Network.isLobbyActive() || !Game.IsRunning)
|
||||
if (Application.isFullScreen)
|
||||
{
|
||||
// Message board
|
||||
if (iRedrawBackground) ClearFullscreenBackground();
|
||||
MessageBoard.Execute();
|
||||
if (!Game.pGUI || !C4GUI::IsActive())
|
||||
if (!::pGUI || !C4GUI::IsActive())
|
||||
{ FinishDrawing(); return; }
|
||||
fBGDrawn = true;
|
||||
}
|
||||
|
||||
// fullscreen GUI?
|
||||
if (Application.isFullScreen && Game.pGUI && C4GUI::IsActive() && (Game.pGUI->HasFullscreenDialog(false) || !Game.IsRunning))
|
||||
if (Application.isFullScreen && ::pGUI && C4GUI::IsActive() && (::pGUI->HasFullscreenDialog(false) || !Game.IsRunning))
|
||||
{
|
||||
if (!fBGDrawn && iRedrawBackground) ClearFullscreenBackground();
|
||||
Game.pGUI->Render(!fBGDrawn);
|
||||
::pGUI->Render(!fBGDrawn);
|
||||
FinishDrawing();
|
||||
return;
|
||||
}
|
||||
|
@ -188,7 +188,7 @@ void C4GraphicsSystem::Execute()
|
|||
|
||||
// some hack to ensure the mouse is drawn after a dialog close and before any
|
||||
// movement messages
|
||||
if (Game.pGUI && !C4GUI::IsActive())
|
||||
if (::pGUI && !C4GUI::IsActive())
|
||||
SetMouseInGUI(false, false);
|
||||
|
||||
// Viewports
|
||||
|
@ -210,9 +210,9 @@ void C4GraphicsSystem::Execute()
|
|||
}
|
||||
|
||||
// InGame-GUI
|
||||
if (Game.pGUI && C4GUI::IsActive())
|
||||
if (::pGUI && C4GUI::IsActive())
|
||||
{
|
||||
Game.pGUI->Render(false);
|
||||
::pGUI->Render(false);
|
||||
}
|
||||
|
||||
// Palette update
|
||||
|
@ -427,8 +427,8 @@ void C4GraphicsSystem::RecalculateViewports()
|
|||
// StdWindow handles this.
|
||||
#endif
|
||||
// reset GUI dlg pos
|
||||
if (Game.pGUI)
|
||||
Game.pGUI->SetPreferredDlgRect(C4Rect(ViewportArea.X, ViewportArea.Y, ViewportArea.Wdt, ViewportArea.Hgt));
|
||||
if (::pGUI)
|
||||
::pGUI->SetPreferredDlgRect(C4Rect(ViewportArea.X, ViewportArea.Y, ViewportArea.Wdt, ViewportArea.Hgt));
|
||||
|
||||
// fullscreen background: First, cover all of screen
|
||||
BackgroundAreas.Clear();
|
||||
|
@ -543,10 +543,10 @@ void C4GraphicsSystem::MouseMove(int32_t iButton, int32_t iX, int32_t iY, DWORD
|
|||
{
|
||||
// pass on to GUI
|
||||
// Special: Don't pass if dragging and button is not upped
|
||||
if (Game.pGUI && Game.pGUI->IsActive() && !::MouseControl.IsDragging())
|
||||
if (::pGUI && ::pGUI->IsActive() && !::MouseControl.IsDragging())
|
||||
{
|
||||
bool fResult = Game.pGUI->MouseInput(iButton, iX, iY, dwKeyParam, NULL, pVP);
|
||||
if (Game.pGUI && Game.pGUI->HasMouseFocus()) { SetMouseInGUI(true, true); return; }
|
||||
bool fResult = ::pGUI->MouseInput(iButton, iX, iY, dwKeyParam, NULL, pVP);
|
||||
if (::pGUI && ::pGUI->HasMouseFocus()) { SetMouseInGUI(true, true); return; }
|
||||
// non-exclusive GUI: inform mouse-control about GUI-result
|
||||
SetMouseInGUI(fResult, true);
|
||||
// abort if GUI processed it
|
||||
|
@ -559,7 +559,7 @@ void C4GraphicsSystem::MouseMove(int32_t iButton, int32_t iX, int32_t iY, DWORD
|
|||
if (!::MouseControl.IsActive())
|
||||
{
|
||||
// enable mouse in GUI, if a mouse-only-dlg is displayed
|
||||
if (Game.pGUI && Game.pGUI->GetMouseControlledDialogCount())
|
||||
if (::pGUI && ::pGUI->GetMouseControlledDialogCount())
|
||||
SetMouseInGUI(true, true);
|
||||
return;
|
||||
}
|
||||
|
@ -581,14 +581,14 @@ void C4GraphicsSystem::MouseMoveToViewport(int32_t iButton, int32_t iX, int32_t
|
|||
void C4GraphicsSystem::SetMouseInGUI(bool fInGUI, bool fByMouse)
|
||||
{
|
||||
// inform mouse control and GUI
|
||||
if (Game.pGUI)
|
||||
if (::pGUI)
|
||||
{
|
||||
Game.pGUI->Mouse.SetOwnedMouse(fInGUI);
|
||||
::pGUI->Mouse.SetOwnedMouse(fInGUI);
|
||||
// initial movement to ensure mouse control pos is correct
|
||||
if (!::MouseControl.IsMouseOwned() && !fInGUI && !fByMouse)
|
||||
{
|
||||
::MouseControl.SetOwnedMouse(true);
|
||||
MouseMoveToViewport(C4MC_Button_None, int32_t(Game.pGUI->Mouse.x*C4GUI::GetZoom()), int32_t(Game.pGUI->Mouse.y*C4GUI::GetZoom()), Game.pGUI->Mouse.dwKeys);
|
||||
MouseMoveToViewport(C4MC_Button_None, int32_t(::pGUI->Mouse.x*C4GUI::GetZoom()), int32_t(::pGUI->Mouse.y*C4GUI::GetZoom()), ::pGUI->Mouse.dwKeys);
|
||||
}
|
||||
}
|
||||
::MouseControl.SetOwnedMouse(!fInGUI);
|
||||
|
|
|
@ -1209,3 +1209,5 @@ Screen *Screen::pScreen;
|
|||
|
||||
|
||||
}; // end of namespace
|
||||
|
||||
C4GUIScreen *pGUI;
|
||||
|
|
|
@ -210,7 +210,7 @@ CStdWindow * DialogWindow::Init(CStdApp * pApp, const char * Title, CStdWindow *
|
|||
LRESULT APIENTRY DialogWinProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
// Determine dialog
|
||||
Dialog *pDlg = Game.pGUI ? Game.pGUI->GetDialog(hwnd) : NULL;
|
||||
Dialog *pDlg = ::pGUI ? ::pGUI->GetDialog(hwnd) : NULL;
|
||||
if (!pDlg) return DefWindowProc(hwnd, uMsg, wParam, lParam);
|
||||
|
||||
// Process message
|
||||
|
@ -252,25 +252,25 @@ LRESULT APIENTRY DialogWinProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPara
|
|||
break;
|
||||
return 0;
|
||||
//----------------------------------------------------------------------------------------------------------------------------------
|
||||
case WM_LBUTTONDOWN: Game.pGUI->MouseInput(C4MC_Button_LeftDown,LOWORD(lParam),HIWORD(lParam),wParam, pDlg, NULL); break;
|
||||
case WM_LBUTTONDOWN: ::pGUI->MouseInput(C4MC_Button_LeftDown,LOWORD(lParam),HIWORD(lParam),wParam, pDlg, NULL); break;
|
||||
//----------------------------------------------------------------------------------------------------------------------------------
|
||||
case WM_LBUTTONUP: Game.pGUI->MouseInput(C4MC_Button_LeftUp,LOWORD(lParam),HIWORD(lParam),wParam, pDlg, NULL); break;
|
||||
case WM_LBUTTONUP: ::pGUI->MouseInput(C4MC_Button_LeftUp,LOWORD(lParam),HIWORD(lParam),wParam, pDlg, NULL); break;
|
||||
//----------------------------------------------------------------------------------------------------------------------------------
|
||||
case WM_RBUTTONDOWN: Game.pGUI->MouseInput(C4MC_Button_RightDown,LOWORD(lParam),HIWORD(lParam),wParam, pDlg, NULL); break;
|
||||
case WM_RBUTTONDOWN: ::pGUI->MouseInput(C4MC_Button_RightDown,LOWORD(lParam),HIWORD(lParam),wParam, pDlg, NULL); break;
|
||||
//----------------------------------------------------------------------------------------------------------------------------------
|
||||
case WM_RBUTTONUP: Game.pGUI->MouseInput(C4MC_Button_RightUp,LOWORD(lParam),HIWORD(lParam),wParam, pDlg, NULL); break;
|
||||
case WM_RBUTTONUP: ::pGUI->MouseInput(C4MC_Button_RightUp,LOWORD(lParam),HIWORD(lParam),wParam, pDlg, NULL); break;
|
||||
//----------------------------------------------------------------------------------------------------------------------------------
|
||||
case WM_LBUTTONDBLCLK: Game.pGUI->MouseInput(C4MC_Button_LeftDouble,LOWORD(lParam),HIWORD(lParam),wParam, pDlg, NULL); break;
|
||||
case WM_LBUTTONDBLCLK: ::pGUI->MouseInput(C4MC_Button_LeftDouble,LOWORD(lParam),HIWORD(lParam),wParam, pDlg, NULL); break;
|
||||
//----------------------------------------------------------------------------------------------------------------------------------
|
||||
case WM_RBUTTONDBLCLK: Game.pGUI->MouseInput(C4MC_Button_RightDouble,LOWORD(lParam),HIWORD(lParam),wParam, pDlg, NULL); break;
|
||||
case WM_RBUTTONDBLCLK: ::pGUI->MouseInput(C4MC_Button_RightDouble,LOWORD(lParam),HIWORD(lParam),wParam, pDlg, NULL); break;
|
||||
//----------------------------------------------------------------------------------------------------------------------------------
|
||||
case WM_MOUSEMOVE:
|
||||
//SetCursor(NULL);
|
||||
Game.pGUI->MouseInput(C4MC_Button_None,LOWORD(lParam),HIWORD(lParam),wParam, pDlg, NULL);
|
||||
::pGUI->MouseInput(C4MC_Button_None,LOWORD(lParam),HIWORD(lParam),wParam, pDlg, NULL);
|
||||
break;
|
||||
//----------------------------------------------------------------------------------------------------------------------------------
|
||||
case WM_MOUSEWHEEL:
|
||||
Game.pGUI->MouseInput(C4MC_Button_Wheel,LOWORD(lParam),HIWORD(lParam),wParam, pDlg, NULL);
|
||||
::pGUI->MouseInput(C4MC_Button_Wheel,LOWORD(lParam),HIWORD(lParam),wParam, pDlg, NULL);
|
||||
break;
|
||||
//----------------------------------------------------------------------------------------------------------------------------------
|
||||
}
|
||||
|
@ -315,7 +315,7 @@ CStdWindow * DialogWindow::Init(CStdApp * pApp, const char * Title, CStdWindow *
|
|||
void DialogWindow::Close()
|
||||
{
|
||||
// FIXME: Close the dialog of this window
|
||||
//Dialog *pDlg = Game.pGUI ? Game.pGUI->GetDialog(hWindow) : NULL;
|
||||
//Dialog *pDlg = ::pGUI ? ::pGUI->GetDialog(hWindow) : NULL;
|
||||
//if (pDlg) pDlg->Close();
|
||||
}
|
||||
|
||||
|
|
|
@ -190,8 +190,8 @@ namespace C4InVal
|
|||
const char *szWebCode = Config.GetRegistrationData("WebCode");
|
||||
if (szWebCode && *szWebCode) if (SSearchNoCase(szInput, szWebCode))
|
||||
{
|
||||
if (fShowWarningMessage && Game.pGUI)
|
||||
Game.pGUI->ShowErrorMessage(LoadResStr("IDS_ERR_WARNINGYOUWERETRYINGTOSEN"));
|
||||
if (fShowWarningMessage && ::pGUI)
|
||||
::pGUI->ShowErrorMessage(LoadResStr("IDS_ERR_WARNINGYOUWERETRYINGTOSEN"));
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -595,7 +595,7 @@ void C4LeagueSignupDialog::UserClose(bool fOK)
|
|||
if(!fOK)
|
||||
{
|
||||
Dialog::UserClose(fOK);
|
||||
Game.pGUI->ShowMessageModal(FormatString(LoadResStr("IDS_MSG_LEAGUESIGNUPCANCELLED"), strPlayerName.getData()).getData(), LoadResStr("IDS_DLG_LEAGUESIGNUP"), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Notify);
|
||||
::pGUI->ShowMessageModal(FormatString(LoadResStr("IDS_MSG_LEAGUESIGNUPCANCELLED"), strPlayerName.getData()).getData(), LoadResStr("IDS_DLG_LEAGUESIGNUP"), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Notify);
|
||||
return;
|
||||
}
|
||||
// Check for empty account name
|
||||
|
@ -603,21 +603,21 @@ void C4LeagueSignupDialog::UserClose(bool fOK)
|
|||
if(!szAccount || !*szAccount)
|
||||
{
|
||||
SetFocus(pEdtAccount->GetEdit(), false);
|
||||
Game.pGUI->ShowMessageModal(LoadResStr("IDS_MSG_LEAGUEMISSINGUSERNAME"), LoadResStr("IDS_DLG_INVALIDENTRY"), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
::pGUI->ShowMessageModal(LoadResStr("IDS_MSG_LEAGUEMISSINGUSERNAME"), LoadResStr("IDS_DLG_INVALIDENTRY"), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
return;
|
||||
}
|
||||
// Username contains invalid characters
|
||||
if (SCharCountEx(szAccount, C4League_Name_Valid_Characters) != SLen(szAccount))
|
||||
{
|
||||
SetFocus(pEdtAccount->GetEdit(), false);
|
||||
Game.pGUI->ShowMessageModal(LoadResStr("IDS_MSG_LEAGUEINVALIDUSERNAME"), LoadResStr("IDS_DLG_INVALIDENTRY"), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
::pGUI->ShowMessageModal(LoadResStr("IDS_MSG_LEAGUEINVALIDUSERNAME"), LoadResStr("IDS_DLG_INVALIDENTRY"), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
return;
|
||||
}
|
||||
// Username is too short
|
||||
if (SLen(szAccount) < 3)
|
||||
{
|
||||
SetFocus(pEdtAccount->GetEdit(), false);
|
||||
Game.pGUI->ShowMessageModal(LoadResStr("IDS_MSG_LEAGUEUSERNAMETOOSHORT"), LoadResStr("IDS_DLG_INVALIDENTRY"), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
::pGUI->ShowMessageModal(LoadResStr("IDS_MSG_LEAGUEUSERNAMETOOSHORT"), LoadResStr("IDS_DLG_INVALIDENTRY"), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
return;
|
||||
}
|
||||
// Check password
|
||||
|
@ -628,7 +628,7 @@ void C4LeagueSignupDialog::UserClose(bool fOK)
|
|||
if(!szPassword || !*szPassword)
|
||||
{
|
||||
SetFocus(pEdtPass->GetEdit(), false);
|
||||
Game.pGUI->ShowMessageModal(LoadResStr("IDS_MSG_LEAGUEMISSINGPASSWORD"), LoadResStr("IDS_DLG_INVALIDENTRY"), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
::pGUI->ShowMessageModal(LoadResStr("IDS_MSG_LEAGUEMISSINGPASSWORD"), LoadResStr("IDS_DLG_INVALIDENTRY"), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
return;
|
||||
}
|
||||
// Check second password
|
||||
|
@ -636,7 +636,7 @@ void C4LeagueSignupDialog::UserClose(bool fOK)
|
|||
{
|
||||
SetFocus(pEdtPass2->GetEdit(), false);
|
||||
pEdtPass2->GetEdit()->SetText("", false);
|
||||
Game.pGUI->ShowMessageModal(LoadResStr("IDS_MSG_LEAGUEMISMATCHPASSWORD"), LoadResStr("IDS_DLG_INVALIDENTRY"), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
::pGUI->ShowMessageModal(LoadResStr("IDS_MSG_LEAGUEMISMATCHPASSWORD"), LoadResStr("IDS_DLG_INVALIDENTRY"), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -648,9 +648,9 @@ bool C4LeagueSignupDialog::ShowModal(const char *szPlayerName, const char *szLea
|
|||
{
|
||||
// show league signup dlg modally; return whether user pressed OK and change user and pass buffers in that case
|
||||
assert(psCUID); assert(psPass);
|
||||
if (!psCUID || !psPass || !Game.pGUI) return false;
|
||||
if (!psCUID || !psPass || !::pGUI) return false;
|
||||
C4LeagueSignupDialog *pDlg = new C4LeagueSignupDialog(szPlayerName, szLeagueName, szLeagueServerName, psCUID->getData(), psPass->getData(), fWarnThirdParty, fRegister);
|
||||
bool fResult = Game.pGUI->ShowModalDlg(pDlg, false);
|
||||
bool fResult = ::pGUI->ShowModalDlg(pDlg, false);
|
||||
if (fResult)
|
||||
{
|
||||
psCUID->Copy(pDlg->GetAccount());
|
||||
|
|
|
@ -158,7 +158,7 @@ bool Log(const char *szMessage)
|
|||
Console.Out(szMessage);
|
||||
// pass on to lobby
|
||||
C4GameLobby::MainDlg *pLobby = ::Network.GetLobby();
|
||||
if (pLobby && Game.pGUI) pLobby->OnLog(szMessage);
|
||||
if (pLobby && ::pGUI) pLobby->OnLog(szMessage);
|
||||
|
||||
// Add message to log buffer
|
||||
bool fNotifyMsgBoard = false;
|
||||
|
|
|
@ -335,7 +335,7 @@ bool C4Menu::TryClose(bool fOK, bool fControl)
|
|||
// close the menu
|
||||
Close(fOK);
|
||||
Clear();
|
||||
if (Game.pGUI) Game.pGUI->RemoveElement(this);
|
||||
if (::pGUI) ::pGUI->RemoveElement(this);
|
||||
|
||||
// invoke close command
|
||||
if (fControl && CloseCommand.getData())
|
||||
|
@ -379,7 +379,7 @@ bool C4Menu::InitMenu(const char *szEmpty, int32_t iExtra, int32_t iExtraData, i
|
|||
if (iStyle & C4MN_Style_EqualItemHeight) SetEqualItemHeight(true);
|
||||
if (Style == C4MN_Style_Dialog) Alignment = C4MN_Align_Top;
|
||||
if (Style == C4MN_Style_Dialog) DrawMenuControls = 0;
|
||||
if (Game.pGUI) Game.pGUI->ShowDialog(this, false);
|
||||
if (::pGUI) ::pGUI->ShowDialog(this, false);
|
||||
fTextProgressing = false;
|
||||
fActive = true;
|
||||
return true;
|
||||
|
@ -831,8 +831,8 @@ void C4Menu::Draw(C4TargetFacet &cgo)
|
|||
if (!fTextProgressing) ++TimeOnSelection;
|
||||
if (TimeOnSelection >= C4MN_InfoCaption_Delay)
|
||||
if (Style != C4MN_Style_Info) // No tooltips in info menus - doesn't make any sense...
|
||||
if (!Game.Control.isReplay() && Game.pGUI)
|
||||
if (!Game.pGUI->Mouse.IsActiveInput())
|
||||
if (!Game.Control.isReplay() && ::pGUI)
|
||||
if (!::pGUI->Mouse.IsActiveInput())
|
||||
{
|
||||
C4MenuItem *pSel = GetSelectedItem();
|
||||
if (pSel && *pSel->InfoCaption)
|
||||
|
|
|
@ -356,7 +356,7 @@ void C4MessageBoard::LogNotify()
|
|||
// Not active
|
||||
if (!Active) return;
|
||||
// do not show startup board if GUI is active
|
||||
if (Game.pGUI && Game.pGUI->IsActive()) return;
|
||||
if (::pGUI && ::pGUI->IsActive()) return;
|
||||
// Reset
|
||||
iBackScroll=0;
|
||||
// Draw
|
||||
|
|
|
@ -297,7 +297,7 @@ bool C4MessageInput::StartTypeIn(bool fObjInput, C4Object *pObj, bool fUpperCase
|
|||
// close any previous
|
||||
if (IsTypeIn()) CloseTypeIn();
|
||||
// start new
|
||||
return Game.pGUI->ShowRemoveDlg(new C4ChatInputDialog(fObjInput, pObj, fUpperCase, fTeam, iPlr, rsInputQuery));
|
||||
return ::pGUI->ShowRemoveDlg(new C4ChatInputDialog(fObjInput, pObj, fUpperCase, fTeam, iPlr, rsInputQuery));
|
||||
}
|
||||
|
||||
bool C4MessageInput::KeyStartTypeIn(bool fTeam)
|
||||
|
|
|
@ -191,7 +191,7 @@ void C4MouseControl::UpdateClip()
|
|||
// fullscreen only
|
||||
if (!Application.isFullScreen) return;
|
||||
// application or mouse control not active? remove any clips
|
||||
if (!Active || !Application.Active || (Game.pGUI && Game.pGUI->HasMouseFocus())) { ClipCursor(NULL); return; }
|
||||
if (!Active || !Application.Active || (::pGUI && ::pGUI->HasMouseFocus())) { ClipCursor(NULL); return; }
|
||||
// get controlled viewport
|
||||
C4Viewport *pVP=::GraphicsSystem.GetViewport(Player);
|
||||
if (!pVP) { ClipCursor(NULL); return; }
|
||||
|
@ -207,8 +207,8 @@ void C4MouseControl::UpdateClip()
|
|||
}
|
||||
ClipCursor(&vpRct);
|
||||
// and inform GUI
|
||||
if (Game.pGUI)
|
||||
Game.pGUI->SetPreferredDlgRect(C4Rect(pVP->OutX, pVP->OutY, pVP->ViewWdt, pVP->ViewHgt));
|
||||
if (::pGUI)
|
||||
::pGUI->SetPreferredDlgRect(C4Rect(pVP->OutX, pVP->OutY, pVP->ViewWdt, pVP->ViewHgt));
|
||||
#endif
|
||||
//StdWindow manages this.
|
||||
}
|
||||
|
@ -458,7 +458,7 @@ void C4MouseControl::Draw(C4TargetFacet &cgo, const ZoomData &GameZoom)
|
|||
// Draw caption
|
||||
if (Caption)
|
||||
{
|
||||
if (IsHelpCaption && Game.pGUI)
|
||||
if (IsHelpCaption && ::pGUI)
|
||||
{
|
||||
// Help: Tooltip style
|
||||
C4TargetFacet cgoTip; cgoTip = static_cast<const C4Facet &>(cgo);
|
||||
|
|
|
@ -304,23 +304,23 @@ C4Network2::InitResult C4Network2::InitClient(const class C4Network2Address *pAd
|
|||
Log(strMessage.getData());
|
||||
// show box
|
||||
C4GUI::MessageDialog *pDlg = NULL;
|
||||
if(Game.pGUI && !Console.Active)
|
||||
if(::pGUI && !Console.Active)
|
||||
{
|
||||
// create & show
|
||||
pDlg = new C4GUI::MessageDialog(strMessage.getData(), LoadResStr("IDS_NET_JOINGAME"),
|
||||
C4GUI::MessageDialog::btnAbort, C4GUI::Ico_NetWait, C4GUI::MessageDialog::dsMedium);
|
||||
if(!pDlg->Show(Game.pGUI, true)) { Clear(); return IR_Fatal; }
|
||||
if(!pDlg->Show(::pGUI, true)) { Clear(); return IR_Fatal; }
|
||||
}
|
||||
// wait for connect / timeout / abort by user (host will change status on succesful connect)
|
||||
while(Status.getState() == GS_Init)
|
||||
{
|
||||
if(!Application.ScheduleProcs(100))
|
||||
{ if(Game.pGUI && pDlg) delete pDlg; return IR_Fatal;}
|
||||
{ if(::pGUI && pDlg) delete pDlg; return IR_Fatal;}
|
||||
if(pDlg && pDlg->IsAborted())
|
||||
{ if(Game.pGUI && pDlg) delete pDlg; return IR_Fatal; }
|
||||
{ if(::pGUI && pDlg) delete pDlg; return IR_Fatal; }
|
||||
}
|
||||
// Close dialog
|
||||
if(Game.pGUI && pDlg) delete pDlg;
|
||||
if(::pGUI && pDlg) delete pDlg;
|
||||
// error?
|
||||
if(!isEnabled())
|
||||
return IR_Error;
|
||||
|
@ -367,19 +367,19 @@ bool C4Network2::DoLobby()
|
|||
|
||||
// init lobby dialog
|
||||
pLobby = new C4GameLobby::MainDlg(isHost());
|
||||
if (!pLobby->FadeIn(Game.pGUI)) { delete pLobby; pLobby = NULL; Clear(); return FALSE; }
|
||||
if (!pLobby->FadeIn(::pGUI)) { delete pLobby; pLobby = NULL; Clear(); return FALSE; }
|
||||
|
||||
// init lobby countdown if specified
|
||||
if (Game.iLobbyTimeout) StartLobbyCountdown(Game.iLobbyTimeout);
|
||||
|
||||
// while state lobby: keep looping
|
||||
while(isLobbyActive() && Game.pGUI && pLobby && pLobby->IsShown())
|
||||
while(isLobbyActive() && ::pGUI && pLobby && pLobby->IsShown())
|
||||
if (!Application.ScheduleProcs())
|
||||
{ Clear(); return false; }
|
||||
|
||||
// check whether lobby was aborted; first checking Game.pGUI
|
||||
// check whether lobby was aborted; first checking ::pGUI
|
||||
// (because an external call to Game.Clear() would invalidate pLobby)
|
||||
if (!Game.pGUI) { pLobby = NULL; Clear(); return false; }
|
||||
if (!::pGUI) { pLobby = NULL; Clear(); return false; }
|
||||
if (pLobby && pLobby->IsAborted()) { delete pLobby; pLobby = NULL; Clear(); return false; }
|
||||
|
||||
// deinit lobby
|
||||
|
@ -387,7 +387,7 @@ bool C4Network2::DoLobby()
|
|||
delete pLobby; pLobby = NULL;
|
||||
|
||||
// close any other dialogs
|
||||
if (Game.pGUI) Game.pGUI->CloseAllDialogs(false);
|
||||
if (::pGUI) ::pGUI->CloseAllDialogs(false);
|
||||
}
|
||||
|
||||
// lobby end
|
||||
|
@ -453,7 +453,7 @@ bool C4Network2::FinalInit()
|
|||
|
||||
// show box
|
||||
C4GUI::Dialog *pDlg = NULL;
|
||||
if(Game.pGUI && !Console.Active)
|
||||
if(::pGUI && !Console.Active)
|
||||
{
|
||||
// seperate dlgs for host/client
|
||||
if (isHost())
|
||||
|
@ -462,7 +462,7 @@ bool C4Network2::FinalInit()
|
|||
pDlg = new C4GUI::MessageDialog(LoadResStr("IDS_NET_WAITFORSTART"), LoadResStr("IDS_NET_CAPTION"),
|
||||
C4GUI::MessageDialog::btnAbort, C4GUI::Ico_NetWait, C4GUI::MessageDialog::dsSmall);
|
||||
// show it
|
||||
if(!pDlg->Show(Game.pGUI, true)) return false;
|
||||
if(!pDlg->Show(::pGUI, true)) return false;
|
||||
}
|
||||
|
||||
// wait for acknowledgement
|
||||
|
@ -473,13 +473,13 @@ bool C4Network2::FinalInit()
|
|||
// execute
|
||||
if(!pDlg->Execute()) { delete pDlg; Clear(); return false; }
|
||||
// aborted?
|
||||
if(!Game.pGUI) { Clear(); return false;}
|
||||
if(!::pGUI) { Clear(); return false;}
|
||||
if(pDlg->IsAborted()) { delete pDlg; Clear(); return false; }
|
||||
}
|
||||
else if(!Application.ScheduleProcs())
|
||||
{ Clear(); return false; }
|
||||
}
|
||||
if(Game.pGUI && pDlg) delete pDlg;
|
||||
if(::pGUI && pDlg) delete pDlg;
|
||||
// log
|
||||
Log(LoadResStr("IDS_NET_START"));
|
||||
}
|
||||
|
@ -651,7 +651,7 @@ void C4Network2::Clear()
|
|||
iDynamicTick = -1; fDynamicNeeded = false;
|
||||
iLastActivateRequest = iLastChaseTargetUpdate = iLastReferenceUpdate = iLastLeagueUpdate = 0;
|
||||
fDelayedActivateReq = false;
|
||||
if(Game.pGUI) delete pVoteDialog; pVoteDialog = NULL;
|
||||
if(::pGUI) delete pVoteDialog; pVoteDialog = NULL;
|
||||
fPausedForVote = false;
|
||||
iLastOwnVoting = 0;
|
||||
// don't clear fPasswordNeeded here, it's needed by InitClient
|
||||
|
@ -689,7 +689,7 @@ StdStrBuf C4Network2::QueryClientPassword()
|
|||
StdStrBuf sCaption; sCaption.Copy(LoadResStr("IDS_MSG_ENTERPASSWORD"));
|
||||
C4GUI::InputDialog *pInputDlg = new C4GUI::InputDialog(LoadResStr("IDS_MSG_ENTERPASSWORD"), sCaption.getData(), C4GUI::Ico_Ex_Locked, NULL, false);
|
||||
pInputDlg->SetDelOnClose(false);
|
||||
if (!Game.pGUI->ShowModalDlg(pInputDlg, false))
|
||||
if (!::pGUI->ShowModalDlg(pInputDlg, false))
|
||||
{
|
||||
if (C4GUI::IsGUIValid()) delete pInputDlg;
|
||||
return StdStrBuf();
|
||||
|
@ -1545,13 +1545,13 @@ C4Network2Res::Ref C4Network2::RetrieveRes(const C4Network2ResCore &Core, int32_
|
|||
fLog = true;
|
||||
}
|
||||
// show progress dialog
|
||||
if(!pDlg && !Console.Active && Game.pGUI)
|
||||
if(!pDlg && !Console.Active && ::pGUI)
|
||||
{
|
||||
// create
|
||||
pDlg = new C4GUI::ProgressDialog(FormatString(LoadResStr("IDS_NET_WAITFORRES"), szResName).getData(),
|
||||
LoadResStr("IDS_NET_CAPTION"), 100, 0, C4GUI::Ico_NetWait);
|
||||
// show dialog
|
||||
if(!pDlg->Show(Game.pGUI, true)) { delete pDlg; return NULL; }
|
||||
if(!pDlg->Show(::pGUI, true)) { delete pDlg; return NULL; }
|
||||
}
|
||||
|
||||
// wait
|
||||
|
@ -1563,7 +1563,7 @@ C4Network2Res::Ref C4Network2::RetrieveRes(const C4Network2ResCore &Core, int32_
|
|||
if(!pDlg->Execute())
|
||||
{ if (pDlg) delete pDlg; return NULL; }
|
||||
// aborted?
|
||||
if(!Game.pGUI) return NULL;
|
||||
if(!::pGUI) return NULL;
|
||||
if(pDlg->IsAborted()) break;
|
||||
}
|
||||
else
|
||||
|
@ -1574,7 +1574,7 @@ C4Network2Res::Ref C4Network2::RetrieveRes(const C4Network2ResCore &Core, int32_
|
|||
|
||||
}
|
||||
// aborted
|
||||
if(!Game.pGUI) return NULL;
|
||||
if(!::pGUI) return NULL;
|
||||
delete pDlg;
|
||||
return NULL;
|
||||
}
|
||||
|
@ -1909,8 +1909,8 @@ bool C4Network2::InitLeague(bool *pCancel)
|
|||
Game.Parameters.LeagueAddress.Clear();
|
||||
// Show message, allow abort
|
||||
bool fResult = true;
|
||||
if(Game.pGUI && !Console.Active)
|
||||
fResult = Game.pGUI->ShowMessageModal(Message.getData(), LoadResStr("IDS_NET_ERR_LEAGUE"),
|
||||
if(::pGUI && !Console.Active)
|
||||
fResult = ::pGUI->ShowMessageModal(Message.getData(), LoadResStr("IDS_NET_ERR_LEAGUE"),
|
||||
(pCancel ? C4GUI::MessageDialog::btnOK : 0) | C4GUI::MessageDialog::btnAbort,
|
||||
C4GUI::Ico_Error);
|
||||
if (pCancel) *pCancel = fResult;
|
||||
|
@ -1955,10 +1955,10 @@ bool C4Network2::LeagueStart(bool *pCancel)
|
|||
StdStrBuf Message = FormatString(LoadResStr("IDS_NET_ERR_LEAGUE_STARTGAME"), pLeagueClient->GetError());
|
||||
LogFatal(Message.getData());
|
||||
// Show message
|
||||
if(Game.pGUI && !Console.Active)
|
||||
if(::pGUI && !Console.Active)
|
||||
{
|
||||
// Show option to cancel, if possible
|
||||
bool fResult = Game.pGUI->ShowMessageModal(
|
||||
bool fResult = ::pGUI->ShowMessageModal(
|
||||
Message.getData(),
|
||||
LoadResStr("IDS_NET_ERR_LEAGUE"),
|
||||
pCancel ? (C4GUI::MessageDialog::btnOK | C4GUI::MessageDialog::btnAbort) : C4GUI::MessageDialog::btnOK,
|
||||
|
@ -1980,12 +1980,12 @@ bool C4Network2::LeagueStart(bool *pCancel)
|
|||
Log(Message.getData());
|
||||
// Set up a dialog
|
||||
C4GUI::MessageDialog *pDlg = NULL;
|
||||
if(Game.pGUI && !Console.Active)
|
||||
if(::pGUI && !Console.Active)
|
||||
{
|
||||
// create & show
|
||||
pDlg = new C4GUI::MessageDialog(Message.getData(), LoadResStr("IDS_NET_LEAGUE_STARTGAME"),
|
||||
C4GUI::MessageDialog::btnAbort, C4GUI::Ico_NetWait, C4GUI::MessageDialog::dsRegular);
|
||||
if(!pDlg || !pDlg->Show(Game.pGUI, true)) return false;
|
||||
if(!pDlg || !pDlg->Show(::pGUI, true)) return false;
|
||||
}
|
||||
// Wait for response
|
||||
while(pLeagueClient->isBusy())
|
||||
|
@ -1995,7 +1995,7 @@ bool C4Network2::LeagueStart(bool *pCancel)
|
|||
(pDlg && pDlg->IsAborted()))
|
||||
{
|
||||
// Clear up
|
||||
if(Game.pGUI && pDlg) delete pDlg;
|
||||
if(::pGUI && pDlg) delete pDlg;
|
||||
return false;
|
||||
}
|
||||
// Check if league server has responded
|
||||
|
@ -2003,7 +2003,7 @@ bool C4Network2::LeagueStart(bool *pCancel)
|
|||
break;
|
||||
}
|
||||
// Close dialog
|
||||
if(Game.pGUI && pDlg)
|
||||
if(::pGUI && pDlg)
|
||||
{
|
||||
pDlg->Close(true);
|
||||
delete pDlg;
|
||||
|
@ -2021,10 +2021,10 @@ bool C4Network2::LeagueStart(bool *pCancel)
|
|||
// Log message
|
||||
Log(Message.getData());
|
||||
// Show message
|
||||
if(Game.pGUI && !Console.Active)
|
||||
if(::pGUI && !Console.Active)
|
||||
{
|
||||
// Show option to cancel, if possible
|
||||
bool fResult = Game.pGUI->ShowMessageModal(
|
||||
bool fResult = ::pGUI->ShowMessageModal(
|
||||
Message.getData(),
|
||||
LoadResStr("IDS_NET_ERR_LEAGUE"),
|
||||
pCancel ? (C4GUI::MessageDialog::btnOK | C4GUI::MessageDialog::btnAbort) : C4GUI::MessageDialog::btnOK,
|
||||
|
@ -2043,10 +2043,10 @@ bool C4Network2::LeagueStart(bool *pCancel)
|
|||
// Log message
|
||||
Log(Message.getData());
|
||||
// Show message
|
||||
if(Game.pGUI && !Console.Active)
|
||||
if(::pGUI && !Console.Active)
|
||||
{
|
||||
// Show option to cancel, if possible
|
||||
bool fResult = Game.pGUI->ShowMessageModal(
|
||||
bool fResult = ::pGUI->ShowMessageModal(
|
||||
Message.getData(),
|
||||
LoadResStr("IDS_NET_ERR_LEAGUE"),
|
||||
pCancel ? (C4GUI::MessageDialog::btnOK | C4GUI::MessageDialog::btnAbort) : C4GUI::MessageDialog::btnOK,
|
||||
|
@ -2182,8 +2182,8 @@ bool C4Network2::LeagueEnd(const char *szRecordName, const BYTE *pRecordSHA)
|
|||
sResultMessage = FormatString(LoadResStr("IDS_NET_ERR_LEAGUE_FINISHGAME"), pLeagueClient->GetError());
|
||||
Log(sResultMessage.getData());
|
||||
// Show message, allow retry
|
||||
if(!Game.pGUI || Console.Active) break;
|
||||
bool fRetry = Game.pGUI->ShowMessageModal(sResultMessage.getData(), LoadResStr("IDS_NET_ERR_LEAGUE"),
|
||||
if(!::pGUI || Console.Active) break;
|
||||
bool fRetry = ::pGUI->ShowMessageModal(sResultMessage.getData(), LoadResStr("IDS_NET_ERR_LEAGUE"),
|
||||
C4GUI::MessageDialog::btnRetryAbort, C4GUI::Ico_Error);
|
||||
if (fRetry) continue;
|
||||
break;
|
||||
|
@ -2206,10 +2206,10 @@ bool C4Network2::LeagueEnd(const char *szRecordName, const BYTE *pRecordSHA)
|
|||
LeagueServerMessage.getLength() ? LeagueServerMessage.getData() :
|
||||
LoadResStr("IDS_NET_ERR_LEAGUE_EMPTYREPLY");
|
||||
sResultMessage.Take(FormatString(LoadResStr("IDS_NET_ERR_LEAGUE_SENDRESULT"), pError));
|
||||
if(!Game.pGUI || Console.Active) continue;
|
||||
if(!::pGUI || Console.Active) continue;
|
||||
// Only retry if we didn't get an answer from the league server
|
||||
bool fRetry = !pLeagueClient->isSuccess();
|
||||
fRetry = Game.pGUI->ShowMessageModal(sResultMessage.getData(), LoadResStr("IDS_NET_ERR_LEAGUE"),
|
||||
fRetry = ::pGUI->ShowMessageModal(sResultMessage.getData(), LoadResStr("IDS_NET_ERR_LEAGUE"),
|
||||
fRetry ? C4GUI::MessageDialog::btnRetryAbort : C4GUI::MessageDialog::btnAbort,
|
||||
C4GUI::Ico_Error);
|
||||
if (fRetry) continue;
|
||||
|
@ -2313,11 +2313,11 @@ bool C4Network2::LeaguePlrAuth(C4PlayerInfo *pInfo)
|
|||
Log(Message.getData());
|
||||
// Set up a dialog
|
||||
C4GUI::MessageDialog *pDlg = NULL;
|
||||
if(Game.pGUI && !Console.Active)
|
||||
if(::pGUI && !Console.Active)
|
||||
{
|
||||
// create & show
|
||||
pDlg = new C4GUI::MessageDialog(Message.getData(), LoadResStr("IDS_DLG_LEAGUESIGNUP"), C4GUI::MessageDialog::btnAbort, C4GUI::Ico_NetWait, C4GUI::MessageDialog::dsRegular);
|
||||
if(!pDlg || !pDlg->Show(Game.pGUI, true)) return false;
|
||||
if(!pDlg || !pDlg->Show(::pGUI, true)) return false;
|
||||
}
|
||||
// Wait for response
|
||||
while(pLeagueClient->isBusy())
|
||||
|
@ -2327,7 +2327,7 @@ bool C4Network2::LeaguePlrAuth(C4PlayerInfo *pInfo)
|
|||
(pDlg && pDlg->IsAborted()))
|
||||
{
|
||||
// Clear up
|
||||
if(Game.pGUI && pDlg) delete pDlg;
|
||||
if(::pGUI && pDlg) delete pDlg;
|
||||
return false;
|
||||
}
|
||||
// Check if league server has responded
|
||||
|
@ -2335,7 +2335,7 @@ bool C4Network2::LeaguePlrAuth(C4PlayerInfo *pInfo)
|
|||
break;
|
||||
}
|
||||
// Close dialog
|
||||
if(Game.pGUI && pDlg)
|
||||
if(::pGUI && pDlg)
|
||||
{
|
||||
pDlg->Close(true);
|
||||
delete pDlg;
|
||||
|
@ -2352,15 +2352,15 @@ bool C4Network2::LeaguePlrAuth(C4PlayerInfo *pInfo)
|
|||
// Show welcome message, if any
|
||||
bool fSuccess;
|
||||
if(Message.getLength())
|
||||
fSuccess = Game.pGUI->ShowMessageModal(
|
||||
fSuccess = ::pGUI->ShowMessageModal(
|
||||
Message.getData(), LoadResStr("IDS_DLG_LEAGUESIGNUPCONFIRM"),
|
||||
C4GUI::MessageDialog::btnOKAbort, C4GUI::Ico_Ex_League);
|
||||
else if(AccountMaster.getLength())
|
||||
fSuccess = Game.pGUI->ShowMessageModal(
|
||||
fSuccess = ::pGUI->ShowMessageModal(
|
||||
FormatString(LoadResStr("IDS_MSG_LEAGUEPLAYERSIGNUPAS"), pInfo->GetName(), AccountMaster.getData(), pLeagueClient->getServerName()).getData(), LoadResStr("IDS_DLG_LEAGUESIGNUPCONFIRM"),
|
||||
C4GUI::MessageDialog::btnOKAbort, C4GUI::Ico_Ex_League);
|
||||
else
|
||||
fSuccess = Game.pGUI->ShowMessageModal(
|
||||
fSuccess = ::pGUI->ShowMessageModal(
|
||||
FormatString(LoadResStr("IDS_MSG_LEAGUEPLAYERSIGNUP"), pInfo->GetName(), pLeagueClient->getServerName()).getData(), LoadResStr("IDS_DLG_LEAGUESIGNUPCONFIRM"),
|
||||
C4GUI::MessageDialog::btnOKAbort, C4GUI::Ico_Ex_League);
|
||||
|
||||
|
@ -2370,7 +2370,7 @@ bool C4Network2::LeaguePlrAuth(C4PlayerInfo *pInfo)
|
|||
return true;
|
||||
else
|
||||
// Sign-up was cancelled by user
|
||||
Game.pGUI->ShowMessageModal(FormatString(LoadResStr("IDS_MSG_LEAGUESIGNUPCANCELLED"), pInfo->GetName()).getData(), LoadResStr("IDS_DLG_LEAGUESIGNUP"), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Notify);
|
||||
::pGUI->ShowMessageModal(FormatString(LoadResStr("IDS_MSG_LEAGUESIGNUPCANCELLED"), pInfo->GetName()).getData(), LoadResStr("IDS_DLG_LEAGUESIGNUP"), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Notify);
|
||||
|
||||
}
|
||||
else
|
||||
|
@ -2380,7 +2380,7 @@ bool C4Network2::LeaguePlrAuth(C4PlayerInfo *pInfo)
|
|||
if((!fWebCode && !fUnregistered) || fRegister)
|
||||
{
|
||||
LogF(LoadResStr("IDS_MSG_LEAGUESIGNUPERROR"), Message.getData());
|
||||
Game.pGUI->ShowMessageModal(FormatString(LoadResStr("IDS_MSG_LEAGUESERVERMSG"), Message.getData()).getData(), LoadResStr("IDS_DLG_LEAGUESIGNUPFAILED"), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
::pGUI->ShowMessageModal(FormatString(LoadResStr("IDS_MSG_LEAGUESERVERMSG"), Message.getData()).getData(), LoadResStr("IDS_DLG_LEAGUESIGNUPFAILED"), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
// after a league server error message, always fall-through to try again
|
||||
}
|
||||
|
||||
|
@ -2500,9 +2500,9 @@ void C4Network2::LeagueSurrender()
|
|||
|
||||
void C4Network2::LeagueShowError(const char *szMsg)
|
||||
{
|
||||
if (Game.pGUI && Application.isFullScreen)
|
||||
if (::pGUI && Application.isFullScreen)
|
||||
{
|
||||
Game.pGUI->ShowErrorMessage(szMsg);
|
||||
::pGUI->ShowErrorMessage(szMsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2613,7 +2613,7 @@ void C4Network2::OpenVoteDialog()
|
|||
// Dialog already open?
|
||||
if(pVoteDialog) return;
|
||||
// No GUI?
|
||||
if(!Game.pGUI) return;
|
||||
if(!::pGUI) return;
|
||||
// No vote available?
|
||||
if(!Votes.firstPkt()) return;
|
||||
// Can't vote?
|
||||
|
@ -2636,7 +2636,7 @@ void C4Network2::OpenVoteDialog()
|
|||
// Open dialog
|
||||
pVoteDialog = new C4VoteDialog(Msg.getData(), pVote->getType(), pVote->getData(), false);
|
||||
pVoteDialog->SetDelOnClose();
|
||||
pVoteDialog->Show(Game.pGUI, true);
|
||||
pVoteDialog->Show(::pGUI, true);
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -2650,7 +2650,7 @@ void C4Network2::OpenSurrenderDialog(C4ControlVoteType eType, int32_t iData)
|
|||
pVoteDialog = new C4VoteDialog(
|
||||
LoadResStr("IDS_VOTE_SURRENDERWARNING"), eType, iData, true);
|
||||
pVoteDialog->SetDelOnClose();
|
||||
pVoteDialog->Show(Game.pGUI, true);
|
||||
pVoteDialog->Show(::pGUI, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -456,7 +456,7 @@ void C4Network2ClientListBox::Update()
|
|||
C4Network2ClientListDlg *C4Network2ClientListDlg::pInstance = NULL;
|
||||
|
||||
C4Network2ClientListDlg::C4Network2ClientListDlg()
|
||||
: Dialog(Game.pGUI->GetPreferredDlgRect().Wdt*3/4, Game.pGUI->GetPreferredDlgRect().Hgt*3/4, LoadResStr("IDS_NET_CAPTION"), false)
|
||||
: Dialog(::pGUI->GetPreferredDlgRect().Wdt*3/4, ::pGUI->GetPreferredDlgRect().Hgt*3/4, LoadResStr("IDS_NET_CAPTION"), false)
|
||||
{
|
||||
// component layout
|
||||
CStdFont *pUseFont = &C4GUI::GetRes()->TextFont;
|
||||
|
@ -499,7 +499,7 @@ bool C4Network2ClientListDlg::Toggle()
|
|||
// toggle off?
|
||||
if (pInstance) { pInstance->Close(true); return true; }
|
||||
// toggle on!
|
||||
return Game.pGUI->ShowRemoveDlg(pInstance = new C4Network2ClientListDlg());
|
||||
return ::pGUI->ShowRemoveDlg(pInstance = new C4Network2ClientListDlg());
|
||||
}
|
||||
|
||||
|
||||
|
@ -955,5 +955,5 @@ void C4ChartDialog::Toggle()
|
|||
if (pChartDlg) { pChartDlg->Close(false); return; }
|
||||
// otherwise, open
|
||||
C4ChartDialog *pDlg = new C4ChartDialog();
|
||||
if (!Game.pGUI->ShowRemoveDlg(pDlg)) if (pChartDlg) delete pChartDlg;
|
||||
if (!::pGUI->ShowRemoveDlg(pDlg)) if (pChartDlg) delete pChartDlg;
|
||||
}
|
||||
|
|
|
@ -1428,8 +1428,8 @@ bool C4PlayerInfoList::RestoreSavegameInfos(C4PlayerInfoList &rSavegamePlayers)
|
|||
// this is a "wild" match: Warn the player (but not in replays)
|
||||
StdStrBuf sMsg; sMsg.Format(LoadResStr("IDS_MSG_PLAYERASSIGNMENT"), pInfo->GetName(), pSavegameInfo->GetName());
|
||||
Log(sMsg.getData());
|
||||
if (Game.pGUI && FullScreen.Active && !Game.C4S.Head.Replay)
|
||||
Game.pGUI->ShowMessageModal(sMsg.getData(), LoadResStr("IDS_MSG_FREESAVEGAMEPLRS"), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Notify, &Config.Startup.HideMsgPlrTakeOver);
|
||||
if (::pGUI && FullScreen.Active && !Game.C4S.Head.Replay)
|
||||
::pGUI->ShowMessageModal(sMsg.getData(), LoadResStr("IDS_MSG_FREESAVEGAMEPLRS"), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Notify, &Config.Startup.HideMsgPlrTakeOver);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -939,7 +939,7 @@ void C4PlayerInfoListBox::ClientListItem::OnCtxActivate(C4GUI::Element *pListIte
|
|||
void C4PlayerInfoListBox::ClientListItem::OnCtxInfo(C4GUI::Element *pListItem)
|
||||
{
|
||||
// show client info dialog
|
||||
Game.pGUI->ShowRemoveDlg(new C4Network2ClientDlg(idClient));
|
||||
::pGUI->ShowRemoveDlg(new C4Network2ClientDlg(idClient));
|
||||
}
|
||||
|
||||
void C4PlayerInfoListBox::ClientListItem::OnBtnAddPlr(C4GUI::Control *btn)
|
||||
|
|
|
@ -259,7 +259,7 @@ void C4Scoreboard::InvalidateRows()
|
|||
void C4Scoreboard::DoDlgShow(int32_t iChange, bool fUserToggle)
|
||||
{
|
||||
// safety: Only if GUI loaded, and GUI already in exclusive mode
|
||||
if (!C4GUI::IsGUIValid() || Game.pGUI->IsExclusive()) return;
|
||||
if (!C4GUI::IsGUIValid() || ::pGUI->IsExclusive()) return;
|
||||
// update dlg show
|
||||
iDlgShow += iChange;
|
||||
if (!fUserToggle)
|
||||
|
@ -273,7 +273,7 @@ void C4Scoreboard::DoDlgShow(int32_t iChange, bool fUserToggle)
|
|||
if (!pDlg)
|
||||
{
|
||||
if (!C4GameOverDlg::IsShown()) // never show during game over dlg
|
||||
Game.pGUI->ShowRemoveDlg(pDlg = new C4ScoreboardDlg(this));
|
||||
::pGUI->ShowRemoveDlg(pDlg = new C4ScoreboardDlg(this));
|
||||
}
|
||||
else
|
||||
pDlg->Close(false);
|
||||
|
@ -283,7 +283,7 @@ void C4Scoreboard::DoDlgShow(int32_t iChange, bool fUserToggle)
|
|||
void C4Scoreboard::HideDlg()
|
||||
{
|
||||
// safety: Only if GUI loaded, and GUI already in exclusive mode
|
||||
if (!C4GUI::IsGUIValid() || Game.pGUI->IsExclusive()) return;
|
||||
if (!C4GUI::IsGUIValid() || ::pGUI->IsExclusive()) return;
|
||||
// hide scoreboard if it was active
|
||||
if (pDlg) pDlg->Close(false);
|
||||
}
|
||||
|
|
|
@ -157,7 +157,7 @@ C4Startup::C4Startup() : fInStartup(false), fAborted(false), pLastDlg(NULL), pCu
|
|||
C4Startup::~C4Startup()
|
||||
{
|
||||
pInstance = NULL;
|
||||
if (Game.pGUI)
|
||||
if (::pGUI)
|
||||
{
|
||||
if (pLastDlg) delete pLastDlg;
|
||||
if (pCurrDlg) delete pCurrDlg;
|
||||
|
@ -231,7 +231,7 @@ C4StartupDlg *C4Startup::SwitchDialog(DialogID eToDlg, bool fFade)
|
|||
if (pLastDlg = pCurrDlg)
|
||||
if (fFade)
|
||||
{
|
||||
if (!pLastDlg->IsShown()) pLastDlg->Show(Game.pGUI, false);
|
||||
if (!pLastDlg->IsShown()) pLastDlg->Show(::pGUI, false);
|
||||
pLastDlg->FadeOut(true);
|
||||
}
|
||||
else
|
||||
|
@ -244,7 +244,7 @@ C4StartupDlg *C4Startup::SwitchDialog(DialogID eToDlg, bool fFade)
|
|||
// fade in new dlg
|
||||
if (fFade)
|
||||
{
|
||||
if (!pToDlg->FadeIn(Game.pGUI))
|
||||
if (!pToDlg->FadeIn(::pGUI))
|
||||
{
|
||||
delete pToDlg; pCurrDlg=NULL;
|
||||
return NULL;
|
||||
|
@ -252,7 +252,7 @@ C4StartupDlg *C4Startup::SwitchDialog(DialogID eToDlg, bool fFade)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (!pToDlg->Show(Game.pGUI, true))
|
||||
if (!pToDlg->Show(::pGUI, true))
|
||||
{
|
||||
delete pToDlg; pCurrDlg=NULL;
|
||||
return NULL;
|
||||
|
@ -264,7 +264,7 @@ C4StartupDlg *C4Startup::SwitchDialog(DialogID eToDlg, bool fFade)
|
|||
bool C4Startup::DoStartup()
|
||||
{
|
||||
assert(!fInStartup);
|
||||
assert(Game.pGUI);
|
||||
assert(::pGUI);
|
||||
// now in startup!
|
||||
fInStartup = true;
|
||||
fLastDlgWasBack = false;
|
||||
|
@ -303,7 +303,7 @@ bool C4Startup::DoStartup()
|
|||
const char *szErr = GetFatalError();
|
||||
if (szErr)
|
||||
{
|
||||
Game.pGUI->ShowMessage(szErr, LoadResStr("IDS_DLG_LOG"), C4GUI::Ico_Error);
|
||||
::pGUI->ShowMessage(szErr, LoadResStr("IDS_DLG_LOG"), C4GUI::Ico_Error);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -311,18 +311,18 @@ bool C4Startup::DoStartup()
|
|||
StdStrBuf sLastLog;
|
||||
if (GetLogSection(Game.StartupLogPos, Game.QuitLogPos - Game.StartupLogPos, sLastLog))
|
||||
if (!sLastLog.isNull())
|
||||
Game.pGUI->ShowRemoveDlg(new C4GUI::InfoDialog(LoadResStr("IDS_DLG_LOG"), 10, sLastLog));
|
||||
::pGUI->ShowRemoveDlg(new C4GUI::InfoDialog(LoadResStr("IDS_DLG_LOG"), 10, sLastLog));
|
||||
}
|
||||
ResetFatalError();
|
||||
}
|
||||
|
||||
// while state startup: keep looping
|
||||
while(fInStartup && Game.pGUI && !pCurrDlg->IsAborted())
|
||||
while(fInStartup && ::pGUI && !pCurrDlg->IsAborted())
|
||||
if (!Application.ScheduleProcs()) return false;
|
||||
|
||||
// check whether startup was aborted; first checking Game.pGUI
|
||||
// check whether startup was aborted; first checking ::pGUI
|
||||
// (because an external call to Game.Clear() would invalidate dialogs)
|
||||
if (!Game.pGUI) return false;
|
||||
if (!::pGUI) return false;
|
||||
if (pLastDlg) { delete pLastDlg; pLastDlg = NULL; }
|
||||
if (pCurrDlg)
|
||||
{
|
||||
|
@ -344,11 +344,11 @@ bool C4Startup::DoStartup()
|
|||
fInStartup = false;
|
||||
|
||||
// after startup: cleanup
|
||||
if (Game.pGUI) Game.pGUI->CloseAllDialogs(true);
|
||||
if (::pGUI) ::pGUI->CloseAllDialogs(true);
|
||||
|
||||
// reinit keyboard to reflect any config changes that might have been done
|
||||
// this is a good time to do it, because no GUI dialogs are opened
|
||||
if (Game.pGUI) if (!Game.InitKeyboard()) LogFatal(LoadResStr("IDS_ERR_NOKEYBOARD"));
|
||||
if (::pGUI) if (!Game.InitKeyboard()) LogFatal(LoadResStr("IDS_ERR_NOKEYBOARD"));
|
||||
|
||||
// all okay; return whether startup finished with a game start selection
|
||||
return !fAborted;
|
||||
|
@ -357,7 +357,7 @@ bool C4Startup::DoStartup()
|
|||
C4Startup *C4Startup::EnsureLoaded()
|
||||
{
|
||||
// create and load startup data if not done yet
|
||||
assert(Game.pGUI);
|
||||
assert(::pGUI);
|
||||
if (!pInstance)
|
||||
{
|
||||
Game.SetInitProgress(40);
|
||||
|
|
|
@ -969,7 +969,7 @@ bool C4StartupNetDlg::DoOK()
|
|||
if(!pSelection)
|
||||
{
|
||||
// no ref selected: Oh noes!
|
||||
Game.pGUI->ShowMessageModal(
|
||||
::pGUI->ShowMessageModal(
|
||||
LoadResStr("IDS_NET_NOJOIN_NOREF"),
|
||||
strNoJoin.getData(),
|
||||
C4GUI::MessageDialog::btnOK,
|
||||
|
@ -981,7 +981,7 @@ bool C4StartupNetDlg::DoOK()
|
|||
if (szError = pRefEntry->GetError())
|
||||
{
|
||||
// erroneous ref selected: Oh noes!
|
||||
Game.pGUI->ShowMessageModal(
|
||||
::pGUI->ShowMessageModal(
|
||||
FormatString(LoadResStr("IDS_NET_NOJOIN_BADREF"), szError).getData(),
|
||||
strNoJoin.getData(),
|
||||
C4GUI::MessageDialog::btnOK,
|
||||
|
@ -993,7 +993,7 @@ bool C4StartupNetDlg::DoOK()
|
|||
if (!pRef && !(szDirectJoinAddress && *szDirectJoinAddress))
|
||||
{
|
||||
// something strange has been selected (e.g., a masterserver entry). Error.
|
||||
Game.pGUI->ShowMessageModal(
|
||||
::pGUI->ShowMessageModal(
|
||||
LoadResStr("IDS_NET_NOJOIN_NOREF"),
|
||||
strNoJoin.getData(),
|
||||
C4GUI::MessageDialog::btnOK,
|
||||
|
@ -1007,7 +1007,7 @@ bool C4StartupNetDlg::DoOK()
|
|||
C4GameVersion verThis;
|
||||
if (!(pRef->getGameVersion() == verThis))
|
||||
{
|
||||
Game.pGUI->ShowMessageModal(
|
||||
::pGUI->ShowMessageModal(
|
||||
FormatString(LoadResStr("IDS_NET_NOJOIN_BADVER"),
|
||||
pRef->getGameVersion().GetString().getData(),
|
||||
verThis.GetString().getData()).getData(),
|
||||
|
@ -1020,7 +1020,7 @@ bool C4StartupNetDlg::DoOK()
|
|||
if (pRef->isRegJoinOnly())
|
||||
if (!Config.Registered())
|
||||
{
|
||||
Game.pGUI->ShowMessageModal(LoadResStr("IDS_NET_REGJOINONLY"),
|
||||
::pGUI->ShowMessageModal(LoadResStr("IDS_NET_REGJOINONLY"),
|
||||
strNoJoin.getData(),
|
||||
C4GUI::MessageDialog::btnOK,
|
||||
C4GUI::Ico_Error);
|
||||
|
@ -1029,7 +1029,7 @@ bool C4StartupNetDlg::DoOK()
|
|||
// no runtime join
|
||||
if (!pRef->isJoinAllowed())
|
||||
{
|
||||
if (!Game.pGUI->ShowMessageModal(
|
||||
if (!::pGUI->ShowMessageModal(
|
||||
LoadResStr("IDS_NET_NOJOIN_NORUNTIME"),
|
||||
strNoJoin.getData(),
|
||||
C4GUI::MessageDialog::btnYes | C4GUI::MessageDialog::btnNo,
|
||||
|
@ -1079,7 +1079,7 @@ void C4StartupNetDlg::DoRefresh()
|
|||
if(!DiscoverClient.StartDiscovery())
|
||||
{
|
||||
StdCopyStrBuf strNoDiscovery(LoadResStr("IDS_NET_NODISCOVERY"));
|
||||
Game.pGUI->ShowMessageModal(
|
||||
::pGUI->ShowMessageModal(
|
||||
FormatString(LoadResStr("IDS_NET_NODISCOVERY_DESC"), DiscoverClient.GetError()).getData(),
|
||||
strNoDiscovery.getData(),
|
||||
C4GUI::MessageDialog::btnAbort,
|
||||
|
|
|
@ -428,7 +428,7 @@ void C4StartupOptionsDlg::ControlConfigArea::OnGUIGamepadCheckChange(C4GUI::Elem
|
|||
if (fChecked == !!Config.Controls.GamepadGuiControl) return;
|
||||
// reflect change
|
||||
Config.Controls.GamepadGuiControl = fChecked;
|
||||
Game.pGUI->UpdateGamepadGUIControlEnabled();
|
||||
::pGUI->UpdateGamepadGUIControlEnabled();
|
||||
pOptionsDlg->RecreateDialog(false);
|
||||
}
|
||||
|
||||
|
|
|
@ -401,7 +401,7 @@ void C4StartupPlrSelDlg::CrewListItem::OnDeathMessageCtx(C4GUI::Element *el)
|
|||
// Registered version only
|
||||
if (!Config.Registered())
|
||||
{
|
||||
Game.pGUI->ShowMessageModal(LoadResStr("IDS_CTL_REGISTEREDONLY"), LoadResStr("IDS_MSG_SETDEATHMESSAGE"), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
::pGUI->ShowMessageModal(LoadResStr("IDS_CTL_REGISTEREDONLY"), LoadResStr("IDS_MSG_SETDEATHMESSAGE"), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
return;
|
||||
}
|
||||
// Death message dialog
|
||||
|
@ -453,14 +453,14 @@ bool C4StartupPlrSelDlg::CrewListItem::SetName(const char *szNewName)
|
|||
if (pParentGrp->FindEntry(fn))
|
||||
{
|
||||
StdStrBuf sMsg; sMsg.Format(LoadResStr("IDS_ERR_CLONKCOLLISION"), fn);
|
||||
Game.pGUI->ShowMessageModal(sMsg.getData(), LoadResStr("IDS_FAIL_RENAME"), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
::pGUI->ShowMessageModal(sMsg.getData(), LoadResStr("IDS_FAIL_RENAME"), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
return false;
|
||||
}
|
||||
// OK; then rename
|
||||
if (!pParentGrp->Rename(GetFilename().getData(), fn) || !pParentGrp->Save(TRUE))
|
||||
{
|
||||
StdStrBuf sMsg; sMsg.Format(LoadResStr("IDS_ERR_RENAMEFILE"), GetFilename().getData(), fn);
|
||||
Game.pGUI->ShowMessageModal(sMsg.getData(), LoadResStr("IDS_FAIL_RENAME"), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
::pGUI->ShowMessageModal(sMsg.getData(), LoadResStr("IDS_FAIL_RENAME"), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
return false;
|
||||
}
|
||||
const char *szConstFn = fn;
|
||||
|
|
|
@ -623,14 +623,14 @@ bool C4ScenarioListLoader::Entry::RenameTo(const char *szNewName)
|
|||
if (ItemExists(fullfn))
|
||||
{
|
||||
StdStrBuf sMsg; sMsg.Format(LoadResStr("IDS_ERR_FILEEXISTS"), fullfn);
|
||||
Game.pGUI->ShowMessageModal(sMsg.getData(), strErr.getData(), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
::pGUI->ShowMessageModal(sMsg.getData(), strErr.getData(), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
return false;
|
||||
}
|
||||
// OK; then rename
|
||||
if (!C4Group_MoveItem(sFilename.getData(), fullfn, true))
|
||||
{
|
||||
StdStrBuf sMsg; sMsg.Format(LoadResStr("IDS_ERR_RENAMEFILE"), sFilename.getData(), fullfn);
|
||||
Game.pGUI->ShowMessageModal(sMsg.getData(), strErr.getData(), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
::pGUI->ShowMessageModal(sMsg.getData(), strErr.getData(), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
return false;
|
||||
}
|
||||
sFilename.Copy(fullfn);
|
||||
|
@ -642,20 +642,20 @@ bool C4ScenarioListLoader::Entry::RenameTo(const char *szNewName)
|
|||
if (!Grp.Open(fullfn))
|
||||
{
|
||||
StdStrBuf sMsg; sMsg.Format(LoadResStr("IDS_ERR_OPENFILE"), sFilename.getData(), Grp.GetError());
|
||||
Game.pGUI->ShowMessageModal(sMsg.getData(), strErr.getData(), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
::pGUI->ShowMessageModal(sMsg.getData(), strErr.getData(), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
return false;
|
||||
}
|
||||
if (!Grp.Delete(C4CFN_Title))
|
||||
{
|
||||
StdStrBuf sMsg; sMsg.Format(LoadResStr("IDS_ERR_DELOLDTITLE"), sFilename.getData(), Grp.GetError());
|
||||
Game.pGUI->ShowMessageModal(sMsg.getData(), strErr.getData(), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
::pGUI->ShowMessageModal(sMsg.getData(), strErr.getData(), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
return false;
|
||||
}
|
||||
if (!SetTitleInGroup(Grp, szNewName)) return false;
|
||||
if (!Grp.Close())
|
||||
{
|
||||
StdStrBuf sMsg; sMsg.Format(LoadResStr("IDS_ERR_WRITENEWTITLE"), sFilename.getData(), Grp.GetError());
|
||||
Game.pGUI->ShowMessageModal(sMsg.getData(), strErr.getData(), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
::pGUI->ShowMessageModal(sMsg.getData(), strErr.getData(), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -682,7 +682,7 @@ bool C4ScenarioListLoader::Entry::SetTitleInGroup(C4Group &rGrp, const char *szN
|
|||
if (!rGrp.Add(C4CFN_WriteTitle, sTitle, FALSE, TRUE))
|
||||
{
|
||||
StdStrBuf sMsg; sMsg.Format(LoadResStr("IDS_ERR_ERRORADDINGNEWTITLEFORFIL"), sFilename.getData(), rGrp.GetError());
|
||||
Game.pGUI->ShowMessageModal(sMsg.getData(), LoadResStr("IDS_FAIL_RENAME"), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
::pGUI->ShowMessageModal(sMsg.getData(), LoadResStr("IDS_FAIL_RENAME"), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -1775,7 +1775,7 @@ void C4StartupScenSelDlg::DeleteConfirm(ScenListItem *pSel)
|
|||
if (!C4Group_DeleteItem(pEnt->GetEntryFilename().getData(), true))
|
||||
{
|
||||
StdStrBuf sMsg; sMsg.Format("%s", LoadResStr("IDS_FAIL_DELETE"));
|
||||
Game.pGUI->ShowMessageModal(sMsg.getData(), LoadResStr("IDS_MNU_DELETE"), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
::pGUI->ShowMessageModal(sMsg.getData(), LoadResStr("IDS_MNU_DELETE"), C4GUI::MessageDialog::btnOK, C4GUI::Ico_Error);
|
||||
return;
|
||||
}
|
||||
// remove from scenario list
|
||||
|
@ -1786,7 +1786,7 @@ void C4StartupScenSelDlg::DeleteConfirm(ScenListItem *pSel)
|
|||
|
||||
bool C4StartupScenSelDlg::KeyCheat()
|
||||
{
|
||||
return Game.pGUI->ShowRemoveDlg(new C4GUI::InputDialog(LoadResStr("IDS_TEXT_ENTERMISSIONPASSWORD"), LoadResStr("IDS_DLG_MISSIONACCESS"), C4GUI::Ico_Options,
|
||||
return ::pGUI->ShowRemoveDlg(new C4GUI::InputDialog(LoadResStr("IDS_TEXT_ENTERMISSIONPASSWORD"), LoadResStr("IDS_DLG_MISSIONACCESS"), C4GUI::Ico_Options,
|
||||
new C4GUI::InputCallback<C4StartupScenSelDlg>(this, &C4StartupScenSelDlg::KeyCheat2),
|
||||
false));
|
||||
}
|
||||
|
|
|
@ -304,7 +304,7 @@ bool C4VideoPlayer::PlayVideo(C4VideoFile *pVideoFile)
|
|||
// cannot play in console mode
|
||||
if (!FullScreen.Active) return false;
|
||||
// videos are played in a fullscreen GUI dialog
|
||||
if (!Game.pGUI) return false;
|
||||
if (!::pGUI) return false;
|
||||
C4VideoShowDialog *pVideoDlg = new C4VideoShowDialog();
|
||||
if (!pVideoDlg->LoadVideo(pVideoFile))
|
||||
{
|
||||
|
@ -313,7 +313,7 @@ bool C4VideoPlayer::PlayVideo(C4VideoFile *pVideoFile)
|
|||
return false;
|
||||
}
|
||||
++Game.HaltCount;
|
||||
Game.pGUI->ShowModalDlg(pVideoDlg, true); // ignore result; even an aborted video was shown successfully
|
||||
::pGUI->ShowModalDlg(pVideoDlg, true); // ignore result; even an aborted video was shown successfully
|
||||
--Game.HaltCount;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -866,7 +866,7 @@ void C4Viewport::DrawOverlay(C4TargetFacet &cgo, const ZoomData &GameZoom)
|
|||
DrawMouseButtons(cgo);
|
||||
::MouseControl.Draw(cgo, GameZoom);
|
||||
// Draw GUI-mouse in EM if active
|
||||
if (pWindow && Game.pGUI) Game.pGUI->RenderMouse(cgo);
|
||||
if (pWindow && ::pGUI) ::pGUI->RenderMouse(cgo);
|
||||
C4ST_STOP(MouseStat)
|
||||
}
|
||||
// Keyboard/Gamepad
|
||||
|
@ -1543,9 +1543,9 @@ void C4Viewport::SetOutputSize(int32_t iDrawX, int32_t iDrawY, int32_t iOutX, in
|
|||
{
|
||||
::MouseControl.UpdateClip();
|
||||
// and inform GUI
|
||||
if (Game.pGUI)
|
||||
//Game.pGUI->SetBounds(C4Rect(iOutX, iOutY, iOutWdt, iOutHgt));
|
||||
Game.pGUI->SetPreferredDlgRect(C4Rect(iOutX, iOutY, iOutWdt, iOutHgt));
|
||||
if (::pGUI)
|
||||
//::pGUI->SetBounds(C4Rect(iOutX, iOutY, iOutWdt, iOutHgt));
|
||||
::pGUI->SetPreferredDlgRect(C4Rect(iOutX, iOutY, iOutWdt, iOutHgt));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue