Table of Contents

Class TimbnInteractionHint

Namespace
Timbn.GraveyardKeeperTwo.Core.Framework
Assembly
Timbn.GraveyardKeeperTwo.Core.dll

The game's "press a key to do something" hint, drawn over a spot in the world the way it is drawn over a chest or a door, for an interaction the game itself does not know about. Get one from the plugin's UI.CreateHint, move it with Show as often as you like, and it is hidden when the plugin unloads or the player returns to the main menu. It shows one key, or two on two rows the way a cargo lift shows Open and Put. While it shows, its keys belong to the hint the way they do for the game's own hints, so the game ignores those presses and does not, for example, drop what the player is carrying. Dispose a hint the plugin is done with, such as one made per visitor.

public sealed class TimbnInteractionHint : IBubbleDrawable, IDisposable
Inheritance
TimbnInteractionHint
Implements
IBubbleDrawable
Inherited Members

Examples

_hint = UI.CreateHint();
// every frame the player stands by the fire
_hint.Show(fire + Vector3.up * 1.2f, LLBase.L("timbn_campfire_meditate"));
// by a keg, with two keys
_hint.Show(keg, LLBase.L("timbn_bar_open"), GameKey.Interaction, LLBase.L("timbn_bar_pour"), GameKey.Action);
// once they walk away
_hint.Hide();

Properties

IsVisible

Whether the hint is on screen.

public bool IsVisible { get; }

Property Value

bool

Methods

Dispose()

Hides the hint and lets the plugin forget it. It can still be shown again afterwards, but nothing hides it for the plugin any more.

public void Dispose()

Hide()

Takes the hint off the screen. It does nothing when the hint is not showing.

public void Hide()

Show(Vector3, string)

Shows the hint, or moves and rewords it if it is already showing. Calling it every frame with the same values costs nothing.

public void Show(Vector3 position, string text)

Parameters

position Vector3

The spot in the world to draw it over.

text string

What the key does, already in the player's language, such as "Meditate".

Show(Vector3, string, GameKey)

Shows the hint like Show(Vector3, string), with the icon of a key other than Interaction in front of the text.

public void Show(Vector3 position, string text, GameKey key)

Parameters

position Vector3

The spot in the world to draw it over.

text string

What the key does, already in the player's language, such as "Meditate".

key GameKey

The key whose icon goes in front of the text, such as GameKey.Interaction.

Show(Vector3, string, GameKey, string, GameKey)

Shows the hint with two keys, one on each row, or moves and rewords it if it is already showing. Calling it every frame with the same values costs nothing.

public void Show(Vector3 position, string text, GameKey key, string secondText, GameKey secondKey)

Parameters

position Vector3

The spot in the world to draw it over.

text string

What the first key does, already in the player's language, such as "Open".

key GameKey

The first key, such as GameKey.Interaction.

secondText string

What the second key does, such as "Pour Beer".

secondKey GameKey

The second key, such as GameKey.Action.