Skip to content

Commit

Permalink
update osu version
Browse files Browse the repository at this point in the history
  • Loading branch information
Flutterish committed Sep 26, 2022
1 parent 288a1f3 commit bd56baa
Show file tree
Hide file tree
Showing 26 changed files with 55 additions and 59 deletions.
25 changes: 5 additions & 20 deletions Hitokori/HitokoriRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,13 @@ public override IEnumerable<KeyBinding> GetDefaultKeyBindings ( int variant = 0
};
}

public override string GetDisplayNameForHitResult ( HitResult result ) {
public override LocalisableString GetDisplayNameForHitResult ( HitResult result ) {
return result switch
{
HitResult.Miss => GetLocalisedHack( Localisation.JudgementStrings.Miss ),
HitResult.Great => GetLocalisedHack( Localisation.JudgementStrings.Late ),
HitResult.Ok => GetLocalisedHack( Localisation.JudgementStrings.Early ),
_ => GetLocalisedHack( Localisation.JudgementStrings.Perfect )
HitResult.Miss => Localisation.JudgementStrings.Miss,
HitResult.Great => Localisation.JudgementStrings.Late,
HitResult.Ok => Localisation.JudgementStrings.Early,
_ => Localisation.JudgementStrings.Perfect
};
}

Expand All @@ -144,20 +144,5 @@ protected override IEnumerable<HitResult> GetValidHitResults () {
HitResult.Perfect
};
}

