Skip to content

Commit

Permalink
Merge pull request #21 from YoYoGames/fdias-dev
Browse files Browse the repository at this point in the history
Increase compatibility with old macOS versions
  • Loading branch information
DiasFranciscoA authored Jun 21, 2023
2 parents 1451e96 + 74d8374 commit 63a9107
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 10 deletions.
Binary file modified source/Steamworks_gml/extensions/steamworks/libSteamworks.dylib
Binary file not shown.
5 changes: 2 additions & 3 deletions source/Steamworks_vs/Steamworks/DesktopExtensionTools.mm
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
std::string DesktopExtensionTools_getPathToExe()
{
NSString *bundlename = [[NSBundle mainBundle] executablePath];
std::filesystem::path exePath = [bundlename UTF8String];
NSString *exePath = [bundlename stringByDeletingLastPathComponent];

exePath = exePath.parent_path();
return exePath.string();
return std::string([exePath UTF8String]);
}
24 changes: 17 additions & 7 deletions source/Steamworks_vs/Steamworks/GMLSteam/steam_ugc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,23 @@ void OnUgcItemInstalled(ItemInstalled_t* pCallback )

const char* ExtractFilePath(const char* fn)
{
//const char* pLastSlash = utf8_strrchr(fn, '\\', '/');
std::string s = g_pYYRunnerInterface->YYStrDup(fn);
std::filesystem::path filepath{ s };
std::string path = filepath.parent_path().string();
return g_pYYRunnerInterface->YYStrDup(path.c_str());

} // end ExtractFilePat
if (!fn || strlen(fn) == 0) {
// Input string is empty or null.
return g_pYYRunnerInterface->YYStrDup("");
}

std::string s = fn;
std::size_t found = s.find_last_of("/\\");

// Check if slash or backslash was found.
if (found == std::string::npos) {
// No path delimiter found, return an empty string.
return g_pYYRunnerInterface->YYStrDup("");
}

std::string path = s.substr(0, found);
return g_pYYRunnerInterface->YYStrDup(path.c_str());
}


//Check if folder has been added to whitelist, add if required
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array/>
</plist>
Binary file not shown.

0 comments on commit 63a9107

Please sign in to comment.