Skip to content

Commit a1ee819

Browse files
committed
Merge branch 'master' of https://github.com/zacharied/OngekiFumenEditor into soflan_group
# Conflicts: # OngekiFumenEditor/Parser/Ogkr/DefaultOngekiFumenFormatter.cs # OngekiFumenEditor/Properties/Resources.resx
2 parents 509c971 + 9401838 commit a1ee819

6 files changed

Lines changed: 73 additions & 25 deletions

File tree

OngekiFumenEditor/Base/OngekiObjects/LaneBlockArea.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,12 @@ public BlockDirection Direction
8989
var blockStartTGrid = TGrid;
9090
var blockEndTGrid = EndIndicator.TGrid;
9191

92-
var startWallLane = fumen.Lanes.Where(x => x.LaneType == wallType).LastOrDefault(x => x.TGrid <= blockStartTGrid);
93-
var endWallLane = fumen.Lanes.Where(x => x.LaneType == wallType).LastOrDefault(x => x.TGrid <= blockEndTGrid);
92+
var lanes = fumen.Lanes.Where(x => x.LaneType == wallType).OrderBy(x => x.TGrid).ToList();
93+
94+
var startWallLane = lanes.LastOrDefault(x => x.TGrid <= blockStartTGrid);
95+
var endWallLane = startWallLane != null && startWallLane.GetTGridRange().Max >= blockEndTGrid
96+
? startWallLane
97+
: lanes.LastOrDefault(x => x.TGrid <= blockEndTGrid);
9498

9599
return (startWallLane, endWallLane);
96100
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using System.Collections.Generic;
2+
using System.ComponentModel.Composition;
3+
using OngekiFumenEditor.Base;
4+
using OngekiFumenEditor.Modules.FumenCheckerListViewer.Base.DefaultNavigateBehaviorImpl;
5+
using OngekiFumenEditor.Modules.FumenVisualEditor.ViewModels;
6+
using OngekiFumenEditor.Properties;
7+
using OngekiFumenEditor.Utils;
8+
9+
namespace OngekiFumenEditor.Modules.FumenCheckerListViewer.Base.DefaultRulesImpl;
10+
11+
[Export(typeof(IFumenCheckRule))]
12+
public class LaneBlockOnMultipleWallsCheckRule : IFumenCheckRule
13+
{
14+
private const string RuleName = "LaneBlockAcrossWalls";
15+
16+
public IEnumerable<ICheckResult> CheckRule(OngekiFumen fumen, FumenVisualEditorViewModel fumenHostEditor)
17+
{
18+
foreach (var laneBlock in fumen.LaneBlocks) {
19+
var (refLaneStart, refLaneEnd) = laneBlock.CalculateReferenceWallLanes(fumen);
20+
if (refLaneStart != refLaneEnd) {
21+
yield return new CommonCheckResult()
22+
{
23+
Severity = RuleSeverity.Problem,
24+
Description = Resources.LaneBlockOnMultipleWalls.Format(refLaneStart?.RecordId, refLaneEnd?.RecordId),
25+
LocationDescription = laneBlock.TGrid.ToString(),
26+
NavigateBehavior = new NavigateToTGridBehavior(refLaneEnd?.ReferenceStartObject.TGrid),
27+
RuleName = RuleName
28+
};
29+
}
30+
}
31+
}
32+
}

OngekiFumenEditor/Modules/OptionGeneratorTools/Kernel/AcbGeneratorFuckWrapper.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
using OngekiFumenEditor.Modules.OptionGeneratorTools.Base;
2-
using OngekiFumenEditor.Modules.OptionGeneratorTools.Models;
3-
using OngekiFumenEditor.Properties;
4-
using OngekiFumenEditor.Utils;
5-
using System;
6-
using System.IO;
7-
using System.Text;
8-
using System.Threading.Tasks;
1+
using OngekiFumenEditor.Modules.OptionGeneratorTools.Base;
2+
using OngekiFumenEditor.Modules.OptionGeneratorTools.Models;
3+
using OngekiFumenEditor.Properties;
4+
using OngekiFumenEditor.Utils;
5+
using System;
6+
using System.IO;
7+
using System.Text;
8+
using System.Threading.Tasks;
99
using System.Xml;
1010
using System.Xml.Linq;
1111
using System.Xml.XPath;
1212

13-
namespace OngekiFumenEditor.Modules.OptionGeneratorTools.Kernel
13+
namespace OngekiFumenEditor.Modules.OptionGeneratorTools.Kernel
1414
{
1515
public static class AcbGeneratorFuckWrapper
1616
{
@@ -19,7 +19,7 @@ public static async Task<GenerateResult> Generate(AcbGenerateOption option)
1919
if (!File.Exists(option.InputAudioFilePath))
2020
return new(false, Resources.ConvertAudioFileNotFound);
2121

22-
if (option.MusicId < 0 || option.MusicId > 9999)
22+
if (option.MusicId < 0)
2323
return new(false, Resources.MusicIDInvaild.Format(option.MusicId));
2424

2525
if (string.IsNullOrWhiteSpace(option.OutputFolderPath))
@@ -94,5 +94,5 @@ private static async Task<GenerateResult> GenerateMusicSourceXmlAsync(string tem
9494

9595
return new(true);
9696
}
97-
}
98-
}
97+
}
98+
}

OngekiFumenEditor/Parser/Ogkr/DefaultOngekiFumenFormatter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public void ProcessHEADER(OngekiFumen fumen, StringBuilder sb)
164164

165165
sb.AppendLine("[HEADER]");
166166
//sb.AppendLine($"VERSION\t{metaInfo.Version.Major}\t{metaInfo.Version.Minor}\t{metaInfo.Version.Build}");
167-
sb.AppendLine($"VERSION\t{1}\t{6}\t{0}");
167+
sb.AppendLine($"VERSION\t{1}\t{7}\t{0}");
168168
sb.AppendLine($"CREATOR\t{metaInfo.Creator}");
169169
sb.AppendLine($"BPM_DEF\t{metaInfo.BpmDefinition.First}\t{metaInfo.BpmDefinition.Common}\t{metaInfo.BpmDefinition.Maximum}\t{metaInfo.BpmDefinition.Minimum}");
170170
sb.AppendLine($"MET_DEF\t{metaInfo.MeterDefinition.Bunshi}\t{metaInfo.MeterDefinition.Bunbo}");

OngekiFumenEditor/Properties/Resources.Designer.cs

Lines changed: 19 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

OngekiFumenEditor/Properties/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2025,4 +2025,7 @@
20252025
<data name="HideWallLaneWhenEnablePlayField" xml:space="preserve">
20262026
<value>Hide all wall lanes when play field drawing is enable in preview mode</value>
20272027
</data>
2028+
<data name="LaneBlockOnMultipleWalls" xml:space="preserve">
2029+
<value>Lane block start wall ({0}) is different than end wall ({1})</value>
2030+
</data>
20282031
</root>

0 commit comments

Comments
 (0)