public MapPoolScreen() { InternalChildren = new Drawable[] { new MatchHeader(), mapFlows = new FillFlowContainer <FillFlowContainer <TournamentBeatmapPanel> > { Y = 100, Spacing = new Vector2(10, 10), Padding = new MarginPadding(25), Direction = FillDirection.Vertical, RelativeSizeAxes = Axes.Both, }, new ControlPanel { Children = new Drawable[] { new OsuSpriteText { Text = "Current Mode" }, buttonRedBan = new OsuButton { RelativeSizeAxes = Axes.X, Text = "Red Ban", Action = () => setMode(TeamColour.Red, ChoiceType.Ban) }, buttonBlueBan = new OsuButton { RelativeSizeAxes = Axes.X, Text = "Blue Ban", Action = () => setMode(TeamColour.Blue, ChoiceType.Ban) }, buttonRedPick = new OsuButton { RelativeSizeAxes = Axes.X, Text = "Red Pick", Action = () => setMode(TeamColour.Red, ChoiceType.Pick) }, buttonBluePick = new OsuButton { RelativeSizeAxes = Axes.X, Text = "Blue Pick", Action = () => setMode(TeamColour.Blue, ChoiceType.Pick) }, new ControlPanel.Spacer(), new OsuButton { RelativeSizeAxes = Axes.X, Text = "Reset", Action = reset }, } } }; }
public void TestInitiallyDisabled() { AddStep("add button", () => Child = new OsuButton { Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(200), Text = "Button" }); }
private void load(OverlayColourProvider colours) { RelativeSizeAxes = Axes.Both; const float margins = 10; InternalChildren = new Drawable[] { new Box { Colour = colours.Background3, RelativeSizeAxes = Axes.Both, }, new Box { Colour = colours.Background2, RelativeSizeAxes = Axes.Y, Width = ControlPointTable.TIMING_COLUMN_WIDTH + margins, }, new OsuScrollContainer { RelativeSizeAxes = Axes.Both, Child = table = new ControlPointTable(), }, new FillFlowContainer { AutoSizeAxes = Axes.Both, Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, Direction = FillDirection.Horizontal, Margin = new MarginPadding(margins), Spacing = new Vector2(5), Children = new Drawable[] { deleteButton = new OsuButton { Text = "-", Size = new Vector2(30, 30), Action = delete, Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, }, new OsuButton { Text = "+ Add at current time", Action = addNew, Size = new Vector2(160, 30), Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, }, } }, }; }
public void TestDeletedBeatmapDisableReady() { OsuButton readyButton = null; AddAssert("ensure ready button enabled", () => { readyButton = button.ChildrenOfType <OsuButton>().Single(); return(readyButton.Enabled.Value); }); AddStep("delete beatmap", () => beatmaps.Delete(importedSet)); AddAssert("ready button disabled", () => !readyButton.Enabled.Value); AddStep("undelete beatmap", () => beatmaps.Undelete(importedSet)); AddAssert("ready button enabled back", () => readyButton.Enabled.Value); }
private void load(OsuColour colours) { RelativeSizeAxes = Axes.Both; InternalChildren = new Drawable[] { new Box { Colour = colours.Gray0, RelativeSizeAxes = Axes.Both, }, new OsuScrollContainer { RelativeSizeAxes = Axes.Both, Child = table = new ControlPointTable(), }, new FillFlowContainer { AutoSizeAxes = Axes.Both, Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, Direction = FillDirection.Horizontal, Margin = new MarginPadding(10), Spacing = new Vector2(5), Children = new Drawable[] { deleteButton = new OsuButton { Text = "-", Size = new Vector2(30, 30), Action = delete, Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, }, new OsuButton { Text = "+", Action = addNew, Size = new Vector2(30, 30), Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, }, } }, }; }
protected override Drawable CreateComponent() { var drawable = base.CreateComponent(); FlowContainer.Insert(-1, folderButton = new TriangleButton { Text = "Open folder", Width = 100 }); FlowContainer.Insert(-2, dropdown = new OsuDropdown <string> { Width = 510 }); return(drawable); }
public Footer() { RelativeSizeAxes = Axes.X; Height = HEIGHT; InternalChildren = new[] { background = new Box { RelativeSizeAxes = Axes.Both }, startButton = new ReadyButton { Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(600, 50), SelectedItem = { BindTarget = SelectedItem }, Action = () => OnStart?.Invoke() } }; }
public void TestToggleEnabled() { OsuButton button = null; AddStep("add button", () => Child = button = new OsuButton { Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(200), Text = "Button" }); AddToggleStep("toggle enabled", toggle => { for (int i = 0; i < 6; i++) { button.Action = toggle ? () => { } } : (Action)null; }); }
public Multiplayer() { Anchor = Anchor.Centre; Origin = Anchor.Centre; RelativeSizeAxes = Axes.Both; Padding = new MarginPadding { Horizontal = -HORIZONTAL_OVERFLOW_PADDING }; var backgroundColour = OsuColour.FromHex(@"3e3a44"); InternalChild = waves = new MultiplayerWaveContainer { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = backgroundColour, }, new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Top = Header.HEIGHT }, Children = new[] { header = new Container { RelativeSizeAxes = Axes.X, Height = 400, Children = new[] { headerBackground = new Container { RelativeSizeAxes = Axes.Both, Width = 1.25f, Masking = true, Children = new Drawable[] { new HeaderBackgroundSprite { RelativeSizeAxes = Axes.X, Height = 400 // Keep a static height so the header doesn't change as it's resized between subscreens }, } }, new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Bottom = -1 }, // 1px padding to avoid a 1px gap due to masking Child = new Box { RelativeSizeAxes = Axes.Both, Colour = ColourInfo.GradientVertical(backgroundColour.Opacity(0.7f), backgroundColour) }, } } }, screenStack = new MultiplayerSubScreenStack { RelativeSizeAxes = Axes.Both } } }, new Header(screenStack), createButton = new CreateRoomButton { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, Action = createRoom }, roomManager = new RoomManager() } }; screenStack.Push(loungeSubScreen = new LoungeSubScreen()); screenStack.ScreenPushed += screenPushed; screenStack.ScreenExited += screenExited; }
public Multiplayer() { Anchor = Anchor.Centre; Origin = Anchor.Centre; RelativeSizeAxes = Axes.Both; Padding = new MarginPadding { Horizontal = -HORIZONTAL_OVERFLOW_PADDING }; InternalChild = waves = new MultiplayerWaveContainer { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Masking = true, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = OsuColour.FromHex(@"3e3a44"), }, new Triangles { RelativeSizeAxes = Axes.Both, ColourLight = OsuColour.FromHex(@"3c3842"), ColourDark = OsuColour.FromHex(@"393540"), TriangleScale = 5, }, }, }, new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Top = Header.HEIGHT }, Child = screenStack = new MultiplayerSubScreenStack { RelativeSizeAxes = Axes.Both } }, new Header(screenStack), createButton = new HeaderButton { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, RelativeSizeAxes = Axes.None, Size = new Vector2(150, Header.HEIGHT - 20), Margin = new MarginPadding { Top = 10, Right = 10 + HORIZONTAL_OVERFLOW_PADDING, }, Text = "Create room", Action = () => loungeSubScreen.Open(new Room { Name = { Value = $"{api.LocalUser}'s awesome room" } }), }, roomManager = new RoomManager() } }; screenStack.Push(loungeSubScreen = new LoungeSubScreen()); screenStack.ScreenPushed += screenPushed; screenStack.ScreenExited += screenExited; }
protected OnlinePlayScreen() { Anchor = Anchor.Centre; Origin = Anchor.Centre; RelativeSizeAxes = Axes.Both; Padding = new MarginPadding { Horizontal = -HORIZONTAL_OVERFLOW_PADDING }; var backgroundColour = Color4Extensions.FromHex(@"3e3a44"); InternalChild = waves = new MultiplayerWaveContainer { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = backgroundColour, }, new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Top = Header.HEIGHT }, Children = new[] { header = new Container { RelativeSizeAxes = Axes.X, Height = 400, Children = new[] { headerBackground = new Container { RelativeSizeAxes = Axes.Both, Width = 1.25f, Masking = true, Children = new Drawable[] { new HeaderBackgroundSprite { RelativeSizeAxes = Axes.X, Height = 400 // Keep a static height so the header doesn't change as it's resized between subscreens }, } }, new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Bottom = -1 }, // 1px padding to avoid a 1px gap due to masking Child = new Box { RelativeSizeAxes = Axes.Both, Colour = ColourInfo.GradientVertical(backgroundColour.Opacity(0.5f), backgroundColour) }, } } }, screenStack = new OnlinePlaySubScreenStack { RelativeSizeAxes = Axes.Both } } }, new Header(ScreenTitle, screenStack), createButton = CreateNewMultiplayerGameButton().With(button => { button.Anchor = Anchor.TopRight; button.Origin = Anchor.TopRight; button.Size = new Vector2(150, Header.HEIGHT - 20); button.Margin = new MarginPadding { Top = 10, Right = 10 + HORIZONTAL_OVERFLOW_PADDING, }; button.Action = () => OpenNewRoom(); }), RoomManager = CreateRoomManager(), ongoingOperationTracker = new OngoingOperationTracker() } }; screenStack.ScreenPushed += screenPushed; screenStack.ScreenExited += screenExited; screenStack.Push(loungeSubScreen = CreateLounge()); }
private void load(LadderInfo ladder, MatchIPCInfo ipc) { this.ipc = ipc; AddRangeInternal(new Drawable[] { new TourneyVideo("gameplay") { Loop = true, RelativeSizeAxes = Axes.Both, }, header = new MatchHeader { ShowLogo = false }, new Container { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Y = 110, Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Children = new[] { chroma = new Container { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Height = 512, Children = new Drawable[] { new ChromaArea { Name = "Left chroma", RelativeSizeAxes = Axes.Both, Width = 0.5f, }, new ChromaArea { Name = "Right chroma", RelativeSizeAxes = Axes.Both, Anchor = Anchor.TopRight, Origin = Anchor.TopRight, Width = 0.5f, } } }, } }, scoreDisplay = new TournamentMatchScoreDisplay { Y = -147, Anchor = Anchor.BottomCentre, Origin = Anchor.TopCentre, }, new ControlPanel { Children = new Drawable[] { warmupButton = new TourneyButton { RelativeSizeAxes = Axes.X, Text = "Toggle warmup", Action = () => warmup.Toggle() }, new TourneyButton { RelativeSizeAxes = Axes.X, Text = "Toggle chat", Action = () => { State.Value = State.Value == TourneyState.Idle ? TourneyState.Playing : TourneyState.Idle; } }, new SettingsSlider <int> { LabelText = "Chroma width", Current = LadderInfo.ChromaKeyWidth, KeyboardStep = 1, }, new SettingsSlider <int> { LabelText = "Players per team", Current = LadderInfo.PlayersPerTeam, KeyboardStep = 1, } } } }); ladder.ChromaKeyWidth.BindValueChanged(width => chroma.Width = width.NewValue, true); warmup.BindValueChanged(w => { warmupButton.Alpha = !w.NewValue ? 0.5f : 1; header.ShowScores = !w.NewValue; }, true); }
private void load(LadderInfo ladder, MatchIPCInfo ipc) { this.ipc = ipc; AddRangeInternal(new Drawable[] { new MatchHeader(), new Container { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Y = 5, Anchor = Anchor.Centre, Origin = Anchor.Centre, Children = new Drawable[] { new Box { // chroma key area for stable gameplay Name = "chroma", RelativeSizeAxes = Axes.X, Height = 512, Colour = new Color4(0, 255, 0, 255), }, new Container { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Y = -4, Children = new Drawable[] { new Circle { Name = "top bar red", RelativeSizeAxes = Axes.X, Height = 8, Width = 0.5f, Colour = red, }, new Circle { Name = "top bar blue", RelativeSizeAxes = Axes.X, Height = 8, Width = 0.5f, Colour = blue, Anchor = Anchor.TopRight, Origin = Anchor.TopRight, }, } }, } }, scoreDisplay = new MatchScoreDisplay { Y = -60, Scale = new Vector2(0.8f), Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, }, new ControlPanel { Children = new Drawable[] { warmupButton = new TourneyButton { RelativeSizeAxes = Axes.X, Text = "Toggle warmup", Action = () => warmup.Toggle() }, new TourneyButton { RelativeSizeAxes = Axes.X, Text = "Toggle chat", Action = () => { State.Value = State.Value == TourneyState.Idle ? TourneyState.Playing : TourneyState.Idle; } } } } }); State.BindTo(ipc.State); State.BindValueChanged(stateChanged, true); currentMatch.BindValueChanged(m => { warmup.Value = m.NewValue.Team1Score.Value + m.NewValue.Team2Score.Value == 0; scheduledOperation?.Cancel(); }); currentMatch.BindTo(ladder.CurrentMatch); warmup.BindValueChanged(w => warmupButton.Alpha = !w.NewValue ? 0.5f : 1, true); }
private void load(LadderInfo ladder, MatchIPCInfo ipc, Storage storage) { this.ipc = ipc; AddRangeInternal(new Drawable[] { new TourneyVideo("gameplay") { Loop = true, RelativeSizeAxes = Axes.Both, }, header = new MatchHeader { ShowLogo = false }, new Container { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Y = 110, Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Children = new Drawable[] { chroma = new Box { // chroma key area for stable gameplay Name = "chroma", Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Height = 512, Colour = new Color4(0, 255, 0, 255), }, } }, scoreDisplay = new MatchScoreDisplay { Y = -147, Anchor = Anchor.BottomCentre, Origin = Anchor.TopCentre, }, new ControlPanel { Children = new Drawable[] { warmupButton = new TourneyButton { RelativeSizeAxes = Axes.X, Text = "Toggle warmup", Action = () => warmup.Toggle() }, new TourneyButton { RelativeSizeAxes = Axes.X, Text = "Toggle chat", Action = () => { State.Value = State.Value == TourneyState.Idle ? TourneyState.Playing : TourneyState.Idle; } }, new SettingsSlider <int> { LabelText = "Chroma Width", Bindable = LadderInfo.ChromaKeyWidth, KeyboardStep = 1, } } } }); State.BindTo(ipc.State); State.BindValueChanged(stateChanged, true); ladder.ChromaKeyWidth.BindValueChanged(width => chroma.Width = width.NewValue, true); currentMatch.BindValueChanged(m => { warmup.Value = m.NewValue.Team1Score.Value + m.NewValue.Team2Score.Value == 0; scheduledOperation?.Cancel(); }); currentMatch.BindTo(ladder.CurrentMatch); warmup.BindValueChanged(w => { warmupButton.Alpha = !w.NewValue ? 0.5f : 1; header.ShowScores = !w.NewValue; }, true); }
public Multiplayer() { Child = waves = new MultiplayerWaveContainer { RelativeSizeAxes = Axes.Both, }; waves.AddRange(new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Masking = true, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = OsuColour.FromHex(@"3e3a44"), }, new Triangles { RelativeSizeAxes = Axes.Both, ColourLight = OsuColour.FromHex(@"3c3842"), ColourDark = OsuColour.FromHex(@"393540"), TriangleScale = 5, }, }, }, new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Top = Header.HEIGHT }, Child = loungeSubScreen = new LoungeSubScreen(Push), }, new Header(loungeSubScreen), createButton = new HeaderButton { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, RelativeSizeAxes = Axes.None, Size = new Vector2(150, Header.HEIGHT - 20), Margin = new MarginPadding { Top = 10, Right = 10, }, Text = "Create room", Action = () => loungeSubScreen.Push(new Room { Name = { Value = $"{api.LocalUser}'s awesome room" } }), }, roomManager = new RoomManager() }); screenAdded(loungeSubScreen); loungeSubScreen.Exited += _ => Exit(); }