コード例 #1
0
        private void load(TextureStore textures)
        {
            if (workingProject == null)
            {
                workingProject = WorkingProject.Parse(null, store, textures, api);
                SaveProject(false);
            }

            initialRelations = workingProject.DatabaseObject.Relations == null ? null : new List <FileRelation>(workingProject.DatabaseObject.Relations);

            InternalChildren = new[]
            {
                new Container
                {
                    Depth            = 4,
                    RelativeSizeAxes = Axes.Both,
                    Padding          = new MarginPadding
                    {
                        Top = 30,
                    },
                    Child = screenContainer = new ScreenStack
                    {
                        RelativeSizeAxes = Axes.Both,
                    },
                },
                new Container
                {
                    Depth            = 3,
                    RelativeSizeAxes = Axes.X,
                    Height           = 30,
                    Children         = new Drawable[]
                    {
                        new Box
                        {
                            RelativeSizeAxes = Axes.Both,
                            Colour           = Colour4.Gray,
                        },
                        tabsBar = new EditorTabChanger(),
                        new CloseButton
                        {
                            Action = confirmClose,
                        },
                    },
                },
            };

            tabsBar.Current.ValueChanged       += changeEditorScreen;
            CurrentEditingElement.ValueChanged += _ => tabsBar.Current.Value = tabsBar.Current.Value switch
            {
                EditorScreenOption.Objetos => EditorScreenOption.Objetos,
                EditorScreenOption.Eventos => EditorScreenOption.Eventos,
                _ => EditorScreenOption.Objetos,
            };

            AddInternal(imagePicker);

            tabsBar.Current.Value = EditorScreenOption.Inicio;
        }
コード例 #2
0
ファイル: ProjectEditor.cs プロジェクト: RVCorp/GamesToGo
        private void load(TextureStore textures)
        {
            initialRelations = workingProject.DatabaseObject.Relations == null ? null : new List <FileRelation>(workingProject.DatabaseObject.Relations);

            InternalChildren = new[]
            {
                new Container
                {
                    Depth            = 5,
                    RelativeSizeAxes = Axes.Both,
                    Padding          = new MarginPadding
                    {
                        Top = 30,
                    },
                    Child = screenContainer = new ScreenStack
                    {
                        RelativeSizeAxes = Axes.Both,
                    },
                },
                new Container
                {
                    Depth            = 4,
                    RelativeSizeAxes = Axes.Both,
                    Padding          = new MarginPadding
                    {
                        Top = 30,
                    },
                    Child = fileOverlay = new ProjectFileOverlay(),
                },
                new Container
                {
                    Depth            = 3,
                    RelativeSizeAxes = Axes.X,
                    Height           = 30,
                    Children         = new Drawable[]
                    {
                        new Box
                        {
                            RelativeSizeAxes = Axes.Both,
                            Colour           = Colour4.Gray,
                        },
                        new GridContainer
                        {
                            RelativeSizeAxes = Axes.Both,
                            ColumnDimensions = new []
                            {
                                new Dimension(GridSizeMode.AutoSize),
                                new Dimension(GridSizeMode.Absolute, 10),
                                new Dimension(GridSizeMode.AutoSize),
                                new Dimension(),
                            },
                            RowDimensions = new []
                            {
                                new Dimension(),
                            },
                            Content = new []
                            {
                                new Drawable[]
                                {
                                    new TopButton(@"Archivo")
                                    {
                                        Action = fileOverlay.ToggleVisibility,
                                    },
                                    null,
                                    tabsBar = new EditorTabChanger(),
                                    new TopButton(@"Volver al inicio")
                                    {
                                        Action = confirmClose,
                                    },
                                },
                            },
                        },
                    },
                },
            };

            CurrentEditingElement.ValueChanged += _ => tabsBar.Current.Value = tabsBar.Current.Value switch
            {
                EditorScreenOption.Objets => EditorScreenOption.Objets,
                EditorScreenOption.Events => EditorScreenOption.Events,
                _ => EditorScreenOption.Objets,
            };

            AddInternal(imagePicker);

            tabsBar.Current.BindValueChanged(changeEditorScreen, true);
        }