2019-01-24 16:43:03 +08:00
|
|
|
|
// 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.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Framework.Graphics.UserInterface;
|
|
|
|
|
using osu.Game.Configuration;
|
|
|
|
|
using osu.Game.Graphics.Sprites;
|
|
|
|
|
using osu.Game.Graphics.UserInterface;
|
|
|
|
|
using osu.Game.Online.API;
|
2018-11-20 15:51:59 +08:00
|
|
|
|
using osuTK;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using osu.Game.Users;
|
|
|
|
|
using System.ComponentModel;
|
2020-10-22 13:19:12 +08:00
|
|
|
|
using osu.Framework.Bindables;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using osu.Game.Graphics;
|
2018-11-20 15:51:59 +08:00
|
|
|
|
using osuTK.Graphics;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using osu.Framework.Extensions.Color4Extensions;
|
2019-04-02 13:51:28 +08:00
|
|
|
|
using osu.Framework.Graphics.Effects;
|
2019-03-27 18:29:27 +08:00
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
2018-10-02 11:02:47 +08:00
|
|
|
|
using osu.Framework.Input.Events;
|
2018-12-26 17:05:12 +08:00
|
|
|
|
using osu.Game.Graphics.Containers;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using RectangleF = osu.Framework.Graphics.Primitives.RectangleF;
|
|
|
|
|
using Container = osu.Framework.Graphics.Containers.Container;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Overlays.Settings.Sections.General
|
|
|
|
|
{
|
2020-10-22 13:19:12 +08:00
|
|
|
|
public class LoginSettings : FillFlowContainer
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
private bool bounding = true;
|
|
|
|
|
private LoginForm form;
|
2020-02-14 21:14:00 +08:00
|
|
|
|
|
|
|
|
|
[Resolved]
|
|
|
|
|
private OsuColour colours { get; set; }
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2020-07-19 01:24:38 +08:00
|
|
|
|
private UserGridPanel panel;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
private UserDropdown dropdown;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Called to request a hide of a parent displaying this container.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public Action RequestHide;
|
|
|
|
|
|
2020-10-22 13:19:12 +08:00
|
|
|
|
private readonly IBindable<APIState> apiState = new Bindable<APIState>();
|
|
|
|
|
|
|
|
|
|
[Resolved]
|
|
|
|
|
private IAPIProvider api { get; set; }
|
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
public override RectangleF BoundingBox => bounding ? base.BoundingBox : RectangleF.Empty;
|
|
|
|
|
|
|
|
|
|
public bool Bounding
|
|
|
|
|
{
|
2019-02-28 12:58:19 +08:00
|
|
|
|
get => bounding;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
bounding = value;
|
|
|
|
|
Invalidate(Invalidation.MiscGeometry);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public LoginSettings()
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X;
|
|
|
|
|
AutoSizeAxes = Axes.Y;
|
|
|
|
|
Direction = FillDirection.Vertical;
|
|
|
|
|
Spacing = new Vector2(0f, 5f);
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-22 13:19:12 +08:00
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load()
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2020-10-22 13:19:12 +08:00
|
|
|
|
apiState.BindTo(api.State);
|
|
|
|
|
apiState.BindValueChanged(onlineStateChanged, true);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
2020-10-22 13:19:12 +08:00
|
|
|
|
private void onlineStateChanged(ValueChangedEvent<APIState> state) => Schedule(() =>
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
form = null;
|
|
|
|
|
|
2020-10-22 13:19:12 +08:00
|
|
|
|
switch (state.NewValue)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
case APIState.Offline:
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new OsuSpriteText
|
|
|
|
|
{
|
|
|
|
|
Text = "ACCOUNT",
|
|
|
|
|
Margin = new MarginPadding { Bottom = 5 },
|
2020-03-17 07:32:25 +08:00
|
|
|
|
Font = OsuFont.GetFont(weight: FontWeight.Bold),
|
2018-04-13 17:19:50 +08:00
|
|
|
|
},
|
2018-12-04 19:33:29 +08:00
|
|
|
|
form = new LoginForm
|
|
|
|
|
{
|
|
|
|
|
RequestHide = RequestHide
|
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
};
|
|
|
|
|
break;
|
2019-04-01 11:44:46 +08:00
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
case APIState.Failing:
|
2018-12-26 17:05:12 +08:00
|
|
|
|
case APIState.Connecting:
|
|
|
|
|
LinkFlowContainer linkFlow;
|
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
2020-02-21 14:33:31 +08:00
|
|
|
|
new LoadingSpinner
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2019-06-11 13:28:52 +08:00
|
|
|
|
State = { Value = Visibility.Visible },
|
2018-12-26 17:05:12 +08:00
|
|
|
|
Anchor = Anchor.TopCentre,
|
|
|
|
|
Origin = Anchor.TopCentre,
|
2018-04-13 17:19:50 +08:00
|
|
|
|
},
|
2018-12-26 17:05:12 +08:00
|
|
|
|
linkFlow = new LinkFlowContainer
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2018-12-26 17:05:12 +08:00
|
|
|
|
Anchor = Anchor.TopCentre,
|
|
|
|
|
Origin = Anchor.TopCentre,
|
|
|
|
|
TextAnchor = Anchor.TopCentre,
|
|
|
|
|
AutoSizeAxes = Axes.Both,
|
2020-10-22 13:19:12 +08:00
|
|
|
|
Text = state.NewValue == APIState.Failing ? "Connection is failing, will attempt to reconnect... " : "Attempting to connect... ",
|
2018-04-13 17:19:50 +08:00
|
|
|
|
Margin = new MarginPadding { Top = 10, Bottom = 10 },
|
|
|
|
|
},
|
|
|
|
|
};
|
2018-12-26 17:05:12 +08:00
|
|
|
|
|
|
|
|
|
linkFlow.AddLink("cancel", api.Logout, string.Empty);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
break;
|
2019-04-01 11:44:46 +08:00
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
case APIState.Online:
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new FillFlowContainer
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
|
Padding = new MarginPadding { Left = 20, Right = 20 },
|
|
|
|
|
Direction = FillDirection.Vertical,
|
|
|
|
|
Spacing = new Vector2(0f, 10f),
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new Container
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
|
Children = new[]
|
|
|
|
|
{
|
|
|
|
|
new OsuSpriteText
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Text = "Signed in",
|
2019-02-12 12:04:46 +08:00
|
|
|
|
Font = OsuFont.GetFont(size: 18, weight: FontWeight.Bold),
|
2018-04-13 17:19:50 +08:00
|
|
|
|
Margin = new MarginPadding { Top = 5, Bottom = 5 },
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2020-03-04 19:58:15 +08:00
|
|
|
|
panel = new UserGridPanel(api.LocalUser.Value)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
Action = RequestHide
|
|
|
|
|
},
|
|
|
|
|
dropdown = new UserDropdown { RelativeSizeAxes = Axes.X },
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
panel.Status.BindTo(api.LocalUser.Value.Status);
|
2019-05-06 02:51:55 +08:00
|
|
|
|
panel.Activity.BindTo(api.LocalUser.Value.Activity);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2019-06-12 17:04:57 +08:00
|
|
|
|
dropdown.Current.BindValueChanged(action =>
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2019-02-22 16:51:39 +08:00
|
|
|
|
switch (action.NewValue)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
case UserAction.Online:
|
|
|
|
|
api.LocalUser.Value.Status.Value = new UserStatusOnline();
|
|
|
|
|
dropdown.StatusColour = colours.Green;
|
|
|
|
|
break;
|
2019-04-01 11:44:46 +08:00
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
case UserAction.DoNotDisturb:
|
|
|
|
|
api.LocalUser.Value.Status.Value = new UserStatusDoNotDisturb();
|
|
|
|
|
dropdown.StatusColour = colours.Red;
|
|
|
|
|
break;
|
2019-04-01 11:44:46 +08:00
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
case UserAction.AppearOffline:
|
|
|
|
|
api.LocalUser.Value.Status.Value = new UserStatusOffline();
|
|
|
|
|
dropdown.StatusColour = colours.Gray7;
|
|
|
|
|
break;
|
2019-04-01 11:44:46 +08:00
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
case UserAction.SignOut:
|
|
|
|
|
api.Logout();
|
|
|
|
|
break;
|
|
|
|
|
}
|
2019-06-12 17:04:57 +08:00
|
|
|
|
}, true);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (form != null) GetContainingInputManager()?.ChangeFocus(form);
|
2019-09-23 03:45:23 +08:00
|
|
|
|
});
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
public override bool AcceptsFocus => true;
|
|
|
|
|
|
2018-10-02 11:02:47 +08:00
|
|
|
|
protected override bool OnClick(ClickEvent e) => true;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-10-02 11:02:47 +08:00
|
|
|
|
protected override void OnFocus(FocusEvent e)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
if (form != null) GetContainingInputManager().ChangeFocus(form);
|
2018-10-02 11:02:47 +08:00
|
|
|
|
base.OnFocus(e);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private class LoginForm : FillFlowContainer
|
|
|
|
|
{
|
|
|
|
|
private TextBox username;
|
|
|
|
|
private TextBox password;
|
2019-10-30 01:50:04 +08:00
|
|
|
|
private ShakeContainer shakeSignIn;
|
2020-02-14 21:14:00 +08:00
|
|
|
|
|
2020-02-14 23:02:44 +08:00
|
|
|
|
[Resolved(CanBeNull = true)]
|
2020-02-14 21:14:00 +08:00
|
|
|
|
private IAPIProvider api { get; set; }
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-12-04 19:33:29 +08:00
|
|
|
|
public Action RequestHide;
|
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
private void performLogin()
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(username.Text) && !string.IsNullOrEmpty(password.Text))
|
|
|
|
|
api.Login(username.Text, password.Text);
|
2019-10-30 01:50:04 +08:00
|
|
|
|
else
|
|
|
|
|
shakeSignIn.Shake();
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader(permitNulls: true)]
|
2020-02-14 21:14:00 +08:00
|
|
|
|
private void load(OsuConfigManager config, AccountCreationOverlay accountCreation)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
Direction = FillDirection.Vertical;
|
|
|
|
|
Spacing = new Vector2(0, 5);
|
|
|
|
|
AutoSizeAxes = Axes.Y;
|
|
|
|
|
RelativeSizeAxes = Axes.X;
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
username = new OsuTextBox
|
|
|
|
|
{
|
2019-11-25 20:35:25 +08:00
|
|
|
|
PlaceholderText = "username",
|
2018-04-13 17:19:50 +08:00
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
Text = api?.ProvidedUsername ?? string.Empty,
|
|
|
|
|
TabbableContentContainer = this
|
|
|
|
|
},
|
|
|
|
|
password = new OsuPasswordTextBox
|
|
|
|
|
{
|
2018-12-04 19:33:29 +08:00
|
|
|
|
PlaceholderText = "password",
|
2018-04-13 17:19:50 +08:00
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
TabbableContentContainer = this,
|
|
|
|
|
},
|
|
|
|
|
new SettingsCheckbox
|
|
|
|
|
{
|
2019-11-25 20:35:25 +08:00
|
|
|
|
LabelText = "Remember username",
|
2020-10-06 16:18:41 +08:00
|
|
|
|
Current = config.GetBindable<bool>(OsuSetting.SaveUsername),
|
2018-04-13 17:19:50 +08:00
|
|
|
|
},
|
|
|
|
|
new SettingsCheckbox
|
|
|
|
|
{
|
|
|
|
|
LabelText = "Stay signed in",
|
2020-10-06 16:18:41 +08:00
|
|
|
|
Current = config.GetBindable<bool>(OsuSetting.SavePassword),
|
2018-04-13 17:19:50 +08:00
|
|
|
|
},
|
2019-10-30 01:50:04 +08:00
|
|
|
|
new Container
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2019-10-30 01:50:04 +08:00
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
shakeSignIn = new ShakeContainer
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
|
Child = new SettingsButton
|
|
|
|
|
{
|
|
|
|
|
Text = "Sign in",
|
|
|
|
|
Action = performLogin
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
},
|
|
|
|
|
new SettingsButton
|
|
|
|
|
{
|
|
|
|
|
Text = "Register",
|
2018-12-04 19:33:29 +08:00
|
|
|
|
Action = () =>
|
|
|
|
|
{
|
|
|
|
|
RequestHide();
|
|
|
|
|
accountCreation.Show();
|
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
};
|
2020-10-01 11:51:33 +08:00
|
|
|
|
|
|
|
|
|
password.OnCommit += (sender, newText) => performLogin();
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool AcceptsFocus => true;
|
|
|
|
|
|
2018-10-02 11:02:47 +08:00
|
|
|
|
protected override bool OnClick(ClickEvent e) => true;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-10-02 11:02:47 +08:00
|
|
|
|
protected override void OnFocus(FocusEvent e)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
Schedule(() => { GetContainingInputManager().ChangeFocus(string.IsNullOrEmpty(username.Text) ? username : password); });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private class UserDropdown : OsuEnumDropdown<UserAction>
|
|
|
|
|
{
|
|
|
|
|
protected override DropdownHeader CreateHeader() => new UserDropdownHeader();
|
|
|
|
|
|
|
|
|
|
protected override DropdownMenu CreateMenu() => new UserDropdownMenu();
|
|
|
|
|
|
|
|
|
|
public Color4 StatusColour
|
|
|
|
|
{
|
|
|
|
|
set
|
|
|
|
|
{
|
2019-11-12 18:16:51 +08:00
|
|
|
|
if (Header is UserDropdownHeader h)
|
|
|
|
|
h.StatusColour = value;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OsuColour colours)
|
|
|
|
|
{
|
|
|
|
|
AccentColour = colours.Gray5;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private class UserDropdownMenu : OsuDropdownMenu
|
|
|
|
|
{
|
|
|
|
|
public UserDropdownMenu()
|
|
|
|
|
{
|
|
|
|
|
Masking = true;
|
|
|
|
|
CornerRadius = 5;
|
|
|
|
|
|
|
|
|
|
Margin = new MarginPadding { Bottom = 5 };
|
|
|
|
|
|
|
|
|
|
EdgeEffect = new EdgeEffectParameters
|
|
|
|
|
{
|
|
|
|
|
Type = EdgeEffectType.Shadow,
|
|
|
|
|
Colour = Color4.Black.Opacity(0.25f),
|
|
|
|
|
Radius = 4,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OsuColour colours)
|
|
|
|
|
{
|
|
|
|
|
BackgroundColour = colours.Gray3;
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-25 05:17:07 +08:00
|
|
|
|
protected override DrawableDropdownMenuItem CreateDrawableDropdownMenuItem(MenuItem item) => new DrawableUserDropdownMenuItem(item);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
private class DrawableUserDropdownMenuItem : DrawableOsuDropdownMenuItem
|
|
|
|
|
{
|
|
|
|
|
public DrawableUserDropdownMenuItem(MenuItem item)
|
|
|
|
|
: base(item)
|
|
|
|
|
{
|
|
|
|
|
Foreground.Padding = new MarginPadding { Top = 5, Bottom = 5, Left = 10, Right = 5 };
|
|
|
|
|
CornerRadius = 5;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override Drawable CreateContent() => new Content
|
|
|
|
|
{
|
|
|
|
|
Label = { Margin = new MarginPadding { Left = UserDropdownHeader.LABEL_LEFT_MARGIN - 11 } }
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private class UserDropdownHeader : OsuDropdownHeader
|
|
|
|
|
{
|
|
|
|
|
public const float LABEL_LEFT_MARGIN = 20;
|
|
|
|
|
|
|
|
|
|
private readonly SpriteIcon statusIcon;
|
2018-12-04 19:33:29 +08:00
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
public Color4 StatusColour
|
|
|
|
|
{
|
2019-02-28 12:58:19 +08:00
|
|
|
|
set => statusIcon.FadeColour(value, 500, Easing.OutQuint);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public UserDropdownHeader()
|
|
|
|
|
{
|
|
|
|
|
Foreground.Padding = new MarginPadding { Left = 10, Right = 10 };
|
|
|
|
|
Margin = new MarginPadding { Bottom = 5 };
|
|
|
|
|
Masking = true;
|
|
|
|
|
CornerRadius = 5;
|
|
|
|
|
EdgeEffect = new EdgeEffectParameters
|
|
|
|
|
{
|
|
|
|
|
Type = EdgeEffectType.Shadow,
|
|
|
|
|
Colour = Color4.Black.Opacity(0.25f),
|
|
|
|
|
Radius = 4,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Icon.Size = new Vector2(14);
|
|
|
|
|
Icon.Margin = new MarginPadding(0);
|
|
|
|
|
|
|
|
|
|
Foreground.Add(statusIcon = new SpriteIcon
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.CentreLeft,
|
|
|
|
|
Origin = Anchor.CentreLeft,
|
2019-04-02 18:55:24 +08:00
|
|
|
|
Icon = FontAwesome.Regular.Circle,
|
2018-04-13 17:19:50 +08:00
|
|
|
|
Size = new Vector2(14),
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Text.Margin = new MarginPadding { Left = LABEL_LEFT_MARGIN };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OsuColour colours)
|
|
|
|
|
{
|
|
|
|
|
BackgroundColour = colours.Gray3;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private enum UserAction
|
|
|
|
|
{
|
|
|
|
|
Online,
|
2018-12-04 19:33:29 +08:00
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
[Description(@"Do not disturb")]
|
|
|
|
|
DoNotDisturb,
|
2018-12-04 19:33:29 +08:00
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
[Description(@"Appear offline")]
|
|
|
|
|
AppearOffline,
|
2018-12-04 19:33:29 +08:00
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
[Description(@"Sign out")]
|
|
|
|
|
SignOut,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|