private void listViewCustom1_DoubleClick(object sender, EventArgs e)
        {
            if (listViewCustom1.SelectedItems.Count > 0)
            {
                int SelectedFrame = KeyFrames[listViewCustom1.SelectedIndices[0]];

                string currentTex = listViewCustom1.SelectedItems[0].Text;

                Texture_Selector editor = new Texture_Selector();
                editor.LoadTexture(currentTex, activeSampleU != null);

                if (editor.ShowDialog() == DialogResult.OK)
                {
                    string NewTex = editor.GetSelectedTexture();

                    if (!ActiveMaterialAnim.Textures.Contains(NewTex))
                    {
                        ActiveMaterialAnim.Textures.Add(NewTex);
                    }

                    int index = ActiveMaterialAnim.Textures.IndexOf(NewTex);
                    if (activeSampleU != null)
                    {
                        activeSampleU.group.SetValue(SelectedFrame, index);
                    }
                    else
                    {
                        activeSampler.group.SetValue(SelectedFrame, index);
                    }

                    ActiveMaterialAnim.UpdateAnimationData();
                }
            }
        }
        private void btnAdd_Click(object sender, EventArgs e)
        {
            Texture_Selector editor = new Texture_Selector();

            editor.LoadTexture("", activeSampleU != null);

            if (editor.ShowDialog() == DialogResult.OK)
            {
                string NewTex = editor.GetSelectedTexture();

                if (ActiveMaterialAnim.Textures == null)
                {
                    ActiveMaterialAnim.Textures = new List <string>();
                }

                if (!ActiveMaterialAnim.Textures.Contains(NewTex))
                {
                    ActiveMaterialAnim.Textures.Add(NewTex);
                }

                if (activeSampler != null)
                {
                    activeSampler.AddKeyFrame(NewTex);
                }
                else
                {
                }
            }
        }
Beispiel #3
0
        private void addKeyFrameToolstrip_Click(object sender, EventArgs e)
        {
            if (activeSampler != null)
            {
                bool IsWiiU = activeSampler is FTXP.BfresSamplerAnim;

                Texture_Selector editor = new Texture_Selector();
                editor.LoadTexture("", IsWiiU);
                if (editor.ShowDialog() == DialogResult.OK)
                {
                    string NewTex = editor.GetSelectedTexture();

                    if (ActiveMaterialAnim.Textures == null)
                    {
                        ActiveMaterialAnim.Textures = new List <string>();
                    }

                    if (!ActiveMaterialAnim.Textures.Contains(NewTex))
                    {
                        ActiveMaterialAnim.Textures.Add(NewTex);
                    }

                    if (activeSampler != null)
                    {
                        activeSampler.AddKeyFrame(NewTex);
                    }
                }
            }
        }
        private void btnEdit_Click(object sender, EventArgs e)
        {
            Texture_Selector selector = new Texture_Selector();

            if (selector.ShowDialog() == DialogResult.OK)
            {
                textureNameTB.Text = selector.GetSelectedTexture();
            }
        }
        private void textureRefListView_DoubleClick(object sender, EventArgs e)
        {
            if (textureRefListView.SelectedIndices.Count <= 0)
            {
                return;
            }

            int index            = textureRefListView.SelectedIndices[0];
            Texture_Selector tex = new Texture_Selector();

            tex.LoadTexture(textureRefListView.SelectedItems[0].Text, material.GetResFileU() != null);
            if (tex.ShowDialog() == DialogResult.OK)
            {
                material.TextureMaps[index].Name = tex.GetSelectedTexture();
                InitializeTextureListView(material);
                material.UpdateTextureMaps();
            }
        }