Skip to content

Commit

Permalink
Set cwd to ArtDirectory before XRC Preview
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
Randalphwa committed Dec 24, 2024
1 parent 6173543 commit 58d753a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/previews.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 58d753a

Please # to comment.