refactor message display option settings to be an object, and simplify the message config dialog
This commit is contained in:
parent
b94a830f13
commit
a565f6f299
|
@ -253,34 +253,15 @@ namespace BizHawk.Client.Common
|
|||
public bool DispAutoPrescale = true;
|
||||
public int DispSpeedupFeatures = 2;
|
||||
|
||||
public int DispFPSx = DefaultMessageOptions.DispFPSx;
|
||||
public int DispFPSy = DefaultMessageOptions.DispFPSy;
|
||||
public int DispFrameCx = DefaultMessageOptions.DispFrameCx;
|
||||
public int DispFrameCy = DefaultMessageOptions.DispFrameCy;
|
||||
public int DispLagx = DefaultMessageOptions.DispLagx;
|
||||
public int DispLagy = DefaultMessageOptions.DispLagy;
|
||||
public int DispInpx = DefaultMessageOptions.DispInpx;
|
||||
public int DispInpy = DefaultMessageOptions.DispInpy;
|
||||
public int DispRecx = DefaultMessageOptions.DispRecx;
|
||||
public int DispRecy = DefaultMessageOptions.DispRecy;
|
||||
public int DispMultix = DefaultMessageOptions.DispMultix;
|
||||
public int DispMultiy = DefaultMessageOptions.DispMultiy;
|
||||
public int DispRamWatchx = DefaultMessageOptions.DispRamWatchx;
|
||||
public int DispRamWatchy = DefaultMessageOptions.DispRamWatchy;
|
||||
public int DispMessagex = DefaultMessageOptions.DispMessagex;
|
||||
public int DispMessagey = DefaultMessageOptions.DispMessagey;
|
||||
public int DispAutoholdx = DefaultMessageOptions.DispAutoholdx;
|
||||
public int DispAutoholdy = DefaultMessageOptions.DispAutoholdy;
|
||||
|
||||
public int DispFPSanchor = DefaultMessageOptions.DispFPSanchor; // 0 = UL, 1 = UR, 2 = DL, 3 = DR
|
||||
public int DispFrameanchor = DefaultMessageOptions.DispFrameanchor;
|
||||
public int DispLaganchor = DefaultMessageOptions.DispLaganchor;
|
||||
public int DispInpanchor = DefaultMessageOptions.DispInpanchor;
|
||||
public int DispWatchesanchor = DefaultMessageOptions.DispWatchAnchor;
|
||||
public int DispRecanchor = DefaultMessageOptions.DispRecanchor;
|
||||
public int DispMultianchor = DefaultMessageOptions.DispMultianchor;
|
||||
public int DispMessageanchor = DefaultMessageOptions.DispMessageanchor;
|
||||
public int DispAutoholdanchor = DefaultMessageOptions.DispAutoholdanchor;
|
||||
public MessageOption Fps = DefaultMessageOptions.Fps;
|
||||
public MessageOption FrameCounter = DefaultMessageOptions.FrameCounter;
|
||||
public MessageOption LagCounter = DefaultMessageOptions.LagCounter;
|
||||
public MessageOption InputDisplay = DefaultMessageOptions.InputDisplay;
|
||||
public MessageOption ReRecordCounter = DefaultMessageOptions.ReRecordCounter;
|
||||
public MessageOption MultitrackRecorder = DefaultMessageOptions.MultitrackRecorder;
|
||||
public MessageOption Messages = DefaultMessageOptions.Messages;
|
||||
public MessageOption Autohold = DefaultMessageOptions.Autohold;
|
||||
public MessageOption RamWatches = DefaultMessageOptions.RamWatches;
|
||||
|
||||
public int MessagesColor = DefaultMessageOptions.MessagesColor;
|
||||
public int AlertMessageColor = DefaultMessageOptions.AlertMessageColor;
|
||||
|
|
|
@ -1,40 +1,33 @@
|
|||
namespace BizHawk.Client.Common
|
||||
{
|
||||
public class MessageOption
|
||||
{
|
||||
public int X { get; set; }
|
||||
public int Y { get; set; }
|
||||
public int Anchor { get; set; } // TODO: make an enum 0 = UL, 1 = UR, 2 = DL, 3 = DR
|
||||
|
||||
public MessageOption Clone()
|
||||
{
|
||||
return (MessageOption)MemberwiseClone();
|
||||
}
|
||||
}
|
||||
|
||||
public static class DefaultMessageOptions
|
||||
{
|
||||
public const int
|
||||
DispFPSx = 0,
|
||||
DispFPSy = 0,
|
||||
DispFrameCx = 0,
|
||||
DispFrameCy = 14,
|
||||
DispLagx = 0,
|
||||
DispLagy = 42,
|
||||
DispInpx = 0,
|
||||
DispInpy = 28,
|
||||
DispRecx = 0,
|
||||
DispRecy = 56,
|
||||
DispMultix = 0,
|
||||
DispMultiy = 14,
|
||||
DispMessagex = 3,
|
||||
DispMessagey = 0,
|
||||
DispAutoholdx = 0,
|
||||
DispAutoholdy = 0,
|
||||
DispRamWatchx = 0,
|
||||
DispRamWatchy = 70,
|
||||
public static MessageOption Fps = new MessageOption { X = 0, Y = 0 };
|
||||
public static MessageOption FrameCounter = new MessageOption { X = 0, Y = 14 };
|
||||
public static MessageOption LagCounter = new MessageOption { X = 0, Y = 42 };
|
||||
public static MessageOption InputDisplay = new MessageOption { X = 0, Y = 28 };
|
||||
public static MessageOption ReRecordCounter = new MessageOption { X = 0, Y = 56 };
|
||||
public static MessageOption MultitrackRecorder = new MessageOption { X = 0, Y = 14, Anchor = 1 };
|
||||
public static MessageOption Messages = new MessageOption { X = 0, Y = 0, Anchor = 2 };
|
||||
public static MessageOption Autohold = new MessageOption { X = 0, Y = 0, Anchor = 1 };
|
||||
public static MessageOption RamWatches = new MessageOption { X = 0, Y = 70 };
|
||||
|
||||
public const int
|
||||
MessagesColor = -1,
|
||||
AlertMessageColor = -65536,
|
||||
LastInputColor = -23296,
|
||||
MovieInput = -8355712,
|
||||
|
||||
DispFPSanchor = 0, // 0 = UL, 1 = UR, 2 = DL, 3 = DR
|
||||
DispFrameanchor = 0,
|
||||
DispLaganchor = 0,
|
||||
DispInpanchor = 0,
|
||||
DispWatchAnchor = 0,
|
||||
DispRecanchor = 0,
|
||||
DispMultianchor = 1,
|
||||
DispMessageanchor = 2,
|
||||
DispAutoholdanchor = 1;
|
||||
MovieInput = -8355712;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -156,9 +156,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
for (int i = _messages.Count - 1; i >= 0; i--, line++)
|
||||
{
|
||||
float x = GetX(g, Global.Config.DispMessagex, Global.Config.DispMessageanchor, _messages[i].Message);
|
||||
float y = GetY(g, Global.Config.DispMessagey, Global.Config.DispMessageanchor, _messages[i].Message);
|
||||
if (Global.Config.DispMessageanchor < 2)
|
||||
float x = GetX(g, Global.Config.Messages.X, Global.Config.Messages.Anchor, _messages[i].Message);
|
||||
float y = GetY(g, Global.Config.Messages.X, Global.Config.Messages.Anchor, _messages[i].Message);
|
||||
if (Global.Config.Messages.Anchor < 2)
|
||||
{
|
||||
y += (line - 1) * 18;
|
||||
}
|
||||
|
@ -176,9 +176,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
int i = _messages.Count - 1;
|
||||
|
||||
float x = GetX(g, Global.Config.DispMessagex, Global.Config.DispMessageanchor, _messages[i].Message);
|
||||
float y = GetY(g, Global.Config.DispMessagey, Global.Config.DispMessageanchor, _messages[i].Message);
|
||||
if (Global.Config.DispMessageanchor < 2)
|
||||
float x = GetX(g, Global.Config.Messages.X, Global.Config.Messages.Anchor, _messages[i].Message);
|
||||
float y = GetY(g, Global.Config.Messages.Y, Global.Config.Messages.Anchor, _messages[i].Message);
|
||||
if (Global.Config.Messages.Anchor < 2)
|
||||
{
|
||||
y += (line - 1) * 18;
|
||||
}
|
||||
|
@ -296,8 +296,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
if (Global.Config.DisplayFrameCounter && !Global.Game.IsNullInstance())
|
||||
{
|
||||
string message = MakeFrameCounter();
|
||||
float x = GetX(g, Global.Config.DispFrameCx, Global.Config.DispFrameanchor, message);
|
||||
float y = GetY(g, Global.Config.DispFrameCy, Global.Config.DispFrameanchor, message);
|
||||
float x = GetX(g, Global.Config.FrameCounter.X, Global.Config.FrameCounter.Anchor, message);
|
||||
float y = GetY(g, Global.Config.FrameCounter.Y, Global.Config.FrameCounter.Anchor, message);
|
||||
|
||||
DrawOsdMessage(g, message, Color.FromArgb(Global.Config.MessagesColor), x, y);
|
||||
|
||||
|
@ -313,8 +313,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
|| (Global.MovieSession.Movie.IsFinished && Global.Emulator.Frame == Global.MovieSession.Movie.InputLogLength)) // Account for the last frame of the movie, the movie state is immediately "Finished" here but we still want to show the input
|
||||
{
|
||||
var input = InputStrMovie();
|
||||
var x = GetX(g, Global.Config.DispInpx, Global.Config.DispInpanchor, input);
|
||||
var y = GetY(g, Global.Config.DispInpy, Global.Config.DispInpanchor, input);
|
||||
var x = GetX(g, Global.Config.InputDisplay.X, Global.Config.InputDisplay.Anchor, input);
|
||||
var y = GetY(g, Global.Config.InputDisplay.Y, Global.Config.InputDisplay.Anchor, input);
|
||||
Color c = Color.FromArgb(Global.Config.MovieInput);
|
||||
g.DrawString(input, MessageFont, c, x, y);
|
||||
}
|
||||
|
@ -328,8 +328,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
//we need some kind of string for calculating position when right-anchoring, of something like that
|
||||
var bgStr = InputStrOrAll();
|
||||
var x = GetX(g, Global.Config.DispInpx, Global.Config.DispInpanchor, bgStr);
|
||||
var y = GetY(g, Global.Config.DispInpy, Global.Config.DispInpanchor, bgStr);
|
||||
var x = GetX(g, Global.Config.InputDisplay.X, Global.Config.InputDisplay.Anchor, bgStr);
|
||||
var y = GetY(g, Global.Config.InputDisplay.Y, Global.Config.InputDisplay.Anchor, bgStr);
|
||||
|
||||
// now, we're going to render these repeatedly, with higher-priority things overriding
|
||||
|
||||
|
@ -361,16 +361,16 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
if (Global.MovieSession.MultiTrack.IsActive)
|
||||
{
|
||||
float x = GetX(g, Global.Config.DispMultix, Global.Config.DispMultianchor, Global.MovieSession.MultiTrack.Status);
|
||||
float y = GetY(g, Global.Config.DispMultiy, Global.Config.DispMultianchor, Global.MovieSession.MultiTrack.Status);
|
||||
float x = GetX(g, Global.Config.MultitrackRecorder.X, Global.Config.MultitrackRecorder.Anchor, Global.MovieSession.MultiTrack.Status);
|
||||
float y = GetY(g, Global.Config.MultitrackRecorder.Y, Global.Config.MultitrackRecorder.Anchor, Global.MovieSession.MultiTrack.Status);
|
||||
|
||||
DrawOsdMessage(g, Global.MovieSession.MultiTrack.Status, FixedMessagesColor, x, y);
|
||||
}
|
||||
|
||||
if (Global.Config.DisplayFPS && Fps != null)
|
||||
{
|
||||
float x = GetX(g, Global.Config.DispFPSx, Global.Config.DispFPSanchor, Fps);
|
||||
float y = GetY(g, Global.Config.DispFPSy, Global.Config.DispFPSanchor, Fps);
|
||||
float x = GetX(g, Global.Config.Fps.X, Global.Config.Fps.Anchor, Fps);
|
||||
float y = GetY(g, Global.Config.Fps.Y, Global.Config.Fps.Anchor, Fps);
|
||||
|
||||
DrawOsdMessage(g, Fps, FixedMessagesColor, x, y);
|
||||
}
|
||||
|
@ -378,8 +378,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
if (Global.Config.DisplayLagCounter && Global.Emulator.CanPollInput())
|
||||
{
|
||||
var counter = Global.Emulator.AsInputPollable().LagCount.ToString();
|
||||
var x = GetX(g, Global.Config.DispLagx, Global.Config.DispLaganchor, counter);
|
||||
var y = GetY(g, Global.Config.DispLagy, Global.Config.DispLaganchor, counter);
|
||||
var x = GetX(g, Global.Config.LagCounter.X, Global.Config.LagCounter.Anchor, counter);
|
||||
var y = GetY(g, Global.Config.LagCounter.Y, Global.Config.LagCounter.Anchor, counter);
|
||||
|
||||
DrawOsdMessage(g, counter, FixedAlertMessageColor, x, y);
|
||||
}
|
||||
|
@ -387,8 +387,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
if (Global.Config.DisplayRerecordCount)
|
||||
{
|
||||
string rerecordCount = MakeRerecordCount();
|
||||
float x = GetX(g, Global.Config.DispRecx, Global.Config.DispRecanchor, rerecordCount);
|
||||
float y = GetY(g, Global.Config.DispRecy, Global.Config.DispRecanchor, rerecordCount);
|
||||
float x = GetX(g, Global.Config.ReRecordCounter.X, Global.Config.ReRecordCounter.Anchor, rerecordCount);
|
||||
float y = GetY(g, Global.Config.ReRecordCounter.Y, Global.Config.ReRecordCounter.Anchor, rerecordCount);
|
||||
|
||||
DrawOsdMessage(g, rerecordCount, FixedMessagesColor, x, y);
|
||||
}
|
||||
|
@ -416,8 +416,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
message,
|
||||
MessageFont,
|
||||
Color.White,
|
||||
GetX(g, Global.Config.DispAutoholdx, Global.Config.DispAutoholdanchor, message),
|
||||
GetY(g, Global.Config.DispAutoholdy, Global.Config.DispAutoholdanchor, message));
|
||||
GetX(g, Global.Config.Autohold.X, Global.Config.Autohold.Anchor, message),
|
||||
GetY(g, Global.Config.Autohold.Y, Global.Config.Autohold.Anchor, message));
|
||||
}
|
||||
|
||||
if (Global.MovieSession.Movie.IsActive && Global.Config.DisplaySubtitles)
|
||||
|
|
|
@ -4,45 +4,27 @@ using System.Windows.Forms;
|
|||
|
||||
using BizHawk.Emulation.Common.IEmulatorExtensions;
|
||||
using BizHawk.Client.Common;
|
||||
using BizHawk.Client.EmuHawk.WinFormExtensions;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
public partial class MessageConfig : Form
|
||||
{
|
||||
private int _dispFpSx = Global.Config.DispFPSx;
|
||||
private int _dispFpSy = Global.Config.DispFPSy;
|
||||
private int _dispFrameCx = Global.Config.DispFrameCx;
|
||||
private int _dispFrameCy = Global.Config.DispFrameCy;
|
||||
private int _dispLagX = Global.Config.DispLagx;
|
||||
private int _dispLagY = Global.Config.DispLagy;
|
||||
private int _dispInpX = Global.Config.DispInpx;
|
||||
private int _dispInpY = Global.Config.DispInpy;
|
||||
private int _dispWatchesX = Global.Config.DispRamWatchx;
|
||||
private int _dispWatchesY = Global.Config.DispRamWatchy;
|
||||
private int _lastInputColor = Global.Config.LastInputColor;
|
||||
private int _dispRecX = Global.Config.DispRecx;
|
||||
private int _dispRecY = Global.Config.DispRecy;
|
||||
private int _dispMultiX = Global.Config.DispMultix;
|
||||
private int _dispMultiY = Global.Config.DispMultiy;
|
||||
private int _dispMessageX = Global.Config.DispMessagex;
|
||||
private int _dispMessageY = Global.Config.DispMessagey;
|
||||
private int _dispAutoholdX = Global.Config.DispAutoholdx;
|
||||
private int _dispAutoholdY = Global.Config.DispAutoholdy;
|
||||
private MessageOption _fps = Global.Config.Fps.Clone();
|
||||
private MessageOption _frameCounter = Global.Config.FrameCounter.Clone();
|
||||
private MessageOption _lagCounter = Global.Config.LagCounter.Clone();
|
||||
private MessageOption _inputDisplay = Global.Config.InputDisplay.Clone();
|
||||
private MessageOption _reRecordCounter = Global.Config.ReRecordCounter.Clone();
|
||||
private MessageOption _multitrackRecorder = Global.Config.MultitrackRecorder.Clone();
|
||||
private MessageOption _messages = Global.Config.Messages.Clone();
|
||||
private MessageOption _autohold = Global.Config.Autohold.Clone();
|
||||
private MessageOption _ramWatches = Global.Config.RamWatches.Clone();
|
||||
|
||||
private int _messageColor = Global.Config.MessagesColor;
|
||||
private int _alertColor = Global.Config.AlertMessageColor;
|
||||
private int _lastInputColor = Global.Config.LastInputColor;
|
||||
private int _movieInput = Global.Config.MovieInput;
|
||||
|
||||
private int _dispFpsAnchor = Global.Config.DispFPSanchor;
|
||||
private int _dispFrameAnchor = Global.Config.DispFrameanchor;
|
||||
private int _dispLagAnchor = Global.Config.DispLaganchor;
|
||||
private int _dispInputAnchor = Global.Config.DispInpanchor;
|
||||
private int _dispWatchesAnchor = Global.Config.DispWatchesanchor;
|
||||
private int _dispRecAnchor = Global.Config.DispRecanchor;
|
||||
private int _dispMultiAnchor = Global.Config.DispMultianchor;
|
||||
private int _dispMessageAnchor = Global.Config.DispMessageanchor;
|
||||
private int _dispAutoholdAnchor = Global.Config.DispAutoholdanchor;
|
||||
|
||||
private readonly Brush _brush = Brushes.Black;
|
||||
private int _px;
|
||||
private int _py;
|
||||
|
@ -116,79 +98,52 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
private void SetFromOption(MessageOption option)
|
||||
{
|
||||
XNumeric.Value = option.X;
|
||||
YNumeric.Value = option.Y;
|
||||
_px = option.X;
|
||||
_py = option.Y;
|
||||
SetAnchorRadio(option.Anchor);
|
||||
}
|
||||
|
||||
private void SetPositionInfo()
|
||||
{
|
||||
if (FPSRadio.Checked)
|
||||
{
|
||||
XNumeric.Value = _dispFpSx;
|
||||
YNumeric.Value = _dispFpSy;
|
||||
_px = _dispFpSx;
|
||||
_py = _dispFpSy;
|
||||
SetAnchorRadio(_dispFpsAnchor);
|
||||
SetFromOption(_fps);
|
||||
}
|
||||
else if (FrameCounterRadio.Checked)
|
||||
{
|
||||
XNumeric.Value = _dispFrameCx;
|
||||
YNumeric.Value = _dispFrameCy;
|
||||
_px = _dispFrameCx;
|
||||
_py = _dispFrameCy;
|
||||
SetAnchorRadio(_dispFrameAnchor);
|
||||
SetFromOption(_frameCounter);
|
||||
}
|
||||
else if (LagCounterRadio.Checked)
|
||||
{
|
||||
XNumeric.Value = _dispLagX;
|
||||
YNumeric.Value = _dispLagY;
|
||||
_px = _dispLagX;
|
||||
_py = _dispLagY;
|
||||
SetAnchorRadio(_dispLagAnchor);
|
||||
SetFromOption(_lagCounter);
|
||||
}
|
||||
else if (InputDisplayRadio.Checked)
|
||||
{
|
||||
XNumeric.Value = _dispInpX;
|
||||
XNumeric.Value = _dispInpY;
|
||||
_px = _dispInpX;
|
||||
_py = _dispInpY;
|
||||
SetAnchorRadio(_dispInputAnchor);
|
||||
SetFromOption(_inputDisplay);
|
||||
}
|
||||
else if (WatchesRadio.Checked)
|
||||
{
|
||||
XNumeric.Value = _dispWatchesX;
|
||||
XNumeric.Value = _dispWatchesY;
|
||||
_px = _dispWatchesX;
|
||||
_py = _dispWatchesY;
|
||||
SetAnchorRadio(_dispWatchesAnchor);
|
||||
SetFromOption(_ramWatches);
|
||||
}
|
||||
else if (MessagesRadio.Checked)
|
||||
{
|
||||
XNumeric.Value = _dispMessageX;
|
||||
YNumeric.Value = _dispMessageY;
|
||||
_px = _dispMessageX;
|
||||
_py = _dispMessageY;
|
||||
SetAnchorRadio(_dispMessageAnchor);
|
||||
SetFromOption(_messages);
|
||||
}
|
||||
else if (RerecordsRadio.Checked)
|
||||
{
|
||||
XNumeric.Value = _dispRecX;
|
||||
YNumeric.Value = _dispRecY;
|
||||
_px = _dispRecX;
|
||||
_py = _dispRecY;
|
||||
SetAnchorRadio(_dispRecAnchor);
|
||||
SetFromOption(_reRecordCounter);
|
||||
}
|
||||
else if (MultitrackRadio.Checked)
|
||||
{
|
||||
XNumeric.Value = _dispMultiX;
|
||||
YNumeric.Value = _dispMultiY;
|
||||
_px = _dispMultiX;
|
||||
_py = _dispMultiY;
|
||||
SetAnchorRadio(_dispMultiAnchor);
|
||||
SetFromOption(_multitrackRecorder);
|
||||
}
|
||||
else if (AutoholdRadio.Checked)
|
||||
{
|
||||
XNumeric.Value = _dispAutoholdX;
|
||||
YNumeric.Value = _dispAutoholdY;
|
||||
_px = _dispAutoholdX;
|
||||
_py = _dispAutoholdY;
|
||||
SetAnchorRadio(_dispAutoholdAnchor);
|
||||
SetFromOption(_autohold);
|
||||
}
|
||||
|
||||
PositionPanel.Refresh();
|
||||
|
@ -199,37 +154,20 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void SaveSettings()
|
||||
{
|
||||
Global.Config.DispFPSx = _dispFpSx;
|
||||
Global.Config.DispFPSy = _dispFpSy;
|
||||
Global.Config.DispFrameCx = _dispFrameCx;
|
||||
Global.Config.DispFrameCy = _dispFrameCy;
|
||||
Global.Config.DispLagx = _dispLagX;
|
||||
Global.Config.DispLagy = _dispLagY;
|
||||
Global.Config.DispInpx = _dispInpX;
|
||||
Global.Config.DispInpy = _dispInpY;
|
||||
Global.Config.DispRamWatchx = _dispWatchesX;
|
||||
Global.Config.DispRamWatchy = _dispWatchesY;
|
||||
Global.Config.DispRecx = _dispRecX;
|
||||
Global.Config.DispRecy = _dispRecY;
|
||||
Global.Config.DispMultix = _dispMultiX;
|
||||
Global.Config.DispMultiy = _dispMultiY;
|
||||
Global.Config.DispMessagex = _dispMessageX;
|
||||
Global.Config.DispMessagey = _dispMessageY;
|
||||
Global.Config.DispAutoholdx = _dispAutoholdX;
|
||||
Global.Config.DispAutoholdy = _dispAutoholdY;
|
||||
Global.Config.Fps = _fps;
|
||||
Global.Config.FrameCounter = _frameCounter;
|
||||
Global.Config.LagCounter = _lagCounter;
|
||||
Global.Config.InputDisplay = _inputDisplay;
|
||||
Global.Config.ReRecordCounter = _reRecordCounter;
|
||||
Global.Config.MultitrackRecorder = _multitrackRecorder;
|
||||
Global.Config.Messages = _messages;
|
||||
Global.Config.Autohold = _autohold;
|
||||
Global.Config.RamWatches = _ramWatches;
|
||||
|
||||
Global.Config.MessagesColor = _messageColor;
|
||||
Global.Config.AlertMessageColor = _alertColor;
|
||||
Global.Config.LastInputColor = _lastInputColor;
|
||||
Global.Config.MovieInput = _movieInput;
|
||||
Global.Config.DispFPSanchor = _dispFpsAnchor;
|
||||
Global.Config.DispFrameanchor = _dispFrameAnchor;
|
||||
Global.Config.DispLaganchor = _dispLagAnchor;
|
||||
Global.Config.DispInpanchor = _dispInputAnchor;
|
||||
Global.Config.DispRecanchor = _dispRecAnchor;
|
||||
Global.Config.DispMultianchor = _dispMultiAnchor;
|
||||
Global.Config.DispMessageanchor = _dispMessageAnchor;
|
||||
Global.Config.DispAutoholdanchor = _dispAutoholdAnchor;
|
||||
|
||||
Global.Config.StackOSDMessages = StackMessagesCheckbox.Checked;
|
||||
}
|
||||
|
@ -361,128 +299,83 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
private void SetOptionPosition(MessageOption option)
|
||||
{
|
||||
option.X = _px;
|
||||
option.Y = _py;
|
||||
}
|
||||
|
||||
private void SetPositionLabels()
|
||||
{
|
||||
if (FPSRadio.Checked)
|
||||
{
|
||||
_dispFpSx = _px;
|
||||
_dispFpSy = _py;
|
||||
SetOptionPosition(_fps);
|
||||
}
|
||||
else if (FrameCounterRadio.Checked)
|
||||
{
|
||||
_dispFrameCx = _px;
|
||||
_dispFrameCy = _py;
|
||||
SetOptionPosition(_frameCounter);
|
||||
}
|
||||
else if (LagCounterRadio.Checked)
|
||||
{
|
||||
_dispLagX = _px;
|
||||
_dispLagY = _py;
|
||||
SetOptionPosition(_lagCounter);
|
||||
}
|
||||
else if (InputDisplayRadio.Checked)
|
||||
{
|
||||
_dispInpX = _px;
|
||||
_dispInpY = _py;
|
||||
SetOptionPosition(_inputDisplay);
|
||||
}
|
||||
else if (WatchesRadio.Checked)
|
||||
{
|
||||
_dispWatchesX = _px;
|
||||
_dispWatchesY = _py;
|
||||
SetOptionPosition(_ramWatches);
|
||||
}
|
||||
else if (RerecordsRadio.Checked)
|
||||
{
|
||||
_dispRecX = _px;
|
||||
_dispRecY = _py;
|
||||
SetOptionPosition(_reRecordCounter);
|
||||
}
|
||||
else if (MultitrackRadio.Checked)
|
||||
{
|
||||
_dispMultiX = _px;
|
||||
_dispMultiY = _py;
|
||||
SetOptionPosition(_multitrackRecorder);
|
||||
}
|
||||
else if (MessagesRadio.Checked)
|
||||
{
|
||||
_dispMessageX = _px;
|
||||
_dispMessageY = _py;
|
||||
SetOptionPosition(_messages);
|
||||
}
|
||||
else if (AutoholdRadio.Checked)
|
||||
{
|
||||
_dispAutoholdX = _px;
|
||||
_dispAutoholdY = _py;
|
||||
SetOptionPosition(_autohold);
|
||||
}
|
||||
|
||||
FpsPosLabel.Text = $"{_dispFpSx}, {_dispFpSy}";
|
||||
FCLabel.Text = $"{_dispFrameCx}, {_dispFrameCy}";
|
||||
LagLabel.Text = $"{_dispLagX}, {_dispLagY}";
|
||||
InpLabel.Text = $"{_dispInpX}, {_dispInpY}";
|
||||
WatchesLabel.Text = $"{_dispWatchesX}, {_dispWatchesY}";
|
||||
RerecLabel.Text = $"{_dispRecX}, {_dispRecY}";
|
||||
MultitrackLabel.Text = $"{_dispMultiX}, {_dispMultiY}";
|
||||
MessLabel.Text = $"{_dispMessageX}, {_dispMessageY}";
|
||||
AutoholdLabel.Text = $"{_dispAutoholdX}, {_dispAutoholdY}";
|
||||
FpsPosLabel.Text = ToCoordinateStr(_fps);
|
||||
FCLabel.Text = ToCoordinateStr(_frameCounter);
|
||||
LagLabel.Text = ToCoordinateStr(_lagCounter);
|
||||
InpLabel.Text = ToCoordinateStr(_inputDisplay);
|
||||
WatchesLabel.Text = ToCoordinateStr(_ramWatches);
|
||||
RerecLabel.Text = ToCoordinateStr(_reRecordCounter);
|
||||
MultitrackLabel.Text = ToCoordinateStr(_multitrackRecorder);
|
||||
MessLabel.Text = ToCoordinateStr(_messages);
|
||||
AutoholdLabel.Text = ToCoordinateStr(_autohold);
|
||||
}
|
||||
|
||||
private string ToCoordinateStr(MessageOption option)
|
||||
{
|
||||
return $"{option.X}, {option.Y}";
|
||||
}
|
||||
|
||||
private void ResetDefaultsButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.DispFPSx = DefaultMessageOptions.DispFPSx;
|
||||
Global.Config.DispFPSy = DefaultMessageOptions.DispFPSy;
|
||||
Global.Config.DispFrameCx = DefaultMessageOptions.DispFrameCx;
|
||||
Global.Config.DispFrameCy = DefaultMessageOptions.DispFrameCy;
|
||||
Global.Config.DispLagx = DefaultMessageOptions.DispLagx;
|
||||
Global.Config.DispLagy = DefaultMessageOptions.DispLagy;
|
||||
Global.Config.DispInpx = DefaultMessageOptions.DispInpx;
|
||||
Global.Config.DispInpy = DefaultMessageOptions.DispInpy;
|
||||
Global.Config.DispRecx = DefaultMessageOptions.DispRecx;
|
||||
Global.Config.DispRecy = DefaultMessageOptions.DispRecy;
|
||||
Global.Config.DispMultix = DefaultMessageOptions.DispMultix;
|
||||
Global.Config.DispMultiy = DefaultMessageOptions.DispMultiy;
|
||||
Global.Config.DispMessagex = DefaultMessageOptions.DispMessagex;
|
||||
Global.Config.DispMessagey = DefaultMessageOptions.DispMessagey;
|
||||
Global.Config.DispAutoholdx = DefaultMessageOptions.DispAutoholdx;
|
||||
Global.Config.DispAutoholdy = DefaultMessageOptions.DispAutoholdy;
|
||||
_fps = Global.Config.Fps = DefaultMessageOptions.Fps;
|
||||
_frameCounter = Global.Config.FrameCounter = DefaultMessageOptions.FrameCounter;
|
||||
_lagCounter = Global.Config.LagCounter = DefaultMessageOptions.LagCounter;
|
||||
_inputDisplay = Global.Config.InputDisplay = DefaultMessageOptions.InputDisplay;
|
||||
_reRecordCounter = Global.Config.ReRecordCounter = DefaultMessageOptions.ReRecordCounter;
|
||||
_multitrackRecorder = Global.Config.MultitrackRecorder = DefaultMessageOptions.MultitrackRecorder;
|
||||
_messages = Global.Config.Messages = DefaultMessageOptions.Messages;
|
||||
_autohold = Global.Config.Autohold = DefaultMessageOptions.Autohold;
|
||||
_ramWatches = Global.Config.RamWatches = DefaultMessageOptions.RamWatches;
|
||||
|
||||
Global.Config.DispFPSanchor = DefaultMessageOptions.DispFPSanchor;
|
||||
Global.Config.DispFrameanchor = DefaultMessageOptions.DispFrameanchor;
|
||||
Global.Config.DispLaganchor = DefaultMessageOptions.DispLaganchor;
|
||||
Global.Config.DispInpanchor = DefaultMessageOptions.DispInpanchor;
|
||||
Global.Config.DispRecanchor = DefaultMessageOptions.DispRecanchor;
|
||||
Global.Config.DispMultianchor = DefaultMessageOptions.DispMultianchor;
|
||||
Global.Config.DispMessageanchor = DefaultMessageOptions.DispMessageanchor;
|
||||
Global.Config.DispAutoholdanchor = DefaultMessageOptions.DispAutoholdanchor;
|
||||
|
||||
Global.Config.MessagesColor = DefaultMessageOptions.MessagesColor;
|
||||
Global.Config.AlertMessageColor = DefaultMessageOptions.AlertMessageColor;
|
||||
Global.Config.LastInputColor = DefaultMessageOptions.LastInputColor;
|
||||
Global.Config.MovieInput = DefaultMessageOptions.MovieInput;
|
||||
|
||||
_dispFpSx = Global.Config.DispFPSx;
|
||||
_dispFpSy = Global.Config.DispFPSy;
|
||||
_dispFrameCx = Global.Config.DispFrameCx;
|
||||
_dispFrameCy = Global.Config.DispFrameCy;
|
||||
_dispLagX = Global.Config.DispLagx;
|
||||
_dispLagY = Global.Config.DispLagy;
|
||||
_dispInpX = Global.Config.DispInpx;
|
||||
_dispInpY = Global.Config.DispInpy;
|
||||
_dispRecX = Global.Config.DispRecx;
|
||||
_dispRecY = Global.Config.DispRecy;
|
||||
_dispMultiX = Global.Config.DispMultix;
|
||||
_dispMultiY = Global.Config.DispMultiy;
|
||||
_dispMessageX = Global.Config.DispMessagex;
|
||||
_dispMessageY = Global.Config.DispMessagey;
|
||||
_dispAutoholdX = Global.Config.DispAutoholdx;
|
||||
_dispAutoholdY = Global.Config.DispAutoholdy;
|
||||
|
||||
_dispFpsAnchor = Global.Config.DispFPSanchor;
|
||||
_dispFrameAnchor = Global.Config.DispFrameanchor;
|
||||
_dispLagAnchor = Global.Config.DispLaganchor;
|
||||
_dispInputAnchor = Global.Config.DispInpanchor;
|
||||
_dispRecAnchor = Global.Config.DispRecanchor;
|
||||
_dispMultiAnchor = Global.Config.DispMultianchor;
|
||||
_dispMessageAnchor = Global.Config.DispMessageanchor;
|
||||
_dispAutoholdAnchor = Global.Config.DispAutoholdanchor;
|
||||
|
||||
_messageColor = Global.Config.MessagesColor;
|
||||
_alertColor = Global.Config.AlertMessageColor;
|
||||
_lastInputColor = Global.Config.LastInputColor;
|
||||
_movieInput = Global.Config.MovieInput;
|
||||
_messageColor = Global.Config.MessagesColor = DefaultMessageOptions.MessagesColor;
|
||||
_alertColor = Global.Config.AlertMessageColor = DefaultMessageOptions.AlertMessageColor;
|
||||
_lastInputColor = Global.Config.LastInputColor = DefaultMessageOptions.LastInputColor;
|
||||
_movieInput = Global.Config.MovieInput = DefaultMessageOptions.MovieInput;
|
||||
|
||||
MessageColorDialog.Color = Color.FromArgb(_messageColor);
|
||||
AlertColorDialog.Color = Color.FromArgb(_alertColor);
|
||||
|
@ -500,39 +393,39 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
if (FPSRadio.Checked)
|
||||
{
|
||||
_dispFpsAnchor = value;
|
||||
_fps.Anchor = value;
|
||||
}
|
||||
else if (FrameCounterRadio.Checked)
|
||||
{
|
||||
_dispFrameAnchor = value;
|
||||
_frameCounter.Anchor = value;
|
||||
}
|
||||
else if (LagCounterRadio.Checked)
|
||||
{
|
||||
_dispLagAnchor = value;
|
||||
_lagCounter.Anchor = value;
|
||||
}
|
||||
else if (InputDisplayRadio.Checked)
|
||||
{
|
||||
_dispInputAnchor = value;
|
||||
_inputDisplay.Anchor = value;
|
||||
}
|
||||
else if (WatchesRadio.Checked)
|
||||
{
|
||||
_dispWatchesAnchor = value;
|
||||
_ramWatches.Anchor = value;
|
||||
}
|
||||
else if (MessagesRadio.Checked)
|
||||
{
|
||||
_dispMessageAnchor = value;
|
||||
_messages.Anchor = value;
|
||||
}
|
||||
else if (RerecordsRadio.Checked)
|
||||
{
|
||||
_dispRecAnchor = value;
|
||||
_reRecordCounter.Anchor = value;
|
||||
}
|
||||
else if (MultitrackRadio.Checked)
|
||||
{
|
||||
_dispMultiAnchor = value;
|
||||
_multitrackRecorder.Anchor = value;
|
||||
}
|
||||
else if (AutoholdRadio.Checked)
|
||||
{
|
||||
_dispAutoholdAnchor = value;
|
||||
_autohold.Anchor = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -562,6 +455,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
SetAnchorValue(2);
|
||||
}
|
||||
|
||||
PositionPanel.Refresh();
|
||||
}
|
||||
|
||||
|
@ -571,6 +465,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
SetAnchorValue(3);
|
||||
}
|
||||
|
||||
PositionPanel.Refresh();
|
||||
}
|
||||
|
||||
|
@ -586,7 +481,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void ColorPanel_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (MessageColorDialog.ShowDialog() == DialogResult.OK)
|
||||
if (MessageColorDialog.ShowDialog().IsOk())
|
||||
{
|
||||
SetColorBox();
|
||||
}
|
||||
|
@ -594,7 +489,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void AlertColorPanel_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (AlertColorDialog.ShowDialog() == DialogResult.OK)
|
||||
if (AlertColorDialog.ShowDialog().IsOk())
|
||||
{
|
||||
SetColorBox();
|
||||
}
|
||||
|
@ -602,7 +497,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void LInputColorPanel_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (LInputColorDialog.ShowDialog() == DialogResult.OK)
|
||||
if (LInputColorDialog.ShowDialog().IsOk())
|
||||
{
|
||||
SetColorBox();
|
||||
}
|
||||
|
@ -610,7 +505,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void MovieInputColor_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (MovieInputColorDialog.ShowDialog() == DialogResult.OK)
|
||||
if (MovieInputColorDialog.ShowDialog().IsOk())
|
||||
{
|
||||
SetColorBox();
|
||||
}
|
||||
|
|
|
@ -253,8 +253,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
var frozen = !_watches[i].IsSeparator && Global.CheatList.IsActive(_watches[i].Domain, _watches[i].Address);
|
||||
GlobalWin.OSD.AddGuiText(
|
||||
_watches[i].ToDisplayString(),
|
||||
Global.Config.DispRamWatchx,
|
||||
Global.Config.DispRamWatchy + (i * 14),
|
||||
Global.Config.RamWatches.X,
|
||||
Global.Config.RamWatches.Y + (i * 14),
|
||||
Color.Black,
|
||||
frozen ? Color.Cyan : Color.White,
|
||||
0);
|
||||
|
@ -293,8 +293,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
var frozen = !_watches[i].IsSeparator && Global.CheatList.IsActive(_watches[i].Domain, _watches[i].Address);
|
||||
GlobalWin.OSD.AddGuiText(
|
||||
_watches[i].ToDisplayString(),
|
||||
Global.Config.DispRamWatchx,
|
||||
Global.Config.DispRamWatchy + (i * 14),
|
||||
Global.Config.RamWatches.X,
|
||||
Global.Config.RamWatches.Y + (i * 14),
|
||||
Color.Black,
|
||||
frozen ? Color.Cyan : Color.White,
|
||||
0);
|
||||
|
|
Loading…
Reference in New Issue