private void load(ISkinSource skin, IScrollingInfo scrollingInfo) { string lightImage = GetManiaSkinConfig <string>(skin, LegacyManiaSkinConfigurationLookups.LightImage, 0)?.Value ?? "mania-stage-light"; float leftLineWidth = GetManiaSkinConfig <float>(skin, LegacyManiaSkinConfigurationLookups.LeftLineWidth) ?.Value ?? 1; float rightLineWidth = GetManiaSkinConfig <float>(skin, LegacyManiaSkinConfigurationLookups.RightLineWidth) ?.Value ?? 1; bool hasLeftLine = leftLineWidth > 0; bool hasRightLine = rightLineWidth > 0 && skin.GetConfig <LegacySkinConfiguration.LegacySetting, decimal>(LegacySkinConfiguration.LegacySetting.Version)?.Value >= 2.4m || Stage == null || Column.Index == Stage.Columns.Count - 1; float lightPosition = skin.GetConfig <LegacyManiaSkinConfigurationLookup, float>( new LegacyManiaSkinConfigurationLookup(Stage?.Columns.Count ?? 4, LegacyManiaSkinConfigurationLookups.LightPosition))?.Value ?? 0; InternalChildren = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.Black }, new Box { RelativeSizeAxes = Axes.Y, Width = leftLineWidth, Alpha = hasLeftLine ? 1 : 0 }, new Box { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, RelativeSizeAxes = Axes.Y, Width = rightLineWidth, Alpha = hasRightLine ? 1 : 0 }, lightContainer = new Container { Origin = Anchor.BottomCentre, RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Bottom = lightPosition }, Child = light = new Sprite { Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, Texture = skin.GetTexture(lightImage), RelativeSizeAxes = Axes.X, Width = 1, Alpha = 0 } } }; direction.BindTo(scrollingInfo.Direction); direction.BindValueChanged(onDirectionChanged, true); }
private void load(ISkinSource skin) { this.skin = skin; }
protected override void ApplySkin(ISkinSource skin, bool allowFallback) { base.ApplySkin(skin, allowFallback); updateBallTint(); }
/// <summary> /// Called when a change is made to the skin. /// </summary> /// <param name="skin">The new skin.</param> /// <param name="allowFallback">Whether fallback to default skin should be allowed if the custom skin is missing this resource.</param> protected virtual void ApplySkin(ISkinSource skin, bool allowFallback) { }
private void updateAccentColour(ISkinSource skin, Color4 defaultAccentColour) => AccentColour = skin.GetConfig <OsuSkinColour, Color4>(OsuSkinColour.SliderTrackOverride)?.Value ?? defaultAccentColour;
protected override void SkinChanged(ISkinSource skin) { base.SkinChanged(skin); SkinChangedCount++; }
protected override void SkinChanged(ISkinSource skin, bool allowFallback) { base.SkinChanged(skin, allowFallback); updateSample(); }
protected override void SkinChanged(ISkinSource skin, bool allowFallback) { cursorExpand = skin.GetValue <SkinConfiguration, bool>(s => s.CursorExpand ?? true); }
public TaikoLegacySkinTransformer(ISkinSource source) { this.source = source; }
protected override void SkinChanged(ISkinSource skin) { base.SkinChanged(skin); UpdateHitPosition(); }
protected override void ApplySkin(ISkinSource skin, bool allowFallback) { base.ApplySkin(skin, allowFallback); spinnerFrequencyModulate = skin.GetConfig <OsuSkinConfiguration, bool>(OsuSkinConfiguration.SpinnerFrequencyModulate)?.Value ?? true; }
public TaikoLegacySkinTransformer(ISkinSource source) : base(source) { }
private void load(ISkinSource skin, IScrollingInfo scrollingInfo) { string lightImage = GetManiaSkinConfig <string>(skin, LegacyManiaSkinConfigurationLookups.LightImage, 0)?.Value ?? "mania-stage-light"; float leftLineWidth = GetManiaSkinConfig <float>(skin, LegacyManiaSkinConfigurationLookups.LeftLineWidth) ?.Value ?? 1; float rightLineWidth = GetManiaSkinConfig <float>(skin, LegacyManiaSkinConfigurationLookups.RightLineWidth) ?.Value ?? 1; bool hasLeftLine = leftLineWidth > 0; bool hasRightLine = rightLineWidth > 0 && skin.GetConfig <LegacySkinConfiguration.LegacySetting, decimal>(LegacySkinConfiguration.LegacySetting.Version)?.Value >= 2.4m || isLastColumn; float lightPosition = GetManiaSkinConfig <float>(skin, LegacyManiaSkinConfigurationLookups.LightPosition)?.Value ?? 0; Color4 lineColour = GetManiaSkinConfig <Color4>(skin, LegacyManiaSkinConfigurationLookups.ColumnLineColour)?.Value ?? Color4.White; Color4 backgroundColour = GetManiaSkinConfig <Color4>(skin, LegacyManiaSkinConfigurationLookups.ColumnBackgroundColour)?.Value ?? Color4.Black; Color4 lightColour = GetManiaSkinConfig <Color4>(skin, LegacyManiaSkinConfigurationLookups.ColumnLightColour)?.Value ?? Color4.White; InternalChildren = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = backgroundColour }, new Box { RelativeSizeAxes = Axes.Y, Width = leftLineWidth, Scale = new Vector2(0.740f, 1), Colour = lineColour, Alpha = hasLeftLine ? 1 : 0 }, new Box { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, RelativeSizeAxes = Axes.Y, Width = rightLineWidth, Scale = new Vector2(0.740f, 1), Colour = lineColour, Alpha = hasRightLine ? 1 : 0 }, lightContainer = new Container { Origin = Anchor.BottomCentre, RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Bottom = lightPosition }, Child = light = new Sprite { Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, Colour = lightColour, Texture = skin.GetTexture(lightImage), RelativeSizeAxes = Axes.X, Width = 1, Alpha = 0 } } }; direction.BindTo(scrollingInfo.Direction); direction.BindValueChanged(onDirectionChanged, true); }
protected override void SkinChanged(ISkinSource skin, bool allowFallback) { base.SkinChanged(skin, allowFallback); SkinChangedCount++; }
private void load(OsuGameBase game, SkinManager skins) { var legacySkin = new DefaultLegacySkin(new NamespacedResourceStore <byte[]>(game.Resources, "Skins/Legacy"), skins); legacySkinSource = new SkinProvidingContainer(legacySkin); }
protected override void SkinChanged(ISkinSource skin, bool allowFallback) { base.SkinChanged(skin, allowFallback); UpdateHitPosition(); }
public SkinProvidingPlayer(ISkinSource skinSource) { this.skinSource = skinSource; }
public CustomSkinWorkingBeatmap(IBeatmap beatmap, Storyboard storyboard, IFrameBasedClock frameBasedClock, AudioManager audio, ISkinSource skin) : base(beatmap, storyboard, frameBasedClock, audio) { this.skin = skin; }
public CatchLegacySkinTransformer(ISkinSource source) : base(source) { }
protected override void SkinChanged(ISkinSource skin) { base.SkinChanged(skin); Reload(); }
public OsuLegacySkinTransformer(ISkinSource source) : base(source) { Source.SourceChanged += sourceChanged; sourceChanged(); }
private void load(ISkinSource skin, IScrollingInfo scrollingInfo, DrawableHitObject drawableObject) { holdNote = (DrawableHoldNote)drawableObject; string imageName = GetColumnSkinConfig <string>(skin, LegacyManiaSkinConfigurationLookups.HoldNoteBodyImage)?.Value ?? $"mania-note{FallbackColumnIndex}L"; string lightImage = GetColumnSkinConfig <string>(skin, LegacyManiaSkinConfigurationLookups.HoldNoteLightImage)?.Value ?? "lightingL"; float lightScale = GetColumnSkinConfig <float>(skin, LegacyManiaSkinConfigurationLookups.HoldNoteLightScale)?.Value ?? 1; // Create a temporary animation to retrieve the number of frames, in an effort to calculate the intended frame length. // This animation is discarded and re-queried with the appropriate frame length afterwards. var tmp = skin.GetAnimation(lightImage, true, false); double frameLength = 0; if (tmp is IFramedAnimation tmpAnimation && tmpAnimation.FrameCount > 0) { frameLength = Math.Max(1000 / 60.0, 170.0 / tmpAnimation.FrameCount); } light = skin.GetAnimation(lightImage, true, true, frameLength: frameLength).With(d => { if (d == null) { return; } d.Origin = Anchor.Centre; d.Blending = BlendingParameters.Additive; d.Scale = new Vector2(lightScale); }); if (light != null) { lightContainer = new HitTargetInsetContainer { Alpha = 0, Child = light }; } bodySprite = skin.GetAnimation(imageName, WrapMode.ClampToEdge, WrapMode.ClampToEdge, true, true).With(d => { if (d == null) { return; } if (d is TextureAnimation animation) { animation.IsPlaying = false; } d.Anchor = Anchor.TopCentre; d.RelativeSizeAxes = Axes.Both; d.Size = Vector2.One; d.FillMode = FillMode.Stretch; // Todo: Wrap }); if (bodySprite != null) { InternalChild = bodySprite; } direction.BindTo(scrollingInfo.Direction); isHitting.BindTo(holdNote.IsHitting); }
protected override void SkinChanged(ISkinSource skin, bool allowFallback) { cursorExpand = skin.GetConfig <OsuSkinConfiguration, bool>(OsuSkinConfiguration.CursorExpand)?.Value ?? true; }
public virtual ISkin CreateLegacySkinProvider(ISkinSource source, IBeatmap beatmap) => null;
public override ISkin CreateLegacySkinProvider(ISkinSource source) => new OsuLegacySkinTransformer(source);
protected override void SkinChanged(ISkinSource skin) { base.SkinChanged(skin); updateColour(); }
public override ISkin CreateLegacySkinProvider(ISkinSource source, IBeatmap beatmap) => new CatchLegacySkinTransformer(source);
public virtual ISkin CreateLegacySkinProvider(ISkinSource source) => null;
public CatchLegacySkinTransformer(ISkinSource source) { this.source = source; }
protected override Color4 GetBodyAccentColour(ISkinSource skin, Color4 hitObjectAccentColour) { // legacy skins use a constant value for slider track alpha, regardless of the source colour. return(base.GetBodyAccentColour(skin, hitObjectAccentColour).Opacity(0.7f)); }