1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 08:33:21 +08:00

Code Quality

This commit is contained in:
Dylan Nantz 2023-01-13 10:16:52 -05:00
parent 5dd0aaccef
commit 6028abff39
2 changed files with 16 additions and 16 deletions

View File

@ -188,7 +188,7 @@ namespace osu.Game.Rulesets.Catch.Edit
if (EditorBeatmap.PlacementObject.Value is JuiceStream) if (EditorBeatmap.PlacementObject.Value is JuiceStream)
{ {
// Juice stream path is not subject to snapping. // Juice stream path is not subject to snapping.
if (BlueprintContainer.currentPlacement.PlacementActive is PlacementBlueprint.PlacementState.Active) if (BlueprintContainer.CurrentPlacement.PlacementActive is PlacementBlueprint.PlacementState.Active)
return null; return null;
} }

View File

@ -36,7 +36,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
protected new EditorSelectionHandler SelectionHandler => (EditorSelectionHandler)base.SelectionHandler; protected new EditorSelectionHandler SelectionHandler => (EditorSelectionHandler)base.SelectionHandler;
public PlacementBlueprint currentPlacement { get; private set; } public PlacementBlueprint CurrentPlacement { get; private set; }
/// <remarks> /// <remarks>
/// Positional input must be received outside the container's bounds, /// Positional input must be received outside the container's bounds,
@ -137,13 +137,13 @@ namespace osu.Game.Screens.Edit.Compose.Components
private void updatePlacementNewCombo() private void updatePlacementNewCombo()
{ {
if (currentPlacement?.HitObject is IHasComboInformation c) if (CurrentPlacement?.HitObject is IHasComboInformation c)
c.NewCombo = NewCombo.Value == TernaryState.True; c.NewCombo = NewCombo.Value == TernaryState.True;
} }
private void updatePlacementSamples() private void updatePlacementSamples()
{ {
if (currentPlacement == null) return; if (CurrentPlacement == null) return;
foreach (var kvp in SelectionHandler.SelectionSampleStates) foreach (var kvp in SelectionHandler.SelectionSampleStates)
sampleChanged(kvp.Key, kvp.Value.Value); sampleChanged(kvp.Key, kvp.Value.Value);
@ -151,9 +151,9 @@ namespace osu.Game.Screens.Edit.Compose.Components
private void sampleChanged(string sampleName, TernaryState state) private void sampleChanged(string sampleName, TernaryState state)
{ {
if (currentPlacement == null) return; if (CurrentPlacement == null) return;
var samples = currentPlacement.HitObject.Samples; var samples = CurrentPlacement.HitObject.Samples;
var existingSample = samples.FirstOrDefault(s => s.Name == sampleName); var existingSample = samples.FirstOrDefault(s => s.Name == sampleName);
@ -225,7 +225,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
// if no time was found from positional snapping, we should still quantize to the beat. // if no time was found from positional snapping, we should still quantize to the beat.
snapResult.Time ??= Beatmap.SnapTime(EditorClock.CurrentTime, null); snapResult.Time ??= Beatmap.SnapTime(EditorClock.CurrentTime, null);
currentPlacement.UpdateTimeAndPosition(snapResult); CurrentPlacement.UpdateTimeAndPosition(snapResult);
} }
#endregion #endregion
@ -234,9 +234,9 @@ namespace osu.Game.Screens.Edit.Compose.Components
{ {
base.Update(); base.Update();
if (currentPlacement != null) if (CurrentPlacement != null)
{ {
switch (currentPlacement.PlacementActive) switch (CurrentPlacement.PlacementActive)
{ {
case PlacementBlueprint.PlacementState.Waiting: case PlacementBlueprint.PlacementState.Waiting:
if (!Composer.CursorInPlacementArea) if (!Composer.CursorInPlacementArea)
@ -252,7 +252,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
if (Composer.CursorInPlacementArea) if (Composer.CursorInPlacementArea)
ensurePlacementCreated(); ensurePlacementCreated();
if (currentPlacement != null) if (CurrentPlacement != null)
updatePlacementPosition(); updatePlacementPosition();
} }
@ -281,13 +281,13 @@ namespace osu.Game.Screens.Edit.Compose.Components
private void ensurePlacementCreated() private void ensurePlacementCreated()
{ {
if (currentPlacement != null) return; if (CurrentPlacement != null) return;
var blueprint = CurrentTool?.CreatePlacementBlueprint(); var blueprint = CurrentTool?.CreatePlacementBlueprint();
if (blueprint != null) if (blueprint != null)
{ {
placementBlueprintContainer.Child = currentPlacement = blueprint; placementBlueprintContainer.Child = CurrentPlacement = blueprint;
// Fixes a 1-frame position discrepancy due to the first mouse move event happening in the next frame // Fixes a 1-frame position discrepancy due to the first mouse move event happening in the next frame
updatePlacementPosition(); updatePlacementPosition();
@ -300,11 +300,11 @@ namespace osu.Game.Screens.Edit.Compose.Components
private void removePlacement() private void removePlacement()
{ {
if (currentPlacement == null) return; if (CurrentPlacement == null) return;
currentPlacement.EndPlacement(false); CurrentPlacement.EndPlacement(false);
currentPlacement.Expire(); CurrentPlacement.Expire();
currentPlacement = null; CurrentPlacement = null;
} }
private HitObjectCompositionTool currentTool; private HitObjectCompositionTool currentTool;