From 58d753ae5611ea624c6b7521632ca8311df0317a Mon Sep 17 00:00:00 2001 From: Randalphwa <38287198+Randalphwa@users.noreply.github.com> Date: Mon, 23 Dec 2024 19:13:56 -0800 Subject: [PATCH] Set cwd to ArtDirectory before XRC Preview This shouldn't matter for C++ which will be using embedded art, but for XRC it increases the chance that it will load the requested art (which doesn't have a path specifier). --- src/previews.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/previews.cpp b/src/previews.cpp index de2a93a63..65566a68a 100644 --- a/src/previews.cpp +++ b/src/previews.cpp @@ -166,6 +166,9 @@ void Preview(Node* form_node) return; } + tt_cwd cwd(true); + wxSetWorkingDirectory(Project.ArtDirectory().make_wxString()); + XrcCompare dlg_compare; if (!dlg_compare.DoCreate(wxGetMainFrame(), form_node)) { @@ -256,6 +259,9 @@ void PreviewXrc(Node* form_node) return; } + tt_cwd cwd(true); + wxSetWorkingDirectory(Project.ArtDirectory().make_wxString()); + switch (form_node->getGenName()) { case gen_wxDialog: