mirror of
https://github.com/ppy/osu-tools.git
synced 2025-06-10 01:50:46 +09:00
Merge pull request #206 from stanriders/fix-object-inspectors
Fix GUI object inspectors, update packages
This commit is contained in:
commit
179c0bda1c
9 changed files with 20 additions and 49 deletions
|
@ -97,7 +97,7 @@ namespace PerformanceCalculatorGUI.Components
|
||||||
{
|
{
|
||||||
graphsContainer.Clear();
|
graphsContainer.Clear();
|
||||||
|
|
||||||
var skills = val.NewValue.Where(x => x is StrainSkill).ToArray();
|
var skills = val.NewValue.Where(x => x is StrainSkill or StrainDecaySkill).ToArray();
|
||||||
|
|
||||||
// dont bother if there are no strain skills to draw
|
// dont bother if there are no strain skills to draw
|
||||||
if (skills.Length == 0)
|
if (skills.Length == 0)
|
||||||
|
|
|
@ -101,7 +101,7 @@ namespace PerformanceCalculatorGUI.Components.TextBoxes
|
||||||
OnFocused?.Invoke();
|
OnFocused?.Invoke();
|
||||||
base.OnFocus(e);
|
base.OnFocus(e);
|
||||||
|
|
||||||
GetContainingInputManager().TriggerFocusContention(this);
|
GetContainingFocusManager()?.TriggerFocusContention(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Extensions;
|
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
|
|
||||||
namespace PerformanceCalculatorGUI.Components.TextBoxes
|
namespace PerformanceCalculatorGUI.Components.TextBoxes
|
||||||
|
@ -14,7 +13,7 @@ namespace PerformanceCalculatorGUI.Components.TextBoxes
|
||||||
{
|
{
|
||||||
protected override bool AllowIme => false;
|
protected override bool AllowIme => false;
|
||||||
|
|
||||||
protected override bool CanAddCharacter(char character) => character.IsAsciiDigit() || character == CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator[0];
|
protected override bool CanAddCharacter(char character) => char.IsAsciiDigit(character) || character == CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator[0];
|
||||||
|
|
||||||
protected override void OnUserTextAdded(string added)
|
protected override void OnUserTextAdded(string added)
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,10 +6,10 @@
|
||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>latest</LangVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="ppy.osu.Game" Version="2024.130.2" />
|
<PackageReference Include="ppy.osu.Game" Version="2024.625.2" />
|
||||||
<PackageReference Include="ppy.osu.Game.Rulesets.Osu" Version="2024.130.2" />
|
<PackageReference Include="ppy.osu.Game.Rulesets.Osu" Version="2024.625.2" />
|
||||||
<PackageReference Include="ppy.osu.Game.Rulesets.Taiko" Version="2024.130.2" />
|
<PackageReference Include="ppy.osu.Game.Rulesets.Taiko" Version="2024.625.2" />
|
||||||
<PackageReference Include="ppy.osu.Game.Rulesets.Catch" Version="2024.130.2" />
|
<PackageReference Include="ppy.osu.Game.Rulesets.Catch" Version="2024.625.2" />
|
||||||
<PackageReference Include="ppy.osu.Game.Rulesets.Mania" Version="2024.130.2" />
|
<PackageReference Include="ppy.osu.Game.Rulesets.Mania" Version="2024.625.2" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -4,21 +4,15 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
|
||||||
using osu.Framework.Graphics.Containers;
|
|
||||||
using osu.Framework.Graphics.Shapes;
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics;
|
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Rulesets.Catch.Difficulty.Preprocessing;
|
using osu.Game.Rulesets.Catch.Difficulty.Preprocessing;
|
||||||
using osu.Game.Rulesets.Catch.Edit;
|
using osu.Game.Rulesets.Catch.Edit;
|
||||||
using osu.Game.Rulesets.Catch.UI;
|
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.UI;
|
|
||||||
|
|
||||||
namespace PerformanceCalculatorGUI.Screens.ObjectInspection
|
namespace PerformanceCalculatorGUI.Screens.ObjectInspection
|
||||||
{
|
{
|
||||||
public partial class CatchObjectInspectorRuleset : DrawableCatchRuleset
|
public partial class CatchObjectInspectorRuleset : DrawableCatchEditorRuleset
|
||||||
{
|
{
|
||||||
private readonly CatchDifficultyHitObject[] difficultyHitObjects;
|
private readonly CatchDifficultyHitObject[] difficultyHitObjects;
|
||||||
|
|
||||||
|
@ -36,36 +30,12 @@ namespace PerformanceCalculatorGUI.Screens.ObjectInspection
|
||||||
|
|
||||||
public override bool PropagateNonPositionalInputSubTree => false;
|
public override bool PropagateNonPositionalInputSubTree => false;
|
||||||
|
|
||||||
protected override Playfield CreatePlayfield() => new CatchObjectInspectorPlayfield(Beatmap.Difficulty);
|
public override bool AllowBackwardsSeeks => true;
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
objectDifficultyValuesContainer.CurrentDifficultyHitObject.Value = difficultyHitObjects.LastOrDefault(x => x.StartTime < Clock.CurrentTime);
|
objectDifficultyValuesContainer.CurrentDifficultyHitObject.Value = difficultyHitObjects.LastOrDefault(x => x.StartTime < Clock.CurrentTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
private partial class CatchObjectInspectorPlayfield : CatchEditorPlayfield
|
|
||||||
{
|
|
||||||
protected override GameplayCursorContainer CreateCursor() => null!;
|
|
||||||
|
|
||||||
public CatchObjectInspectorPlayfield(IBeatmapDifficultyInfo difficulty)
|
|
||||||
: base(difficulty)
|
|
||||||
{
|
|
||||||
DisplayJudgements.Value = false;
|
|
||||||
AddInternal(new Container
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
Y = 440,
|
|
||||||
Height = 6.0f,
|
|
||||||
CornerRadius = 4.0f,
|
|
||||||
Masking = true,
|
|
||||||
Child = new Box
|
|
||||||
{
|
|
||||||
Colour = OsuColour.Gray(0.5f),
|
|
||||||
RelativeSizeAxes = Axes.Both
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@ using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Utils;
|
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
using osu.Game.Rulesets.Catch.Difficulty.Preprocessing;
|
using osu.Game.Rulesets.Catch.Difficulty.Preprocessing;
|
||||||
|
@ -132,7 +131,7 @@ namespace PerformanceCalculatorGUI.Screens.ObjectInspection
|
||||||
});
|
});
|
||||||
|
|
||||||
if (hitObject.Angle is not null)
|
if (hitObject.Angle is not null)
|
||||||
flowContainer.Add(new ObjectInspectorDifficultyValue("Angle", MathUtils.RadiansToDegrees(hitObject.Angle.Value)));
|
flowContainer.Add(new ObjectInspectorDifficultyValue("Angle", double.RadiansToDegrees(hitObject.Angle.Value)));
|
||||||
|
|
||||||
if (hitObject.BaseObject is Slider)
|
if (hitObject.BaseObject is Slider)
|
||||||
{
|
{
|
||||||
|
|
|
@ -178,7 +178,6 @@ namespace PerformanceCalculatorGUI.Screens.ObjectInspection
|
||||||
},
|
},
|
||||||
"taiko" => new TaikoPlayfieldAdjustmentContainer
|
"taiko" => new TaikoPlayfieldAdjustmentContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Child = new TaikoObjectInspectorRuleset(rulesetInstance, playableBeatmap, modifiedMods, difficultyCalculator.Value as ExtendedTaikoDifficultyCalculator,
|
Child = new TaikoObjectInspectorRuleset(rulesetInstance, playableBeatmap, modifiedMods, difficultyCalculator.Value as ExtendedTaikoDifficultyCalculator,
|
||||||
processorBeatmap.Track.Rate)
|
processorBeatmap.Track.Rate)
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,13 +10,14 @@ using osu.Game.Rulesets;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Osu.Difficulty.Preprocessing;
|
using osu.Game.Rulesets.Osu.Difficulty.Preprocessing;
|
||||||
|
using osu.Game.Rulesets.Osu.Edit;
|
||||||
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Osu.UI;
|
using osu.Game.Rulesets.Osu.UI;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
|
|
||||||
namespace PerformanceCalculatorGUI.Screens.ObjectInspection
|
namespace PerformanceCalculatorGUI.Screens.ObjectInspection
|
||||||
{
|
{
|
||||||
public partial class OsuObjectInspectorRuleset : DrawableOsuRuleset
|
public partial class OsuObjectInspectorRuleset : DrawableOsuEditorRuleset
|
||||||
{
|
{
|
||||||
private readonly OsuDifficultyHitObject[] difficultyHitObjects;
|
private readonly OsuDifficultyHitObject[] difficultyHitObjects;
|
||||||
|
|
||||||
|
@ -39,6 +40,8 @@ namespace PerformanceCalculatorGUI.Screens.ObjectInspection
|
||||||
|
|
||||||
public override bool PropagateNonPositionalInputSubTree => false;
|
public override bool PropagateNonPositionalInputSubTree => false;
|
||||||
|
|
||||||
|
public override bool AllowBackwardsSeeks => true;
|
||||||
|
|
||||||
protected override Playfield CreatePlayfield() => new OsuObjectInspectorPlayfield(difficultyHitObjects);
|
protected override Playfield CreatePlayfield() => new OsuObjectInspectorPlayfield(difficultyHitObjects);
|
||||||
|
|
||||||
private partial class OsuObjectInspectorPlayfield : OsuPlayfield
|
private partial class OsuObjectInspectorPlayfield : OsuPlayfield
|
||||||
|
@ -55,14 +58,12 @@ namespace PerformanceCalculatorGUI.Screens.ObjectInspection
|
||||||
|
|
||||||
protected override void OnNewDrawableHitObject(DrawableHitObject d)
|
protected override void OnNewDrawableHitObject(DrawableHitObject d)
|
||||||
{
|
{
|
||||||
|
base.OnNewDrawableHitObject(d);
|
||||||
d.ApplyCustomUpdateState += updateState;
|
d.ApplyCustomUpdateState += updateState;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateState(DrawableHitObject hitObject, ArmedState state)
|
private void updateState(DrawableHitObject hitObject, ArmedState state)
|
||||||
{
|
{
|
||||||
if (state == ArmedState.Idle)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (hitObject is DrawableSliderRepeat repeat)
|
if (hitObject is DrawableSliderRepeat repeat)
|
||||||
{
|
{
|
||||||
repeat.Arrow.ApplyTransformsAt(hitObject.StateUpdateTime, true);
|
repeat.Arrow.ApplyTransformsAt(hitObject.StateUpdateTime, true);
|
||||||
|
|
|
@ -8,12 +8,13 @@ using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Taiko.Difficulty.Preprocessing;
|
using osu.Game.Rulesets.Taiko.Difficulty.Preprocessing;
|
||||||
|
using osu.Game.Rulesets.Taiko.Edit;
|
||||||
using osu.Game.Rulesets.Taiko.UI;
|
using osu.Game.Rulesets.Taiko.UI;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
|
|
||||||
namespace PerformanceCalculatorGUI.Screens.ObjectInspection
|
namespace PerformanceCalculatorGUI.Screens.ObjectInspection
|
||||||
{
|
{
|
||||||
public partial class TaikoObjectInspectorRuleset : DrawableTaikoRuleset
|
public partial class TaikoObjectInspectorRuleset : DrawableTaikoEditorRuleset
|
||||||
{
|
{
|
||||||
private readonly TaikoDifficultyHitObject[] difficultyHitObjects;
|
private readonly TaikoDifficultyHitObject[] difficultyHitObjects;
|
||||||
|
|
||||||
|
@ -31,6 +32,8 @@ namespace PerformanceCalculatorGUI.Screens.ObjectInspection
|
||||||
|
|
||||||
public override bool PropagateNonPositionalInputSubTree => false;
|
public override bool PropagateNonPositionalInputSubTree => false;
|
||||||
|
|
||||||
|
public override bool AllowBackwardsSeeks => true;
|
||||||
|
|
||||||
protected override Playfield CreatePlayfield() => new TaikoObjectInspectorPlayfield();
|
protected override Playfield CreatePlayfield() => new TaikoObjectInspectorPlayfield();
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue