Beispiel #1
0
        private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            int indexNum = treeView1.SelectedNode.Index;

            try
            {
                if (treeView1.SelectedNode.Parent.Text == "Symbols")
                {
                    Lumen.Strings[indexNum] = tbl.Rows[0][1].ToString();
                }
                else if (treeView1.SelectedNode.Parent.Text == "Colors")
                {
                    Lumen.ReplaceColor(new OpenTK.Vector4(float.Parse(tbl.Rows[0][1].ToString()) / 255f, float.Parse(tbl.Rows[1][1].ToString()) / 255f, float.Parse(tbl.Rows[2][1].ToString()) / 255f, float.Parse(tbl.Rows[3][1].ToString()) / 255f), indexNum);
                    treeView1.SelectedNode.Text = (Lumen.Colors[indexNum] * 255).ToString();
                }
                else if (treeView1.SelectedNode.Parent.Text == "Transforms")
                {
                    Lumen.ReplaceTransform(new OpenTK.Matrix4(
                                               float.Parse(tbl.Rows[0][1].ToString()), float.Parse(tbl.Rows[3][1].ToString()), 0, 0,
                                               float.Parse(tbl.Rows[1][1].ToString()), float.Parse(tbl.Rows[4][1].ToString()), 0, 0,
                                               0, 0, 1, 0,
                                               float.Parse(tbl.Rows[2][1].ToString()), float.Parse(tbl.Rows[5][1].ToString()), 0, 1), indexNum
                                           );
                }
                else if (treeView1.SelectedNode.Parent.Text == "Positions")
                {
                    Lumen.ReplacePosition(new OpenTK.Vector2(float.Parse(tbl.Rows[0][1].ToString()), float.Parse(tbl.Rows[1][1].ToString())), indexNum);
                }
                else if (treeView1.SelectedNode.Parent.Text == "Bounds")
                {
                    Lumen.ReplaceBound(new Lumen.Rect(float.Parse(tbl.Rows[0][1].ToString()), float.Parse(tbl.Rows[1][1].ToString()), float.Parse(tbl.Rows[2][1].ToString()), float.Parse(tbl.Rows[3][1].ToString())), indexNum);
                }
                else if (treeView1.SelectedNode.Parent.Text == "Atlases")
                {
                    Lumen.TextureAtlas atlas = new Lumen.TextureAtlas();

                    atlas.id     = int.Parse(tbl.Rows[0][1].ToString());
                    atlas.nameId = int.Parse(tbl.Rows[1][1].ToString());
                    atlas.width  = float.Parse(tbl.Rows[2][1].ToString());
                    atlas.height = float.Parse(tbl.Rows[3][1].ToString());

                    Lumen.ReplaceAtlas(atlas, indexNum);
                }
                else if (treeView1.SelectedNode.Parent.Text == "unk")
                {
                }
            }
            catch
            {
                MessageBox.Show("Incorrect format", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #2
0
        private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            Edited = true;
            int indexNum = treeView1.SelectedNode.Index;

            try
            {
                if (treeView1.SelectedNode.Parent.Text == "Symbols")
                {
                    Lumen.Strings[indexNum] = tbl.Rows[0][1].ToString();
                }
                else if (treeView1.SelectedNode.Parent.Text == "Colors")
                {
                    Lumen.ReplaceColor(new OpenTK.Vector4(float.Parse(tbl.Rows[0][1].ToString()) / 255f, float.Parse(tbl.Rows[1][1].ToString()) / 255f, float.Parse(tbl.Rows[2][1].ToString()) / 255f, float.Parse(tbl.Rows[3][1].ToString()) / 255f), indexNum);
                    treeView1.SelectedNode.Text = (Lumen.Colors[indexNum] * 255).ToString();
                }
                else if (treeView1.SelectedNode.Parent.Text == "Transforms")
                {
                    Lumen.ReplaceTransform(new OpenTK.Matrix4(
                                               float.Parse(tbl.Rows[0][1].ToString()), float.Parse(tbl.Rows[3][1].ToString()), 0, 0,
                                               float.Parse(tbl.Rows[1][1].ToString()), float.Parse(tbl.Rows[4][1].ToString()), 0, 0,
                                               0, 0, 1, 0,
                                               float.Parse(tbl.Rows[2][1].ToString()), float.Parse(tbl.Rows[5][1].ToString()), 0, 1), indexNum
                                           );
                }
                else if (treeView1.SelectedNode.Parent.Text == "Positions")
                {
                    Lumen.ReplacePosition(new OpenTK.Vector2(float.Parse(tbl.Rows[0][1].ToString()), float.Parse(tbl.Rows[1][1].ToString())), indexNum);
                }
                else if (treeView1.SelectedNode.Parent.Text == "Bounds")
                {
                    Lumen.ReplaceBound(new Lumen.Rect(float.Parse(tbl.Rows[0][1].ToString()), float.Parse(tbl.Rows[1][1].ToString()), float.Parse(tbl.Rows[2][1].ToString()), float.Parse(tbl.Rows[3][1].ToString())), indexNum);
                }
                else if (treeView1.SelectedNode.Parent.Text == "Atlases")
                {
                    Lumen.TextureAtlas atlas = new Lumen.TextureAtlas();

                    atlas.id     = int.Parse(tbl.Rows[0][1].ToString());
                    atlas.nameId = int.Parse(tbl.Rows[1][1].ToString());
                    atlas.width  = float.Parse(tbl.Rows[2][1].ToString());
                    atlas.height = float.Parse(tbl.Rows[3][1].ToString());

                    Lumen.ReplaceAtlas(atlas, indexNum);
                }
                else if (treeView1.SelectedNode.Parent.Text == "Texts")
                {
                    Lumen.DynamicText text = new Lumen.DynamicText();

                    text.CharacterId       = int.Parse(tbl.Rows[0][1].ToString());
                    text.unk1              = int.Parse(tbl.Rows[1][1].ToString());
                    text.placeholderTextId = int.Parse(tbl.Rows[2][1].ToString());
                    text.unk2              = int.Parse(tbl.Rows[3][1].ToString());
                    text.strokeColorId     = int.Parse(tbl.Rows[4][1].ToString());
                    text.unk3              = int.Parse(tbl.Rows[5][1].ToString());
                    text.unk4              = int.Parse(tbl.Rows[6][1].ToString());
                    text.unk5              = int.Parse(tbl.Rows[7][1].ToString());
                    text.alignment         = (Lumen.TextAlignment) int.Parse(tbl.Rows[8][1].ToString());
                    text.unk6              = short.Parse(tbl.Rows[9][1].ToString());
                    text.unk7              = int.Parse(tbl.Rows[10][1].ToString());
                    text.unk8              = int.Parse(tbl.Rows[11][1].ToString());
                    text.size              = int.Parse(tbl.Rows[12][1].ToString());
                    text.unk9              = int.Parse(tbl.Rows[13][1].ToString());
                    text.unk10             = int.Parse(tbl.Rows[14][1].ToString());
                    text.unk11             = int.Parse(tbl.Rows[15][1].ToString());
                    text.unk12             = int.Parse(tbl.Rows[16][1].ToString());
                }
                else if (treeView1.SelectedNode.Parent.Text == "unk")
                {
                }
            }
            catch
            {
                MessageBox.Show("Incorrect format", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }