1
0
mirror of synced 2024-11-23 20:10:57 +01:00

fixed notes count

This commit is contained in:
NotImplementedLife 2023-07-17 14:59:33 +03:00
parent ff3c80a572
commit f02044b8ec
2 changed files with 29 additions and 9 deletions

View File

@ -257,10 +257,10 @@ namespace TaikoSoundEditor
ns.WordSub = new Word { Key = $"song_sub_{songName}", JapaneseText = tja.Headers.Subtitle };
ns.WordDetail = new Word { Key = $"song_detail_{songName}", JapaneseText = tja.Headers.TitleJa };
mi.EasyOnpuNum = tja.Courses[0].Converted.Notes.Length;
mi.NormalOnpuNum = tja.Courses[1].Converted.Notes.Length;
mi.HardOnpuNum = tja.Courses[2].Converted.Notes.Length;
mi.ManiaOnpuNum = tja.Courses[3].Converted.Notes.Length;
mi.EasyOnpuNum = tja.Courses[0].NotesCount;
mi.NormalOnpuNum = tja.Courses[1].NotesCount;
mi.HardOnpuNum = tja.Courses[2].NotesCount;
mi.ManiaOnpuNum = tja.Courses[3].NotesCount;
mi.StarEasy = tja.Courses[0].Headers.Level;
mi.StarNormal = tja.Courses[1].Headers.Level;
@ -270,7 +270,7 @@ namespace TaikoSoundEditor
if (tja.Courses.ContainsKey(4))
{
FeedbackBox.AppendText("URA course detected\r\n");
mi.UraOnpuNum = tja.Courses[4].Converted.Notes.Length;
mi.UraOnpuNum = tja.Courses[4].NotesCount;
mi.StarUra = tja.Courses[4].Headers.Level;
ma.CanPlayUra = true;
@ -294,6 +294,8 @@ namespace TaikoSoundEditor
if (ma.CanPlayUra)
{
mi.ShinutiScoreUra = 1002320;
mi.ShinutiScoreUraDuet = 1002320;
mi.ShinutiUra = (mi.ShinutiScoreUra / mi.UraOnpuNum) / 10 * 10;
mi.ShinutiUraDuet = (mi.ShinutiScoreUraDuet / mi.UraOnpuNum) / 10 * 10;
}
@ -349,7 +351,8 @@ namespace TaikoSoundEditor
private void ExportDatatable(string path)
{
var mi = new MusicInfos();
mi.Items.AddRange(MusicInfos.Items);
mi.Items.AddRange(MusicInfos.Items);
mi.Items.AddRange(AddedMusic.Select(_ => _.MusicInfo));
var ma = new MusicAttributes();
ma.Items.AddRange(MusicAttributes.Items);
@ -381,6 +384,7 @@ namespace TaikoSoundEditor
var jwl = Json.Serialize(wl);
jma = jma.Replace("\"new\": true,", "\"new\":true,");
jma = jma.Replace("\"new\": false,", "\"new\":false,");
File.WriteAllText(Path.Combine(path,"musicinfo"), jmi);
File.WriteAllText(Path.Combine(path,"music_attribute"), jma);

22
TJA.cs
View File

@ -338,7 +338,19 @@ namespace TaikoSoundEditor
public override string ToString()
=> $"C({CourseN},{Headers},{string.Join("|",Measures)})";
public ConvertedCourse Converted => ConvertToTimes(this);
public ConvertedCourse Converted => ConvertToTimed(this);
private static readonly List<string> typeNote = new List<string> { "don", "kat", "donBig", "katBig" };
public int NotesCount
{
get
{
Debug.WriteLine(string.Join("", Measures.Select(_ => _.MeasureData)));
return string.Join("", Measures.Select(_ => _.MeasureData)).Where(c => "1234".Contains(c)).Count();
}
//get => Converted.Notes.Where(n => typeNote.Contains(n.Type)).Count();
}
}
public class Measure
@ -449,8 +461,9 @@ namespace TaikoSoundEditor
public override string ToString() => $"{Headers}\n{string.Join("\n", Courses)}";
public static ConvertedCourse ConvertToTimes(Course course)
public static ConvertedCourse ConvertToTimed(Course course)
{
List<TimedEvent> events=new List<TimedEvent>();
List<Note> notes = new List<Note>();
@ -458,6 +471,8 @@ namespace TaikoSoundEditor
int balloon=0;
bool imo = false;
//Debug.WriteLine("-----------------------------------------");
for (int m = 0; m < course.Measures.Count; m++)
{
var measure = course.Measures[m];
@ -471,9 +486,10 @@ namespace TaikoSoundEditor
else if (evt.Name == "gogoStart" || evt.Name == "gogoEnd")
events.Add(new TimedEvent(evt.Name, 0, beat + eBeat));
}
for(int d=0;d<measure.MeasureData.Length;d++)
{
//Debug.WriteLine(measure.MeasureData[d]);
var ch = measure.MeasureData[d];
var nBeat = length / measure.MeasureData.Length * d;