Skip to content

Commit

Permalink
StandardizeFormat process soflan list
Browse files Browse the repository at this point in the history
  • Loading branch information
MikiraSora committed Dec 25, 2023
1 parent abc9be1 commit 8eb7abe
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion OngekiFumenEditor/Base/Collections/BpmList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public BpmList(IEnumerable<BPMChange> initBpmChanges = default)

private void BpmList_OnChangedEvent()
{
cachedBpmContentHash = int.MinValue;
cachedBpmContentHash = RandomHepler.Random(int.MinValue, int.MaxValue);
}

public void Add(BPMChange bpm)
Expand Down
3 changes: 2 additions & 1 deletion OngekiFumenEditor/Base/Collections/SoflanList.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using OngekiFumenEditor.Base.Collections.Base;
using OngekiFumenEditor.Base.EditorObjects;
using OngekiFumenEditor.Base.OngekiObjects;
using OngekiFumenEditor.Utils;
using System;
using System.Collections;
using System.Collections.Generic;
Expand Down Expand Up @@ -39,7 +40,7 @@ public SoflanList(IEnumerable<ISoflan> initSoflanChanges = default)

private void OnChilidrenSubPropsChangedEvent()
{
cachedSoflanListCacheHash = int.MinValue;
cachedSoflanListCacheHash = RandomHepler.Random(int.MinValue, int.MaxValue);
}

public void Add(ISoflan soflan)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ public double CalculateSpeed(BpmList bpmList, TGrid t)
return soflan.Speed;
}

public IEnumerable<IDurationSoflan> GenerateDurationSoflans(BpmList bpmList)
public IEnumerable<Soflan> GenerateDurationSoflans(BpmList bpmList)
{
var list = GetCachedSoflanPositionList_PreviewMode(bpmList).Select(x => new
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using Gemini.Modules.Toolbox;
using OngekiFumenEditor.Base.EditorObjects;

namespace OngekiFumenEditor.Modules.FumenVisualEditor.ViewModels.OngekiObjects
{
[ToolboxItem(typeof(FumenVisualEditorViewModel), "Interpolatable Soflan", "Misc")]
public class InterpolatableSoflanToolboxGenerator : ToolboxGenerator<InterpolatableSoflan>
{

}
}
using Gemini.Modules.Toolbox;
using OngekiFumenEditor.Base.EditorObjects;

namespace OngekiFumenEditor.Modules.FumenVisualEditor.ViewModels.OngekiObjects
{
[ToolboxItem(typeof(FumenVisualEditorViewModel), "Interpolatable Soflan", "Soflan")]
public class InterpolatableSoflanToolboxGenerator : ToolboxGenerator<InterpolatableSoflan>
{

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace OngekiFumenEditor.Modules.FumenVisualEditor.ViewModels.OngekiObjects
{
[ToolboxItem(typeof(FumenVisualEditorViewModel), "Keyframe Soflan", "Misc")]
[ToolboxItem(typeof(FumenVisualEditorViewModel), "Keyframe Soflan", "Soflan")]
public class KeyframeSoflanToolboxGenerator : ToolboxGenerator<KeyframeSoflan>
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace OngekiFumenEditor.Modules.FumenVisualEditor.ViewModels.OngekiObjects
{
[ToolboxItem(typeof(FumenVisualEditorViewModel), "Soflan", "Lane Control")]
[ToolboxItem(typeof(FumenVisualEditorViewModel), "Duration Soflan", "Soflan")]
public class SoflanToolboxGenerator : ToolboxGenerator<Soflan>
{

Expand Down
5 changes: 2 additions & 3 deletions OngekiFumenEditor/Utils/Ogkr/StandardizeFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,14 @@ public static async Task<ProcessTask> Process(OngekiFumen currentFumen)
{
var fumen = await CopyFumenObject(currentFumen);

var interpolatableSoflans = fumen.Soflans.OfType<InterpolatableSoflan>().ToArray();
var generatedSoflans = interpolatableSoflans.SelectMany(x => x.GenerateKeyframeSoflans()).OfType<OngekiObjectBase>().ToArray();
var generatedSoflans = fumen.Soflans.GenerateDurationSoflans(fumen.BpmList).ToArray();

//directly removes objects which not belong to ongeki.
fumen.SvgPrefabs.Clear();
fumen.Comments.Clear();
//interpolate soflans
fumen.RemoveObjects(fumen.Soflans.OfType<OngekiObjectBase>().ToArray());
fumen.AddObjects(generatedSoflans);
fumen.RemoveObjects(interpolatableSoflans);

if (!CheckFumenIsSerializable(fumen, out var msg))
return new(false) { Message = msg };
Expand Down

0 comments on commit 8eb7abe

Please sign in to comment.