Fix removing textures from archive for layout editor.
This commit is contained in:
parent
a6d1e2d4de
commit
63fdff7b5e
@ -91,7 +91,44 @@ namespace LayoutBXLYT
|
||||
return texture;
|
||||
}
|
||||
|
||||
public List<STGenericTexture> AddTextures()
|
||||
public void RemoveTextures(List<STGenericTexture> textures) {
|
||||
foreach (var tex in textures)
|
||||
RemoveTexture(tex);
|
||||
}
|
||||
|
||||
public void RemoveTexture(STGenericTexture texture)
|
||||
{
|
||||
switch (Platform)
|
||||
{
|
||||
case PlatformType.WiiU:
|
||||
{
|
||||
var archive = ArchiveParent;
|
||||
if (archive == null) return;
|
||||
|
||||
ArchiveFileInfo fileInfoDelete = null;
|
||||
foreach (var file in archive.Files)
|
||||
{
|
||||
if (file.FileName.Contains(texture.Text))
|
||||
fileInfoDelete = file;
|
||||
}
|
||||
|
||||
if (fileInfoDelete != null)
|
||||
archive.DeleteFile(fileInfoDelete);
|
||||
}
|
||||
break;
|
||||
case PlatformType.Switch:
|
||||
{
|
||||
foreach (var bntx in BinaryContainers.Values)
|
||||
{
|
||||
if (bntx.Textures.ContainsKey(texture.Text))
|
||||
bntx.RemoveTexture(bntx.Textures[texture.Text]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public List<STGenericTexture> AddTextures()
|
||||
{
|
||||
List<STGenericTexture> textures = new List<STGenericTexture>();
|
||||
|
||||
|
@ -54,7 +54,10 @@ namespace LayoutBXLYT
|
||||
|
||||
Textures = new Dictionary<string, STGenericTexture>();
|
||||
|
||||
var theme = new VS2015DarkTheme();
|
||||
ThemeBase theme = new VS2015DarkTheme();
|
||||
if (FormThemes.ActivePreset == FormThemes.Preset.White)
|
||||
theme = new VS2015LightTheme();
|
||||
|
||||
this.dockPanel1.Theme = theme;
|
||||
this.dockPanel1.BackColor = FormThemes.BaseTheme.FormBackColor;
|
||||
this.BackColor = FormThemes.BaseTheme.FormBackColor;
|
||||
|
@ -214,7 +214,10 @@ namespace LayoutBXLYT
|
||||
{
|
||||
var texture = item.Text;
|
||||
if (TextureList.ContainsKey(texture))
|
||||
{
|
||||
ActiveLayout.TextureManager.RemoveTexture(TextureList[texture]);
|
||||
TextureList.Remove(texture);
|
||||
}
|
||||
|
||||
ActiveLayout.RemoveTexture(texture);
|
||||
listViewCustom1.Items.Remove(item);
|
||||
|
@ -1130,8 +1130,9 @@ namespace LayoutBXLYT
|
||||
SelectionBoxPanes.Clear();
|
||||
|
||||
ParentEditor.RefreshEditors();
|
||||
glControl1.Invalidate();
|
||||
}
|
||||
|
||||
glControl1.Invalidate();
|
||||
}
|
||||
|
||||
public enum PickAction
|
||||
|
Loading…
Reference in New Issue
Block a user