Пример #1
0
        public void BindTo(Sprite sprite, IList<int> sharedSPRs, Stream iso)
        {
            ignoreChanges = true;
            this.iso = iso;
            Sprite = sprite;
            ReloadSprite();

            if (sharedSPRs.Count > 0)
            {
                StringBuilder sb = new StringBuilder("WARNING: This sprite shares an SPR with: ");
                foreach (int i in sharedSPRs)
                {
                    sb.AppendFormat("0x{0:X2} ", i + 1);
                }
                sharedLabel.Text = sb.ToString();
                sharedLabel.Visible = true;
            }
            else
            {
                sharedLabel.Visible = false;
            }

            Enabled = true;
            ignoreChanges = false;
        }
Пример #2
0
        private void UpdateShapes(CharacterSprite charSprite,Sprite sprite)
        {
            bool oldIgnoreChanges = ignoreChanges;
            ignoreChanges = true;
            if (charSprite == null )
            {
                tabControl1.Enabled = false;
                if ( sprite.ToString() == "WEP1" || sprite.ToString() == "WEP2" ||
                     sprite.ToString() == "EFF1" || sprite.ToString() == "EFF2")
                {
                     tabControl1.Enabled = true;
                     if (sprite.ToString() == "WEP1")
                     {
                         currentShape = Shape.Shapes[SpriteType.WEP1];
                     }
                     else if (sprite.ToString() == "WEP2")
                     {
                         currentShape = Shape.Shapes[SpriteType.WEP2];
                     }
                     else if (sprite.ToString() == "EFF1")
                     {
                         currentShape = Shape.Shapes[SpriteType.EFF1];
                     }
                     else if (sprite.ToString() == "EFF2")
                     {
                         currentShape = Shape.Shapes[SpriteType.EFF2];
                     }
                     numericUpDown1.Maximum = currentShape.Frames.Count - 1;
                     UpdatePictureBox();

                }
            }
            else
            {

                tabControl1.Enabled = true;
                if (Shape.Shapes.ContainsKey(charSprite.SHP))
                {
                    numericUpDown1.Enabled = true;
                    pictureBox1.Enabled = true;

                    currentShape = Shape.Shapes[charSprite.SHP];
                    //numericUpDown1.Value = 1;
                    numericUpDown1.Maximum = currentShape.Frames.Count - 1;
                }
                else
                {
                    numericUpDown1.Enabled = false;
                    pictureBox1.Enabled = false;
                    currentShape = null;
                }
                UpdatePictureBox();
            }
            ignoreChanges = oldIgnoreChanges;
        }
Пример #3
0
        private void UpdateAnimationTab(CharacterSprite charSprite, Sprite sprite)
        {
            if(sprite.ToString() == "WEP1")
            {
                seqComboBox.SelectedItem = seqComboBox.Items[7];
            }
            else if (sprite.ToString() == "WEP2")
            {
                seqComboBox.SelectedItem = seqComboBox.Items[8];
            }
            else if (sprite.ToString() == "EFF1")
            {
                seqComboBox.SelectedItem = seqComboBox.Items[9];
            }
            else if (sprite.ToString() == "EFF2")
            {
                seqComboBox.SelectedItem = seqComboBox.Items[10];
            }

            if (charSprite != null &&
                seqComboBox.SelectedItem != null)
            {
                if (Sequence.Sequences.ContainsKey((SpriteType)seqComboBox.SelectedItem))
                {
                    IList<Sequence> sequences = Sequence.Sequences[(SpriteType)seqComboBox.SelectedItem];
                    currentSequences = sequences;
                    numericUpDown2.Minimum = 0;
                    numericUpDown2.Maximum = sequences.Count - 1;
                    numericUpDown2.Value = 0;
                    numericUpDown2.Enabled = true;
                    animationViewer1.Enabled = true;
                }
                else
                {
                    animationViewer1.Pause();
                    animationViewer1.Enabled = false;
                    numericUpDown2.Enabled = false;
                }
            }
        }