Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
alicealys committed Dec 22, 2023
2 parents a40cd64 + e5cd4de commit 3ef6162
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
6 changes: 5 additions & 1 deletion src/client/component/ui_scripting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
15 changes: 10 additions & 5 deletions src/client/steam/steam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include <utils/nt.hpp>
#include <utils/string.hpp>
#include <utils/io.hpp>

#define GENERIC_RETURN_IF_FAIL(condition) \
if (condition != S_OK) \
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 3ef6162

Please sign in to comment.