Merge remote-tracking branch 'upstream/master' into generic-download-model-manager

This commit is contained in:
naoey
2019-06-12 17:36:43 +05:30
41 changed files with 647 additions and 252 deletions

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Threading;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@ -36,6 +37,10 @@ namespace osu.Game.Overlays.Notifications
State = state;
}
private readonly CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();
public CancellationToken CancellationToken => cancellationTokenSource.Token;
public virtual ProgressNotificationState State
{
get => state;
@ -62,6 +67,8 @@ namespace osu.Game.Overlays.Notifications
break;
case ProgressNotificationState.Cancelled:
cancellationTokenSource.Cancel();
Light.Colour = colourCancelled;
Light.Pulsate = false;
progressBar.Active = false;

View File

@ -17,7 +17,7 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
{
new SettingsCheckbox
{
LabelText = "Increase visibility of first object with \"Hidden\" mod",
LabelText = "Increase visibility of first object when visual impairment mods are enabled",
Bindable = config.GetBindable<bool>(OsuSetting.IncreaseFirstObjectVisibility)
},
};

View File

@ -154,8 +154,9 @@ namespace osu.Game.Overlays.Settings.Sections.General
};
panel.Status.BindTo(api.LocalUser.Value.Status);
panel.Activity.BindTo(api.LocalUser.Value.Activity);
dropdown.Current.ValueChanged += action =>
dropdown.Current.BindValueChanged(action =>
{
switch (action.NewValue)
{
@ -178,9 +179,7 @@ namespace osu.Game.Overlays.Settings.Sections.General
api.Logout();
break;
}
};
dropdown.Current.TriggerChange();
}, true);
break;
}

View File

@ -10,11 +10,14 @@ namespace osu.Game.Overlays.Settings
{
private OsuCheckbox checkbox;
private string labelText;
protected override Drawable CreateControl() => checkbox = new OsuCheckbox();
public override string LabelText
{
set => checkbox.LabelText = value;
get => labelText;
set => checkbox.LabelText = labelText = value;
}
}
}

View File

@ -8,6 +8,7 @@ using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Rulesets;
using osuTK;
using osuTK.Graphics;
@ -58,15 +59,49 @@ namespace osu.Game.Overlays.Settings
Text = game.Name,
Font = OsuFont.GetFont(size: 18, weight: FontWeight.Bold),
},
new OsuSpriteText
new BuildDisplay(game.Version, DebugUtils.IsDebug)
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Font = OsuFont.GetFont(size: 14),
Text = game.Version,
Colour = DebugUtils.IsDebug ? colours.Red : Color4.White,
},
}
};
}
private class BuildDisplay : OsuAnimatedButton
{
private readonly string version;
private readonly bool isDebug;
[Resolved]
private OsuColour colours { get; set; }
public BuildDisplay(string version, bool isDebug)
{
this.version = version;
this.isDebug = isDebug;
Content.RelativeSizeAxes = Axes.Y;
Content.AutoSizeAxes = AutoSizeAxes = Axes.X;
Height = 20;
}
[BackgroundDependencyLoader(true)]
private void load(ChangelogOverlay changelog)
{
if (!isDebug)
Action = () => changelog?.ShowBuild(OsuGameBase.CLIENT_STREAM_NAME, version);
Add(new OsuSpriteText
{
Font = OsuFont.GetFont(size: 16),
Text = version,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Padding = new MarginPadding(5),
Colour = isDebug ? colours.Red : Color4.White,
});
}
}
}
}

View File

@ -119,6 +119,7 @@ namespace osu.Game.Overlays
}
panel.Status.BindTo(u.Status);
panel.Activity.BindTo(u.Activity);
return panel;
})
};