Skip to content

Commit ecf34de

Browse files
committed
DrawHitObjectEffectHelper support bells
1 parent 9c55026 commit ecf34de

3 files changed

Lines changed: 39 additions & 17 deletions

File tree

OngekiFumenEditor/Kernel/SettingPages/FumenVisualEditor/Views/FumenVisualEditorGlobalSettingView.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
<CheckBox IsChecked="{Binding Setting.EnableShowPlayerLocation}">
202202
<TextBlock Text="{markup:Translate [EnableShowPlayerLocation]}" TextWrapping="WrapWithOverflow" />
203203
</CheckBox>
204-
<CheckBox IsChecked="{Binding Setting.ShowHitObjectEffectInPreviewMode}">
204+
<CheckBox Margin="0,5,0,0" IsChecked="{Binding Setting.ShowHitObjectEffectInPreviewMode}">
205205
<TextBlock Text="{markup:Translate [ShowHitObjectEffectInPreviewMode]}" TextWrapping="WrapWithOverflow" />
206206
</CheckBox>
207207
</StackPanel>

OngekiFumenEditor/Modules/FumenVisualEditor/Graphics/Drawing/Editors/DrawHitObjectEffectHelper.cs

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,33 +44,57 @@ public void Draw(IFumenEditorDrawingContext target)
4444
minTGrid = TGrid.Zero;
4545
var durationTotalGrid = maxTGrid.TotalGrid - minTGrid.TotalGrid;
4646

47+
var y = (float)target.ConvertToY_DefaultSoflanGroup(maxTGrid);
48+
49+
void drawColorCircle(float progress, Vector2 pos, Vector4 solidColor, float radius)
50+
{
51+
progress = Math.Clamp(progress, 0, 1);
52+
53+
var circleScale = (float)Interpolation.EasingValue(progress, 0, 1, EasingTypes.OutExpo) * radius;
54+
55+
var shortProgress = Interpolation.EasingValue(progress, 0, 0.65, 0, 1);
56+
var soliderCircleAlpha = (float)Interpolation.EasingValue(shortProgress, 1, 0, EasingTypes.In);
57+
58+
var hollowCircleAlpha = (float)Interpolation.EasingValue(progress, 1, 0, EasingTypes.InQuart);
59+
60+
var solderColor = new Vector4(solidColor.X, solidColor.Y, solidColor.Z, soliderCircleAlpha);
61+
var hollowColor = new Vector4(solidColor.X, solidColor.Y, solidColor.Z, hollowCircleAlpha);
62+
63+
circleDrawing.Post(pos, solderColor, true, circleScale);
64+
circleDrawing.Post(pos, hollowColor, false, circleScale, 2);
65+
}
66+
4767
var hitObjects = Enumerable.Empty<OngekiMovableObjectBase>()
4868
.Concat(target.Editor.Fumen.Flicks.BinaryFindRange(minTGrid, maxTGrid))
4969
.Concat(target.Editor.Fumen.Taps.BinaryFindRange(minTGrid, maxTGrid))
5070
.Concat(target.Editor.Fumen.Holds.GetVisibleStartObjects(minTGrid, maxTGrid));
5171

52-
var y = (float)target.ConvertToY_DefaultSoflanGroup(maxTGrid);
53-
5472
circleDrawing.Begin(target);
55-
56-
foreach (var obj in hitObjects)
73+
foreach (var hit in hitObjects)
5774
{
58-
var x = (float)XGridCalculator.ConvertXGridToX(obj.XGrid, target.Editor);
75+
var x = (float)XGridCalculator.ConvertXGridToX(hit.XGrid, target.Editor);
5976
var p = new Vector2(x, y);
6077

61-
var tGrid = obj.TGrid;
78+
var tGrid = hit.TGrid;
6279
var progress = (maxTGrid.TotalGrid * 1.0f - tGrid.TotalGrid) / durationTotalGrid;
63-
progress = Math.Clamp(progress, 0, 1);
6480

65-
var circleScale = (float)Interpolation.EasingValue(progress, 0, 1, EasingTypes.OutExpo) * 20f;
81+
drawColorCircle(progress, p, Vector4.One, 20);
82+
}
83+
circleDrawing.End();
6684

67-
var shortProgress = Interpolation.EasingValue(progress, 0, 0.65, 0, 1);
68-
var soliderCircleAlpha = (float)Interpolation.EasingValue(shortProgress, 1, 0, EasingTypes.In);
6985

70-
var hollowCircleAlpha = (float)Interpolation.EasingValue(progress, 1, 0, EasingTypes.InQuart);
86+
var bellObjects = target.Editor.Fumen.Bells.BinaryFindRange(minTGrid, maxTGrid);
87+
88+
circleDrawing.Begin(target);
89+
foreach (var bell in bellObjects)
90+
{
91+
var x = (float)XGridCalculator.ConvertXGridToX(bell.XGrid, target.Editor);
92+
var p = new Vector2(x, y);
93+
94+
var tGrid = bell.TGrid;
95+
var progress = (maxTGrid.TotalGrid * 1.0f - tGrid.TotalGrid) / durationTotalGrid;
7196

72-
circleDrawing.Post(p, new(1, 1, 1, soliderCircleAlpha), true, circleScale);
73-
circleDrawing.Post(p, new(1, 1, 1, hollowCircleAlpha), false, circleScale, 2);
97+
drawColorCircle(progress, p, new(1, 1, 0, 0), 15);
7498
}
7599
circleDrawing.End();
76100
}

OngekiFumenEditor/OngekiFumenEditor.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@
5050
<PropertyGroup Condition="'$(Configuration)'=='Release'">
5151
<DebugType>none</DebugType>
5252
</PropertyGroup>
53-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
54-
<DefineConstants>$(DefineConstants);PLAYFIELD_DEBUG</DefineConstants>
55-
</PropertyGroup>
53+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'" />
5654

5755
<ItemGroup>
5856
<Compile Remove="Dependencies\**" />

0 commit comments

Comments
 (0)