Skip to content

Commit 609c967

Browse files
Fix imported link paths not being nested correctly in the MGCB browser. (MonoGame#8739)
XNA contentproj files use Windows paths separated by backslashes. MGCB expects forward slashes to be able to nest content items correctly. The call to PathHelper.GetRelativePath() below the lines changed use System.Uri methods, which has the effect of performing backslash -> slash conversions on the supplied source file path, so this seemed the correct location to convert the link path too. Without this change, any contentproj that references items with a `<Link>` path will be shown at the root of the MGCB project. With this change, the items will be nested at the correct location in the browser. --------- Co-authored-by: Simon (Darkside) Jackson <[email protected]>
1 parent 003d516 commit 609c967

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Tools/MonoGame.Content.Builder.Editor/Common/PipelineProjectParser.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public bool AddContent(string sourceFile, bool skipDuplicates)
175175
sourceFile = split[0];
176176

177177
if (split.Length > 0)
178-
link = split[1];
178+
link = PathHelper.Normalize(split[1]);
179179
}
180180

181181
// Make sure the source file is relative to the project.
@@ -230,7 +230,7 @@ public void OnCopy(string sourceFile)
230230
sourceFile = split[0];
231231

232232
if (split.Length > 0)
233-
link = split[1];
233+
link = PathHelper.Normalize(split[1]);
234234
}
235235

236236
// Make sure the source file is relative to the project.

0 commit comments

Comments
 (0)