Skip to content

Commit 1e39743

Browse files
committed
change TAStudio layout when rotation changes
- addresses #3708
1 parent 8efeda8 commit 1e39743

File tree

4 files changed

+22
-11
lines changed

4 files changed

+22
-11
lines changed

src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,10 @@ public int HoverInterval
477477
[Description("Occurs when a cell is dragged and then dropped into a new cell, old cell is the cell that was being dragged, new cell is its new destination")]
478478
public event CellDroppedEvent CellDropped;
479479

480+
[Category("Property Changed")]
481+
[Description("Fires after rotation has been changed.")]
482+
public event EventHandler RotationChanged;
483+
480484
/// <summary>
481485
/// Retrieve the text for a cell
482486
/// </summary>
@@ -1568,6 +1572,7 @@ protected override void OnResize(EventArgs e)
15681572

15691573
private void OrientationChanged()
15701574
{
1575+
RotationChanged?.Invoke(this, EventArgs.Empty);
15711576
// TODO scroll to correct positions
15721577
ColumnChangedCallback();
15731578
Refresh();

src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,6 @@ private void FollowCursorMenuItem_DropDownOpened(object sender, EventArgs e)
10191019
private void RotateMenuItem_Click(object sender, EventArgs e)
10201020
{
10211021
TasView.HorizontalOrientation = !TasView.HorizontalOrientation;
1022-
CurrentTasMovie.FlagChanges();
10231022
}
10241023

10251024
private void HideLagFramesX_Click(object sender, EventArgs e)

src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -180,16 +180,7 @@ private void Tastudio_Load(object sender, EventArgs e)
180180
return;
181181
}
182182

183-
if (TasView.Rotatable)
184-
{
185-
RightClickMenu.Items.AddRange(TasView.GenerateContextMenuItems()
186-
.ToArray());
187-
188-
RightClickMenu.Items
189-
.OfType<ToolStripMenuItem>()
190-
.First(t => t.Name == "RotateMenuItem")
191-
.Click += (o, ov) => { CurrentTasMovie.FlagChanges(); };
192-
}
183+
RightClickMenu.Items.AddRange(TasView.GenerateContextMenuItems().ToArray());
193184

194185
TasView.ScrollSpeed = Settings.ScrollSpeed;
195186
TasView.AlwaysScroll = Settings.FollowCursorAlwaysScroll;
@@ -1251,5 +1242,20 @@ private IMovieController ControllerFromMnemonicStr(string inputLogEntry)
12511242
}
12521243
}
12531244
}
1245+
1246+
private void HandleRotationChanged(object sender, EventArgs e)
1247+
{
1248+
CurrentTasMovie.FlagChanges();
1249+
if (TasView.HorizontalOrientation)
1250+
{
1251+
BranchesMarkersSplit.Orientation = Orientation.Vertical;
1252+
BranchesMarkersSplit.SplitterDistance = 200;
1253+
}
1254+
else
1255+
{
1256+
BranchesMarkersSplit.Orientation = Orientation.Horizontal;
1257+
BranchesMarkersSplit.SplitterDistance = _defaultBranchMarkerSplitDistance;
1258+
}
1259+
}
12541260
}
12551261
}

0 commit comments

Comments
 (0)