Skip to content

Commit

Permalink
fix local default textures not loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Flutterish committed Feb 1, 2022
1 parent 0c262ba commit 96ddf53
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
4 changes: 2 additions & 2 deletions osu.Game.Rulesets.RurusettoAddon/API/APIUser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ public void RequestDetail ( Action<UserProfile> success, Action? failure = null
}
}

public void RequestProfilePicture ( Action<Texture> success, Action<Texture>? failure = null ) {
public void RequestProfilePicture ( Action<Texture> success, Action? failure = null ) {
void requestDefault () {
if ( API != null ) {
API.RequestImage( StaticAPIResource.DefaultProfileImage, success, failure: () => {
failure?.Invoke( Texture.WhitePixel );
failure?.Invoke();
} );
}
}
Expand Down
9 changes: 3 additions & 6 deletions osu.Game.Rulesets.RurusettoAddon/UI/Info/InfoTab.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ public InfoTab ( APIRuleset ruleset ) {
}

OverlayColourProvider colourProvider;
Texture defaultCover;
[BackgroundDependencyLoader]
private void load ( OverlayColourProvider colourProvider ) {
private void load ( OverlayColourProvider colourProvider, GameHost host, TextureStore textures, RurusettoAddonRuleset ruleset ) {
this.colourProvider = colourProvider;
defaultCover = ruleset.GetTexture( host, textures, TextureNames.DefaultCover );
}

SubpageListingEntry main;
Expand All @@ -58,11 +60,6 @@ private void load ( OverlayColourProvider colourProvider ) {

ILocalisedBindableString contentBindable;

Texture defaultCover;
private void load ( GameHost host, TextureStore textures, RurusettoAddonRuleset ruleset ) {
defaultCover = ruleset.GetTexture( host, textures, TextureNames.DefaultCover );
}

protected override void LoadContent () {
AddInternal( new Container {
RelativeSizeAxes = Axes.X,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,6 @@ protected override void LoadComplete () {

user.RequestProfilePicture( texture => {
pfp.Texture = texture;
}, fallback => {
pfp.Texture = fallback;
} );
}

Expand Down

0 comments on commit 96ddf53

Please sign in to comment.