Skip to content

Commit

Permalink
don't prefix files as premake handles this, fix steam function
Browse files Browse the repository at this point in the history
  • Loading branch information
GEEKiDoS committed Jul 27, 2024
1 parent f0f1021 commit 549fe5f
Show file tree
Hide file tree
Showing 19 changed files with 52 additions and 47 deletions.
2 changes: 1 addition & 1 deletion assets/launcher-ui/src/modules/launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class Launcher {
await window.laochan.setParam('LAOCHAN_TOKEN', this._config.value.token);
await window.laochan.setParam('LAOCHAN_SERVER_URL', this._config.value.serverUrl);
await window.laochan.setParam('LAOCHAN_ENABLE_CONSOLE', JSON.stringify(+this._config.value.enableConsole));
await window.laochan.setParam('LAOCHAN_ENABLE_STEAM_OVERLAY', JSON.stringify(+this._config.value.enableConsole));
await window.laochan.setParam('LAOCHAN_ENABLE_STEAM_OVERLAY', JSON.stringify(+this._config.value.enableSteamOverlay));
}
}

Expand Down
2 changes: 1 addition & 1 deletion premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ dependencies.load()
workspace "laochan-client"
startproject "client"
location "./build"
objdir "%{wks.location}/obj"
objdir "%{wks.location}/obj/"
targetdir "%{wks.location}/bin/%{cfg.platform}/%{cfg.buildcfg}"

configurations {"Debug", "Release"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <utils/memory.hpp>
#include <game/game.hpp>

#include "i_chart_modifier.hpp"
#include "chart_modifier.hpp"

namespace iidx::chart_modifier
{
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "component/filesystem.hpp"
#include "component/steam_proxy.hpp"

#include "i_chart_modifier.hpp"
#include "chart_modifier.hpp"

#include <imgui.h>
#include <imgui_impl_win32.h>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
46 changes: 25 additions & 21 deletions src/client/component/steam_proxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,32 +45,22 @@ namespace steam_proxy

void post_load() override
{
if (game::environment::get_param("LAOCHAN_ENABLE_STEAM_OVERLAY") != "1")
return;
this->load_steam();

const std::filesystem::path steam_path = steam::get_steam_install_path();
if (game::environment::get_param("LAOCHAN_ENABLE_STEAM_OVERLAY") == "1")
{
const std::filesystem::path steam_path = steam::get_steam_install_path();

if (steam_path.empty())
return;
if (steam_path.empty())
return;

this->steam_overlay_module_ = utils::nt::library::load(steam_path / "gameoverlayrenderer64.dll");
this->steam_overlay_module_ = utils::nt::library::load(steam_path / "gameoverlayrenderer64.dll");
}
}

void pre_destroy() override
{
if (this->steam_client_module_)
{
if (this->steam_pipe_)
{
if (this->global_user_)
{
this->steam_client_module_.invoke<void>("Steam_ReleaseUser", this->steam_pipe_,
this->global_user_);
}

this->steam_client_module_.invoke<bool>("Steam_BReleaseSteamPipe", this->steam_pipe_);
}
}
this->unload_client();
}

const utils::nt::library& get_overlay_module() const
Expand Down Expand Up @@ -138,6 +128,20 @@ namespace steam_proxy
}
}

void unload_client()
{
if (!steam_client_module_)
return;

if (!this->steam_pipe_)
return;

if (!this->global_user_)
return;

this->steam_client_module_.invoke<void>("Steam_ReleaseUser", this->steam_pipe_, this->global_user_);
}

void load_client()
{
const std::filesystem::path steam_path = steam::get_steam_install_path();
Expand Down Expand Up @@ -234,7 +238,7 @@ namespace steam_proxy
if (!comp)
return;

return comp->start_mod(status, 980610);
return comp->start_mod(status, 480);
}

uint64_t get_steam_id()
Expand All @@ -253,7 +257,7 @@ namespace steam_proxy

if (!comp)
return;

return comp->load_steam();
}
}
Expand Down
1 change: 1 addition & 0 deletions src/client/component/steam_proxy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ namespace steam_proxy
void set_status(const std::string& status);
uint64_t get_steam_id();
void load_steam();
void load_overlay();
}
4 changes: 2 additions & 2 deletions src/client/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@ int main()
component_loader::pre_destroy();
});

steam_proxy::load_steam();

try
{
const launcher launcher;
Expand All @@ -179,6 +177,8 @@ int main()

if (!component_loader::post_load())
return 0;

steam_proxy::set_status(game::environment::get_string());
}
catch (std::exception& e)
{
Expand Down
4 changes: 2 additions & 2 deletions src/client/resource.g.rc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ ID_ASSET_0 RCDATA "resources/ui-dist/favicon.ico"
ID_ASSET_1 RCDATA "resources/ui-dist/index.html"
ID_ASSET_2 RCDATA "resources/ui-dist/assets/howler-CCqh-U3u.js"
ID_ASSET_3 RCDATA "resources/ui-dist/assets/iidx-BAOXvOlX.jpg"
ID_ASSET_4 RCDATA "resources/ui-dist/assets/index-B-_OyPHK.css"
ID_ASSET_5 RCDATA "resources/ui-dist/assets/index-CEmN3ehz.js"
ID_ASSET_4 RCDATA "resources/ui-dist/assets/index-Ci4vBWtd.css"
ID_ASSET_5 RCDATA "resources/ui-dist/assets/index-D3Snp9-p.js"
ID_ASSET_6 RCDATA "resources/ui-dist/assets/moai-bg-BU2gdkgA.jpg"
ID_ASSET_7 RCDATA "resources/ui-dist/assets/num-BvRoq2n1.png"
ID_ASSET_8 RCDATA "resources/ui-dist/assets/num-z0VsZKpR.mp3"
Expand Down
4 changes: 2 additions & 2 deletions src/client/resources/all.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ namespace laochan::embedded

rtn.emplace("assets/howler-CCqh-U3u.js", saucer::embedded_file{"text/javascript", read_resource(ID_ASSET_2)});
rtn.emplace("assets/iidx-BAOXvOlX.jpg", saucer::embedded_file{"image/jpeg", read_resource(ID_ASSET_3)});
rtn.emplace("assets/index-B-_OyPHK.css", saucer::embedded_file{"text/css", read_resource(ID_ASSET_4)});
rtn.emplace("assets/index-CEmN3ehz.js", saucer::embedded_file{"text/javascript", read_resource(ID_ASSET_5)});
rtn.emplace("assets/index-Ci4vBWtd.css", saucer::embedded_file{"text/css", read_resource(ID_ASSET_4)});
rtn.emplace("assets/index-D3Snp9-p.js", saucer::embedded_file{"text/javascript", read_resource(ID_ASSET_5)});
rtn.emplace("assets/moai-bg-BU2gdkgA.jpg", saucer::embedded_file{"image/jpeg", read_resource(ID_ASSET_6)});
rtn.emplace("assets/num-BvRoq2n1.png", saucer::embedded_file{"image/png", read_resource(ID_ASSET_7)});
rtn.emplace("assets/num-z0VsZKpR.mp3", saucer::embedded_file{"audio/mpeg", read_resource(ID_ASSET_8)});
Expand Down
Loading

0 comments on commit 549fe5f

Please sign in to comment.