From cca11e2add8e97912e7e9369cc40dbafa50e1f18 Mon Sep 17 00:00:00 2001 From: fed <58637860+fedddddd@users.noreply.github.com> Date: Fri, 22 Dec 2023 21:40:01 +0100 Subject: [PATCH 1/2] Add steam_path.txt option for wine --- src/client/steam/steam.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/client/steam/steam.cpp b/src/client/steam/steam.cpp index 32c0c0b7..2a469b73 100644 --- a/src/client/steam/steam.cpp +++ b/src/client/steam/steam.cpp @@ -5,6 +5,7 @@ #include #include +#include #define GENERIC_RETURN_IF_FAIL(condition) \ if (condition != S_OK) \ @@ -220,6 +221,13 @@ namespace steam char path[MAX_PATH] = {0}; DWORD length = sizeof(path); + std::string path_str; + if (::utils::io::read_file("steam_path.txt", &path_str)) + { + install_path = path_str; + return install_path.data(); + } + HKEY reg_key; // check if Steam contains information in registry for the install path @@ -252,12 +260,9 @@ namespace steam return ""; } - // create a pointer to our path variable to use in our open_folder function - char* directory_ptr = path; - - // open a file explorer prompt to find the Steam directory (user input) + auto directory_ptr = path; open_folder_prompt(directory_ptr); - while (!strcmp(directory_ptr, "")) // if this while statement goes, this means that the operation was cancelled + while (!strcmp(directory_ptr, "")) { MSG_BOX_ERROR("You must select a valid Steam directory before you can continue."); open_folder_prompt(directory_ptr); From e5cd4de72b91ab2bb7636a52d425073d415ea85e Mon Sep 17 00:00:00 2001 From: fed <58637860+fedddddd@users.noreply.github.com> Date: Fri, 22 Dec 2023 22:41:36 +0100 Subject: [PATCH 2/2] Small fix --- src/client/component/ui_scripting.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/client/component/ui_scripting.cpp b/src/client/component/ui_scripting.cpp index bfb8730d..b44aec98 100644 --- a/src/client/component/ui_scripting.cpp +++ b/src/client/component/ui_scripting.cpp @@ -393,7 +393,11 @@ namespace ui_scripting download_table["abort"] = download::stop_download; download_table["userdownloadresponse"] = party::user_download_response; - download_table["getwwwurl"] = party::get_server_connection_state().base_url; + download_table["getwwwurl"] = [] + { + const auto state = party::get_server_connection_state(); + return state.base_url; + }; auto discord_table = table(); lua["discord"] = discord_table;