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();
        }
Пример #2
0
        private void ParseMaterialHashTBText()
        {
            int hash = GuiTools.TryParseTBInt(param1TB, true);

            if (hash != -1 && propertiesListView.SelectedItems.Count > 0)
            {
                currentMaterialList[currentMatIndex].entries[propertiesListView.SelectedItems[0].Text][0] = BitConverter.ToSingle(BitConverter.GetBytes(hash), 0);
            }
        }
Пример #3
0
        private void zBufferTB_TextChanged(object sender, EventArgs e)
        {
            int value = GuiTools.TryParseTBInt(zBufferTB);

            if (value != -1)
            {
                currentMaterialList[currentMatIndex].zBufferOffset = value;
            }
        }
Пример #4
0
        private void refAlphaTB_TextChanged(object sender, EventArgs e)
        {
            int value = GuiTools.TryParseTBInt(refAlphaTB);

            if (value != -1)
            {
                currentMaterialList[currentMatIndex].RefAlpha = value;
            }
        }
Пример #5
0
        private void dstTB_TextChanged(object sender, EventArgs e)
        {
            int value = GuiTools.TryParseTBInt(dstTB);

            if (value != -1)
            {
                currentMaterialList[currentMatIndex].dstFactor = value;
            }
        }
Пример #6
0
        private void charTB_TextChanged(object sender, EventArgs e)
        {
            character = GuiTools.TryParseTBInt(charTB);
            var keyValue = characters.FirstOrDefault(x => x.Value == character);

            if (keyValue.Key != null)
            {
                characterComboBox.SelectedItem = keyValue.Key;
            }
        }
Пример #7
0
        private void typeTB_TextChanged(object sender, EventArgs e)
        {
            type = GuiTools.TryParseTBInt(typeTB);
            var keyValue = types.FirstOrDefault(x => x.Value == type);

            if (keyValue.Key != null)
            {
                typeComboBox.SelectedItem = keyValue.Key;
            }
        }
Пример #8
0
        private void textureIdTB_TextChanged(object sender, EventArgs e)
        {
            int value = GuiTools.TryParseTBInt(textureIdTB, true);

            if (value != -1 && texturesListView.SelectedIndices.Count > 0)
            {
                currentMaterialList[currentMatIndex].textures[texturesListView.SelectedIndices[0]].hash = value;
            }

            // Update the texture color channels.
            RenderTexture();
            RenderTexture(true);

            if (texturesListView.SelectedItems.Count > 0 && value != -1)
            {
                texturesListView.SelectedItems[0].ImageKey = value.ToString("X");
            }
        }