From 5a3ce15472486844e563959c1153d0c32b316819 Mon Sep 17 00:00:00 2001 From: Artemis-chan <37626459+Artemis-chan@users.noreply.github.com> Date: Fri, 26 Jul 2024 01:05:38 +0000 Subject: [PATCH 1/2] chore: update osu packages to --- osu.Game.Rulesets.Diva/osu.Game.Rulesets.Diva.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Diva/osu.Game.Rulesets.Diva.csproj b/osu.Game.Rulesets.Diva/osu.Game.Rulesets.Diva.csproj index b14c832..2ebe86b 100644 --- a/osu.Game.Rulesets.Diva/osu.Game.Rulesets.Diva.csproj +++ b/osu.Game.Rulesets.Diva/osu.Game.Rulesets.Diva.csproj @@ -13,7 +13,7 @@ - - + + From 5125f31c95eb5b93147651f19a2412cf96244c21 Mon Sep 17 00:00:00 2001 From: Artemis Date: Fri, 26 Jul 2024 21:42:54 +0530 Subject: [PATCH 2/2] fix breaking changes --- .../Objects/Drawables/DrawableDivaJudgement.cs | 18 +++++++++++++++--- .../Objects/Drawables/SkinnableLighting.cs | 9 ++++----- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/osu.Game.Rulesets.Diva/Objects/Drawables/DrawableDivaJudgement.cs b/osu.Game.Rulesets.Diva/Objects/Drawables/DrawableDivaJudgement.cs index c21b3f0..6f9609f 100644 --- a/osu.Game.Rulesets.Diva/Objects/Drawables/DrawableDivaJudgement.cs +++ b/osu.Game.Rulesets.Diva/Objects/Drawables/DrawableDivaJudgement.cs @@ -5,14 +5,17 @@ using osu.Framework.Graphics; using osu.Game.Configuration; using osu.Game.Rulesets.Judgements; +using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Scoring; using osuTK; +using osuTK.Graphics; namespace osu.Game.Rulesets.Diva.Objects.Drawables { - public partial class DrawableDivaJudgement : DrawableJudgement + public partial class DrawableDivaJudgement : DrawableJudgement { internal SkinnableLighting Lighting { get; private set; } + internal Color4 AccentColour { get; private set; } [Resolved] private OsuConfigManager config { get; set; } @@ -30,14 +33,23 @@ private void load() }); } + public override void Apply(JudgementResult result, DrawableHitObject judgedObject) + { + base.Apply(result, judgedObject); + if (judgedObject is not DrawableDivaHitObject drawableDivaHitObject) + return; + + AccentColour = drawableDivaHitObject.AccentColour.Value; + } + protected override void PrepareForUse() { base.PrepareForUse(); Lighting.ResetAnimation(); - Lighting.SetColourFrom(JudgedObject, Result); + Lighting.SetColourFrom(this, Result); - if (JudgedObject?.HitObject is DivaHitObject divaObject) + if (JudgedHitObject is DivaHitObject divaObject) { Position = divaObject.Position; Scale = new Vector2(1); diff --git a/osu.Game.Rulesets.Diva/Objects/Drawables/SkinnableLighting.cs b/osu.Game.Rulesets.Diva/Objects/Drawables/SkinnableLighting.cs index 8a03242..af97d9d 100644 --- a/osu.Game.Rulesets.Diva/Objects/Drawables/SkinnableLighting.cs +++ b/osu.Game.Rulesets.Diva/Objects/Drawables/SkinnableLighting.cs @@ -1,7 +1,6 @@ // Taken from https://github.com/ppy/osu/blob/master/osu.Game.Rulesets.Osu/Objects/Drawables/SkinnableLighting.cs using osu.Game.Rulesets.Judgements; -using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Skinning; using osuTK.Graphics; @@ -9,7 +8,7 @@ namespace osu.Game.Rulesets.Diva.Objects.Drawables { internal partial class SkinnableLighting : SkinnableSprite { - private DrawableHitObject targetObject; + private DrawableDivaJudgement targetObject; private JudgementResult targetResult; public SkinnableLighting() @@ -26,9 +25,9 @@ protected override void SkinChanged(ISkinSource skin) /// /// Updates the lighting colour from a given hitobject and result. /// - /// The that's been judged. + /// The that's been judged. /// The that was judged with. - public void SetColourFrom(DrawableHitObject targetObject, JudgementResult targetResult) + public void SetColourFrom(DrawableDivaJudgement targetObject, JudgementResult targetResult) { this.targetObject = targetObject; this.targetResult = targetResult; @@ -41,7 +40,7 @@ private void updateColour() if (targetObject == null || targetResult == null) Colour = Color4.White; else - Colour = targetResult.IsHit ? targetObject.AccentColour.Value : Color4.Transparent; + Colour = targetResult.IsHit ? targetObject.AccentColour : Color4.Transparent; } } }