mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-22 20:43:09 +00:00
Fix actor renaming for odyssey
This commit is contained in:
parent
7d4ad62dd0
commit
ed4ef23eb7
2 changed files with 13 additions and 12 deletions
|
@ -182,18 +182,9 @@ namespace FirstPlugin
|
|||
string NewActorName = dialog.textBox1.Text;
|
||||
FileName = NewActorName + ".szs";
|
||||
|
||||
foreach (var file in files)
|
||||
{
|
||||
string NodeName = Path.GetFileNameWithoutExtension(file.FileName);
|
||||
string ext = Utils.GetExtension(file.FileName);
|
||||
if (NodeName == ActorName)
|
||||
{
|
||||
file.FileName = $"{NewActorName}{ext}";
|
||||
}
|
||||
else if (file.FileName.Contains("Attribute.byml"))
|
||||
{
|
||||
file.FileName = $"{NewActorName}Attribute.byml";
|
||||
}
|
||||
foreach (var file in files) {
|
||||
file.FileName = file.FileName.Replace(ActorName, NewActorName);
|
||||
file.UpdateWrapper();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,6 +75,15 @@ namespace Toolbox.Library
|
|||
[Browsable(false)]
|
||||
public virtual bool CanLoadFile { get; set; } = true;
|
||||
|
||||
[Browsable(false)]
|
||||
public ArchiveFileWrapper FileWrapper;
|
||||
|
||||
public void UpdateWrapper()
|
||||
{
|
||||
if (FileWrapper == null) return;
|
||||
|
||||
FileWrapper.Text = Path.GetFileName(FileName);
|
||||
}
|
||||
|
||||
[Browsable(false)]
|
||||
public virtual IFileFormat OpenFile()
|
||||
|
@ -276,6 +285,7 @@ namespace Toolbox.Library
|
|||
public void AddFileNode(ArchiveFileWrapper fileWrapper)
|
||||
{
|
||||
FileNodes.Add(Tuple.Create(fileWrapper.ArchiveFileInfo, (TreeNode)fileWrapper));
|
||||
fileWrapper.ArchiveFileInfo.FileWrapper = fileWrapper;
|
||||
|
||||
string FullName = SetFullPath(fileWrapper, this);
|
||||
if (FullName != string.Empty)
|
||||
|
|
Loading…
Reference in a new issue