mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 02:32:59 +08:00
Merge branch 'master' into resume-cursor-2
This commit is contained in:
commit
184403c7e1
11
.github/ISSUE_TEMPLATE.md
vendored
11
.github/ISSUE_TEMPLATE.md
vendored
@ -1,11 +0,0 @@
|
||||
osu!lazer is currently still under heavy development!
|
||||
|
||||
Please ensure that you are making an issue for one of the following:
|
||||
|
||||
- A bug with currently implemented features (not features that don't exist)
|
||||
- A feature you are considering adding, so we can collaborate on feedback and design.
|
||||
- Discussions about technical design decisions
|
||||
|
||||
If your issue qualifies, replace this text with a detailed description of your issue with as much relevant information as you can provide.
|
||||
|
||||
Screenshots and log files are highly welcomed.
|
11
.github/ISSUE_TEMPLATE/bug-issues.md
vendored
11
.github/ISSUE_TEMPLATE/bug-issues.md
vendored
@ -1,14 +1,11 @@
|
||||
---
|
||||
name: Bug Report
|
||||
about: For issues regarding encountered game bugs
|
||||
about: Issues regarding encountered bugs.
|
||||
---
|
||||
|
||||
<!-- After you fill in all information, delete all comments in the issue -->
|
||||
|
||||
**Describe your problem:** <!-- Provide any information you believe could be useful -->
|
||||
**Describe the bug:**
|
||||
|
||||
**Screenshots or videos showing encountered issue:**
|
||||
|
||||
**osu!lazer version:** <!-- Provide the version of your osu!lazer, you can find it at the bottom of the screen -->
|
||||
**osu!lazer version:**
|
||||
|
||||
**Logs:** <!-- Attach your osu!lazer logs, you can find them under %appdata%\osu\logs in Windows, or under ~/.local/share/osu/ in Linux and macOS -->
|
||||
**Logs:**
|
||||
|
13
.github/ISSUE_TEMPLATE/crash-issues.md
vendored
13
.github/ISSUE_TEMPLATE/crash-issues.md
vendored
@ -1,16 +1,13 @@
|
||||
---
|
||||
name: Crash Report
|
||||
about: For issues regarding game crashes or permanent freezes
|
||||
about: Issues regarding crashes or permanent freezes.
|
||||
---
|
||||
|
||||
<!-- After you fill in all information, delete all comments in the issue -->
|
||||
|
||||
**Describe your problem:** <!-- Provide any information you believe could be useful -->
|
||||
**Describe the crash:**
|
||||
|
||||
**Screenshots or videos showing encountered issue:**
|
||||
|
||||
**osu!lazer version:** <!-- Provide the version of your osu!lazer, you can find it at the bottom of the screen -->
|
||||
**osu!lazer version:**
|
||||
|
||||
**Logs:** <!-- Attach your osu!lazer logs, you can find them under %appdata%\osu\logs in Windows, or under ~/.local/share/osu/ in Linux and macOS -->
|
||||
**Logs:**
|
||||
|
||||
**Computer Specifications:** <!-- Attach your computer specifications, you can find them by using System Information in Windows, System Monitor in Linux, or About This Mac in macOS -->
|
||||
**Computer Specifications:**
|
||||
|
@ -1,10 +1,7 @@
|
||||
---
|
||||
name: Feature Request
|
||||
about: Let us know what you would like to see in the game!
|
||||
about: Features you would like to see in the game!
|
||||
---
|
||||
**Describe the new feature:**
|
||||
|
||||
<!-- After you fill in all information, delete all comments in the issue -->
|
||||
|
||||
**Describe the feature:** <!-- Describe the feature you would like to see in the game -->
|
||||
|
||||
**Proposal designs of the feature:** <!-- Attach screenshots of how the feature should look like according to you -->
|
||||
**Proposal designs of the feature:**
|
||||
|
@ -1,10 +1,7 @@
|
||||
---
|
||||
name: Missing for Live
|
||||
about: Let us know the features you need which are available in osu-stable but not lazer
|
||||
about: Features which are available in osu!stable but not yet in osu!lazer.
|
||||
---
|
||||
**Describe the missing feature:**
|
||||
|
||||
<!-- After you fill in all information, delete all comments in the issue -->
|
||||
|
||||
**Describe the feature:** <!-- Describe the missing game feature -->
|
||||
|
||||
**Designs:** <!-- Attach screenshots of how the feature is supposed to look like. For illustrative purpose only; final designs are usually re-imagined from scratch. -->
|
||||
**Proposal designs of the feature:**
|
||||
|
@ -14,6 +14,7 @@ using osuTK.Input;
|
||||
using Microsoft.Win32;
|
||||
using osu.Desktop.Updater;
|
||||
using osu.Framework;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Framework.Platform.Windows;
|
||||
using osu.Framework.Screens;
|
||||
using osu.Game.Screens.Menu;
|
||||
@ -35,12 +36,15 @@ namespace osu.Desktop
|
||||
{
|
||||
try
|
||||
{
|
||||
return new StableStorage();
|
||||
if (Host is DesktopGameHost desktopHost)
|
||||
return new StableStorage(desktopHost);
|
||||
}
|
||||
catch
|
||||
catch (Exception e)
|
||||
{
|
||||
return null;
|
||||
Logger.Error(e, "Error while searching for stable install");
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
@ -139,8 +143,8 @@ namespace osu.Desktop
|
||||
return null;
|
||||
}
|
||||
|
||||
public StableStorage()
|
||||
: base(string.Empty, null)
|
||||
public StableStorage(DesktopGameHost host)
|
||||
: base(string.Empty, host)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ namespace osu.Game.Rulesets.Catch.UI
|
||||
|
||||
protected override Playfield CreatePlayfield() => new CatchPlayfield(Beatmap.BeatmapInfo.BaseDifficulty, CreateDrawableRepresentation);
|
||||
|
||||
protected override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new CatchPlayfieldAdjustmentContainer();
|
||||
public override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new CatchPlayfieldAdjustmentContainer();
|
||||
|
||||
protected override PassThroughInputManager CreateInputManager() => new CatchInputManager(Ruleset.RulesetInfo);
|
||||
|
||||
|
@ -88,7 +88,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
/// <returns>The column which intersects with <paramref name="screenSpacePosition"/>.</returns>
|
||||
public Column GetColumnByPosition(Vector2 screenSpacePosition) => Playfield.GetColumnByPosition(screenSpacePosition);
|
||||
|
||||
protected override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new ManiaPlayfieldAdjustmentContainer();
|
||||
public override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new ManiaPlayfieldAdjustmentContainer();
|
||||
|
||||
protected override Playfield CreatePlayfield() => new ManiaPlayfield(Beatmap.Stages);
|
||||
|
||||
|
@ -15,7 +15,9 @@ namespace osu.Game.Rulesets.Osu.Edit
|
||||
{
|
||||
}
|
||||
|
||||
protected override Playfield CreatePlayfield() => new OsuPlayfieldNoCursor { Size = Vector2.One };
|
||||
protected override Playfield CreatePlayfield() => new OsuPlayfieldNoCursor();
|
||||
|
||||
public override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new OsuPlayfieldAdjustmentContainer { Size = Vector2.One };
|
||||
|
||||
private class OsuPlayfieldNoCursor : OsuPlayfield
|
||||
{
|
||||
|
@ -2,8 +2,6 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets.Edit;
|
||||
using osu.Game.Rulesets.Edit.Tools;
|
||||
@ -13,7 +11,6 @@ using osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders;
|
||||
using osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners;
|
||||
using osu.Game.Rulesets.Osu.Objects;
|
||||
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Osu.UI;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using osu.Game.Screens.Edit.Compose.Components;
|
||||
|
||||
@ -38,8 +35,6 @@ namespace osu.Game.Rulesets.Osu.Edit
|
||||
|
||||
public override SelectionHandler CreateSelectionHandler() => new OsuSelectionHandler();
|
||||
|
||||
protected override Container CreateLayerContainer() => new OsuPlayfieldAdjustmentContainer { RelativeSizeAxes = Axes.Both };
|
||||
|
||||
public override SelectionBlueprint CreateBlueprintFor(DrawableHitObject hitObject)
|
||||
{
|
||||
switch (hitObject)
|
||||
|
@ -292,7 +292,6 @@ namespace osu.Game.Rulesets.Osu.Replays
|
||||
{
|
||||
// We add intermediate frames for spinning / following a slider here.
|
||||
case Spinner spinner:
|
||||
{
|
||||
Vector2 difference = startPosition - SPINNER_CENTRE;
|
||||
|
||||
float radius = difference.Length;
|
||||
@ -315,9 +314,7 @@ namespace osu.Game.Rulesets.Osu.Replays
|
||||
|
||||
endFrame.Position = endPosition;
|
||||
break;
|
||||
}
|
||||
case Slider slider:
|
||||
{
|
||||
for (double j = FrameDelay; j < slider.Duration; j += FrameDelay)
|
||||
{
|
||||
Vector2 pos = slider.StackedPositionAt(j / slider.Duration);
|
||||
@ -326,7 +323,6 @@ namespace osu.Game.Rulesets.Osu.Replays
|
||||
|
||||
AddFrameToReplay(new OsuReplayFrame(slider.EndTime, new Vector2(slider.StackedEndPosition.X, slider.StackedEndPosition.Y), action));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// We only want to let go of our button if we are at the end of the current replay. Otherwise something is still going on after us so we need to keep the button pressed!
|
||||
|
@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Osu.Replays
|
||||
{
|
||||
}
|
||||
|
||||
protected override bool IsImportant(OsuReplayFrame frame) => frame?.Actions.Any() ?? false;
|
||||
protected override bool IsImportant(OsuReplayFrame frame) => frame.Actions.Any();
|
||||
|
||||
protected Vector2? Position
|
||||
{
|
||||
|
@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Osu.UI
|
||||
|
||||
protected override PassThroughInputManager CreateInputManager() => new OsuInputManager(Ruleset.RulesetInfo);
|
||||
|
||||
protected override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new OsuPlayfieldAdjustmentContainer();
|
||||
public override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new OsuPlayfieldAdjustmentContainer();
|
||||
|
||||
protected override ResumeOverlay CreateResumeOverlay() => new OsuResumeOverlay();
|
||||
|
||||
|
@ -81,7 +81,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
|
||||
public override ScoreProcessor CreateScoreProcessor() => new TaikoScoreProcessor(this);
|
||||
|
||||
protected override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new TaikoPlayfieldAdjustmentContainer();
|
||||
public override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new TaikoPlayfieldAdjustmentContainer();
|
||||
|
||||
protected override PassThroughInputManager CreateInputManager() => new TaikoInputManager(Ruleset.RulesetInfo);
|
||||
|
||||
|
@ -278,7 +278,7 @@ namespace osu.Game.Tests.NonVisual
|
||||
|
||||
protected override double AllowedImportantTimeSpan => 1000;
|
||||
|
||||
protected override bool IsImportant(TestReplayFrame frame) => frame?.IsImportant ?? false;
|
||||
protected override bool IsImportant(TestReplayFrame frame) => frame.IsImportant;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ namespace osu.Game.Configuration
|
||||
|
||||
// Input
|
||||
Set(OsuSetting.MenuCursorSize, 1.0, 0.5f, 2, 0.01);
|
||||
Set(OsuSetting.GameplayCursorSize, 1.0, 0.5f, 2, 0.01);
|
||||
Set(OsuSetting.GameplayCursorSize, 1.0, 0.1f, 2, 0.01);
|
||||
Set(OsuSetting.AutoCursorSize, false);
|
||||
|
||||
Set(OsuSetting.MouseDisableButtons, false);
|
||||
|
@ -116,5 +116,6 @@ namespace osu.Game.Overlays.Direct
|
||||
Ranked,
|
||||
Rating,
|
||||
Plays,
|
||||
Favourites,
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,8 @@ namespace osu.Game.Rulesets.Edit
|
||||
/// </summary>
|
||||
public abstract Playfield Playfield { get; }
|
||||
|
||||
public abstract PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer();
|
||||
|
||||
internal DrawableEditRuleset()
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
@ -43,6 +45,8 @@ namespace osu.Game.Rulesets.Edit
|
||||
{
|
||||
public override Playfield Playfield => drawableRuleset.Playfield;
|
||||
|
||||
public override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => drawableRuleset.CreatePlayfieldAdjustmentContainer();
|
||||
|
||||
private Ruleset ruleset => drawableRuleset.Ruleset;
|
||||
private Beatmap<TObject> beatmap => drawableRuleset.Beatmap;
|
||||
|
||||
|
@ -63,10 +63,10 @@ namespace osu.Game.Rulesets.Edit
|
||||
return;
|
||||
}
|
||||
|
||||
var layerBelowRuleset = CreateLayerContainer();
|
||||
var layerBelowRuleset = DrawableRuleset.CreatePlayfieldAdjustmentContainer();
|
||||
layerBelowRuleset.Child = new EditorPlayfieldBorder { RelativeSizeAxes = Axes.Both };
|
||||
|
||||
var layerAboveRuleset = CreateLayerContainer();
|
||||
var layerAboveRuleset = DrawableRuleset.CreatePlayfieldAdjustmentContainer();
|
||||
layerAboveRuleset.Child = blueprintContainer = new BlueprintContainer();
|
||||
|
||||
layerContainers.Add(layerBelowRuleset);
|
||||
@ -174,11 +174,6 @@ namespace osu.Game.Rulesets.Edit
|
||||
/// Creates a <see cref="SelectionHandler"/> which outlines <see cref="DrawableHitObject"/>s and handles movement of selections.
|
||||
/// </summary>
|
||||
public virtual SelectionHandler CreateSelectionHandler() => new SelectionHandler();
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="ScalableContainer"/> which provides a layer above or below the <see cref="Playfield"/>.
|
||||
/// </summary>
|
||||
protected virtual Container CreateLayerContainer() => new Container { RelativeSizeAxes = Axes.Both };
|
||||
}
|
||||
|
||||
public abstract class HitObjectComposer<TObject> : HitObjectComposer
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using JetBrains.Annotations;
|
||||
using osu.Framework.Input.StateChanges;
|
||||
using osu.Game.Input.Handlers;
|
||||
using osu.Game.Replays;
|
||||
@ -87,14 +88,24 @@ namespace osu.Game.Rulesets.Replays
|
||||
|
||||
protected bool HasFrames => Frames.Count > 0;
|
||||
|
||||
private bool inImportantSection =>
|
||||
HasFrames && FrameAccuratePlayback &&
|
||||
//a button is in a pressed state
|
||||
IsImportant(currentDirection > 0 ? CurrentFrame : NextFrame) &&
|
||||
//the next frame is within an allowable time span
|
||||
Math.Abs(CurrentTime - NextFrame?.Time ?? 0) <= AllowedImportantTimeSpan;
|
||||
private bool inImportantSection
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!HasFrames || !FrameAccuratePlayback)
|
||||
return false;
|
||||
|
||||
protected virtual bool IsImportant(TFrame frame) => false;
|
||||
var frame = currentDirection > 0 ? CurrentFrame : NextFrame;
|
||||
|
||||
if (frame == null)
|
||||
return false;
|
||||
|
||||
return IsImportant(frame) && //a button is in a pressed state
|
||||
Math.Abs(CurrentTime - NextFrame?.Time ?? 0) <= AllowedImportantTimeSpan; //the next frame is within an allowable time span
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual bool IsImportant([NotNull] TFrame frame) => false;
|
||||
|
||||
/// <summary>
|
||||
/// Update the current frame based on an incoming time value.
|
||||
|
@ -133,7 +133,7 @@ namespace osu.Game.Rulesets.UI
|
||||
return dependencies;
|
||||
}
|
||||
|
||||
protected virtual PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new PlayfieldAdjustmentContainer();
|
||||
public virtual PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new PlayfieldAdjustmentContainer();
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuConfigManager config)
|
||||
|
@ -5,6 +5,7 @@ using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.Formats;
|
||||
using osu.Game.Beatmaps.Legacy;
|
||||
using osu.Game.IO.Legacy;
|
||||
using osu.Game.Replays;
|
||||
@ -144,6 +145,7 @@ namespace osu.Game.Scoring.Legacy
|
||||
score.Rank = ScoreRank.D;
|
||||
break;
|
||||
}
|
||||
|
||||
case 1:
|
||||
{
|
||||
int totalHits = count50 + count100 + count300 + countMiss;
|
||||
@ -166,6 +168,7 @@ namespace osu.Game.Scoring.Legacy
|
||||
score.Rank = ScoreRank.D;
|
||||
break;
|
||||
}
|
||||
|
||||
case 2:
|
||||
{
|
||||
int totalHits = count50 + count100 + count300 + countMiss + countKatu;
|
||||
@ -185,6 +188,7 @@ namespace osu.Game.Scoring.Legacy
|
||||
score.Rank = ScoreRank.D;
|
||||
break;
|
||||
}
|
||||
|
||||
case 3:
|
||||
{
|
||||
int totalHits = count50 + count100 + count300 + countMiss + countGeki + countKatu;
|
||||
@ -224,7 +228,7 @@ namespace osu.Game.Scoring.Legacy
|
||||
continue;
|
||||
}
|
||||
|
||||
var diff = float.Parse(split[0]);
|
||||
var diff = Parsing.ParseFloat(split[0]);
|
||||
lastTime += diff;
|
||||
|
||||
// Todo: At some point we probably want to rewind and play back the negative-time frames
|
||||
@ -232,7 +236,10 @@ namespace osu.Game.Scoring.Legacy
|
||||
if (diff < 0)
|
||||
continue;
|
||||
|
||||
replay.Frames.Add(convertFrame(new LegacyReplayFrame(lastTime, float.Parse(split[1]), float.Parse(split[2]), (ReplayButtonState)int.Parse(split[3]))));
|
||||
replay.Frames.Add(convertFrame(new LegacyReplayFrame(lastTime,
|
||||
Parsing.ParseFloat(split[1], Parsing.MAX_COORDINATE_VALUE),
|
||||
Parsing.ParseFloat(split[2], Parsing.MAX_COORDINATE_VALUE),
|
||||
(ReplayButtonState)Parsing.ParseInt(split[3]))));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,9 +12,13 @@ using osu.Framework.Graphics.Shaders;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Skinning;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Users;
|
||||
using System;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
|
||||
namespace osu.Game.Screens.Menu
|
||||
{
|
||||
@ -66,18 +70,25 @@ namespace osu.Game.Screens.Menu
|
||||
private IShader shader;
|
||||
private readonly Texture texture;
|
||||
|
||||
private Bindable<User> user;
|
||||
private Bindable<Skin> skin;
|
||||
|
||||
public LogoVisualisation()
|
||||
{
|
||||
texture = Texture.WhitePixel;
|
||||
AccentColour = new Color4(1, 1, 1, 0.2f);
|
||||
Blending = BlendingMode.Additive;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(ShaderManager shaders, IBindable<WorkingBeatmap> beatmap)
|
||||
private void load(ShaderManager shaders, IBindable<WorkingBeatmap> beatmap, IAPIProvider api, SkinManager skinManager)
|
||||
{
|
||||
this.beatmap.BindTo(beatmap);
|
||||
shader = shaders.Load(VertexShaderDescriptor.TEXTURE_2, FragmentShaderDescriptor.TEXTURE_ROUNDED);
|
||||
user = api.LocalUser.GetBoundCopy();
|
||||
skin = skinManager.CurrentSkin.GetBoundCopy();
|
||||
|
||||
user.ValueChanged += _ => updateColour();
|
||||
skin.BindValueChanged(_ => updateColour(), true);
|
||||
}
|
||||
|
||||
private void updateAmplitudes()
|
||||
@ -107,6 +118,16 @@ namespace osu.Game.Screens.Menu
|
||||
Scheduler.AddDelayed(updateAmplitudes, time_between_updates);
|
||||
}
|
||||
|
||||
private void updateColour()
|
||||
{
|
||||
Color4 defaultColour = Color4.White.Opacity(0.2f);
|
||||
|
||||
if (user.Value?.IsSupporter ?? false)
|
||||
AccentColour = skin.Value.GetValue<SkinConfiguration, Color4?>(s => s.CustomColours.ContainsKey("MenuGlow") ? s.CustomColours["MenuGlow"] : (Color4?)null) ?? defaultColour;
|
||||
else
|
||||
AccentColour = defaultColour;
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
@ -12,6 +12,9 @@ using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.ControlPoints;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Skinning;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Users;
|
||||
using System;
|
||||
using osu.Framework.Bindables;
|
||||
|
||||
@ -32,6 +35,12 @@ namespace osu.Game.Screens.Menu
|
||||
private const double box_fade_in_time = 65;
|
||||
private const int box_width = 200;
|
||||
|
||||
private Bindable<User> user;
|
||||
private Bindable<Skin> skin;
|
||||
|
||||
[Resolved]
|
||||
private OsuColour colours { get; set; }
|
||||
|
||||
public MenuSideFlashes()
|
||||
{
|
||||
EarlyActivationMilliseconds = box_fade_in_time;
|
||||
@ -42,13 +51,12 @@ namespace osu.Game.Screens.Menu
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(IBindable<WorkingBeatmap> beatmap, OsuColour colours)
|
||||
private void load(IBindable<WorkingBeatmap> beatmap, IAPIProvider api, SkinManager skinManager)
|
||||
{
|
||||
this.beatmap.BindTo(beatmap);
|
||||
|
||||
// linear colour looks better in this case, so let's use it for now.
|
||||
Color4 gradientDark = colours.Blue.Opacity(0).ToLinear();
|
||||
Color4 gradientLight = colours.Blue.Opacity(0.6f).ToLinear();
|
||||
user = api.LocalUser.GetBoundCopy();
|
||||
skin = skinManager.CurrentSkin.GetBoundCopy();
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
@ -62,8 +70,7 @@ namespace osu.Game.Screens.Menu
|
||||
// align off-screen to make sure our edges don't become visible during parallax.
|
||||
X = -box_width,
|
||||
Alpha = 0,
|
||||
Blending = BlendingMode.Additive,
|
||||
Colour = ColourInfo.GradientHorizontal(gradientLight, gradientDark)
|
||||
Blending = BlendingMode.Additive
|
||||
},
|
||||
rightBox = new Box
|
||||
{
|
||||
@ -74,10 +81,12 @@ namespace osu.Game.Screens.Menu
|
||||
Height = 1.5f,
|
||||
X = box_width,
|
||||
Alpha = 0,
|
||||
Blending = BlendingMode.Additive,
|
||||
Colour = ColourInfo.GradientHorizontal(gradientDark, gradientLight)
|
||||
Blending = BlendingMode.Additive
|
||||
}
|
||||
};
|
||||
|
||||
user.ValueChanged += _ => updateColour();
|
||||
skin.BindValueChanged(_ => updateColour(), true);
|
||||
}
|
||||
|
||||
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes)
|
||||
@ -97,5 +106,20 @@ namespace osu.Game.Screens.Menu
|
||||
.Then()
|
||||
.FadeOut(beatLength, Easing.In);
|
||||
}
|
||||
|
||||
private void updateColour()
|
||||
{
|
||||
Color4 baseColour = colours.Blue;
|
||||
|
||||
if (user.Value?.IsSupporter ?? false)
|
||||
baseColour = skin.Value.GetValue<SkinConfiguration, Color4?>(s => s.CustomColours.ContainsKey("MenuGlow") ? s.CustomColours["MenuGlow"] : (Color4?)null) ?? baseColour;
|
||||
|
||||
// linear colour looks better in this case, so let's use it for now.
|
||||
Color4 gradientDark = baseColour.Opacity(0).ToLinear();
|
||||
Color4 gradientLight = baseColour.Opacity(0.6f).ToLinear();
|
||||
|
||||
leftBox.Colour = ColourInfo.GradientHorizontal(gradientLight, gradientDark);
|
||||
rightBox.Colour = ColourInfo.GradientHorizontal(gradientDark, gradientLight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,12 +16,10 @@ namespace osu.Game.Skinning
|
||||
{
|
||||
line = StripComments(line);
|
||||
|
||||
var pair = SplitKeyVal(line);
|
||||
switch (section)
|
||||
{
|
||||
case Section.General:
|
||||
{
|
||||
var pair = SplitKeyVal(line);
|
||||
|
||||
switch (pair.Key)
|
||||
{
|
||||
case @"Name":
|
||||
@ -36,11 +34,8 @@ namespace osu.Game.Skinning
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case Section.Fonts:
|
||||
{
|
||||
var pair = SplitKeyVal(line);
|
||||
|
||||
case Section.Fonts:
|
||||
switch (pair.Key)
|
||||
{
|
||||
case "HitCirclePrefix":
|
||||
@ -52,7 +47,6 @@ namespace osu.Game.Skinning
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
base.ParseLine(skin, section, line);
|
||||
|
@ -16,7 +16,7 @@
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.3" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.128.0" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2019.328.0" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2019.330.0" />
|
||||
<PackageReference Include="SharpCompress" Version="0.23.0" />
|
||||
<PackageReference Include="NUnit" Version="3.11.0" />
|
||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||
|
@ -105,8 +105,8 @@
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.1" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.128.0" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2019.328.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.328.0" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2019.330.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.330.0" />
|
||||
<PackageReference Include="SharpCompress" Version="0.22.0" />
|
||||
<PackageReference Include="NUnit" Version="3.11.0" />
|
||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||
|
Loading…
Reference in New Issue
Block a user