public static SetControlActions ( bool b ) : void | ||
b | bool | |
Результат | void |
/// <summary> /// Show the console /// </summary> /// <param name="show">Whether or not the console should be shown</param> public void ShowConsole(bool show) { _isHidden = !show; _lineOffset = 0; _historyCursor = -1; if (show) { _disabledControls = GTAFuncs.DisableAllControls(); SetConsoleControls(); } else { GTAFuncs.SetControlActions(false); GTAFuncs.EnableControls(_disabledControls); _disabledControls.Clear(); } }
/// <summary> /// Disables all controls not enabled while using the console /// </summary> private void SetConsoleControls() { GTAFuncs.SetControlActions(false); GTAFuncs.EnableControlAction(Control.MoveLeftRight, true); GTAFuncs.EnableControlAction(Control.MoveUpDown, true); GTAFuncs.EnableControlAction(Control.VehicleAccelerate, true); GTAFuncs.EnableControlAction(Control.VehicleBrake, true); GTAFuncs.EnableControlAction(Control.VehicleDriveLook, true); GTAFuncs.EnableControlAction(Control.VehicleDriveLook2, true); GTAFuncs.EnableControlAction(Control.VehicleMoveLeftRight, true); GTAFuncs.EnableControlAction(Control.VehicleMoveUpDown, true); GTAFuncs.EnableControlAction(Control.LookLeftRight, true); GTAFuncs.EnableControlAction(Control.LookUpDown, true); GTAFuncs.EnableControlAction(Control.FlyUpDown, true); GTAFuncs.EnableControlAction(Control.FlyLeftRight, true); GTAFuncs.EnableControlAction(Control.VehicleFlyRollLeftRight, true); GTAFuncs.EnableControlAction(Control.VehicleFlyPitchUpDown, true); GTAFuncs.EnableControlAction(Control.VehicleFlyYawLeft, true); GTAFuncs.EnableControlAction(Control.VehicleFlyYawRight, true); GTAFuncs.EnableControlAction(Control.VehicleFlyThrottleDown, true); GTAFuncs.EnableControlAction(Control.VehicleFlyThrottleUp, true); }