Table of Contents

Class ControlsHint

Namespace
TinyLife.Uis
Assembly
Tiny Life.dll

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)

Parameters

name string

The name of this controls hint.

keybind Func<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.

shouldDisplay Func<GameImpl, bool>

Whether this controls hint should currently be displayed, based on the current Options instance.

Fields

Hints

A set of registered hints, both by mods and by the game itself.

public static readonly ReadOnlyCollection<ControlsHint> Hints

Field Value

ReadOnlyCollection<ControlsHint>

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

Func<Options, bool, object>

Name

The name of this controls hint.

public readonly string Name

Field Value

string

ShouldDisplay

Whether this controls hint should currently be displayed, based on the current Options instance.

public readonly Func<GameImpl, bool> ShouldDisplay

Field Value

Func<GameImpl, bool>

Methods

Register(ControlsHint)

Registers the given controls hint to the Hints registry.

public static ControlsHint Register(ControlsHint hint)

Parameters

hint ControlsHint

The hint to register.

Returns

ControlsHint

The passed hint, for chaining.