Update container list for texture loader

This commit is contained in:
KillzXGaming 2019-03-30 14:55:04 -04:00
parent b1db621786
commit 46b9587908
9 changed files with 34 additions and 8 deletions

Binary file not shown.

View file

@ -53,6 +53,9 @@
this.stComboBox1.Size = new System.Drawing.Size(158, 21);
this.stComboBox1.TabIndex = 12;
this.stComboBox1.SelectedIndexChanged += new System.EventHandler(this.stComboBox1_SelectedIndexChanged);
this.stComboBox1.Click += new System.EventHandler(this.stComboBox1_Click);
this.stComboBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.stComboBox1_KeyDown);
this.stComboBox1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.stComboBox1_MouseDown);
//
// listViewCustom1
//
@ -88,6 +91,7 @@
this.barSlider1.ElapsedPenColorTop = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60)))));
this.barSlider1.Font = new System.Drawing.Font("Microsoft Sans Serif", 6F);
this.barSlider1.ForeColor = System.Drawing.Color.White;
this.barSlider1.IncrementAmount = 0.01F;
this.barSlider1.InputName = null;
this.barSlider1.LargeChange = 10F;
this.barSlider1.Location = new System.Drawing.Point(240, 3);

View file

@ -43,14 +43,6 @@ namespace FirstPlugin.Forms
ColorDepth = ColorDepth.Depth32Bit,
ImageSize = new Size(70, 70),
};
int i = 0;
foreach (var tex in PluginRuntime.bntxContainers)
stComboBox1.Items.Add($"BNTX File {i++}");
i = 0;
foreach (var tex in PluginRuntime.ftexContainers)
stComboBox1.Items.Add($"FTEX Folder {i++}");
}
public void LoadTexture()
@ -108,7 +100,25 @@ namespace FirstPlugin.Forms
}
}
int currentBntxCounter = 0;
private void UpdateContainers()
{
//Check for new BNTX or FTEX containers
//If they are all loaded in the combo box, return to prevent clearing on switching everytime
int total = PluginRuntime.bntxContainers.Count + PluginRuntime.ftexContainers.Count;
if (stComboBox1.Items.Count == total)
return;
stComboBox1.Items.Clear();
int i = 0;
foreach (var tex in PluginRuntime.bntxContainers)
stComboBox1.Items.Add($"BNTX File {i++}");
i = 0;
foreach (var tex in PluginRuntime.ftexContainers)
stComboBox1.Items.Add($"FTEX Folder {i++}");
}
private void stComboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
@ -337,5 +347,17 @@ namespace FirstPlugin.Forms
}
}
}
private void stComboBox1_Click(object sender, EventArgs e) {
UpdateContainers();
}
private void stComboBox1_MouseDown(object sender, MouseEventArgs e) {
UpdateContainers();
}
private void stComboBox1_KeyDown(object sender, KeyEventArgs e) {
UpdateContainers();
}
}
}