mirror of
https://github.com/osukey/osukey.git
synced 2025-05-06 06:07:26 +09:00
Merge branch 'master' into adujustable-skinnablesound
This commit is contained in:
commit
a636c7052c
@ -52,6 +52,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.731.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.731.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.804.0" />
|
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.806.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -14,8 +14,8 @@ using osu.Game.Rulesets.Objects.Drawables;
|
|||||||
using osu.Game.Rulesets.Osu.Judgements;
|
using osu.Game.Rulesets.Osu.Judgements;
|
||||||
using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
|
using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osuTK;
|
|
||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||||
{
|
{
|
||||||
|
@ -14,6 +14,7 @@ using osu.Game.Rulesets.Osu.Objects;
|
|||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
using static osu.Game.Skinning.LegacySkinConfiguration;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Skinning
|
namespace osu.Game.Rulesets.Osu.Skinning
|
||||||
{
|
{
|
||||||
@ -28,19 +29,32 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
|||||||
Size = new Vector2(OsuHitObject.OBJECT_RADIUS * 2);
|
Size = new Vector2(OsuHitObject.OBJECT_RADIUS * 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Container<Sprite> circleSprites;
|
||||||
|
private Sprite hitCircleSprite;
|
||||||
|
private Sprite hitCircleOverlay;
|
||||||
|
|
||||||
|
private SkinnableSpriteText hitCircleText;
|
||||||
|
|
||||||
private readonly IBindable<ArmedState> state = new Bindable<ArmedState>();
|
private readonly IBindable<ArmedState> state = new Bindable<ArmedState>();
|
||||||
private readonly Bindable<Color4> accentColour = new Bindable<Color4>();
|
private readonly Bindable<Color4> accentColour = new Bindable<Color4>();
|
||||||
private readonly IBindable<int> indexInCurrentCombo = new Bindable<int>();
|
private readonly IBindable<int> indexInCurrentCombo = new Bindable<int>();
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private ISkinSource skin { get; set; }
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(DrawableHitObject drawableObject, ISkinSource skin)
|
private void load(DrawableHitObject drawableObject)
|
||||||
{
|
{
|
||||||
OsuHitObject osuObject = (OsuHitObject)drawableObject.HitObject;
|
OsuHitObject osuObject = (OsuHitObject)drawableObject.HitObject;
|
||||||
|
|
||||||
Sprite hitCircleSprite;
|
|
||||||
SkinnableSpriteText hitCircleText;
|
|
||||||
|
|
||||||
InternalChildren = new Drawable[]
|
InternalChildren = new Drawable[]
|
||||||
|
{
|
||||||
|
circleSprites = new Container<Sprite>
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Children = new[]
|
||||||
{
|
{
|
||||||
hitCircleSprite = new Sprite
|
hitCircleSprite = new Sprite
|
||||||
{
|
{
|
||||||
@ -49,32 +63,33 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
|||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
},
|
},
|
||||||
hitCircleText = new SkinnableSpriteText(new OsuSkinComponent(OsuSkinComponents.HitCircleText), _ => new OsuSpriteText
|
hitCircleOverlay = new Sprite
|
||||||
{
|
|
||||||
Font = OsuFont.Numeric.With(size: 40),
|
|
||||||
UseFullGlyphHeight = false,
|
|
||||||
}, confineMode: ConfineMode.NoScaling),
|
|
||||||
new Sprite
|
|
||||||
{
|
{
|
||||||
Texture = getTextureWithFallback("overlay"),
|
Texture = getTextureWithFallback("overlay"),
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
hitCircleText = new SkinnableSpriteText(new OsuSkinComponent(OsuSkinComponents.HitCircleText), _ => new OsuSpriteText
|
||||||
|
{
|
||||||
|
Font = OsuFont.Numeric.With(size: 40),
|
||||||
|
UseFullGlyphHeight = false,
|
||||||
|
}, confineMode: ConfineMode.NoScaling)
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
bool overlayAboveNumber = skin.GetConfig<OsuSkinConfiguration, bool>(OsuSkinConfiguration.HitCircleOverlayAboveNumber)?.Value ?? true;
|
bool overlayAboveNumber = skin.GetConfig<OsuSkinConfiguration, bool>(OsuSkinConfiguration.HitCircleOverlayAboveNumber)?.Value ?? true;
|
||||||
|
|
||||||
if (!overlayAboveNumber)
|
if (overlayAboveNumber)
|
||||||
ChangeInternalChildDepth(hitCircleText, -float.MaxValue);
|
AddInternal(hitCircleOverlay.CreateProxy());
|
||||||
|
|
||||||
state.BindTo(drawableObject.State);
|
state.BindTo(drawableObject.State);
|
||||||
state.BindValueChanged(updateState, true);
|
|
||||||
|
|
||||||
accentColour.BindTo(drawableObject.AccentColour);
|
accentColour.BindTo(drawableObject.AccentColour);
|
||||||
accentColour.BindValueChanged(colour => hitCircleSprite.Colour = colour.NewValue, true);
|
|
||||||
|
|
||||||
indexInCurrentCombo.BindTo(osuObject.IndexInCurrentComboBindable);
|
indexInCurrentCombo.BindTo(osuObject.IndexInCurrentComboBindable);
|
||||||
indexInCurrentCombo.BindValueChanged(index => hitCircleText.Text = (index.NewValue + 1).ToString(), true);
|
|
||||||
|
|
||||||
Texture getTextureWithFallback(string name)
|
Texture getTextureWithFallback(string name)
|
||||||
{
|
{
|
||||||
@ -87,6 +102,15 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
|
||||||
|
state.BindValueChanged(updateState, true);
|
||||||
|
accentColour.BindValueChanged(colour => hitCircleSprite.Colour = colour.NewValue, true);
|
||||||
|
indexInCurrentCombo.BindValueChanged(index => hitCircleText.Text = (index.NewValue + 1).ToString(), true);
|
||||||
|
}
|
||||||
|
|
||||||
private void updateState(ValueChangedEvent<ArmedState> state)
|
private void updateState(ValueChangedEvent<ArmedState> state)
|
||||||
{
|
{
|
||||||
const double legacy_fade_duration = 240;
|
const double legacy_fade_duration = 240;
|
||||||
@ -94,8 +118,21 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
|||||||
switch (state.NewValue)
|
switch (state.NewValue)
|
||||||
{
|
{
|
||||||
case ArmedState.Hit:
|
case ArmedState.Hit:
|
||||||
this.FadeOut(legacy_fade_duration, Easing.Out);
|
circleSprites.FadeOut(legacy_fade_duration, Easing.Out);
|
||||||
this.ScaleTo(1.4f, legacy_fade_duration, Easing.Out);
|
circleSprites.ScaleTo(1.4f, legacy_fade_duration, Easing.Out);
|
||||||
|
|
||||||
|
var legacyVersion = skin.GetConfig<LegacySetting, decimal>(LegacySetting.Version)?.Value;
|
||||||
|
|
||||||
|
if (legacyVersion >= 2.0m)
|
||||||
|
// legacy skins of version 2.0 and newer only apply very short fade out to the number piece.
|
||||||
|
hitCircleText.FadeOut(legacy_fade_duration / 4, Easing.Out);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// old skins scale and fade it normally along other pieces.
|
||||||
|
hitCircleText.FadeOut(legacy_fade_duration, Easing.Out);
|
||||||
|
hitCircleText.ScaleTo(1.4f, legacy_fade_duration, Easing.Out);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ namespace osu.Game.Rulesets.Osu.UI
|
|||||||
|
|
||||||
protected override PassThroughInputManager CreateInputManager() => new OsuInputManager(Ruleset.RulesetInfo);
|
protected override PassThroughInputManager CreateInputManager() => new OsuInputManager(Ruleset.RulesetInfo);
|
||||||
|
|
||||||
public override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new OsuPlayfieldAdjustmentContainer();
|
public override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new OsuPlayfieldAdjustmentContainer { AlignWithStoryboard = true };
|
||||||
|
|
||||||
protected override ResumeOverlay CreateResumeOverlay() => new OsuResumeOverlay();
|
protected override ResumeOverlay CreateResumeOverlay() => new OsuResumeOverlay();
|
||||||
|
|
||||||
|
@ -11,10 +11,19 @@ namespace osu.Game.Rulesets.Osu.UI
|
|||||||
public class OsuPlayfieldAdjustmentContainer : PlayfieldAdjustmentContainer
|
public class OsuPlayfieldAdjustmentContainer : PlayfieldAdjustmentContainer
|
||||||
{
|
{
|
||||||
protected override Container<Drawable> Content => content;
|
protected override Container<Drawable> Content => content;
|
||||||
private readonly Container content;
|
private readonly ScalingContainer content;
|
||||||
|
|
||||||
private const float playfield_size_adjust = 0.8f;
|
private const float playfield_size_adjust = 0.8f;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// When true, an offset is applied to allow alignment with historical storyboards displayed in the same parent space.
|
||||||
|
/// This will shift the playfield downwards slightly.
|
||||||
|
/// </summary>
|
||||||
|
public bool AlignWithStoryboard
|
||||||
|
{
|
||||||
|
set => content.PlayfieldShift = value;
|
||||||
|
}
|
||||||
|
|
||||||
public OsuPlayfieldAdjustmentContainer()
|
public OsuPlayfieldAdjustmentContainer()
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre;
|
Anchor = Anchor.Centre;
|
||||||
@ -39,6 +48,8 @@ namespace osu.Game.Rulesets.Osu.UI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private class ScalingContainer : Container
|
private class ScalingContainer : Container
|
||||||
{
|
{
|
||||||
|
internal bool PlayfieldShift { get; set; }
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
@ -55,6 +66,7 @@ namespace osu.Game.Rulesets.Osu.UI
|
|||||||
// Scale = 819.2 / 512
|
// Scale = 819.2 / 512
|
||||||
// Scale = 1.6
|
// Scale = 1.6
|
||||||
Scale = new Vector2(Parent.ChildSize.X / OsuPlayfield.BASE_SIZE.X);
|
Scale = new Vector2(Parent.ChildSize.X / OsuPlayfield.BASE_SIZE.X);
|
||||||
|
Position = new Vector2(0, (PlayfieldShift ? 8f : 0f) * Scale.X);
|
||||||
// Size = 0.625
|
// Size = 0.625
|
||||||
Size = Vector2.Divide(Vector2.One, Scale);
|
Size = Vector2.Divide(Vector2.One, Scale);
|
||||||
}
|
}
|
||||||
|
@ -67,8 +67,6 @@ namespace osu.Game
|
|||||||
[NotNull]
|
[NotNull]
|
||||||
private readonly NotificationOverlay notifications = new NotificationOverlay();
|
private readonly NotificationOverlay notifications = new NotificationOverlay();
|
||||||
|
|
||||||
private NowPlayingOverlay nowPlaying;
|
|
||||||
|
|
||||||
private BeatmapListingOverlay beatmapListing;
|
private BeatmapListingOverlay beatmapListing;
|
||||||
|
|
||||||
private DashboardOverlay dashboard;
|
private DashboardOverlay dashboard;
|
||||||
@ -650,7 +648,7 @@ namespace osu.Game
|
|||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
}, rightFloatingOverlayContent.Add, true);
|
}, rightFloatingOverlayContent.Add, true);
|
||||||
|
|
||||||
loadComponentSingleFile(nowPlaying = new NowPlayingOverlay
|
loadComponentSingleFile(new NowPlayingOverlay
|
||||||
{
|
{
|
||||||
GetToolbarHeight = () => ToolbarOffset,
|
GetToolbarHeight = () => ToolbarOffset,
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
@ -862,18 +860,6 @@ namespace osu.Game
|
|||||||
|
|
||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
case GlobalAction.ToggleNowPlaying:
|
|
||||||
nowPlaying.ToggleVisibility();
|
|
||||||
return true;
|
|
||||||
|
|
||||||
case GlobalAction.ToggleChat:
|
|
||||||
chatOverlay.ToggleVisibility();
|
|
||||||
return true;
|
|
||||||
|
|
||||||
case GlobalAction.ToggleSocial:
|
|
||||||
dashboard.ToggleVisibility();
|
|
||||||
return true;
|
|
||||||
|
|
||||||
case GlobalAction.ResetInputSettings:
|
case GlobalAction.ResetInputSettings:
|
||||||
var sensitivity = frameworkConfig.GetBindable<double>(FrameworkSetting.CursorSensitivity);
|
var sensitivity = frameworkConfig.GetBindable<double>(FrameworkSetting.CursorSensitivity);
|
||||||
|
|
||||||
@ -889,18 +875,6 @@ namespace osu.Game
|
|||||||
Toolbar.ToggleVisibility();
|
Toolbar.ToggleVisibility();
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case GlobalAction.ToggleSettings:
|
|
||||||
Settings.ToggleVisibility();
|
|
||||||
return true;
|
|
||||||
|
|
||||||
case GlobalAction.ToggleDirect:
|
|
||||||
beatmapListing.ToggleVisibility();
|
|
||||||
return true;
|
|
||||||
|
|
||||||
case GlobalAction.ToggleNotifications:
|
|
||||||
notifications.ToggleVisibility();
|
|
||||||
return true;
|
|
||||||
|
|
||||||
case GlobalAction.ToggleGameplayMouseButtons:
|
case GlobalAction.ToggleGameplayMouseButtons:
|
||||||
LocalConfig.Set(OsuSetting.MouseDisableButtons, !LocalConfig.Get<bool>(OsuSetting.MouseDisableButtons));
|
LocalConfig.Set(OsuSetting.MouseDisableButtons, !LocalConfig.Get<bool>(OsuSetting.MouseDisableButtons));
|
||||||
return true;
|
return true;
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Input.Bindings;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Toolbar
|
namespace osu.Game.Overlays.Toolbar
|
||||||
{
|
{
|
||||||
@ -13,6 +14,8 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
SetIcon(OsuIcon.ChevronDownCircle);
|
SetIcon(OsuIcon.ChevronDownCircle);
|
||||||
TooltipMain = "Beatmap listing";
|
TooltipMain = "Beatmap listing";
|
||||||
TooltipSub = "Browse for new beatmaps";
|
TooltipSub = "Browse for new beatmaps";
|
||||||
|
|
||||||
|
Hotkey = GlobalAction.ToggleDirect;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
|
@ -1,27 +1,34 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Caching;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Effects;
|
using osu.Framework.Graphics.Effects;
|
||||||
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Framework.Input.Bindings;
|
||||||
|
using osu.Framework.Input.Events;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Backgrounds;
|
using osu.Game.Graphics.Backgrounds;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
|
using osu.Game.Graphics.UserInterface;
|
||||||
|
using osu.Game.Input;
|
||||||
|
using osu.Game.Input.Bindings;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
using osu.Framework.Graphics.Shapes;
|
|
||||||
using osu.Framework.Input.Events;
|
|
||||||
using osu.Game.Graphics.Containers;
|
|
||||||
using osu.Game.Graphics.UserInterface;
|
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Toolbar
|
namespace osu.Game.Overlays.Toolbar
|
||||||
{
|
{
|
||||||
public class ToolbarButton : OsuClickableContainer
|
public abstract class ToolbarButton : OsuClickableContainer, IKeyBindingHandler<GlobalAction>
|
||||||
{
|
{
|
||||||
public const float WIDTH = Toolbar.HEIGHT * 1.4f;
|
public const float WIDTH = Toolbar.HEIGHT * 1.4f;
|
||||||
|
|
||||||
|
protected GlobalAction? Hotkey { get; set; }
|
||||||
|
|
||||||
public void SetIcon(Drawable icon)
|
public void SetIcon(Drawable icon)
|
||||||
{
|
{
|
||||||
IconContainer.Icon = icon;
|
IconContainer.Icon = icon;
|
||||||
@ -66,9 +73,13 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
private readonly FillFlowContainer tooltipContainer;
|
private readonly FillFlowContainer tooltipContainer;
|
||||||
private readonly SpriteText tooltip1;
|
private readonly SpriteText tooltip1;
|
||||||
private readonly SpriteText tooltip2;
|
private readonly SpriteText tooltip2;
|
||||||
|
private readonly SpriteText keyBindingTooltip;
|
||||||
protected FillFlowContainer Flow;
|
protected FillFlowContainer Flow;
|
||||||
|
|
||||||
public ToolbarButton()
|
[Resolved]
|
||||||
|
private KeyBindingStore keyBindings { get; set; }
|
||||||
|
|
||||||
|
protected ToolbarButton()
|
||||||
: base(HoverSampleSet.Loud)
|
: base(HoverSampleSet.Loud)
|
||||||
{
|
{
|
||||||
Width = WIDTH;
|
Width = WIDTH;
|
||||||
@ -123,7 +134,7 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
Origin = TooltipAnchor,
|
Origin = TooltipAnchor,
|
||||||
Position = new Vector2(TooltipAnchor.HasFlag(Anchor.x0) ? 5 : -5, 5),
|
Position = new Vector2(TooltipAnchor.HasFlag(Anchor.x0) ? 5 : -5, 5),
|
||||||
Alpha = 0,
|
Alpha = 0,
|
||||||
Children = new[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
tooltip1 = new OsuSpriteText
|
tooltip1 = new OsuSpriteText
|
||||||
{
|
{
|
||||||
@ -132,17 +143,44 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
Shadow = true,
|
Shadow = true,
|
||||||
Font = OsuFont.GetFont(size: 22, weight: FontWeight.Bold),
|
Font = OsuFont.GetFont(size: 22, weight: FontWeight.Bold),
|
||||||
},
|
},
|
||||||
tooltip2 = new OsuSpriteText
|
new FillFlowContainer
|
||||||
{
|
{
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
Anchor = TooltipAnchor,
|
Anchor = TooltipAnchor,
|
||||||
Origin = TooltipAnchor,
|
Origin = TooltipAnchor,
|
||||||
Shadow = true,
|
Direction = FillDirection.Horizontal,
|
||||||
|
Children = new[]
|
||||||
|
{
|
||||||
|
tooltip2 = new OsuSpriteText { Shadow = true },
|
||||||
|
keyBindingTooltip = new OsuSpriteText { Shadow = true }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private readonly Cached tooltipKeyBinding = new Cached();
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load()
|
||||||
|
{
|
||||||
|
keyBindings.KeyBindingChanged += () => tooltipKeyBinding.Invalidate();
|
||||||
|
updateKeyBindingTooltip();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateKeyBindingTooltip()
|
||||||
|
{
|
||||||
|
if (tooltipKeyBinding.IsValid)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var binding = keyBindings.Query().Find(b => (GlobalAction)b.Action == Hotkey);
|
||||||
|
var keyBindingString = binding?.KeyCombination.ReadableString();
|
||||||
|
keyBindingTooltip.Text = !string.IsNullOrEmpty(keyBindingString) ? $" ({keyBindingString})" : string.Empty;
|
||||||
|
|
||||||
|
tooltipKeyBinding.Validate();
|
||||||
|
}
|
||||||
|
|
||||||
protected override bool OnMouseDown(MouseDownEvent e) => true;
|
protected override bool OnMouseDown(MouseDownEvent e) => true;
|
||||||
|
|
||||||
protected override bool OnClick(ClickEvent e)
|
protected override bool OnClick(ClickEvent e)
|
||||||
@ -154,6 +192,8 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
|
|
||||||
protected override bool OnHover(HoverEvent e)
|
protected override bool OnHover(HoverEvent e)
|
||||||
{
|
{
|
||||||
|
updateKeyBindingTooltip();
|
||||||
|
|
||||||
HoverBackground.FadeIn(200);
|
HoverBackground.FadeIn(200);
|
||||||
tooltipContainer.FadeIn(100);
|
tooltipContainer.FadeIn(100);
|
||||||
return base.OnHover(e);
|
return base.OnHover(e);
|
||||||
@ -164,6 +204,21 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
HoverBackground.FadeOut(200);
|
HoverBackground.FadeOut(200);
|
||||||
tooltipContainer.FadeOut(100);
|
tooltipContainer.FadeOut(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool OnPressed(GlobalAction action)
|
||||||
|
{
|
||||||
|
if (action == Hotkey)
|
||||||
|
{
|
||||||
|
Click();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnReleased(GlobalAction action)
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class OpaqueBackground : Container
|
public class OpaqueBackground : Container
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Game.Input.Bindings;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Toolbar
|
namespace osu.Game.Overlays.Toolbar
|
||||||
{
|
{
|
||||||
@ -13,6 +14,8 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
SetIcon(FontAwesome.Solid.Comments);
|
SetIcon(FontAwesome.Solid.Comments);
|
||||||
TooltipMain = "Chat";
|
TooltipMain = "Chat";
|
||||||
TooltipSub = "Join the real-time discussion";
|
TooltipSub = "Join the real-time discussion";
|
||||||
|
|
||||||
|
Hotkey = GlobalAction.ToggleChat;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
|
@ -2,33 +2,19 @@
|
|||||||
// 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 osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Input.Bindings;
|
|
||||||
using osu.Game.Input.Bindings;
|
using osu.Game.Input.Bindings;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Toolbar
|
namespace osu.Game.Overlays.Toolbar
|
||||||
{
|
{
|
||||||
public class ToolbarHomeButton : ToolbarButton, IKeyBindingHandler<GlobalAction>
|
public class ToolbarHomeButton : ToolbarButton
|
||||||
{
|
{
|
||||||
public ToolbarHomeButton()
|
public ToolbarHomeButton()
|
||||||
{
|
{
|
||||||
Icon = FontAwesome.Solid.Home;
|
Icon = FontAwesome.Solid.Home;
|
||||||
TooltipMain = "Home";
|
TooltipMain = "Home";
|
||||||
TooltipSub = "Return to the main menu";
|
TooltipSub = "Return to the main menu";
|
||||||
}
|
|
||||||
|
|
||||||
public bool OnPressed(GlobalAction action)
|
Hotkey = GlobalAction.Home;
|
||||||
{
|
|
||||||
if (action == GlobalAction.Home)
|
|
||||||
{
|
|
||||||
Click();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnReleased(GlobalAction action)
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,17 +2,23 @@
|
|||||||
// 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 osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Game.Input.Bindings;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Toolbar
|
namespace osu.Game.Overlays.Toolbar
|
||||||
{
|
{
|
||||||
public class ToolbarMusicButton : ToolbarOverlayToggleButton
|
public class ToolbarMusicButton : ToolbarOverlayToggleButton
|
||||||
{
|
{
|
||||||
|
protected override Anchor TooltipAnchor => Anchor.TopRight;
|
||||||
|
|
||||||
public ToolbarMusicButton()
|
public ToolbarMusicButton()
|
||||||
{
|
{
|
||||||
Icon = FontAwesome.Solid.Music;
|
Icon = FontAwesome.Solid.Music;
|
||||||
TooltipMain = "Now playing";
|
TooltipMain = "Now playing";
|
||||||
TooltipSub = "Manage the currently playing track";
|
TooltipSub = "Manage the currently playing track";
|
||||||
|
|
||||||
|
Hotkey = GlobalAction.ToggleNowPlaying;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
|
@ -9,6 +9,7 @@ using osu.Framework.Graphics.Shapes;
|
|||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
|
using osu.Game.Input.Bindings;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
@ -28,6 +29,8 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
TooltipMain = "Notifications";
|
TooltipMain = "Notifications";
|
||||||
TooltipSub = "Waiting for 'ya";
|
TooltipSub = "Waiting for 'ya";
|
||||||
|
|
||||||
|
Hotkey = GlobalAction.ToggleNotifications;
|
||||||
|
|
||||||
Add(countDisplay = new CountCircle
|
Add(countDisplay = new CountCircle
|
||||||
{
|
{
|
||||||
Alpha = 0,
|
Alpha = 0,
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Game.Input.Bindings;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Toolbar
|
namespace osu.Game.Overlays.Toolbar
|
||||||
{
|
{
|
||||||
@ -13,6 +14,8 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
Icon = FontAwesome.Solid.Cog;
|
Icon = FontAwesome.Solid.Cog;
|
||||||
TooltipMain = "Settings";
|
TooltipMain = "Settings";
|
||||||
TooltipSub = "Change your settings";
|
TooltipSub = "Change your settings";
|
||||||
|
|
||||||
|
Hotkey = GlobalAction.ToggleSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Game.Input.Bindings;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Toolbar
|
namespace osu.Game.Overlays.Toolbar
|
||||||
{
|
{
|
||||||
@ -13,6 +14,8 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
Icon = FontAwesome.Solid.Users;
|
Icon = FontAwesome.Solid.Users;
|
||||||
TooltipMain = "Friends";
|
TooltipMain = "Friends";
|
||||||
TooltipSub = "Interact with those close to you";
|
TooltipSub = "Interact with those close to you";
|
||||||
|
|
||||||
|
Hotkey = GlobalAction.ToggleSocial;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
|
@ -117,7 +117,7 @@ namespace osu.Game.Rulesets.UI
|
|||||||
|
|
||||||
public void RemoveAdjustment(AdjustableProperty type, BindableNumber<double> adjustBindable) => throw new NotSupportedException();
|
public void RemoveAdjustment(AdjustableProperty type, BindableNumber<double> adjustBindable) => throw new NotSupportedException();
|
||||||
|
|
||||||
public void RemoveAllAdjustments(AdjustableProperty type) => throw new NotImplementedException();
|
public void RemoveAllAdjustments(AdjustableProperty type) => throw new NotSupportedException();
|
||||||
|
|
||||||
public BindableNumber<double> Volume => throw new NotSupportedException();
|
public BindableNumber<double> Volume => throw new NotSupportedException();
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2020.804.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2020.806.0" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.731.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.731.0" />
|
||||||
<PackageReference Include="Sentry" Version="2.1.5" />
|
<PackageReference Include="Sentry" Version="2.1.5" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.26.0" />
|
<PackageReference Include="SharpCompress" Version="0.26.0" />
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
<Reference Include="System.Net.Http" />
|
<Reference Include="System.Net.Http" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Label="Package References">
|
<ItemGroup Label="Package References">
|
||||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2020.804.0" />
|
<PackageReference Include="ppy.osu.Framework.iOS" Version="2020.806.0" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.731.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.731.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<!-- Xamarin.iOS does not automatically handle transitive dependencies from NuGet packages. -->
|
<!-- Xamarin.iOS does not automatically handle transitive dependencies from NuGet packages. -->
|
||||||
@ -80,7 +80,7 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2020.804.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2020.806.0" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.26.0" />
|
<PackageReference Include="SharpCompress" Version="0.26.0" />
|
||||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user