mirror of
https://github.com/ppy/osu.git
synced 2024-11-12 03:57:25 +08:00
Merge pull request #3341 from peppy/rip-async
Remove async logic in line with framework
This commit is contained in:
commit
174c52decf
@ -2,7 +2,6 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
@ -32,7 +31,7 @@ namespace osu.Desktop.Overlays
|
|||||||
public override bool HandleMouseInput => false;
|
public override bool HandleMouseInput => false;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(NotificationOverlay notification, OsuColour colours, TextureStore textures, OsuGameBase game, OsuConfigManager config, GameHost host)
|
private void load(NotificationOverlay notification, OsuColour colours, TextureStore textures, OsuGameBase game, OsuConfigManager config, GameHost host)
|
||||||
{
|
{
|
||||||
notificationOverlay = notification;
|
notificationOverlay = notification;
|
||||||
this.config = config;
|
this.config = config;
|
||||||
@ -87,7 +86,7 @@ namespace osu.Desktop.Overlays
|
|||||||
{
|
{
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Texture = await textures.GetAsync(@"Menu/dev-build-footer"),
|
Texture = textures.Get(@"Menu/dev-build-footer"),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
@ -449,9 +448,9 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(TextureStore textures)
|
private void load(TextureStore textures)
|
||||||
{
|
{
|
||||||
Texture = await textures.GetAsync(@"Play/Catch/fruit-catcher-idle");
|
Texture = textures.Get(@"Play/Catch/fruit-catcher-idle");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
@ -13,7 +12,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
public class DefaultCirclePiece : Container
|
public class DefaultCirclePiece : Container
|
||||||
{
|
{
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(TextureStore textures)
|
private void load(TextureStore textures)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
@ -22,7 +21,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Texture = await textures.GetAsync(@"Play/osu/disc"),
|
Texture = textures.Get(@"Play/osu/disc"),
|
||||||
},
|
},
|
||||||
new TrianglesPiece
|
new TrianglesPiece
|
||||||
{
|
{
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.OpenGL.Buffers;
|
using osu.Framework.Graphics.OpenGL.Buffers;
|
||||||
@ -80,10 +79,10 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true;
|
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(ShaderManager shaders, TextureStore textures)
|
private void load(ShaderManager shaders, TextureStore textures)
|
||||||
{
|
{
|
||||||
shader = shaders?.Load(@"CursorTrail", FragmentShaderDescriptor.TEXTURE);
|
shader = shaders?.Load(@"CursorTrail", FragmentShaderDescriptor.TEXTURE);
|
||||||
texture = await textures.GetAsync(@"Cursor/cursortrail");
|
texture = textures.Get(@"Cursor/cursortrail");
|
||||||
Scale = new Vector2(1 / texture.ScaleAdjust);
|
Scale = new Vector2(1 / texture.ScaleAdjust);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -131,12 +130,12 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(TextureStore textures, OsuColour colours)
|
private void load(TextureStore textures, OsuColour colours)
|
||||||
{
|
{
|
||||||
rim.Texture = await textures.GetAsync(@"Play/Taiko/taiko-drum-outer");
|
rim.Texture = textures.Get(@"Play/Taiko/taiko-drum-outer");
|
||||||
rimHit.Texture = await textures.GetAsync(@"Play/Taiko/taiko-drum-outer-hit");
|
rimHit.Texture = textures.Get(@"Play/Taiko/taiko-drum-outer-hit");
|
||||||
centre.Texture = await textures.GetAsync(@"Play/Taiko/taiko-drum-inner");
|
centre.Texture = textures.Get(@"Play/Taiko/taiko-drum-inner");
|
||||||
centreHit.Texture = await textures.GetAsync(@"Play/Taiko/taiko-drum-inner-hit");
|
centreHit.Texture = textures.Get(@"Play/Taiko/taiko-drum-inner-hit");
|
||||||
|
|
||||||
rimHit.Colour = colours.Blue;
|
rimHit.Colour = colours.Blue;
|
||||||
centreHit.Colour = colours.Pink;
|
centreHit.Colour = colours.Pink;
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
@ -24,7 +23,7 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(TextureStore textures)
|
private void load(TextureStore textures)
|
||||||
{
|
{
|
||||||
string resource = null;
|
string resource = null;
|
||||||
|
|
||||||
@ -42,7 +41,7 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (resource != null)
|
if (resource != null)
|
||||||
Texture = await textures.GetAsync(resource);
|
Texture = textures.Get(resource);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
@ -35,10 +34,10 @@ namespace osu.Game.Graphics.Backgrounds
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(LargeTextureStore textures)
|
private void load(LargeTextureStore textures)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(textureName))
|
if (!string.IsNullOrEmpty(textureName))
|
||||||
Sprite.Texture = await textures.GetAsync(textureName);
|
Sprite.Texture = textures.Get(textureName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
using osu.Framework.Audio.Sample;
|
using osu.Framework.Audio.Sample;
|
||||||
@ -38,15 +37,15 @@ namespace osu.Game.Graphics.Containers
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
private async Task load(OsuGame osuGame, AudioManager audio, PreviewTrackManager previewTrackManager)
|
private void load(OsuGame osuGame, AudioManager audio, PreviewTrackManager previewTrackManager)
|
||||||
{
|
{
|
||||||
this.previewTrackManager = previewTrackManager;
|
this.previewTrackManager = previewTrackManager;
|
||||||
|
|
||||||
if (osuGame != null)
|
if (osuGame != null)
|
||||||
OverlayActivationMode.BindTo(osuGame.OverlayActivationMode);
|
OverlayActivationMode.BindTo(osuGame.OverlayActivationMode);
|
||||||
|
|
||||||
samplePopIn = await audio.Sample.GetAsync(@"UI/overlay-pop-in");
|
samplePopIn = audio.Sample.Get(@"UI/overlay-pop-in");
|
||||||
samplePopOut = await audio.Sample.GetAsync(@"UI/overlay-pop-out");
|
samplePopOut = audio.Sample.Get(@"UI/overlay-pop-out");
|
||||||
|
|
||||||
StateChanged += onStateChanged;
|
StateChanged += onStateChanged;
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,6 @@ using osu.Framework.Graphics.Cursor;
|
|||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
using osu.Framework.Input.EventArgs;
|
using osu.Framework.Input.EventArgs;
|
||||||
@ -133,7 +132,7 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(OsuConfigManager config, TextureStore textures, OsuColour colour)
|
private void load(OsuConfigManager config, TextureStore textures, OsuColour colour)
|
||||||
{
|
{
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
@ -144,14 +143,14 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
{
|
{
|
||||||
new Sprite
|
new Sprite
|
||||||
{
|
{
|
||||||
Texture = await textures.GetAsync(@"Cursor/menu-cursor"),
|
Texture = textures.Get(@"Cursor/menu-cursor"),
|
||||||
},
|
},
|
||||||
AdditiveLayer = new Sprite
|
AdditiveLayer = new Sprite
|
||||||
{
|
{
|
||||||
Blending = BlendingMode.Additive,
|
Blending = BlendingMode.Additive,
|
||||||
Colour = colour.Pink,
|
Colour = colour.Pink,
|
||||||
Alpha = 0,
|
Alpha = 0,
|
||||||
Texture = await textures.GetAsync(@"Cursor/menu-cursor-additive"),
|
Texture = textures.Get(@"Cursor/menu-cursor-additive"),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ namespace osu.Game.Graphics
|
|||||||
private SampleChannel shutter;
|
private SampleChannel shutter;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(GameHost host, OsuConfigManager config, Storage storage, NotificationOverlay notificationOverlay, AudioManager audio)
|
private void load(GameHost host, OsuConfigManager config, Storage storage, NotificationOverlay notificationOverlay, AudioManager audio)
|
||||||
{
|
{
|
||||||
this.host = host;
|
this.host = host;
|
||||||
this.storage = storage.GetStorageForDirectory(@"screenshots");
|
this.storage = storage.GetStorageForDirectory(@"screenshots");
|
||||||
@ -51,7 +51,7 @@ namespace osu.Game.Graphics
|
|||||||
screenshotFormat = config.GetBindable<ScreenshotFormat>(OsuSetting.ScreenshotFormat);
|
screenshotFormat = config.GetBindable<ScreenshotFormat>(OsuSetting.ScreenshotFormat);
|
||||||
captureMenuCursor = config.GetBindable<bool>(OsuSetting.ScreenshotCaptureMenuCursor);
|
captureMenuCursor = config.GetBindable<bool>(OsuSetting.ScreenshotCaptureMenuCursor);
|
||||||
|
|
||||||
shutter = await audio.Sample.GetAsync("UI/shutter");
|
shutter = audio.Sample.Get("UI/shutter");
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool OnPressed(GlobalAction action)
|
public bool OnPressed(GlobalAction action)
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
@ -25,7 +24,7 @@ namespace osu.Game.Graphics
|
|||||||
private FontStore store;
|
private FontStore store;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(FontStore store)
|
private void load(FontStore store)
|
||||||
{
|
{
|
||||||
this.store = store;
|
this.store = store;
|
||||||
|
|
||||||
@ -56,23 +55,23 @@ namespace osu.Game.Graphics
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
await updateTexture();
|
updateTexture();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
updateTexture().Wait();
|
updateTexture();
|
||||||
}
|
}
|
||||||
|
|
||||||
private FontAwesome loadedIcon;
|
private FontAwesome loadedIcon;
|
||||||
private async Task updateTexture()
|
private void updateTexture()
|
||||||
{
|
{
|
||||||
var loadableIcon = icon;
|
var loadableIcon = icon;
|
||||||
|
|
||||||
if (loadableIcon == loadedIcon) return;
|
if (loadableIcon == loadedIcon) return;
|
||||||
|
|
||||||
var texture = await store.GetAsync(((char)loadableIcon).ToString());
|
var texture = store.Get(((char)loadableIcon).ToString());
|
||||||
|
|
||||||
spriteMain.Texture = texture;
|
spriteMain.Texture = texture;
|
||||||
spriteShadow.Texture = texture;
|
spriteShadow.Texture = texture;
|
||||||
@ -131,7 +130,7 @@ namespace osu.Game.Graphics
|
|||||||
|
|
||||||
icon = value;
|
icon = value;
|
||||||
if (LoadState == LoadState.Loaded)
|
if (LoadState == LoadState.Loaded)
|
||||||
updateTexture().Wait();
|
updateTexture();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ namespace osu.Game.Graphics.Sprites
|
|||||||
|
|
||||||
protected override Drawable CreateFallbackCharacterDrawable()
|
protected override Drawable CreateFallbackCharacterDrawable()
|
||||||
{
|
{
|
||||||
var tex = GetTextureForCharacter('?').Result;
|
var tex = GetTextureForCharacter('?');
|
||||||
|
|
||||||
if (tex != null)
|
if (tex != null)
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
using osu.Framework.Audio.Sample;
|
using osu.Framework.Audio.Sample;
|
||||||
@ -29,9 +28,9 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(AudioManager audio)
|
private void load(AudioManager audio)
|
||||||
{
|
{
|
||||||
sampleClick = await audio.Sample.GetAsync($@"UI/generic-select{SampleSet.GetDescription()}");
|
sampleClick = audio.Sample.Get($@"UI/generic-select{SampleSet.GetDescription()}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
using osu.Framework.Audio.Sample;
|
using osu.Framework.Audio.Sample;
|
||||||
@ -36,9 +35,9 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(AudioManager audio)
|
private void load(AudioManager audio)
|
||||||
{
|
{
|
||||||
sampleHover = await audio.Sample.GetAsync($@"UI/generic-hover{SampleSet.GetDescription()}");
|
sampleHover = audio.Sample.Get($@"UI/generic-hover{SampleSet.GetDescription()}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
using osu.Framework.Audio.Sample;
|
using osu.Framework.Audio.Sample;
|
||||||
@ -111,10 +110,10 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(AudioManager audio)
|
private void load(AudioManager audio)
|
||||||
{
|
{
|
||||||
sampleChecked = await audio.Sample.GetAsync(@"UI/check-on");
|
sampleChecked = audio.Sample.Get(@"UI/check-on");
|
||||||
sampleUnchecked = await audio.Sample.GetAsync(@"UI/check-off");
|
sampleUnchecked = audio.Sample.Get(@"UI/check-off");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
using osu.Framework.Audio.Sample;
|
using osu.Framework.Audio.Sample;
|
||||||
@ -70,10 +69,10 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(AudioManager audio)
|
private void load(AudioManager audio)
|
||||||
{
|
{
|
||||||
sampleHover = await audio.Sample.GetAsync(@"UI/generic-hover");
|
sampleHover = audio.Sample.Get(@"UI/generic-hover");
|
||||||
sampleClick = await audio.Sample.GetAsync(@"UI/generic-select");
|
sampleClick = audio.Sample.Get(@"UI/generic-select");
|
||||||
|
|
||||||
BackgroundColour = Color4.Transparent;
|
BackgroundColour = Color4.Transparent;
|
||||||
BackgroundColourHover = OsuColour.FromHex(@"172023");
|
BackgroundColourHover = OsuColour.FromHex(@"172023");
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
@ -120,9 +119,9 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(AudioManager audio, OsuColour colours)
|
private void load(AudioManager audio, OsuColour colours)
|
||||||
{
|
{
|
||||||
sample = await audio.Sample.GetAsync(@"UI/sliderbar-notch");
|
sample = audio.Sample.Get(@"UI/sliderbar-notch");
|
||||||
AccentColour = colours.Pink;
|
AccentColour = colours.Pink;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,6 @@ using OpenTK.Input;
|
|||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework.Input.States;
|
using osu.Framework.Input.States;
|
||||||
using osu.Framework.MathUtils;
|
using osu.Framework.MathUtils;
|
||||||
|
|
||||||
@ -144,10 +143,10 @@ namespace osu.Game.Overlays
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(OsuColour colours, TextureStore textures, AudioManager audio)
|
private void load(OsuColour colours, TextureStore textures, AudioManager audio)
|
||||||
{
|
{
|
||||||
getSample = await audio.Sample.GetAsync(@"MedalSplash/medal-get");
|
getSample = audio.Sample.Get(@"MedalSplash/medal-get");
|
||||||
innerSpin.Texture = outerSpin.Texture = await textures.GetAsync(@"MedalSplash/disc-spin");
|
innerSpin.Texture = outerSpin.Texture = textures.Get(@"MedalSplash/disc-spin");
|
||||||
|
|
||||||
disc.EdgeEffect = leftStrip.EdgeEffect = rightStrip.EdgeEffect = new EdgeEffectParameters
|
disc.EdgeEffect = leftStrip.EdgeEffect = rightStrip.EdgeEffect = new EdgeEffectParameters
|
||||||
{
|
{
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework;
|
using osu.Framework;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
@ -119,10 +118,10 @@ namespace osu.Game.Overlays.MedalSplash
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(OsuColour colours, TextureStore textures)
|
private void load(OsuColour colours, TextureStore textures)
|
||||||
{
|
{
|
||||||
medalSprite.Texture = await textures.GetAsync(medal.ImageUrl);
|
medalSprite.Texture = textures.Get(medal.ImageUrl);
|
||||||
medalGlow.Texture = await textures.GetAsync(@"MedalSplash/medal-glow");
|
medalGlow.Texture = textures.Get(@"MedalSplash/medal-glow");
|
||||||
description.Colour = colours.BlueLight;
|
description.Colour = colours.BlueLight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@ using osu.Game.Rulesets.Mods;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
using osu.Framework.Audio.Sample;
|
using osu.Framework.Audio.Sample;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
@ -50,7 +49,7 @@ namespace osu.Game.Overlays.Mods
|
|||||||
protected readonly IBindable<RulesetInfo> Ruleset = new Bindable<RulesetInfo>();
|
protected readonly IBindable<RulesetInfo> Ruleset = new Bindable<RulesetInfo>();
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
private async Task load(OsuColour colours, IBindable<RulesetInfo> ruleset, AudioManager audio, Bindable<IEnumerable<Mod>> selectedMods)
|
private void load(OsuColour colours, IBindable<RulesetInfo> ruleset, AudioManager audio, Bindable<IEnumerable<Mod>> selectedMods)
|
||||||
{
|
{
|
||||||
LowMultiplierColour = colours.Red;
|
LowMultiplierColour = colours.Red;
|
||||||
HighMultiplierColour = colours.Green;
|
HighMultiplierColour = colours.Green;
|
||||||
@ -59,8 +58,8 @@ namespace osu.Game.Overlays.Mods
|
|||||||
Ruleset.BindTo(ruleset);
|
Ruleset.BindTo(ruleset);
|
||||||
if (selectedMods != null) SelectedMods.BindTo(selectedMods);
|
if (selectedMods != null) SelectedMods.BindTo(selectedMods);
|
||||||
|
|
||||||
sampleOn = await audio.Sample.GetAsync(@"UI/check-on");
|
sampleOn = audio.Sample.Get(@"UI/check-on");
|
||||||
sampleOff = await audio.Sample.GetAsync(@"UI/check-off");
|
sampleOff = audio.Sample.Get(@"UI/check-off");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
|
@ -454,9 +454,9 @@ namespace osu.Game.Overlays
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(TextureStore textures)
|
private void load(TextureStore textures)
|
||||||
{
|
{
|
||||||
sprite.Texture = beatmap?.Background ?? await textures.GetAsync(@"Backgrounds/bg4");
|
sprite.Texture = beatmap?.Background ?? textures.Get(@"Backgrounds/bg4");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
@ -43,9 +42,9 @@ namespace osu.Game.Overlays.Profile.Components
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(TextureStore textures)
|
private void load(TextureStore textures)
|
||||||
{
|
{
|
||||||
badge.Texture = await textures.GetAsync($"Grades/{grade}");
|
badge.Texture = textures.Get($"Grades/{grade}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
@ -177,13 +176,13 @@ namespace osu.Game.Overlays.Profile.Header
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(TextureStore textures)
|
private void load(TextureStore textures)
|
||||||
{
|
{
|
||||||
Child = new Sprite
|
Child = new Sprite
|
||||||
{
|
{
|
||||||
FillMode = FillMode.Fit,
|
FillMode = FillMode.Fit,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Texture = await textures.GetAsync(badge.ImageUrl),
|
Texture = textures.Get(badge.ImageUrl),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
@ -312,9 +311,9 @@ namespace osu.Game.Overlays.Profile
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(TextureStore textures)
|
private void load(TextureStore textures)
|
||||||
{
|
{
|
||||||
levelBadge.Texture = await textures.GetAsync(@"Profile/levelbadge");
|
levelBadge.Texture = textures.Get(@"Profile/levelbadge");
|
||||||
}
|
}
|
||||||
|
|
||||||
private User user;
|
private User user;
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -31,9 +30,9 @@ namespace osu.Game.Overlays.Profile.Sections.Recent
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(TextureStore textures)
|
private void load(TextureStore textures)
|
||||||
{
|
{
|
||||||
sprite.Texture = await textures.GetAsync(url);
|
sprite.Texture = textures.Get(url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
@ -76,9 +75,9 @@ namespace osu.Game.Screens.Backgrounds
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(TextureStore textures)
|
private void load(TextureStore textures)
|
||||||
{
|
{
|
||||||
Sprite.Texture = beatmap?.Background ?? await textures.GetAsync(@"Backgrounds/bg1");
|
Sprite.Texture = beatmap?.Background ?? textures.Get(@"Backgrounds/bg1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework;
|
using osu.Framework;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
@ -180,11 +179,11 @@ namespace osu.Game.Screens.Menu
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(AudioManager audio)
|
private void load(AudioManager audio)
|
||||||
{
|
{
|
||||||
sampleHover = await audio.Sample.GetAsync(@"Menu/button-hover");
|
sampleHover = audio.Sample.Get(@"Menu/button-hover");
|
||||||
if (!string.IsNullOrEmpty(sampleName))
|
if (!string.IsNullOrEmpty(sampleName))
|
||||||
sampleClick = await audio.Sample.GetAsync($@"Menu/{sampleName}");
|
sampleClick = audio.Sample.Get($@"Menu/{sampleName}");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
|
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework;
|
using osu.Framework;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
@ -103,10 +102,10 @@ namespace osu.Game.Screens.Menu
|
|||||||
private OsuGame game;
|
private OsuGame game;
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
private async Task load(AudioManager audio, OsuGame game)
|
private void load(AudioManager audio, OsuGame game)
|
||||||
{
|
{
|
||||||
this.game = game;
|
this.game = game;
|
||||||
sampleBack = await audio.Sample.GetAsync(@"Menu/button-back-select");
|
sampleBack = audio.Sample.Get(@"Menu/button-back-select");
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool OnPressed(GlobalAction action)
|
public bool OnPressed(GlobalAction action)
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
using osu.Framework.Audio.Sample;
|
using osu.Framework.Audio.Sample;
|
||||||
@ -48,7 +47,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
private WorkingBeatmap introBeatmap;
|
private WorkingBeatmap introBeatmap;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(AudioManager audio, OsuConfigManager config, BeatmapManager beatmaps, Framework.Game game, BindableBeatmap beatmap)
|
private void load(AudioManager audio, OsuConfigManager config, BeatmapManager beatmaps, Framework.Game game, BindableBeatmap beatmap)
|
||||||
{
|
{
|
||||||
this.beatmap.BindTo(beatmap);
|
this.beatmap.BindTo(beatmap);
|
||||||
|
|
||||||
@ -81,8 +80,8 @@ namespace osu.Game.Screens.Menu
|
|||||||
introBeatmap = beatmaps.GetWorkingBeatmap(setInfo.Beatmaps[0]);
|
introBeatmap = beatmaps.GetWorkingBeatmap(setInfo.Beatmaps[0]);
|
||||||
track = introBeatmap.Track;
|
track = introBeatmap.Track;
|
||||||
|
|
||||||
welcome = await audio.Sample.GetAsync(@"welcome");
|
welcome = audio.Sample.Get(@"welcome");
|
||||||
seeya = await audio.Sample.GetAsync(@"seeya");
|
seeya = audio.Sample.Get(@"seeya");
|
||||||
}
|
}
|
||||||
|
|
||||||
private const double delay_step_one = 2300;
|
private const double delay_step_one = 2300;
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
using osu.Framework.Audio.Sample;
|
using osu.Framework.Audio.Sample;
|
||||||
@ -254,13 +253,13 @@ namespace osu.Game.Screens.Menu
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(TextureStore textures, AudioManager audio)
|
private void load(TextureStore textures, AudioManager audio)
|
||||||
{
|
{
|
||||||
sampleClick = await audio.Sample.GetAsync(@"Menu/osu-logo-select");
|
sampleClick = audio.Sample.Get(@"Menu/osu-logo-select");
|
||||||
sampleBeat = await audio.Sample.GetAsync(@"Menu/osu-logo-heartbeat");
|
sampleBeat = audio.Sample.Get(@"Menu/osu-logo-heartbeat");
|
||||||
|
|
||||||
logo.Texture = await textures.GetAsync(@"Menu/logo");
|
logo.Texture = textures.Get(@"Menu/logo");
|
||||||
ripple.Texture = await textures.GetAsync(@"Menu/logo");
|
ripple.Texture = textures.Get(@"Menu/logo");
|
||||||
}
|
}
|
||||||
|
|
||||||
private int lastBeatIndex;
|
private int lastBeatIndex;
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.EntityFrameworkCore.Internal;
|
using Microsoft.EntityFrameworkCore.Internal;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
@ -81,7 +80,7 @@ namespace osu.Game.Screens
|
|||||||
private SampleChannel sampleExit;
|
private SampleChannel sampleExit;
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
private async Task load(BindableBeatmap beatmap, OsuGame osu, AudioManager audio, Bindable<RulesetInfo> ruleset)
|
private void load(BindableBeatmap beatmap, OsuGame osu, AudioManager audio, Bindable<RulesetInfo> ruleset)
|
||||||
{
|
{
|
||||||
Beatmap.BindTo(beatmap);
|
Beatmap.BindTo(beatmap);
|
||||||
Ruleset.BindTo(ruleset);
|
Ruleset.BindTo(ruleset);
|
||||||
@ -99,7 +98,7 @@ namespace osu.Game.Screens
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
sampleExit = await audio.Sample.GetAsync(@"UI/screen-back");
|
sampleExit = audio.Sample.Get(@"UI/screen-back");
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual bool OnPressed(GlobalAction action)
|
public virtual bool OnPressed(GlobalAction action)
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
@ -62,19 +61,19 @@ namespace osu.Game.Screens.Play
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(TextureStore textures)
|
private void load(TextureStore textures)
|
||||||
{
|
{
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
buttonSprite = new Sprite
|
buttonSprite = new Sprite
|
||||||
{
|
{
|
||||||
Texture = await textures.GetAsync(@"KeyCounter/key-up"),
|
Texture = textures.Get(@"KeyCounter/key-up"),
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
},
|
},
|
||||||
glowSprite = new Sprite
|
glowSprite = new Sprite
|
||||||
{
|
{
|
||||||
Texture = await textures.GetAsync(@"KeyCounter/key-glow"),
|
Texture = textures.Get(@"KeyCounter/key-glow"),
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Alpha = 0
|
Alpha = 0
|
||||||
|
@ -84,7 +84,7 @@ namespace osu.Game.Screens.Play
|
|||||||
public bool LoadedBeatmapSuccessfully => RulesetContainer?.Objects.Any() == true;
|
public bool LoadedBeatmapSuccessfully => RulesetContainer?.Objects.Any() == true;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(AudioManager audio, APIAccess api, OsuConfigManager config)
|
private void load(AudioManager audio, APIAccess api, OsuConfigManager config)
|
||||||
{
|
{
|
||||||
this.api = api;
|
this.api = api;
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ namespace osu.Game.Screens.Play
|
|||||||
if (working is DummyWorkingBeatmap)
|
if (working is DummyWorkingBeatmap)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
sampleRestart = await audio.Sample.GetAsync(@"Gameplay/restart");
|
sampleRestart = audio.Sample.Get(@"Gameplay/restart");
|
||||||
|
|
||||||
mouseWheelDisabled = config.GetBindable<bool>(OsuSetting.MouseDisableWheel);
|
mouseWheelDisabled = config.GetBindable<bool>(OsuSetting.MouseDisableWheel);
|
||||||
userAudioOffset = config.GetBindable<double>(OsuSetting.AudioOffset);
|
userAudioOffset = config.GetBindable<double>(OsuSetting.AudioOffset);
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework;
|
using osu.Framework;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
@ -225,12 +224,12 @@ namespace osu.Game.Screens.Play
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(OsuColour colours, AudioManager audio)
|
private void load(OsuColour colours, AudioManager audio)
|
||||||
{
|
{
|
||||||
colourNormal = colours.Yellow;
|
colourNormal = colours.Yellow;
|
||||||
colourHover = colours.YellowDark;
|
colourHover = colours.YellowDark;
|
||||||
|
|
||||||
sampleConfirm = await audio.Sample.GetAsync(@"SongSelect/confirm-selection");
|
sampleConfirm = audio.Sample.Get(@"SongSelect/confirm-selection");
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
@ -369,10 +368,10 @@ namespace osu.Game.Screens.Ranking
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(TextureStore textures)
|
private void load(TextureStore textures)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(user.CoverUrl))
|
if (!string.IsNullOrEmpty(user.CoverUrl))
|
||||||
cover.Texture = await textures.GetAsync(user.CoverUrl);
|
cover.Texture = textures.Get(user.CoverUrl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
using osu.Framework.Audio.Sample;
|
using osu.Framework.Audio.Sample;
|
||||||
@ -46,7 +45,7 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
private SampleChannel sampleHover;
|
private SampleChannel sampleHover;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(AudioManager audio, OsuColour colours)
|
private void load(AudioManager audio, OsuColour colours)
|
||||||
{
|
{
|
||||||
InternalChild = borderContainer = new Container
|
InternalChild = borderContainer = new Container
|
||||||
{
|
{
|
||||||
@ -69,7 +68,7 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
sampleHover = await audio.Sample.GetAsync($@"SongSelect/song-ping-variation-{RNG.Next(1, 5)}");
|
sampleHover = audio.Sample.Get($@"SongSelect/song-ping-variation-{RNG.Next(1, 5)}");
|
||||||
hoverLayer.Colour = colours.Blue.Opacity(0.1f);
|
hoverLayer.Colour = colours.Blue.Opacity(0.1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
@ -36,20 +35,23 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(TextureStore textures)
|
private void load(TextureStore textures)
|
||||||
{
|
{
|
||||||
this.textures = textures;
|
this.textures = textures;
|
||||||
await updateTexture();
|
updateTexture();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task updateTexture() => rankSprite.Texture = await textures.GetAsync($@"Grades/{Rank.GetDescription()}");
|
private void updateTexture()
|
||||||
|
{
|
||||||
|
rankSprite.Texture = textures.Get($@"Grades/{Rank.GetDescription()}");
|
||||||
|
}
|
||||||
|
|
||||||
public void UpdateRank(ScoreRank newRank)
|
public void UpdateRank(ScoreRank newRank)
|
||||||
{
|
{
|
||||||
Rank = newRank;
|
Rank = newRank;
|
||||||
|
|
||||||
if (LoadState >= LoadState.Ready)
|
if (LoadState >= LoadState.Ready)
|
||||||
updateTexture().Wait();
|
updateTexture();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,11 +55,11 @@ namespace osu.Game.Screens.Select
|
|||||||
private readonly Bindable<IEnumerable<Mod>> selectedMods = new Bindable<IEnumerable<Mod>>(new Mod[] { });
|
private readonly Bindable<IEnumerable<Mod>> selectedMods = new Bindable<IEnumerable<Mod>>(new Mod[] { });
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
private async Task load(OsuColour colours, AudioManager audio, BeatmapManager beatmaps, DialogOverlay dialogOverlay, Bindable<IEnumerable<Mod>> selectedMods)
|
private void load(OsuColour colours, AudioManager audio, BeatmapManager beatmaps, DialogOverlay dialogOverlay, Bindable<IEnumerable<Mod>> selectedMods)
|
||||||
{
|
{
|
||||||
if (selectedMods != null) this.selectedMods.BindTo(selectedMods);
|
if (selectedMods != null) this.selectedMods.BindTo(selectedMods);
|
||||||
|
|
||||||
sampleConfirm = await audio.Sample.GetAsync(@"SongSelect/confirm-selection");
|
sampleConfirm = audio.Sample.Get(@"SongSelect/confirm-selection");
|
||||||
|
|
||||||
Footer.AddButton(@"mods", colours.Yellow, modSelect, Key.F1, float.MaxValue);
|
Footer.AddButton(@"mods", colours.Yellow, modSelect, Key.F1, float.MaxValue);
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Input;
|
using OpenTK.Input;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
@ -199,7 +198,7 @@ namespace osu.Game.Screens.Select
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
private async Task load(BeatmapManager beatmaps, AudioManager audio, DialogOverlay dialog, OsuColour colours)
|
private void load(BeatmapManager beatmaps, AudioManager audio, DialogOverlay dialog, OsuColour colours)
|
||||||
{
|
{
|
||||||
if (Footer != null)
|
if (Footer != null)
|
||||||
{
|
{
|
||||||
@ -219,8 +218,8 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
dialogOverlay = dialog;
|
dialogOverlay = dialog;
|
||||||
|
|
||||||
sampleChangeDifficulty = await audio.Sample.GetAsync(@"SongSelect/select-difficulty");
|
sampleChangeDifficulty = audio.Sample.Get(@"SongSelect/select-difficulty");
|
||||||
sampleChangeBeatmap = await audio.Sample.GetAsync(@"SongSelect/select-expand");
|
sampleChangeBeatmap = audio.Sample.Get(@"SongSelect/select-expand");
|
||||||
|
|
||||||
Carousel.LoadBeatmapSetsFromManager(this.beatmaps);
|
Carousel.LoadBeatmapSetsFromManager(this.beatmaps);
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,6 @@ using osu.Framework.Graphics.Textures;
|
|||||||
using osu.Framework.MathUtils;
|
using osu.Framework.MathUtils;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace osu.Game.Screens.Tournament.Components
|
namespace osu.Game.Screens.Tournament.Components
|
||||||
{
|
{
|
||||||
@ -76,9 +75,9 @@ namespace osu.Game.Screens.Tournament.Components
|
|||||||
private int expiredCount;
|
private int expiredCount;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(TextureStore textures)
|
private void load(TextureStore textures)
|
||||||
{
|
{
|
||||||
texture = await textures.GetAsync("Drawings/visualiser-line");
|
texture = textures.Get("Drawings/visualiser-line");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateAfterChildren()
|
protected override void UpdateAfterChildren()
|
||||||
|
@ -53,7 +53,7 @@ namespace osu.Game.Screens.Tournament
|
|||||||
dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
|
dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(TextureStore textures, Storage storage)
|
private void load(TextureStore textures, Storage storage)
|
||||||
{
|
{
|
||||||
this.storage = storage;
|
this.storage = storage;
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ namespace osu.Game.Screens.Tournament
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
FillMode = FillMode.Fill,
|
FillMode = FillMode.Fill,
|
||||||
Texture = await textures.GetAsync(@"Backgrounds/Drawings/background.png")
|
Texture = textures.Get(@"Backgrounds/Drawings/background.png")
|
||||||
},
|
},
|
||||||
new FillFlowContainer
|
new FillFlowContainer
|
||||||
{
|
{
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
@ -179,9 +178,9 @@ namespace osu.Game.Screens.Tournament
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(TextureStore textures)
|
private void load(TextureStore textures)
|
||||||
{
|
{
|
||||||
flagSprite.Texture = await textures.GetAsync($@"Flags/{Team.FlagName}");
|
flagSprite.Texture = textures.Get($@"Flags/{Team.FlagName}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Colour;
|
using osu.Framework.Graphics.Colour;
|
||||||
@ -373,9 +372,9 @@ namespace osu.Game.Screens.Tournament
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(TextureStore textures)
|
private void load(TextureStore textures)
|
||||||
{
|
{
|
||||||
flagSprite.Texture = await textures.GetAsync($@"Flags/{Team.FlagName}");
|
flagSprite.Texture = textures.Get($@"Flags/{Team.FlagName}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
@ -25,14 +24,14 @@ namespace osu.Game.Users
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(TextureStore textures)
|
private void load(TextureStore textures)
|
||||||
{
|
{
|
||||||
if (textures == null)
|
if (textures == null)
|
||||||
throw new ArgumentNullException(nameof(textures));
|
throw new ArgumentNullException(nameof(textures));
|
||||||
|
|
||||||
Texture texture = null;
|
Texture texture = null;
|
||||||
if (user != null && user.Id > 1) texture = await textures.GetAsync($@"https://a.ppy.sh/{user.Id}");
|
if (user != null && user.Id > 1) texture = textures.Get($@"https://a.ppy.sh/{user.Id}");
|
||||||
if (texture == null) texture = await textures.GetAsync(@"Online/avatar-guest");
|
if (texture == null) texture = textures.Get(@"Online/avatar-guest");
|
||||||
|
|
||||||
Add(new Sprite
|
Add(new Sprite
|
||||||
{
|
{
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -45,7 +44,7 @@ namespace osu.Game.Users
|
|||||||
country = value;
|
country = value;
|
||||||
|
|
||||||
if (LoadState >= LoadState.Ready)
|
if (LoadState >= LoadState.Ready)
|
||||||
sprite.Texture = getFlagTexture().Result;
|
sprite.Texture = getFlagTexture();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,15 +64,15 @@ namespace osu.Game.Users
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(TextureStore ts)
|
private void load(TextureStore ts)
|
||||||
{
|
{
|
||||||
if (ts == null)
|
if (ts == null)
|
||||||
throw new ArgumentNullException(nameof(ts));
|
throw new ArgumentNullException(nameof(ts));
|
||||||
|
|
||||||
textures = ts;
|
textures = ts;
|
||||||
sprite.Texture = await getFlagTexture();
|
sprite.Texture = getFlagTexture();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<Texture> getFlagTexture() => await textures.GetAsync($@"Flags/{country?.FlagName ?? @"__"}");
|
private Texture getFlagTexture() => textures.Get($@"Flags/{country?.FlagName ?? @"__"}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
@ -19,13 +18,13 @@ namespace osu.Game.Users
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private async Task load(TextureStore textures)
|
private void load(TextureStore textures)
|
||||||
{
|
{
|
||||||
if (textures == null)
|
if (textures == null)
|
||||||
throw new ArgumentNullException(nameof(textures));
|
throw new ArgumentNullException(nameof(textures));
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(user.CoverUrl))
|
if (!string.IsNullOrEmpty(user.CoverUrl))
|
||||||
Texture = await textures.GetAsync(user.CoverUrl);
|
Texture = textures.Get(user.CoverUrl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.2" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.2" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.1.2" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.1.2" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
|
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2018.830.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2018.831.0" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.22.0" />
|
<PackageReference Include="SharpCompress" Version="0.22.0" />
|
||||||
<PackageReference Include="NUnit" Version="3.10.1" />
|
<PackageReference Include="NUnit" Version="3.10.1" />
|
||||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||||
|
Loading…
Reference in New Issue
Block a user