disable Steam overlay (fixes hidden issues)

This commit is contained in:
m 2024-02-21 08:08:18 -06:00
parent e1b91c818d
commit a12f996892
3 changed files with 25 additions and 10 deletions

View File

@ -77,6 +77,11 @@ newoption {
description = "Enable development builds of the client." description = "Enable development builds of the client."
} }
newoption {
trigger = "steam-overlay",
description = "Enable the Steam Overlay."
}
newoption { newoption {
trigger = "inject-host-as-lib", trigger = "inject-host-as-lib",
description = "Decide whether to load the game as lib or to inject it" description = "Decide whether to load the game as lib or to inject it"
@ -246,7 +251,11 @@ warnings "Extra"
characterset "ASCII" characterset "ASCII"
if _OPTIONS["dev-build"] then if _OPTIONS["dev-build"] then
defines {"DEV_BUILD"} defines "DEV_BUILD"
end
if _OPTIONS["steam-overlay"] then
defines "LOAD_STEAM_OVERLAY"
end end
if os.getenv("CI") then if os.getenv("CI") then

View File

@ -21,7 +21,9 @@ namespace steam_proxy
utils::binary_resource runner_file(RUNNER, "runner.exe"); utils::binary_resource runner_file(RUNNER, "runner.exe");
utils::nt::library steam_client_module_{}; utils::nt::library steam_client_module_{};
#ifdef LOAD_STEAM_OVERLAY
utils::nt::library steam_overlay_module_{}; utils::nt::library steam_overlay_module_{};
#endif
steam::interface client_engine_ {}; steam::interface client_engine_ {};
steam::interface client_user_ {}; steam::interface client_user_ {};
@ -70,7 +72,9 @@ namespace steam_proxy
utils::nt::library::load(steam_path / "tier0_s64.dll"); utils::nt::library::load(steam_path / "tier0_s64.dll");
utils::nt::library::load(steam_path / "vstdlib_s64.dll"); utils::nt::library::load(steam_path / "vstdlib_s64.dll");
#ifdef LOAD_STEAM_OVERLAY
steam_overlay_module_ = utils::nt::library::load(steam_path / "gameoverlayrenderer64.dll"); steam_overlay_module_ = utils::nt::library::load(steam_path / "gameoverlayrenderer64.dll");
#endif
steam_client_module_ = utils::nt::library::load(steam_path / "steamclient64.dll"); steam_client_module_ = utils::nt::library::load(steam_path / "steamclient64.dll");
if (!steam_client_module_) return; if (!steam_client_module_) return;
@ -253,10 +257,12 @@ namespace steam_proxy
} }
}; };
#ifdef LOAD_STEAM_OVERLAY
const utils::nt::library& get_overlay_module() const utils::nt::library& get_overlay_module()
{ {
return steam_overlay_module_; return steam_overlay_module_;
} }
#endif
void initialize() void initialize()
{ {

View File

@ -89,6 +89,9 @@ namespace steam
result_handlers_[result.call]->run(result.data, false, result.call); result_handlers_[result.call]->run(result.data, false, result.call);
} }
// someone concluded this can cause issues and from my knowledge, removing this doesn't break anything (unless it does?)
// if it does and is discovered, please make a issue <3
#ifdef 0
for (const auto& callback : callback_list_) for (const auto& callback : callback_list_)
{ {
if (callback && callback->get_i_callback() == result.type) if (callback && callback->get_i_callback() == result.type)
@ -96,10 +99,11 @@ namespace steam
callback->run(result.data, false, 0); callback->run(result.data, false, 0);
} }
} }
#endif
if (result.data) if (result.data)
{ {
free(result.data); std::free(result.data);
} }
} }
@ -165,11 +169,8 @@ namespace steam
return install_path.data(); return install_path.data();
} }
char path[MAX_PATH] = {0};
DWORD length = sizeof(path);
std::string path_str; std::string path_str;
if (::utils::io::read_file("steam_path.txt", &path_str)) // steam_path.txt in root for directory if (::utils::io::read_file("steam_path.txt", &path_str)) // steam_path.txt in root for directory, manually fixes issues lol
{ {
install_path = path_str; install_path = path_str;
return install_path.data(); return install_path.data();
@ -177,9 +178,10 @@ namespace steam
// check if Steam contains information in registry for the install path // check if Steam contains information in registry for the install path
HKEY reg_key; HKEY reg_key;
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\WOW6432Node\\Valve\\Steam", 0, KEY_QUERY_VALUE, if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\WOW6432Node\\Valve\\Steam", 0, KEY_QUERY_VALUE, &reg_key) == ERROR_SUCCESS)
&reg_key) == ERROR_SUCCESS)
{ {
char path[MAX_PATH]{};
DWORD length = sizeof(path);
RegQueryValueExA(reg_key, "InstallPath", nullptr, nullptr, reinterpret_cast<BYTE*>(path), &length); RegQueryValueExA(reg_key, "InstallPath", nullptr, nullptr, reinterpret_cast<BYTE*>(path), &length);
RegCloseKey(reg_key); RegCloseKey(reg_key);
install_path = path; install_path = path;
@ -216,7 +218,6 @@ namespace steam
return &c; return &c;
} }
MessageBoxA(0, interfacename, __FUNCTION__, 0); MessageBoxA(0, interfacename, __FUNCTION__, 0);
return nullptr; return nullptr;
} }
@ -239,7 +240,6 @@ namespace steam
{ {
} }
friends* SteamFriends() friends* SteamFriends()
{ {
static friends friends; static friends friends;