diff --git a/BizHawk.MultiClient/Config.cs b/BizHawk.MultiClient/Config.cs index 4aef787dc2..b64742fbf0 100644 --- a/BizHawk.MultiClient/Config.cs +++ b/BizHawk.MultiClient/Config.cs @@ -780,7 +780,7 @@ namespace BizHawk.MultiClient public bool Atari2600_ShowPlayfield = true; } - public class NESConsoleButtonTemplate + public class NESConsoleButtonTemplate : iControllerConfigObject { public string Reset = ""; public string Power = ""; @@ -788,276 +788,253 @@ namespace BizHawk.MultiClient //public string FDS_Insert = ""; //Need to support inserting of disk 1,2,3,4,etc so not supporting this for now //public string VS_Coin_1 = ""; //Not supported yet //public string VS_Coin_2 = ""; //Not supported yet + + public void SetDefaults() + { + Reset = ""; + Power = ""; + } } - public class SMSConsoleButtonTemplate + public class SMSConsoleButtonTemplate : iControllerConfigObject { public string Reset = "C"; public string Pause = "V, X1 Start"; + + public void SetDefaults() + { + Reset = "C"; + Pause = "V, X1 Start"; + } } - public class GenConsoleButtonTemplate + public class GenConsoleButtonTemplate : iControllerConfigObject { public string Reset = ""; + + public void SetDefaults() + { + Reset = ""; + } } - public class SMSControllerTemplate + public class SMSControllerTemplate : iControllerConfigObject { - public string Up; - public string Down; - public string Left; - public string Right; - public string B1; - public string B2; - public bool Enabled; + public string Up = ""; + public string Down = ""; + public string Left = ""; + public string Right = ""; + public string B1 = ""; + public string B2 = ""; + public bool Enabled = false; public SMSControllerTemplate() { } public SMSControllerTemplate(bool defaults) { if (defaults) { - Enabled = true; - Up = "UpArrow, X1 DpadUp, X1 LStickUp"; - Down = "DownArrow, X1 DpadDown, X1 LStickDown"; - Left = "LeftArrow, X1 DpadLeft, X1 LStickLeft"; - Right = "RightArrow, X1 DpadRight, X1 LStickRight"; - B1 = "Z, X1 A"; - B2 = "X, X1 B"; - } - else - { - Enabled = false; - Up = ""; - Down = ""; - Right = ""; - Left = ""; - B1 = ""; - B2 = ""; + SetDefaults(); } } + + public void SetDefaults() + { + Enabled = true; + Up = "UpArrow, X1 DpadUp, X1 LStickUp"; + Down = "DownArrow, X1 DpadDown, X1 LStickDown"; + Left = "LeftArrow, X1 DpadLeft, X1 LStickLeft"; + Right = "RightArrow, X1 DpadRight, X1 LStickRight"; + B1 = "Z, X1 A"; + B2 = "X, X1 B"; + } } - public class PCEControllerTemplate + public class PCEControllerTemplate : iControllerConfigObject { - public string Up; - public string Down; - public string Left; - public string Right; - public string I; - public string II; - public string Select; - public string Run; - public bool Enabled; + public string Up = ""; + public string Down = ""; + public string Left = ""; + public string Right = ""; + public string I = ""; + public string II = ""; + public string Select = ""; + public string Run = ""; + public bool Enabled = false; public PCEControllerTemplate() { } public PCEControllerTemplate(bool defaults) { if (defaults) { - Enabled = true; - Up = "UpArrow, X1 DpadUp, X1 LStickUp"; - Down = "DownArrow, X1 DpadDown, X1 LStickDown"; - Left = "LeftArrow, X1 DpadLeft, X1 LStickLeft"; - Right = "RightArrow, X1 DpadRight, X1 LStickRight"; - I = "Z, X1 B"; - II = "X, X1 A"; - Run = "C, X1 Start"; - Select = "V, X1 Back"; - } - else - { - Enabled = false; - Up = ""; - Down = ""; - Right = ""; - Left = ""; - I = ""; - II = ""; - Run = ""; - Select = ""; + SetDefaults(); } } + + public void SetDefaults() + { + Enabled = true; + Up = "UpArrow, X1 DpadUp, X1 LStickUp"; + Down = "DownArrow, X1 DpadDown, X1 LStickDown"; + Left = "LeftArrow, X1 DpadLeft, X1 LStickLeft"; + Right = "RightArrow, X1 DpadRight, X1 LStickRight"; + I = "Z, X1 B"; + II = "X, X1 A"; + Run = "C, X1 Start"; + Select = "V, X1 Back"; + } } - public class SNESControllerTemplate + public class SNESControllerTemplate : iControllerConfigObject { - public string Up; - public string Down; - public string Left; - public string Right; - public string A; - public string B; - public string Start; - public string Select; - public string Y, X, L, R; - public bool Enabled; + public string Up = ""; + public string Down = ""; + public string Left = ""; + public string Right = ""; + public string A = ""; + public string B = ""; + public string Start = ""; + public string Select = ""; + public string Y = ""; + public string X = ""; + public string L = ""; + public string R = ""; + public bool Enabled = false; public SNESControllerTemplate() { } public SNESControllerTemplate(bool defaults) { if (defaults) { - Enabled = true; - Up = "UpArrow, X1 DpadUp, X1 LStickUp"; - Down = "DownArrow, X1 DpadDown, X1 LStickDown"; - Left = "LeftArrow, X1 DpadLeft, X1 LStickLeft"; - Right = "RightArrow, X1 DpadRight, X1 LStickRight"; - A = "X, X1 B"; - B = "Z, X1 A"; - Y = "A, X1 X"; - X = "S, X1 Y"; - L = "W, X1 LeftTrigger"; - R = "E, X1 RightTrigger"; - Start = "Return, X1 Start"; - Select = "Space, X1 Back"; - } - else - { - Enabled = false; - Up = ""; - Down = ""; - Right = ""; - Left = ""; - A = ""; - B = ""; - Start = ""; - Select = ""; - X = Y = L = R = ""; + SetDefaults(); } } + + public void SetDefaults() + { + Enabled = true; + Up = "UpArrow, X1 DpadUp, X1 LStickUp"; + Down = "DownArrow, X1 DpadDown, X1 LStickDown"; + Left = "LeftArrow, X1 DpadLeft, X1 LStickLeft"; + Right = "RightArrow, X1 DpadRight, X1 LStickRight"; + A = "X, X1 B"; + B = "Z, X1 A"; + Y = "A, X1 X"; + X = "S, X1 Y"; + L = "W, X1 LeftTrigger"; + R = "E, X1 RightTrigger"; + Start = "Return, X1 Start"; + Select = "Space, X1 Back"; + } } - public class GBAControllerTemplate + public class GBAControllerTemplate : iControllerConfigObject { - public string Up; - public string Down; - public string Left; - public string Right; - public string A; - public string B; - public string Start; - public string Select; - public string L, R; - public string Power; - public bool Enabled; + public string Up = ""; + public string Down = ""; + public string Left = ""; + public string Right = ""; + public string A = ""; + public string B = ""; + public string Start = ""; + public string Select = ""; + public string L = ""; + public string R = ""; + public string Power = ""; + public bool Enabled = false; public GBAControllerTemplate() { } public GBAControllerTemplate(bool defaults) { if (defaults) { - Enabled = true; - Up = "UpArrow, X1 DpadUp, X1 LStickUp"; - Down = "DownArrow, X1 DpadDown, X1 LStickDown"; - Left = "LeftArrow, X1 DpadLeft, X1 LStickLeft"; - Right = "RightArrow, X1 DpadRight, X1 LStickRight"; - A = "X, X1 B"; - B = "Z, X1 A"; - L = "W, X1 LeftTrigger"; - R = "E, X1 RightTrigger"; - Start = "Return, X1 Start"; - Select = "Space, X1 Back"; - Power = ""; - } - else - { - Enabled = false; - Up = ""; - Down = ""; - Right = ""; - Left = ""; - A = ""; - B = ""; - Start = ""; - Select = ""; - L = R = ""; - Power = ""; + SetDefaults(); } } + + public void SetDefaults() + { + Enabled = true; + Up = "UpArrow, X1 DpadUp, X1 LStickUp"; + Down = "DownArrow, X1 DpadDown, X1 LStickDown"; + Left = "LeftArrow, X1 DpadLeft, X1 LStickLeft"; + Right = "RightArrow, X1 DpadRight, X1 LStickRight"; + A = "X, X1 B"; + B = "Z, X1 A"; + L = "W, X1 LeftTrigger"; + R = "E, X1 RightTrigger"; + Start = "Return, X1 Start"; + Select = "Space, X1 Back"; + Power = ""; + } } - public class NESControllerTemplate + public class NESControllerTemplate : iControllerConfigObject { - public string Up; - public string Down; - public string Left; - public string Right; - public string A; - public string B; - public string Select; - public string Start; - public bool Enabled; + public string Up = ""; + public string Down = ""; + public string Left = ""; + public string Right = ""; + public string A = ""; + public string B = ""; + public string Select = ""; + public string Start = ""; + public bool Enabled = false; public NESControllerTemplate() { } public NESControllerTemplate(bool defaults) { if (defaults) { - Enabled = true; - Up = "UpArrow, X1 DpadUp, X1 LStickUp"; - Down = "DownArrow, X1 DpadDown, X1 LStickDown"; - Left = "LeftArrow, X1 DpadLeft, X1 LStickLeft"; - Right = "RightArrow, X1 DpadRight, X1 LStickRight"; - A = "X, X1 B"; - B = "Z, X1 A"; - Start = "Return, X1 Start"; - Select = "Space, X1 Back"; - } - else - { - Enabled = false; - Up = ""; - Down = ""; - Right = ""; - Left = ""; - A = ""; - B = ""; - Start = ""; - Select = ""; + SetDefaults(); } } + + public void SetDefaults() + { + Enabled = true; + Up = "UpArrow, X1 DpadUp, X1 LStickUp"; + Down = "DownArrow, X1 DpadDown, X1 LStickDown"; + Left = "LeftArrow, X1 DpadLeft, X1 LStickLeft"; + Right = "RightArrow, X1 DpadRight, X1 LStickRight"; + A = "X, X1 B"; + B = "Z, X1 A"; + Start = "Return, X1 Start"; + Select = "Space, X1 Back"; + } } - public class GBControllerTemplate + public class GBControllerTemplate : iControllerConfigObject { - public string Up; - public string Down; - public string Left; - public string Right; - public string A; - public string B; - public string Select; - public string Start; + public string Up = ""; + public string Down = ""; + public string Left = ""; + public string Right = ""; + public string A = ""; + public string B = ""; + public string Select = ""; + public string Start = ""; public string Power = ""; - public bool Enabled; + public bool Enabled = false; public GBControllerTemplate() { } public GBControllerTemplate(bool defaults) { if (defaults) { - Enabled = true; - Up = "UpArrow, X1 DpadUp, X1 LStickUp"; - Down = "DownArrow, X1 DpadDown, X1 LStickDown"; - Left = "LeftArrow, X1 DpadLeft, X1 LStickLeft"; - Right = "RightArrow, X1 DpadRight, X1 LStickRight"; - A = "X, X1 B"; - B = "Z, X1 A"; - Start = "Return, X1 Start"; - Select = "Space, X1 Back"; - Power = ""; - } - else - { - Enabled = false; - Up = ""; - Down = ""; - Right = ""; - Left = ""; - A = ""; - B = ""; - Start = ""; - Select = ""; - Power = ""; + SetDefaults(); } } + + public void SetDefaults() + { + Enabled = true; + Up = "UpArrow, X1 DpadUp, X1 LStickUp"; + Down = "DownArrow, X1 DpadDown, X1 LStickDown"; + Left = "LeftArrow, X1 DpadLeft, X1 LStickLeft"; + Right = "RightArrow, X1 DpadRight, X1 LStickRight"; + A = "X, X1 B"; + B = "Z, X1 A"; + Start = "Return, X1 Start"; + Select = "Space, X1 Back"; + Power = ""; + } } - public class GenControllerTemplate + public class GenControllerTemplate : iControllerConfigObject { public string Up = ""; public string Down = ""; @@ -1074,20 +1051,25 @@ namespace BizHawk.MultiClient { if (defaults) { - Enabled = true; - Up = "UpArrow, X1 DpadUp, X1 LStickUp"; - Down = "DownArrow, X1 DpadDown, X1 LStickDown"; - Left = "LeftArrow, X1 DpadLeft, X1 LStickLeft"; - Right = "RightArrow, X1 DpadRight, X1 LStickRight"; - A = "Z, X1 A"; - B = "X, X1 X"; - C = "C, X1 Y"; - Start = "Return, X1 Start"; + SetDefaults(); } } + + public void SetDefaults() + { + Enabled = true; + Up = "UpArrow, X1 DpadUp, X1 LStickUp"; + Down = "DownArrow, X1 DpadDown, X1 LStickDown"; + Left = "LeftArrow, X1 DpadLeft, X1 LStickLeft"; + Right = "RightArrow, X1 DpadRight, X1 LStickRight"; + A = "Z, X1 A"; + B = "X, X1 X"; + C = "C, X1 Y"; + Start = "Return, X1 Start"; + } } - public class SingleButtonJoyStickTemplate + public class SingleButtonJoyStickTemplate : iControllerConfigObject { public string Up = ""; public string Down = ""; @@ -1095,53 +1077,65 @@ namespace BizHawk.MultiClient public string Right = ""; public string Button = ""; public bool Enabled; + public bool UseNumpad; public SingleButtonJoyStickTemplate() { } public SingleButtonJoyStickTemplate(bool defaults, bool useNumpad = false) { + UseNumpad = useNumpad; if (defaults) { - if (useNumpad) - { - Enabled = true; - Up = "NumberPad8, X1 DpadUp, X1 LStickUp"; - Down = "NumberPad2, X1 DpadDown, X1 LStickDown"; - Left = "NumberPad4, X1 DpadLeft, X1 LStickLeft"; - Right = "NumberPad6, X1 DpadRight, X1 LStickRight"; - Button = "NumberPad8, X1 A"; - } - else - { - Enabled = true; - Up = "UpArrow, X1 DpadUp, X1 LStickUp"; - Down = "DownArrow, X1 DpadDown, X1 LStickDown"; - Left = "LeftArrow, X1 DpadLeft, X1 LStickLeft"; - Right = "RightArrow, X1 DpadRight, X1 LStickRight"; - Button = "Z, X1 A"; - } + SetDefaults(); + } + } + + public void SetDefaults() + { + if (UseNumpad) + { + Enabled = true; + Up = "NumberPad8, X1 DpadUp, X1 LStickUp"; + Down = "NumberPad2, X1 DpadDown, X1 LStickDown"; + Left = "NumberPad4, X1 DpadLeft, X1 LStickLeft"; + Right = "NumberPad6, X1 DpadRight, X1 LStickRight"; + Button = "NumberPad8, X1 A"; + } + else + { + Enabled = true; + Up = "UpArrow, X1 DpadUp, X1 LStickUp"; + Down = "DownArrow, X1 DpadDown, X1 LStickDown"; + Left = "LeftArrow, X1 DpadLeft, X1 LStickLeft"; + Right = "RightArrow, X1 DpadRight, X1 LStickRight"; + Button = "Z, X1 A"; } } } - public class Atari2600ConsoleButtonsTemplate + public class Atari2600ConsoleButtonsTemplate : iControllerConfigObject { public string Reset = ""; public string Select = ""; - public bool Enabled; + public bool Enabled = false; public Atari2600ConsoleButtonsTemplate() { } public Atari2600ConsoleButtonsTemplate(bool defaults) { if (defaults) { - Enabled = true; - Reset = ""; - Select = ""; + SetDefaults(); } } + + public void SetDefaults() + { + Enabled = true; + Reset = ""; + Select = ""; + } } - public class ColecoVisionControllerTemplate + public class ColecoVisionControllerTemplate : iControllerConfigObject { public string Up = ""; public string Down = ""; @@ -1168,347 +1162,315 @@ namespace BizHawk.MultiClient { if (defaults) { - Enabled = true; - Up = "UpArrow, X1 DpadUp, X1 LStickUp"; - Down = "DownArrow, X1 DpadDown, X1 LStickDown"; - Left = "LeftArrow, X1 DpadLeft, X1 LStickLeft"; - Right = "RightArrow, X1 DpadRight, X1 LStickRight"; - L = "Z, J1 B1"; - R = "X, J1 B1"; - _0 = "NumberPad0"; - _1 = "NumberPad1"; - _2 = "NumberPad2"; - _3 = "NumberPad3"; - _4 = "NumberPad4"; - _5 = "NumberPad5"; - _6 = "NumberPad6"; - _7 = "NumberPad7"; - _8 = "NumberPad8"; - _9 = "NumberPad9"; - Pound = "NumberPadPeriod"; - Star = "NumberPadEnter"; + SetDefaults(); } } + + public void SetDefaults() + { + Enabled = true; + Up = "UpArrow, X1 DpadUp, X1 LStickUp"; + Down = "DownArrow, X1 DpadDown, X1 LStickDown"; + Left = "LeftArrow, X1 DpadLeft, X1 LStickLeft"; + Right = "RightArrow, X1 DpadRight, X1 LStickRight"; + L = "Z, J1 B1"; + R = "X, J1 B1"; + _0 = "NumberPad0"; + _1 = "NumberPad1"; + _2 = "NumberPad2"; + _3 = "NumberPad3"; + _4 = "NumberPad4"; + _5 = "NumberPad5"; + _6 = "NumberPad6"; + _7 = "NumberPad7"; + _8 = "NumberPad8"; + _9 = "NumberPad9"; + Pound = "NumberPadPeriod"; + Star = "NumberPadEnter"; + } } - public class C64KeyboardTemplate + public class C64KeyboardTemplate : iControllerConfigObject { - public string F1; - public string F3; - public string F5; - public string F7; + public string F1 = ""; + public string F3 = ""; + public string F5 = ""; + public string F7 = ""; - public string Left_Arrow; - public string _1; - public string _2; - public string _3; - public string _4; - public string _5; - public string _6; - public string _7; - public string _8; - public string _9; - public string _0; - public string Plus; - public string Minus; - public string Pound; - public string Clear_Home; - public string Insert_Delete; + public string Left_Arrow = ""; + public string _1 = ""; + public string _2 = ""; + public string _3 = ""; + public string _4 = ""; + public string _5 = ""; + public string _6 = ""; + public string _7 = ""; + public string _8 = ""; + public string _9 = ""; + public string _0 = ""; + public string Plus = ""; + public string Minus = ""; + public string Pound = ""; + public string Clear_Home = ""; + public string Insert_Delete = ""; - public string Control; - public string Q; - public string W; - public string E; - public string R; - public string T; - public string Y; - public string U; - public string I; - public string O; - public string P; - public string At; - public string Asterisk; - public string Up_Arrow; - public string Restore; + public string Control = ""; + public string Q = ""; + public string W = ""; + public string E = ""; + public string R = ""; + public string T = ""; + public string Y = ""; + public string U = ""; + public string I = ""; + public string O = ""; + public string P = ""; + public string At = ""; + public string Asterisk = ""; + public string Up_Arrow = ""; + public string Restore = ""; - public string Run_Stop; - public string Lck; - public string A; - public string S; - public string D; - public string F; - public string G; - public string H; - public string J; - public string K; - public string L; - public string Colon; - public string Semicolon; - public string Equal; - public string Return; + public string Run_Stop = ""; + public string Lck = ""; + public string A = ""; + public string S = ""; + public string D = ""; + public string F = ""; + public string G = ""; + public string H = ""; + public string J = ""; + public string K = ""; + public string L = ""; + public string Colon = ""; + public string Semicolon = ""; + public string Equal = ""; + public string Return = ""; - public string Commodore; - public string Left_Shift; - public string Z; - public string X; - public string C; - public string V; - public string B; - public string N; - public string M; - public string Comma; - public string Period; - public string Slash; - public string Right_Shift; - public string Cursor_Up_Down; - public string Cursor_Left_Right; + public string Commodore = ""; + public string Left_Shift = ""; + public string Z = ""; + public string X = ""; + public string C = ""; + public string V = ""; + public string B = ""; + public string N = ""; + public string M = ""; + public string Comma = ""; + public string Period = ""; + public string Slash = ""; + public string Right_Shift = ""; + public string Cursor_Up_Down = ""; + public string Cursor_Left_Right = ""; - public string Space; + public string Space = ""; - public bool enabled; + public bool enabled = false; public C64KeyboardTemplate() { } public C64KeyboardTemplate(bool defaults) { if (defaults) { - F1 = "F1"; - F3 = "F3"; - F5 = "F5"; - F7 = "F7"; - - Left_Arrow = "Grave"; - _1 = "D1"; - _2 = "D2"; - _3 = "D3"; - _4 = "D4"; - _5 = "D5"; - _6 = "D6"; - _7 = "D7"; - _8 = "D8"; - _9 = "D9"; - _0 = "D0"; - Plus = "Equals"; - Minus = "Minus"; - Pound = "Insert"; - Clear_Home = "Delete"; - Insert_Delete = "Backspace"; - - Control = "Tab"; - Q = "Q"; - W = "W"; - E = "E"; - R = "R"; - T = "T"; - Y = "Y"; - U = "U"; - I = "I"; - O = "O"; - P = "P"; - At = "LeftBracket"; - Asterisk = "RightBracket"; - Up_Arrow = "Backslash"; - - Run_Stop = "CapsLock"; - A = "A"; - S = "S"; - D = "D"; - F = "F"; - G = "G"; - H = "H"; - J = "J"; - K = "K"; - L = "L"; - Colon = "Semicolon"; - Semicolon = "Apostrophe"; - Equal = "RightControl"; - Return = "Return"; - - Commodore = "LeftControl"; - Left_Shift = "LeftShift"; - Z = "Z"; - X = "X"; - C = "C"; - V = "V"; - B = "B"; - N = "N"; - M = "M"; - Comma = "Comma"; - Period = "Period"; - Slash = "Slash"; - Right_Shift = "RightShift"; - Cursor_Up_Down = "DownArrow"; - Cursor_Left_Right = "RightArrow"; - - Space = "Space"; + SetDefaults(); } } + + public void SetDefaults() + { + F1 = "F1"; + F3 = "F3"; + F5 = "F5"; + F7 = "F7"; + + Left_Arrow = "Grave"; + _1 = "D1"; + _2 = "D2"; + _3 = "D3"; + _4 = "D4"; + _5 = "D5"; + _6 = "D6"; + _7 = "D7"; + _8 = "D8"; + _9 = "D9"; + _0 = "D0"; + Plus = "Equals"; + Minus = "Minus"; + Pound = "Insert"; + Clear_Home = "Delete"; + Insert_Delete = "Backspace"; + + Control = "Tab"; + Q = "Q"; + W = "W"; + E = "E"; + R = "R"; + T = "T"; + Y = "Y"; + U = "U"; + I = "I"; + O = "O"; + P = "P"; + At = "LeftBracket"; + Asterisk = "RightBracket"; + Up_Arrow = "Backslash"; + + Run_Stop = "CapsLock"; + A = "A"; + S = "S"; + D = "D"; + F = "F"; + G = "G"; + H = "H"; + J = "J"; + K = "K"; + L = "L"; + Colon = "Semicolon"; + Semicolon = "Apostrophe"; + Equal = "RightControl"; + Return = "Return"; + + Commodore = "LeftControl"; + Left_Shift = "LeftShift"; + Z = "Z"; + X = "X"; + C = "C"; + V = "V"; + B = "B"; + N = "N"; + M = "M"; + Comma = "Comma"; + Period = "Period"; + Slash = "Slash"; + Right_Shift = "RightShift"; + Cursor_Up_Down = "DownArrow"; + Cursor_Left_Right = "RightArrow"; + + Space = "Space"; + } } - public class TI83ControllerTemplate + public class TI83ControllerTemplate : iControllerConfigObject { - public string _0; - public string _1; - public string _2; - public string _3; - public string _4; - public string _5; - public string _6; - public string _7; - public string _8; - public string _9; - public string DOT; - public string ON; - public string ENTER; - public string DOWN; - public string UP; - public string LEFT; - public string RIGHT; - public string PLUS; - public string MINUS; - public string MULTIPLY; - public string DIVIDE; - public string CLEAR; - public string EXP; - public string DASH; - public string PARACLOSE; - public string TAN; - public string VARS; - public string PARAOPEN; - public string COS; - public string PRGM; - public string STAT; - public string SIN; - public string MATRIX; - public string X; - public string STO; - public string LN; - public string LOG; - public string SQUARED; - public string NEG1; - public string MATH; - public string ALPHA; - public string GRAPH; - public string TRACE; - public string ZOOM; - public string WINDOW; - public string Y; - public string SECOND; - public string MODE; - public string DEL; + public string _0 = ""; + public string _1 = ""; + public string _2 = ""; + public string _3 = ""; + public string _4 = ""; + public string _5 = ""; + public string _6 = ""; + public string _7 = ""; + public string _8 = ""; + public string _9 = ""; + public string DOT = ""; + public string ON = ""; + public string ENTER = ""; + public string DOWN = ""; + public string UP = ""; + public string LEFT = ""; + public string RIGHT = ""; + public string PLUS = ""; + public string MINUS = ""; + public string MULTIPLY = ""; + public string DIVIDE = ""; + public string CLEAR = ""; + public string EXP = ""; + public string DASH = ""; + public string PARACLOSE = ""; + public string TAN = ""; + public string VARS = ""; + public string PARAOPEN = ""; + public string COS = ""; + public string PRGM = ""; + public string STAT = ""; + public string SIN = ""; + public string MATRIX = ""; + public string X = ""; + public string STO = ""; + public string LN = ""; + public string LOG = ""; + public string SQUARED = ""; + public string NEG1 = ""; + public string MATH = ""; + public string ALPHA = ""; + public string GRAPH = ""; + public string TRACE = ""; + public string ZOOM = ""; + public string WINDOW = ""; + public string Y = ""; + public string SECOND = ""; + public string MODE = ""; + public string DEL = ""; + public string COMMA = ""; + + public bool Enabled = false; + public TI83ControllerTemplate() { } - public bool Enabled; - public string COMMA; public TI83ControllerTemplate(bool defaults) { if (defaults) { - Enabled = true; - _0 = "NumberPad0"; //0 - _1 = "NumberPad1"; //1 - _2 = "NumberPad2"; //2 - _3 = "NumberPad3"; //3 - _4 = "NumberPad4"; //4 - _5 = "NumberPad5"; //5 - _6 = "NumberPad6"; //6 - _7 = "NumberPad7"; //7 - _8 = "NumberPad8"; //8 - _9 = "NumberPad9"; //9 - DOT = "NumberPadPeriod";//10 - ON = "Space"; //11 - ENTER = "Return, NumberPadEnter"; //12 - UP = "UpArrow"; //13 - DOWN = "DownArrow"; //14 - LEFT = "LeftArrow"; //15 - RIGHT = "RightArrow"; //16 - PLUS = "NumberPadPlus"; //17 - MINUS = "NumberPadMinus"; //18 - MULTIPLY = "NumberPadStar"; //19 - DIVIDE = "NumberPadSlash"; //20 - CLEAR = "Escape"; //21 - EXP = "6"; //22 - DASH = "Minus"; //23 - PARACLOSE = "0"; //24 - PARAOPEN = "9"; //25 - TAN = "T"; //26 - VARS = "V"; //27 - COS = "C"; //28 - PRGM = "R"; //29 - STAT = "S"; //30 - MATRIX = "LeftBracket"; //31 - X = "X"; //32 - STO = "Insert"; //33 - LN = "L"; //34 - LOG = "O"; //35 - SQUARED = "2"; //36 - NEG1 = "1"; //37 - MATH = "M"; //38 - ALPHA = "A"; //39 - GRAPH = "G"; //40 - TRACE = "Home"; //41 - ZOOM = "Z"; //42 - WINDOW = "W"; //43 - Y = "Y"; //44 - SECOND = "Slash"; //45 - MODE = "BackSlash"; //46 - DEL = "Delete"; //47 - COMMA = "Comma"; //48 - SIN = "Period"; //49 - } - else - { - Enabled = false; - _0 = ""; - _1 = ""; - _2 = ""; - _3 = ""; - _4 = ""; - _5 = ""; - _6 = ""; - _7 = ""; - _8 = ""; - _9 = ""; - DOT = ""; - ON = ""; - ENTER = ""; - UP = ""; - DOWN = ""; - LEFT = ""; - RIGHT = ""; - PLUS = ""; - MINUS = ""; - MULTIPLY = ""; - DIVIDE = ""; - CLEAR = ""; - EXP = ""; - DASH = ""; - PARACLOSE = ""; - TAN = ""; - VARS = ""; - PARAOPEN = ""; - COS = ""; - PRGM = ""; - STAT = ""; - SIN = ""; - MATRIX = ""; - X = ""; - STO = ""; - LN = ""; - LOG = ""; - SQUARED = ""; - NEG1 = ""; - MATH = ""; - ALPHA = ""; - GRAPH = ""; - TRACE = ""; - ZOOM = ""; - WINDOW = ""; - Y = ""; - SECOND = ""; - MODE = ""; - DEL = ""; - COMMA = ""; + SetDefaults(); } } + + public void SetDefaults() + { + Enabled = true; + _0 = "NumberPad0"; //0 + _1 = "NumberPad1"; //1 + _2 = "NumberPad2"; //2 + _3 = "NumberPad3"; //3 + _4 = "NumberPad4"; //4 + _5 = "NumberPad5"; //5 + _6 = "NumberPad6"; //6 + _7 = "NumberPad7"; //7 + _8 = "NumberPad8"; //8 + _9 = "NumberPad9"; //9 + DOT = "NumberPadPeriod";//10 + ON = "Space"; //11 + ENTER = "Return, NumberPadEnter"; //12 + UP = "UpArrow"; //13 + DOWN = "DownArrow"; //14 + LEFT = "LeftArrow"; //15 + RIGHT = "RightArrow"; //16 + PLUS = "NumberPadPlus"; //17 + MINUS = "NumberPadMinus"; //18 + MULTIPLY = "NumberPadStar"; //19 + DIVIDE = "NumberPadSlash"; //20 + CLEAR = "Escape"; //21 + EXP = "6"; //22 + DASH = "Minus"; //23 + PARACLOSE = "0"; //24 + PARAOPEN = "9"; //25 + TAN = "T"; //26 + VARS = "V"; //27 + COS = "C"; //28 + PRGM = "R"; //29 + STAT = "S"; //30 + MATRIX = "LeftBracket"; //31 + X = "X"; //32 + STO = "Insert"; //33 + LN = "L"; //34 + LOG = "O"; //35 + SQUARED = "2"; //36 + NEG1 = "1"; //37 + MATH = "M"; //38 + ALPHA = "A"; //39 + GRAPH = "G"; //40 + TRACE = "Home"; //41 + ZOOM = "Z"; //42 + WINDOW = "W"; //43 + Y = "Y"; //44 + SECOND = "Slash"; //45 + MODE = "BackSlash"; //46 + DEL = "Delete"; //47 + COMMA = "Comma"; //48 + SIN = "Period"; //49 + } + } + + public interface iControllerConfigObject + { + void SetDefaults(); } } \ No newline at end of file diff --git a/BizHawk.MultiClient/config/ControllerConfig/ControllerConfigPanel.Designer.cs b/BizHawk.MultiClient/config/ControllerConfig/ControllerConfigPanel.Designer.cs index 1654b674fa..a8ce3899e7 100644 --- a/BizHawk.MultiClient/config/ControllerConfig/ControllerConfigPanel.Designer.cs +++ b/BizHawk.MultiClient/config/ControllerConfig/ControllerConfigPanel.Designer.cs @@ -31,15 +31,17 @@ this.components = new System.ComponentModel.Container(); this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); this.clearToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.restoreDefaultsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.contextMenuStrip1.SuspendLayout(); this.SuspendLayout(); // // contextMenuStrip1 // this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.clearToolStripMenuItem}); + this.clearToolStripMenuItem, + this.restoreDefaultsToolStripMenuItem}); this.contextMenuStrip1.Name = "contextMenuStrip1"; - this.contextMenuStrip1.Size = new System.Drawing.Size(102, 26); + this.contextMenuStrip1.Size = new System.Drawing.Size(160, 70); // // clearToolStripMenuItem // @@ -48,6 +50,13 @@ this.clearToolStripMenuItem.Text = "&Clear"; this.clearToolStripMenuItem.Click += new System.EventHandler(this.clearToolStripMenuItem_Click); // + // restoreDefaultsToolStripMenuItem + // + this.restoreDefaultsToolStripMenuItem.Name = "restoreDefaultsToolStripMenuItem"; + this.restoreDefaultsToolStripMenuItem.Size = new System.Drawing.Size(159, 22); + this.restoreDefaultsToolStripMenuItem.Text = "&Restore Defaults"; + this.restoreDefaultsToolStripMenuItem.Click += new System.EventHandler(this.restoreDefaultsToolStripMenuItem_Click); + // // ControllerConfigPanel // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -64,5 +73,6 @@ private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; private System.Windows.Forms.ToolStripMenuItem clearToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem restoreDefaultsToolStripMenuItem; } } diff --git a/BizHawk.MultiClient/config/ControllerConfig/ControllerConfigPanel.cs b/BizHawk.MultiClient/config/ControllerConfig/ControllerConfigPanel.cs index 5fccb8a6bc..72c9175ac7 100644 --- a/BizHawk.MultiClient/config/ControllerConfig/ControllerConfigPanel.cs +++ b/BizHawk.MultiClient/config/ControllerConfig/ControllerConfigPanel.cs @@ -12,7 +12,7 @@ namespace BizHawk.MultiClient { public partial class ControllerConfigPanel : UserControl { - object ControllerConfigObject; //Object that values will be saved to (In Config.cs) + iControllerConfigObject ControllerConfigObject; //Object that values will be saved to (In Config.cs) public List buttons = new List(); @@ -55,7 +55,7 @@ namespace BizHawk.MultiClient } } - public void LoadSettings(object configobj) + public void LoadSettings(iControllerConfigObject configobj) { ControllerConfigObject = configobj; @@ -139,5 +139,14 @@ namespace BizHawk.MultiClient { ClearAll(); } + + private void restoreDefaultsToolStripMenuItem_Click(object sender, EventArgs e) + { + if (ControllerConfigObject is iControllerConfigObject) + { + (ControllerConfigObject as iControllerConfigObject).SetDefaults(); + } + SetWidgetStrings(); + } } }