예제 #1
0
 private void load(ProjectEditor editor)
 {
     InternalChildren = new Drawable[]
     {
         new Box
         {
             RelativeSizeAxes = Axes.Both,
             Colour           = new Colour4(106, 100, 104, 255),
         },
         new Container
         {
             RelativeSizeAxes = Axes.Both,
             Padding          = new MarginPadding
             {
                 Top    = 200f,
                 Left   = 300f,
                 Right  = 300f,
                 Bottom = 200f,
             },
             Children = new Drawable[]
             {
                 new GamesToGoButton
                 {
                     RelativeSizeAxes = Axes.Y,
                     Width            = 650,
                     BackgroundColour = Colour4.DarkGreen,
                     Text             = @"Quieres compartir tu juego con la comunidad? Publica tu juego",
                 },
                 new GamesToGoButton
                 {
                     Anchor           = Anchor.TopRight,
                     Origin           = Anchor.TopRight,
                     Width            = 650,
                     RelativeSizeAxes = Axes.Y,
                     Padding          = new MarginPadding {
                         Bottom = 10
                     },
                     Height           = 1 / 3f,
                     BackgroundColour = Colour4.DodgerBlue,
                     Text             = @"Incompleto? Guarda y termina después",
                     Action           = () => editor.SaveProject(CommunityStatus.Saved),
                 },
                 new GamesToGoButton
                 {
                     Anchor           = Anchor.CentreRight,
                     Origin           = Anchor.CentreRight,
                     RelativeSizeAxes = Axes.Y,
                     Padding          = new MarginPadding {
                         Vertical = 5
                     },
                     Height           = 1 / 3f,
                     Width            = 650,
                     BackgroundColour = Colour4.PaleVioletRed,
                     Text             = @"Quieres un respaldo? Sube tu juego",
                     Action           = editor.UploadProject,
                 },
                 new GamesToGoButton
                 {
                     Anchor           = Anchor.BottomRight,
                     Origin           = Anchor.BottomRight,
                     Width            = 650,
                     RelativeSizeAxes = Axes.Y,
                     Padding          = new MarginPadding {
                         Top = 10
                     },
                     Height           = 1 / 3f,
                     BackgroundColour = Colour4.DarkSalmon,
                     Text             = @"Listo para publicar? Primero prueba tu juego",
                 },
             },
         },
     };
 }
