Cheats dialog - convert to using ConfigPersist, and simplify some code
This commit is contained in:
parent
757ca11e98
commit
d809da1e8d
|
@ -409,65 +409,12 @@ namespace BizHawk.Client.Common
|
||||||
public Dictionary<string, ToolDialogSettings> CommonToolSettings = new Dictionary<string, ToolDialogSettings>();
|
public Dictionary<string, ToolDialogSettings> CommonToolSettings = new Dictionary<string, ToolDialogSettings>();
|
||||||
public Dictionary<string, Dictionary<string, object>> CustomToolSettings = new Dictionary<string, Dictionary<string, object>>();
|
public Dictionary<string, Dictionary<string, object>> CustomToolSettings = new Dictionary<string, Dictionary<string, object>>();
|
||||||
|
|
||||||
#region Cheats Dialog
|
#region Cheats
|
||||||
|
|
||||||
public ToolDialogSettings CheatsSettings = new ToolDialogSettings();
|
|
||||||
public bool Cheats_ValuesAsHex = true;
|
|
||||||
public bool DisableCheatsOnLoad = false;
|
public bool DisableCheatsOnLoad = false;
|
||||||
public bool LoadCheatFileByGame = true;
|
public bool LoadCheatFileByGame = true;
|
||||||
public bool CheatsAutoSaveOnClose = true;
|
public bool CheatsAutoSaveOnClose = true;
|
||||||
public RecentFiles RecentCheats = new RecentFiles(8);
|
public RecentFiles RecentCheats = new RecentFiles(8);
|
||||||
public int CheatsNameWidth = -1;
|
|
||||||
public int CheatsAddressWidth = -1;
|
|
||||||
public int CheatsValueWidth = -1;
|
|
||||||
public int CheatsCompareWidth = -1;
|
|
||||||
public int CheatsDomainWidth = -1;
|
|
||||||
public int CheatsOnWidth = -1;
|
|
||||||
public int CheatsNameIndex = 0;
|
|
||||||
public int CheatsAddressIndex = 1;
|
|
||||||
public int CheatsValueIndex = 2;
|
|
||||||
public int CheatsCompareIndex = 3;
|
|
||||||
public int CheatsOnIndex = 4;
|
|
||||||
public int CheatsDomainIndex = 5;
|
|
||||||
|
|
||||||
public Dictionary<string, int> CheatsColumnWidths = new Dictionary<string, int>
|
|
||||||
{
|
|
||||||
{ "NamesColumn", -1 },
|
|
||||||
{ "AddressColumn", -1 },
|
|
||||||
{ "ValueColumn", -1 },
|
|
||||||
{ "CompareColumn", -1 },
|
|
||||||
{ "OnColumn", -1 },
|
|
||||||
{ "DomainColumn", -1 },
|
|
||||||
{ "SizeColumn", -1 },
|
|
||||||
{ "EndianColumn", -1 },
|
|
||||||
{ "DisplayTypeColumn", -1 },
|
|
||||||
};
|
|
||||||
|
|
||||||
public Dictionary<string, int> CheatsColumnIndices = new Dictionary<string, int>
|
|
||||||
{
|
|
||||||
{ "NamesColumn", 0 },
|
|
||||||
{ "AddressColumn", 1 },
|
|
||||||
{ "ValueColumn", 2 },
|
|
||||||
{ "CompareColumn", 3 },
|
|
||||||
{ "OnColumn", 4 },
|
|
||||||
{ "DomainColumn", 5 },
|
|
||||||
{ "SizeColumn", 6 },
|
|
||||||
{ "EndianColumn", 7 },
|
|
||||||
{ "DisplayTypeColumn", 8 },
|
|
||||||
};
|
|
||||||
|
|
||||||
public Dictionary<string, bool> CheatsColumnShow = new Dictionary<string, bool>
|
|
||||||
{
|
|
||||||
{ "NamesColumn", true },
|
|
||||||
{ "AddressColumn", true },
|
|
||||||
{ "ValueColumn", true },
|
|
||||||
{ "CompareColumn", true },
|
|
||||||
{ "OnColumn", false },
|
|
||||||
{ "DomainColumn", true },
|
|
||||||
{ "SizeColumn", true },
|
|
||||||
{ "EndianColumn", false },
|
|
||||||
{ "DisplayTypeColumn", false },
|
|
||||||
};
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,58 @@ namespace BizHawk.Client.EmuHawk
|
||||||
[RequiredService] // TODO: use of this property should be factored out
|
[RequiredService] // TODO: use of this property should be factored out
|
||||||
private IEmulator Emu { get; set; }
|
private IEmulator Emu { get; set; }
|
||||||
|
|
||||||
|
[ConfigPersist]
|
||||||
|
public CheatsSettings Settings { get; set; }
|
||||||
|
|
||||||
|
public class CheatsSettings : ToolDialogSettings
|
||||||
|
{
|
||||||
|
public CheatsSettings()
|
||||||
|
{
|
||||||
|
CheatsColumnWidths = new Dictionary<string, int>
|
||||||
|
{
|
||||||
|
{ "NamesColumn", 128 },
|
||||||
|
{ "AddressColumn", 60 },
|
||||||
|
{ "ValueColumn", 59 },
|
||||||
|
{ "CompareColumn", 59 },
|
||||||
|
{ "OnColumn", 28 },
|
||||||
|
{ "DomainColumn", 55 },
|
||||||
|
{ "SizeColumn", 55 },
|
||||||
|
{ "EndianColumn", 55 },
|
||||||
|
{ "DisplayTypeColumn", 55 },
|
||||||
|
};
|
||||||
|
|
||||||
|
CheatsColumnIndices = new Dictionary<string, int>
|
||||||
|
{
|
||||||
|
{ "NamesColumn", 0 },
|
||||||
|
{ "AddressColumn", 1 },
|
||||||
|
{ "ValueColumn", 2 },
|
||||||
|
{ "CompareColumn", 3 },
|
||||||
|
{ "OnColumn", 4 },
|
||||||
|
{ "DomainColumn", 5 },
|
||||||
|
{ "SizeColumn", 6 },
|
||||||
|
{ "EndianColumn", 7 },
|
||||||
|
{ "DisplayTypeColumn", 8 },
|
||||||
|
};
|
||||||
|
|
||||||
|
CheatsColumnShow = new Dictionary<string, bool>
|
||||||
|
{
|
||||||
|
{ "NamesColumn", true },
|
||||||
|
{ "AddressColumn", true },
|
||||||
|
{ "ValueColumn", true },
|
||||||
|
{ "CompareColumn", true },
|
||||||
|
{ "OnColumn", false },
|
||||||
|
{ "DomainColumn", true },
|
||||||
|
{ "SizeColumn", true },
|
||||||
|
{ "EndianColumn", false },
|
||||||
|
{ "DisplayTypeColumn", false },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public Dictionary<string, int> CheatsColumnWidths { get; set; }
|
||||||
|
public Dictionary<string, int> CheatsColumnIndices { get; set; }
|
||||||
|
public Dictionary<string, bool> CheatsColumnShow { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public const string NAME = "NamesColumn";
|
public const string NAME = "NamesColumn";
|
||||||
public const string ADDRESS = "AddressColumn";
|
public const string ADDRESS = "AddressColumn";
|
||||||
public const string VALUE = "ValueColumn";
|
public const string VALUE = "ValueColumn";
|
||||||
|
@ -35,19 +87,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
public const string ENDIAN = "EndianColumn";
|
public const string ENDIAN = "EndianColumn";
|
||||||
public const string TYPE = "DisplayTypeColumn";
|
public const string TYPE = "DisplayTypeColumn";
|
||||||
|
|
||||||
private readonly Dictionary<string, int> _defaultColumnWidths = new Dictionary<string, int>
|
|
||||||
{
|
|
||||||
{ NAME, 128 },
|
|
||||||
{ ADDRESS, 60 },
|
|
||||||
{ VALUE, 59 },
|
|
||||||
{ COMPARE, 59 },
|
|
||||||
{ ON, 28 },
|
|
||||||
{ DOMAIN, 55 },
|
|
||||||
{ SIZE, 55 },
|
|
||||||
{ ENDIAN, 55 },
|
|
||||||
{ TYPE, 55 },
|
|
||||||
};
|
|
||||||
|
|
||||||
private int _defaultWidth;
|
private int _defaultWidth;
|
||||||
private int _defaultHeight;
|
private int _defaultHeight;
|
||||||
private string _sortedColumn = string.Empty;
|
private string _sortedColumn = string.Empty;
|
||||||
|
@ -58,6 +97,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
public Cheats()
|
public Cheats()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
Settings = new CheatsSettings();
|
||||||
|
|
||||||
Closing += (o, e) =>
|
Closing += (o, e) =>
|
||||||
{
|
{
|
||||||
|
@ -77,7 +117,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
_sortedColumn = string.Empty;
|
_sortedColumn = string.Empty;
|
||||||
_sortReverse = false;
|
_sortReverse = false;
|
||||||
TopMost = Global.Config.CheatsSettings.TopMost;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateValues()
|
public void UpdateValues()
|
||||||
|
@ -186,6 +225,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void Cheats_Load(object sender, EventArgs e)
|
private void Cheats_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
TopMost = Settings.TopMost;
|
||||||
CheatEditor.Core = Core;
|
CheatEditor.Core = Core;
|
||||||
LoadConfigSettings();
|
LoadConfigSettings();
|
||||||
ToggleGameGenieButton();
|
ToggleGameGenieButton();
|
||||||
|
@ -221,10 +261,10 @@ namespace BizHawk.Client.EmuHawk
|
||||||
public void SaveConfigSettings()
|
public void SaveConfigSettings()
|
||||||
{
|
{
|
||||||
SaveColumnInfo();
|
SaveColumnInfo();
|
||||||
Global.Config.CheatsSettings.Wndx = Location.X;
|
Settings.Wndx = Location.X;
|
||||||
Global.Config.CheatsSettings.Wndy = Location.Y;
|
Settings.Wndy = Location.Y;
|
||||||
Global.Config.CheatsSettings.Width = Right - Left;
|
Settings.Width = Right - Left;
|
||||||
Global.Config.CheatsSettings.Height = Bottom - Top;
|
Settings.Height = Bottom - Top;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LoadConfigSettings()
|
private void LoadConfigSettings()
|
||||||
|
@ -232,14 +272,14 @@ namespace BizHawk.Client.EmuHawk
|
||||||
_defaultWidth = Size.Width;
|
_defaultWidth = Size.Width;
|
||||||
_defaultHeight = Size.Height;
|
_defaultHeight = Size.Height;
|
||||||
|
|
||||||
if (Global.Config.CheatsSettings.UseWindowPosition)
|
if (Settings.UseWindowPosition)
|
||||||
{
|
{
|
||||||
Location = Global.Config.CheatsSettings.WindowPosition;
|
Location = Settings.WindowPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Global.Config.CheatsSettings.UseWindowSize)
|
if (Settings.UseWindowSize)
|
||||||
{
|
{
|
||||||
Size = Global.Config.CheatsSettings.WindowSize;
|
Size = Settings.WindowSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadColumnInfo();
|
LoadColumnInfo();
|
||||||
|
@ -248,22 +288,22 @@ namespace BizHawk.Client.EmuHawk
|
||||||
private void LoadColumnInfo()
|
private void LoadColumnInfo()
|
||||||
{
|
{
|
||||||
CheatListView.Columns.Clear();
|
CheatListView.Columns.Clear();
|
||||||
CheatListView.AddColumn(NAME, Global.Config.CheatsColumnShow[NAME], GetColumnWidth(NAME));
|
CheatListView.AddColumn(NAME, Settings.CheatsColumnShow[NAME], GetColumnWidth(NAME));
|
||||||
CheatListView.AddColumn(ADDRESS, Global.Config.CheatsColumnShow[ADDRESS], GetColumnWidth(ADDRESS));
|
CheatListView.AddColumn(ADDRESS, Settings.CheatsColumnShow[ADDRESS], GetColumnWidth(ADDRESS));
|
||||||
CheatListView.AddColumn(VALUE, Global.Config.CheatsColumnShow[VALUE], GetColumnWidth(VALUE));
|
CheatListView.AddColumn(VALUE, Settings.CheatsColumnShow[VALUE], GetColumnWidth(VALUE));
|
||||||
CheatListView.AddColumn(COMPARE, Global.Config.CheatsColumnShow[COMPARE], GetColumnWidth(COMPARE));
|
CheatListView.AddColumn(COMPARE, Settings.CheatsColumnShow[COMPARE], GetColumnWidth(COMPARE));
|
||||||
CheatListView.AddColumn(ON, Global.Config.CheatsColumnShow[ON], GetColumnWidth(ON));
|
CheatListView.AddColumn(ON, Settings.CheatsColumnShow[ON], GetColumnWidth(ON));
|
||||||
CheatListView.AddColumn(DOMAIN, Global.Config.CheatsColumnShow[DOMAIN], GetColumnWidth(DOMAIN));
|
CheatListView.AddColumn(DOMAIN, Settings.CheatsColumnShow[DOMAIN], GetColumnWidth(DOMAIN));
|
||||||
CheatListView.AddColumn(SIZE, Global.Config.CheatsColumnShow[SIZE], GetColumnWidth(SIZE));
|
CheatListView.AddColumn(SIZE, Settings.CheatsColumnShow[SIZE], GetColumnWidth(SIZE));
|
||||||
CheatListView.AddColumn(ENDIAN, Global.Config.CheatsColumnShow[ENDIAN], GetColumnWidth(ENDIAN));
|
CheatListView.AddColumn(ENDIAN, Settings.CheatsColumnShow[ENDIAN], GetColumnWidth(ENDIAN));
|
||||||
CheatListView.AddColumn(TYPE, Global.Config.CheatsColumnShow[TYPE], GetColumnWidth(TYPE));
|
CheatListView.AddColumn(TYPE, Settings.CheatsColumnShow[TYPE], GetColumnWidth(TYPE));
|
||||||
|
|
||||||
ColumnPositions();
|
ColumnPositions();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ColumnPositions()
|
private void ColumnPositions()
|
||||||
{
|
{
|
||||||
var columns = Global.Config.CheatsColumnIndices
|
var columns = Settings.CheatsColumnIndices
|
||||||
.Where(x => CheatListView.Columns.ContainsKey(x.Key))
|
.Where(x => CheatListView.Columns.ContainsKey(x.Key))
|
||||||
.OrderBy(x => x.Value)
|
.OrderBy(x => x.Value)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
@ -277,77 +317,72 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: delete me
|
||||||
private int GetColumnWidth(string columnName)
|
private int GetColumnWidth(string columnName)
|
||||||
{
|
{
|
||||||
var width = Global.Config.CheatsColumnWidths[columnName];
|
return Settings.CheatsColumnWidths[columnName];
|
||||||
if (width == -1)
|
|
||||||
{
|
|
||||||
width = _defaultColumnWidths[columnName];
|
|
||||||
}
|
|
||||||
|
|
||||||
return width;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SaveColumnInfo()
|
private void SaveColumnInfo()
|
||||||
{
|
{
|
||||||
if (CheatListView.Columns[NAME] != null)
|
if (CheatListView.Columns[NAME] != null)
|
||||||
{
|
{
|
||||||
Global.Config.CheatsColumnIndices[NAME] = CheatListView.Columns[NAME].DisplayIndex;
|
Settings.CheatsColumnIndices[NAME] = CheatListView.Columns[NAME].DisplayIndex;
|
||||||
Global.Config.CheatsColumnWidths[NAME] = CheatListView.Columns[NAME].Width;
|
Settings.CheatsColumnWidths[NAME] = CheatListView.Columns[NAME].Width;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CheatListView.Columns[ADDRESS] != null)
|
if (CheatListView.Columns[ADDRESS] != null)
|
||||||
{
|
{
|
||||||
Global.Config.CheatsColumnIndices[ADDRESS] = CheatListView.Columns[ADDRESS].DisplayIndex;
|
Settings.CheatsColumnIndices[ADDRESS] = CheatListView.Columns[ADDRESS].DisplayIndex;
|
||||||
Global.Config.CheatsColumnWidths[ADDRESS] = CheatListView.Columns[ADDRESS].Width;
|
Settings.CheatsColumnWidths[ADDRESS] = CheatListView.Columns[ADDRESS].Width;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CheatListView.Columns[VALUE] != null)
|
if (CheatListView.Columns[VALUE] != null)
|
||||||
{
|
{
|
||||||
Global.Config.CheatsColumnIndices[VALUE] = CheatListView.Columns[VALUE].DisplayIndex;
|
Settings.CheatsColumnIndices[VALUE] = CheatListView.Columns[VALUE].DisplayIndex;
|
||||||
Global.Config.CheatsColumnWidths[VALUE] = CheatListView.Columns[VALUE].Width;
|
Settings.CheatsColumnWidths[VALUE] = CheatListView.Columns[VALUE].Width;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CheatListView.Columns[COMPARE] != null)
|
if (CheatListView.Columns[COMPARE] != null)
|
||||||
{
|
{
|
||||||
Global.Config.CheatsColumnIndices[COMPARE] = CheatListView.Columns[COMPARE].DisplayIndex;
|
Settings.CheatsColumnIndices[COMPARE] = CheatListView.Columns[COMPARE].DisplayIndex;
|
||||||
Global.Config.CheatsColumnWidths[COMPARE] = CheatListView.Columns[COMPARE].Width;
|
Settings.CheatsColumnWidths[COMPARE] = CheatListView.Columns[COMPARE].Width;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CheatListView.Columns[ON] != null)
|
if (CheatListView.Columns[ON] != null)
|
||||||
{
|
{
|
||||||
Global.Config.CheatsColumnIndices[ON] = CheatListView.Columns[ON].DisplayIndex;
|
Settings.CheatsColumnIndices[ON] = CheatListView.Columns[ON].DisplayIndex;
|
||||||
Global.Config.CheatsColumnWidths[ON] = CheatListView.Columns[ON].Width;
|
Settings.CheatsColumnWidths[ON] = CheatListView.Columns[ON].Width;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CheatListView.Columns[DOMAIN] != null)
|
if (CheatListView.Columns[DOMAIN] != null)
|
||||||
{
|
{
|
||||||
Global.Config.CheatsColumnIndices[DOMAIN] = CheatListView.Columns[DOMAIN].DisplayIndex;
|
Settings.CheatsColumnIndices[DOMAIN] = CheatListView.Columns[DOMAIN].DisplayIndex;
|
||||||
Global.Config.CheatsColumnWidths[DOMAIN] = CheatListView.Columns[DOMAIN].Width;
|
Settings.CheatsColumnWidths[DOMAIN] = CheatListView.Columns[DOMAIN].Width;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CheatListView.Columns[SIZE] != null)
|
if (CheatListView.Columns[SIZE] != null)
|
||||||
{
|
{
|
||||||
Global.Config.CheatsColumnIndices[SIZE] = CheatListView.Columns[SIZE].DisplayIndex;
|
Settings.CheatsColumnIndices[SIZE] = CheatListView.Columns[SIZE].DisplayIndex;
|
||||||
Global.Config.CheatsColumnWidths[SIZE] = CheatListView.Columns[SIZE].Width;
|
Settings.CheatsColumnWidths[SIZE] = CheatListView.Columns[SIZE].Width;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CheatListView.Columns[ENDIAN] != null)
|
if (CheatListView.Columns[ENDIAN] != null)
|
||||||
{
|
{
|
||||||
Global.Config.CheatsColumnIndices[ENDIAN] = CheatListView.Columns[ENDIAN].DisplayIndex;
|
Settings.CheatsColumnIndices[ENDIAN] = CheatListView.Columns[ENDIAN].DisplayIndex;
|
||||||
Global.Config.CheatsColumnWidths[ENDIAN] = CheatListView.Columns[ENDIAN].Width;
|
Settings.CheatsColumnWidths[ENDIAN] = CheatListView.Columns[ENDIAN].Width;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CheatListView.Columns[TYPE] != null)
|
if (CheatListView.Columns[TYPE] != null)
|
||||||
{
|
{
|
||||||
Global.Config.CheatsColumnIndices[TYPE] = CheatListView.Columns[TYPE].DisplayIndex;
|
Settings.CheatsColumnIndices[TYPE] = CheatListView.Columns[TYPE].DisplayIndex;
|
||||||
Global.Config.CheatsColumnWidths[TYPE] = CheatListView.Columns[TYPE].Width;
|
Settings.CheatsColumnWidths[TYPE] = CheatListView.Columns[TYPE].Width;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DoColumnToggle(string column)
|
private void DoColumnToggle(string column)
|
||||||
{
|
{
|
||||||
Global.Config.CheatsColumnShow[column] ^= true;
|
Settings.CheatsColumnShow[column] ^= true;
|
||||||
SaveColumnInfo();
|
SaveColumnInfo();
|
||||||
LoadColumnInfo();
|
LoadColumnInfo();
|
||||||
}
|
}
|
||||||
|
@ -465,7 +500,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void RefreshFloatingWindowControl()
|
private void RefreshFloatingWindowControl()
|
||||||
{
|
{
|
||||||
Owner = Global.Config.CheatsSettings.FloatingWindow ? null : GlobalWin.MainForm;
|
Owner = Settings.FloatingWindow ? null : GlobalWin.MainForm;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Events
|
#region Events
|
||||||
|
@ -661,9 +696,9 @@ namespace BizHawk.Client.EmuHawk
|
||||||
AutoSaveCheatsMenuItem.Checked = Global.Config.CheatsAutoSaveOnClose;
|
AutoSaveCheatsMenuItem.Checked = Global.Config.CheatsAutoSaveOnClose;
|
||||||
DisableCheatsOnLoadMenuItem.Checked = Global.Config.DisableCheatsOnLoad;
|
DisableCheatsOnLoadMenuItem.Checked = Global.Config.DisableCheatsOnLoad;
|
||||||
AutoloadMenuItem.Checked = Global.Config.RecentCheats.AutoLoad;
|
AutoloadMenuItem.Checked = Global.Config.RecentCheats.AutoLoad;
|
||||||
SaveWindowPositionMenuItem.Checked = Global.Config.CheatsSettings.SaveWindowPosition;
|
SaveWindowPositionMenuItem.Checked = Settings.SaveWindowPosition;
|
||||||
AlwaysOnTopMenuItem.Checked = Global.Config.CheatsSettings.TopMost;
|
AlwaysOnTopMenuItem.Checked = Settings.TopMost;
|
||||||
FloatingWindowMenuItem.Checked = Global.Config.CheatsSettings.FloatingWindow;
|
FloatingWindowMenuItem.Checked = Settings.FloatingWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AlwaysLoadCheatsMenuItem_Click(object sender, EventArgs e)
|
private void AlwaysLoadCheatsMenuItem_Click(object sender, EventArgs e)
|
||||||
|
@ -688,60 +723,32 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void SaveWindowPositionMenuItem_Click(object sender, EventArgs e)
|
private void SaveWindowPositionMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Global.Config.CheatsSettings.SaveWindowPosition ^= true;
|
Settings.SaveWindowPosition ^= true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AlwaysOnTopMenuItem_Click(object sender, EventArgs e)
|
private void AlwaysOnTopMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Global.Config.CheatsSettings.TopMost ^= true;
|
Settings.TopMost ^= true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FloatingWindowMenuItem_Click(object sender, EventArgs e)
|
private void FloatingWindowMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Global.Config.CheatsSettings.FloatingWindow ^= true;
|
Settings.FloatingWindow ^= true;
|
||||||
RefreshFloatingWindowControl();
|
RefreshFloatingWindowControl();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RestoreWindowSizeMenuItem_Click(object sender, EventArgs e)
|
private void RestoreWindowSizeMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Size = new Size(_defaultWidth, _defaultHeight);
|
Size = new Size(_defaultWidth, _defaultHeight);
|
||||||
Global.Config.CheatsSettings.SaveWindowPosition = true;
|
Settings = new CheatsSettings();
|
||||||
Global.Config.CheatsSettings.TopMost = TopMost = false;
|
|
||||||
Global.Config.CheatsSettings.FloatingWindow = false;
|
|
||||||
Global.Config.DisableCheatsOnLoad = false;
|
Global.Config.DisableCheatsOnLoad = false;
|
||||||
Global.Config.LoadCheatFileByGame = true;
|
Global.Config.LoadCheatFileByGame = true;
|
||||||
Global.Config.CheatsAutoSaveOnClose = true;
|
Global.Config.CheatsAutoSaveOnClose = true;
|
||||||
|
|
||||||
Global.Config.CheatsColumnIndices = new Dictionary<string, int>
|
|
||||||
{
|
|
||||||
{ "NamesColumn", 0 },
|
|
||||||
{ "AddressColumn", 1 },
|
|
||||||
{ "ValueColumn", 2 },
|
|
||||||
{ "CompareColumn", 3 },
|
|
||||||
{ "OnColumn", 4 },
|
|
||||||
{ "DomainColumn", 5 },
|
|
||||||
{ "SizeColumn", 6 },
|
|
||||||
{ "EndianColumn", 7 },
|
|
||||||
{ "DisplayTypeColumn", 8 },
|
|
||||||
};
|
|
||||||
|
|
||||||
Global.Config.CheatsColumnShow = new Dictionary<string, bool>
|
|
||||||
{
|
|
||||||
{ "NamesColumn", true },
|
|
||||||
{ "AddressColumn", true },
|
|
||||||
{ "ValueColumn", true },
|
|
||||||
{ "CompareColumn", true },
|
|
||||||
{ "OnColumn", false },
|
|
||||||
{ "DomainColumn", true },
|
|
||||||
{ "SizeColumn", true },
|
|
||||||
{ "EndianColumn", false },
|
|
||||||
{ "DisplayTypeColumn", false },
|
|
||||||
};
|
|
||||||
|
|
||||||
RefreshFloatingWindowControl();
|
RefreshFloatingWindowControl();
|
||||||
ColumnPositions();
|
ColumnPositions();
|
||||||
LoadColumnInfo();
|
LoadColumnInfo();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -750,15 +757,15 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void ColumnsSubMenu_DropDownOpened(object sender, EventArgs e)
|
private void ColumnsSubMenu_DropDownOpened(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
ShowNameMenuItem.Checked = Global.Config.CheatsColumnShow[NAME];
|
ShowNameMenuItem.Checked = Settings.CheatsColumnShow[NAME];
|
||||||
ShowAddressMenuItem.Checked = Global.Config.CheatsColumnShow[ADDRESS];
|
ShowAddressMenuItem.Checked = Settings.CheatsColumnShow[ADDRESS];
|
||||||
ShowValueMenuItem.Checked = Global.Config.CheatsColumnShow[VALUE];
|
ShowValueMenuItem.Checked = Settings.CheatsColumnShow[VALUE];
|
||||||
ShowCompareMenuItem.Checked = Global.Config.CheatsColumnShow[COMPARE];
|
ShowCompareMenuItem.Checked = Settings.CheatsColumnShow[COMPARE];
|
||||||
ShowOnMenuItem.Checked = Global.Config.CheatsColumnShow[ON];
|
ShowOnMenuItem.Checked = Settings.CheatsColumnShow[ON];
|
||||||
ShowDomainMenuItem.Checked = Global.Config.CheatsColumnShow[DOMAIN];
|
ShowDomainMenuItem.Checked = Settings.CheatsColumnShow[DOMAIN];
|
||||||
ShowSizeMenuItem.Checked = Global.Config.CheatsColumnShow[SIZE];
|
ShowSizeMenuItem.Checked = Settings.CheatsColumnShow[SIZE];
|
||||||
ShowEndianMenuItem.Checked = Global.Config.CheatsColumnShow[ENDIAN];
|
ShowEndianMenuItem.Checked = Settings.CheatsColumnShow[ENDIAN];
|
||||||
ShowDisplayTypeMenuItem.Checked = Global.Config.CheatsColumnShow[TYPE];
|
ShowDisplayTypeMenuItem.Checked = Settings.CheatsColumnShow[TYPE];
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ShowNameMenuItem_Click(object sender, EventArgs e)
|
private void ShowNameMenuItem_Click(object sender, EventArgs e)
|
||||||
|
|
Loading…
Reference in New Issue