From 97721ddcc355b9599b4e638f3fb3906fcfed9ad9 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 18 Oct 2014 20:29:23 +0000 Subject: [PATCH] InputRoll - fix logic in vertical view that was not drawing text in a column if any pixel of the column went off screen, save HorizontalOrientation in settings --- .../tools/TAStudio/InputRoll.cs | 34 ++++++++++++++++--- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs index 7956a7d3d0..7b39b6d54a 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs @@ -421,16 +421,39 @@ namespace BizHawk.Client.EmuHawk public string UserSettingsSerialized() { - // TODO: More than just columns - var settings = ConfigService.SaveWithType(_columns); + var settings = ConfigService.SaveWithType(Settings); return settings; } public void LoadSettingsSerialized(string settingsJson) { - // TODO: more than just columns var settings = ConfigService.LoadWithType(settingsJson); - _columns = (RollColumns)settings; + + // TODO: don't silently fail, inform the user somehow + if (settings is InputRollSettings) + { + _columns = (settings as InputRollSettings).Columns; + HorizontalOrientation = (settings as InputRollSettings).HorizontalOrientation; + } + } + + + private InputRollSettings Settings + { + get + { + return new InputRollSettings + { + Columns = _columns, + HorizontalOrientation = HorizontalOrientation + }; + } + } + + public class InputRollSettings + { + public RollColumns Columns { get; set; } + public bool HorizontalOrientation { get; set; } } /// @@ -716,10 +739,11 @@ namespace BizHawk.Client.EmuHawk for (int j = 0; j < columns.Count; j++) // Horizontal { var col = columns[j]; - if (col.Left.Value < 0 || col.Right.Value > DrawWidth) + if (col.Left.Value < 0 || col.Left.Value > DrawWidth) { continue; } + string text; var point = new Point(col.Left.Value + xPadding, RowsToPixels(i) + CellHeightPadding);