예제 #2
0
        private void load(ProjectEditor editor)
        {
            InternalChildren = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = new Colour4(106, 100, 104, 255),
                },
                new GridContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Content          = new[]
                    {
                        new Drawable[]
                        {
                            //Listas de elementos
                            new Container
                            {
                                RelativeSizeAxes = Axes.Both,
                                Children         = new Drawable[]
                                {
                                    new Box
                                    {
                                        RelativeSizeAxes = Axes.Both,
                                        Colour           = Colour4.Gray,
                                    },
                                    new ProjectObjectManagerContainer <Card>(true)
                                    {
                                        Anchor = Anchor.TopLeft,
                                        Origin = Anchor.TopLeft,
                                        Height = 1 / 3f,
                                    },
                                    new ProjectObjectManagerContainer <Token>(true)
                                    {
                                        Anchor = Anchor.CentreLeft,
                                        Origin = Anchor.CentreLeft,
                                        Height = 1 / 3f,
                                    },
                                    new ProjectObjectManagerContainer <Board>(true)
                                    {
                                        Anchor = Anchor.BottomLeft,
                                        Origin = Anchor.BottomLeft,
                                        Height = 1 / 3f,
                                    },
                                },
                            },
                            //Area de edición
                            new Container
                            {
                                RelativeSizeAxes = Axes.Both,
                                Children         = new Drawable[]
                                {
                                    activeEditContainer = new BasicScrollContainer
                                    {
                                        RelativeSizeAxes = Axes.Both,
                                        Child            = new FillFlowContainer
                                        {
                                            RelativeSizeAxes = Axes.X,
                                            AutoSizeAxes     = Axes.Y,
                                            Direction        = FillDirection.Vertical,
                                            Children         = new Drawable[]
                                            {
                                                new Container
                                                {
                                                    RelativeSizeAxes = Axes.X,
                                                    AutoSizeAxes     = Axes.Y,
                                                    Padding          = new MarginPadding {
                                                        Horizontal = 60, Vertical = 50
                                                    },
                                                    Children = new Drawable[]
                                                    {
                                                        visualEditor = new ElementVisualEditorContainer(),
                                                        new SpriteText
                                                        {
                                                            Anchor   = Anchor.TopRight,
                                                            Origin   = Anchor.TopRight,
                                                            Position = new Vector2(-675, 10),
                                                            Text     = @"Nombre:",
                                                        },
                                                        nameTextBox = new BasicTextBox
                                                        {
                                                            CommitOnFocusLost = true,
                                                            Anchor            = Anchor.TopRight,
                                                            Origin            = Anchor.TopRight,
                                                            Position          = new Vector2(-250, 0),
                                                            Height            = 35,
                                                            Width             = 400,
                                                        },
                                                        new SpriteText
                                                        {
                                                            Anchor   = Anchor.TopRight,
                                                            Origin   = Anchor.TopRight,
                                                            Position = new Vector2(-675, 80),
                                                            Text     = @"Descripción:",
                                                        },
                                                        descriptionTextBox = new BasicTextBox
                                                        {
                                                            CommitOnFocusLost = true,
                                                            Anchor            = Anchor.TopRight,
                                                            Origin            = Anchor.TopRight,
                                                            Position          = new Vector2(-250, 70),
                                                            Height            = 35,
                                                            Width             = 400,
                                                        },
                                                        new GamesToGoButton
                                                        {
                                                            Anchor = Anchor.TopRight,
                                                            Origin = Anchor.TopRight,
                                                            Height = 35,
                                                            Width  = 200,
                                                            Text   = @"Borrar Elemento",
                                                            Action = () => editor.DeleteElement(currentEditing.Value),
                                                        },
                                                    },
                                                },
                                                new Container
                                                {
                                                    RelativeSizeAxes = Axes.X,
                                                    Height           = 600,
                                                    Children         = new Drawable[]
                                                    {
                                                        new FillFlowContainer
                                                        {
                                                            RelativeSizeAxes = Axes.Both,
                                                            Direction        = FillDirection.Full,
                                                            Spacing          = new Vector2(10),
                                                            Padding          = new MarginPadding {
                                                                Horizontal = 50
                                                            },
                                                            Children = new Drawable[]
                                                            {
                                                                elementSize = new VectorTextBoxContainer(4, false)
                                                                {
                                                                    TextX = @"Tamaño X:",
                                                                    TextY = @"Tamaño Y:",
                                                                },
                                                                elementOrientation = new LabeledDropdown <ElementOrientation>
                                                                {
                                                                    Text    = @"Orientación:",
                                                                    Element = new GamesToGoDropdown <ElementOrientation>
                                                                    {
                                                                        Width = 200,
                                                                    },
                                                                },
                                                                elementSideVisible = new LabeledDropdown <ElementSideVisible>
                                                                {
                                                                    Text    = @"Lado visible:",
                                                                    Element = new GamesToGoDropdown <ElementSideVisible>
                                                                    {
                                                                        Width = 200,
                                                                    },
                                                                },
                                                                elementPrivacy = new LabeledDropdown <ElementPrivacy>
                                                                {
                                                                    Text    = @"Privacidad:",
                                                                    Element = new GamesToGoDropdown <ElementPrivacy>
                                                                    {
                                                                        Width = 200,
                                                                    },
                                                                },
                                                                elementPosition = new VectorTextBoxContainer(4, true)
                                                                {
                                                                    TextX = @"Posición en X:",
                                                                    TextY = @"Posición en Y:",
                                                                },
                                                            },
                                                        },
                                                        elementSubElements = new Container
                                                        {
                                                            RelativeSizeAxes = Axes.Both,
                                                            Width            = 1 / 3f,
                                                            Anchor           = Anchor.TopRight,
                                                            Origin           = Anchor.TopRight,
                                                            Child            = tilesManagerContainer = new BoardObjectManagerContainer(),
                                                        },
                                                    },
                                                },
                                            },
                                        },
                                    },
                                    tileOverlay,
                                    noSelectionContainer = new Container
                                    {
                                        RelativeSizeAxes = Axes.Both,
                                        Anchor           = Anchor.Centre,
                                        Origin           = Anchor.Centre,
                                        Child            = new SpriteText
                                        {
                                            Anchor = Anchor.Centre,
                                            Origin = Anchor.Centre,
                                            Text   = @"Selecciona un objeto para editarlo",
                                        },
                                    },
                                },
                            },
                        },
                    },
                    ColumnDimensions = new[]
                    {
                        new Dimension(GridSizeMode.Relative, 0.25f),
                        new Dimension(),
                    },
                },
            };
            currentEditing.BindTo(editor.CurrentEditingElement);
            currentEditing.BindValueChanged(checkData, true);

            nameTextBox.OnCommit += delegate
            {
                if (currentEditing.Value != null)
                {
                    currentEditing.Value.Name.Value = nameTextBox.Text;
                }
            };

            descriptionTextBox.OnCommit += delegate
            {
                if (currentEditing.Value != null)
                {
                    currentEditing.Value.Description.Value = descriptionTextBox.Text;
                }
            };

            elementPosition.Current.BindValueChanged(_ => visualEditor.UpdatePreview());
            elementOrientation.Current.BindValueChanged(_ => visualEditor.UpdatePreview());
            elementSideVisible.Current.BindValueChanged(_ => visualEditor.UpdatePreview());
            elementSize.Current.BindValueChanged(_ => visualEditor.UpdatePreview());
            tilesManagerContainer.ElementsAdded   = _ => visualEditor.UpdatePreview();
            tilesManagerContainer.ElementsRemoved = _ => visualEditor.UpdatePreview();
        }