/// <summary> /// Take an IDialogueBox and break it down into multiple instructions as necessary /// </summary> /// <param name="input"></param> /// <returns></returns> public IInstruction[] BreakUpDialgoueBox(IDialogueBox input, BoxLines[] boxes) { /*if (boxes.Length == 1) * { * return new IInstruction[1] { input as IInstruction }; * } * //Leaving this old here for posterity. I removed this out because it was causing issues with text boxes that have 2 lines but no overflow. (They weren't wrapping properly for some reason.) */ List <IInstruction> newBoxes = new List <IInstruction>(); input.SetDialogue(boxes[0].ToString()); newBoxes.Add(input as IInstruction); for (int i = 1; i < boxes.Length; i++) { var workingBox = boxes[i]; BasicTextBox newDialogBox = new BasicTextBox(); newDialogBox.InitalizeDefault(); newDialogBox.SetDialogue(workingBox.ToString()); newDialogBox.SetName(input.GetName()); newBoxes.Add(newDialogBox); } return(newBoxes.ToArray()); }
public void TestSetTextSelection() { TextBox textBox = null; AddStep("add textbox", () => { textBoxes.Add(textBox = new BasicTextBox { Size = new Vector2(300, 40), Text = "initial text", }); }); AddStep("click on textbox", () => { InputManager.MoveMouseTo(textBox); InputManager.Click(MouseButton.Left); }); AddStep("set text", () => textBox.Text = "a longer string of text"); // ideally, this should check the caret/selection position, but that is not exposed in TextBox. AddAssert("nothing selected", () => textBox.SelectedText == string.Empty); AddStep("select all", () => InputManager.Keys(PlatformAction.SelectAll)); AddStep("set text via current", () => textBox.Text = "short text"); AddAssert("nothing selected", () => textBox.SelectedText == string.Empty); }
public void TestInteractiveContent() => createContent(button => { TextBox textBox; return(new AnimatedPopover { Child = new FillFlowContainer { Direction = FillDirection.Vertical, Width = 200, AutoSizeAxes = Axes.Y, Spacing = new Vector2(5), Children = new Drawable[] { textBox = new BasicTextBox { PlaceholderText = $"{button.Anchor} text box", Height = 30, RelativeSizeAxes = Axes.X }, new BasicButton { RelativeSizeAxes = Axes.X, Height = 30, Text = "Clear", Action = () => textBox.Text = string.Empty } } } }); });
public void TestInteractiveContent() => createContent((anchor, popover) => { TextBox textBox; popover.AlwaysPresent = true; popover.Child = new FillFlowContainer { Direction = FillDirection.Vertical, Width = 200, AutoSizeAxes = Axes.Y, Spacing = new Vector2(5), Children = new Drawable[] { textBox = new BasicTextBox { PlaceholderText = $"{anchor} text box", Height = 30, RelativeSizeAxes = Axes.X }, new BasicButton { RelativeSizeAxes = Axes.X, Height = 30, Text = "Clear", Action = () => textBox.Text = string.Empty } } }; });
public void TestInteractiveContent() { createContent(button => { TextBox textBox; return(new AnimatedPopover { Child = new FillFlowContainer { Direction = FillDirection.Vertical, Width = 200, AutoSizeAxes = Axes.Y, Spacing = new Vector2(5), Children = new Drawable[] { textBox = new BasicTextBox { PlaceholderText = $"{button.Anchor} text box", Height = 30, RelativeSizeAxes = Axes.X }, new BasicButton { RelativeSizeAxes = Axes.X, Height = 30, Text = "Clear", Action = () => textBox.Text = string.Empty } } } }); }); AddStep("click button", () => { InputManager.MoveMouseTo(this.ChildrenOfType <DrawableWithPopover>().First()); InputManager.Click(MouseButton.Left); }); AddAssert("popover shown", () => this.ChildrenOfType <Popover>().Any(popover => popover.State.Value == Visibility.Visible)); AddStep("click textbox", () => { InputManager.MoveMouseTo(this.ChildrenOfType <TextBox>().First()); InputManager.Click(MouseButton.Left); }); AddAssert("textbox is focused", () => InputManager.FocusedDrawable is TextBox); AddAssert("popover still shown", () => this.ChildrenOfType <Popover>().Any(popover => popover.State.Value == Visibility.Visible)); AddStep("click in popover", () => { InputManager.MoveMouseTo(this.ChildrenOfType <Popover>().First().Body.ScreenSpaceDrawQuad.TopLeft + Vector2.One); InputManager.Click(MouseButton.Left); }); AddAssert("popover is focused", () => InputManager.FocusedDrawable is Popover); AddAssert("popover still shown", () => this.ChildrenOfType <Popover>().Any(popover => popover.State.Value == Visibility.Visible)); }
public void TestKeyHandledByOtherDrawableDoesNotTrigger() { List <TestAction> pressedActions = new List <TestAction>(); List <TestAction> releasedActions = new List <TestAction>(); TextBox textBox = null; AddStep("add children", () => { pressedActions.Clear(); releasedActions.Clear(); Child = new TestKeyBindingContainer { Children = new Drawable[] { textBox = new BasicTextBox { Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(200, 30) }, new TestKeyBindingReceptor { Pressed = a => pressedActions.Add(a), Released = a => releasedActions.Add(a) } } }; }); AddStep("focus textbox and move mouse away", () => { InputManager.MoveMouseTo(textBox); InputManager.Click(MouseButton.Left); InputManager.MoveMouseTo(textBox, new Vector2(0, 100)); }); AddStep("press enter", () => InputManager.PressKey(Key.Enter)); AddStep("press mouse button", () => InputManager.PressButton(MouseButton.Left)); AddStep("release enter", () => InputManager.ReleaseKey(Key.Enter)); AddStep("release mouse button", () => InputManager.ReleaseButton(MouseButton.Left)); AddAssert("no pressed actions", () => pressedActions.Count == 0); AddAssert("no released actions", () => releasedActions.Count == 0); }
public void TestPlatformAction() { BasicTextBox textbox = null; AddStep("add textbox", () => Child = textbox = new BasicTextBox { Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(100, 20), Text = "test text" }); AddStep("focus textbox", () => { InputManager.MoveMouseTo(textbox); InputManager.Click(MouseButton.Left); }); AddAssert("text is not selected", () => string.IsNullOrEmpty(textbox.SelectedText)); AddStep("press platform action", () => InputManager.Keys(PlatformAction.SelectAll)); AddAssert("text is selected", () => textbox.SelectedText == "test text"); }
public void TestReadOnly() { BasicTextBox firstTextBox = null; BasicTextBox secondTextBox = null; AddStep("add textboxes", () => textBoxes.AddRange(new[] { firstTextBox = new BasicTextBox { Text = "Readonly textbox", Size = new Vector2(500, 30), ReadOnly = true, TabbableContentContainer = textBoxes }, secondTextBox = new BasicTextBox { Text = "Standard textbox", Size = new Vector2(500, 30), TabbableContentContainer = textBoxes } })); AddStep("click first (readonly) textbox", () => { InputManager.MoveMouseTo(firstTextBox); InputManager.Click(MouseButton.Left); }); AddAssert("first textbox has no focus", () => !firstTextBox.HasFocus); AddStep("click second (editable) textbox", () => { InputManager.MoveMouseTo(secondTextBox); InputManager.Click(MouseButton.Left); }); AddStep("try to tab backwards", () => { InputManager.PressKey(Key.ShiftLeft); InputManager.Key(Key.Tab); InputManager.ReleaseKey(Key.ShiftLeft); }); AddAssert("first (readonly) has no focus", () => !firstTextBox.HasFocus); AddStep("drag on first (readonly) textbox", () => { InputManager.MoveMouseTo(firstTextBox.ScreenSpaceDrawQuad.Centre); InputManager.PressButton(MouseButton.Left); InputManager.MoveMouseTo(firstTextBox.ScreenSpaceDrawQuad.TopLeft); InputManager.ReleaseButton(MouseButton.Left); }); AddAssert("first textbox has no focus", () => !firstTextBox.HasFocus); AddStep("make first textbox non-readonly", () => firstTextBox.ReadOnly = false); AddStep("click first textbox", () => { InputManager.MoveMouseTo(firstTextBox); InputManager.Click(MouseButton.Left); }); AddStep("make first textbox readonly again", () => firstTextBox.ReadOnly = true); AddAssert("first textbox yielded focus", () => !firstTextBox.HasFocus); AddStep("delete last character", () => InputManager.Keys(PlatformAction.DeleteBackwardChar)); AddAssert("no text removed", () => firstTextBox.Text == "Readonly textbox"); }
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(); }
private void load() { Origin = Anchor.TopRight; Anchor = Anchor.TopRight; RelativeSizeAxes = Axes.Both; Width = 1 / 3f; Children = new Drawable[] { shadowBox = new Box { RelativeSizeAxes = Axes.Both, Colour = Colour4.Black, Alpha = 0, }, popUpContent = new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, RelativePositionAxes = Axes.X, X = 1, Child = new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, Width = 3 / 4f, BorderColour = new Colour4(70, 68, 66, 255), BorderThickness = 4, Masking = true, CornerRadius = 15, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = new Colour4(106, 100, 104, 255), }, new Container { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Padding = new MarginPadding(50), Child = new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Children = new Drawable[] { new SpriteText { Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, Text = @"Usuario:", }, usernameBox = new BasicTextBox { Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, Height = 35, Width = 380, Margin = new MarginPadding { Bottom = 20 }, }, new SpriteText { Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, Text = @"Contraseña:", }, passwordBox = new BasicPasswordTextBox { Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, Height = 35, Width = 380, Margin = new MarginPadding { Bottom = 50 }, }, new Container { Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Child = loginButton = new GamesToGoButton { Origin = Anchor.BottomCentre, Anchor = Anchor.BottomCentre, Text = @"Iniciar Sesión", Width = 100, Height = 35, Action = () => api.Login(usernameBox.Text, passwordBox.Text), }, }, }, }, }, }, }, }, }; loginButton.Enabled.Value = false; passwordBox.Current.BindValueChanged(checkUserPass); usernameBox.Current.BindValueChanged(checkUserPass); localUser.BindTo(api.LocalUser); localUser.BindValueChanged(_ => nextScreenAction?.Invoke()); api.Login(@"daro31", @"1234"); }
private void load() { RelativeSizeAxes = Axes.Both; Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.Black, Alpha = 0.5f, }, new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding(20), Child = new GridContainer { RelativeSizeAxes = Axes.Both, RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize), new Dimension(GridSizeMode.AutoSize), new Dimension(), new Dimension(GridSizeMode.Absolute, 30), }, Content = new[] { new Drawable[] { new FillFlowContainer { Name = @"Nombre evento", RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Horizontal, Padding = new MarginPadding { Bottom = 5 }, Spacing = new Vector2(7), Children = new Drawable[] { new SpriteText { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, Text = @"Nombre del evento:", Font = new FontUsage(size: 20), }, eventNameBox = new BasicTextBox { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, Size = new Vector2(400, 30), }, }, }, }, new Drawable[] { eventDescriptorContainer = new Container { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, }, }, new Drawable[] { new BasicScrollContainer { RelativeSizeAxes = Axes.Both, ClampExtension = 30, Child = actionFillFlow = new FillFlowContainer <ActionDescriptor> { AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, Direction = FillDirection.Vertical, }, }, }, new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Child = new ActionTypeListing { Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, }, }, }, }, }, }, argumentListing, }; }
private void load() { RelativeSizeAxes = Axes.Both; Children = new Drawable[] { shadowBox = new Box { RelativeSizeAxes = Axes.Both, Colour = Colour4.Black, Alpha = 0, }, content = new Container { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { new GridContainer { RelativeSizeAxes = Axes.Both, RowDimensions = new[] { new Dimension(GridSizeMode.Relative, .2f), new Dimension(GridSizeMode.Relative, .5f), new Dimension() }, ColumnDimensions = new[] { new Dimension() }, Content = new[] { new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding(10), Child = new SimpleIconButton(FontAwesome.Solid.Times) { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, Action = Hide, }, }, }, new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { new FillFlowContainer { RelativeSizeAxes = Axes.Both, Direction = FillDirection.Vertical, Padding = new MarginPadding(30), Children = new Drawable[] { new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Children = new Drawable[] { new SpriteText { Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, Text = @"Usuario:", Font = new FontUsage(size: 60) }, usernameBox = new BasicTextBox { Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, Height = 150, RelativeSizeAxes = Axes.X, }, } }, new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Children = new Drawable[] { new SpriteText { Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, Text = @"Contraseña:", Font = new FontUsage(size: 60), }, passwordBox = new BasicPasswordTextBox { Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, Height = 150, RelativeSizeAxes = Axes.X, }, }, }, }, }, }, }, }, new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding(30), Child = login = new GamesToGoButton { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Height = 225, RelativeSizeAxes = Axes.X, Text = @"Iniciar Sesión", Action = () => api.Login(usernameBox.Text, passwordBox.Text), }, }, }, }, }, }, }, }; login.SpriteText.Font = new FontUsage(size: 60); login.Enabled.Value = false; passwordBox.Current.BindValueChanged(checkUserPass); usernameBox.Current.BindValueChanged(checkUserPass); localUser.BindTo(api.LocalUser); localUser.BindValueChanged(_ => { usernameBox.Text = ""; passwordBox.Text = ""; Hide(); nextScreenAction?.Invoke(); }); api.Login(@"daro31", @"1234"); }
private void load() { RelativeSizeAxes = Axes.Both; Children = new Drawable[] { shadowBox = new Box { RelativeSizeAxes = Axes.Both, Colour = Colour4.Black, Alpha = 0, }, content = new Container { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { new GridContainer { RelativeSizeAxes = Axes.Both, RowDimensions = new[] { new Dimension(GridSizeMode.Relative, .1f), new Dimension(GridSizeMode.Relative, .6f), new Dimension() }, ColumnDimensions = new[] { new Dimension() }, Content = new[] { new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding(10), Child = new SimpleIconButton(FontAwesome.Solid.Times) { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, Action = Hide, }, }, }, new Drawable[] { new Container { Depth = 0, RelativeSizeAxes = Axes.Both, Children = new Drawable[] { new FillFlowContainer { RelativeSizeAxes = Axes.Both, Direction = FillDirection.Vertical, Padding = new MarginPadding(30), Children = new Drawable[] { new Container { Anchor = Anchor.TopLeft, Origin = Anchor.TopLeft, RelativeSizeAxes = Axes.X, Height = 200, Child = searchTextBox = new BasicTextBox { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.X, Width = .9f, Height = 150, } }, new Container { Anchor = Anchor.TopLeft, Origin = Anchor.TopLeft, RelativeSizeAxes = Axes.X, Height = 150, Child = new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, Width = .9f, Child = tagsContainer = new TagSelectionContainer(100) { RelativeSizeAxes = Axes.X, Height = 100 } } } }, }, }, }, }, new Drawable[] { new Container { Depth = 1, RelativeSizeAxes = Axes.Both, Padding = new MarginPadding(30), Child = search = new GamesToGoButton { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Height = 225, RelativeSizeAxes = Axes.X, Text = @"Buscar", Action = () => searchRequest() }, }, }, }, }, }, }, }; tagsContainer.Current.BindValueChanged(v => enableButton()); searchTextBox.Current.BindValueChanged(t => enableButton()); search.SpriteText.Font = new FontUsage(size: 60); search.Enabled.Value = false; }
private void load() { RelativeSizeAxes = Axes.Both; Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.Black, Alpha = 0.5f, }, new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding(20), Children = new Drawable[] { new GridContainer { RelativeSizeAxes = Axes.Both, RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize), new Dimension(GridSizeMode.AutoSize), new Dimension(), new Dimension(GridSizeMode.Absolute, 30), }, Content = new[] { new Drawable[] { new FillFlowContainer { Name = @"Nombre evento", RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Horizontal, Padding = new MarginPadding { Bottom = 5 }, Spacing = new Vector2(7), Children = new Drawable[] { new SpriteText { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, Text = @"Nombre del evento:", Font = new FontUsage(size: 20), }, eventNameBox = new BasicTextBox { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, Size = new Vector2(400, 30), }, new SpriteText { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, Text = @"Prioridad:", Font = new FontUsage(size: 20), }, priorityBox = new NumericTextBox(false) { LengthLimit = 1, Size = new Vector2(100, 30), }, }, }, }, new Drawable[] { eventDescriptorContainer = new Container { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, }, }, new Drawable[] { new BasicScrollContainer { RelativeSizeAxes = Axes.Both, ClampExtension = 30, Child = actionFillFlow = new FillFlowContainer <ActionDescriptor> { AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, Direction = FillDirection.Vertical, }, }, }, new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Child = new ActionTypeListing { OnSelection = created => Current.Value.Actions.Add(Activator.CreateInstance(created.GetType()) as EventAction), Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, }, }, }, }, }, new GamesToGoButton { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, Height = 35, Width = 200, Text = @"Cerrar", Action = Hide, }, }, }, argumentListing, selectorOverlay, }; }
private void load(Storage storage, GameHost host, FrameworkConfigManager frameworkConfig, FontStore fonts, Game game, AudioManager audio) { interactive = host.Window != null; config = new TestBrowserConfig(storage); exit = host.Exit; audio.AddAdjustment(AdjustableProperty.Frequency, audioRateAdjust); var resources = game.Resources; //Roboto game.AddFont(resources, @"Fonts/Roboto/Roboto-Regular"); game.AddFont(resources, @"Fonts/Roboto/Roboto-Bold"); //RobotoCondensed game.AddFont(resources, @"Fonts/RobotoCondensed/RobotoCondensed-Regular"); game.AddFont(resources, @"Fonts/RobotoCondensed/RobotoCondensed-Bold"); showLogOverlay = frameworkConfig.GetBindable <bool>(FrameworkSetting.ShowLogOverlay); var rateAdjustClock = new StopwatchClock(true); var framedClock = new FramedClock(rateAdjustClock); Children = new Drawable[] { mainContainer = new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = test_list_width }, Children = new Drawable[] { new SafeAreaContainer { SafeAreaOverrideEdges = Edges.Right | Edges.Bottom, RelativeSizeAxes = Axes.Both, Child = testContentContainer = new Container { Clock = framedClock, RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Top = 50 }, Child = compilingNotice = new Container { Alpha = 0, Anchor = Anchor.Centre, Origin = Anchor.Centre, Masking = true, Depth = float.MinValue, CornerRadius = 5, AutoSizeAxes = Axes.Both, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.Black, }, new SpriteText { Font = new FontUsage(size: 30), Text = @"Compiling new version..." } }, } } }, toolbar = new TestBrowserToolbar { RelativeSizeAxes = Axes.X, Height = 50, }, } }, leftContainer = new Container { RelativeSizeAxes = Axes.Y, Size = new Vector2(test_list_width, 1), Masking = true, Children = new Drawable[] { new SafeAreaContainer { SafeAreaOverrideEdges = Edges.Left | Edges.Top | Edges.Bottom, RelativeSizeAxes = Axes.Both, Child = new Box { Colour = FrameworkColour.GreenDark, RelativeSizeAxes = Axes.Both } }, new FillFlowContainer { Direction = FillDirection.Vertical, RelativeSizeAxes = Axes.Both, Children = new Drawable[] { searchTextBox = new TestBrowserTextBox { OnCommit = delegate { var firstTest = leftFlowContainer.Where(b => b.IsPresent).SelectMany(b => b.FilterableChildren).OfType <TestSubButton>() .FirstOrDefault(b => b.MatchingFilter)?.TestType; if (firstTest != null) { LoadTest(firstTest); } }, Height = 25, RelativeSizeAxes = Axes.X, PlaceholderText = "type to search", Depth = -1, }, new BasicScrollContainer { RelativeSizeAxes = Axes.Both, Masking = false, Child = leftFlowContainer = new SearchContainer <TestGroupButton> { Padding = new MarginPadding { Top = 3, Bottom = 20 }, Direction = FillDirection.Vertical, AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, } } } } } }, }; searchTextBox.Current.ValueChanged += e => leftFlowContainer.SearchTerm = e.NewValue; if (RuntimeInfo.SupportsJIT) { backgroundCompiler = new DynamicClassCompiler <TestScene>(); backgroundCompiler.CompilationStarted += compileStarted; backgroundCompiler.CompilationFinished += compileFinished; backgroundCompiler.CompilationFailed += compileFailed; try { backgroundCompiler.Start(); } catch { //it's okay for this to fail for now. } } foreach (Assembly asm in assemblies) { toolbar.AddAssembly(asm.GetName().Name, asm); } Assembly.BindValueChanged(updateList); RunAllSteps.BindValueChanged(v => runTests(null)); PlaybackRate.BindValueChanged(e => { rateAdjustClock.Rate = e.NewValue; audioRateAdjust.Value = e.NewValue; }, true); }
private void load() { Children = new Drawable[] { drawableSkeleton = new DrawableSkeleton(Link.Skeleton) { RelativeSizeAxes = Axes.Y, Width = skeleton_width, BoneClicked = bone => { currentBone = bone; boneText.Text = bone.Name; sensorIdInput.Text = Link.Get(bone.Name, true)?.SensorId.ToString() ?? string.Empty; sensorIdInput.ReadOnly = false; } }, new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = skeleton_width }, Children = new Drawable[] { new FillFlowContainer { AutoSizeAxes = Axes.Both, Anchor = Anchor.TopLeft, Origin = Anchor.TopLeft, Direction = FillDirection.Vertical, Children = new Drawable[] { portInput = new BasicTextBox { PlaceholderText = "Serial Port", Size = new Vector2(250, 20), CommitOnFocusLost = true }, receiverIdInput = new NumberTextBox { PlaceholderText = "Receiver ID", Size = new Vector2(250, 20), CommitOnFocusLost = true }, boneText = new SpriteText { Text = "Select a bone", Font = new FontUsage(size: 24, weight: "Bold") }, sensorIdInput = new NumberTextBox { PlaceholderText = "Sensor ID", Size = new Vector2(250, 20), CommitOnFocusLost = true, ReadOnly = true }, new TextButton { Text = "Calibrate All", Size = new Vector2(250, 20), Action = () => { Link.CalibrateAll(); } } } } } } }; portInput.OnCommit += (sender, newText) => { Link.Port = sender.Text; }; receiverIdInput.OnCommit += (sender, newText) => { if (sender.Text == string.Empty) { return; } Link.ReceiverId = int.Parse(sender.Text); }; sensorIdInput.OnCommit += (sender, newText) => { if (sender.Text == string.Empty) { return; } var id = int.Parse(sender.Text); if (currentBone == null) { return; } var existing = Link.Get(currentBone.Name, true) ?? Link.Get(id, true); if (existing == null) { Link.Register(currentBone.Name, id); } else { Link.UpdateLink(currentBone.Name, id); } }; }
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, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Colour4.Cyan, }, new Container { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Padding = new MarginPadding { Horizontal = 60, Vertical = 50 }, Children = new Drawable[] { new ImagePreviewContainer(), new SpriteText { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, Position = new Vector2(-675, 10), Text = @"Nombre:", Colour = Colour4.Black, }, nameTextBox = new BasicTextBox { 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:", Colour = Colour4.Black, }, descriptionTextBox = new BasicTextBox { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, Position = new Vector2(-250, 70), Height = 35, Width = 400, }, }, }, }, }, new Container { RelativeSizeAxes = Axes.X, Height = 600, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Colour4.Fuchsia, }, elementSize = new Container { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { new SpriteText { Text = @"Tamaño X:", Position = new Vector2(50, 50), }, sizeTextBoxX = new NumericTextBox(4) { Height = 35, Width = 75, Position = new Vector2(125, 45), }, new SpriteText { Text = @"Tamaño Y:", Position = new Vector2(50, 100), }, sizeTextBoxY = new NumericTextBox(4) { Height = 35, Width = 75, Position = new Vector2(125, 95), }, }, }, 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); }
private void load() { InternalChildren = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = new Colour4(106, 100, 104, 255), //Color fondo general }, new GridContainer { RelativeSizeAxes = Axes.Both, ColumnDimensions = new[] { new Dimension(), }, RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize), new Dimension(), }, Content = new[] { new Drawable[] { new Container { Depth = 0, AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, Children = new Drawable[] { new Container { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, RelativeSizeAxes = Axes.X, Height = 180, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Colour4.Black.Opacity(0.8f), }, new Container { Padding = new MarginPadding(15), Size = new Vector2(180), Child = new ProjectImageChangerButton(), }, new SpriteText { Text = @"Nombre del proyecto:", Position = new Vector2(180, 17), }, titleTextBox = new BasicTextBox { Text = project.DatabaseObject.Name, Position = new Vector2(340, 10), Height = TEXT_ELEMENT_SIZE, Width = 775, }, new SpriteText { Anchor = Anchor.TopCentre, Text = @"Minimo Jugadores:", Position = new Vector2(560, 17), }, minPlayersTextBox = new NumericTextBox(false) { LengthLimit = 2, Text = Math.Max(2, project.DatabaseObject.MinNumberPlayers).ToString(), Anchor = Anchor.TopCentre, Position = new Vector2(694, 10), Height = TEXT_ELEMENT_SIZE, Width = 50, CommitOnFocusLost = true, }, new SpriteText { Anchor = Anchor.TopCentre, Text = @"Maximo Jugadores:", Position = new Vector2(760, 17), }, maxPlayersTextBox = new NumericTextBox(false) { LengthLimit = 2, Text = Math.Min(32, project.DatabaseObject.MaxNumberPlayers).ToString(), Anchor = Anchor.TopCentre, Position = new Vector2(898, 10), Height = TEXT_ELEMENT_SIZE, Width = 50, CommitOnFocusLost = true, }, new SpriteText { Text = @"Descripción:", Position = new Vector2(245, 70), }, descriptionTextBox = new BasicTextBox { Text = project.DatabaseObject.Description, Position = new Vector2(340, 70), Height = TEXT_ELEMENT_SIZE, Width = 1732, }, new SpriteText { Origin = Anchor.TopRight, Text = @"Chat recomendado:", Position = new Vector2(329, 130), }, chatDropdown = new GamesToGoDropdown <ChatRecommendation> { Width = 200, Position = new Vector2(340, 130), Items = Enum.GetValues(typeof(ChatRecommendation)).Cast <ChatRecommendation>(), }, new SpriteText { Text = @"Etiquetas:", Position = new Vector2(556, 130), }, tags = new TagSelectionContainer(TEXT_ELEMENT_SIZE) { Size = new Vector2(1272, TEXT_ELEMENT_SIZE), Position = new Vector2(635, 130), }, }, }, }, }, }, new Drawable[] { new GridContainer { Depth = 1, RelativeSizeAxes = Axes.Both, ColumnDimensions = new[] { new Dimension(GridSizeMode.Relative, 1 / 6f), new Dimension(GridSizeMode.Relative, 1 / 6f), new Dimension(GridSizeMode.Relative, 1 / 6f), new Dimension(), }, RowDimensions = new[] { new Dimension(), }, Content = new[] { new Drawable[] { new ProjectObjectManagerContainer <Card>(), new ProjectObjectManagerContainer <Token>(), new ProjectObjectManagerContainer <Board>(), new GridContainer { RelativeSizeAxes = Axes.Both, RowDimensions = new[] { new Dimension(GridSizeMode.Absolute, 50), new Dimension(), }, ColumnDimensions = new[] { new Dimension(), }, Content = new[] { new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Colour4.MediumPurple, }, new FillFlowContainer { RelativeSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Children = new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Width = .4f, Child = editingText = new SpriteText { Font = new FontUsage(size: 45), Text = @"Condiciones de Victoria Turnos Turno de preparación", Position = new Vector2(5, 2.5f), }, }, new FillFlowContainer { RelativeSizeAxes = Axes.Both, Width = .6f, Direction = FillDirection.Horizontal, Children = new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { toggleButton = new IteratingButton { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, Size = new Vector2(200, 35), X = -5, Text = @"Turnos", }, }, }, }, }, }, }, }, }, }, new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { victoryContainer = new VictoryConditionsContainer { State = { Value = Visibility.Visible }, }, turnsOverlay = new TurnsOverlay(), preparationTurnOverlay = new PreparationTurnOverlay(), }, }, }, }, }, }, }, }, }, }, }, argumentListing, selectorOverlay, }; toggleButton.Actions.Add(showVictoryConditions); toggleButton.Actions.Add(showTurns); toggleButton.Actions.Add(showPreparationTurn); chatDropdown.Current.Value = project.ChatRecommendation; chatDropdown.Current.BindValueChanged(cht => project.ChatRecommendation = cht.NewValue); descriptionTextBox.Current.BindValueChanged(obj => project.DatabaseObject.Description = obj.NewValue); titleTextBox.Current.BindValueChanged(obj => project.DatabaseObject.Name = obj.NewValue); maxPlayersTextBox.OnCommit += (_, __) => checkPlayerNumber(false); minPlayersTextBox.OnCommit += (_, __) => checkPlayerNumber(true); tags.Current.Value = project.DatabaseObject.Tags; tags.Current.BindValueChanged(tag => project.DatabaseObject.Tags = tag.NewValue); checkPlayerNumber(false); }
private void load() { RelativeSizeAxes = Axes.Both; Children = new Drawable[] { shadowBox = new Box { RelativeSizeAxes = Axes.Both, Colour = Colour4.Black, Alpha = 0, }, content = new Container { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { new GridContainer { RelativeSizeAxes = Axes.Both, RowDimensions = new[] { new Dimension(GridSizeMode.Relative, .2f), new Dimension(GridSizeMode.Relative, .5f), new Dimension() }, ColumnDimensions = new[] { new Dimension() }, Content = new[] { new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding(10), Child = new SimpleIconButton(FontAwesome.Solid.Times) { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, Action = Hide, }, }, }, new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { new FillFlowContainer { RelativeSizeAxes = Axes.Both, Direction = FillDirection.Vertical, Padding = new MarginPadding(30), Children = new Drawable[] { new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Children = new Drawable[] { new SpriteText { Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, Text = @"Email:", Font = new FontUsage(size: 60) }, emailBox = new BasicTextBox { Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, Height = 150, RelativeSizeAxes = Axes.X, }, } }, new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Children = new Drawable[] { new SpriteText { Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, Text = @"Nombre de Usuario:", Font = new FontUsage(size: 60) }, usernameBox = new BasicTextBox { Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, Height = 150, RelativeSizeAxes = Axes.X, }, } }, new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Children = new Drawable[] { new SpriteText { Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, Text = @"Contraseña:", Font = new FontUsage(size: 60), }, passwordBox = new BasicPasswordTextBox { Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, Height = 150, RelativeSizeAxes = Axes.X, }, }, }, new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Children = new Drawable[] { new SpriteText { Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, Text = @"Confirmar Contraseña:", Font = new FontUsage(size: 60), }, confirmPasswordBox = new BasicPasswordTextBox { Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, Height = 150, RelativeSizeAxes = Axes.X, }, }, }, }, }, }, }, }, new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding(30), Child = register = new GamesToGoButton { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Height = 225, RelativeSizeAxes = Axes.X, Text = @"Registrarse", Action = registerUser, }, }, }, }, }, }, }, }; register.SpriteText.Font = new FontUsage(size: 60); register.Enabled.Value = false; passwordBox.Current.BindValueChanged(checkUserPass); confirmPasswordBox.Current.BindValueChanged(checkUserPass); emailBox.Current.BindValueChanged(checkUserPass); usernameBox.Current.BindValueChanged(checkUserPass); }
private void load(Storage storage, GameHost host, AudioManager audio) { interactive = host.Window != null; config = new TestBrowserConfig(storage); audio.AddAdjustment(AdjustableProperty.Frequency, audioRateAdjust); var rateAdjustClock = new StopwatchClock(true); var framedClock = new FramedClock(rateAdjustClock); Children = new Drawable[] { mainContainer = new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = test_list_width }, Children = new Drawable[] { new SafeAreaContainer { SafeAreaOverrideEdges = Edges.Right | Edges.Bottom, RelativeSizeAxes = Axes.Both, Child = testContentContainer = new Container { Clock = framedClock, RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Top = 50 }, Child = compilingNotice = new Container { Alpha = 0, Anchor = Anchor.Centre, Origin = Anchor.Centre, Masking = true, Depth = float.MinValue, CornerRadius = 5, AutoSizeAxes = Axes.Both, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.Black, }, new SpriteText { Font = FrameworkFont.Regular.With(size: 30), Text = @"Compiling new version..." } }, } } }, toolbar = new TestBrowserToolbar { RelativeSizeAxes = Axes.X, Height = 50, }, } }, leftContainer = new Container { RelativeSizeAxes = Axes.Y, Size = new Vector2(test_list_width, 1), Masking = true, Children = new Drawable[] { new SafeAreaContainer { SafeAreaOverrideEdges = Edges.Left | Edges.Top | Edges.Bottom, RelativeSizeAxes = Axes.Both, Child = new Box { Colour = FrameworkColour.GreenDark, RelativeSizeAxes = Axes.Both } }, new FillFlowContainer { Direction = FillDirection.Vertical, RelativeSizeAxes = Axes.Both, Children = new Drawable[] { searchTextBox = new TestBrowserTextBox { Height = 25, RelativeSizeAxes = Axes.X, PlaceholderText = "type to search", Depth = -1, }, new BasicScrollContainer { RelativeSizeAxes = Axes.Both, Masking = false, Child = leftFlowContainer = new SearchContainer <TestGroupButton> { AllowNonContiguousMatching = true, Padding = new MarginPadding { Top = 3, Bottom = 20 }, Direction = FillDirection.Vertical, AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, } } } } } }, }; searchTextBox.OnCommit += delegate { var firstTest = leftFlowContainer.Where(b => b.IsPresent).SelectMany(b => b.FilterableChildren).OfType <TestSubButton>() .FirstOrDefault(b => b.MatchingFilter)?.TestType; if (firstTest != null) { LoadTest(firstTest); } }; searchTextBox.Current.ValueChanged += e => leftFlowContainer.SearchTerm = e.NewValue; if (RuntimeInfo.IsDesktop) { HotReloadCallbackReceiver.CompilationFinished += compileFinished; } foreach (Assembly asm in assemblies) { toolbar.AddAssembly(asm.GetName().Name, asm); } Assembly.BindValueChanged(updateList); RunAllSteps.BindValueChanged(v => runTests(null)); PlaybackRate.BindValueChanged(e => { rateAdjustClock.Rate = e.NewValue; audioRateAdjust.Value = e.NewValue; }, true); }
private void load() { Origin = Anchor.TopLeft; Anchor = Anchor.TopLeft; RelativeSizeAxes = Axes.Both; Width = 1 / 3f; Children = new Drawable[] { shadowBox = new Box { RelativeSizeAxes = Axes.Both, Colour = Colour4.Black, Alpha = 0, }, popUpContent = new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, RelativePositionAxes = Axes.X, X = 1, Child = new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, Width = 3 / 4f, BorderColour = new Colour4(70, 68, 66, 255), BorderThickness = 4, Masking = true, CornerRadius = 15, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = new Colour4(106, 100, 104, 255), }, new Container { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Padding = new MarginPadding(50), Child = new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Children = new Drawable[] { new SpriteText { Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, Text = @"Usuario:", }, usernameBox = new BasicTextBox { Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, Height = 35, Width = 380, Margin = new MarginPadding { Bottom = 20 }, }, new SpriteText { Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, Text = @"Correo:", }, emailBox = new BasicTextBox { Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, Height = 35, Width = 380, Margin = new MarginPadding { Bottom = 20 }, }, new SpriteText { Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, Text = @"Contraseña:", }, passwordBox = new BasicPasswordTextBox { Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, Height = 35, Width = 380, Margin = new MarginPadding { Bottom = 20 }, }, new SpriteText { Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, Text = @"Verificar Contraseña:", }, confirmPasswordBox = new BasicPasswordTextBox { Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, Height = 35, Width = 380, Margin = new MarginPadding { Bottom = 20 }, }, new Container { Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Child = registerButton = new GamesToGoButton { Origin = Anchor.BottomCentre, Anchor = Anchor.BottomCentre, Text = @"Registrarse", Width = 100, Height = 35, Action = registerUser, }, }, }, }, }, }, }, }, }; registerButton.Enabled.Value = false; passwordBox.Current.BindValueChanged(checkUserPass); usernameBox.Current.BindValueChanged(checkUserPass); confirmPasswordBox.Current.BindValueChanged(checkUserPass); emailBox.Current.BindValueChanged(checkUserPass); }
private void load() { InternalChildren = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = new Colour4(106, 100, 104, 255), //Color fondo general }, new GridContainer { RelativeSizeAxes = Axes.Both, ColumnDimensions = new[] { new Dimension(), }, RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize), new Dimension(), }, Content = new[] { new Drawable[] { new Container { Depth = 0, AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, Children = new Drawable[] { new Container { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, RelativeSizeAxes = Axes.X, Height = 180, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Colour4.Black.Opacity(0.8f), }, new Container { Padding = new MarginPadding(15), Size = new Vector2(180), Child = new ImageChangerButton { RelativeSizeAxes = Axes.Both, }, }, new SpriteText { Text = @"Nombre del proyecto:", Position = new Vector2(180, 17), }, titleTextBox = new BasicTextBox { Text = project.DatabaseObject.Name, Position = new Vector2(340, 10), Height = 35, Width = 775, }, new SpriteText { Anchor = Anchor.TopCentre, Text = @"Minimo Jugadores:", Position = new Vector2(560, 17), }, minPlayersTextBox = new NumericTextBox(2) //Restringir la cantidad de digitos a 2 { Text = Math.Max(2, project.DatabaseObject.MinNumberPlayers).ToString(), Anchor = Anchor.TopCentre, Position = new Vector2(694, 10), Height = 35, Width = 50, CommitOnFocusLost = true, }, new SpriteText { Anchor = Anchor.TopCentre, Text = @"Maximo Jugadores:", Position = new Vector2(760, 17), }, maxPlayersTextBox = new NumericTextBox(2) //Restringir la cantidad de digitos a 2 { Text = Math.Min(32, project.DatabaseObject.MaxNumberPlayers).ToString(), Anchor = Anchor.TopCentre, Position = new Vector2(898, 10), Height = 35, Width = 50, CommitOnFocusLost = true, }, new SpriteText { Text = @"Descripción:", Position = new Vector2(245, 70), }, descriptionTextBox = new BasicTextBox { Text = project.DatabaseObject.Description, Position = new Vector2(340, 70), Height = 35, Width = 1732, }, new SpriteText { Origin = Anchor.TopRight, Text = @"Chat recomendado:", Position = new Vector2(329, 130), }, chatDropdown = new GamesToGoDropdown <ChatRecommendation> { Width = 200, Position = new Vector2(340, 130), Items = Enum.GetValues(typeof(ChatRecommendation)).Cast <ChatRecommendation>(), }, }, }, }, }, }, new Drawable[] { new Container { Depth = 1, RelativeSizeAxes = Axes.Both, Width = 0.5f, Children = new Drawable[] { new ProjectObjectManagerContainer <Card> { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, Width = 1 / 3f, }, new ProjectObjectManagerContainer <Token> { Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, Width = 1 / 3f, }, new ProjectObjectManagerContainer <Board> { Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, Width = 1 / 3f, }, }, }, }, }, }, }; chatDropdown.Current.Value = project.ChatRecommendation; chatDropdown.Current.BindValueChanged(cht => project.ChatRecommendation = cht.NewValue); descriptionTextBox.Current.BindValueChanged(obj => project.DatabaseObject.Description = obj.NewValue); titleTextBox.Current.BindValueChanged(obj => project.DatabaseObject.Name = obj.NewValue); maxPlayersTextBox.OnCommit += (_, __) => checkPlayerNumber(false); minPlayersTextBox.OnCommit += (_, __) => checkPlayerNumber(true); checkPlayerNumber(false); }