public LayoutHierarchy(LayoutEditor layoutEditor)
        {
            ParentEditor = layoutEditor;

            InitializeComponent();

            treeView1.BackColor = FormThemes.BaseTheme.FormBackColor;
            treeView1.ForeColor = FormThemes.BaseTheme.FormForeColor;

            var imgList = new ImageList();

            imgList.ColorDepth = ColorDepth.Depth32Bit;
            imgList.Images.Add("folder", Toolbox.Library.Properties.Resources.Folder);
            imgList.Images.Add("AlignmentPane", FirstPlugin.Properties.Resources.AlignmentPane);
            imgList.Images.Add("WindowPane", FirstPlugin.Properties.Resources.WindowPane);
            imgList.Images.Add("ScissorPane", FirstPlugin.Properties.Resources.ScissorPane);
            imgList.Images.Add("BoundryPane", FirstPlugin.Properties.Resources.BoundryPane);
            imgList.Images.Add("NullPane", FirstPlugin.Properties.Resources.NullPane);
            imgList.Images.Add("PicturePane", FirstPlugin.Properties.Resources.PicturePane);
            imgList.Images.Add("QuickAcess", FirstPlugin.Properties.Resources.QuickAccess);
            imgList.Images.Add("TextPane", FirstPlugin.Properties.Resources.TextPane);
            imgList.Images.Add("material", Toolbox.Library.Properties.Resources.materialSphere);
            imgList.Images.Add("texture", Toolbox.Library.Properties.Resources.Texture);
            imgList.Images.Add("font", Toolbox.Library.Properties.Resources.Font);

            imgList.ImageSize   = new Size(22, 22);
            treeView1.ImageList = imgList;

            BackColor = FormThemes.BaseTheme.FormBackColor;
            ForeColor = FormThemes.BaseTheme.FormForeColor;

            ContexMenu = new STContextMenuStrip();
        }
        public LayoutAnimList(LayoutEditor parentEditor, EventHandler onPropertySelected)
        {
            OnProperySelected = onPropertySelected;
            ParentEditor      = parentEditor;
            InitializeComponent();

            BackColor = FormThemes.BaseTheme.FormBackColor;
            ForeColor = FormThemes.BaseTheme.FormForeColor;

            listView1.BackColor     = FormThemes.BaseTheme.FormBackColor;
            listView1.ForeColor     = FormThemes.BaseTheme.FormForeColor;
            listView1.FullRowSelect = true;

            imgList = new ImageList()
            {
                ColorDepth = ColorDepth.Depth32Bit,
                ImageSize  = new Size(24, 24),
            };

            imgList.Images.Add("LayoutAnimation", FirstPlugin.Properties.Resources.LayoutAnimation);

            listView1.SmallImageList = imgList;
            listView1.LargeImageList = imgList;

            listView1.Sorting = SortOrder.Ascending;
        }
            public AnimatedPaneFolder(LayoutEditor editor, string text)
            {
                ParentEditor = editor;
                Text         = text;

                Nodes.Add("Empty");
            }
Exemple #4
0
        public void LoadMaterial(BxlytMaterial material, LayoutEditor parentEditor)
        {
            ActiveMaterial = material;
            ParentEditor   = parentEditor;

            Loaded       = false;
            MaterialMode = true;

            stToolStrip1.Items.Clear();

            AddTab("Texture Maps", LoadTextureMaps);
            if (ActiveMaterial is Revolution.Material)
            {
                AddTab("Colors", LoadBRLYTColorBlending);
                AddTab("Blending", LoadBRLYTBlending);
                AddTab("SwapTable", LoadBRLYTTevSwapChannel);
                AddTab("Combiners", LoadBRLYTTextureCombiners);
            }
            else if (ActiveMaterial is CTR.Material)
            {
                AddTab("Colors", LoadBCLYTColorBlending);
                AddTab("Blending", LoadBlending);
                AddTab("Combiners", LoadBCLYTTextureCombiners);
            }
            else
            {
                AddTab("Colors", LoadColorBlending);
                AddTab("Blending", LoadBlending);
                AddTab("Combiners", LoadTextureCombiners);
            }

            stToolStrip1.Items[Runtime.LayoutEditor.MaterialTabIndex].PerformClick();

            Loaded = true;
        }
