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() { 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() { 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[] { 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); }