Skip to content

Commit

Permalink
Merge pull request #54 from Altenhh/CircleSize-Fix
Browse files Browse the repository at this point in the history
Fix CircleSize not being affected
  • Loading branch information
naoei committed Apr 7, 2020
2 parents da88d84 + b9aef93 commit 8436fa8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
9 changes: 6 additions & 3 deletions osu.Game.Rulesets.tau/UI/Cursor/tauCursor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ namespace osu.Game.Rulesets.Tau.UI.Cursor
public class TauCursor : CompositeDrawable
{
private readonly IBindable<WorkingBeatmap> beatmap = new Bindable<WorkingBeatmap>();
private readonly BeatmapDifficulty difficulty;

private DefaultCursor defaultCursor;

public TauCursor()
public TauCursor(BeatmapDifficulty difficulty)
{
this.difficulty = difficulty;

Origin = Anchor.Centre;
Anchor = Anchor.Centre;

Expand All @@ -33,7 +36,7 @@ public TauCursor()
[BackgroundDependencyLoader]
private void load(IBindable<WorkingBeatmap> beatmap)
{
InternalChild = defaultCursor = new DefaultCursor(beatmap.Value.BeatmapInfo.BaseDifficulty.CircleSize);
InternalChild = defaultCursor = new DefaultCursor(difficulty.CircleSize);

this.beatmap.BindTo(beatmap);
}
Expand Down Expand Up @@ -158,7 +161,7 @@ public GameplayCursor(float cs)
const double a = 2;
const double b = 7;
const double c = 0.15;
const double d = 0.05;
const double d = 0.0605;

// Thank you AlFas for this code.
double convertValue(double value) => c + (((d - c) * (value - a)) / (b - a));
Expand Down
4 changes: 2 additions & 2 deletions osu.Game.Rulesets.tau/UI/tauDrawableRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public DrawabletauRuleset(TauRuleset ruleset, IBeatmap beatmap, IReadOnlyList<Mo
{
}

protected override Playfield CreatePlayfield() => new TauPlayfield();
protected override Playfield CreatePlayfield() => new TauPlayfield(Beatmap.BeatmapInfo.BaseDifficulty);

protected override ReplayInputHandler CreateReplayInputHandler(Replay replay) => new TauFramedReplayInputHandler(replay);

Expand All @@ -33,7 +33,7 @@ public DrawabletauRuleset(TauRuleset ruleset, IBeatmap beatmap, IReadOnlyList<Mo
protected override PassThroughInputManager CreateInputManager() => new TauInputManager(Ruleset?.RulesetInfo);

public override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new TauPlayfieldAdjustmentContainer();

protected override ReplayRecorder CreateReplayRecorder(Replay replay) => new TauReplayRecorder(replay);
}
}
5 changes: 3 additions & 2 deletions osu.Game.Rulesets.tau/UI/tauPlayfield.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Scoring;
using osu.Framework.Graphics.Shapes;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Tau.Configuration;
using osu.Game.Rulesets.Tau.Objects.Drawables;
using osu.Game.Rulesets.Tau.UI.Cursor;
Expand All @@ -35,9 +36,9 @@ public class TauPlayfield : Playfield
public const float UNIVERSAL_SCALE = 0.6f;
public static readonly Vector2 BASE_SIZE = new Vector2(768, 768);

public TauPlayfield()
public TauPlayfield(BeatmapDifficulty difficulty)
{
cursor = new TauCursor();
cursor = new TauCursor(difficulty);

AddRangeInternal(new Drawable[]
{
Expand Down

0 comments on commit 8436fa8

Please sign in to comment.