public IBindable <TValue> GetConfig <TLookup, TValue>(TLookup lookup) { switch (lookup) { case OsuSkinColour colour: return(source.GetConfig <SkinCustomColourLookup, TValue>(new SkinCustomColourLookup(colour))); case OsuSkinConfiguration osuLookup: switch (osuLookup) { case OsuSkinConfiguration.SliderPathRadius: if (hasHitCircle.Value) { return(SkinUtils.As <TValue>(new BindableFloat(LEGACY_CIRCLE_RADIUS))); } break; case OsuSkinConfiguration.HitCircleOverlayAboveNumber: // See https://osu.ppy.sh/help/wiki/Skinning/skin.ini#%5Bgeneral%5D // HitCircleOverlayAboveNumer (with typo) should still be supported for now. return(source.GetConfig <OsuSkinConfiguration, TValue>(OsuSkinConfiguration.HitCircleOverlayAboveNumber) ?? source.GetConfig <OsuSkinConfiguration, TValue>(OsuSkinConfiguration.HitCircleOverlayAboveNumer)); } break; } return(source.GetConfig <TLookup, TValue>(lookup)); }
private void onSkinChanged() { foreach (var col in columnFlow) { if (col.Index > 0) { float spacing = currentSkin.GetConfig <ManiaSkinConfigurationLookup, float>( new ManiaSkinConfigurationLookup(LegacyManiaSkinConfigurationLookups.ColumnSpacing, col.Index - 1)) ?.Value ?? COLUMN_SPACING; col.Margin = new MarginPadding { Left = spacing }; } float?width = currentSkin.GetConfig <ManiaSkinConfigurationLookup, float>( new ManiaSkinConfigurationLookup(LegacyManiaSkinConfigurationLookups.ColumnWidth, col.Index)) ?.Value; if (width == null) { // only used by default skin (legacy skins get defaults set in LegacyManiaSkinConfiguration) col.Width = col.IsSpecial ? Column.SPECIAL_COLUMN_WIDTH : Column.COLUMN_WIDTH; } else { col.Width = width.Value; } } }
public LegacyCatchComboCounter(ISkin skin) { var fontName = skin.GetConfig <LegacySetting, string>(LegacySetting.ComboPrefix)?.Value ?? "score"; var fontOverlap = skin.GetConfig <LegacySetting, float>(LegacySetting.ComboOverlap)?.Value ?? -2f; AutoSizeAxes = Axes.Both; Alpha = 0f; Anchor = Anchor.Centre; Origin = Anchor.Centre; Scale = new Vector2(0.8f); InternalChildren = new Drawable[] { explosion = new LegacyRollingCounter(skin, fontName, fontOverlap) { Alpha = 0.65f, Blending = BlendingParameters.Additive, Anchor = Anchor.Centre, Origin = Anchor.Centre, Scale = new Vector2(1.5f), }, counter = new LegacyRollingCounter(skin, fontName, fontOverlap) { Anchor = Anchor.Centre, Origin = Anchor.Centre, }, }; }
private void sourceChanged() { isLegacySkin = new Lazy <bool>(() => source.GetConfig <LegacySkinConfiguration.LegacySetting, decimal>(LegacySkinConfiguration.LegacySetting.Version) != null); hasKeyTexture = new Lazy <bool>(() => source.GetAnimation( GetConfig <ManiaSkinConfigurationLookup, string>( new ManiaSkinConfigurationLookup(LegacyManiaSkinConfigurationLookups.KeyImage, 0))?.Value ?? "mania-key1", true, true) != null); }
public IBindable <TValue> GetConfig <TLookup, TValue>(TLookup lookup) { switch (lookup) { case CatchSkinColour colour: return(source.GetConfig <SkinCustomColourLookup, TValue>(new SkinCustomColourLookup(colour))); } return(source.GetConfig <TLookup, TValue>(lookup)); }
private void load() { var ballColour = skin.GetConfig <OsuSkinColour, Color4>(OsuSkinColour.SliderBall)?.Value ?? Color4.White; InternalChildren = new[] { layerNd = new Sprite { Anchor = Anchor.Centre, Origin = Anchor.Centre, Texture = skin.GetTexture("sliderb-nd"), Colour = new Color4(5, 5, 5, 255), }, LegacyColourCompatibility.ApplyWithDoubledAlpha(animationContent.With(d => { d.Anchor = Anchor.Centre; d.Origin = Anchor.Centre; }), ballColour), layerSpec = new Sprite { Anchor = Anchor.Centre, Origin = Anchor.Centre, Texture = skin.GetTexture("sliderb-spec"), Blending = BlendingParameters.Additive, }, }; }
private void load(OsuConfigManager config) { Texture = skin.GetTexture("cursortrail"); disjointTrail = skin.GetTexture("cursormiddle") == null; if (disjointTrail) { bool centre = skin.GetConfig <OsuSkinConfiguration, bool>(OsuSkinConfiguration.CursorCentre)?.Value ?? true; TrailOrigin = centre ? Anchor.Centre : Anchor.TopLeft; Blending = BlendingParameters.Inherit; } else { Blending = BlendingParameters.Additive; } if (Texture != null) { // stable "magic ratio". see OsuPlayfieldAdjustmentContainer for full explanation. Texture.ScaleAdjust *= 1.6f; } cursorSize = config.GetBindable <float>(OsuSetting.GameplayCursorSize).GetBoundCopy(); }
public static string GetFontPrefix(this ISkin source, LegacyFont font) { switch (font) { case LegacyFont.Score: return(source.GetConfig <LegacySetting, string>(LegacySetting.ScorePrefix)?.Value ?? "score"); case LegacyFont.Combo: return(source.GetConfig <LegacySetting, string>(LegacySetting.ComboPrefix)?.Value ?? "score"); case LegacyFont.HitCircle: return(source.GetConfig <LegacySetting, string>(LegacySetting.HitCirclePrefix)?.Value ?? "default"); default: throw new ArgumentOutOfRangeException(nameof(font)); } }
public static float GetFontOverlap(this ISkin source, LegacyFont font) { switch (font) { case LegacyFont.Score: return(source.GetConfig <LegacySetting, float>(LegacySetting.ScoreOverlap)?.Value ?? 0f); case LegacyFont.Combo: return(source.GetConfig <LegacySetting, float>(LegacySetting.ComboOverlap)?.Value ?? 0f); case LegacyFont.HitCircle: return(source.GetConfig <LegacySetting, float>(LegacySetting.HitCircleOverlap)?.Value ?? -2f); default: throw new ArgumentOutOfRangeException(nameof(font)); } }
public IBindable <TValue> GetConfig <TLookup, TValue>(TLookup lookup) { if (AllowConfigurationLookup && skin != null) { var bindable = skin.GetConfig <TLookup, TValue>(lookup); if (bindable != null) { return(bindable); } } return(fallbackSource?.GetConfig <TLookup, TValue>(lookup)); }
private IBindable <TValue> lookupWithFallback <TLookup, TValue>(TLookup lookup, bool canUseSkinLookup) { if (canUseSkinLookup) { var bindable = skin?.GetConfig <TLookup, TValue>(lookup); if (bindable != null) { return(bindable); } } return(fallbackSource?.GetConfig <TLookup, TValue>(lookup)); }
private void load() { bool centre = skin.GetConfig <OsuSkinConfiguration, bool>(OsuSkinConfiguration.CursorCentre)?.Value ?? true; spin = skin.GetConfig <OsuSkinConfiguration, bool>(OsuSkinConfiguration.CursorRotate)?.Value ?? true; InternalChildren = new[] { ExpandTarget = new NonPlayfieldSprite { Texture = skin.GetTexture("cursor"), Anchor = Anchor.Centre, Origin = centre ? Anchor.Centre : Anchor.TopLeft, }, new NonPlayfieldSprite { Texture = skin.GetTexture("cursormiddle"), Anchor = Anchor.Centre, Origin = centre ? Anchor.Centre : Anchor.TopLeft, }, }; }
private static double getFrameLength(ISkin source, bool applyConfigFrameRate, Texture[] textures) { if (applyConfigFrameRate) { var iniRate = source.GetConfig<LegacySetting, int>(LegacySetting.AnimationFramerate); if (iniRate?.Value > 0) return 1000f / iniRate.Value; return 1000f / textures.Length; } return default_frame_time; }
public override IBindable <TValue> GetConfig <TLookup, TValue>(TLookup lookup) { switch (lookup) { // Lookup skin by type and index case KaraokeSkinLookup skinLookup: { var config = skinLookup.Config; var lookupNumber = skinLookup.Lookup; switch (config) { case KaraokeSkinConfiguration.LyricStyle: return(SkinUtils.As <TValue>(bindableFonts[lookupNumber])); case KaraokeSkinConfiguration.LyricLayout: return(SkinUtils.As <TValue>(bindableLayouts[lookupNumber])); case KaraokeSkinConfiguration.NoteStyle: return(SkinUtils.As <TValue>(bindableNotes[lookupNumber])); case KaraokeSkinConfiguration.Singer: return(SkinUtils.As <TValue>(bindableSingers[lookupNumber])); } break; } // Lookup list of name by type case KaraokeIndexLookup indexLookup: switch (indexLookup) { case KaraokeIndexLookup.Layout: return(SkinUtils.As <TValue>(bindableLayoutsLookup)); case KaraokeIndexLookup.Style: return(SkinUtils.As <TValue>(bindableFontsLookup)); case KaraokeIndexLookup.Note: return(SkinUtils.As <TValue>(bindableNotesLookup)); case KaraokeIndexLookup.Singer: return(SkinUtils.As <TValue>(bindableSingersLookup)); } break; } return(source.GetConfig <TLookup, TValue>(lookup)); }
public IBindable <TValue> GetConfig <TLookup, TValue>(TLookup lookup) { switch (lookup) { case GlobalSkinColours _: case SkinCustomColourLookup _: if (provider.AllowColourLookup) { return(skin.GetConfig <TLookup, TValue>(lookup)); } break; default: if (provider.AllowConfigurationLookup) { return(skin.GetConfig <TLookup, TValue>(lookup)); } break; } return(null); }
public IBindable <TValue> GetConfig <TLookup, TValue>(TLookup lookup) { switch (lookup) { case OsuSkinColour colour: return(source.GetConfig <SkinCustomColourLookup, TValue>(new SkinCustomColourLookup(colour))); case OsuSkinConfiguration osuLookup: switch (osuLookup) { case OsuSkinConfiguration.SliderPathRadius: if (hasHitCircle.Value) { return(SkinUtils.As <TValue>(new BindableFloat(LEGACY_CIRCLE_RADIUS))); } break; } break; } return(source.GetConfig <TLookup, TValue>(lookup)); }
private static double getFrameLength(ISkin source, bool applyConfigFrameRate, Texture[] textures) { if (applyConfigFrameRate) { var iniRate = source.GetConfig <GlobalSkinConfiguration, int>(GlobalSkinConfiguration.AnimationFramerate); if (iniRate?.Value > 0) { return(1000f / iniRate.Value); } return(1000f / textures.Length); } return(default_frame_time); }
protected Texture GetTextureFromLookup(ISkin skin, LegacyManiaSkinConfigurationLookups lookup) { string suffix = string.Empty; switch (lookup) { case LegacyManiaSkinConfigurationLookups.HoldNoteHeadImage: suffix = "H"; break; case LegacyManiaSkinConfigurationLookups.HoldNoteTailImage: suffix = "T"; break; } string noteImage = skin.GetConfig <LegacyManiaSkinConfigurationLookup, string>( new LegacyManiaSkinConfigurationLookup(Stage?.Columns.Count ?? 4, lookup, Column.Index))?.Value ?? $"mania-note{FallbackColumnIndex}{suffix}"; return(skin.GetTexture(noteImage)); }
private void handleColours(TextWriter writer) { var colours = skin?.GetConfig <GlobalSkinColours, IReadOnlyList <Color4> >(GlobalSkinColours.ComboColours)?.Value; if (colours == null || colours.Count == 0) { return; } writer.WriteLine("[Colours]"); for (var i = 0; i < colours.Count; i++) { var comboColour = colours[i]; writer.Write(FormattableString.Invariant($"Combo{i}: ")); writer.Write(FormattableString.Invariant($"{(byte)(comboColour.R * byte.MaxValue)},")); writer.Write(FormattableString.Invariant($"{(byte)(comboColour.G * byte.MaxValue)},")); writer.Write(FormattableString.Invariant($"{(byte)(comboColour.B * byte.MaxValue)},")); writer.Write(FormattableString.Invariant($"{(byte)(comboColour.A * byte.MaxValue)}")); writer.WriteLine(); } }
private void sourceChanged() { isLegacySkin = new Lazy <bool>(() => source.GetConfig <LegacySkinConfiguration.LegacySetting, decimal>(LegacySkinConfiguration.LegacySetting.Version) != null); }
/// <summary> /// Retrieve a per-column-count skin configuration. /// </summary> /// <param name="skin">The skin from which configuration is retrieved.</param> /// <param name="lookup">The value to retrieve.</param> /// <param name="index">If not null, denotes the index of the column to which the entry applies.</param> public static IBindable <T> GetManiaSkinConfig <T>(this ISkin skin, LegacyManiaSkinConfigurationLookups lookup, int?index = null) => skin.GetConfig <ManiaSkinConfigurationLookup, T>( new ManiaSkinConfigurationLookup(lookup, index));
/// <summary> /// Retrieve a per-column-count skin configuration. /// </summary> /// <param name="skin">The skin from which configuration is retrieved.</param> /// <param name="lookup">The value to retrieve.</param> /// <param name="index">If not null, denotes the index of the column to which the entry applies.</param> protected virtual IBindable <T> GetKaraokeSkinConfig <T>(ISkin skin, LegacyKaraokeSkinConfigurationLookups lookup, int?index = null) => skin.GetConfig <LegacyKaraokeSkinConfigurationLookup, T>( new LegacyKaraokeSkinConfigurationLookup(Playfield?.NotePlayfield.Columns ?? 4, lookup, index));
/// <summary> /// Retrieve a per-column-count skin configuration. /// </summary> /// <param name="skin">The skin from which configuration is retrieved.</param> /// <param name="lookup">The value to retrieve.</param> /// <param name="index">If not null, denotes the index of the column to which the entry applies.</param> protected virtual IBindable <T> GetManiaSkinConfig <T>(ISkin skin, LegacyManiaSkinConfigurationLookups lookup, int?index = null) => skin.GetConfig <LegacyManiaSkinConfigurationLookup, T>( new LegacyManiaSkinConfigurationLookup(Stage?.Columns.Count ?? 4, lookup, index));
public IBindable <TValue> GetConfig <TLookup, TValue>(TLookup lookup) => source.GetConfig <TLookup, TValue>(lookup);
/// <summary> /// Retrieve a per-column-count skin configuration. /// </summary> /// <param name="skin">The skin from which configuration is retrieved.</param> /// <param name="lookup">The value to retrieve.</param> /// <param name="index">If not null, denotes the index of the column to which the entry applies.</param> protected virtual IBindable <T> GetManiaSkinConfig <T>(ISkin skin, LegacyManiaSkinConfigurationLookups lookup, int?index = null) => skin.GetConfig <ManiaSkinConfigurationLookup, T>( new ManiaSkinConfigurationLookup(lookup, index));