From 230b77fb4a69ee685b992b3633c12b8d045a6f3a Mon Sep 17 00:00:00 2001 From: Raymonf Date: Wed, 16 Nov 2022 13:28:03 -0500 Subject: [PATCH] feature: add option for selection of last inserted note --- BAKKA-Editor/MainForm.Designer.cs | 13 ++++++++++++- BAKKA-Editor/MainForm.cs | 4 +++- BAKKA-Editor/UserSettings.cs | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/BAKKA-Editor/MainForm.Designer.cs b/BAKKA-Editor/MainForm.Designer.cs index f466333..2208081 100644 --- a/BAKKA-Editor/MainForm.Designer.cs +++ b/BAKKA-Editor/MainForm.Designer.cs @@ -99,6 +99,7 @@ this.showCursorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.showCursorDuringPlaybackToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.highlightViewedNoteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.selectLastInsertedNoteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.chartToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.initialChartSettingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -939,7 +940,8 @@ this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.showCursorToolStripMenuItem, this.showCursorDuringPlaybackToolStripMenuItem, - this.highlightViewedNoteToolStripMenuItem}); + this.highlightViewedNoteToolStripMenuItem, + this.selectLastInsertedNoteToolStripMenuItem}); this.viewToolStripMenuItem.Name = "viewToolStripMenuItem"; this.viewToolStripMenuItem.Size = new System.Drawing.Size(44, 20); this.viewToolStripMenuItem.Text = "View"; @@ -968,6 +970,14 @@ this.highlightViewedNoteToolStripMenuItem.Name = "highlightViewedNoteToolStripMenuItem"; this.highlightViewedNoteToolStripMenuItem.Size = new System.Drawing.Size(230, 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.Text = "Select Last Inserted Note"; // // chartToolStripMenuItem // @@ -1506,6 +1516,7 @@ private ToolStripMenuItem showCursorToolStripMenuItem; private ToolStripMenuItem showCursorDuringPlaybackToolStripMenuItem; private ToolStripMenuItem highlightViewedNoteToolStripMenuItem; + private ToolStripMenuItem selectLastInsertedNoteToolStripMenuItem; private ToolStripMenuItem chartToolStripMenuItem; private ToolStripMenuItem initialChartSettingsToolStripMenuItem; private ToolStripMenuItem aboutToolStripMenuItem; diff --git a/BAKKA-Editor/MainForm.cs b/BAKKA-Editor/MainForm.cs index 96faebd..0b0f045 100644 --- a/BAKKA-Editor/MainForm.cs +++ b/BAKKA-Editor/MainForm.cs @@ -123,6 +123,7 @@ namespace BAKKA_Editor 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 @@ -1149,7 +1150,8 @@ namespace BAKKA_Editor break; } // new object so update the temporary last note to the new one - nextSelectedNote = tempNote; + if (selectLastInsertedNoteToolStripMenuItem.Checked) + nextSelectedNote = tempNote; chart.Notes.Add(tempNote); chart.IsSaved = false; switch (currentNoteType) diff --git a/BAKKA-Editor/UserSettings.cs b/BAKKA-Editor/UserSettings.cs index 8823a35..1117461 100644 --- a/BAKKA-Editor/UserSettings.cs +++ b/BAKKA-Editor/UserSettings.cs @@ -18,6 +18,7 @@ namespace BAKKA_Editor public bool ShowCursor { get; set; } = true; public bool ShowCursorDuringPlayback { get; set; } = false; public bool HighlightViewedNote { get; set; } = true; + public bool SelectLastInsertedNote { get; set; } = true; } internal class SaveSettings