static Dictionary<LocalisableString, ILocalisedBindableString> localisationHack = new();
public static Func<LocalisableString, ILocalisedBindableString> LocalisationHackFactory;
public static string GetLocalisedHack ( LocalisableString str ) {
if ( !localisationHack.TryGetValue( str, out var bindable ) ) {
if ( LocalisationHackFactory is null ) {
return str.ToString();
}
else {
localisationHack.Add( str, bindable = LocalisationHackFactory( str ) );
}
}

return bindable.Value;
}
}
}
3 changes: 2 additions & 1 deletion Hitokori/Mods/HitokoriModAuto.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using osu.Framework.Graphics.Sprites;
using osu.Framework.Localisation;
using osu.Game.Beatmaps;
using osu.Game.Graphics;
using osu.Game.Rulesets.Hitokori.Beatmaps;
Expand All @@ -11,7 +12,7 @@ namespace osu.Game.Rulesets.Hitokori.Mods {
public class HitokoriModAuto : ModAutoplay {
public override string Name => "Auto";
public override string Acronym => "AT";
public override string Description => HitokoriRuleset.GetLocalisedHack( Localisation.ModStrings.AutoplayDescription );
public override LocalisableString Description => Localisation.ModStrings.AutoplayDescription;

public override bool UserPlayable => false;

Expand Down
5 changes: 3 additions & 2 deletions Hitokori/Mods/HitokoriModDaycore.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using osu.Game.Rulesets.Mods;
using osu.Framework.Localisation;
using osu.Game.Rulesets.Mods;

namespace osu.Game.Rulesets.Hitokori.Mods {
public class HitokoriModDaycore : ModDaycore {
public override string Description => HitokoriRuleset.GetLocalisedHack( Localisation.ModStrings.DaycoreDescription );
public override LocalisableString Description => Localisation.ModStrings.DaycoreDescription;

public override double ScoreMultiplier => 0.3;
}
Expand Down
5 changes: 3 additions & 2 deletions Hitokori/Mods/HitokoriModDoubleTime.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using osu.Game.Rulesets.Mods;
using osu.Framework.Localisation;
using osu.Game.Rulesets.Mods;

namespace osu.Game.Rulesets.Hitokori.Mods {
public class HitokoriModDoubleTime : ModDoubleTime {
public override double ScoreMultiplier => 1.12;
public override string Description => HitokoriRuleset.GetLocalisedHack( Localisation.ModStrings.DoubleTimeDescription );
public override LocalisableString Description => Localisation.ModStrings.DoubleTimeDescription;
}
}
5 changes: 3 additions & 2 deletions Hitokori/Mods/HitokoriModEasy.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using osu.Game.Rulesets.Mods;
using osu.Framework.Localisation;
using osu.Game.Rulesets.Mods;

namespace osu.Game.Rulesets.Hitokori.Mods {
public class HitokoriModEasy : ModEasy {
public override string Description => HitokoriRuleset.GetLocalisedHack( Localisation.ModStrings.EasyDescription );
public override LocalisableString Description => Localisation.ModStrings.EasyDescription;
}
}
3 changes: 2 additions & 1 deletion Hitokori/Mods/HitokoriModFlashlight.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Localisation;
using osu.Game.Rulesets.Hitokori.Objects.Base;
using osu.Game.Rulesets.Hitokori.UI;
using osu.Game.Rulesets.Mods;
Expand All @@ -10,7 +11,7 @@
namespace osu.Game.Rulesets.Hitokori.Mods {
public class HitokoriModFlashlight : ModFlashlight<HitokoriHitObject>, IUpdatableByPlayfield {
public override double ScoreMultiplier => 1.12;
public override string Description => HitokoriRuleset.GetLocalisedHack( Localisation.ModStrings.FlashlightDescription );
public override LocalisableString Description => Localisation.ModStrings.FlashlightDescription;

public override bool HasImplementation => true;

Expand Down
5 changes: 3 additions & 2 deletions Hitokori/Mods/HitokoriModHalfTime.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using osu.Game.Rulesets.Mods;
using osu.Framework.Localisation;
using osu.Game.Rulesets.Mods;

namespace osu.Game.Rulesets.Hitokori.Mods {
public class HitokoriModHalfTime : ModHalfTime {
public override double ScoreMultiplier => 0.4;
public override string Description => HitokoriRuleset.GetLocalisedHack( Localisation.ModStrings.HalfTimeDescription );
public override LocalisableString Description => Localisation.ModStrings.HalfTimeDescription;
}
}
3 changes: 2 additions & 1 deletion Hitokori/Mods/HitokoriModHardRock.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using osu.Framework.Graphics.Sprites;
using osu.Framework.Localisation;
using osu.Game.Graphics;
using osu.Game.Rulesets.Hitokori.Beatmaps;
using osu.Game.Rulesets.Mods;
Expand All @@ -10,7 +11,7 @@ public class HitokoriModHardRock : AutoImplementedMod {
public override double ScoreMultiplier => 1.1;
public override string Name => "Hard Rock";
public override string Acronym => "HR";
public override string Description => HitokoriRuleset.GetLocalisedHack( Localisation.ModStrings.HardRockDescription );
public override LocalisableString Description => Localisation.ModStrings.HardRockDescription;

public override Type[] IncompatibleMods => base.IncompatibleMods.Concat( new[] { typeof( ModEasy ), typeof( ModDifficultyAdjust ) } ).ToArray();

Expand Down
3 changes: 2 additions & 1 deletion Hitokori/Mods/HitokoriModHidden.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using osu.Framework.Graphics;
using osu.Framework.Localisation;
using osu.Game.Rulesets.Hitokori.Objects.Drawables.Tiles;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects.Drawables;
Expand All @@ -7,7 +8,7 @@ namespace osu.Game.Rulesets.Hitokori.Mods {
public class HitokoriModHidden : ModHidden {
public override double ScoreMultiplier => 1.10;

public override string Description => HitokoriRuleset.GetLocalisedHack( Localisation.ModStrings.HiddenDescription );
public override LocalisableString Description => Localisation.ModStrings.HiddenDescription;

protected override void ApplyNormalVisibilityState ( DrawableHitObject hitObject, ArmedState state ) {
if ( hitObject is DrawableTilePoint tile ) {
Expand Down
3 changes: 2 additions & 1 deletion Hitokori/Mods/HitokoriModHoldTiles.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using osu.Framework.Graphics.Sprites;
using osu.Framework.Localisation;
using osu.Game.Rulesets.Hitokori.Beatmaps;
using osu.Game.Rulesets.Mods;

namespace osu.Game.Rulesets.Hitokori.Mods {
public class HitokoriModHoldTiles : AutoImplementedMod {
public override string Name => "Hold Tiles";
public override string Acronym => "HDT";
public override string Description => HitokoriRuleset.GetLocalisedHack( Localisation.ModStrings.HoldDescription );
public override LocalisableString Description => Localisation.ModStrings.HoldDescription;

public override double ScoreMultiplier => 1;

Expand Down
5 changes: 3 additions & 2 deletions Hitokori/Mods/HitokoriModNightcore.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using osu.Game.Rulesets.Hitokori.Objects.Base;
using osu.Framework.Localisation;
using osu.Game.Rulesets.Hitokori.Objects.Base;
using osu.Game.Rulesets.Mods;

namespace osu.Game.Rulesets.Hitokori.Mods {
public class HitokoriModNightcore : ModNightcore<HitokoriHitObject> {
public override string Description => HitokoriRuleset.GetLocalisedHack( Localisation.ModStrings.NightcoreDescription );
public override LocalisableString Description => Localisation.ModStrings.NightcoreDescription;

public override double ScoreMultiplier => 1.12;
}
Expand Down
5 changes: 3 additions & 2 deletions Hitokori/Mods/HitokoriModNoFail.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using osu.Game.Rulesets.Mods;
using osu.Framework.Localisation;
using osu.Game.Rulesets.Mods;

namespace osu.Game.Rulesets.Hitokori.Mods {
public class HitokoriModNoFail : ModNoFail {
public override string Description => HitokoriRuleset.GetLocalisedHack( Localisation.ModStrings.NoFailDescription );
public override LocalisableString Description => Localisation.ModStrings.NoFailDescription;
}
}
5 changes: 3 additions & 2 deletions Hitokori/Mods/HitokoriModPerfect.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using osu.Game.Rulesets.Mods;
using osu.Framework.Localisation;
using osu.Game.Rulesets.Mods;

namespace osu.Game.Rulesets.Hitokori.Mods {
public class HitokoriModPerfect : ModPerfect {
public override string Description => HitokoriRuleset.GetLocalisedHack( Localisation.ModStrings.PerfectDescription );
public override LocalisableString Description => Localisation.ModStrings.PerfectDescription;
}
}
3 changes: 2 additions & 1 deletion Hitokori/Mods/HitokoriModReverseSpin.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using osu.Framework.Graphics.Sprites;
using osu.Framework.Localisation;
using osu.Game.Rulesets.Mods;

namespace osu.Game.Rulesets.Hitokori.Mods {
public class HitokoriModReverseSpin : Mod {
public override string Name => "Reverse Spin";
public override string Acronym => "RS";
public override string Description => HitokoriRuleset.GetLocalisedHack( Localisation.ModStrings.ReverseSpinDescription );
public override LocalisableString Description => Localisation.ModStrings.ReverseSpinDescription;

public override double ScoreMultiplier => 1;

Expand Down
3 changes: 2 additions & 1 deletion Hitokori/Mods/HitokoriModSpinTiles.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using osu.Framework.Graphics.Sprites;
using osu.Framework.Localisation;
using osu.Game.Rulesets.Hitokori.Beatmaps;
using osu.Game.Rulesets.Mods;

namespace osu.Game.Rulesets.Hitokori.Mods {
public class HitokoriModSpinTiles : AutoImplementedMod {
public override string Name => "Spin Tiles";
public override string Acronym => "SPT";
public override string Description => HitokoriRuleset.GetLocalisedHack( Localisation.ModStrings.SpinDescription );
public override LocalisableString Description => Localisation.ModStrings.SpinDescription;

public override double ScoreMultiplier => 1;

Expand Down
5 changes: 3 additions & 2 deletions Hitokori/Mods/HitokoriModSuddenDeath.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using osu.Game.Rulesets.Mods;
using osu.Framework.Localisation;
using osu.Game.Rulesets.Mods;

namespace osu.Game.Rulesets.Hitokori.Mods {
public class HitokoriModSuddenDeath : ModSuddenDeath {
public override string Description => HitokoriRuleset.GetLocalisedHack( Localisation.ModStrings.SuddenDeathDescription );
public override LocalisableString Description => Localisation.ModStrings.SuddenDeathDescription;
}
}
3 changes: 2 additions & 1 deletion Hitokori/Mods/HitokoriModTriplets.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using osu.Framework.Graphics.Sprites;
using osu.Framework.Localisation;
using osu.Game.Rulesets.Hitokori.Beatmaps;
using osu.Game.Rulesets.Mods;

namespace osu.Game.Rulesets.Hitokori.Mods {
public class HitokoriModTriplets : AutoImplementedMod {
public override string Name => "Triplets";
public override string Acronym => "TR";
public override string Description => HitokoriRuleset.GetLocalisedHack( Localisation.ModStrings.TripletsDescription );
public override LocalisableString Description => Localisation.ModStrings.TripletsDescription;

public override double ScoreMultiplier => 1;

Expand Down
3 changes: 2 additions & 1 deletion Hitokori/Mods/HitokoriModUntangle.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using osu.Framework.Graphics.Sprites;
using osu.Framework.Localisation;
using osu.Game.Rulesets.Hitokori.Beatmaps;
using osu.Game.Rulesets.Mods;

namespace osu.Game.Rulesets.Hitokori.Mods {
public class HitokoriModUntangle : AutoImplementedMod {
public override string Name => "Untangle";
public override string Acronym => "UN";
public override string Description => HitokoriRuleset.GetLocalisedHack( Localisation.ModStrings.UntangleDescription );
public override LocalisableString Description => Localisation.ModStrings.UntangleDescription;

public override double ScoreMultiplier => 1;

Expand Down
2 changes: 1 addition & 1 deletion Hitokori/Objects/Drawables/Hitokori/StarSparkle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class SparklePool : IDisposable {
public StarSparkle Borrow ( double duration ) {
foreach ( var sparkle in sparkles ) {
if ( !sparkle.IsBorrowed ) {
( sparkle.Parent as Container )?.Remove( sparkle );
( sparkle.Parent as Container )?.Remove( sparkle, false );
sparkle.StartTime = Clock.CurrentTime;
sparkle.Duration = duration;
sparkle.Clock = Clock;
Expand Down
2 changes: 1 addition & 1 deletion Hitokori/Objects/Drawables/TileMarker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void Apply ( TilePoint tile ) {
Circle.Alpha = 0;
}
public void Free () {
RemoveAll( x => x != Circle && x != TargetMarker );
RemoveAll( x => x != Circle && x != TargetMarker, false );
ClearTransforms( true );
Circle.Alpha = 0;
LineToMe = null;
Expand Down
4 changes: 2 additions & 2 deletions Hitokori/Objects/Drawables/Tiles/DrawableHoldTile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ protected override void AddNestedHitObject ( DrawableHitObject hitObject ) {
}

protected override void ClearNestedHitObjects () {
RemoveInternal( StartPoint );
RemoveInternal( EndPoint );
RemoveInternal( StartPoint, false );
RemoveInternal( EndPoint, false );

StartPoint = null;
EndPoint = null;
Expand Down
2 changes: 1 addition & 1 deletion Hitokori/Objects/Drawables/Tiles/DrawableSpinTile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected override void AddNestedHitObject ( DrawableHitObject hitObject ) {

protected override void ClearNestedHitObjects () {
foreach ( var i in Points ) {
RemoveInternal( i );
RemoveInternal( i, false );
}

Points.Clear();
Expand Down
2 changes: 1 addition & 1 deletion Hitokori/Objects/Drawables/Tiles/DrawableTapTile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected override void AddNestedHitObject ( DrawableHitObject hitObject ) {
}

protected override void ClearNestedHitObjects () {
RemoveInternal( PressPoint );
RemoveInternal( PressPoint, false );

PressPoint = null;
}
Expand Down
2 changes: 1 addition & 1 deletion Hitokori/Objects/Drawables/Trails/PathTileConnector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public class PooledPath : Path {
public bool IsBorrowed { get; private set; }
public void Release () {
IsBorrowed = false;
( Parent as Container )?.Remove( this );
( Parent as Container )?.Remove( this, false );
}

public void Borrow () {
Expand Down
6 changes: 0 additions & 6 deletions Hitokori/UI/HitokoriIcon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ public class HitokoriIcon : Container {
private LocalisationManager localisation { get; set; }

public HitokoriIcon () {
if ( HitokoriRuleset.LocalisationHackFactory is null ) {
HitokoriRuleset.LocalisationHackFactory = str => {
return localisation.GetLocalisedBindableString( str );
};
}

this.Center();
RelativeSizeAxes = Axes.Both;

Expand Down
2 changes: 1 addition & 1 deletion Hitokori/osu.Game.Rulesets.Hitokori.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ppy.osu.Game" Version="2022.810.2" />
<PackageReference Include="ppy.osu.Game" Version="2022.923.1" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit bd56baa

Please sign in to comment.