Skip to content

Commit

Permalink
fix for dynamic changing 3d mode
Browse files Browse the repository at this point in the history
  • Loading branch information
eriforce committed Aug 27, 2024
1 parent eada184 commit eac5af6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Magpie.Core/OverlayDrawer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ void OverlayDrawer::SetUIVisibility(bool value, bool noSetForeground) noexcept {
_isUIVisiable = value;

if (value) {
if (ScalingWindow::Get().Options().Is3DGameMode()) {
_openWith3DGameMode = ScalingWindow::Get().Options().Is3DGameMode();
if (_openWith3DGameMode) {
// 使全屏窗口不透明且可以接收焦点
HWND hwndHost = ScalingWindow::Get().Handle();
INT_PTR style = GetWindowLongPtr(hwndHost, GWL_EXSTYLE);
Expand All @@ -278,7 +279,7 @@ void OverlayDrawer::SetUIVisibility(bool value, bool noSetForeground) noexcept {
_imguiImpl.ClearStates();
}

if (ScalingWindow::Get().Options().Is3DGameMode()) {
if (_openWith3DGameMode) {
// 还原全屏窗口样式
HWND hwndHost = ScalingWindow::Get().Handle();
INT_PTR style = GetWindowLongPtr(hwndHost, GWL_EXSTYLE);
Expand Down
1 change: 1 addition & 0 deletions src/Magpie.Core/OverlayDrawer.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class OverlayDrawer {

bool _isUIVisiable = false;
bool _isFirstFrame = true;
bool _openWith3DGameMode;
};

}

0 comments on commit eac5af6

Please sign in to comment.