mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-27 06:50:23 +00:00
Fix deleting materials causing index issues for shapes
This commit is contained in:
parent
1831efc3e9
commit
cedaac5518
4 changed files with 11 additions and 1 deletions
Binary file not shown.
|
@ -96,6 +96,7 @@ namespace Bfres.Structs
|
|||
if (Type == BRESGroupType.Models)
|
||||
{
|
||||
ContextMenuStrip.Items.Add(new STToolStripSeparator());
|
||||
ContextMenuStrip.Items.Add(new STToolStipMenuItem("Show All Models", null, ShowAllModelsAction, Keys.Control | Keys.A));
|
||||
ContextMenuStrip.Items.Add(new STToolStipMenuItem("Hide All Models", null, HideAllModelsAction, Keys.Control | Keys.H));
|
||||
}
|
||||
}
|
||||
|
@ -107,6 +108,7 @@ namespace Bfres.Structs
|
|||
protected void BatchGenerateMipmapsAction(object sender, EventArgs e) { BatchGenerateMipmaps(); }
|
||||
|
||||
protected void HideAllModelsAction(object sender, EventArgs e) { HideAllModels(); }
|
||||
protected void ShowAllModelsAction(object sender, EventArgs e) { ShowAllModels(); }
|
||||
|
||||
public void BatchGenerateMipmaps()
|
||||
{
|
||||
|
@ -117,6 +119,14 @@ namespace Bfres.Structs
|
|||
}
|
||||
}
|
||||
|
||||
public void ShowAllModels()
|
||||
{
|
||||
for (int i = 0; i < Nodes.Count; i++)
|
||||
{
|
||||
Nodes[i].Checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void HideAllModels()
|
||||
{
|
||||
for (int i = 0; i < Nodes.Count; i++)
|
||||
|
|
|
@ -150,7 +150,7 @@ namespace Bfres.Structs
|
|||
foreach (var shape in model.shapes)
|
||||
{
|
||||
//If there are indices higher than this index, shift them
|
||||
if (shape.MaterialIndex > CurrentIndex)
|
||||
if (shape.MaterialIndex >= CurrentIndex)
|
||||
{
|
||||
shape.MaterialIndex -= 1;
|
||||
}
|
||||
|
|
Binary file not shown.
Loading…
Reference in a new issue