mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Update home button
This commit is contained in:
@ -35,6 +35,15 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
IconContainer.Show();
|
IconContainer.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private TextureStore textures { get; set; }
|
||||||
|
|
||||||
|
public void SetIcon(string texture) =>
|
||||||
|
SetIcon(new Sprite
|
||||||
|
{
|
||||||
|
Texture = textures.Get(texture),
|
||||||
|
});
|
||||||
|
|
||||||
public string Text
|
public string Text
|
||||||
{
|
{
|
||||||
get => DrawableText.Text;
|
get => DrawableText.Text;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// 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.Game.Input.Bindings;
|
using osu.Game.Input.Bindings;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Toolbar
|
namespace osu.Game.Overlays.Toolbar
|
||||||
@ -9,11 +10,16 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
{
|
{
|
||||||
public ToolbarHomeButton()
|
public ToolbarHomeButton()
|
||||||
{
|
{
|
||||||
// todo: icon
|
Width *= 1.4f;
|
||||||
|
Hotkey = GlobalAction.Home;
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load()
|
||||||
|
{
|
||||||
TooltipMain = "Home";
|
TooltipMain = "Home";
|
||||||
TooltipSub = "Return to the main menu";
|
TooltipSub = "Return to the main menu";
|
||||||
|
SetIcon("Icons/Hexacons/home");
|
||||||
Hotkey = GlobalAction.Home;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,11 @@
|
|||||||
// 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.Bindables;
|
using osu.Framework.Bindables;
|
||||||
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.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Graphics.Sprites;
|
|
||||||
using osu.Framework.Graphics.Textures;
|
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Toolbar
|
namespace osu.Game.Overlays.Toolbar
|
||||||
@ -21,9 +18,6 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
|
|
||||||
private readonly Bindable<Visibility> overlayState = new Bindable<Visibility>();
|
private readonly Bindable<Visibility> overlayState = new Bindable<Visibility>();
|
||||||
|
|
||||||
[Resolved]
|
|
||||||
private TextureStore textures { get; set; }
|
|
||||||
|
|
||||||
public OverlayContainer StateContainer
|
public OverlayContainer StateContainer
|
||||||
{
|
{
|
||||||
get => stateContainer;
|
get => stateContainer;
|
||||||
@ -43,10 +37,7 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
{
|
{
|
||||||
TooltipMain = named.Title;
|
TooltipMain = named.Title;
|
||||||
TooltipSub = named.Description;
|
TooltipSub = named.Description;
|
||||||
SetIcon(new Sprite
|
SetIcon(named.IconTexture);
|
||||||
{
|
|
||||||
Texture = textures.Get(named.IconTexture),
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user