Skip to content

Commit

Permalink
Merge branch 'master' into use-bindable-transforms
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed May 10, 2018
2 parents 2d6b2d1 + aa69e0e commit 2e9c91c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Expand Up @@ -11,7 +11,7 @@ install:
- cmd: git submodule update --init --recursive --depth=5
- cmd: choco install resharper-clt -y
- cmd: choco install nvika -y
- cmd: appveyor DownloadFile https://github.com/peppy/CodeFileSanity/releases/download/v0.2.4/CodeFileSanity.exe
- cmd: appveyor DownloadFile https://github.com/peppy/CodeFileSanity/releases/download/v0.2.5/CodeFileSanity.exe
before_build:
- cmd: CodeFileSanity.exe
- cmd: nuget restore -verbosity quiet
Expand Down
3 changes: 0 additions & 3 deletions osu.Game.Tests/Visual/TestCaseBreakOverlay.cs
@@ -1,7 +1,6 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE

using osu.Framework.Timing;
using osu.Game.Beatmaps.Timing;
using System.Collections.Generic;
using NUnit.Framework;
Expand All @@ -16,8 +15,6 @@ public class TestCaseBreakOverlay : OsuTestCase

public TestCaseBreakOverlay()
{
Clock = new FramedClock();

Child = breakOverlay = new BreakOverlay(true);

AddStep("2s break", () => startBreak(2000));
Expand Down
17 changes: 11 additions & 6 deletions osu.Game/Overlays/Direct/FilterControl.cs
@@ -1,8 +1,6 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE

using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
Expand All @@ -12,6 +10,8 @@
using osu.Game.Online.API.Requests;
using osu.Game.Overlays.SearchableList;
using osu.Game.Rulesets;
using OpenTK;
using OpenTK.Graphics;

namespace osu.Game.Overlays.Direct
{
Expand All @@ -22,6 +22,7 @@ public class FilterControl : SearchableListFilterControl<DirectSortCriteria, Bea

protected override Color4 BackgroundColour => OsuColour.FromHex(@"384552");
protected override DirectSortCriteria DefaultTab => DirectSortCriteria.Ranked;

protected override Drawable CreateSupplementaryControls()
{
modeButtons = new FillFlowContainer<RulesetToggleButton>
Expand All @@ -38,7 +39,7 @@ private void load(OsuGame game, RulesetStore rulesets, OsuColour colours)
{
DisplayStyleControl.Dropdown.AccentColour = colours.BlueDark;

Ruleset.BindTo(game?.Ruleset ?? new Bindable<RulesetInfo> { Value = rulesets.GetRuleset(0) });
Ruleset.Value = game?.Ruleset.Value ?? rulesets.GetRuleset(0);
foreach (var r in rulesets.AvailableRulesets)
{
modeButtons.Add(new RulesetToggleButton(Ruleset, r));
Expand All @@ -49,14 +50,15 @@ private class RulesetToggleButton : OsuClickableContainer
{
private Drawable icon
{
get { return iconContainer.Icon; }
set { iconContainer.Icon = value; }
get => iconContainer.Icon;
set => iconContainer.Icon = value;
}

private RulesetInfo ruleset;

public RulesetInfo Ruleset
{
get { return ruleset; }
get => ruleset;
set
{
ruleset = value;
Expand All @@ -73,6 +75,9 @@ private void Bindable_ValueChanged(RulesetInfo obj)
iconContainer.FadeTo(Ruleset.ID == obj?.ID ? 1f : 0.5f, 100);
}

public override bool HandleKeyboardInput => !bindable.Disabled && base.HandleKeyboardInput;
public override bool HandleMouseInput => !bindable.Disabled && base.HandleMouseInput;

public RulesetToggleButton(Bindable<RulesetInfo> bindable, RulesetInfo ruleset)
{
this.bindable = bindable;
Expand Down
4 changes: 2 additions & 2 deletions osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs
Expand Up @@ -87,8 +87,8 @@ private void load(RulesetStore rulesets, OsuGame game)
ruleset.Value = rulesets.AvailableRulesets.FirstOrDefault();
}

public override bool HandleKeyboardInput => !ruleset.Disabled;
public override bool HandleMouseInput => !ruleset.Disabled;
public override bool HandleKeyboardInput => !ruleset.Disabled && base.HandleKeyboardInput;
public override bool HandleMouseInput => !ruleset.Disabled && base.HandleMouseInput;

private void disabledChanged(bool isDisabled) => this.FadeColour(isDisabled ? Color4.Gray : Color4.White, 300);

Expand Down
1 change: 1 addition & 0 deletions osu.Game/Screens/Edit/Editor.cs
Expand Up @@ -27,6 +27,7 @@ public class Editor : OsuScreen
protected override BackgroundScreen CreateBackground() => new BackgroundScreenCustom(@"Backgrounds/bg4");

public override bool ShowOverlaysOnEnter => false;
public override bool AllowBeatmapRulesetChange => false;

private Box bottomBackground;
private Container screenContainer;
Expand Down

0 comments on commit 2e9c91c

Please sign in to comment.