Exemple #5
0
        public void LoadTextures(LayoutEditor parentEditor, BxlytHeader header,
                                 Dictionary <string, STGenericTexture> textureList)
        {
            ParentEditor = parentEditor;
            TextureList  = textureList;
            ActiveLayout = header;
            listViewCustom1.Items.Clear();
            imgListSmall.Images.Clear();
            imgListSmall.Images.Add(FirstPlugin.Properties.Resources.MissingTexture);
            imgListBig.Images.Clear();
            imgListBig.Images.Add(FirstPlugin.Properties.Resources.MissingTexture);

            listViewCustom1.LargeImageList = imgListBig;
            listViewCustom1.SmallImageList = imgListSmall;

            listViewCustom1.BeginUpdate();
            foreach (var texture in header.Textures)
            {
                ListViewItem item = new ListViewItem();
                item.Text       = texture;
                item.ImageIndex = 0;
                listViewCustom1.Items.Add(item);
            }

            //Load textures after on a seperate thread

            if (Thread != null && Thread.IsAlive)
            {
                Thread.Abort();
            }

            Thread = new Thread((ThreadStart)(() =>
            {
                int index = 0;
                foreach (var texture in header.Textures)
                {
                    if (textureList.ContainsKey(texture))
                    {
                        if (header is BCLYT.Header)
                        {
                            //Skip certain formats like bcn ones
                            if (STGenericTexture.IsCompressed(textureList[texture].Format))
                            {
                                continue;
                            }
                        }

                        LoadTextureIcon(index, textureList[texture]);
                    }
                    index++;
                }
            }));
            Thread.Start();

            listViewCustom1.EndUpdate();

            isLoaded = true;
        }
        public void LoadPane(BasePane pane, LayoutEditor editor)
        {
            ActivePane   = pane;
            ParentEditor = editor;

            animationCB.Items.Clear();
            if (pane == null)
            {
                return;               //No pane is selected then jut reset and return
            }
            SearchActiveAnimations(pane);
        }
        public void LoadMaterial(BxlytMaterial material, LayoutEditor parentEditor)
        {
            ActiveMaterial = material;
            ParentEditor   = parentEditor;

            Loaded       = false;
            MaterialMode = true;

            stToolStrip1.Items.Clear();

            AddTab("Texture Maps", LoadTextureMaps);
            AddTab("Colors", LoadColorBlending);
            AddTab("Blending", LoadBlending);
            AddTab("Combiners", LoadTextureCombiners);

            stToolStrip1.Items[Runtime.LayoutEditor.MaterialTabIndex].PerformClick();

            Loaded = true;
        }
        public void LoadPane(BasePane pane, LayoutEditor parentEditor)
        {
            ParentEditor = parentEditor;

            Loaded       = false;
            MaterialMode = false;

            ActivePane = pane;

            stToolStrip1.Items.Clear();
            AddTab("Pane", LoadBasePane);
            if (pane is IPicturePane)
            {
                ActiveMaterial = ((IPicturePane)ActivePane).Material;
                AddTab("Picture Pane", LoadPicturePane);
                AddTab("Texture Maps", LoadTextureMaps);
                AddTab("Colors", LoadColorBlending);
                AddTab("Blending", LoadBlending);
                AddTab("Combiners", LoadTextureCombiners);
            }
            if (pane is IWindowPane)
            {
                //Note active material is set in window pane editor based on frame selector

                AddTab("Window Pane", LoadWindowPane);
                AddTab("Texture Maps", LoadWindowLoadTextureMaps);
                AddTab("Colors", LoadWindowColorBlending);
                AddTab("Blending", LoadWindowMatBlending);
                AddTab("Combiners", LoadWindowTextureCombiners);
            }
            if (pane is ITextPane)
            {
                ActiveMaterial = ((ITextPane)ActivePane).Material;

                AddTab("Text Pane", LoadTextPane);
                AddTab("Colors", LoadColorBlending);
                AddTab("Blending", LoadBlending);
            }
            if (pane is IPartPane)
            {
                AddTab("Part Pane", LoadPartPane);
            }

            AddTab("User Data", LoadUserData);

            int tabIndex;

            if (pane is IPicturePane)
            {
                tabIndex = Runtime.LayoutEditor.PicturePaneTabIndex;
            }
            else if (pane is IWindowPane)
            {
                tabIndex = Runtime.LayoutEditor.WindowPaneTabIndex;
            }
            else if (pane is ITextPane)
            {
                tabIndex = Runtime.LayoutEditor.TextPaneTabIndex;
            }
            else
            {
                tabIndex = Runtime.LayoutEditor.NullPaneTabIndex;
            }

            stToolStrip1.Items[tabIndex].PerformClick();

            Loaded = true;
        }