Skip to content

Commit

Permalink
Merge pull request #152 from Artemis-chan/osu-bump
Browse files Browse the repository at this point in the history
Update to osu!
  • Loading branch information
Artemis-chan authored Jul 26, 2024
2 parents 7e50a40 + 5125f31 commit 1e6c6af
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
18 changes: 15 additions & 3 deletions osu.Game.Rulesets.Diva/Objects/Drawables/DrawableDivaJudgement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand All @@ -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);
Expand Down
9 changes: 4 additions & 5 deletions osu.Game.Rulesets.Diva/Objects/Drawables/SkinnableLighting.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
// 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;

namespace osu.Game.Rulesets.Diva.Objects.Drawables
{
internal partial class SkinnableLighting : SkinnableSprite
{
private DrawableHitObject targetObject;
private DrawableDivaJudgement targetObject;
private JudgementResult targetResult;

public SkinnableLighting()
Expand All @@ -26,9 +25,9 @@ protected override void SkinChanged(ISkinSource skin)
/// <summary>
/// Updates the lighting colour from a given hitobject and result.
/// </summary>
/// <param name="targetObject">The <see cref="DrawableHitObject"/> that's been judged.</param>
/// <param name="targetObject">The <see cref="DrawableDivaJudgement"/> that's been judged.</param>
/// <param name="targetResult">The <see cref="JudgementResult"/> that <paramref name="targetObject"/> was judged with.</param>
public void SetColourFrom(DrawableHitObject targetObject, JudgementResult targetResult)
public void SetColourFrom(DrawableDivaJudgement targetObject, JudgementResult targetResult)
{
this.targetObject = targetObject;
this.targetResult = targetResult;
Expand All @@ -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;
}
}
}
4 changes: 2 additions & 2 deletions osu.Game.Rulesets.Diva/osu.Game.Rulesets.Diva.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<Folder Include="Resources\Textures" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Game" Version="2024.521.2" />
<PackageReference Include="ppy.osu.Game.Rulesets.Osu" Version="2024.521.2" />
<PackageReference Include="ppy.osu.Game" Version="2024.726.0" />
<PackageReference Include="ppy.osu.Game.Rulesets.Osu" Version="2024.726.0" />
</ItemGroup>
</Project>

0 comments on commit 1e6c6af

Please sign in to comment.