From 22fc5038a232cca9018c2d1b288747916c41e76f Mon Sep 17 00:00:00 2001 From: otavepto Date: Tue, 9 Apr 2024 21:00:19 +0200 Subject: [PATCH] don't bypass local_storage in steam_overlay class --- overlay_experimental/overlay/steam_overlay.h | 15 ++++++++------- overlay_experimental/steam_overlay.cpp | 9 +++------ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/overlay_experimental/overlay/steam_overlay.h b/overlay_experimental/overlay/steam_overlay.h index 96fe13e0..33550da6 100644 --- a/overlay_experimental/overlay/steam_overlay.h +++ b/overlay_experimental/overlay/steam_overlay.h @@ -104,11 +104,12 @@ class Steam_Overlay { constexpr static const char ACH_FALLBACK_DIR[] = "achievement_images"; - Settings* settings; - SteamCallResults* callback_results; - SteamCallBacks* callbacks; - RunEveryRunCB* run_every_runcb; - Networking* network; + class Settings* settings; + class Local_Storage* local_storage; + class SteamCallResults* callback_results; + class SteamCallBacks* callbacks; + class RunEveryRunCB* run_every_runcb; + class Networking* network; // friend id, show client window (to chat and accept invite maybe) std::map friends{}; @@ -223,7 +224,7 @@ class Steam_Overlay void steam_run_callback(); public: - Steam_Overlay(Settings* settings, SteamCallResults* callback_results, SteamCallBacks* callbacks, RunEveryRunCB* run_every_runcb, Networking *network); + Steam_Overlay(Settings* settings, Local_Storage *local_storage, SteamCallResults* callback_results, SteamCallBacks* callbacks, RunEveryRunCB* run_every_runcb, Networking *network); ~Steam_Overlay(); @@ -258,7 +259,7 @@ public: class Steam_Overlay { public: - Steam_Overlay(Settings* settings, SteamCallResults* callback_results, SteamCallBacks* callbacks, RunEveryRunCB* run_every_runcb, Networking* network) {} + Steam_Overlay(Settings* settings, Local_Storage *local_storage, SteamCallResults* callback_results, SteamCallBacks* callbacks, RunEveryRunCB* run_every_runcb, Networking* network) {} ~Steam_Overlay() {} bool Ready() const { return false; } diff --git a/overlay_experimental/steam_overlay.cpp b/overlay_experimental/steam_overlay.cpp index 68265991..e666eec3 100644 --- a/overlay_experimental/steam_overlay.cpp +++ b/overlay_experimental/steam_overlay.cpp @@ -100,8 +100,9 @@ void Steam_Overlay::overlay_networking_callback(void* object, Common_Message* ms _this->networking_msg_received(msg); } -Steam_Overlay::Steam_Overlay(Settings* settings, SteamCallResults* callback_results, SteamCallBacks* callbacks, RunEveryRunCB* run_every_runcb, Networking* network) : +Steam_Overlay::Steam_Overlay(Settings* settings, Local_Storage *local_storage, SteamCallResults* callback_results, SteamCallBacks* callbacks, RunEveryRunCB* run_every_runcb, Networking* network) : settings(settings), + local_storage(local_storage), callback_results(callback_results), callbacks(callbacks), run_every_runcb(run_every_runcb), @@ -328,11 +329,7 @@ void Steam_Overlay::load_audio() file_path = Local_Storage::get_game_settings_path() + file_name; file_size = file_size_(file_path); if (!file_size) { - if (settings->local_save.length() > 0) { - file_path = settings->local_save + "/settings/" + file_name; - } else { - file_path = Local_Storage::get_user_appdata_path() + "/settings/" + file_name; - } + file_path = local_storage->get_global_settings_path() + file_name; file_size = file_size_(file_path); } if (file_size) {