Skip to content

Commit

Permalink
Merge remote-tracking branch 'blattersturm/fix/sdk-browser-directory'…
Browse files Browse the repository at this point in the history
… into master-pub
  • Loading branch information
blattersturm committed Aug 14, 2021
2 parents 50662fa + 29d1f4d commit 977fb77
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
16 changes: 15 additions & 1 deletion code/components/nui-core/src/NUIInitialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ namespace nui
fwRefContainer<NUIWindow> FindNUIWindow(fwString windowName);
}

std::wstring GetNUIStoragePath();

nui::GameInterface* g_nuiGi;

struct GameRenderData
Expand Down Expand Up @@ -1261,7 +1263,7 @@ void Initialize(nui::GameInterface* gi)
return;
}

std::wstring cachePath = MakeRelativeCitPath(fmt::sprintf(L"data\\nui-storage%s", ToWide(launch::GetPrefixedLaunchModeKey("-"))));
std::wstring cachePath = GetNUIStoragePath();
CreateDirectory(cachePath.c_str(), nullptr);

// delete any old CEF logs
Expand Down Expand Up @@ -1491,3 +1493,15 @@ void Initialize(nui::GameInterface* gi)
});
}
}

std::wstring GetNUIStoragePath()
{
std::wstring lmSuffix;

if (launch::IsSDKGuest())
{
lmSuffix = L"-guest";
}

return MakeRelativeCitPath(fmt::sprintf(L"data\\nui-storage%s%s", ToWide(launch::GetPrefixedLaunchModeKey("-")), lmSuffix));
}
6 changes: 3 additions & 3 deletions code/components/nui-core/src/NUIWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@

#include <CefOverlay.h>

#include <CL2LaunchMode.h>

extern nui::GameInterface* g_nuiGi;

#include "memdbgon.h"

extern std::wstring GetNUIStoragePath();

namespace nui
{
extern bool g_rendererInit;
Expand Down Expand Up @@ -395,7 +395,7 @@ void NUIWindow::Initialize(CefString url)
}
else
{
auto cachePath = MakeRelativeCitPath(fmt::sprintf(L"data\\nui-storage%s\\context-%s", ToWide(launch::GetPrefixedLaunchModeKey("-")), ToWide(m_windowContext)));
auto cachePath = fmt::sprintf(L"%s\\context-%s", GetNUIStoragePath(), ToWide(m_windowContext));
CreateDirectory(cachePath.c_str(), nullptr);

CefRequestContextSettings rcConfig;
Expand Down

0 comments on commit 977fb77

Please sign in to comment.