Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/client/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ add_library(${PROJECT_NAME} SHARED ${CLIENT_SRC})

add_win_version_resource(
${PROJECT_NAME}
VERSION "1.2.0.0"
VERSION "1.3.0.0"
COMPANY "aurora-mp"
PRODUCT_NAME "CEF Client Plugin"
FILE_DESC "CEF Client DLL for SA-MP/open.mp"
Expand Down
19 changes: 16 additions & 3 deletions src/client/core/runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "hooks/wndproc.hpp"
#include "network/network_manager.hpp"
#include "rendering/render_manager.hpp"
#include "game_sa/CMenuManager.h"
#include "samp/addresses.hpp"
#include "samp/samp.hpp"
#include "samp/samp_version_manager.hpp"
Expand All @@ -30,7 +31,6 @@ std::unique_ptr<Runtime> Runtime::CreateDefault()

runtime->logger_ = std::make_unique<Logger>();
logging::SetLogger(runtime->logger_.get());

runtime->config_ = std::make_unique<ConfigManager>();
runtime->gta_ = std::make_unique<Gta>();
runtime->hud_ = std::make_unique<HudManager>();
Expand All @@ -39,6 +39,18 @@ std::unique_ptr<Runtime> Runtime::CreateDefault()
return runtime;
}

void Runtime::UpdateBrowserDrawState()
{
if (!browser_)
return;

const HWND hwnd = gta_ ? gta_->GetHwnd() : nullptr;
const bool window_active = hwnd && ::IsWindow(hwnd) && (::GetForegroundWindow() == hwnd);
const bool pause_menu_open = FrontEndMenuManager.m_bMenuActive && FrontEndMenuManager.m_nCurrentMenuPage == MENUPAGE_PAUSE_MENU;

browser_->SetDrawEnabled(window_active && !pause_menu_open);
}

bool Runtime::Start()
{
const auto user_files = std::filesystem::path(gta_->GetUserFilesPath());
Expand Down Expand Up @@ -101,6 +113,8 @@ bool Runtime::Start()
if (gta_)
gta_->PumpMainThreadCallbacks();

UpdateBrowserDrawState();

int frames = cursor_recenter_frames_.load(std::memory_order_acquire);
if (frames > 0)
{
Expand Down Expand Up @@ -240,8 +254,7 @@ void Runtime::FinalizeInitialization(HWND hwnd)
{
const bool active = (LOWORD(wParam) != WA_INACTIVE);

if (browser_)
browser_->SetDrawEnabled(active);
UpdateBrowserDrawState();

if (active)
{
Expand Down
2 changes: 2 additions & 0 deletions src/client/core/runtime.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class Runtime
void Stop();

private:
void UpdateBrowserDrawState();

Runtime() = default;
Runtime(const Runtime&) = delete;
Runtime& operator=(const Runtime&) = delete;
Expand Down
2 changes: 1 addition & 1 deletion src/client/renderer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ add_executable(${PROJECT_NAME} WIN32 ${RENDERER_SRC})

add_win_version_resource(
${PROJECT_NAME}
VERSION "1.2.0.0"
VERSION "1.3.0.0"
COMPANY "aurora-mp"
PRODUCT_NAME "OMP CEF Renderer"
FILE_DESC "CEF renderer subprocess"
Expand Down
2 changes: 1 addition & 1 deletion src/server/omp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ add_library(${PROJECT_NAME}

add_win_version_resource(
${PROJECT_NAME}
VERSION "1.2.0.0"
VERSION "1.3.0.0"
COMPANY "aurora-mp"
PRODUCT_NAME "CEF Server Component"
FILE_DESC "CEF Component for open.mp"
Expand Down
2 changes: 1 addition & 1 deletion src/server/samp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ add_library(${PROJECT_NAME}

add_win_version_resource(
${PROJECT_NAME}
VERSION "1.2.0.0"
VERSION "1.3.0.0"
COMPANY "aurora-mp"
PRODUCT_NAME "SA-MP Server Plugin"
FILE_DESC "CEF Plugin for SA-MP"
Expand Down
2 changes: 1 addition & 1 deletion src/shared/version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <string>

#define VERSION_MAJOR 1
#define VERSION_MINOR 2
#define VERSION_MINOR 3
#define VERSION_PATCH 0
#define VERSION_BUILD 0

Expand Down
Loading