Class ControlsHint
A controls hint is a set of information that is displayed in the bottom-right corner of the game that is supposed to help the player with the game's controls. Each controls hint has a condition as well as a set of bindings and a string that it should display.
public class ControlsHint
- Inheritance
-
ControlsHint
- Inherited Members
- Extension Methods
Constructors
ControlsHint(string, Func<Options, bool, object>, Func<GameImpl, bool>)
Creates a new controls hint with the given settings.
public ControlsHint(string name, Func<Options, bool, object> keybind, Func<GameImpl, bool> shouldDisplay = null)
Parameters
namestringThe name of this controls hint.
keybindFunc<Options, bool, object>A function that returns the keybind that should be displayed, based on the current Options instance, and whether MLEM.Ui.UiControls.IsAutoNavMode is true. Returned bindings can be of type Microsoft.Xna.Framework.Input.Keys, MLEM.Input.MouseButton, Microsoft.Xna.Framework.Input.Buttons, MLEM.Input.GenericInput, MLEM.Input.ModifierKey or Keybind.
shouldDisplayFunc<GameImpl, bool>Whether this controls hint should currently be displayed, based on the current Options instance.
Fields
GlobalHints
A set of hints that are registered to be displayed in the bottom-right corner of the game window automatically. Register new hints using RegisterGlobal(ControlsHint).
public static readonly ReadOnlyCollection<ControlsHint> GlobalHints
Field Value
Keybind
A function that returns the keybind that should be displayed, based on the current Options instance, and whether MLEM.Ui.UiControls.IsAutoNavMode is true. Returned bindings can be of type Microsoft.Xna.Framework.Input.Keys, MLEM.Input.MouseButton, Microsoft.Xna.Framework.Input.Buttons, MLEM.Input.GenericInput, MLEM.Input.ModifierKey or Keybind.
public readonly Func<Options, bool, object> Keybind
Field Value
Name
The name of this controls hint.
public readonly string Name
Field Value
ShouldDisplay
Whether this controls hint should currently be displayed, based on the current Options instance.
public readonly Func<GameImpl, bool> ShouldDisplay
Field Value
Methods
CreatePanel(Anchor, IEnumerable<ControlsHint>)
public static Panel CreatePanel(Anchor anchor, IEnumerable<ControlsHint> hints)
Parameters
anchorAnchorhintsIEnumerable<ControlsHint>
Returns
- Panel
RegisterGlobal(ControlsHint)
Registers the given controls hint to the GlobalHints registry, which causes the hint to be displayed in the bottom-right corner of the game window automatically.
public static ControlsHint RegisterGlobal(ControlsHint hint)
Parameters
hintControlsHintThe hint to register.
Returns
- ControlsHint
The passed
hint, for chaining.