private void param1TB_TextChanged(object sender, EventArgs e) { if (matPropertyNameTB.Text.Equals("NU_materialHash")) { int f = GuiTools.TryParseTBInt(param1TB, true); if (f != -1 && propertiesListView.SelectedItems.Count > 0) { materials[currentMatIndex].entries[propertiesListView.SelectedItems[0].Text][0] = BitConverter.ToSingle(BitConverter.GetBytes(f), 0); } } else { float f = -1; float.TryParse(param1TB.Text, out f); if (f != -1 && propertiesListView.SelectedItems.Count > 0) { materials[currentMatIndex].entries[propertiesListView.SelectedItems[0].Text][0] = f; // Update trackbar. MatParam labels = null; propList.TryGetValue(matPropertyNameTB.Text, out labels); float max = 1; if (labels != null) { max = labels.max1; } GuiTools.UpdateTrackBarFromValue(f, param1TrackBar, 0, max); } } UpdateButtonColor(); }
private void param4TB_TextChanged(object sender, EventArgs e) { string propertyName = propertiesListView.SelectedItems[0].Text; float value = GuiTools.TryParseTBFloat(param4TB); currentMaterialList[currentMatIndex].entries[propertyName][3] = value; float max = GetMatParamMax(propertyName); if (enableParam4SliderUpdates) { GuiTools.UpdateTrackBarFromValue(value, param4TrackBar, 0, max); } UpdateButtonColor(); }
private void param3TB_TextChanged(object sender, EventArgs e) { float f = -1; float.TryParse(param3TB.Text, out f); if (f != -1 && propertiesListView.SelectedItems.Count > 0) { materials[currentMatIndex].entries[propertiesListView.SelectedItems[0].Text][2] = f; // update trackbar MatParam labels = null; propList.TryGetValue(matPropertyNameTB.Text, out labels); float max = 1; if (labels != null) { max = labels.max3; } GuiTools.UpdateTrackBarFromValue(f, param3TrackBar, 0, max); } UpdateButtonColor(); }
private void param1TB_TextChanged(object sender, EventArgs e) { string propertyName = propertiesListView.SelectedItems[0].Text; if (propertyName == "NU_materialHash") { ParseMaterialHashTBText(); } else { float value = GuiTools.TryParseTBFloat(param1TB); currentMaterialList[currentMatIndex].entries[propertyName][0] = value; float max = GetMatParamMax(propertyName, 0); if (enableParam1SliderUpdates) { GuiTools.UpdateTrackBarFromValue(value, param1TrackBar, 0, max); } } UpdatePropertyButtonColor(); }
private void param4TB_TextChanged(object sender, EventArgs e) { float f = -1; float.TryParse(param4TB.Text, out f); if (f != -1 && propertiesListView.SelectedItems.Count > 0) { // Set the param value for the selected property. string matPropertyKey = propertiesListView.SelectedItems[0].Text; materials[currentMatIndex].entries[matPropertyKey][3] = f; // Update trackbar MatParam labels = null; propList.TryGetValue(matPropertyNameTB.Text, out labels); float max = 1; if (labels != null) { max = labels.max4; } GuiTools.UpdateTrackBarFromValue(f, param4TrackBar, 0, max); } }