From 250b839e2c5958b2f95e69a2bd668822ee0bf918 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Tue, 3 Jan 2023 06:05:19 +1000 Subject: [PATCH] Extract method from `LoadBranchToolStripMenuItem_Click` --- .../tools/TAStudio/BookmarksBranchesBox.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs b/src/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs index 81875fe42e..a372f19a87 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs @@ -247,7 +247,7 @@ namespace BizHawk.Client.EmuHawk Tastudio.MainForm.AddOnScreenMessage($"Added branch {Branches.Current + 1}"); } - private void LoadBranchToolStripMenuItem_Click(object sender, EventArgs e) + private void PrepareHistoryAndLoadSelectedBranch() { _backupBranch = CreateBranch(); @@ -270,6 +270,9 @@ namespace BizHawk.Client.EmuHawk } } + private void LoadBranchToolStripMenuItem_Click(object sender, EventArgs e) + => PrepareHistoryAndLoadSelectedBranch(); + private void UpdateBranchToolStripMenuItem_Click(object sender, EventArgs e) { if (SelectedBranch == null) @@ -423,7 +426,7 @@ namespace BizHawk.Client.EmuHawk } } - LoadBranchToolStripMenuItem_Click(null, null); + PrepareHistoryAndLoadSelectedBranch(); } public void UpdateBranchExternal(int slot = -1) @@ -610,7 +613,7 @@ namespace BizHawk.Client.EmuHawk { if (Tastudio.Settings.LoadBranchOnDoubleClick) { - LoadBranchToolStripMenuItem_Click(null, null); + PrepareHistoryAndLoadSelectedBranch(); } }