-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pakfile Explorer fixes #130
base: main
Are you sure you want to change the base?
Conversation
…e explorer Pakfile explorer drag-drop wasn't working, where the OnDrop event wasn't getting raised. I have no idea why this fixes it, but it does, and Avalonia seems to automatically be doing the DragDropEffects.Link icon behaviour already, so removing this code doesn't affect the application in any negative way.
Idk why I was doing this, more complex and not going to be a major perf benefit unless getting used a lot.
Fixes two bugs: - Could get stuck in an infinite loop when moving from a directory whose path is a substring of the new directory - Would change "foo/barbaz.vtf" when moving "foo/bar.vtf"
e10a394
to
f51ca0a
Compare
Trying to run on UI thread is a nightmare as we're updating Content as we go, multithreading headache.
Last dep upgrade removed nullability of these
Idk why these methods got dumped at the top
f51ca0a
to
0982d4a
Compare
@@ -291,6 +291,22 @@ out string[]? opNoExtension | |||
if (changes > 0) | |||
Logger.Info($"Replaced {changes} instances of {updatedOp} with {updatedNp} in file {entry.Key}"); | |||
} | |||
|
|||
// TexData - doesn't have viewmodels (yay!) | |||
if (oldPath.EndsWith(".vmt", cmp) && opPrefix.Equals("materials", cmp)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Path.GetExtension
instead.
string[] npSplit = newPath.Split(separator); | ||
|
||
// VMTs can reference VTFs ignoring the root directory and without the extension | ||
oldPath = string.Join(separator, opSplit[1..]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes oldPath
and newPath
empty, making line 247 throw an error on string replace. If current path doesn't use specified separator, opSplit
and npSplit
would become one-element arrays, and both of them are sliced off here
// fucked. | ||
if (directoryMatch is not null) | ||
{ | ||
op = string.Join("/", op.Split('/')[1..]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be more efficient to use substrings:
op = op.Substring(op.IndexOf('/') + 1);
Fixes Panzer's issue with surf_arcade
Closes #49