mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 15:16:38 +09:00
Renamespace
This commit is contained in:
@ -4,7 +4,7 @@
|
|||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Overlays.Mods;
|
using osu.Game.Overlays.Mods;
|
||||||
using osu.Game.Screens.OnlinePlay.Multiplayer;
|
using osu.Game.Screens.OnlinePlay.Match;
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.Multiplayer
|
namespace osu.Game.Tests.Visual.Multiplayer
|
||||||
{
|
{
|
||||||
|
63
osu.Game/Screens/OnlinePlay/Match/FooterButtonFreeMods.cs
Normal file
63
osu.Game/Screens/OnlinePlay/Match/FooterButtonFreeMods.cs
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.UserInterface;
|
||||||
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Rulesets.Mods;
|
||||||
|
using osu.Game.Screens.Play.HUD;
|
||||||
|
using osu.Game.Screens.Select;
|
||||||
|
using osuTK;
|
||||||
|
|
||||||
|
namespace osu.Game.Screens.OnlinePlay.Match
|
||||||
|
{
|
||||||
|
public class FooterButtonFreeMods : FooterButton, IHasCurrentValue<IReadOnlyList<Mod>>
|
||||||
|
{
|
||||||
|
public Bindable<IReadOnlyList<Mod>> Current
|
||||||
|
{
|
||||||
|
get => modDisplay.Current;
|
||||||
|
set => modDisplay.Current = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
private readonly ModDisplay modDisplay;
|
||||||
|
|
||||||
|
public FooterButtonFreeMods()
|
||||||
|
{
|
||||||
|
ButtonContentContainer.Add(modDisplay = new ModDisplay
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
DisplayUnrankedText = false,
|
||||||
|
Scale = new Vector2(0.8f),
|
||||||
|
ExpansionMode = ExpansionMode.AlwaysContracted,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(OsuColour colours)
|
||||||
|
{
|
||||||
|
SelectedColour = colours.Yellow;
|
||||||
|
DeselectedColour = SelectedColour.Opacity(0.5f);
|
||||||
|
Text = @"freemods";
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
|
||||||
|
Current.BindValueChanged(_ => updateModDisplay(), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateModDisplay()
|
||||||
|
{
|
||||||
|
if (Current.Value?.Count > 0)
|
||||||
|
modDisplay.FadeIn();
|
||||||
|
else
|
||||||
|
modDisplay.FadeOut();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -10,7 +10,7 @@ using osu.Game.Graphics.UserInterface;
|
|||||||
using osu.Game.Overlays.Mods;
|
using osu.Game.Overlays.Mods;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
|
|
||||||
namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
namespace osu.Game.Screens.OnlinePlay.Match
|
||||||
{
|
{
|
||||||
public class FreeModSelectOverlay : ModSelectOverlay
|
public class FreeModSelectOverlay : ModSelectOverlay
|
||||||
{
|
{
|
@ -2,23 +2,15 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
|
||||||
using osu.Framework.Graphics;
|
|
||||||
using osu.Framework.Graphics.UserInterface;
|
|
||||||
using osu.Framework.Logging;
|
using osu.Framework.Logging;
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
using osu.Game.Graphics;
|
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Online.Multiplayer;
|
using osu.Game.Online.Multiplayer;
|
||||||
using osu.Game.Online.Rooms;
|
using osu.Game.Online.Rooms;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Screens.Play.HUD;
|
|
||||||
using osu.Game.Screens.Select;
|
using osu.Game.Screens.Select;
|
||||||
using osuTK;
|
|
||||||
|
|
||||||
namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
||||||
{
|
{
|
||||||
@ -78,50 +70,4 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
|
|
||||||
protected override bool IsValidFreeMod(Mod mod) => base.IsValidFreeMod(mod) && !(mod is ModTimeRamp) && !(mod is ModRateAdjust);
|
protected override bool IsValidFreeMod(Mod mod) => base.IsValidFreeMod(mod) && !(mod is ModTimeRamp) && !(mod is ModRateAdjust);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class FooterButtonFreeMods : FooterButton, IHasCurrentValue<IReadOnlyList<Mod>>
|
|
||||||
{
|
|
||||||
public Bindable<IReadOnlyList<Mod>> Current
|
|
||||||
{
|
|
||||||
get => modDisplay.Current;
|
|
||||||
set => modDisplay.Current = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
private readonly ModDisplay modDisplay;
|
|
||||||
|
|
||||||
public FooterButtonFreeMods()
|
|
||||||
{
|
|
||||||
ButtonContentContainer.Add(modDisplay = new ModDisplay
|
|
||||||
{
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
DisplayUnrankedText = false,
|
|
||||||
Scale = new Vector2(0.8f),
|
|
||||||
ExpansionMode = ExpansionMode.AlwaysContracted,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(OsuColour colours)
|
|
||||||
{
|
|
||||||
SelectedColour = colours.Yellow;
|
|
||||||
DeselectedColour = SelectedColour.Opacity(0.5f);
|
|
||||||
Text = @"freemods";
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void LoadComplete()
|
|
||||||
{
|
|
||||||
base.LoadComplete();
|
|
||||||
|
|
||||||
Current.BindValueChanged(_ => updateModDisplay(), true);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateModDisplay()
|
|
||||||
{
|
|
||||||
if (Current.Value?.Count > 0)
|
|
||||||
modDisplay.FadeIn();
|
|
||||||
else
|
|
||||||
modDisplay.FadeOut();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ using osu.Game.Online.Rooms;
|
|||||||
using osu.Game.Overlays.Mods;
|
using osu.Game.Overlays.Mods;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Screens.OnlinePlay.Multiplayer;
|
using osu.Game.Screens.OnlinePlay.Match;
|
||||||
using osu.Game.Screens.Select;
|
using osu.Game.Screens.Select;
|
||||||
|
|
||||||
namespace osu.Game.Screens.OnlinePlay
|
namespace osu.Game.Screens.OnlinePlay
|
||||||
|
Reference in New Issue
Block a user