private void load(ISkinSource skin) { string leftImage = skin.GetManiaSkinConfig <string>(LegacyManiaSkinConfigurationLookups.LeftStageImage)?.Value ?? "mania-stage-left"; string rightImage = skin.GetManiaSkinConfig <string>(LegacyManiaSkinConfigurationLookups.RightStageImage)?.Value ?? "mania-stage-right"; InternalChildren = new[] { leftSprite = new Sprite { Anchor = Anchor.TopLeft, Origin = Anchor.TopRight, X = 0.05f, Texture = skin.GetTexture(leftImage), }, rightSprite = new Sprite { Anchor = Anchor.TopRight, Origin = Anchor.TopLeft, X = -0.05f, Texture = skin.GetTexture(rightImage) } }; }
private void load(ISkinSource skin) { float leftLineWidth = skin.GetManiaSkinConfig <float>(LegacyManiaSkinConfigurationLookups.LeftLineWidth, columnIndex)?.Value ?? 1; float rightLineWidth = skin.GetManiaSkinConfig <float>(LegacyManiaSkinConfigurationLookups.RightLineWidth, columnIndex)?.Value ?? 1; bool hasLeftLine = leftLineWidth > 0; bool hasRightLine = rightLineWidth > 0 && skin.GetConfig <SkinConfiguration.LegacySetting, decimal>(SkinConfiguration.LegacySetting.Version)?.Value >= 2.4m || isLastColumn; Color4 lineColour = skin.GetManiaSkinConfig <Color4>(LegacyManiaSkinConfigurationLookups.ColumnLineColour, columnIndex)?.Value ?? Color4.White; Color4 backgroundColour = skin.GetManiaSkinConfig <Color4>(LegacyManiaSkinConfigurationLookups.ColumnBackgroundColour, columnIndex)?.Value ?? Color4.Black; InternalChildren = new Drawable[] { LegacyColourCompatibility.ApplyWithDoubledAlpha(new Box { RelativeSizeAxes = Axes.Both }, backgroundColour), new HitTargetInsetContainer { RelativeSizeAxes = Axes.Both, Children = new[] { new Container { RelativeSizeAxes = Axes.Y, Width = leftLineWidth, Scale = new Vector2(0.740f, 1), Alpha = hasLeftLine ? 1 : 0, Child = LegacyColourCompatibility.ApplyWithDoubledAlpha(new Box { RelativeSizeAxes = Axes.Both }, lineColour) }, new Container { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, RelativeSizeAxes = Axes.Y, Width = rightLineWidth, Scale = new Vector2(0.740f, 1), Alpha = hasRightLine ? 1 : 0, Child = LegacyColourCompatibility.ApplyWithDoubledAlpha(new Box { RelativeSizeAxes = Axes.Both }, lineColour) }, } } }; }
private void load(ISkinSource skin, IScrollingInfo scrollingInfo) { hitPosition = skin.GetManiaSkinConfig <float>(LegacyManiaSkinConfigurationLookups.HitPosition)?.Value ?? Stage.HIT_TARGET_POSITION; direction.BindTo(scrollingInfo.Direction); direction.BindValueChanged(onDirectionChanged, true); }
private void load(ISkinSource skin) { string leftImage = skin.GetManiaSkinConfig <string>(LegacyManiaSkinConfigurationLookups.LeftStageImage)?.Value ?? "mania-stage-left"; string rightImage = skin.GetManiaSkinConfig <string>(LegacyManiaSkinConfigurationLookups.RightStageImage)?.Value ?? "mania-stage-right"; InternalChildren = new[] { leftSprite = new Sprite { Anchor = Anchor.TopLeft, Origin = Anchor.TopRight, X = 0.05f, Texture = skin.GetTexture(leftImage), }, rightSprite = new Sprite { Anchor = Anchor.TopRight, Origin = Anchor.TopLeft, X = -0.05f, Texture = skin.GetTexture(rightImage) }, columnBackgrounds = new ColumnFlow <Drawable>(stageDefinition) { RelativeSizeAxes = Axes.Y }, new HitTargetInsetContainer { Child = new LegacyHitTarget { RelativeSizeAxes = Axes.Both } } }; for (int i = 0; i < stageDefinition.Columns; i++) { columnBackgrounds.SetContentForColumn(i, new ColumnBackground(i, i == stageDefinition.Columns - 1)); } }
private void load(ISkinSource skin, IScrollingInfo scrollingInfo) { string targetImage = skin.GetManiaSkinConfig <string>(LegacyManiaSkinConfigurationLookups.HitTargetImage)?.Value ?? "mania-stage-hint"; bool showJudgementLine = skin.GetManiaSkinConfig <bool>(LegacyManiaSkinConfigurationLookups.ShowJudgementLine)?.Value ?? true; Color4 lineColour = skin.GetManiaSkinConfig <Color4>(LegacyManiaSkinConfigurationLookups.JudgementLineColour)?.Value ?? Color4.White; InternalChild = directionContainer = new Container { Origin = Anchor.CentreLeft, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Children = new Drawable[] { new Sprite { Texture = skin.GetTexture(targetImage), Scale = new Vector2(1, 0.9f * 1.6025f), RelativeSizeAxes = Axes.X, Width = 1 }, new Box { Anchor = Anchor.CentreLeft, RelativeSizeAxes = Axes.X, Height = 1, Colour = LegacyColourCompatibility.DisallowZeroAlpha(lineColour), Alpha = showJudgementLine ? 0.9f : 0 } } }; direction.BindTo(scrollingInfo.Direction); direction.BindValueChanged(onDirectionChanged, true); }
private void load(ISkinSource skin) { float?scorePosition = skin.GetManiaSkinConfig <float>(LegacyManiaSkinConfigurationLookups.ScorePosition)?.Value; if (scorePosition != null) { scorePosition -= Stage.HIT_TARGET_POSITION + 150; } Y = scorePosition ?? 0; if (animation != null) { InternalChild = animation.With(d => { d.Anchor = Anchor.Centre; d.Origin = Anchor.Centre; }); } }
private void load(ISkinSource skin, IScrollingInfo scrollingInfo) { string bottomImage = skin.GetManiaSkinConfig <string>(LegacyManiaSkinConfigurationLookups.BottomStageImage)?.Value ?? "mania-stage-bottom"; sprite = skin.GetAnimation(bottomImage, true, true)?.With(d => { if (d == null) { return; } d.Scale = new Vector2(1.6f); }); if (sprite != null) { InternalChild = sprite; } direction.BindTo(scrollingInfo.Direction); direction.BindValueChanged(onDirectionChanged, true); }
private void load(ISkinSource skin, IScrollingInfo scrollingInfo) { string lightImage = skin.GetManiaSkinConfig <string>(LegacyManiaSkinConfigurationLookups.LightImage)?.Value ?? "mania-stage-light"; float lightPosition = GetColumnSkinConfig <float>(skin, LegacyManiaSkinConfigurationLookups.LightPosition)?.Value ?? 0; Color4 lightColour = GetColumnSkinConfig <Color4>(skin, LegacyManiaSkinConfigurationLookups.ColumnLightColour)?.Value ?? Color4.White; InternalChildren = new[] { 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); }
private void load(ISkinSource skin, IScrollingInfo scrollingInfo) { string lightImage = skin.GetManiaSkinConfig <string>(LegacyManiaSkinConfigurationLookups.LightImage)?.Value ?? "mania-stage-light"; float leftLineWidth = GetColumnSkinConfig <float>(skin, LegacyManiaSkinConfigurationLookups.LeftLineWidth) ?.Value ?? 1; float rightLineWidth = GetColumnSkinConfig <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 = GetColumnSkinConfig <float>(skin, LegacyManiaSkinConfigurationLookups.LightPosition)?.Value ?? 0; Color4 lineColour = GetColumnSkinConfig <Color4>(skin, LegacyManiaSkinConfigurationLookups.ColumnLineColour)?.Value ?? Color4.White; Color4 backgroundColour = GetColumnSkinConfig <Color4>(skin, LegacyManiaSkinConfigurationLookups.ColumnBackgroundColour)?.Value ?? Color4.Black; Color4 lightColour = GetColumnSkinConfig <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); }