Enable MA0070 and fix noncompliance
"Obsolete attributes should include explanations"
This commit is contained in:
parent
152b3ad6f5
commit
67edf3f047
|
@ -239,7 +239,7 @@ dotnet_diagnostic.MA0068.severity = error
|
|||
# Non-constant static fields should not be visible
|
||||
dotnet_diagnostic.MA0069.severity = silent
|
||||
# Obsolete attributes should include explanations
|
||||
dotnet_diagnostic.MA0070.severity = silent
|
||||
dotnet_diagnostic.MA0070.severity = warning
|
||||
# Avoid using redundant else
|
||||
dotnet_diagnostic.MA0071.severity = silent
|
||||
# Do not throw from a finally block
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace BizHawk.Client.Common
|
|||
/// See <see cref="DistinctKey"/> for keyboard key names, though some are overridden by <see cref="DistinctKeyNameOverrides"/> (check the source).
|
||||
/// </remarks>
|
||||
/// <seealso cref="GetPressedButtons"/>
|
||||
[Obsolete]
|
||||
[Obsolete($"consider using {nameof(GetPressedButtons)}/{nameof(GetPressedAxes)}/{nameof(GetMouse)}")]
|
||||
Dictionary<string, bool> Get();
|
||||
|
||||
/// <returns>
|
||||
|
|
|
@ -9,12 +9,12 @@ namespace BizHawk.Client.Common
|
|||
|
||||
public override string Name => "input";
|
||||
|
||||
#pragma warning disable CS0612
|
||||
[LuaMethodExample("local buttons_down = input.get();\nlocal is_b_down = buttons_down[\"B\"];\nif is_b_down and not was_b_down then console.writeline(\"B pressed\"); end\nwas_b_down = is_b_down;")]
|
||||
[LuaMethod("get", "Returns a dict-like table of key/button names (of host). Only pressed buttons will appear (with a value of {{true}}); unpressed buttons are omitted. Includes gamepad axes ({{!axis.isNeutral}}, with sticks as 4 \"buttons\" suffixed {{\"Up\"}}/{{\"Down\"}}/{{\"Left\"}}/{{\"Right\"}}). Includes mouse buttons, but not axes (cursor position and wheel rotation). Unlike {{getmouse}}, these have the names {{\"WMouse L\"}}, {{\"WMouse R\"}}, {{\"WMouse C\"}}, {{\"WMouse 1\"}}, and {{\"WMouse 2\"}} for LMB, RMB, MMB, Mouse4, and Mouse5, respectively.")]
|
||||
public LuaTable Get()
|
||||
#pragma warning disable CS0618 // the ApiHawk equivalent of this function is warn-level deprecated; Lua can't and shouldn't make that distinction
|
||||
=> _th.DictToTable(APIs.Input.Get());
|
||||
#pragma warning restore CS0612
|
||||
#pragma warning restore CS0618
|
||||
|
||||
[LuaMethodExample("local mouse_buttons_down = input.getmouse();\nlocal is_m3_down = mouse_buttons_down[\"Middle\"];\nif is_m3_down and not was_m3_down then console.writeline(\"M3 pressed\"); end\nwas_m3_down = is_m3_down;")]
|
||||
[LuaMethod("getmouse", "Returns a lua table of the mouse X/Y coordinates and button states. Table keys are X, Y, Left, Middle, Right, XButton1, XButton2, Wheel.")]
|
||||
|
|
Loading…
Reference in New Issue