Files
Ez2Lazer/osu.Game/Screens/OnlinePlay/FooterButtonFreestyleV2.cs
Denis Titovets e2dd4d86b4 Add localisation support for PlaylistsSongSelectV2 (#36410)
| master | pr |
|-|-|
| <img width="691" height="84" alt="osu_2026-01-20_18-16-38 — копия"
src="https://github.com/user-attachments/assets/24e24131-525b-4603-b6f7-dbdd6e8be188"
/> | <img width="694" height="76" alt="osu_2026-01-20_18-12-45 — копия"
src="https://github.com/user-attachments/assets/d880b9c8-8a69-494e-863f-170f904a71b2"
/> |
| <img width="581" height="191" alt="osu_2026-01-20_18-16-38"
src="https://github.com/user-attachments/assets/01256367-3275-40c3-9da2-0073e4e33a1d"
/> | <img width="570" height="184" alt="osu_2026-01-20_18-12-45"
src="https://github.com/user-attachments/assets/a9b2ce0a-b571-4f94-bf0e-7869bd32e6ae"
/> |
2026-01-22 18:18:02 +09:00

52 lines
1.5 KiB
C#

// 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;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Localisation;
using osu.Game.Screens.Footer;
namespace osu.Game.Screens.OnlinePlay
{
public partial class FooterButtonFreestyleV2 : ScreenFooterButton
{
public readonly Bindable<bool> Freestyle = new Bindable<bool>();
public new Action Action
{
set => throw new NotSupportedException("The click action is handled by the button itself.");
}
[Resolved]
private OsuColour colours { get; set; } = null!;
public FooterButtonFreestyleV2()
{
// Overwrite any external behaviour as we delegate the main toggle action to a sub-button.
base.Action = () => Freestyle.Value = !Freestyle.Value;
}
[BackgroundDependencyLoader]
private void load()
{
Text = OnlinePlayStrings.FooterButtonFreestyle;
Icon = FontAwesome.Solid.ExchangeAlt;
AccentColour = colours.Lime1;
}
protected override void LoadComplete()
{
base.LoadComplete();
Freestyle.BindValueChanged(active =>
{
OverlayState.Value = active.NewValue ? Visibility.Visible : Visibility.Hidden;
}, true);
}
}
}