Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f101b2b1f8 | ||
|
|
c37b538b33 |
@@ -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]));
|
||||
|
||||
@@ -26,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; }
|
||||
@@ -182,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
|
||||
{
|
||||
@@ -242,32 +240,12 @@ 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 + TotalMeasureShowNotes)).ToList();
|
||||
|
||||
foreach (var gimmick in drawGimmicks)
|
||||
{
|
||||
var info = GetScaledRect(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(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
|
||||
@@ -317,7 +295,7 @@ 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
|
||||
@@ -352,7 +330,7 @@ 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
|
||||
@@ -362,7 +340,7 @@ namespace BAKKA_Editor
|
||||
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
|
||||
@@ -388,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
|
||||
@@ -470,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
+66
-61
@@ -108,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();
|
||||
@@ -126,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();
|
||||
@@ -140,7 +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.showGimmicksInCircleViewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
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();
|
||||
@@ -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;
|
||||
@@ -943,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";
|
||||
@@ -954,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
|
||||
@@ -970,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
|
||||
@@ -979,7 +981,7 @@
|
||||
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";
|
||||
//
|
||||
// chartToolStripMenuItem
|
||||
@@ -1049,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);
|
||||
@@ -1062,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;
|
||||
@@ -1092,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;
|
||||
@@ -1103,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;
|
||||
@@ -1112,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;
|
||||
@@ -1121,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;
|
||||
@@ -1130,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;
|
||||
@@ -1140,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;
|
||||
@@ -1150,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;
|
||||
@@ -1160,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;
|
||||
@@ -1170,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;
|
||||
@@ -1203,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);
|
||||
@@ -1216,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;
|
||||
@@ -1261,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
|
||||
//
|
||||
@@ -1392,15 +1394,17 @@
|
||||
//
|
||||
this.autoSaveTimer.Tick += new System.EventHandler(this.autoSaveTimer_Tick);
|
||||
//
|
||||
// showGimmicksInCircleViewToolStripMenuItem
|
||||
// toolStripSeparator1
|
||||
//
|
||||
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);
|
||||
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
|
||||
//
|
||||
@@ -1422,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);
|
||||
@@ -1552,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;
|
||||
@@ -1573,7 +1578,7 @@
|
||||
private TrackBar trackBarVolume;
|
||||
private Label labelSpeed;
|
||||
private TrackBar trackBarSpeed;
|
||||
private Button gimmickJumpToCurrTimeButton;
|
||||
private ToolStripMenuItem showGimmicksInCircleViewToolStripMenuItem;
|
||||
private ToolStripSeparator toolStripSeparator1;
|
||||
private ToolStripMenuItem linearViewToolStripMenuItem;
|
||||
}
|
||||
}
|
||||
+60
-128
@@ -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,12 +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;
|
||||
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);
|
||||
@@ -226,6 +232,7 @@ namespace BAKKA_Editor
|
||||
SetText();
|
||||
opManager.Clear();
|
||||
circlePanel.Invalidate();
|
||||
linearForm.Chart = chart;
|
||||
}
|
||||
|
||||
private void openToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
@@ -272,6 +279,7 @@ namespace BAKKA_Editor
|
||||
SetText();
|
||||
}
|
||||
circlePanel.Invalidate();
|
||||
linearForm.Chart = chart;
|
||||
}
|
||||
|
||||
private void saveToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
@@ -285,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;
|
||||
}
|
||||
@@ -346,16 +347,6 @@ 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.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)
|
||||
@@ -400,7 +391,6 @@ namespace BAKKA_Editor
|
||||
updateLabel("Hold Middle");
|
||||
break;
|
||||
case NoteType.HoldEnd:
|
||||
endHoldCheck.Checked = true;
|
||||
updateLabel("Hold End");
|
||||
break;
|
||||
case NoteType.MaskAdd:
|
||||
@@ -545,9 +535,6 @@ namespace BAKKA_Editor
|
||||
// Draw degree lines
|
||||
circleView.DrawDegreeLines();
|
||||
|
||||
// Draw Gimmicks
|
||||
circleView.DrawGimmicks(chart, showGimmicksInCircleViewToolStripMenuItem.Checked, selectedGimmickIndex);
|
||||
|
||||
// Draw holds
|
||||
circleView.DrawHolds(chart, highlightViewedNoteToolStripMenuItem.Checked, selectedNoteIndex);
|
||||
|
||||
@@ -751,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)
|
||||
@@ -1224,8 +1207,6 @@ namespace BAKKA_Editor
|
||||
|
||||
private void SetNonHoldButtonState(bool state)
|
||||
{
|
||||
isInsertingHold = !state;
|
||||
|
||||
tapButton.Enabled = state;
|
||||
orangeButton.Enabled = state;
|
||||
greenButton.Enabled = state;
|
||||
@@ -1392,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)
|
||||
{
|
||||
@@ -1424,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)
|
||||
@@ -1701,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);
|
||||
@@ -1751,26 +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.NoteType == NoteType.HoldEnd)
|
||||
{
|
||||
op2 = new RemoveHoldNote(chart, chart.Notes[selectedNoteIndex].NextNote);
|
||||
}
|
||||
}
|
||||
if (chart.Notes[selectedNoteIndex].NoteType == NoteType.HoldEnd)
|
||||
{
|
||||
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)
|
||||
{
|
||||
@@ -1891,17 +1848,6 @@ namespace BAKKA_Editor
|
||||
if (op != null)
|
||||
{
|
||||
UpdateControlsFromOperation(op, OperationDirection.Undo);
|
||||
if (op.GetType() == typeof(RemoveHoldNote))
|
||||
{
|
||||
foreach (var note in chart.Notes)
|
||||
{
|
||||
if (note.IsHold && note.NextNote == null && note.PrevNote == null)
|
||||
{
|
||||
undoToolStripMenuItem_Click(sender, e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1937,11 +1883,6 @@ namespace BAKKA_Editor
|
||||
if (isRemoveHold)
|
||||
{
|
||||
if (note.NextNote == null)
|
||||
{
|
||||
SetNonHoldButtonState(false);
|
||||
SetSelectedObject(NoteType.HoldJoint);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetNonHoldButtonState(true);
|
||||
SetSelectedObject(note.NoteType);
|
||||
@@ -1952,7 +1893,6 @@ namespace BAKKA_Editor
|
||||
{
|
||||
if (isInsertHold)
|
||||
{
|
||||
SetSelectedObject(note.NoteType);
|
||||
lastNote = note.PrevNote;
|
||||
}
|
||||
}
|
||||
@@ -1961,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);
|
||||
@@ -1979,7 +1919,7 @@ namespace BAKKA_Editor
|
||||
{
|
||||
if (isInsertHold)
|
||||
{
|
||||
SetNonHoldButtonState(false);
|
||||
SetNonHoldButtonState(true);
|
||||
SetSelectedObject(NoteType.HoldJoint);
|
||||
}
|
||||
if (isRemoveHold)
|
||||
@@ -2000,7 +1940,6 @@ namespace BAKKA_Editor
|
||||
if (isInsertHold)
|
||||
{
|
||||
SetNonHoldButtonState(true);
|
||||
endHoldCheck.Checked = false;
|
||||
SetSelectedObject(flairRadio.Checked ? NoteType.HoldStartBonusFlair : NoteType.HoldStartNoBonus);
|
||||
lastNote = note;
|
||||
}
|
||||
@@ -2051,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
|
||||
{
|
||||
@@ -2063,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");
|
||||
@@ -2106,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,7 +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;
|
||||
}
|
||||
|
||||
internal class SaveSettings
|
||||
|
||||
+2
-24
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user