public void FillComboBoxes()
        {
            SpriteList possibleSprites = new SpriteList();

            if (this.sceneOrGroup.Text == "Entire Scene")
            {
                possibleSprites = GameData.Scene.Sprites;
            }
            else if (GameData.EditorLogic.CurrentSprites.Count != 0)
            {
                ((Sprite)GameData.EditorLogic.CurrentSprites[0].TopParent).GetAllDescendantsOneWay(possibleSprites);
            }
            this.rootSpriteComboBox.AddItem("<No Root>");
            foreach (Sprite s in possibleSprites)
            {
                this.rootSpriteComboBox.AddItem(s.Name);
            }
            Sprite defaultRoot = possibleSprites.FindByName("root1");

            if (defaultRoot == null)
            {
                defaultRoot = possibleSprites.FindByName("root");
            }
            if (defaultRoot == null)
            {
                defaultRoot = possibleSprites.FindByName("Root");
            }
            if (defaultRoot == null)
            {
                defaultRoot = possibleSprites.FindByName("Root1");
            }
            if (defaultRoot == null)
            {
                defaultRoot = possibleSprites.FindWithNameContaining("root");
            }
            if (defaultRoot == null)
            {
                defaultRoot = possibleSprites.FindWithNameContaining("Root");
            }
            if (defaultRoot != null)
            {
                this.rootSpriteComboBox.Text = defaultRoot.Name;
            }
            else
            {
                this.rootSpriteComboBox.Text = "<No Root>";
            }
        }
Пример #2
0
 public void FillComboBoxes()
 {
     SpriteList possibleSprites = new SpriteList();
     if (this.sceneOrGroup.Text == "Entire Scene")
     {
         possibleSprites = GameData.Scene.Sprites;
     }
     else if (GameData.EditorLogic.CurrentSprites.Count != 0)
     {
         ((Sprite)GameData.EditorLogic.CurrentSprites[0].TopParent).GetAllDescendantsOneWay(possibleSprites);
     }
     this.rootSpriteComboBox.AddItem("<No Root>");
     foreach (Sprite s in possibleSprites)
     {
         this.rootSpriteComboBox.AddItem(s.Name);
     }
     Sprite defaultRoot = possibleSprites.FindByName("root1");
     if (defaultRoot == null)
     {
         defaultRoot = possibleSprites.FindByName("root");
     }
     if (defaultRoot == null)
     {
         defaultRoot = possibleSprites.FindByName("Root");
     }
     if (defaultRoot == null)
     {
         defaultRoot = possibleSprites.FindByName("Root1");
     }
     if (defaultRoot == null)
     {
         defaultRoot = possibleSprites.FindWithNameContaining("root");
     }
     if (defaultRoot == null)
     {
         defaultRoot = possibleSprites.FindWithNameContaining("Root");
     }
     if (defaultRoot != null)
     {
         this.rootSpriteComboBox.Text = defaultRoot.Name;
     }
     else
     {
         this.rootSpriteComboBox.Text = "<No Root>";
     }
 }