Skip to content

Commit fafd59a

Browse files
Synchronize changes from 1.6 master branch [ci skip]
b71b222 Revert "Tweak mouse cursor startup behaviour (#2855)" 3d0c28b Update client en_US pot
2 parents 9c8217c + b71b222 commit fafd59a

File tree

4 files changed

+6
-49
lines changed

4 files changed

+6
-49
lines changed

Client/core/CCore.cpp

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -894,30 +894,6 @@ void CCore::SetCenterCursor(bool bEnabled)
894894
m_pSetCursorPosHook->DisableSetCursorPos();
895895
}
896896

897-
// Changes visibility of the system mouse cursor within application window
898-
void CCore::SetSystemCursorVisible(bool bVisible)
899-
{
900-
if (m_pMultiplayer)
901-
{
902-
m_pMultiplayer->AllowWindowsCursorShowing(bVisible);
903-
ShowCursor(bVisible);
904-
}
905-
}
906-
907-
////////////////////////////////////////////////////////////////////////
908-
//
909-
// ShouldShowSystemCursorDuringLoad
910-
//
911-
// Whenever system cursor should be shown during game load.
912-
// It should be if game is being launched in windowed mode or user has multiple monitors and full screen minimize is disabled.
913-
//
914-
////////////////////////////////////////////////////////////////////////
915-
bool CCore::ShouldShowSystemCursorDuringLoad()
916-
{
917-
CVideoModeManagerInterface* pVidMan = GetVideoModeManager();
918-
return pVidMan->IsDisplayModeWindowed() || (pVidMan->IsMultiMonitor() && !pVidMan->IsMinimizeEnabled());
919-
}
920-
921897
////////////////////////////////////////////////////////////////////////
922898
//
923899
// LoadModule
@@ -1044,11 +1020,6 @@ void CCore::DeinitGUI()
10441020
void CCore::InitGUI(IDirect3DDevice9* pDevice)
10451021
{
10461022
m_pGUI = InitModule<CGUI>(m_GUIModule, "GUI", "InitGUIInterface", pDevice);
1047-
1048-
SetSystemCursorVisible(ShouldShowSystemCursorDuringLoad());
1049-
1050-
// Hide GUI mouse cursor during game startup
1051-
m_pGUI->SetCursorEnabled(false);
10521023
}
10531024

10541025
void CCore::CreateGUI()
@@ -1290,9 +1261,6 @@ void CCore::DoPostFramePulse()
12901261
{
12911262
m_bFirstFrame = false;
12921263

1293-
// Make sure system mouse cursor is not visible
1294-
CCore::GetSingletonPtr()->SetSystemCursorVisible(false);
1295-
12961264
// Disable vsync while it's all dark
12971265
m_pGame->DisableVSync();
12981266

Client/core/CCore.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,6 @@ class CCore : public CCoreInterface, public CSingleton<CCore>
143143
bool IsCursorControlsToggled() { return m_bCursorToggleControls; }
144144
void HideMainMenu();
145145
void SetCenterCursor(bool bEnabled);
146-
void SetSystemCursorVisible(bool bVisible);
147-
bool ShouldShowSystemCursorDuringLoad();
148146

149147
void ShowServerInfo(unsigned int WindowType);
150148

Client/core/CGUI.cpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ CLocalGUI::CLocalGUI()
4444

4545
m_LastSettingsRevision = -1;
4646
m_LocaleChangeCounter = 0;
47-
48-
m_StoredMousePosition = {-1, -1};
4947
}
5048

5149
CLocalGUI::~CLocalGUI()
@@ -713,7 +711,8 @@ bool CLocalGUI::InputGoesToGUI()
713711

714712
// Here we're supposed to check if things like menues are up, console is up or the chatbox is expecting input
715713
// If the console is visible OR the chat is expecting input OR the mainmenu is visible
716-
return (IsConsoleVisible() || IsMainMenuVisible() || IsChatBoxInputEnabled() || m_bForceCursorVisible || pGUI->GetGUIInputEnabled() || IsWebRequestGUIVisible());
714+
return (IsConsoleVisible() || IsMainMenuVisible() || IsChatBoxInputEnabled() || m_bForceCursorVisible || pGUI->GetGUIInputEnabled() ||
715+
!CCore::GetSingleton().IsFocused() || IsWebRequestGUIVisible());
717716
}
718717

719718
void CLocalGUI::ForceCursorVisible(bool bVisible)
@@ -727,18 +726,14 @@ void CLocalGUI::UpdateCursor()
727726

728727
static DWORD dwWidth = CDirect3DData::GetSingleton().GetViewportWidth();
729728
static DWORD dwHeight = CDirect3DData::GetSingleton().GetViewportHeight();
730-
static bool bFirstRun = true;
729+
static bool bFirstRun = true;
731730

732731
if (bFirstRun)
733732
{
734-
if (!CCore::GetSingleton().ShouldShowSystemCursorDuringLoad())
735-
{
736-
m_StoredMousePosition.x = dwWidth / 2;
737-
m_StoredMousePosition.y = dwHeight / 2;
738-
}
733+
m_StoredMousePosition.x = dwWidth / 2;
734+
m_StoredMousePosition.y = dwHeight / 2;
739735
bFirstRun = false;
740736
}
741-
742737
// Called in each frame to make sure the mouse is only visible when a GUI control that uses the
743738
// mouse requires it.
744739
if (InputGoesToGUI())
@@ -751,8 +746,7 @@ void CLocalGUI::UpdateCursor()
751746
CCore::GetSingleton ().GetGame ()->GetPad ()->Clear ();*/
752747

753748
// Restore the mouse cursor to its old position
754-
if (m_StoredMousePosition.x != -1 && m_StoredMousePosition.y != -1)
755-
SetCursorPos(m_StoredMousePosition.x, m_StoredMousePosition.y);
749+
SetCursorPos(m_StoredMousePosition.x, m_StoredMousePosition.y);
756750

757751
// Enable our mouse cursor
758752
CSetCursorPosHook::GetSingleton().DisableSetCursorPos();

Client/multiplayer_sa/CMultiplayerSA.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,9 +1558,6 @@ void CMultiplayerSA::InitHooks()
15581558
// by skipping some entity flag check in CShadows::CastPlayerShadowSectorList()
15591559
MemSet((void*)0x70A4CB, 0x90, 6);
15601560

1561-
// Disable setting system mouse cursor position to the center on game init
1562-
MemSet((void*)0x748A01, 0x90, 0x748A23 - 0x748A01);
1563-
15641561
// Allow vertical camera movement during a camera fade (#411)
15651562
MemPut<BYTE>(0x524084, 0xFF);
15661563
MemPut<BYTE>(0x524089, 0xFF);

0 commit comments

Comments
 (0)