2011-04-23 00:39:29 +00:00
using System ;
using System.Drawing ;
using System.Windows.Forms ;
2016-12-07 18:32:59 +00:00
using BizHawk.Emulation.Common.IEmulatorExtensions ;
2013-10-25 00:57:23 +00:00
using BizHawk.Client.Common ;
2013-11-03 03:54:37 +00:00
namespace BizHawk.Client.EmuHawk
2011-04-23 00:39:29 +00:00
{
2011-06-16 02:39:35 +00:00
public partial class MessageConfig : Form
{
2013-11-28 01:33:38 +00:00
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 ;
2015-10-01 06:39:22 +00:00
private int _dispWatchesx = Global . Config . DispRamWatchx ;
private int _dispWatchesy = Global . Config . DispRamWatchy ;
2013-11-28 01:33:38 +00:00
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 int _messageColor = Global . Config . MessagesColor ;
private int _alertColor = Global . Config . AlertMessageColor ;
private int _movieInput = Global . Config . MovieInput ;
2011-07-01 02:43:08 +00:00
2013-11-28 01:33:38 +00:00
private int _dispFpSanchor = Global . Config . DispFPSanchor ;
private int _dispFrameanchor = Global . Config . DispFrameanchor ;
private int _dispLaganchor = Global . Config . DispLaganchor ;
private int _dispInputanchor = Global . Config . DispInpanchor ;
2015-10-01 06:39:22 +00:00
private int _dispWatchesanchor = Global . Config . DispWatchesanchor ;
2013-11-28 01:33:38 +00:00
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 ;
private bool _mousedown ;
2011-06-16 02:39:35 +00:00
public MessageConfig ( )
{
InitializeComponent ( ) ;
}
private void MessageConfig_Load ( object sender , EventArgs e )
{
2017-05-31 15:28:06 +00:00
SetMaxXy ( ) ;
2013-11-28 01:33:38 +00:00
MessageColorDialog . Color = Color . FromArgb ( _messageColor ) ;
AlertColorDialog . Color = Color . FromArgb ( _alertColor ) ;
LInputColorDialog . Color = Color . FromArgb ( _lastInputColor ) ;
MovieInputColorDialog . Color = Color . FromArgb ( _movieInput ) ;
2011-06-16 02:39:35 +00:00
SetColorBox ( ) ;
SetPositionInfo ( ) ;
2012-09-26 04:00:42 +00:00
StackMessagesCheckbox . Checked = Global . Config . StackOSDMessages ;
2011-06-16 02:39:35 +00:00
}
2017-05-31 15:28:06 +00:00
private void SetMaxXy ( )
2011-06-16 02:39:35 +00:00
{
2016-12-07 18:32:59 +00:00
var video = Global . Emulator . AsVideoProvider ( ) ; // TODO: this is objectively wrong, these are core agnostic settings, why is the current core used here? Also this will crash on a core without a video provider
2015-01-14 22:37:37 +00:00
XNumeric . Maximum = video . BufferWidth - 12 ;
YNumeric . Maximum = video . BufferHeight - 12 ;
PositionPanel . Size = new Size ( video . BufferWidth + 2 , video . BufferHeight + 2 ) ;
2011-06-16 02:39:35 +00:00
2014-12-28 21:59:53 +00:00
PositionGroupBox . Size = new Size (
2015-01-14 22:37:37 +00:00
Math . Max ( video . BufferWidth , UIHelper . ScaleX ( 128 ) ) + UIHelper . ScaleX ( 44 ) ,
video . BufferHeight + UIHelper . ScaleY ( 52 ) ) ;
2011-06-16 02:39:35 +00:00
}
private void SetColorBox ( )
{
2013-11-28 01:33:38 +00:00
_messageColor = MessageColorDialog . Color . ToArgb ( ) ;
2011-06-16 02:39:35 +00:00
ColorPanel . BackColor = MessageColorDialog . Color ;
2017-05-31 15:28:06 +00:00
ColorText . Text = $"{_messageColor:X8}" ;
2011-06-16 02:39:35 +00:00
2013-11-28 01:33:38 +00:00
_alertColor = AlertColorDialog . Color . ToArgb ( ) ;
2011-06-16 02:39:35 +00:00
AlertColorPanel . BackColor = AlertColorDialog . Color ;
2017-05-31 15:28:06 +00:00
AlertColorText . Text = $"{_alertColor:X8}" ;
2011-06-16 02:39:35 +00:00
2013-11-28 01:33:38 +00:00
_lastInputColor = LInputColorDialog . Color . ToArgb ( ) ;
2011-06-16 02:39:35 +00:00
LInputColorPanel . BackColor = LInputColorDialog . Color ;
2017-05-31 15:28:06 +00:00
LInputText . Text = $"{_lastInputColor:X8}" ;
2011-07-01 02:43:08 +00:00
2013-11-28 01:33:38 +00:00
_movieInput = MovieInputColorDialog . Color . ToArgb ( ) ;
2011-07-10 03:13:07 +00:00
MovieInputColor . BackColor = MovieInputColorDialog . Color ;
2017-05-31 15:28:06 +00:00
MovieInputText . Text = $"{_movieInput:X8}" ;
2011-06-16 02:39:35 +00:00
}
private void SetAnchorRadio ( int anchor )
{
switch ( anchor )
{
default :
case 0 :
2017-05-31 15:28:06 +00:00
TL . Checked = true ;
break ;
2011-06-16 02:39:35 +00:00
case 1 :
2017-05-31 15:28:06 +00:00
TR . Checked = true ;
break ;
2011-06-16 02:39:35 +00:00
case 2 :
2017-05-31 15:28:06 +00:00
BL . Checked = true ;
break ;
2011-06-16 02:39:35 +00:00
case 3 :
2017-05-31 15:28:06 +00:00
BR . Checked = true ;
break ;
2011-06-16 02:39:35 +00:00
}
}
private void SetPositionInfo ( )
{
if ( FPSRadio . Checked )
{
2013-11-28 01:33:38 +00:00
XNumeric . Value = _dispFpSx ;
YNumeric . Value = _dispFpSy ;
_px = _dispFpSx ;
_py = _dispFpSy ;
SetAnchorRadio ( _dispFpSanchor ) ;
2011-06-16 02:39:35 +00:00
}
else if ( FrameCounterRadio . Checked )
{
2013-11-28 01:33:38 +00:00
XNumeric . Value = _dispFrameCx ;
YNumeric . Value = _dispFrameCy ;
_px = _dispFrameCx ;
_py = _dispFrameCy ;
SetAnchorRadio ( _dispFrameanchor ) ;
2011-06-16 02:39:35 +00:00
}
else if ( LagCounterRadio . Checked )
{
2013-11-28 01:33:38 +00:00
XNumeric . Value = _dispLagx ;
YNumeric . Value = _dispLagy ;
_px = _dispLagx ;
_py = _dispLagy ;
SetAnchorRadio ( _dispLaganchor ) ;
2011-06-16 02:39:35 +00:00
}
else if ( InputDisplayRadio . Checked )
{
2013-11-28 01:33:38 +00:00
XNumeric . Value = _dispInpx ;
XNumeric . Value = _dispInpy ;
_px = _dispInpx ;
_py = _dispInpy ;
SetAnchorRadio ( _dispInputanchor ) ;
2011-06-16 02:39:35 +00:00
}
2015-10-01 06:39:22 +00:00
else if ( WatchesRadio . Checked )
{
XNumeric . Value = _dispWatchesx ;
XNumeric . Value = _dispWatchesy ;
_px = _dispWatchesx ;
_py = _dispWatchesy ;
SetAnchorRadio ( _dispWatchesanchor ) ;
}
2011-06-16 02:39:35 +00:00
else if ( MessagesRadio . Checked )
{
2013-11-28 01:33:38 +00:00
XNumeric . Value = _dispMessagex ;
YNumeric . Value = _dispMessagey ;
_px = _dispMessagex ;
_py = _dispMessagey ;
SetAnchorRadio ( _dispMessageAnchor ) ;
2011-06-16 02:39:35 +00:00
}
2011-07-01 02:00:11 +00:00
else if ( RerecordsRadio . Checked )
{
2013-11-28 01:33:38 +00:00
XNumeric . Value = _dispRecx ;
YNumeric . Value = _dispRecy ;
_px = _dispRecx ;
_py = _dispRecy ;
SetAnchorRadio ( _dispRecanchor ) ;
2011-07-01 02:00:11 +00:00
}
2011-07-10 03:38:46 +00:00
else if ( MultitrackRadio . Checked )
{
2013-11-28 01:33:38 +00:00
XNumeric . Value = _dispMultix ;
YNumeric . Value = _dispMultiy ;
_px = _dispMultix ;
_py = _dispMultiy ;
SetAnchorRadio ( _dispMultiAnchor ) ;
2011-07-10 03:38:46 +00:00
}
2012-09-26 23:25:43 +00:00
else if ( AutoholdRadio . Checked )
{
2013-11-28 01:33:38 +00:00
XNumeric . Value = _dispAutoholdx ;
YNumeric . Value = _dispAutoholdy ;
_px = _dispAutoholdx ;
_py = _dispAutoholdy ;
SetAnchorRadio ( _dispAutoholdAnchor ) ;
2012-09-26 23:25:43 +00:00
}
2011-06-16 02:39:35 +00:00
PositionPanel . Refresh ( ) ;
2011-06-18 16:22:26 +00:00
XNumeric . Refresh ( ) ;
YNumeric . Refresh ( ) ;
2011-06-16 02:39:35 +00:00
SetPositionLabels ( ) ;
}
private void SaveSettings ( )
{
2013-11-28 01:33:38 +00:00
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 ;
2015-10-01 06:39:22 +00:00
Global . Config . DispRamWatchx = _dispWatchesx ;
Global . Config . DispRamWatchy = _dispWatchesy ;
2013-11-28 01:33:38 +00:00
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 . 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 ;
2012-09-26 04:00:42 +00:00
Global . Config . StackOSDMessages = StackMessagesCheckbox . Checked ;
2011-06-16 02:39:35 +00:00
}
2017-05-31 15:28:06 +00:00
private void Ok_Click ( object sender , EventArgs e )
2011-06-16 02:39:35 +00:00
{
SaveSettings ( ) ;
2013-11-03 16:07:58 +00:00
GlobalWin . OSD . AddMessage ( "Message settings saved" ) ;
2013-11-28 01:33:38 +00:00
Close ( ) ;
2011-06-16 02:39:35 +00:00
}
2013-11-28 01:33:38 +00:00
private void MessageTypeRadio_CheckedChanged ( object sender , EventArgs e )
2012-09-26 23:25:43 +00:00
{
SetPositionInfo ( ) ;
}
2011-06-16 02:39:35 +00:00
private void XNumericChange ( )
{
2013-11-28 01:33:38 +00:00
_px = ( int ) XNumeric . Value ;
2011-06-16 02:39:35 +00:00
SetPositionLabels ( ) ;
PositionPanel . Refresh ( ) ;
}
private void YNumericChange ( )
{
2013-11-28 01:33:38 +00:00
_py = ( int ) YNumeric . Value ;
2011-06-16 02:39:35 +00:00
SetPositionLabels ( ) ;
PositionPanel . Refresh ( ) ;
}
private void Cancel_Click ( object sender , EventArgs e )
{
2013-11-03 16:07:58 +00:00
GlobalWin . OSD . AddMessage ( "Message config aborted" ) ;
2013-11-28 01:33:38 +00:00
Close ( ) ;
2011-06-16 02:39:35 +00:00
}
private void PositionPanel_MouseEnter ( object sender , EventArgs e )
{
2013-11-28 01:33:38 +00:00
Cursor = Cursors . Hand ;
2011-06-16 02:39:35 +00:00
}
private void PositionPanel_MouseLeave ( object sender , EventArgs e )
{
2013-11-28 01:33:38 +00:00
Cursor = Cursors . Default ;
2011-06-16 02:39:35 +00:00
}
private void PositionPanel_Paint ( object sender , PaintEventArgs e )
{
2012-09-26 23:41:11 +00:00
int x = 0 ;
int y = 0 ;
if ( TL . Checked )
{
2013-11-28 01:33:38 +00:00
x = _px ;
y = _py ;
2012-09-26 23:41:11 +00:00
}
else if ( TR . Checked )
{
2013-11-28 01:33:38 +00:00
x = ( int ) XNumeric . Maximum - _px ;
y = _py ;
2012-09-26 23:41:11 +00:00
}
else if ( BL . Checked )
{
2013-11-28 01:33:38 +00:00
x = _px ;
y = ( int ) YNumeric . Maximum - _py ;
2012-09-26 23:41:11 +00:00
}
else if ( BR . Checked )
{
2013-11-28 01:33:38 +00:00
x = ( int ) XNumeric . Maximum - _px ;
y = ( int ) YNumeric . Maximum - _py ;
2012-09-26 23:41:11 +00:00
}
2013-11-28 01:33:38 +00:00
var p = new Pen ( _brush ) ;
2012-09-27 00:52:45 +00:00
e . Graphics . DrawLine ( p , new Point ( x , y ) , new Point ( x + 8 , y + 8 ) ) ;
e . Graphics . DrawLine ( p , new Point ( x + 8 , y ) , new Point ( x , y + 8 ) ) ;
2013-11-28 01:33:38 +00:00
e . Graphics . DrawRectangle ( p , new Rectangle ( x , y , 8 , 8 ) ) ;
2011-06-16 02:39:35 +00:00
}
private void PositionPanel_MouseDown ( object sender , MouseEventArgs e )
{
2013-11-28 01:33:38 +00:00
Cursor = Cursors . Arrow ;
_mousedown = true ;
2011-06-16 02:39:35 +00:00
SetNewPosition ( e . X , e . Y ) ;
}
private void PositionPanel_MouseUp ( object sender , MouseEventArgs e )
{
2013-11-28 01:33:38 +00:00
Cursor = Cursors . Hand ;
_mousedown = false ;
2011-06-16 02:39:35 +00:00
}
private void SetNewPosition ( int mx , int my )
{
if ( mx < 0 ) mx = 0 ;
if ( my < 0 ) my = 0 ;
if ( mx > XNumeric . Maximum ) mx = ( int ) XNumeric . Maximum ;
if ( my > YNumeric . Maximum ) my = ( int ) YNumeric . Maximum ;
2012-09-27 00:04:16 +00:00
if ( TL . Checked )
{
2017-05-31 15:28:06 +00:00
// Do nothing
2012-09-27 00:04:16 +00:00
}
else if ( TR . Checked )
{
mx = ( int ) XNumeric . Maximum - mx ;
}
else if ( BL . Checked )
{
my = ( int ) YNumeric . Maximum - my ;
}
else if ( BR . Checked )
{
mx = ( int ) XNumeric . Maximum - mx ;
my = ( int ) YNumeric . Maximum - my ;
}
2011-06-16 02:39:35 +00:00
XNumeric . Value = mx ;
YNumeric . Value = my ;
2013-11-28 01:33:38 +00:00
_px = mx ;
_py = my ;
2011-06-16 02:39:35 +00:00
PositionPanel . Refresh ( ) ;
SetPositionLabels ( ) ;
}
private void PositionPanel_MouseMove ( object sender , MouseEventArgs e )
{
2013-11-28 01:33:38 +00:00
if ( _mousedown )
2011-06-16 02:39:35 +00:00
{
SetNewPosition ( e . X , e . Y ) ;
}
}
private void SetPositionLabels ( )
{
if ( FPSRadio . Checked )
{
2013-11-28 01:33:38 +00:00
_dispFpSx = _px ;
_dispFpSy = _py ;
2011-06-16 02:39:35 +00:00
}
else if ( FrameCounterRadio . Checked )
{
2013-11-28 01:33:38 +00:00
_dispFrameCx = _px ;
_dispFrameCy = _py ;
2011-06-16 02:39:35 +00:00
}
else if ( LagCounterRadio . Checked )
{
2013-11-28 01:33:38 +00:00
_dispLagx = _px ;
_dispLagy = _py ;
2011-06-16 02:39:35 +00:00
}
else if ( InputDisplayRadio . Checked )
{
2013-11-28 01:33:38 +00:00
_dispInpx = _px ;
_dispInpy = _py ;
2011-06-16 02:39:35 +00:00
}
2015-10-01 06:39:22 +00:00
else if ( WatchesRadio . Checked )
{
_dispWatchesx = _px ;
_dispWatchesy = _py ;
}
2011-07-01 02:00:11 +00:00
else if ( RerecordsRadio . Checked )
{
2013-11-28 01:33:38 +00:00
_dispRecx = _px ;
_dispRecy = _py ;
2011-07-01 02:00:11 +00:00
}
2011-07-10 03:38:46 +00:00
else if ( MultitrackRadio . Checked )
{
2013-11-28 01:33:38 +00:00
_dispMultix = _px ;
_dispMultiy = _py ;
2011-07-10 03:38:46 +00:00
}
2012-09-25 04:04:54 +00:00
else if ( MessagesRadio . Checked )
{
2013-11-28 01:33:38 +00:00
_dispMessagex = _px ;
_dispMessagey = _py ;
2012-09-25 04:04:54 +00:00
}
2012-09-26 23:25:43 +00:00
else if ( AutoholdRadio . Checked )
{
2013-11-28 01:33:38 +00:00
_dispAutoholdx = _px ;
_dispAutoholdy = _py ;
2012-09-26 23:25:43 +00:00
}
2012-09-25 04:04:54 +00:00
2019-03-18 14:06:37 +00:00
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}" ;
2011-06-16 02:39:35 +00:00
}
private void ResetDefaultsButton_Click ( object sender , EventArgs e )
{
2015-07-08 21:58:17 +00:00
Global . Config . DispFPSx = Config . DefaultMessageOptions . DispFPSx ;
Global . Config . DispFPSy = Config . DefaultMessageOptions . DispFPSy ;
2017-04-15 20:37:30 +00:00
Global . Config . DispFrameCx = Config . DefaultMessageOptions . DispFrameCx ;
Global . Config . DispFrameCy = Config . DefaultMessageOptions . DispFrameCy ;
Global . Config . DispLagx = Config . DefaultMessageOptions . DispLagx ;
Global . Config . DispLagy = Config . DefaultMessageOptions . DispLagy ;
Global . Config . DispInpx = Config . DefaultMessageOptions . DispInpx ;
Global . Config . DispInpy = Config . DefaultMessageOptions . DispInpy ;
Global . Config . DispRecx = Config . DefaultMessageOptions . DispRecx ;
Global . Config . DispRecy = Config . DefaultMessageOptions . DispRecy ;
Global . Config . DispMultix = Config . DefaultMessageOptions . DispMultix ;
Global . Config . DispMultiy = Config . DefaultMessageOptions . DispMultiy ;
Global . Config . DispMessagex = Config . DefaultMessageOptions . DispMessagex ;
Global . Config . DispMessagey = Config . DefaultMessageOptions . DispMessagey ;
Global . Config . DispAutoholdx = Config . DefaultMessageOptions . DispAutoholdx ;
Global . Config . DispAutoholdy = Config . DefaultMessageOptions . DispAutoholdy ;
Global . Config . DispFPSanchor = Config . DefaultMessageOptions . DispFPSanchor ;
Global . Config . DispFrameanchor = Config . DefaultMessageOptions . DispFrameanchor ;
Global . Config . DispLaganchor = Config . DefaultMessageOptions . DispLaganchor ;
Global . Config . DispInpanchor = Config . DefaultMessageOptions . DispInpanchor ;
Global . Config . DispRecanchor = Config . DefaultMessageOptions . DispRecanchor ;
Global . Config . DispMultianchor = Config . DefaultMessageOptions . DispMultianchor ;
Global . Config . DispMessageanchor = Config . DefaultMessageOptions . DispMessageanchor ;
Global . Config . DispAutoholdanchor = Config . DefaultMessageOptions . DispAutoholdanchor ;
Global . Config . MessagesColor = Config . DefaultMessageOptions . MessagesColor ;
Global . Config . AlertMessageColor = Config . DefaultMessageOptions . AlertMessageColor ;
Global . Config . LastInputColor = Config . DefaultMessageOptions . LastInputColor ;
Global . Config . MovieInput = Config . DefaultMessageOptions . MovieInput ;
2011-07-10 03:13:07 +00:00
2013-11-28 01:33:38 +00:00
_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 ;
2017-04-15 20:37:30 +00:00
_dispAutoholdAnchor = Global . Config . DispAutoholdanchor ;
2015-07-08 23:07:21 +00:00
2017-04-15 20:37:30 +00:00
_messageColor = Global . Config . MessagesColor ;
_alertColor = Global . Config . AlertMessageColor ;
_lastInputColor = Global . Config . LastInputColor ;
_movieInput = Global . Config . MovieInput ;
2015-07-08 23:07:21 +00:00
2017-04-15 20:37:30 +00:00
MessageColorDialog . Color = Color . FromArgb ( _messageColor ) ;
AlertColorDialog . Color = Color . FromArgb ( _alertColor ) ;
LInputColorDialog . Color = Color . FromArgb ( _lastInputColor ) ;
MovieInputColorDialog . Color = Color . FromArgb ( _movieInput ) ;
2012-09-25 04:04:54 +00:00
2017-05-31 15:28:06 +00:00
SetMaxXy ( ) ;
2011-06-16 02:39:35 +00:00
SetColorBox ( ) ;
SetPositionInfo ( ) ;
2012-09-26 04:00:42 +00:00
StackMessagesCheckbox . Checked = Global . Config . StackOSDMessages = true ;
2011-06-16 02:39:35 +00:00
}
2012-09-25 04:04:54 +00:00
private void SetAnchorValue ( int value )
{
if ( FPSRadio . Checked )
{
2013-11-28 01:33:38 +00:00
_dispFpSanchor = value ;
2012-09-25 04:04:54 +00:00
}
else if ( FrameCounterRadio . Checked )
{
2013-11-28 01:33:38 +00:00
_dispFrameanchor = value ;
2012-09-25 04:04:54 +00:00
}
else if ( LagCounterRadio . Checked )
{
2013-11-28 01:33:38 +00:00
_dispLaganchor = value ;
2012-09-25 04:04:54 +00:00
}
else if ( InputDisplayRadio . Checked )
{
2013-11-28 01:33:38 +00:00
_dispInputanchor = value ;
2012-09-25 04:04:54 +00:00
}
2015-10-01 06:39:22 +00:00
else if ( WatchesRadio . Checked )
{
_dispWatchesanchor = value ;
}
2012-09-25 04:04:54 +00:00
else if ( MessagesRadio . Checked )
{
2013-11-28 01:33:38 +00:00
_dispMessageAnchor = value ;
2012-09-25 04:04:54 +00:00
}
else if ( RerecordsRadio . Checked )
{
2013-11-28 01:33:38 +00:00
_dispRecanchor = value ;
2012-09-25 04:04:54 +00:00
}
else if ( MultitrackRadio . Checked )
{
2013-11-28 01:33:38 +00:00
_dispMultiAnchor = value ;
2012-09-25 04:04:54 +00:00
}
2012-09-26 23:25:43 +00:00
else if ( AutoholdRadio . Checked )
{
2013-11-28 01:33:38 +00:00
_dispAutoholdAnchor = value ;
2012-09-26 23:25:43 +00:00
}
2012-09-25 04:04:54 +00:00
}
2011-06-16 02:39:35 +00:00
private void TL_CheckedChanged ( object sender , EventArgs e )
{
if ( TL . Checked )
{
2012-09-25 04:04:54 +00:00
SetAnchorValue ( 0 ) ;
2011-06-16 02:39:35 +00:00
}
2017-05-31 15:28:06 +00:00
2012-09-26 23:41:11 +00:00
PositionPanel . Refresh ( ) ;
2011-06-16 02:39:35 +00:00
}
private void TR_CheckedChanged ( object sender , EventArgs e )
{
if ( TR . Checked )
{
2012-09-25 04:04:54 +00:00
SetAnchorValue ( 1 ) ;
2011-06-16 02:39:35 +00:00
}
2017-05-31 15:28:06 +00:00
2012-09-26 23:41:11 +00:00
PositionPanel . Refresh ( ) ;
2011-06-16 02:39:35 +00:00
}
private void BL_CheckedChanged ( object sender , EventArgs e )
{
if ( BL . Checked )
{
2012-09-25 04:04:54 +00:00
SetAnchorValue ( 2 ) ;
2011-06-16 02:39:35 +00:00
}
2012-09-26 23:41:11 +00:00
PositionPanel . Refresh ( ) ;
2011-06-16 02:39:35 +00:00
}
private void BR_CheckedChanged ( object sender , EventArgs e )
{
if ( BR . Checked )
{
2012-09-25 04:04:54 +00:00
SetAnchorValue ( 3 ) ;
2011-06-16 02:39:35 +00:00
}
2012-09-26 23:41:11 +00:00
PositionPanel . Refresh ( ) ;
2011-06-16 02:39:35 +00:00
}
2011-06-18 16:22:26 +00:00
private void XNumeric_Click ( object sender , EventArgs e )
{
XNumericChange ( ) ;
}
private void YNumeric_Click ( object sender , EventArgs e )
{
YNumericChange ( ) ;
}
2011-07-01 02:43:08 +00:00
2012-09-16 20:28:56 +00:00
private void ColorPanel_Click ( object sender , EventArgs e )
2011-07-01 02:43:08 +00:00
{
2012-09-16 20:28:56 +00:00
if ( MessageColorDialog . ShowDialog ( ) = = DialogResult . OK )
2012-09-25 04:04:54 +00:00
{
2012-09-16 20:28:56 +00:00
SetColorBox ( ) ;
2012-09-25 04:04:54 +00:00
}
2012-09-16 20:28:56 +00:00
}
2012-09-16 20:22:22 +00:00
2012-09-16 20:28:56 +00:00
private void AlertColorPanel_Click ( object sender , EventArgs e )
{
if ( AlertColorDialog . ShowDialog ( ) = = DialogResult . OK )
2012-09-25 04:04:54 +00:00
{
2012-09-16 20:28:56 +00:00
SetColorBox ( ) ;
2012-09-25 04:04:54 +00:00
}
2011-07-01 02:43:08 +00:00
}
2012-09-16 20:22:22 +00:00
private void LInputColorPanel_Click ( object sender , EventArgs e )
2011-07-01 02:43:08 +00:00
{
2012-09-16 20:28:56 +00:00
if ( LInputColorDialog . ShowDialog ( ) = = DialogResult . OK )
2012-09-25 04:04:54 +00:00
{
2012-09-16 20:28:56 +00:00
SetColorBox ( ) ;
2012-09-25 04:04:54 +00:00
}
2011-07-01 02:43:08 +00:00
}
2012-09-16 20:22:22 +00:00
private void MovieInputColor_Click ( object sender , EventArgs e )
2011-07-10 03:13:07 +00:00
{
2012-09-16 20:28:56 +00:00
if ( MovieInputColorDialog . ShowDialog ( ) = = DialogResult . OK )
2012-09-25 04:04:54 +00:00
{
2012-09-16 20:28:56 +00:00
SetColorBox ( ) ;
2012-09-25 04:04:54 +00:00
}
2011-07-10 03:13:07 +00:00
}
2012-09-27 01:01:35 +00:00
private void XNumeric_KeyUp ( object sender , KeyEventArgs e )
{
XNumericChange ( ) ;
}
private void YNumeric_KeyUp ( object sender , KeyEventArgs e )
{
YNumericChange ( ) ;
}
2011-06-16 02:39:35 +00:00
}
2011-04-23 00:39:29 +00:00
}