private void load(ISkinSource source) { AddInternal(scaleContainer = new Container { Scale = new Vector2(SPRITE_SCALE), Anchor = Anchor.TopCentre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, Y = SPINNER_Y_CENTRE, Children = new Drawable[] { glow = new Sprite { Anchor = Anchor.Centre, Origin = Anchor.Centre, Texture = source.GetTexture("spinner-glow"), Blending = BlendingParameters.Additive, Colour = glowColour, }, discBottom = new Sprite { Anchor = Anchor.Centre, Origin = Anchor.Centre, Texture = source.GetTexture("spinner-bottom"), }, discTop = new Sprite { Anchor = Anchor.Centre, Origin = Anchor.Centre, Texture = source.GetTexture("spinner-top"), }, fixedMiddle = new Sprite { Anchor = Anchor.Centre, Origin = Anchor.Centre, Texture = source.GetTexture("spinner-middle"), }, spinningMiddle = new Sprite { Anchor = Anchor.Centre, Origin = Anchor.Centre, Texture = source.GetTexture("spinner-middle2"), }, } }); var topProvider = source.FindProvider(s => s.GetTexture("spinner-top") != null); if (topProvider is LegacySkinTransformer transformer && !(transformer.Skin is DefaultLegacySkin)) { AddInternal(ApproachCircle = new Sprite { Anchor = Anchor.TopCentre, Origin = Anchor.Centre, Texture = source.GetTexture("spinner-approachcircle"), Scale = new Vector2(SPRITE_SCALE * 1.86f), Y = SPINNER_Y_CENTRE, }); } }
private void load(ISkinSource skinSource) { AutoSizeAxes = Axes.Both; string lookupName = new OsuSkinComponent(OsuSkinComponents.ReverseArrow).LookupName; var skin = skinSource.FindProvider(s => s.GetTexture(lookupName) != null); InternalChild = skin?.GetAnimation(lookupName, true, true) ?? Empty(); }
public ISkin FindProvider(Func <ISkin, bool> lookupFunction) { if (skin is ISkinSource source) { if (source.FindProvider(lookupFunction) is ISkin found) { return(found); } } else if (skin != null) { if (lookupFunction(skin)) { return(skin); } } return(fallbackSource?.FindProvider(lookupFunction)); }
public ISkin FindProvider(Func <ISkin, bool> lookupFunction) { if (skin is ISkinSource source) { if (source.FindProvider(lookupFunction) is ISkin found) { return(found); } } else if (skin != null) { // a proxy must be used here to correctly pass through the "Allow" checks without implicitly falling back to the fallbackSource. if (lookupFunction(noFallbackLookupProxy)) { return(skin); } } return(fallbackSource?.FindProvider(lookupFunction)); }
private void load(ISkinSource source) { ISkin skin = source.FindProvider(s => getAnimationFrame(s, state, 0) != null); if (skin == null) { return; } for (int frameIndex = 0; true; frameIndex++) { var texture = getAnimationFrame(skin, state, frameIndex); if (texture == null) { break; } AddFrame(texture); } }
private void load(ISkinSource source) { ISkin skin = source.FindProvider(s => getAnimationFrame(s, TaikoMascotAnimationState.Clear, 0) != null); if (skin == null) { return; } foreach (int frameIndex in clear_animation_sequence) { var texture = getAnimationFrame(skin, TaikoMascotAnimationState.Clear, frameIndex); if (texture == null) { // as per https://osu.ppy.sh/help/wiki/Skinning/osu!taiko#pippidon break; } AddFrame(texture); } }
private void load(ISkinSource source) { AutoSizeAxes = Axes.Both; var skin = source.FindProvider(s => getTexture(s, "bg") != null); // the marker lookup to decide which display style must be performed on the source of the bg, which is the most common element. isNewStyle = getTexture(skin, "marker") != null; // background implementation is the same for both versions. AddInternal(new Sprite { Texture = getTexture(skin, "bg") }); if (isNewStyle) { AddRangeInternal(new[] { fill = new LegacyNewStyleFill(skin), marker = new LegacyNewStyleMarker(skin), }); } else { AddRangeInternal(new[] { fill = new LegacyOldStyleFill(skin), marker = new LegacyOldStyleMarker(skin), }); } fill.Current.BindTo(Current); marker.Current.BindTo(Current); maxFillWidth = fill.Width; }
public ISkin FindProvider(Func <ISkin, bool> lookupFunction) => skin.FindProvider(lookupFunction);