Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f101b2b1f8 | ||
|
|
c37b538b33 |
@@ -7,9 +7,9 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>$(VersionPrefix)2.1.7</Version>
|
||||
<Version>$(VersionPrefix)2.0.0</Version>
|
||||
<AssemblyVersion>1.0.0.0</AssemblyVersion>
|
||||
<FileVersion>2.1.7</FileVersion>
|
||||
<FileVersion>2.0.0</FileVersion>
|
||||
<Company>Goatgarien</Company>
|
||||
<Copyright>2022</Copyright>
|
||||
<StartupObject>BAKKA_Editor.Program</StartupObject>
|
||||
|
||||
+5
-12
@@ -80,9 +80,6 @@ namespace BAKKA_Editor
|
||||
Dictionary<int, int> refByLine = new();
|
||||
for (int i = index; i < file.Length; i++)
|
||||
{
|
||||
if (String.IsNullOrWhiteSpace(file[i]))
|
||||
continue;
|
||||
|
||||
var parsed = file[i].Split(new string[] {" "}, StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
||||
NoteBase temp = new();
|
||||
temp.BeatInfo = new BeatInfo(Convert.ToInt32(parsed[0]), Convert.ToInt32(parsed[1]));
|
||||
@@ -257,14 +254,10 @@ namespace BAKKA_Editor
|
||||
TimeEvents[0].StartTime = Offset * 1000.0;
|
||||
for (int i = 1; i < TimeEvents.Count; i++)
|
||||
{
|
||||
TimeEvents[i].StartTime = ((TimeEvents[i].Measure - TimeEvents[i - 1].Measure) * (4.0f * TimeEvents[i - 1].TimeSig.Ratio * (60000.0 / TimeEvents[i - 1].BPM))) + TimeEvents[i - 1].StartTime;
|
||||
TimeEvents[i].StartTime = ((TimeEvents[i].Measure - TimeEvents[i - 1].Measure) * 4 * TimeEvents[i - 1].TimeSig.Ratio * 60000.0 / TimeEvents[i].BPM) + TimeEvents[i - 1].StartTime;
|
||||
}
|
||||
}
|
||||
/*
|
||||
((60000.0 / evt.BPM) * 4.0 * evt.TimeSig.Ratio) * measure = time
|
||||
time / ((60000.0 / evt.BPM) * 4.0 * evt.TimeSig.Ratio) = measure
|
||||
*/
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Translate clock time to beats
|
||||
/// </summary>
|
||||
@@ -278,7 +271,7 @@ namespace BAKKA_Editor
|
||||
var evt = TimeEvents.Where(x => time >= x.StartTime).LastOrDefault();
|
||||
if (evt == null)
|
||||
evt = TimeEvents[0];
|
||||
return new BeatInfo((float)((time - evt.StartTime) / ((60000.0 / evt.BPM) * 4.0f * evt.TimeSig.Ratio) + evt.Measure));
|
||||
return new BeatInfo((float)(evt.BPM * (time - evt.StartTime) / (60000.0f * evt.TimeSig.Ratio * 4)) + evt.Measure);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -294,7 +287,7 @@ namespace BAKKA_Editor
|
||||
var evt = TimeEvents.Where(x => beat.MeasureDecimal >= x.Measure).LastOrDefault();
|
||||
if (evt == null)
|
||||
evt = TimeEvents[0];
|
||||
return (int)(((60000.0 / evt.BPM) * 4.0f * evt.TimeSig.Ratio) * (beat.MeasureDecimal - evt.Measure) + evt.StartTime);
|
||||
return (int)((60000.0 * 4.0 * evt.TimeSig.Ratio / evt.BPM) * (beat.MeasureDecimal - evt.Measure) + evt.StartTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+32
-150
@@ -4,8 +4,6 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Threading.Tasks;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace BAKKA_Editor
|
||||
{
|
||||
@@ -17,7 +15,10 @@ namespace BAKKA_Editor
|
||||
public PointF CenterPoint { get; private set; }
|
||||
public float Radius { get; private set; }
|
||||
public float CurrentMeasure { get; set; }
|
||||
public float Hispeed { get; set; } = 1.5f;
|
||||
/// <summary>
|
||||
/// Number of measures in the future that are visible
|
||||
/// </summary>
|
||||
public float TotalMeasureShowNotes { get; set; } = 0.5f;
|
||||
|
||||
// Pens and Brushes
|
||||
public Pen BasePen { get; set; }
|
||||
@@ -25,8 +26,6 @@ namespace BAKKA_Editor
|
||||
public Pen TickMinorPen { get; set; }
|
||||
public Pen TickMediumPen { get; set; }
|
||||
public Pen TickMajorPen { get; set; }
|
||||
public SolidBrush HoldBrush { get; set; } = new SolidBrush(Color.FromArgb(170, Color.Yellow));
|
||||
public SolidBrush MaskBrush { get; set; } = new SolidBrush(Color.FromArgb(90, Color.Black));
|
||||
public SolidBrush BackgroundBrush { get; set; }
|
||||
public Pen HighlightPen { get; set; }
|
||||
public Pen FlairPen { get; set; }
|
||||
@@ -73,103 +72,11 @@ namespace BAKKA_Editor
|
||||
FlairPen = new Pen(Color.FromArgb(FlairTransparency, Color.Yellow), PanelSize.Width * 8.0f / 600.0f);
|
||||
}
|
||||
|
||||
private float GetTotalMeasureShowNotes(Chart chart)
|
||||
{
|
||||
//Convert hispeed to frames
|
||||
float displayFrames = 73.0f - ((Hispeed - 1.5f) * 10.0f);
|
||||
//Account for hispeed gimmick
|
||||
List<Gimmick> HispeedChanges = new List<Gimmick>();
|
||||
Gimmick InitialSpeed = chart.Gimmicks.Where(x => x.GimmickType == GimmickType.HiSpeedChange && CurrentMeasure > x.Measure).LastOrDefault();
|
||||
//Add initial hispeed to list
|
||||
if (InitialSpeed == null)
|
||||
{
|
||||
InitialSpeed = new Gimmick();
|
||||
InitialSpeed.HiSpeed = 1.0;
|
||||
}
|
||||
HispeedChanges.Add(InitialSpeed);
|
||||
//add all hispeed changes to list that happen within the current total time to show notes
|
||||
float tempTotalTime = ((displayFrames / 60.0f) * 1000.0f);
|
||||
float currentTime = chart.GetTime(new BeatInfo(CurrentMeasure));
|
||||
float tempEndTime = currentTime + tempTotalTime;
|
||||
HispeedChanges.AddRange(chart.Gimmicks.Where(
|
||||
x => x.Measure >= CurrentMeasure
|
||||
&& chart.GetTime(new BeatInfo(x.Measure)) < tempEndTime
|
||||
&& x.GimmickType == GimmickType.HiSpeedChange).ToList());
|
||||
if (HispeedChanges.Count > 1)
|
||||
{
|
||||
for (int i = 0; i < HispeedChanges.Count; i++)
|
||||
{
|
||||
float timeDiff;
|
||||
float itemTime;
|
||||
float modifiedTime;
|
||||
if (chart.GetTime(HispeedChanges[i].BeatInfo) <= (tempTotalTime + currentTime))
|
||||
{
|
||||
if (i == 0)
|
||||
itemTime = currentTime;
|
||||
else
|
||||
itemTime = chart.GetTime(HispeedChanges[i].BeatInfo);
|
||||
if (i != HispeedChanges.Count - 1)
|
||||
{
|
||||
float tempTestITimeDiff = (currentTime + tempTotalTime) - itemTime;
|
||||
float tempTestIModifiedTime = (tempTestITimeDiff) / (float)(HispeedChanges[i].HiSpeed);
|
||||
if ((currentTime + tempTotalTime - tempTestITimeDiff + tempTestIModifiedTime) < chart.GetTime(HispeedChanges[i + 1].BeatInfo))
|
||||
{
|
||||
timeDiff = (currentTime + tempTotalTime) - itemTime;
|
||||
modifiedTime = timeDiff / (float)HispeedChanges[i].HiSpeed;
|
||||
}
|
||||
else
|
||||
{
|
||||
timeDiff = chart.GetTime(HispeedChanges[i + 1].BeatInfo) - itemTime;
|
||||
modifiedTime = timeDiff / (float)HispeedChanges[i].HiSpeed;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
timeDiff = (currentTime + tempTotalTime) - itemTime;
|
||||
modifiedTime = timeDiff / (float)HispeedChanges[i].HiSpeed;
|
||||
}
|
||||
tempTotalTime = tempTotalTime - timeDiff + modifiedTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
tempTotalTime /= (float)HispeedChanges[0].HiSpeed;
|
||||
}
|
||||
//convert total time to total measure
|
||||
tempEndTime = currentTime + tempTotalTime;
|
||||
BeatInfo EndMeasure = chart.GetBeat(tempEndTime);
|
||||
return EndMeasure.MeasureDecimal - CurrentMeasure;
|
||||
}
|
||||
|
||||
private float GetNoteScaleFromMeasure(Chart chart, float objectTime)
|
||||
{
|
||||
// Scale from 0-1
|
||||
float objectTimeAsTime = chart.GetTime(new BeatInfo(objectTime));
|
||||
float currentTime = chart.GetTime(new BeatInfo(CurrentMeasure));
|
||||
float EndTimeShowNotes = chart.GetTime(new BeatInfo(CurrentMeasure + GetTotalMeasureShowNotes(chart)));
|
||||
float notescaleInit;
|
||||
var LatestHispeedChange = chart.Gimmicks.Where(x => x.GimmickType == GimmickType.HiSpeedChange && CurrentMeasure >= x.Measure).LastOrDefault();
|
||||
if (LatestHispeedChange != null && LatestHispeedChange.HiSpeed < 0.0)
|
||||
{
|
||||
//Reverse
|
||||
notescaleInit = (objectTimeAsTime - currentTime) / (EndTimeShowNotes - currentTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Normal
|
||||
notescaleInit = 1 - ((objectTimeAsTime - currentTime) / (EndTimeShowNotes - currentTime));
|
||||
}
|
||||
//Scale math
|
||||
notescaleInit = 0.001f + (float)Math.Pow(notescaleInit, 3.0f) - (0.501f * (float)Math.Pow(notescaleInit, 2.0f)) + (0.5f * notescaleInit);
|
||||
return notescaleInit;
|
||||
}
|
||||
|
||||
private ArcInfo GetScaledRect(Chart chart, float objectTime)
|
||||
private ArcInfo GetScaledRect(float objectTime)
|
||||
{
|
||||
ArcInfo info = new();
|
||||
|
||||
info.NoteScale = GetNoteScaleFromMeasure(chart, objectTime);
|
||||
float notescaleInit = 1 - ((objectTime - CurrentMeasure) * (1 / TotalMeasureShowNotes)); // Scale from 0-1
|
||||
info.NoteScale = (float)Math.Pow(10.0f, notescaleInit) / 10.0f;
|
||||
float scaledRectSize = DrawRect.Width * info.NoteScale;
|
||||
float scaledRadius = scaledRectSize / 2.0f;
|
||||
info.Rect = new RectangleF(
|
||||
@@ -180,9 +87,9 @@ namespace BAKKA_Editor
|
||||
return info;
|
||||
}
|
||||
|
||||
private ArcInfo GetArcInfo(Chart chart, Note note)
|
||||
private ArcInfo GetArcInfo(Note note)
|
||||
{
|
||||
ArcInfo info = GetScaledRect(chart, note.Measure);
|
||||
ArcInfo info = GetScaledRect(note.Measure);
|
||||
info.StartAngle = -note.Position * 6;
|
||||
info.ArcLength = -note.Size * 6;
|
||||
if(info.ArcLength != -360)
|
||||
@@ -273,7 +180,7 @@ namespace BAKKA_Editor
|
||||
var rem = masks.FirstOrDefault(x => x.NoteType == NoteType.MaskRemove &&
|
||||
x.Position == mask.Position && x.Size == mask.Size);
|
||||
if (rem == null || rem.Measure < mask.Measure)
|
||||
bufGraphics.Graphics.FillPie(MaskBrush, DrawRect.ToInt(), -mask.Position * 6.0f, -mask.Size * 6.0f);
|
||||
bufGraphics.Graphics.FillPie(PlotBrush.MaskBrush, DrawRect.ToInt(), -mask.Position * 6.0f, -mask.Size * 6.0f);
|
||||
}
|
||||
else if (mask.NoteType == NoteType.MaskRemove) // Explicitly draw MaskRemove for edge cases
|
||||
{
|
||||
@@ -282,15 +189,15 @@ namespace BAKKA_Editor
|
||||
}
|
||||
}
|
||||
|
||||
public void DrawCircle(Chart chart)
|
||||
public void DrawCircle()
|
||||
{
|
||||
// Switch drawing modes
|
||||
bufGraphics.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
|
||||
|
||||
// Draw measure circle
|
||||
for (float meas = (float)Math.Ceiling(CurrentMeasure); (meas - CurrentMeasure) < GetTotalMeasureShowNotes(chart); meas += 1.0f)
|
||||
for (float meas = (float)Math.Ceiling(CurrentMeasure); (meas - CurrentMeasure) < TotalMeasureShowNotes; meas += 1.0f)
|
||||
{
|
||||
var info = GetScaledRect(chart, meas);
|
||||
var info = GetScaledRect(meas);
|
||||
if (info.Rect.Width >= 1)
|
||||
{
|
||||
bufGraphics.Graphics.DrawEllipse(BeatPen, info.Rect);
|
||||
@@ -333,41 +240,21 @@ namespace BAKKA_Editor
|
||||
}
|
||||
}
|
||||
|
||||
public void DrawGimmicks(Chart chart, bool showGimmicks, int selectedGimmickIndex)
|
||||
{
|
||||
if (showGimmicks)
|
||||
{
|
||||
List<Gimmick> drawGimmicks = chart.Gimmicks.Where(
|
||||
x => x.Measure >= CurrentMeasure
|
||||
&& x.Measure <= (CurrentMeasure + GetTotalMeasureShowNotes(chart))).ToList();
|
||||
|
||||
foreach (var gimmick in drawGimmicks)
|
||||
{
|
||||
var info = GetScaledRect(chart, gimmick.Measure);
|
||||
|
||||
if (info.Rect.Width >= 1)
|
||||
{
|
||||
bufGraphics.Graphics.DrawEllipse(GetPen(gimmick), info.Rect);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void DrawHolds(Chart chart, bool highlightSelectedNote, int selectedNoteIndex)
|
||||
{
|
||||
ArcInfo currentInfo = GetScaledRect(chart, CurrentMeasure);
|
||||
ArcInfo endInfo = GetScaledRect(chart, CurrentMeasure + GetTotalMeasureShowNotes(chart));
|
||||
ArcInfo currentInfo = GetScaledRect(CurrentMeasure);
|
||||
ArcInfo endInfo = GetScaledRect(CurrentMeasure + TotalMeasureShowNotes);
|
||||
|
||||
// First, draw holes that start before the viewpoint and have nodes that end after
|
||||
// First, draw holds that start before the viewpoint and have nodes that end after
|
||||
List<Note> holdNotes = chart.Notes.Where(
|
||||
x => x.Measure < CurrentMeasure
|
||||
&& x.NextNote != null
|
||||
&& x.NextNote.Measure > (CurrentMeasure + GetTotalMeasureShowNotes(chart))
|
||||
&& x.NextNote.Measure > (CurrentMeasure + TotalMeasureShowNotes)
|
||||
&& x.IsHold).ToList();
|
||||
foreach (var note in holdNotes)
|
||||
{
|
||||
ArcInfo info = GetArcInfo(chart, note);
|
||||
ArcInfo nextInfo = GetArcInfo(chart, (Note)note.NextNote);
|
||||
ArcInfo info = GetArcInfo(note);
|
||||
ArcInfo nextInfo = GetArcInfo((Note)note.NextNote);
|
||||
//GraphicsPath path = new GraphicsPath();
|
||||
//path.AddArc(endInfo.Rect, info.StartAngle, info.ArcLength);
|
||||
//path.AddArc(currentInfo.Rect, info.StartAngle + info.ArcLength, -info.ArcLength);
|
||||
@@ -408,22 +295,22 @@ namespace BAKKA_Editor
|
||||
GraphicsPath path = new GraphicsPath();
|
||||
path.AddArc(currentInfo.Rect, startAngle, arcLength);
|
||||
path.AddArc(endInfo.Rect, startAngle2 + arcLength2, -arcLength2);
|
||||
bufGraphics.Graphics.FillPath(HoldBrush, path);
|
||||
bufGraphics.Graphics.FillPath(PlotBrush.HoldBrush, path);
|
||||
}
|
||||
|
||||
// Second, draw all the notes on-screen
|
||||
holdNotes = chart.Notes.Where(
|
||||
x => x.Measure >= CurrentMeasure
|
||||
&& x.Measure <= (CurrentMeasure + GetTotalMeasureShowNotes(chart))
|
||||
&& x.Measure <= (CurrentMeasure + TotalMeasureShowNotes)
|
||||
&& x.IsHold).ToList();
|
||||
foreach (var note in holdNotes)
|
||||
{
|
||||
ArcInfo info = GetArcInfo(chart, note);
|
||||
ArcInfo info = GetArcInfo(note);
|
||||
|
||||
// If the previous note is off-screen, this case handles that
|
||||
if (note.PrevNote != null && note.PrevNote.Measure < CurrentMeasure)
|
||||
{
|
||||
ArcInfo prevInfo = GetArcInfo(chart, (Note)note.PrevNote);
|
||||
ArcInfo prevInfo = GetArcInfo((Note)note.PrevNote);
|
||||
float ratio = (currentInfo.Rect.Width - info.Rect.Width) / (prevInfo.Rect.Width - info.Rect.Width);
|
||||
float startNoteAngle = info.StartAngle;
|
||||
float endNoteAngle = prevInfo.StartAngle;
|
||||
@@ -443,23 +330,23 @@ namespace BAKKA_Editor
|
||||
GraphicsPath path = new GraphicsPath();
|
||||
path.AddArc(info.Rect, info.StartAngle, info.ArcLength);
|
||||
path.AddArc(currentInfo.Rect, startAngle + arcLength, -arcLength);
|
||||
bufGraphics.Graphics.FillPath(HoldBrush, path);
|
||||
bufGraphics.Graphics.FillPath(PlotBrush.HoldBrush, path);
|
||||
}
|
||||
|
||||
// If the next note is on-screen, this case handles that
|
||||
if (note.NextNote != null && note.NextNote.Measure <= (CurrentMeasure + GetTotalMeasureShowNotes(chart)))
|
||||
if (note.NextNote != null && note.NextNote.Measure <= (CurrentMeasure + TotalMeasureShowNotes))
|
||||
{
|
||||
ArcInfo nextInfo = GetArcInfo(chart, (Note)note.NextNote);
|
||||
ArcInfo nextInfo = GetArcInfo((Note)note.NextNote);
|
||||
GraphicsPath path = new GraphicsPath();
|
||||
path.AddArc(info.Rect, info.StartAngle, info.ArcLength);
|
||||
path.AddArc(nextInfo.Rect, nextInfo.StartAngle + nextInfo.ArcLength, -nextInfo.ArcLength);
|
||||
bufGraphics.Graphics.FillPath(HoldBrush, path);
|
||||
bufGraphics.Graphics.FillPath(PlotBrush.HoldBrush, path);
|
||||
}
|
||||
|
||||
// If the next note is off-screen, this case handles that
|
||||
if (note.NextNote != null && note.NextNote.Measure > (CurrentMeasure + GetTotalMeasureShowNotes(chart)))
|
||||
if (note.NextNote != null && note.NextNote.Measure > (CurrentMeasure + TotalMeasureShowNotes))
|
||||
{
|
||||
ArcInfo nextInfo = GetArcInfo(chart, (Note)note.NextNote);
|
||||
ArcInfo nextInfo = GetArcInfo((Note)note.NextNote);
|
||||
float ratio = (endInfo.Rect.Width - nextInfo.Rect.Width) / (info.Rect.Width - nextInfo.Rect.Width);
|
||||
float startNoteAngle = nextInfo.StartAngle;
|
||||
float endNoteAngle = info.StartAngle;
|
||||
@@ -479,7 +366,7 @@ namespace BAKKA_Editor
|
||||
GraphicsPath path = new GraphicsPath();
|
||||
path.AddArc(endInfo.Rect, startAngle, arcLength);
|
||||
path.AddArc(info.Rect, info.StartAngle + info.ArcLength, -info.ArcLength);
|
||||
bufGraphics.Graphics.FillPath(HoldBrush, path);
|
||||
bufGraphics.Graphics.FillPath(PlotBrush.HoldBrush, path);
|
||||
}
|
||||
|
||||
// Draw note
|
||||
@@ -507,11 +394,11 @@ namespace BAKKA_Editor
|
||||
{
|
||||
List<Note> drawNotes = chart.Notes.Where(
|
||||
x => x.Measure >= CurrentMeasure
|
||||
&& x.Measure <= (CurrentMeasure + GetTotalMeasureShowNotes(chart))
|
||||
&& x.Measure <= (CurrentMeasure + TotalMeasureShowNotes)
|
||||
&& !x.IsHold && !x.IsMask).ToList();
|
||||
foreach (var note in drawNotes)
|
||||
{
|
||||
ArcInfo info = GetArcInfo(chart, note);
|
||||
ArcInfo info = GetArcInfo(note);
|
||||
|
||||
if (info.Rect.Width >= 1)
|
||||
{
|
||||
@@ -561,11 +448,6 @@ namespace BAKKA_Editor
|
||||
{
|
||||
return new Pen(Color.FromArgb(CursorTransparency, Utils.NoteTypeToColor(noteType)), PanelSize.Width * 24.0f / 600.0f);
|
||||
}
|
||||
|
||||
public Pen GetPen(Gimmick gimmick)
|
||||
{
|
||||
return new Pen(Utils.GimmickTypeToColor(gimmick.GimmickType), PanelSize.Width * 1.0f / 600.0f);
|
||||
}
|
||||
}
|
||||
|
||||
internal struct ArcInfo
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BAKKA_Editor
|
||||
{
|
||||
internal class DrawClasses
|
||||
{
|
||||
}
|
||||
|
||||
internal class NoteInfo
|
||||
{
|
||||
public int StartLane { get; }
|
||||
public int EndLane { get; }
|
||||
public int? StartLane2 { get; }
|
||||
public int Size { get; }
|
||||
public int? Size2 { get; }
|
||||
|
||||
public NoteInfo(int position, int size)
|
||||
{
|
||||
StartLane = (position - 15) < 0 ? (position - 15) + 60 : position - 15;
|
||||
Size = size;
|
||||
EndLane = (StartLane + size >= 60) ? StartLane + size : StartLane + size + 1;
|
||||
StartLane2 = null;
|
||||
Size2 = null;
|
||||
if (EndLane > 60)
|
||||
{
|
||||
StartLane2 = StartLane;
|
||||
StartLane = 0;
|
||||
Size = EndLane - 60;
|
||||
Size2 = 60 - StartLane2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+27
-27
@@ -36,7 +36,7 @@ namespace BAKKA_Editor
|
||||
internal DialogResult Show(
|
||||
Gimmick baseGimmick, FormReason reason, Gimmick? gim1 = null, Gimmick? gim2 = null)
|
||||
{
|
||||
var quant = Utils.GetQuantization(baseGimmick.BeatInfo.Beat, 12);
|
||||
var quant = Utils.GetQuantization(baseGimmick.BeatInfo.Beat, 16);
|
||||
|
||||
gimmick = new Gimmick();
|
||||
gimmick.BeatInfo = new BeatInfo(baseGimmick.BeatInfo);
|
||||
@@ -46,15 +46,15 @@ namespace BAKKA_Editor
|
||||
{
|
||||
case GimmickType.BpmChange:
|
||||
startMeasureNumeric.Value = gimmick.BeatInfo.Measure;
|
||||
startBeat2Numeric.Value = quant.Item2;
|
||||
startBeat1Numeric.Value = quant.Item1;
|
||||
startBeat2Numeric.Value = quant.Item2;
|
||||
if (reason == FormReason.Edit)
|
||||
gimmickBpmNumeric.Value = (decimal)baseGimmick.BPM;
|
||||
break;
|
||||
case GimmickType.TimeSignatureChange:
|
||||
startMeasureNumeric.Value = gimmick.BeatInfo.Measure;
|
||||
startBeat2Numeric.Value = quant.Item2;
|
||||
startBeat1Numeric.Value = quant.Item1;
|
||||
startBeat2Numeric.Value = quant.Item2;
|
||||
if (reason == FormReason.Edit)
|
||||
{
|
||||
timeSig1Numeric.Value = baseGimmick.TimeSig.Upper;
|
||||
@@ -63,73 +63,73 @@ namespace BAKKA_Editor
|
||||
break;
|
||||
case GimmickType.HiSpeedChange:
|
||||
startMeasureNumeric.Value = gimmick.BeatInfo.Measure;
|
||||
startBeat2Numeric.Value = quant.Item2;
|
||||
startBeat1Numeric.Value = quant.Item1;
|
||||
startBeat2Numeric.Value = quant.Item2;
|
||||
if (reason == FormReason.Edit)
|
||||
hiSpeedNumeric.Value = (decimal)baseGimmick.HiSpeed;
|
||||
break;
|
||||
case GimmickType.ReverseStart:
|
||||
startMeasureNumeric.Value = gimmick.BeatInfo.Measure;
|
||||
startBeat2Numeric.Value = quant.Item2;
|
||||
startBeat1Numeric.Value = quant.Item1;
|
||||
startBeat2Numeric.Value = quant.Item2;
|
||||
if (reason == FormReason.Edit && gim1 != null && gim2 != null)
|
||||
{
|
||||
var quantMid1 = Utils.GetQuantization(gim1.BeatInfo.Beat, 12);
|
||||
var quantEnd1 = Utils.GetQuantization(gim2.BeatInfo.Beat, 12);
|
||||
var quantMid1 = Utils.GetQuantization(gim1.BeatInfo.Beat, 16);
|
||||
var quantEnd1 = Utils.GetQuantization(gim2.BeatInfo.Beat, 16);
|
||||
revEnd1MeasureNumeric.Value = gim1.BeatInfo.Measure;
|
||||
revEnd1Beat2Numeric.Value = quantMid1.Item2;
|
||||
revEnd1Beat1Numeric.Value = quantMid1.Item1;
|
||||
revEnd1Beat2Numeric.Value = quantMid1.Item2;
|
||||
revEnd2MeasureNumeric.Value = gim2.BeatInfo.Measure;
|
||||
revEnd2Beat2Numeric.Value = quantEnd1.Item2;
|
||||
revEnd2Beat1Numeric.Value = quantEnd1.Item1;
|
||||
revEnd2Beat2Numeric.Value = quantEnd1.Item2;
|
||||
}
|
||||
break;
|
||||
case GimmickType.ReverseMiddle:
|
||||
var quantStart2 = Utils.GetQuantization(gim1.BeatInfo.Beat, 12);
|
||||
var quantEnd2 = Utils.GetQuantization(gim2.BeatInfo.Beat, 12);
|
||||
startMeasureNumeric.Value = gim1.BeatInfo.Measure;
|
||||
startBeat2Numeric.Value = quantStart2.Item2;
|
||||
var quantStart2 = Utils.GetQuantization(gim1.BeatInfo.Beat, 16);
|
||||
var quantEnd2 = Utils.GetQuantization(gim2.BeatInfo.Beat, 16);
|
||||
startMeasureNumeric.Value = gim1.BeatInfo.Measure;
|
||||
startBeat1Numeric.Value = quantStart2.Item1;
|
||||
startBeat2Numeric.Value = quantStart2.Item2;
|
||||
revEnd1MeasureNumeric.Value = gimmick.BeatInfo.Measure;
|
||||
revEnd1Beat2Numeric.Value = quant.Item2;
|
||||
revEnd1Beat1Numeric.Value = quant.Item1;
|
||||
revEnd1Beat2Numeric.Value = quant.Item2;
|
||||
revEnd2MeasureNumeric.Value = gim2.BeatInfo.Measure;
|
||||
revEnd2Beat2Numeric.Value = quantEnd2.Item2;
|
||||
revEnd2Beat1Numeric.Value = quantEnd2.Item1;
|
||||
revEnd2Beat2Numeric.Value = quantEnd2.Item2;
|
||||
break;
|
||||
case GimmickType.ReverseEnd:
|
||||
var quantStart3 = Utils.GetQuantization(gim1.BeatInfo.Beat, 12);
|
||||
var quantMid3 = Utils.GetQuantization(gim2.BeatInfo.Beat, 12);
|
||||
var quantStart3 = Utils.GetQuantization(gim1.BeatInfo.Beat, 16);
|
||||
var quantMid3 = Utils.GetQuantization(gim2.BeatInfo.Beat, 16);
|
||||
startMeasureNumeric.Value = gim1.BeatInfo.Measure;
|
||||
startBeat2Numeric.Value = quantStart3.Item2;
|
||||
startBeat1Numeric.Value = quantStart3.Item1;
|
||||
revEnd1MeasureNumeric.Value = gim2.BeatInfo.Measure;
|
||||
revEnd1Beat2Numeric.Value = quantMid3.Item2;
|
||||
startBeat2Numeric.Value = quantStart3.Item2;
|
||||
revEnd1MeasureNumeric.Value = gim2.BeatInfo.Measure;
|
||||
revEnd1Beat1Numeric.Value = quantMid3.Item1;
|
||||
revEnd1Beat2Numeric.Value = quantMid3.Item2;
|
||||
revEnd2MeasureNumeric.Value = gimmick.BeatInfo.Measure;
|
||||
revEnd2Beat2Numeric.Value = quant.Item2;
|
||||
revEnd2Beat1Numeric.Value = quant.Item1;
|
||||
revEnd2Beat2Numeric.Value = quant.Item2;
|
||||
break;
|
||||
case GimmickType.StopStart:
|
||||
startMeasureNumeric.Value = gimmick.BeatInfo.Measure;
|
||||
startBeat2Numeric.Value = quant.Item2;
|
||||
startBeat1Numeric.Value = quant.Item1;
|
||||
startBeat2Numeric.Value = quant.Item2;
|
||||
if (reason == FormReason.Edit)
|
||||
{
|
||||
var stopEnd = Utils.GetQuantization(gim1.BeatInfo.Beat, 12);
|
||||
var stopEnd = Utils.GetQuantization(gim1.BeatInfo.Beat, 16);
|
||||
stopEndMeasureNumeric.Value = gim1.BeatInfo.Measure;
|
||||
stopEndBeat2Numeric.Value = stopEnd.Item2;
|
||||
stopEndBeat1Numeric.Value = stopEnd.Item1;
|
||||
stopEndBeat2Numeric.Value = stopEnd.Item2;
|
||||
}
|
||||
break;
|
||||
case GimmickType.StopEnd:
|
||||
var stopStart = Utils.GetQuantization(gim1.BeatInfo.Beat, 12);
|
||||
var stopStart = Utils.GetQuantization(gim1.BeatInfo.Beat, 16);
|
||||
startMeasureNumeric.Value = gim1.BeatInfo.Measure;
|
||||
startBeat2Numeric.Value = stopStart.Item2;
|
||||
startBeat1Numeric.Value = stopStart.Item1;
|
||||
startBeat2Numeric.Value = stopStart.Item2;
|
||||
stopEndMeasureNumeric.Value = gimmick.BeatInfo.Measure;
|
||||
stopEndBeat2Numeric.Value = quant.Item2;
|
||||
stopEndBeat1Numeric.Value = quant.Item1;
|
||||
stopEndBeat2Numeric.Value = quant.Item2;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
-5
@@ -96,11 +96,6 @@
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.initOffsetNumeric.Minimum = new decimal(new int[] {
|
||||
9999,
|
||||
0,
|
||||
0,
|
||||
-2147483648});
|
||||
this.initOffsetNumeric.Name = "initOffsetNumeric";
|
||||
this.initOffsetNumeric.Size = new System.Drawing.Size(100, 23);
|
||||
this.initOffsetNumeric.TabIndex = 26;
|
||||
|
||||
@@ -0,0 +1,193 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Drawing.Drawing2D;
|
||||
|
||||
namespace BAKKA_Editor
|
||||
{
|
||||
internal class LinearView
|
||||
{
|
||||
public SizeF PanelSize { get; private set; }
|
||||
public int LaneWidth { get; private set; }
|
||||
public int LeftMargin { get; set; }
|
||||
public int AllLaneWidth { get; private set; }
|
||||
public int BpmMargin { get; private set; }
|
||||
public int TimeSigMargin { get; private set; }
|
||||
public int HiSpeedMargin { get; private set; }
|
||||
public float StartingMeasure { get; set; } = -0.25f;
|
||||
public float StartingPoint {
|
||||
get
|
||||
{
|
||||
return (float)Math.Ceiling((Math.Ceiling(StartingMeasure) - StartingMeasure) * QuarterNoteHeight * 4);
|
||||
}
|
||||
}
|
||||
public float SelectedMeasure { get; set; } = 0.0f;
|
||||
public float EndMeasure
|
||||
{
|
||||
get
|
||||
{
|
||||
return (float)Math.Ceiling(StartingMeasure + PanelSize.Height / (QuarterNoteHeight * 4));
|
||||
}
|
||||
}
|
||||
|
||||
public int QuarterNoteHeight { get; set; } = 50;
|
||||
public int NumLanes { get; } = 60;
|
||||
|
||||
public Pen MeasurePen { get; } = new Pen(Color.White, 1.0f);
|
||||
public Pen MinorLanePen { get; } = new Pen(Color.FromArgb(42, 42, 42), 1.0f);
|
||||
public Pen MediumLanePen { get; } = new Pen(Color.FromArgb(80, 80, 80), 1.0f);
|
||||
public Pen MajorLanePen { get; } = new Pen(Color.White, 1.0f);
|
||||
//public Pen MajorLanePen { get; } = new Pen(Color.FromArgb(100, 100, 100), 1.0f);
|
||||
//public Brush LabelBrush { get; } = new SolidBrush(Color.FromArgb(204, 204, 204));
|
||||
public Brush LabelBrush { get; } = new SolidBrush(Color.Black);
|
||||
|
||||
public Pen SelectionPen { get; } = new Pen(Color.Red, 1.0f);
|
||||
|
||||
public Pen BpmPen { get; } = new Pen(Color.Lime, 1.0f);
|
||||
public Brush BpmBrush { get; } = new SolidBrush(Color.Lime);
|
||||
public Pen TimeSigPen { get; } = new Pen(Color.LightBlue, 1.0f);
|
||||
public Brush TimeSigBrush { get; } = new SolidBrush(Color.LightBlue);
|
||||
public Pen HiSpeedPen { get; } = new Pen(Color.Salmon, 1.0f);
|
||||
public Brush HiSpeedBrush { get; } = new SolidBrush(Color.Salmon);
|
||||
|
||||
public Font GimmickFont { get; } = new Font("Arial", 10.0f);
|
||||
public StringFormat RightAlign { get; } = new StringFormat() { Alignment = StringAlignment.Far };
|
||||
|
||||
public LinearView(SizeF size)
|
||||
{
|
||||
Update(size);
|
||||
}
|
||||
|
||||
public void Update(SizeF size)
|
||||
{
|
||||
PanelSize = size;
|
||||
|
||||
LeftMargin = (int)(PanelSize.Width * 0.08f);
|
||||
LaneWidth = (int)Math.Max(8, PanelSize.Width * 0.68f / NumLanes);
|
||||
AllLaneWidth = LaneWidth * NumLanes;
|
||||
BpmMargin = TimeSigMargin = HiSpeedMargin = (int)Math.Max(60, PanelSize.Width * 0.08f);
|
||||
}
|
||||
|
||||
public void DrawNote(Graphics g, Note note, float startingPoint)
|
||||
{
|
||||
float measureOffset = note.Measure - (float)Math.Ceiling(StartingMeasure);
|
||||
float notePoint = (float)Math.Ceiling(measureOffset * QuarterNoteHeight * 4);
|
||||
|
||||
var noteInfo = new NoteInfo(note.Position, note.Size);
|
||||
|
||||
if (note.IsHold && note.NextNote != null)
|
||||
{
|
||||
float nextOffset = note.NextNote.Measure - (float)Math.Ceiling(StartingMeasure);
|
||||
float nextPoint = (float)Math.Ceiling(nextOffset * QuarterNoteHeight * 4);
|
||||
|
||||
var nextInfo = new NoteInfo(note.NextNote.Position, note.NextNote.Size);
|
||||
|
||||
bool crossedBoundary = noteInfo.StartLane2 != null || nextInfo.StartLane2 != null;
|
||||
bool bothValid = noteInfo.StartLane2 != null && nextInfo.StartLane2 != null;
|
||||
|
||||
if (!crossedBoundary || bothValid)
|
||||
{
|
||||
g.FillPolygon(
|
||||
PlotBrush.HoldBrush,
|
||||
new PointF[] {
|
||||
new PointF(LeftMargin + LaneWidth * noteInfo.StartLane + 1.0f, PanelSize.Height - startingPoint - notePoint - 3.0f),
|
||||
new PointF(LeftMargin + LaneWidth * (noteInfo.StartLane + noteInfo.Size) - 1.0f, PanelSize.Height - startingPoint - notePoint - 3.0f),
|
||||
new PointF(LeftMargin + LaneWidth * (nextInfo.StartLane + nextInfo.Size) - 1.0f, PanelSize.Height - startingPoint - nextPoint - 3.0f),
|
||||
new PointF(LeftMargin + LaneWidth * nextInfo.StartLane + 1.0f, PanelSize.Height - startingPoint - nextPoint - 3.0f)
|
||||
});
|
||||
|
||||
if (bothValid)
|
||||
{
|
||||
g.FillPolygon(
|
||||
PlotBrush.HoldBrush,
|
||||
new PointF[] {
|
||||
new PointF(LeftMargin + LaneWidth * (float)noteInfo.StartLane2 + 1.0f, PanelSize.Height - startingPoint - notePoint - 3.0f),
|
||||
new PointF(LeftMargin + LaneWidth * ((float)noteInfo.StartLane2 + (float)noteInfo.Size2) - 1.0f, PanelSize.Height - startingPoint - notePoint - 3.0f),
|
||||
new PointF(LeftMargin + LaneWidth * ((float)nextInfo.StartLane2 + (float)nextInfo.Size2) - 1.0f, PanelSize.Height - startingPoint - nextPoint - 3.0f),
|
||||
new PointF(LeftMargin + LaneWidth * (float)nextInfo.StartLane2 + 1.0f, PanelSize.Height - startingPoint - nextPoint - 3.0f)
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
g.FillRectangle(
|
||||
new SolidBrush(note.Color),
|
||||
LeftMargin + LaneWidth * noteInfo.StartLane + 1.0f,
|
||||
PanelSize.Height - startingPoint - notePoint - 3.0f,
|
||||
LaneWidth * noteInfo.Size - 2.0f,
|
||||
6.0f);
|
||||
|
||||
if (noteInfo.StartLane2 != null && noteInfo.Size2 != null)
|
||||
{
|
||||
g.FillPolygon(
|
||||
new SolidBrush(note.Color),
|
||||
new PointF[] {
|
||||
new PointF(LeftMargin - 8.0f, PanelSize.Height - startingPoint - notePoint + 1.0f),
|
||||
new PointF(LeftMargin - 8.0f, PanelSize.Height - startingPoint - notePoint - 2.0f),
|
||||
new PointF(LeftMargin + 1.0f, PanelSize.Height - startingPoint - notePoint - 4.0f),
|
||||
new PointF(LeftMargin + 1.0f, PanelSize.Height - startingPoint - notePoint + 3.0f)
|
||||
});
|
||||
|
||||
g.FillRectangle(
|
||||
new SolidBrush(note.Color),
|
||||
LeftMargin + LaneWidth * (int)noteInfo.StartLane2 + 1.0f,
|
||||
PanelSize.Height - startingPoint - notePoint - 3.0f,
|
||||
LaneWidth * (int)noteInfo.Size2 - 2.0f,
|
||||
6.0f);
|
||||
|
||||
g.FillPolygon(
|
||||
new SolidBrush(note.Color),
|
||||
new PointF[] {
|
||||
new PointF(LeftMargin + AllLaneWidth + 8.0f, PanelSize.Height - startingPoint - notePoint + 1.0f),
|
||||
new PointF(LeftMargin + AllLaneWidth + 8.0f, PanelSize.Height - startingPoint - notePoint - 2.0f),
|
||||
new PointF(LeftMargin + AllLaneWidth - 1.0f, PanelSize.Height - startingPoint - notePoint - 4.0f),
|
||||
new PointF(LeftMargin + AllLaneWidth - 1.0f, PanelSize.Height - startingPoint - notePoint + 3.0f)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public RectangleF[] GetNoteRect(Note note)
|
||||
{
|
||||
List<RectangleF> rects = new List<RectangleF>();
|
||||
|
||||
float measureOffset = note.Measure - (float)Math.Ceiling(StartingMeasure);
|
||||
float notePoint = (float)Math.Ceiling(measureOffset * QuarterNoteHeight * 4);
|
||||
|
||||
int endLane = (14 - note.Position) < 0 ? (14 - note.Position) + 60 : (14 - note.Position);
|
||||
int size = note.Size;
|
||||
int startLane = (endLane - size + 1);
|
||||
int? startLane2 = null;
|
||||
int? size2 = null;
|
||||
if (startLane < 0)
|
||||
{
|
||||
startLane2 = startLane + 60;
|
||||
startLane = 0;
|
||||
size = endLane + 1;
|
||||
size2 = 60 - startLane2;
|
||||
}
|
||||
|
||||
rects.Add(new RectangleF(
|
||||
LeftMargin + LaneWidth * startLane + 1.0f,
|
||||
PanelSize.Height - StartingPoint - notePoint - 3.0f,
|
||||
LaneWidth * size - 2.0f,
|
||||
6.0f));
|
||||
|
||||
if (startLane2 != null && size2 != null)
|
||||
{
|
||||
rects.Add(new RectangleF(
|
||||
LeftMargin + LaneWidth * (int)startLane2 + 1.0f,
|
||||
PanelSize.Height - StartingPoint - notePoint - 3.0f,
|
||||
LaneWidth * (int)size2 - 2.0f,
|
||||
6.0f));
|
||||
}
|
||||
|
||||
return rects.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+64
@@ -0,0 +1,64 @@
|
||||
namespace BAKKA_Editor
|
||||
{
|
||||
partial class LinearViewForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.linearPanel = new System.Windows.Forms.Panel();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// linearPanel
|
||||
//
|
||||
this.linearPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.linearPanel.Location = new System.Drawing.Point(0, 0);
|
||||
this.linearPanel.Name = "linearPanel";
|
||||
this.linearPanel.Size = new System.Drawing.Size(800, 450);
|
||||
this.linearPanel.TabIndex = 0;
|
||||
this.linearPanel.Click += new System.EventHandler(this.linearPanel_Click);
|
||||
this.linearPanel.Paint += new System.Windows.Forms.PaintEventHandler(this.linearPanel_Paint);
|
||||
this.linearPanel.MouseMove += new System.Windows.Forms.MouseEventHandler(this.linearPanel_MouseMove);
|
||||
//
|
||||
// LinearViewForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||
this.Controls.Add(this.linearPanel);
|
||||
this.Name = "LinearViewForm";
|
||||
this.ShowIcon = false;
|
||||
this.Text = "Linear View";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.LinearViewForm_FormClosing);
|
||||
this.Resize += new System.EventHandler(this.LinearViewForm_Resize);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Panel linearPanel;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,323 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace BAKKA_Editor
|
||||
{
|
||||
public partial class LinearViewForm : Form
|
||||
{
|
||||
// Chart
|
||||
Chart _chart;
|
||||
internal Chart Chart
|
||||
{
|
||||
get => _chart;
|
||||
set
|
||||
{
|
||||
_chart = value;
|
||||
linearPanel.Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
// Graphics
|
||||
BufferedGraphicsContext gfxContext;
|
||||
BufferedGraphics bufGraphics;
|
||||
LinearView linearView;
|
||||
|
||||
public LinearViewForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// Form events
|
||||
linearPanel.MouseWheel += LinearPanel_MouseWheel;
|
||||
|
||||
// Setup graphics
|
||||
gfxContext = BufferedGraphicsManager.Current;
|
||||
SetBufferedGraphicsContext();
|
||||
linearView = new LinearView(linearPanel.Size);
|
||||
|
||||
// Force double buffering on linearPanel
|
||||
Type controlType = linearPanel.GetType();
|
||||
PropertyInfo pi = controlType.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
|
||||
pi.SetValue(linearPanel, true);
|
||||
}
|
||||
|
||||
private void SetBufferedGraphicsContext()
|
||||
{
|
||||
if (linearPanel.Width == 0 || linearPanel.Height == 0)
|
||||
return;
|
||||
|
||||
gfxContext.MaximumBuffer = new Size(linearPanel.Width + 1, linearPanel.Height + 1);
|
||||
bufGraphics = gfxContext.Allocate(linearPanel.CreateGraphics(),
|
||||
new Rectangle(0, 0, linearPanel.Width, linearPanel.Height));
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
linearPanel.Invalidate(true);
|
||||
}
|
||||
|
||||
private void linearPanel_Paint(object sender, PaintEventArgs e)
|
||||
{
|
||||
Rectangle panelRect = new Rectangle(0, 0, linearPanel.Width, linearPanel.Height);
|
||||
|
||||
// Set drawing mode
|
||||
bufGraphics.Graphics.SmoothingMode = SmoothingMode.HighSpeed;
|
||||
|
||||
// Draw background
|
||||
bufGraphics.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(160, 160, 160)), panelRect);
|
||||
|
||||
// Ref Points
|
||||
float startingRemainder = (float)Math.Ceiling(linearView.StartingMeasure) - linearView.StartingMeasure;
|
||||
float startingPoint = startingRemainder * linearView.QuarterNoteHeight * 4;
|
||||
|
||||
// Draw Masks
|
||||
var masks = Chart.Notes.Where(x => x.IsMask && x.NoteType == NoteType.MaskAdd && x.Measure < linearView.EndMeasure);
|
||||
foreach (var mask in masks)
|
||||
{
|
||||
float measureOffset = mask.Measure - (float)Math.Ceiling(linearView.StartingMeasure);
|
||||
float maskPoint = measureOffset * linearView.QuarterNoteHeight * 4;
|
||||
float endPoint = 0;
|
||||
|
||||
var addNote = new NoteInfo(mask.Position, mask.Size);
|
||||
|
||||
var removeNote = Chart.Notes.FirstOrDefault(x => x.NoteType == NoteType.MaskRemove && x.Measure > mask.Measure && x.Position == mask.Position && x.Size == mask.Size);
|
||||
if (removeNote != null)
|
||||
{
|
||||
endPoint = linearView.PanelSize.Height - startingPoint - (removeNote.Measure - (float)Math.Ceiling(linearView.StartingMeasure)) * linearView.QuarterNoteHeight * 4;
|
||||
if (endPoint < 0)
|
||||
endPoint = 0;
|
||||
}
|
||||
|
||||
bufGraphics.Graphics.FillRectangle(
|
||||
new SolidBrush(mask.Color),
|
||||
linearView.LeftMargin + linearView.LaneWidth * addNote.StartLane + 1.0f,
|
||||
endPoint,
|
||||
linearView.LaneWidth * addNote.Size - 1.0f,
|
||||
linearView.PanelSize.Height - startingPoint - maskPoint);
|
||||
|
||||
if (addNote.StartLane2 != null && addNote.Size2 != null)
|
||||
{
|
||||
bufGraphics.Graphics.FillRectangle(
|
||||
new SolidBrush(mask.Color),
|
||||
linearView.LeftMargin + linearView.LaneWidth * (int)addNote.StartLane2 + 1.0f,
|
||||
endPoint,
|
||||
linearView.LaneWidth * (int)addNote.Size2 - 1.0f,
|
||||
linearView.PanelSize.Height - startingPoint - maskPoint);
|
||||
}
|
||||
}
|
||||
|
||||
// Draw Lanes
|
||||
for (int i = 0; i < (linearView.NumLanes + 1); i++)
|
||||
{
|
||||
Pen lanePen;
|
||||
if (i % 15 == 0)
|
||||
lanePen = linearView.MajorLanePen;
|
||||
else if (i % 5 == 0)
|
||||
lanePen = linearView.MediumLanePen;
|
||||
else
|
||||
lanePen = linearView.MinorLanePen;
|
||||
|
||||
bufGraphics.Graphics.DrawLine(
|
||||
lanePen,
|
||||
linearView.LeftMargin + i * linearView.LaneWidth,
|
||||
0,
|
||||
linearView.LeftMargin + i * linearView.LaneWidth,
|
||||
linearView.PanelSize.Height);
|
||||
}
|
||||
|
||||
// Draw Measure Lines
|
||||
for (int i = 0; i <= (int)(linearView.EndMeasure - linearView.StartingMeasure); i++)
|
||||
{
|
||||
bufGraphics.Graphics.DrawLine(
|
||||
linearView.MeasurePen,
|
||||
linearView.LeftMargin,
|
||||
linearView.PanelSize.Height - startingPoint - i * linearView.QuarterNoteHeight * 4,
|
||||
linearView.LeftMargin + linearView.AllLaneWidth,
|
||||
linearView.PanelSize.Height - startingPoint - i * linearView.QuarterNoteHeight * 4);
|
||||
|
||||
bufGraphics.Graphics.DrawString(
|
||||
$"{(Math.Ceiling(linearView.StartingMeasure) + i):F0}",
|
||||
linearView.GimmickFont,
|
||||
linearView.LabelBrush,
|
||||
linearView.LeftMargin - 8.0f,
|
||||
linearView.PanelSize.Height - startingPoint - i * linearView.QuarterNoteHeight * 4 - 18.0f,
|
||||
linearView.RightAlign);
|
||||
}
|
||||
|
||||
// Draw Hi-Speed
|
||||
var hispeed = Chart.Gimmicks.Where(
|
||||
x => x.GimmickType == GimmickType.HiSpeedChange
|
||||
&& x.Measure >= linearView.StartingMeasure
|
||||
&& x.Measure <= linearView.EndMeasure);
|
||||
foreach (var evt in hispeed)
|
||||
{
|
||||
float measureOffset = evt.Measure - (float)Math.Ceiling(linearView.StartingMeasure);
|
||||
float eventPoint = measureOffset * linearView.QuarterNoteHeight * 4;
|
||||
|
||||
bufGraphics.Graphics.DrawLine(
|
||||
linearView.HiSpeedPen,
|
||||
linearView.LeftMargin + linearView.AllLaneWidth,
|
||||
linearView.PanelSize.Height - startingPoint - eventPoint,
|
||||
linearView.LeftMargin + linearView.AllLaneWidth + linearView.BpmMargin + linearView.TimeSigMargin + linearView.HiSpeedMargin,
|
||||
linearView.PanelSize.Height - startingPoint - eventPoint);
|
||||
|
||||
bufGraphics.Graphics.DrawString(
|
||||
$"x {evt.HiSpeed:F3}",
|
||||
linearView.GimmickFont,
|
||||
linearView.HiSpeedBrush,
|
||||
linearView.LeftMargin + linearView.AllLaneWidth + linearView.BpmMargin + linearView.TimeSigMargin + 8.0f,
|
||||
linearView.PanelSize.Height - startingPoint - eventPoint - 18.0f);
|
||||
}
|
||||
|
||||
// Draw Time Signature
|
||||
var timesig = Chart.Gimmicks.Where(
|
||||
x => x.GimmickType == GimmickType.TimeSignatureChange
|
||||
&& x.Measure >= linearView.StartingMeasure
|
||||
&& x.Measure <= linearView.EndMeasure);
|
||||
foreach (var evt in timesig)
|
||||
{
|
||||
float measureOffset = evt.Measure - (float)Math.Ceiling(linearView.StartingMeasure);
|
||||
float eventPoint = measureOffset * linearView.QuarterNoteHeight * 4;
|
||||
|
||||
bufGraphics.Graphics.DrawLine(
|
||||
linearView.TimeSigPen,
|
||||
linearView.LeftMargin + linearView.AllLaneWidth,
|
||||
linearView.PanelSize.Height - startingPoint - eventPoint,
|
||||
linearView.LeftMargin + linearView.AllLaneWidth + linearView.BpmMargin + linearView.TimeSigMargin,
|
||||
linearView.PanelSize.Height - startingPoint - eventPoint);
|
||||
|
||||
bufGraphics.Graphics.DrawString(
|
||||
$"{evt.TimeSig.Upper}/{evt.TimeSig.Lower}",
|
||||
linearView.GimmickFont,
|
||||
linearView.TimeSigBrush,
|
||||
linearView.LeftMargin + linearView.AllLaneWidth + linearView.BpmMargin + 8.0f,
|
||||
linearView.PanelSize.Height - startingPoint - eventPoint - 18.0f);
|
||||
}
|
||||
|
||||
// Draw BPM
|
||||
var bpm = Chart.Gimmicks.Where(
|
||||
x => x.GimmickType == GimmickType.BpmChange
|
||||
&& x.Measure >= linearView.StartingMeasure
|
||||
&& x.Measure <= linearView.EndMeasure);
|
||||
foreach (var evt in bpm)
|
||||
{
|
||||
float measureOffset = evt.Measure - (float)Math.Ceiling(linearView.StartingMeasure);
|
||||
float eventPoint = measureOffset * linearView.QuarterNoteHeight * 4;
|
||||
|
||||
bufGraphics.Graphics.DrawLine(
|
||||
linearView.BpmPen,
|
||||
linearView.LeftMargin + linearView.AllLaneWidth,
|
||||
linearView.PanelSize.Height - startingPoint - eventPoint,
|
||||
linearView.LeftMargin + linearView.AllLaneWidth + linearView.BpmMargin,
|
||||
linearView.PanelSize.Height - startingPoint - eventPoint);
|
||||
|
||||
bufGraphics.Graphics.DrawString(
|
||||
evt.BPM.ToString("F2"),
|
||||
linearView.GimmickFont,
|
||||
linearView.BpmBrush,
|
||||
linearView.LeftMargin + linearView.AllLaneWidth + 8.0f,
|
||||
linearView.PanelSize.Height - startingPoint - eventPoint - 18.0f);
|
||||
}
|
||||
|
||||
// Draw Selection Line
|
||||
float selectionOffset = linearView.SelectedMeasure - (float)Math.Ceiling(linearView.StartingMeasure);
|
||||
float selectionPoint = selectionOffset * linearView.QuarterNoteHeight * 4;
|
||||
|
||||
bufGraphics.Graphics.DrawLine(
|
||||
linearView.SelectionPen,
|
||||
linearView.LeftMargin - 10.0f,
|
||||
linearView.PanelSize.Height - startingPoint - selectionPoint,
|
||||
linearView.LeftMargin + linearView.AllLaneWidth,
|
||||
linearView.PanelSize.Height - startingPoint - selectionPoint);
|
||||
|
||||
// Draw Holds
|
||||
// First, draw holds that start before the viewpoint and end after
|
||||
|
||||
// Second, draw all notes on-screen
|
||||
var holdNotes = Chart.Notes.Where(
|
||||
x => x.Measure >= linearView.StartingMeasure
|
||||
&& x.Measure <= linearView.EndMeasure
|
||||
&& x.IsHold).ToList();
|
||||
foreach (var note in holdNotes)
|
||||
{
|
||||
linearView.DrawNote(bufGraphics.Graphics, note, startingPoint);
|
||||
}
|
||||
|
||||
// Draw Notes
|
||||
var drawNotes = Chart.Notes.Where(
|
||||
x => x.Measure >= linearView.StartingMeasure
|
||||
&& x.Measure <= linearView.EndMeasure
|
||||
&& !x.IsHold
|
||||
&& !x.IsMask).ToList();
|
||||
foreach (var note in drawNotes)
|
||||
{
|
||||
linearView.DrawNote(bufGraphics.Graphics, note, startingPoint);
|
||||
}
|
||||
|
||||
bufGraphics.Render(e.Graphics);
|
||||
}
|
||||
|
||||
private void LinearViewForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
if (e.CloseReason == CloseReason.UserClosing)
|
||||
{
|
||||
Hide();
|
||||
e.Cancel = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void linearPanel_Click(object sender, EventArgs e)
|
||||
{
|
||||
linearPanel.Invalidate();
|
||||
}
|
||||
|
||||
private void LinearViewForm_Resize(object sender, EventArgs e)
|
||||
{
|
||||
SetBufferedGraphicsContext();
|
||||
linearView.Update(linearPanel.Size);
|
||||
linearPanel.Invalidate();
|
||||
}
|
||||
|
||||
private void LinearPanel_MouseWheel(object? sender, MouseEventArgs e)
|
||||
{
|
||||
if (Control.ModifierKeys == Keys.Control)
|
||||
{
|
||||
if (e.Delta > 0)
|
||||
linearView.QuarterNoteHeight += 50;
|
||||
else if (linearView.QuarterNoteHeight > 50)
|
||||
linearView.QuarterNoteHeight -= 50;
|
||||
linearPanel.Invalidate();
|
||||
}
|
||||
else if (Control.ModifierKeys == Keys.Alt)
|
||||
{ }
|
||||
else if (Control.ModifierKeys == Keys.Shift)
|
||||
{ }
|
||||
else
|
||||
{
|
||||
if (e.Delta > 0)
|
||||
{
|
||||
linearView.StartingMeasure += 0.25f * (50.0f / linearView.QuarterNoteHeight);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (linearView.StartingMeasure > -0.25f)
|
||||
linearView.StartingMeasure = Math.Max(-0.25f, linearView.StartingMeasure - 0.25f * ( 50.0f / linearView.QuarterNoteHeight));
|
||||
}
|
||||
}
|
||||
linearPanel.Invalidate();
|
||||
}
|
||||
|
||||
private void linearPanel_MouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
// Check all notes to determine if we are over one
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
<root>
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
Generated
+78
-75
@@ -100,7 +100,6 @@
|
||||
this.showCursorDuringPlaybackToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.highlightViewedNoteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.selectLastInsertedNoteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.showGimmicksInCircleViewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.chartToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.initialChartSettingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
@@ -109,7 +108,6 @@
|
||||
this.undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.redoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.groupBox6 = new System.Windows.Forms.GroupBox();
|
||||
this.gimmickJumpToCurrTimeButton = new System.Windows.Forms.Button();
|
||||
this.gimmickDeleteButton = new System.Windows.Forms.Button();
|
||||
this.gimmickEditButton = new System.Windows.Forms.Button();
|
||||
this.gimmickBeatLabel = new System.Windows.Forms.Label();
|
||||
@@ -127,7 +125,8 @@
|
||||
this.label9 = new System.Windows.Forms.Label();
|
||||
this.noteSizeLabel = new System.Windows.Forms.Label();
|
||||
this.label17 = new System.Windows.Forms.Label();
|
||||
this.noteJumpToCurrTimeButton = new System.Windows.Forms.Button();
|
||||
this.noteNextMeasureButton = new System.Windows.Forms.Button();
|
||||
this.notePrevMeasureButton = new System.Windows.Forms.Button();
|
||||
this.noteDeleteSelectedButton = new System.Windows.Forms.Button();
|
||||
this.noteEditSelectedButton = new System.Windows.Forms.Button();
|
||||
this.noteBeatLabel = new System.Windows.Forms.Label();
|
||||
@@ -141,6 +140,8 @@
|
||||
this.noteNextButton = new System.Windows.Forms.Button();
|
||||
this.notePrevButton = new System.Windows.Forms.Button();
|
||||
this.autoSaveTimer = new System.Windows.Forms.Timer(this.components);
|
||||
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.linearViewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.groupBox1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.beat2Numeric)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.beat1Numeric)).BeginInit();
|
||||
@@ -290,12 +291,12 @@
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.sizeTrackBar.Location = new System.Drawing.Point(50, 81);
|
||||
this.sizeTrackBar.Maximum = 60;
|
||||
this.sizeTrackBar.Minimum = 4;
|
||||
this.sizeTrackBar.Minimum = 1;
|
||||
this.sizeTrackBar.Name = "sizeTrackBar";
|
||||
this.sizeTrackBar.Size = new System.Drawing.Size(183, 45);
|
||||
this.sizeTrackBar.TabIndex = 5;
|
||||
this.sizeTrackBar.TickStyle = System.Windows.Forms.TickStyle.None;
|
||||
this.sizeTrackBar.Value = 4;
|
||||
this.sizeTrackBar.Value = 1;
|
||||
this.sizeTrackBar.ValueChanged += new System.EventHandler(this.sizeTrackBar_ValueChanged);
|
||||
//
|
||||
// sizeNumeric
|
||||
@@ -307,7 +308,7 @@
|
||||
0,
|
||||
0});
|
||||
this.sizeNumeric.Minimum = new decimal(new int[] {
|
||||
4,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
@@ -315,7 +316,7 @@
|
||||
this.sizeNumeric.Size = new System.Drawing.Size(38, 23);
|
||||
this.sizeNumeric.TabIndex = 4;
|
||||
this.sizeNumeric.Value = new decimal(new int[] {
|
||||
4,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
@@ -438,7 +439,7 @@
|
||||
this.endChartButton.ForeColor = System.Drawing.Color.White;
|
||||
this.endChartButton.Location = new System.Drawing.Point(6, 225);
|
||||
this.endChartButton.Name = "endChartButton";
|
||||
this.endChartButton.Size = new System.Drawing.Size(97, 23);
|
||||
this.endChartButton.Size = new System.Drawing.Size(86, 23);
|
||||
this.endChartButton.TabIndex = 12;
|
||||
this.endChartButton.Text = "End of Chart";
|
||||
this.endChartButton.UseVisualStyleBackColor = false;
|
||||
@@ -449,7 +450,7 @@
|
||||
this.holdButton.BackColor = System.Drawing.Color.Yellow;
|
||||
this.holdButton.Location = new System.Drawing.Point(6, 196);
|
||||
this.holdButton.Name = "holdButton";
|
||||
this.holdButton.Size = new System.Drawing.Size(97, 23);
|
||||
this.holdButton.Size = new System.Drawing.Size(86, 23);
|
||||
this.holdButton.TabIndex = 11;
|
||||
this.holdButton.Text = "Hold";
|
||||
this.holdButton.UseVisualStyleBackColor = false;
|
||||
@@ -460,7 +461,7 @@
|
||||
this.chainButton.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(190)))), ((int)(((byte)(45)))));
|
||||
this.chainButton.Location = new System.Drawing.Point(6, 167);
|
||||
this.chainButton.Name = "chainButton";
|
||||
this.chainButton.Size = new System.Drawing.Size(97, 23);
|
||||
this.chainButton.Size = new System.Drawing.Size(86, 23);
|
||||
this.chainButton.TabIndex = 10;
|
||||
this.chainButton.Text = "Chain";
|
||||
this.chainButton.UseVisualStyleBackColor = false;
|
||||
@@ -472,7 +473,7 @@
|
||||
this.blueButton.ForeColor = System.Drawing.SystemColors.ControlText;
|
||||
this.blueButton.Location = new System.Drawing.Point(6, 138);
|
||||
this.blueButton.Name = "blueButton";
|
||||
this.blueButton.Size = new System.Drawing.Size(97, 23);
|
||||
this.blueButton.Size = new System.Drawing.Size(86, 23);
|
||||
this.blueButton.TabIndex = 9;
|
||||
this.blueButton.Text = "↓ Snap";
|
||||
this.blueButton.UseVisualStyleBackColor = false;
|
||||
@@ -484,7 +485,7 @@
|
||||
this.redButton.ForeColor = System.Drawing.Color.White;
|
||||
this.redButton.Location = new System.Drawing.Point(6, 109);
|
||||
this.redButton.Name = "redButton";
|
||||
this.redButton.Size = new System.Drawing.Size(97, 23);
|
||||
this.redButton.Size = new System.Drawing.Size(86, 23);
|
||||
this.redButton.TabIndex = 8;
|
||||
this.redButton.Text = "↑ Snap";
|
||||
this.redButton.UseVisualStyleBackColor = false;
|
||||
@@ -495,7 +496,7 @@
|
||||
this.greenButton.BackColor = System.Drawing.Color.Lime;
|
||||
this.greenButton.Location = new System.Drawing.Point(6, 80);
|
||||
this.greenButton.Name = "greenButton";
|
||||
this.greenButton.Size = new System.Drawing.Size(97, 23);
|
||||
this.greenButton.Size = new System.Drawing.Size(86, 23);
|
||||
this.greenButton.TabIndex = 7;
|
||||
this.greenButton.Text = "⤿ Slide";
|
||||
this.greenButton.UseVisualStyleBackColor = false;
|
||||
@@ -506,7 +507,7 @@
|
||||
this.orangeButton.BackColor = System.Drawing.Color.Orange;
|
||||
this.orangeButton.Location = new System.Drawing.Point(6, 51);
|
||||
this.orangeButton.Name = "orangeButton";
|
||||
this.orangeButton.Size = new System.Drawing.Size(97, 23);
|
||||
this.orangeButton.Size = new System.Drawing.Size(86, 23);
|
||||
this.orangeButton.TabIndex = 6;
|
||||
this.orangeButton.Text = "⤾ Slide";
|
||||
this.orangeButton.UseVisualStyleBackColor = false;
|
||||
@@ -517,7 +518,7 @@
|
||||
this.tapButton.BackColor = System.Drawing.Color.Fuchsia;
|
||||
this.tapButton.Location = new System.Drawing.Point(6, 22);
|
||||
this.tapButton.Name = "tapButton";
|
||||
this.tapButton.Size = new System.Drawing.Size(97, 23);
|
||||
this.tapButton.Size = new System.Drawing.Size(86, 23);
|
||||
this.tapButton.TabIndex = 5;
|
||||
this.tapButton.Text = "Touch";
|
||||
this.tapButton.UseVisualStyleBackColor = false;
|
||||
@@ -846,13 +847,12 @@
|
||||
//
|
||||
this.visualHispeedNumeric.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.visualHispeedNumeric.DecimalPlaces = 1;
|
||||
this.visualHispeedNumeric.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
this.visualHispeedNumeric.DecimalPlaces = 2;
|
||||
this.visualHispeedNumeric.Increment = new decimal(new int[] {
|
||||
1,
|
||||
5,
|
||||
0,
|
||||
0,
|
||||
65536});
|
||||
131072});
|
||||
this.visualHispeedNumeric.Location = new System.Drawing.Point(6, 37);
|
||||
this.visualHispeedNumeric.Maximum = new decimal(new int[] {
|
||||
500,
|
||||
@@ -863,13 +863,12 @@
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
65536});
|
||||
196608});
|
||||
this.visualHispeedNumeric.Name = "visualHispeedNumeric";
|
||||
this.visualHispeedNumeric.Size = new System.Drawing.Size(102, 29);
|
||||
this.visualHispeedNumeric.Size = new System.Drawing.Size(102, 23);
|
||||
this.visualHispeedNumeric.TabIndex = 11;
|
||||
this.visualHispeedNumeric.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
this.visualHispeedNumeric.Value = new decimal(new int[] {
|
||||
15,
|
||||
5,
|
||||
0,
|
||||
0,
|
||||
65536});
|
||||
@@ -945,7 +944,8 @@
|
||||
this.showCursorDuringPlaybackToolStripMenuItem,
|
||||
this.highlightViewedNoteToolStripMenuItem,
|
||||
this.selectLastInsertedNoteToolStripMenuItem,
|
||||
this.showGimmicksInCircleViewToolStripMenuItem});
|
||||
this.toolStripSeparator1,
|
||||
this.linearViewToolStripMenuItem});
|
||||
this.viewToolStripMenuItem.Name = "viewToolStripMenuItem";
|
||||
this.viewToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
|
||||
this.viewToolStripMenuItem.Text = "View";
|
||||
@@ -956,14 +956,14 @@
|
||||
this.showCursorToolStripMenuItem.CheckOnClick = true;
|
||||
this.showCursorToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.showCursorToolStripMenuItem.Name = "showCursorToolStripMenuItem";
|
||||
this.showCursorToolStripMenuItem.Size = new System.Drawing.Size(233, 22);
|
||||
this.showCursorToolStripMenuItem.Size = new System.Drawing.Size(230, 22);
|
||||
this.showCursorToolStripMenuItem.Text = "Show Cursor";
|
||||
this.showCursorToolStripMenuItem.Click += new System.EventHandler(this.showCursorToolStripMenuItem_Click);
|
||||
//
|
||||
// showCursorDuringPlaybackToolStripMenuItem
|
||||
//
|
||||
this.showCursorDuringPlaybackToolStripMenuItem.Name = "showCursorDuringPlaybackToolStripMenuItem";
|
||||
this.showCursorDuringPlaybackToolStripMenuItem.Size = new System.Drawing.Size(233, 22);
|
||||
this.showCursorDuringPlaybackToolStripMenuItem.Size = new System.Drawing.Size(230, 22);
|
||||
this.showCursorDuringPlaybackToolStripMenuItem.Text = "Show Cursor During Playback";
|
||||
//
|
||||
// highlightViewedNoteToolStripMenuItem
|
||||
@@ -972,7 +972,7 @@
|
||||
this.highlightViewedNoteToolStripMenuItem.CheckOnClick = true;
|
||||
this.highlightViewedNoteToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.highlightViewedNoteToolStripMenuItem.Name = "highlightViewedNoteToolStripMenuItem";
|
||||
this.highlightViewedNoteToolStripMenuItem.Size = new System.Drawing.Size(233, 22);
|
||||
this.highlightViewedNoteToolStripMenuItem.Size = new System.Drawing.Size(230, 22);
|
||||
this.highlightViewedNoteToolStripMenuItem.Text = "Highlight Viewed Note";
|
||||
//
|
||||
// selectLastInsertedNoteToolStripMenuItem
|
||||
@@ -981,19 +981,9 @@
|
||||
this.selectLastInsertedNoteToolStripMenuItem.CheckOnClick = true;
|
||||
this.selectLastInsertedNoteToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.selectLastInsertedNoteToolStripMenuItem.Name = "selectLastInsertedNoteToolStripMenuItem";
|
||||
this.selectLastInsertedNoteToolStripMenuItem.Size = new System.Drawing.Size(233, 22);
|
||||
this.selectLastInsertedNoteToolStripMenuItem.Size = new System.Drawing.Size(230, 22);
|
||||
this.selectLastInsertedNoteToolStripMenuItem.Text = "Select Last Inserted Note";
|
||||
//
|
||||
// showGimmicksInCircleViewToolStripMenuItem
|
||||
//
|
||||
this.showGimmicksInCircleViewToolStripMenuItem.Checked = true;
|
||||
this.showGimmicksInCircleViewToolStripMenuItem.CheckOnClick = true;
|
||||
this.showGimmicksInCircleViewToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.showGimmicksInCircleViewToolStripMenuItem.Name = "showGimmicksInCircleViewToolStripMenuItem";
|
||||
this.showGimmicksInCircleViewToolStripMenuItem.Size = new System.Drawing.Size(233, 22);
|
||||
this.showGimmicksInCircleViewToolStripMenuItem.Text = "Show Gimmicks In Circle View";
|
||||
this.showGimmicksInCircleViewToolStripMenuItem.Click += new System.EventHandler(this.showGimmicksInCircleViewToolStripMenuItem_Click);
|
||||
//
|
||||
// chartToolStripMenuItem
|
||||
//
|
||||
this.chartToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
@@ -1061,7 +1051,6 @@
|
||||
// groupBox6
|
||||
//
|
||||
this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.groupBox6.Controls.Add(this.gimmickJumpToCurrTimeButton);
|
||||
this.groupBox6.Controls.Add(this.gimmickDeleteButton);
|
||||
this.groupBox6.Controls.Add(this.gimmickEditButton);
|
||||
this.groupBox6.Controls.Add(this.gimmickBeatLabel);
|
||||
@@ -1074,27 +1063,17 @@
|
||||
this.groupBox6.Controls.Add(this.label5);
|
||||
this.groupBox6.Controls.Add(this.gimmickNextButton);
|
||||
this.groupBox6.Controls.Add(this.gimmickPrevButton);
|
||||
this.groupBox6.Location = new System.Drawing.Point(874, 602);
|
||||
this.groupBox6.Location = new System.Drawing.Point(874, 633);
|
||||
this.groupBox6.Name = "groupBox6";
|
||||
this.groupBox6.Size = new System.Drawing.Size(256, 173);
|
||||
this.groupBox6.Size = new System.Drawing.Size(256, 142);
|
||||
this.groupBox6.TabIndex = 33;
|
||||
this.groupBox6.TabStop = false;
|
||||
this.groupBox6.Text = "Gimmick View";
|
||||
//
|
||||
// gimmickJumpToCurrTimeButton
|
||||
//
|
||||
this.gimmickJumpToCurrTimeButton.Location = new System.Drawing.Point(7, 48);
|
||||
this.gimmickJumpToCurrTimeButton.Name = "gimmickJumpToCurrTimeButton";
|
||||
this.gimmickJumpToCurrTimeButton.Size = new System.Drawing.Size(243, 23);
|
||||
this.gimmickJumpToCurrTimeButton.TabIndex = 14;
|
||||
this.gimmickJumpToCurrTimeButton.Text = "Jump To Nearest Gimmick @ Current Time";
|
||||
this.gimmickJumpToCurrTimeButton.UseVisualStyleBackColor = true;
|
||||
this.gimmickJumpToCurrTimeButton.Click += new System.EventHandler(this.gimmickJumpToCurrTimeButton_Click);
|
||||
//
|
||||
// gimmickDeleteButton
|
||||
//
|
||||
this.gimmickDeleteButton.ForeColor = System.Drawing.Color.Red;
|
||||
this.gimmickDeleteButton.Location = new System.Drawing.Point(134, 139);
|
||||
this.gimmickDeleteButton.Location = new System.Drawing.Point(134, 109);
|
||||
this.gimmickDeleteButton.Name = "gimmickDeleteButton";
|
||||
this.gimmickDeleteButton.Size = new System.Drawing.Size(113, 23);
|
||||
this.gimmickDeleteButton.TabIndex = 11;
|
||||
@@ -1104,7 +1083,7 @@
|
||||
//
|
||||
// gimmickEditButton
|
||||
//
|
||||
this.gimmickEditButton.Location = new System.Drawing.Point(6, 139);
|
||||
this.gimmickEditButton.Location = new System.Drawing.Point(6, 109);
|
||||
this.gimmickEditButton.Name = "gimmickEditButton";
|
||||
this.gimmickEditButton.Size = new System.Drawing.Size(113, 23);
|
||||
this.gimmickEditButton.TabIndex = 10;
|
||||
@@ -1115,7 +1094,7 @@
|
||||
// gimmickBeatLabel
|
||||
//
|
||||
this.gimmickBeatLabel.AutoSize = true;
|
||||
this.gimmickBeatLabel.Location = new System.Drawing.Point(173, 78);
|
||||
this.gimmickBeatLabel.Location = new System.Drawing.Point(173, 47);
|
||||
this.gimmickBeatLabel.Name = "gimmickBeatLabel";
|
||||
this.gimmickBeatLabel.Size = new System.Drawing.Size(36, 15);
|
||||
this.gimmickBeatLabel.TabIndex = 9;
|
||||
@@ -1124,7 +1103,7 @@
|
||||
// gimmickValueLabel
|
||||
//
|
||||
this.gimmickValueLabel.AutoSize = true;
|
||||
this.gimmickValueLabel.Location = new System.Drawing.Point(76, 120);
|
||||
this.gimmickValueLabel.Location = new System.Drawing.Point(76, 89);
|
||||
this.gimmickValueLabel.Name = "gimmickValueLabel";
|
||||
this.gimmickValueLabel.Size = new System.Drawing.Size(36, 15);
|
||||
this.gimmickValueLabel.TabIndex = 8;
|
||||
@@ -1133,7 +1112,7 @@
|
||||
// gimmickTypeLabel
|
||||
//
|
||||
this.gimmickTypeLabel.AutoSize = true;
|
||||
this.gimmickTypeLabel.Location = new System.Drawing.Point(76, 99);
|
||||
this.gimmickTypeLabel.Location = new System.Drawing.Point(76, 68);
|
||||
this.gimmickTypeLabel.Name = "gimmickTypeLabel";
|
||||
this.gimmickTypeLabel.Size = new System.Drawing.Size(36, 15);
|
||||
this.gimmickTypeLabel.TabIndex = 7;
|
||||
@@ -1142,7 +1121,7 @@
|
||||
// gimmickMeasureLabel
|
||||
//
|
||||
this.gimmickMeasureLabel.AutoSize = true;
|
||||
this.gimmickMeasureLabel.Location = new System.Drawing.Point(76, 78);
|
||||
this.gimmickMeasureLabel.Location = new System.Drawing.Point(76, 47);
|
||||
this.gimmickMeasureLabel.Name = "gimmickMeasureLabel";
|
||||
this.gimmickMeasureLabel.Size = new System.Drawing.Size(36, 15);
|
||||
this.gimmickMeasureLabel.TabIndex = 6;
|
||||
@@ -1152,7 +1131,7 @@
|
||||
//
|
||||
this.label8.AutoSize = true;
|
||||
this.label8.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point);
|
||||
this.label8.Location = new System.Drawing.Point(128, 76);
|
||||
this.label8.Location = new System.Drawing.Point(128, 45);
|
||||
this.label8.Name = "label8";
|
||||
this.label8.Size = new System.Drawing.Size(39, 17);
|
||||
this.label8.TabIndex = 5;
|
||||
@@ -1162,7 +1141,7 @@
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point);
|
||||
this.label7.Location = new System.Drawing.Point(24, 118);
|
||||
this.label7.Location = new System.Drawing.Point(24, 87);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(46, 17);
|
||||
this.label7.TabIndex = 4;
|
||||
@@ -1172,7 +1151,7 @@
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point);
|
||||
this.label6.Location = new System.Drawing.Point(29, 97);
|
||||
this.label6.Location = new System.Drawing.Point(29, 66);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(41, 17);
|
||||
this.label6.TabIndex = 3;
|
||||
@@ -1182,7 +1161,7 @@
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point);
|
||||
this.label5.Location = new System.Drawing.Point(6, 76);
|
||||
this.label5.Location = new System.Drawing.Point(6, 45);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(64, 17);
|
||||
this.label5.TabIndex = 2;
|
||||
@@ -1215,7 +1194,8 @@
|
||||
this.noteViewGroupBox.Controls.Add(this.label9);
|
||||
this.noteViewGroupBox.Controls.Add(this.noteSizeLabel);
|
||||
this.noteViewGroupBox.Controls.Add(this.label17);
|
||||
this.noteViewGroupBox.Controls.Add(this.noteJumpToCurrTimeButton);
|
||||
this.noteViewGroupBox.Controls.Add(this.noteNextMeasureButton);
|
||||
this.noteViewGroupBox.Controls.Add(this.notePrevMeasureButton);
|
||||
this.noteViewGroupBox.Controls.Add(this.noteDeleteSelectedButton);
|
||||
this.noteViewGroupBox.Controls.Add(this.noteEditSelectedButton);
|
||||
this.noteViewGroupBox.Controls.Add(this.noteBeatLabel);
|
||||
@@ -1228,7 +1208,7 @@
|
||||
this.noteViewGroupBox.Controls.Add(this.label16);
|
||||
this.noteViewGroupBox.Controls.Add(this.noteNextButton);
|
||||
this.noteViewGroupBox.Controls.Add(this.notePrevButton);
|
||||
this.noteViewGroupBox.Location = new System.Drawing.Point(874, 389);
|
||||
this.noteViewGroupBox.Location = new System.Drawing.Point(874, 420);
|
||||
this.noteViewGroupBox.Name = "noteViewGroupBox";
|
||||
this.noteViewGroupBox.Size = new System.Drawing.Size(256, 207);
|
||||
this.noteViewGroupBox.TabIndex = 34;
|
||||
@@ -1273,15 +1253,25 @@
|
||||
this.label17.TabIndex = 14;
|
||||
this.label17.Text = "Size:";
|
||||
//
|
||||
// noteJumpToCurrTimeButton
|
||||
// noteNextMeasureButton
|
||||
//
|
||||
this.noteJumpToCurrTimeButton.Location = new System.Drawing.Point(7, 48);
|
||||
this.noteJumpToCurrTimeButton.Name = "noteJumpToCurrTimeButton";
|
||||
this.noteJumpToCurrTimeButton.Size = new System.Drawing.Size(243, 23);
|
||||
this.noteJumpToCurrTimeButton.TabIndex = 13;
|
||||
this.noteJumpToCurrTimeButton.Text = "Jump To Nearest Note @ Current Time";
|
||||
this.noteJumpToCurrTimeButton.UseVisualStyleBackColor = true;
|
||||
this.noteJumpToCurrTimeButton.Click += new System.EventHandler(this.noteJumpToCurrTimeButton_Click);
|
||||
this.noteNextMeasureButton.Location = new System.Drawing.Point(134, 48);
|
||||
this.noteNextMeasureButton.Name = "noteNextMeasureButton";
|
||||
this.noteNextMeasureButton.Size = new System.Drawing.Size(116, 23);
|
||||
this.noteNextMeasureButton.TabIndex = 13;
|
||||
this.noteNextMeasureButton.Text = "Next Measure >>";
|
||||
this.noteNextMeasureButton.UseVisualStyleBackColor = true;
|
||||
this.noteNextMeasureButton.Click += new System.EventHandler(this.noteNextMeasureButton_Click);
|
||||
//
|
||||
// notePrevMeasureButton
|
||||
//
|
||||
this.notePrevMeasureButton.Location = new System.Drawing.Point(6, 48);
|
||||
this.notePrevMeasureButton.Name = "notePrevMeasureButton";
|
||||
this.notePrevMeasureButton.Size = new System.Drawing.Size(116, 23);
|
||||
this.notePrevMeasureButton.TabIndex = 12;
|
||||
this.notePrevMeasureButton.Text = "<< Prev Measure";
|
||||
this.notePrevMeasureButton.UseVisualStyleBackColor = true;
|
||||
this.notePrevMeasureButton.Click += new System.EventHandler(this.notePrevMeasureButton_Click);
|
||||
//
|
||||
// noteDeleteSelectedButton
|
||||
//
|
||||
@@ -1404,6 +1394,18 @@
|
||||
//
|
||||
this.autoSaveTimer.Tick += new System.EventHandler(this.autoSaveTimer_Tick);
|
||||
//
|
||||
// toolStripSeparator1
|
||||
//
|
||||
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
||||
this.toolStripSeparator1.Size = new System.Drawing.Size(227, 6);
|
||||
//
|
||||
// linearViewToolStripMenuItem
|
||||
//
|
||||
this.linearViewToolStripMenuItem.Name = "linearViewToolStripMenuItem";
|
||||
this.linearViewToolStripMenuItem.Size = new System.Drawing.Size(230, 22);
|
||||
this.linearViewToolStripMenuItem.Text = "Linear View";
|
||||
this.linearViewToolStripMenuItem.Click += new System.EventHandler(this.linearViewToolStripMenuItem_Click);
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
@@ -1424,7 +1426,7 @@
|
||||
this.Controls.Add(this.menuStrip);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.MainMenuStrip = this.menuStrip;
|
||||
this.MinimumSize = new System.Drawing.Size(1158, 826);
|
||||
this.MinimumSize = new System.Drawing.Size(1154, 812);
|
||||
this.Name = "MainForm";
|
||||
this.Text = "BAKKA Editor - [New File]";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing);
|
||||
@@ -1554,7 +1556,8 @@
|
||||
private Label label9;
|
||||
private Label noteSizeLabel;
|
||||
private Label label17;
|
||||
private Button noteJumpToCurrTimeButton;
|
||||
private Button noteNextMeasureButton;
|
||||
private Button notePrevMeasureButton;
|
||||
private Button noteDeleteSelectedButton;
|
||||
private Button noteEditSelectedButton;
|
||||
private Label noteBeatLabel;
|
||||
@@ -1575,7 +1578,7 @@
|
||||
private TrackBar trackBarVolume;
|
||||
private Label labelSpeed;
|
||||
private TrackBar trackBarSpeed;
|
||||
private Button gimmickJumpToCurrTimeButton;
|
||||
private ToolStripMenuItem showGimmicksInCircleViewToolStripMenuItem;
|
||||
private ToolStripSeparator toolStripSeparator1;
|
||||
private ToolStripMenuItem linearViewToolStripMenuItem;
|
||||
}
|
||||
}
|
||||
+82
-237
@@ -30,7 +30,6 @@ namespace BAKKA_Editor
|
||||
Note lastNote;
|
||||
Note? nextSelectedNote; // so that we know the last newly inserted note
|
||||
Note? endOfChartNote;
|
||||
bool isInsertingHold = false;
|
||||
|
||||
// Music
|
||||
ISoundEngine soundEngine = new ISoundEngine();
|
||||
@@ -50,6 +49,9 @@ namespace BAKKA_Editor
|
||||
GimmickForm gimmickForm;
|
||||
InitChartSettingsForm initSettingsForm;
|
||||
|
||||
// View Forms
|
||||
LinearViewForm linearForm;
|
||||
|
||||
// Program info
|
||||
string fileVersion = "";
|
||||
UserSettings userSettings;
|
||||
@@ -76,6 +78,10 @@ namespace BAKKA_Editor
|
||||
gimmickForm = new GimmickForm();
|
||||
initSettingsForm = new InitChartSettingsForm();
|
||||
|
||||
// View Forms
|
||||
linearForm = new();
|
||||
linearForm.Chart = chart;
|
||||
|
||||
//Set Initial Song File :)
|
||||
SetInitialSong();
|
||||
|
||||
@@ -104,6 +110,7 @@ namespace BAKKA_Editor
|
||||
UpdateGimmickLabels();
|
||||
SetText();
|
||||
circlePanel.Invalidate();
|
||||
linearForm.Update();
|
||||
};
|
||||
|
||||
// Program info
|
||||
@@ -124,14 +131,11 @@ namespace BAKKA_Editor
|
||||
File.WriteAllText("settings.toml", Toml.FromModel(userSettings));
|
||||
}
|
||||
// Apply settings
|
||||
showCursorToolStripMenuItem.Checked = userSettings.ViewSettings.ShowCursor;
|
||||
showCursorDuringPlaybackToolStripMenuItem.Checked = userSettings.ViewSettings.ShowCursorDuringPlayback;
|
||||
highlightViewedNoteToolStripMenuItem.Checked = userSettings.ViewSettings.HighlightViewedNote;
|
||||
showGimmicksInCircleViewToolStripMenuItem.Checked = userSettings.ViewSettings.ShowGimmicks;
|
||||
selectLastInsertedNoteToolStripMenuItem.Checked = userSettings.ViewSettings.SelectLastInsertedNote;
|
||||
visualHispeedNumeric.Value = (decimal)userSettings.ViewSettings.HispeedSetting;
|
||||
trackBarVolume.Value = userSettings.ViewSettings.Volume;
|
||||
autoSaveTimer.Interval = userSettings.SaveSettings.AutoSaveInterval * 60000;
|
||||
showCursorToolStripMenuItem.Checked = userSettings.ViewSettings.ShowCursor;
|
||||
showCursorDuringPlaybackToolStripMenuItem.Checked = userSettings.ViewSettings.ShowCursorDuringPlayback;
|
||||
highlightViewedNoteToolStripMenuItem.Checked = userSettings.ViewSettings.HighlightViewedNote;
|
||||
selectLastInsertedNoteToolStripMenuItem.Checked = userSettings.ViewSettings.SelectLastInsertedNote;
|
||||
autoSaveTimer.Interval = userSettings.SaveSettings.AutoSaveInterval * 60000;
|
||||
autoSaveTimer.Enabled = true;
|
||||
// Update hotkey labels
|
||||
tapButton.AppendHotkey(userSettings.HotkeySettings.TouchHotkey);
|
||||
@@ -228,6 +232,7 @@ namespace BAKKA_Editor
|
||||
SetText();
|
||||
opManager.Clear();
|
||||
circlePanel.Invalidate();
|
||||
linearForm.Chart = chart;
|
||||
}
|
||||
|
||||
private void openToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
@@ -274,6 +279,7 @@ namespace BAKKA_Editor
|
||||
SetText();
|
||||
}
|
||||
circlePanel.Invalidate();
|
||||
linearForm.Chart = chart;
|
||||
}
|
||||
|
||||
private void saveToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
@@ -287,23 +293,16 @@ namespace BAKKA_Editor
|
||||
|
||||
if (result == DialogResult.OK)
|
||||
{
|
||||
if (CurrentlyInsertingHold())
|
||||
chart.WriteFile(saveFileDialog.FileName);
|
||||
isNewFile = false;
|
||||
if (isRecoveredFile)
|
||||
{
|
||||
MessageBox.Show("Cannot save while inserting holds\n Please finish the hold before saving", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
}
|
||||
else
|
||||
{
|
||||
chart.WriteFile(saveFileDialog.FileName);
|
||||
isNewFile = false;
|
||||
if (isRecoveredFile)
|
||||
{
|
||||
DeleteAutosaves();
|
||||
autosaveFile = "";
|
||||
}
|
||||
isRecoveredFile = false;
|
||||
File.WriteAllText(tempStatusPath, "false");
|
||||
SetText();
|
||||
DeleteAutosaves();
|
||||
autosaveFile = "";
|
||||
}
|
||||
isRecoveredFile = false;
|
||||
File.WriteAllText(tempStatusPath, "false");
|
||||
SetText();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -348,77 +347,50 @@ namespace BAKKA_Editor
|
||||
File.Delete(tempStatusPath);
|
||||
if (tempFilePath != "")
|
||||
File.Delete(tempFilePath);
|
||||
// Apply settings
|
||||
userSettings.ViewSettings.ShowCursor = showCursorToolStripMenuItem.Checked;
|
||||
userSettings.ViewSettings.ShowCursorDuringPlayback = showCursorDuringPlaybackToolStripMenuItem.Checked;
|
||||
userSettings.ViewSettings.HighlightViewedNote = highlightViewedNoteToolStripMenuItem.Checked;
|
||||
userSettings.ViewSettings.ShowGimmicks = showGimmicksInCircleViewToolStripMenuItem.Checked;
|
||||
userSettings.ViewSettings.SelectLastInsertedNote = selectLastInsertedNoteToolStripMenuItem.Checked;
|
||||
userSettings.ViewSettings.HispeedSetting = circleView.Hispeed;
|
||||
userSettings.ViewSettings.Volume = trackBarVolume.Value;
|
||||
userSettings.SaveSettings.AutoSaveInterval = autoSaveTimer.Interval / 60000;
|
||||
//Update user settings.toml
|
||||
if (File.Exists("settings.toml"))
|
||||
File.WriteAllText("settings.toml", Toml.FromModel(userSettings));
|
||||
}
|
||||
|
||||
private void SetSelectedObject(NoteType type)
|
||||
{
|
||||
currentNoteType = type;
|
||||
int minSize = 1;
|
||||
switch (type)
|
||||
{
|
||||
case NoteType.TouchNoBonus:
|
||||
updateLabel("Touch");
|
||||
minSize = 4;
|
||||
break;
|
||||
case NoteType.TouchBonus:
|
||||
updateLabel("Touch [Bonus]");
|
||||
minSize = 5;
|
||||
break;
|
||||
case NoteType.SnapRedNoBonus:
|
||||
updateLabel("Snap (R)");
|
||||
minSize = 6;
|
||||
break;
|
||||
case NoteType.SnapBlueNoBonus:
|
||||
updateLabel("Snap (B)");
|
||||
minSize = 6;
|
||||
break;
|
||||
case NoteType.SlideOrangeNoBonus:
|
||||
updateLabel("Slide (O)");
|
||||
minSize = 5;
|
||||
break;
|
||||
case NoteType.SlideOrangeBonus:
|
||||
updateLabel("Slide (O) [Bonus]");
|
||||
minSize = 7;
|
||||
break;
|
||||
case NoteType.SlideGreenNoBonus:
|
||||
updateLabel("Slide (G)");
|
||||
minSize = 5;
|
||||
break;
|
||||
case NoteType.SlideGreenBonus:
|
||||
updateLabel("Slide (G) [Bonus]");
|
||||
minSize = 7;
|
||||
break;
|
||||
case NoteType.HoldStartNoBonus:
|
||||
updateLabel("Hold Start");
|
||||
minSize = 2;
|
||||
break;
|
||||
case NoteType.HoldJoint:
|
||||
if (endHoldCheck.Checked)
|
||||
{
|
||||
updateLabel("Hold End");
|
||||
currentNoteType = NoteType.HoldEnd;
|
||||
minSize = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
updateLabel("Hold Middle");
|
||||
minSize = 0;
|
||||
}
|
||||
break;
|
||||
case NoteType.HoldEnd:
|
||||
endHoldCheck.Checked = true;
|
||||
updateLabel("Hold End");
|
||||
break;
|
||||
case NoteType.MaskAdd:
|
||||
@@ -428,7 +400,6 @@ namespace BAKKA_Editor
|
||||
updateLabel("Mask Add (Counter-Clockwise)");
|
||||
else
|
||||
updateLabel("Mask Add (From Center)");
|
||||
minSize = 1;
|
||||
break;
|
||||
case NoteType.MaskRemove:
|
||||
if (clockwiseMaskRadio.Checked)
|
||||
@@ -437,53 +408,38 @@ namespace BAKKA_Editor
|
||||
updateLabel("Mask Remove (Counter-Clockwise)");
|
||||
else
|
||||
updateLabel("Mask Remove (From Center)");
|
||||
minSize = 1;
|
||||
break;
|
||||
case NoteType.EndOfChart:
|
||||
updateLabel("End of Chart");
|
||||
minSize = 60;
|
||||
break;
|
||||
case NoteType.Chain:
|
||||
updateLabel("Chain");
|
||||
minSize = 4;
|
||||
break;
|
||||
case NoteType.TouchBonusFlair:
|
||||
updateLabel("Touch [R Note]");
|
||||
minSize = 6;
|
||||
break;
|
||||
case NoteType.SnapRedBonusFlair:
|
||||
updateLabel("Snap (R) [R Note]");
|
||||
minSize = 8;
|
||||
break;
|
||||
case NoteType.SnapBlueBonusFlair:
|
||||
updateLabel("Snap (B) [R Note]");
|
||||
minSize = 8;
|
||||
break;
|
||||
case NoteType.SlideOrangeBonusFlair:
|
||||
updateLabel("Slide (O) [R Note]");
|
||||
minSize = 10;
|
||||
break;
|
||||
case NoteType.SlideGreenBonusFlair:
|
||||
updateLabel("Slide (G) [R Note]");
|
||||
minSize = 10;
|
||||
break;
|
||||
case NoteType.HoldStartBonusFlair:
|
||||
updateLabel("Hold Start [R Note]");
|
||||
minSize = 8;
|
||||
break;
|
||||
case NoteType.ChainBonusFlair:
|
||||
updateLabel("Chain [R Note]");
|
||||
minSize = 10;
|
||||
break;
|
||||
default:
|
||||
updateLabel("None Selected");
|
||||
minSize = 1;
|
||||
break;
|
||||
}
|
||||
if (sizeNumeric.Value < minSize) sizeNumeric.Value = minSize;
|
||||
if (sizeTrackBar.Value < minSize) sizeTrackBar.Value = minSize;
|
||||
sizeNumeric.Minimum = minSize;
|
||||
sizeTrackBar.Minimum = minSize;
|
||||
circlePanel.Invalidate();
|
||||
}
|
||||
|
||||
@@ -574,14 +530,11 @@ namespace BAKKA_Editor
|
||||
circleView.DrawMasks(chart);
|
||||
|
||||
// Draw base and measure circle.
|
||||
circleView.DrawCircle(chart);
|
||||
circleView.DrawCircle();
|
||||
|
||||
// Draw degree lines
|
||||
circleView.DrawDegreeLines();
|
||||
|
||||
// Draw Gimmicks
|
||||
circleView.DrawGimmicks(chart, showGimmicksInCircleViewToolStripMenuItem.Checked, selectedGimmickIndex);
|
||||
|
||||
// Draw holds
|
||||
circleView.DrawHolds(chart, highlightViewedNoteToolStripMenuItem.Checked, selectedNoteIndex);
|
||||
|
||||
@@ -631,13 +584,7 @@ namespace BAKKA_Editor
|
||||
}
|
||||
updateTime();
|
||||
if (currentSong != null && !IsSongPlaying() && valueTriggerEvent != EventSource.TrackBar)
|
||||
{
|
||||
int time = chart.GetTime(new BeatInfo((int)measureNumeric.Value, (int)beat1Numeric.Value * 1920 / (int)beat2Numeric.Value));
|
||||
if (time < 0)
|
||||
songTrackBar.Value = 0;
|
||||
else
|
||||
songTrackBar.Value = time;
|
||||
}
|
||||
songTrackBar.Value = chart.GetTime(new BeatInfo((int)measureNumeric.Value, (int)beat1Numeric.Value * 1920 / (int)beat2Numeric.Value));
|
||||
|
||||
valueTriggerEvent = EventSource.None;
|
||||
}
|
||||
@@ -791,10 +738,6 @@ namespace BAKKA_Editor
|
||||
|
||||
private void holdButtonClicked()
|
||||
{
|
||||
// don't reset hold state if we're already inserting a hold
|
||||
if (isInsertingHold)
|
||||
return;
|
||||
|
||||
if (noBonusRadio.Checked)
|
||||
SetSelectedObject(NoteType.HoldStartNoBonus);
|
||||
else if (bonusRadio.Checked)
|
||||
@@ -1015,8 +958,6 @@ namespace BAKKA_Editor
|
||||
songTrackBar.Value = 0;
|
||||
songTrackBar.Maximum = (int)currentSong.PlayLength;
|
||||
playButton.Enabled = true;
|
||||
measureNumeric.Value = 0;
|
||||
beat1Numeric.Value = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1061,10 +1002,17 @@ namespace BAKKA_Editor
|
||||
var info = chart.GetBeat(currentSong.PlayPosition);
|
||||
if (info != null && info.Measure != -1)
|
||||
{
|
||||
if (info.Measure < 0) measureNumeric.Value = 0;
|
||||
else measureNumeric.Value = info.Measure;
|
||||
measureNumeric.Value = info.Measure;
|
||||
beat1Numeric.Value = (int)((float)info.Beat / 1920.0f * (float)beat2Numeric.Value);
|
||||
circleView.CurrentMeasure = info.MeasureDecimal;
|
||||
|
||||
// TODO Fix hi-speed (it needs to be able to display multiple hi-speeds in the circle view at once)
|
||||
//// Change hi-speed, if applicable
|
||||
//var hispeed = chart.Gimmicks.Where(x => x.Measure <= info.Measure && x.GimmickType == GimmickType.HiSpeedChange).LastOrDefault();
|
||||
//if (hispeed != null && hispeed.HiSpeed != circleView.TotalMeasureShowNotes)
|
||||
//{
|
||||
// visualHispeedNumeric.Value = (decimal)hispeed.HiSpeed;
|
||||
//}
|
||||
}
|
||||
circlePanel.Invalidate();
|
||||
}
|
||||
@@ -1081,8 +1029,7 @@ namespace BAKKA_Editor
|
||||
if (info != null && info.Measure != -1 && valueTriggerEvent != EventSource.MouseWheel)
|
||||
{
|
||||
valueTriggerEvent = EventSource.TrackBar;
|
||||
if (info.Measure < 0) measureNumeric.Value = 0;
|
||||
else measureNumeric.Value = info.Measure;
|
||||
measureNumeric.Value = info.Measure;
|
||||
beat1Numeric.Value = (int)((float)info.Beat / 1920.0f * (float)beat2Numeric.Value);
|
||||
circleView.CurrentMeasure = info.MeasureDecimal;
|
||||
}
|
||||
@@ -1129,8 +1076,6 @@ namespace BAKKA_Editor
|
||||
return;
|
||||
}
|
||||
|
||||
int initialSize = (int)sizeNumeric.Value;
|
||||
|
||||
// X and Y are relative to the upper left of the panel
|
||||
float xCen = e.X - (circlePanel.Width / 2);
|
||||
float yCen = -(e.Y - (circlePanel.Height / 2));
|
||||
@@ -1140,35 +1085,31 @@ namespace BAKKA_Editor
|
||||
if (theta == circleView.mouseDownPos)
|
||||
{
|
||||
positionNumeric.Value = circleView.mouseDownPos;
|
||||
initialSize = 1;
|
||||
sizeNumeric.Value = 1;
|
||||
}
|
||||
else if ((theta > circleView.mouseDownPos || circleView.rolloverPos) && !circleView.rolloverNeg)
|
||||
{
|
||||
positionNumeric.Value = circleView.mouseDownPos;
|
||||
if (circleView.rolloverPos)
|
||||
initialSize = (int)Math.Min(theta + 60 - circleView.mouseDownPos + 1, 60);
|
||||
sizeNumeric.Value = (int)Math.Min(theta + 60 - circleView.mouseDownPos + 1, 60);
|
||||
else
|
||||
initialSize = theta - circleView.mouseDownPos + 1;
|
||||
sizeNumeric.Value = theta - circleView.mouseDownPos + 1;
|
||||
}
|
||||
else if (theta < circleView.mouseDownPos || circleView.rolloverNeg)
|
||||
{
|
||||
positionNumeric.Value = theta;
|
||||
if (circleView.rolloverNeg)
|
||||
initialSize = (int)Math.Min(circleView.mouseDownPos + 60 - theta + 1, 60);
|
||||
sizeNumeric.Value = (int)Math.Min(circleView.mouseDownPos + 60 - theta + 1, 60);
|
||||
else
|
||||
initialSize = circleView.mouseDownPos - theta + 1;
|
||||
sizeNumeric.Value = circleView.mouseDownPos - theta + 1;
|
||||
}
|
||||
|
||||
if (initialSize < sizeNumeric.Minimum) sizeNumeric.Value = sizeNumeric.Minimum;
|
||||
else if (initialSize > 60) sizeNumeric.Value = 60;
|
||||
else sizeNumeric.Value = initialSize;
|
||||
|
||||
circlePanel.Invalidate();
|
||||
}
|
||||
|
||||
private void visualHispeedNumeric_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
circleView.Hispeed = (float)visualHispeedNumeric.Value;
|
||||
circleView.TotalMeasureShowNotes = (float)visualHispeedNumeric.Value;
|
||||
circlePanel.Invalidate();
|
||||
}
|
||||
|
||||
@@ -1266,8 +1207,6 @@ namespace BAKKA_Editor
|
||||
|
||||
private void SetNonHoldButtonState(bool state)
|
||||
{
|
||||
isInsertingHold = !state;
|
||||
|
||||
tapButton.Enabled = state;
|
||||
orangeButton.Enabled = state;
|
||||
greenButton.Enabled = state;
|
||||
@@ -1434,11 +1373,6 @@ namespace BAKKA_Editor
|
||||
{
|
||||
circlePanel.Invalidate();
|
||||
}
|
||||
|
||||
private void showGimmicksInCircleViewToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
circlePanel.Invalidate();
|
||||
}
|
||||
|
||||
private void gimmickPrevButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -1466,29 +1400,6 @@ namespace BAKKA_Editor
|
||||
UpdateGimmickLabels();
|
||||
}
|
||||
|
||||
private void gimmickJumpToCurrTimeButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (chart.Gimmicks.Count == 0)
|
||||
return;
|
||||
|
||||
float currentMeasure = circleView.CurrentMeasure;
|
||||
var gimmick = chart.Gimmicks.FirstOrDefault(x => x.BeatInfo.MeasureDecimal >= currentMeasure);
|
||||
if (gimmick != null)
|
||||
{
|
||||
selectedGimmickIndex = chart.Gimmicks.IndexOf(gimmick);
|
||||
}
|
||||
else
|
||||
{
|
||||
gimmick = chart.Gimmicks.FirstOrDefault(x => x.BeatInfo.MeasureDecimal <= currentMeasure);
|
||||
if (gimmick != null)
|
||||
{
|
||||
selectedGimmickIndex = chart.Gimmicks.IndexOf(gimmick);
|
||||
}
|
||||
}
|
||||
circlePanel.Invalidate();
|
||||
UpdateGimmickLabels();
|
||||
}
|
||||
|
||||
private void gimmickEditButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (selectedGimmickIndex == -1)
|
||||
@@ -1626,7 +1537,7 @@ namespace BAKKA_Editor
|
||||
var gimmick = chart.Gimmicks[selectedGimmickIndex];
|
||||
|
||||
gimmickMeasureLabel.Text = gimmick.BeatInfo.Measure.ToString();
|
||||
var quant = Utils.GetQuantization(gimmick.BeatInfo.Beat, 12);
|
||||
var quant = Utils.GetQuantization(gimmick.BeatInfo.Beat, 16);
|
||||
gimmickBeatLabel.Text = $"{quant.Item1} / {quant.Item2}";
|
||||
gimmickTypeLabel.Text = gimmick.GimmickType.ToLabel();
|
||||
switch (gimmick.GimmickType)
|
||||
@@ -1681,7 +1592,7 @@ namespace BAKKA_Editor
|
||||
var note = chart.Notes[selectedNoteIndex];
|
||||
|
||||
noteMeasureLabel.Text = note.BeatInfo.Measure.ToString();
|
||||
var quant = Utils.GetQuantization(note.BeatInfo.Beat, 12);
|
||||
var quant = Utils.GetQuantization(note.BeatInfo.Beat, 16);
|
||||
noteBeatLabel.Text = $"{quant.Item1} / {quant.Item2}";
|
||||
noteTypeLabel.Text = note.NoteType.ToLabel();
|
||||
notePositionLabel.Text = note.Position.ToString();
|
||||
@@ -1710,8 +1621,8 @@ namespace BAKKA_Editor
|
||||
private void ResetChartTime()
|
||||
{
|
||||
measureNumeric.Value = beat1Numeric.Value = 0;
|
||||
positionNumeric.Value = positionNumeric.Minimum;
|
||||
sizeNumeric.Value = sizeNumeric.Minimum;
|
||||
positionNumeric.Value = 0;
|
||||
sizeNumeric.Value = 1;
|
||||
updateTime();
|
||||
}
|
||||
|
||||
@@ -1743,20 +1654,43 @@ namespace BAKKA_Editor
|
||||
UpdateNoteLabels();
|
||||
}
|
||||
|
||||
private void noteJumpToCurrTimeButton_Click(object sender, EventArgs e)
|
||||
private void notePrevMeasureButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (chart.Notes.Count == 0)
|
||||
return;
|
||||
|
||||
float currentMeasure = circleView.CurrentMeasure;
|
||||
var note = chart.Notes.FirstOrDefault(x => x.BeatInfo.MeasureDecimal >= currentMeasure);
|
||||
int lastMeasure = chart.Notes[selectedNoteIndex].BeatInfo.Measure;
|
||||
var note = chart.Notes.LastOrDefault(x => x.BeatInfo.Measure < lastMeasure);
|
||||
if (note != null)
|
||||
{
|
||||
selectedNoteIndex = chart.Notes.IndexOf(note);
|
||||
}
|
||||
else
|
||||
{
|
||||
note = chart.Notes.FirstOrDefault(x => x.BeatInfo.MeasureDecimal <= currentMeasure);
|
||||
note = chart.Notes.LastOrDefault(x => x.BeatInfo.Measure > lastMeasure);
|
||||
if (note != null)
|
||||
{
|
||||
selectedNoteIndex = chart.Notes.IndexOf(note);
|
||||
}
|
||||
}
|
||||
circlePanel.Invalidate();
|
||||
UpdateNoteLabels();
|
||||
}
|
||||
|
||||
private void noteNextMeasureButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (chart.Notes.Count == 0)
|
||||
return;
|
||||
|
||||
int lastMeasure = chart.Notes[selectedNoteIndex].BeatInfo.Measure;
|
||||
var note = chart.Notes.FirstOrDefault(x => x.BeatInfo.Measure > lastMeasure);
|
||||
if (note != null)
|
||||
{
|
||||
selectedNoteIndex = chart.Notes.IndexOf(note);
|
||||
}
|
||||
else
|
||||
{
|
||||
note = chart.Notes.FirstOrDefault(x => x.BeatInfo.Measure < lastMeasure);
|
||||
if (note != null)
|
||||
{
|
||||
selectedNoteIndex = chart.Notes.IndexOf(note);
|
||||
@@ -1793,32 +1727,7 @@ namespace BAKKA_Editor
|
||||
|
||||
int delIndex = selectedNoteIndex;
|
||||
NoteOperation op = chart.Notes[selectedNoteIndex].IsHold ? new RemoveHoldNote(chart, chart.Notes[selectedNoteIndex]) : new RemoveNote(chart, chart.Notes[selectedNoteIndex]);
|
||||
NoteOperation op2 = null;
|
||||
if (chart.Notes[selectedNoteIndex].NoteType == NoteType.HoldStartBonusFlair || chart.Notes[selectedNoteIndex].NoteType == NoteType.HoldStartNoBonus)
|
||||
{
|
||||
if(chart.Notes[selectedNoteIndex].NextNote != null)
|
||||
{
|
||||
if (chart.Notes[selectedNoteIndex].NextNote.NoteType == NoteType.HoldEnd)
|
||||
{
|
||||
op2 = new RemoveHoldNote(chart, chart.Notes[selectedNoteIndex].NextNote);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (chart.Notes[selectedNoteIndex].NoteType == NoteType.HoldEnd)
|
||||
{
|
||||
if(chart.Notes[selectedNoteIndex].PrevNote != null)
|
||||
{
|
||||
if (chart.Notes[selectedNoteIndex].PrevNote.NoteType == NoteType.HoldStartBonusFlair || chart.Notes[selectedNoteIndex].PrevNote.NoteType == NoteType.HoldStartNoBonus)
|
||||
{
|
||||
op2 = new RemoveHoldNote(chart, chart.Notes[selectedNoteIndex].PrevNote);
|
||||
}
|
||||
}
|
||||
}
|
||||
opManager.InvokeAndPush(op);
|
||||
if (op2 != null)
|
||||
{
|
||||
opManager.InvokeAndPush(op2);
|
||||
}
|
||||
UpdateControlsFromOperation(op, OperationDirection.Redo);
|
||||
if (selectedNoteIndex == delIndex)
|
||||
{
|
||||
@@ -1939,33 +1848,8 @@ namespace BAKKA_Editor
|
||||
if (op != null)
|
||||
{
|
||||
UpdateControlsFromOperation(op, OperationDirection.Undo);
|
||||
//check for if it's a segment hold, if so treat them as 1 object by doing everything twice
|
||||
if (op.GetType() == typeof(RemoveHoldNote))
|
||||
{
|
||||
foreach (var note in chart.Notes)
|
||||
{
|
||||
if (note.IsHold && note.NextNote == null && note.PrevNote == null)
|
||||
{
|
||||
if (opManager.CanUndo)
|
||||
{
|
||||
var op2 = opManager.Undo();
|
||||
if (op2 != null)
|
||||
{
|
||||
UpdateControlsFromOperation(op2, OperationDirection.Undo);
|
||||
//check for the edge case of someone placing a hold start then deleting it
|
||||
if (op2.GetType() == typeof(InsertHoldNote))
|
||||
{
|
||||
redoToolStripMenuItem_Click(sender, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
private void redoToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
@@ -1976,33 +1860,8 @@ namespace BAKKA_Editor
|
||||
if (op != null)
|
||||
{
|
||||
UpdateControlsFromOperation(op, OperationDirection.Redo);
|
||||
//check for if it's a segment hold, if so treat them as 1 object by doing everything twice
|
||||
if (op.GetType() == typeof(RemoveHoldNote))
|
||||
{
|
||||
foreach (var note in chart.Notes)
|
||||
{
|
||||
if (note.IsHold && note.NextNote == null && note.PrevNote == null)
|
||||
{
|
||||
if (opManager.CanRedo)
|
||||
{
|
||||
var op2 = opManager.Redo();
|
||||
if (op2 != null)
|
||||
{
|
||||
UpdateControlsFromOperation(op2, OperationDirection.Redo);
|
||||
//check for the edge case of someone placing a hold start then deleting it
|
||||
if (op2.GetType() == typeof(InsertHoldNote))
|
||||
{
|
||||
undoToolStripMenuItem_Click(sender, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
private void UpdateControlsFromOperation(IOperation op, OperationDirection dir)
|
||||
@@ -2024,11 +1883,6 @@ namespace BAKKA_Editor
|
||||
if (isRemoveHold)
|
||||
{
|
||||
if (note.NextNote == null)
|
||||
{
|
||||
SetNonHoldButtonState(false);
|
||||
SetSelectedObject(NoteType.HoldJoint);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetNonHoldButtonState(true);
|
||||
SetSelectedObject(note.NoteType);
|
||||
@@ -2039,7 +1893,6 @@ namespace BAKKA_Editor
|
||||
{
|
||||
if (isInsertHold)
|
||||
{
|
||||
SetSelectedObject(note.NoteType);
|
||||
lastNote = note.PrevNote;
|
||||
}
|
||||
}
|
||||
@@ -2048,14 +1901,14 @@ namespace BAKKA_Editor
|
||||
if (isInsertHold)
|
||||
{
|
||||
SetNonHoldButtonState(false);
|
||||
SetSelectedObject(NoteType.HoldJoint);
|
||||
SetSelectedObject(note.NoteType);
|
||||
lastNote = note.PrevNote;
|
||||
}
|
||||
}
|
||||
updateTime();
|
||||
}
|
||||
}
|
||||
else //dir == OperationDirection.Redo
|
||||
else
|
||||
{
|
||||
bool isInsertHold = op.GetType() == typeof(InsertHoldNote);
|
||||
bool isRemoveHold = op.GetType() == typeof(RemoveHoldNote);
|
||||
@@ -2066,7 +1919,7 @@ namespace BAKKA_Editor
|
||||
{
|
||||
if (isInsertHold)
|
||||
{
|
||||
SetNonHoldButtonState(false);
|
||||
SetNonHoldButtonState(true);
|
||||
SetSelectedObject(NoteType.HoldJoint);
|
||||
}
|
||||
if (isRemoveHold)
|
||||
@@ -2087,7 +1940,6 @@ namespace BAKKA_Editor
|
||||
if (isInsertHold)
|
||||
{
|
||||
SetNonHoldButtonState(true);
|
||||
endHoldCheck.Checked = false;
|
||||
SetSelectedObject(flairRadio.Checked ? NoteType.HoldStartBonusFlair : NoteType.HoldStartNoBonus);
|
||||
lastNote = note;
|
||||
}
|
||||
@@ -2138,11 +1990,8 @@ namespace BAKKA_Editor
|
||||
|
||||
if ((chart.Notes.Count > 0 || chart.Gimmicks.Count > 0) && !chart.IsSaved)
|
||||
{
|
||||
if (!CurrentlyInsertingHold())
|
||||
{
|
||||
chart.WriteFile(tempFilePath, false);
|
||||
File.WriteAllLines(tempStatusPath, new string[] { "true", DateTime.Now.ToString("yyyy-MM-dd HH:mm") });
|
||||
}
|
||||
chart.WriteFile(tempFilePath, false);
|
||||
File.WriteAllLines(tempStatusPath, new string[] { "true", DateTime.Now.ToString("yyyy-MM-dd HH:mm") });
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2150,15 +1999,6 @@ namespace BAKKA_Editor
|
||||
}
|
||||
}
|
||||
|
||||
bool CurrentlyInsertingHold()
|
||||
{
|
||||
if(currentNoteType == NoteType.HoldJoint || currentNoteType == NoteType.HoldEnd)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void DeleteAutosaves(string keep = "")
|
||||
{
|
||||
var oldAutosave = Directory.GetFiles(Path.GetTempPath(), "*.mer");
|
||||
@@ -2193,5 +2033,10 @@ namespace BAKKA_Editor
|
||||
currentSong.PlaybackSpeed = (trackBarSpeed.Value / (float)trackBarSpeed.Maximum);
|
||||
labelSpeed.Text = $"Speed (x{currentSong.PlaybackSpeed:0.00})";
|
||||
}
|
||||
|
||||
private void linearViewToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
linearForm.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -75,9 +75,6 @@
|
||||
<metadata name="autoSaveTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>651, 17</value>
|
||||
</metadata>
|
||||
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>60</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
|
||||
@@ -148,8 +148,7 @@ namespace BAKKA_Editor.Operations
|
||||
if (nextNote != null)
|
||||
{
|
||||
nextNote.PrevNote = null;
|
||||
if (nextNote.NoteType == NoteType.HoldJoint)
|
||||
nextNote.NoteType = Note.NoteType;
|
||||
nextNote.NoteType = Note.NoteType;
|
||||
}
|
||||
break;
|
||||
case NoteType.HoldJoint:
|
||||
@@ -158,11 +157,8 @@ namespace BAKKA_Editor.Operations
|
||||
nextNote.PrevNote = prevNote;
|
||||
break;
|
||||
case NoteType.HoldEnd:
|
||||
if (prevNote != null)
|
||||
{
|
||||
prevNote.NextNote = null;
|
||||
prevNote.NoteType = NoteType.HoldEnd;
|
||||
}
|
||||
prevNote.NextNote = null;
|
||||
prevNote.NoteType = NoteType.HoldEnd;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -188,11 +184,8 @@ namespace BAKKA_Editor.Operations
|
||||
nextNote.PrevNote = Note;
|
||||
break;
|
||||
case NoteType.HoldEnd:
|
||||
if (prevNote != null)
|
||||
{
|
||||
prevNote.NextNote = Note;
|
||||
prevNote.NoteType = prevNoteType;
|
||||
}
|
||||
prevNote.NextNote = Note;
|
||||
prevNote.NoteType = prevNoteType;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Drawing;
|
||||
|
||||
namespace BAKKA_Editor
|
||||
{
|
||||
internal static class PlotBrush
|
||||
{
|
||||
public static SolidBrush HoldBrush { get; } = new SolidBrush(Color.FromArgb(170, Color.Yellow));
|
||||
public static SolidBrush MaskBrush { get; set; } = new SolidBrush(Color.DimGray);
|
||||
}
|
||||
}
|
||||
@@ -19,9 +19,6 @@ namespace BAKKA_Editor
|
||||
public bool ShowCursorDuringPlayback { get; set; } = false;
|
||||
public bool HighlightViewedNote { get; set; } = true;
|
||||
public bool SelectLastInsertedNote { get; set; } = true;
|
||||
public bool ShowGimmicks { get; set; } = true;
|
||||
public float HispeedSetting { get; set; } = 1.5f;
|
||||
public int Volume { get; set; } = 100;
|
||||
}
|
||||
|
||||
internal class SaveSettings
|
||||
|
||||
+5
-44
@@ -53,6 +53,8 @@ namespace BAKKA_Editor
|
||||
case NoteType.Chain:
|
||||
case NoteType.ChainBonusFlair:
|
||||
return Color.FromArgb(204, 190, 45);
|
||||
case NoteType.MaskAdd:
|
||||
return Color.DimGray;
|
||||
case NoteType.EndOfChart:
|
||||
return Color.Black;
|
||||
default:
|
||||
@@ -60,30 +62,6 @@ namespace BAKKA_Editor
|
||||
}
|
||||
}
|
||||
|
||||
internal static Color GimmickTypeToColor(GimmickType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case GimmickType.NoGimmick:
|
||||
return Color.Transparent;
|
||||
case GimmickType.BpmChange:
|
||||
return Color.FromArgb(200, 0, 255, 255);
|
||||
case GimmickType.TimeSignatureChange:
|
||||
return Color.FromArgb(200, 160, 255, 160);
|
||||
case GimmickType.HiSpeedChange:
|
||||
return Color.FromArgb(200, 0, 255, 0);
|
||||
case GimmickType.ReverseStart:
|
||||
case GimmickType.ReverseMiddle:
|
||||
case GimmickType.ReverseEnd:
|
||||
return Color.FromArgb(200, 255, 255, 0);
|
||||
case GimmickType.StopStart:
|
||||
case GimmickType.StopEnd:
|
||||
return Color.FromArgb(200, 255, 0, 0);
|
||||
default:
|
||||
return Color.Transparent;
|
||||
}
|
||||
}
|
||||
|
||||
internal static void InvokeIfRequired(this Control control, MethodInvoker action)
|
||||
{
|
||||
if (control.InvokeRequired)
|
||||
@@ -193,28 +171,11 @@ namespace BAKKA_Editor
|
||||
|
||||
internal static Tuple<int, int> GetQuantization(int val, int min)
|
||||
{
|
||||
int numerator = val;
|
||||
int denominator = 1920;
|
||||
|
||||
int gcd = GetGcd(numerator, denominator);
|
||||
|
||||
numerator /= gcd;
|
||||
denominator /= gcd;
|
||||
|
||||
while (denominator < min)
|
||||
while (!HasDecimal((double)(val * min) / 1920.0))
|
||||
{
|
||||
numerator *= 2;
|
||||
denominator *= 2;
|
||||
min *= 2;
|
||||
}
|
||||
|
||||
return Tuple.Create(numerator, denominator);
|
||||
}
|
||||
|
||||
private static int GetGcd(int a, int b)
|
||||
{
|
||||
if (b == 0)
|
||||
return a;
|
||||
return GetGcd(b, (int)a % (int)b);
|
||||
return new Tuple<int, int>((int)(val * min / 1920.0), min);
|
||||
}
|
||||
|
||||
internal static float GetDist(Point a, Point b)
|
||||
|
||||
Reference in New Issue
Block a user