Added r_ViewportPos cvar for set the position of a viewport of a game/server launchers

This commit is contained in:
AMZN-Olex
2021-06-15 13:46:53 -04:00
parent a47b30c708
commit 2f5cffe679
6 changed files with 24 additions and 0 deletions
@@ -69,3 +69,14 @@ int APIENTRY WinMain([[maybe_unused]] HINSTANCE hInstance, [[maybe_unused]] HINS
return static_cast<int>(status);
}
void CVar_OnViewportPosition(const AZ::Vector2& value)
{
if (HWND windowHandle = GetActiveWindow())
{
SetWindowPos(windowHandle, nullptr,
value.GetX(),
value.GetY(),
0, 0, SWP_NOOWNERZORDER | SWP_NOSIZE);
}
}