diff --git a/BAKKA-Editor/CircleView.cs b/BAKKA-Editor/CircleView.cs index 6f3702e..2552ac9 100644 --- a/BAKKA-Editor/CircleView.cs +++ b/BAKKA-Editor/CircleView.cs @@ -242,6 +242,26 @@ namespace BAKKA_Editor } } + public void DrawGimmicks(Chart chart, bool showGimmicks, int selectedGimmickIndex) + { + if (showGimmicks) + { + List 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 diff --git a/BAKKA-Editor/MainForm.Designer.cs b/BAKKA-Editor/MainForm.Designer.cs index bb84e49..5f9ae66 100644 --- a/BAKKA-Editor/MainForm.Designer.cs +++ b/BAKKA-Editor/MainForm.Designer.cs @@ -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(); @@ -139,7 +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.gimmickJumpToCurrTimeButton = new System.Windows.Forms.Button(); + this.showGimmicksInCircleViewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.beat2Numeric)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.beat1Numeric)).BeginInit(); @@ -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,7 +970,7 @@ 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 @@ -977,7 +979,7 @@ this.selectLastInsertedNoteToolStripMenuItem.CheckOnClick = true; this.selectLastInsertedNoteToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; this.selectLastInsertedNoteToolStripMenuItem.Name = "selectLastInsertedNoteToolStripMenuItem"; - this.selectLastInsertedNoteToolStripMenuItem.Size = new System.Drawing.Size(230, 22); + this.selectLastInsertedNoteToolStripMenuItem.Size = new System.Drawing.Size(233, 22); this.selectLastInsertedNoteToolStripMenuItem.Text = "Select Last Inserted Note"; // // chartToolStripMenuItem @@ -1067,6 +1069,16 @@ 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; @@ -1380,15 +1392,15 @@ // this.autoSaveTimer.Tick += new System.EventHandler(this.autoSaveTimer_Tick); // - // gimmickJumpToCurrTimeButton + // showGimmicksInCircleViewToolStripMenuItem // - 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); + 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 // @@ -1562,5 +1574,6 @@ private Label labelSpeed; private TrackBar trackBarSpeed; private Button gimmickJumpToCurrTimeButton; + private ToolStripMenuItem showGimmicksInCircleViewToolStripMenuItem; } } \ No newline at end of file diff --git a/BAKKA-Editor/MainForm.cs b/BAKKA-Editor/MainForm.cs index e5580f0..2c497da 100644 --- a/BAKKA-Editor/MainForm.cs +++ b/BAKKA-Editor/MainForm.cs @@ -124,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); @@ -345,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) @@ -534,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); @@ -1378,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) { diff --git a/BAKKA-Editor/UserSettings.cs b/BAKKA-Editor/UserSettings.cs index 1117461..00dcb6b 100644 --- a/BAKKA-Editor/UserSettings.cs +++ b/BAKKA-Editor/UserSettings.cs @@ -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 diff --git a/BAKKA-Editor/Utils.cs b/BAKKA-Editor/Utils.cs index c958074..3f09276 100644 --- a/BAKKA-Editor/Utils.cs +++ b/BAKKA-Editor/Utils.cs @@ -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)