Author SHA1 Message Date
Goatgarien b56900d6c7 Show gimmicks in circle view with option to disable
Options should actually save between launches now aswell
2023-02-14 21:42:34 -08:00
Goatgarien 64b1be61c9 Jump to nearest note/gimmick at current time 2023-02-14 20:24:04 -08:00
Goatgarien d5106d3030 oop. removed unused code lol 2023-02-05 23:35:00 -08:00
Goatgarien 84a1248234 Fixed issues around deleting the final 2 segments of a hold. 2023-02-05 23:15:48 -08:00
Goatgarien a6be9e759a Fixed undo/redo issues on holds 2023-02-05 20:42:07 -08:00
Ray cd29218fc8 fix: prevent use of hold button while inserting a hold (#15) 2023-02-04 15:43:38 -05:00
veroxzik 8d0b39774e fix: crash on empty lines in *.mer 2022-12-05 20:53:16 -05:00
Zsolt Zitting 971285d0aa fix: incorrect UI scaling 2022-11-22 19:19:43 -07:00
8 changed files with 261 additions and 101 deletions
+3
View File
@@ -80,6 +80,9 @@ 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]));
+25
View File
@@ -242,6 +242,26 @@ 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);
@@ -450,6 +470,11 @@ 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
+65 -51
View File
@@ -108,6 +108,7 @@
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();
@@ -125,8 +126,7 @@
this.label9 = new System.Windows.Forms.Label();
this.noteSizeLabel = new System.Windows.Forms.Label();
this.label17 = new System.Windows.Forms.Label();
this.noteNextMeasureButton = new System.Windows.Forms.Button();
this.notePrevMeasureButton = new System.Windows.Forms.Button();
this.noteJumpToCurrTimeButton = 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,6 +140,7 @@
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.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.beat2Numeric)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.beat1Numeric)).BeginInit();
@@ -437,7 +438,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(86, 23);
this.endChartButton.Size = new System.Drawing.Size(97, 23);
this.endChartButton.TabIndex = 12;
this.endChartButton.Text = "End of Chart";
this.endChartButton.UseVisualStyleBackColor = false;
@@ -448,7 +449,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(86, 23);
this.holdButton.Size = new System.Drawing.Size(97, 23);
this.holdButton.TabIndex = 11;
this.holdButton.Text = "Hold";
this.holdButton.UseVisualStyleBackColor = false;
@@ -459,7 +460,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(86, 23);
this.chainButton.Size = new System.Drawing.Size(97, 23);
this.chainButton.TabIndex = 10;
this.chainButton.Text = "Chain";
this.chainButton.UseVisualStyleBackColor = false;
@@ -471,7 +472,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(86, 23);
this.blueButton.Size = new System.Drawing.Size(97, 23);
this.blueButton.TabIndex = 9;
this.blueButton.Text = "↓ Snap";
this.blueButton.UseVisualStyleBackColor = false;
@@ -483,7 +484,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(86, 23);
this.redButton.Size = new System.Drawing.Size(97, 23);
this.redButton.TabIndex = 8;
this.redButton.Text = "↑ Snap";
this.redButton.UseVisualStyleBackColor = false;
@@ -494,7 +495,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(86, 23);
this.greenButton.Size = new System.Drawing.Size(97, 23);
this.greenButton.TabIndex = 7;
this.greenButton.Text = "⤿ Slide";
this.greenButton.UseVisualStyleBackColor = false;
@@ -505,7 +506,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(86, 23);
this.orangeButton.Size = new System.Drawing.Size(97, 23);
this.orangeButton.TabIndex = 6;
this.orangeButton.Text = "⤾ Slide";
this.orangeButton.UseVisualStyleBackColor = false;
@@ -516,7 +517,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(86, 23);
this.tapButton.Size = new System.Drawing.Size(97, 23);
this.tapButton.TabIndex = 5;
this.tapButton.Text = "Touch";
this.tapButton.UseVisualStyleBackColor = false;
@@ -941,7 +942,8 @@
this.showCursorToolStripMenuItem,
this.showCursorDuringPlaybackToolStripMenuItem,
this.highlightViewedNoteToolStripMenuItem,
this.selectLastInsertedNoteToolStripMenuItem});
this.selectLastInsertedNoteToolStripMenuItem,
this.showGimmicksInCircleViewToolStripMenuItem});
this.viewToolStripMenuItem.Name = "viewToolStripMenuItem";
this.viewToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
this.viewToolStripMenuItem.Text = "View";
@@ -952,14 +954,14 @@
this.showCursorToolStripMenuItem.CheckOnClick = true;
this.showCursorToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
this.showCursorToolStripMenuItem.Name = "showCursorToolStripMenuItem";
this.showCursorToolStripMenuItem.Size = new System.Drawing.Size(230, 22);
this.showCursorToolStripMenuItem.Size = new System.Drawing.Size(233, 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(230, 22);
this.showCursorDuringPlaybackToolStripMenuItem.Size = new System.Drawing.Size(233, 22);
this.showCursorDuringPlaybackToolStripMenuItem.Text = "Show Cursor During Playback";
//
// highlightViewedNoteToolStripMenuItem
@@ -968,15 +970,16 @@
this.highlightViewedNoteToolStripMenuItem.CheckOnClick = true;
this.highlightViewedNoteToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
this.highlightViewedNoteToolStripMenuItem.Name = "highlightViewedNoteToolStripMenuItem";
this.highlightViewedNoteToolStripMenuItem.Size = new System.Drawing.Size(230, 22);
this.highlightViewedNoteToolStripMenuItem.Size = new System.Drawing.Size(233, 22);
this.highlightViewedNoteToolStripMenuItem.Text = "Highlight Viewed Note";
//
// selectLastInsertedNoteToolStripMenuItem
//
this.selectLastInsertedNoteToolStripMenuItem.Checked = true;
this.selectLastInsertedNoteToolStripMenuItem.CheckOnClick = true;
this.selectLastInsertedNoteToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
this.selectLastInsertedNoteToolStripMenuItem.Name = "selectLastInsertedNoteToolStripMenuItem";
this.selectLastInsertedNoteToolStripMenuItem.Size = new System.Drawing.Size(285, 26);
this.selectLastInsertedNoteToolStripMenuItem.Size = new System.Drawing.Size(233, 22);
this.selectLastInsertedNoteToolStripMenuItem.Text = "Select Last Inserted Note";
//
// chartToolStripMenuItem
@@ -1046,6 +1049,7 @@
// 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);
@@ -1058,17 +1062,27 @@
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, 633);
this.groupBox6.Location = new System.Drawing.Point(874, 602);
this.groupBox6.Name = "groupBox6";
this.groupBox6.Size = new System.Drawing.Size(256, 142);
this.groupBox6.Size = new System.Drawing.Size(256, 173);
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, 109);
this.gimmickDeleteButton.Location = new System.Drawing.Point(134, 139);
this.gimmickDeleteButton.Name = "gimmickDeleteButton";
this.gimmickDeleteButton.Size = new System.Drawing.Size(113, 23);
this.gimmickDeleteButton.TabIndex = 11;
@@ -1078,7 +1092,7 @@
//
// gimmickEditButton
//
this.gimmickEditButton.Location = new System.Drawing.Point(6, 109);
this.gimmickEditButton.Location = new System.Drawing.Point(6, 139);
this.gimmickEditButton.Name = "gimmickEditButton";
this.gimmickEditButton.Size = new System.Drawing.Size(113, 23);
this.gimmickEditButton.TabIndex = 10;
@@ -1089,7 +1103,7 @@
// gimmickBeatLabel
//
this.gimmickBeatLabel.AutoSize = true;
this.gimmickBeatLabel.Location = new System.Drawing.Point(173, 47);
this.gimmickBeatLabel.Location = new System.Drawing.Point(173, 78);
this.gimmickBeatLabel.Name = "gimmickBeatLabel";
this.gimmickBeatLabel.Size = new System.Drawing.Size(36, 15);
this.gimmickBeatLabel.TabIndex = 9;
@@ -1098,7 +1112,7 @@
// gimmickValueLabel
//
this.gimmickValueLabel.AutoSize = true;
this.gimmickValueLabel.Location = new System.Drawing.Point(76, 89);
this.gimmickValueLabel.Location = new System.Drawing.Point(76, 120);
this.gimmickValueLabel.Name = "gimmickValueLabel";
this.gimmickValueLabel.Size = new System.Drawing.Size(36, 15);
this.gimmickValueLabel.TabIndex = 8;
@@ -1107,7 +1121,7 @@
// gimmickTypeLabel
//
this.gimmickTypeLabel.AutoSize = true;
this.gimmickTypeLabel.Location = new System.Drawing.Point(76, 68);
this.gimmickTypeLabel.Location = new System.Drawing.Point(76, 99);
this.gimmickTypeLabel.Name = "gimmickTypeLabel";
this.gimmickTypeLabel.Size = new System.Drawing.Size(36, 15);
this.gimmickTypeLabel.TabIndex = 7;
@@ -1116,7 +1130,7 @@
// gimmickMeasureLabel
//
this.gimmickMeasureLabel.AutoSize = true;
this.gimmickMeasureLabel.Location = new System.Drawing.Point(76, 47);
this.gimmickMeasureLabel.Location = new System.Drawing.Point(76, 78);
this.gimmickMeasureLabel.Name = "gimmickMeasureLabel";
this.gimmickMeasureLabel.Size = new System.Drawing.Size(36, 15);
this.gimmickMeasureLabel.TabIndex = 6;
@@ -1126,7 +1140,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, 45);
this.label8.Location = new System.Drawing.Point(128, 76);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(39, 17);
this.label8.TabIndex = 5;
@@ -1136,7 +1150,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, 87);
this.label7.Location = new System.Drawing.Point(24, 118);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(46, 17);
this.label7.TabIndex = 4;
@@ -1146,7 +1160,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, 66);
this.label6.Location = new System.Drawing.Point(29, 97);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(41, 17);
this.label6.TabIndex = 3;
@@ -1156,7 +1170,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, 45);
this.label5.Location = new System.Drawing.Point(6, 76);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(64, 17);
this.label5.TabIndex = 2;
@@ -1189,8 +1203,7 @@
this.noteViewGroupBox.Controls.Add(this.label9);
this.noteViewGroupBox.Controls.Add(this.noteSizeLabel);
this.noteViewGroupBox.Controls.Add(this.label17);
this.noteViewGroupBox.Controls.Add(this.noteNextMeasureButton);
this.noteViewGroupBox.Controls.Add(this.notePrevMeasureButton);
this.noteViewGroupBox.Controls.Add(this.noteJumpToCurrTimeButton);
this.noteViewGroupBox.Controls.Add(this.noteDeleteSelectedButton);
this.noteViewGroupBox.Controls.Add(this.noteEditSelectedButton);
this.noteViewGroupBox.Controls.Add(this.noteBeatLabel);
@@ -1203,7 +1216,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, 420);
this.noteViewGroupBox.Location = new System.Drawing.Point(874, 389);
this.noteViewGroupBox.Name = "noteViewGroupBox";
this.noteViewGroupBox.Size = new System.Drawing.Size(256, 207);
this.noteViewGroupBox.TabIndex = 34;
@@ -1248,25 +1261,15 @@
this.label17.TabIndex = 14;
this.label17.Text = "Size:";
//
// noteNextMeasureButton
// noteJumpToCurrTimeButton
//
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);
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);
//
// noteDeleteSelectedButton
//
@@ -1389,6 +1392,16 @@
//
this.autoSaveTimer.Tick += new System.EventHandler(this.autoSaveTimer_Tick);
//
// 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);
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
@@ -1409,7 +1422,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(1154, 812);
this.MinimumSize = new System.Drawing.Size(1158, 826);
this.Name = "MainForm";
this.Text = "BAKKA Editor - [New File]";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing);
@@ -1539,8 +1552,7 @@
private Label label9;
private Label noteSizeLabel;
private Label label17;
private Button noteNextMeasureButton;
private Button notePrevMeasureButton;
private Button noteJumpToCurrTimeButton;
private Button noteDeleteSelectedButton;
private Button noteEditSelectedButton;
private Label noteBeatLabel;
@@ -1561,5 +1573,7 @@
private TrackBar trackBarVolume;
private Label labelSpeed;
private TrackBar trackBarSpeed;
private Button gimmickJumpToCurrTimeButton;
private ToolStripMenuItem showGimmicksInCircleViewToolStripMenuItem;
}
}
+128 -45
View File
@@ -30,6 +30,7 @@ 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();
@@ -123,11 +124,12 @@ 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;
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;
showGimmicksInCircleViewToolStripMenuItem.Checked = userSettings.ViewSettings.ShowGimmicks;
selectLastInsertedNoteToolStripMenuItem.Checked = userSettings.ViewSettings.SelectLastInsertedNote;
autoSaveTimer.Interval = userSettings.SaveSettings.AutoSaveInterval * 60000;
autoSaveTimer.Enabled = true;
// Update hotkey labels
tapButton.AppendHotkey(userSettings.HotkeySettings.TouchHotkey);
@@ -283,16 +285,23 @@ namespace BAKKA_Editor
if (result == DialogResult.OK)
{
chart.WriteFile(saveFileDialog.FileName);
isNewFile = false;
if (isRecoveredFile)
if (CurrentlyInsertingHold())
{
DeleteAutosaves();
autosaveFile = "";
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();
}
isRecoveredFile = false;
File.WriteAllText(tempStatusPath, "false");
SetText();
}
return result;
}
@@ -337,6 +346,16 @@ 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)
@@ -381,6 +400,7 @@ namespace BAKKA_Editor
updateLabel("Hold Middle");
break;
case NoteType.HoldEnd:
endHoldCheck.Checked = true;
updateLabel("Hold End");
break;
case NoteType.MaskAdd:
@@ -525,6 +545,9 @@ namespace BAKKA_Editor
// Draw degree lines
circleView.DrawDegreeLines();
// Draw Gimmicks
circleView.DrawGimmicks(chart, showGimmicksInCircleViewToolStripMenuItem.Checked, selectedGimmickIndex);
// Draw holds
circleView.DrawHolds(chart, highlightViewedNoteToolStripMenuItem.Checked, selectedNoteIndex);
@@ -728,6 +751,10 @@ 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)
@@ -1197,6 +1224,8 @@ namespace BAKKA_Editor
private void SetNonHoldButtonState(bool state)
{
isInsertingHold = !state;
tapButton.Enabled = state;
orangeButton.Enabled = state;
greenButton.Enabled = state;
@@ -1363,6 +1392,11 @@ namespace BAKKA_Editor
{
circlePanel.Invalidate();
}
private void showGimmicksInCircleViewToolStripMenuItem_Click(object sender, EventArgs e)
{
circlePanel.Invalidate();
}
private void gimmickPrevButton_Click(object sender, EventArgs e)
{
@@ -1390,6 +1424,29 @@ 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)
@@ -1644,43 +1701,20 @@ namespace BAKKA_Editor
UpdateNoteLabels();
}
private void notePrevMeasureButton_Click(object sender, EventArgs e)
private void noteJumpToCurrTimeButton_Click(object sender, EventArgs e)
{
if (chart.Notes.Count == 0)
return;
int lastMeasure = chart.Notes[selectedNoteIndex].BeatInfo.Measure;
var note = chart.Notes.LastOrDefault(x => x.BeatInfo.Measure < lastMeasure);
float currentMeasure = circleView.CurrentMeasure;
var note = chart.Notes.FirstOrDefault(x => x.BeatInfo.MeasureDecimal >= currentMeasure);
if (note != null)
{
selectedNoteIndex = chart.Notes.IndexOf(note);
}
else
{
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);
note = chart.Notes.FirstOrDefault(x => x.BeatInfo.MeasureDecimal <= currentMeasure);
if (note != null)
{
selectedNoteIndex = chart.Notes.IndexOf(note);
@@ -1717,7 +1751,26 @@ 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)
{
@@ -1838,6 +1891,17 @@ 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;
}
}
}
}
}
}
@@ -1873,6 +1937,11 @@ namespace BAKKA_Editor
if (isRemoveHold)
{
if (note.NextNote == null)
{
SetNonHoldButtonState(false);
SetSelectedObject(NoteType.HoldJoint);
}
else
{
SetNonHoldButtonState(true);
SetSelectedObject(note.NoteType);
@@ -1883,6 +1952,7 @@ namespace BAKKA_Editor
{
if (isInsertHold)
{
SetSelectedObject(note.NoteType);
lastNote = note.PrevNote;
}
}
@@ -1891,14 +1961,14 @@ namespace BAKKA_Editor
if (isInsertHold)
{
SetNonHoldButtonState(false);
SetSelectedObject(note.NoteType);
SetSelectedObject(NoteType.HoldJoint);
lastNote = note.PrevNote;
}
}
updateTime();
}
}
else
else //dir == OperationDirection.Redo
{
bool isInsertHold = op.GetType() == typeof(InsertHoldNote);
bool isRemoveHold = op.GetType() == typeof(RemoveHoldNote);
@@ -1909,7 +1979,7 @@ namespace BAKKA_Editor
{
if (isInsertHold)
{
SetNonHoldButtonState(true);
SetNonHoldButtonState(false);
SetSelectedObject(NoteType.HoldJoint);
}
if (isRemoveHold)
@@ -1930,6 +2000,7 @@ namespace BAKKA_Editor
if (isInsertHold)
{
SetNonHoldButtonState(true);
endHoldCheck.Checked = false;
SetSelectedObject(flairRadio.Checked ? NoteType.HoldStartBonusFlair : NoteType.HoldStartNoBonus);
lastNote = note;
}
@@ -1980,8 +2051,11 @@ namespace BAKKA_Editor
if ((chart.Notes.Count > 0 || chart.Gimmicks.Count > 0) && !chart.IsSaved)
{
chart.WriteFile(tempFilePath, false);
File.WriteAllLines(tempStatusPath, new string[] { "true", DateTime.Now.ToString("yyyy-MM-dd HH:mm") });
if (!CurrentlyInsertingHold())
{
chart.WriteFile(tempFilePath, false);
File.WriteAllLines(tempStatusPath, new string[] { "true", DateTime.Now.ToString("yyyy-MM-dd HH:mm") });
}
}
else
{
@@ -1989,6 +2063,15 @@ 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");
+3
View File
@@ -75,6 +75,9 @@
<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>
+12 -5
View File
@@ -148,7 +148,8 @@ namespace BAKKA_Editor.Operations
if (nextNote != null)
{
nextNote.PrevNote = null;
nextNote.NoteType = Note.NoteType;
if (nextNote.NoteType == NoteType.HoldJoint)
nextNote.NoteType = Note.NoteType;
}
break;
case NoteType.HoldJoint:
@@ -157,8 +158,11 @@ namespace BAKKA_Editor.Operations
nextNote.PrevNote = prevNote;
break;
case NoteType.HoldEnd:
prevNote.NextNote = null;
prevNote.NoteType = NoteType.HoldEnd;
if (prevNote != null)
{
prevNote.NextNote = null;
prevNote.NoteType = NoteType.HoldEnd;
}
break;
default:
break;
@@ -184,8 +188,11 @@ namespace BAKKA_Editor.Operations
nextNote.PrevNote = Note;
break;
case NoteType.HoldEnd:
prevNote.NextNote = Note;
prevNote.NoteType = prevNoteType;
if (prevNote != null)
{
prevNote.NextNote = Note;
prevNote.NoteType = prevNoteType;
}
break;
default:
break;
+1
View File
@@ -19,6 +19,7 @@ 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
+24
View File
@@ -60,6 +60,30 @@ 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)