1
0
mirror of synced 2024-12-01 18:47:26 +01:00

Some material param improvments

This commit is contained in:
KillzXGaming 2019-04-25 19:38:02 -04:00
parent e3497c76b2
commit 9b5e558543
5 changed files with 38 additions and 31 deletions

Binary file not shown.

View File

@ -34,9 +34,24 @@ namespace FirstPlugin.Forms
shaderParamListView.Items.Clear(); shaderParamListView.Items.Clear();
foreach (BfresShaderParam prm in mat.matparam.Values) foreach (BfresShaderParam prm in mat.matparam.Values)
{ {
string DisplayValue = "";
var item = new ListViewItem(prm.Name); var item = new ListViewItem(prm.Name);
ShaderParamToListItem(prm, item);
shaderParamListView.View = View.Details;
shaderParamListView.Items.Add(item);
CurParam++;
}
il.ImageSize = new Size(10, 10);
shaderParamListView.SmallImageList = il;
shaderParamListView.FullRowSelect = true;
}
private void ShaderParamToListItem(BfresShaderParam prm, ListViewItem item )
{
item.SubItems.Clear();
item.Text = prm.Name;
string DisplayValue = "";
switch (prm.Type) switch (prm.Type)
{ {
@ -65,13 +80,6 @@ namespace FirstPlugin.Forms
item.SubItems.Add(DisplayValue); item.SubItems.Add(DisplayValue);
item.SubItems.Add(""); item.SubItems.Add("");
item.SubItems[2].BackColor = GetColor(prm); item.SubItems[2].BackColor = GetColor(prm);
shaderParamListView.View = View.Details;
shaderParamListView.Items.Add(item);
CurParam++;
}
il.ImageSize = new Size(10, 10);
shaderParamListView.SmallImageList = il;
shaderParamListView.FullRowSelect = true;
} }
private Color GetColor(BfresShaderParam prm) private Color GetColor(BfresShaderParam prm)
@ -378,8 +386,7 @@ namespace FirstPlugin.Forms
if (dialog.ShowDialog() == DialogResult.OK) if (dialog.ShowDialog() == DialogResult.OK)
{ {
currentItem.SubItems[1].Text = GetValueString(material.matparam[currentItem.Text]); ShaderParamToListItem(material.matparam[currentItem.Text], shaderParamListView.SelectedItems[0]);
currentItem.SubItems[2].BackColor = GetColor(material.matparam[currentItem.Text]);
} }
} }
} }