Hud

This is the full list of what the API gives you. Hud shows things on screen and hides parts of the game’s own screen, and every call gives back true when it worked and false when it did not.

An owner is your mod’s id. It is how the framework keeps your hides and bars apart from other mods’ (see Owner in the glossary). A call that cannot do its job, for example because the part of the game it needs is not loaded yet, gives back false. See When you can call it for the full rules.

Hud what you can show and hide on screen

This is the class you start from. It shows notifications, subtitles, hints, notes, the tooltip and a bar, and it hides the crosshair or the game’s HUD for your owner.

public static class Hud
{
    public static bool Notify(string text);
    public static bool Notify(string title, string body);
    public static bool ShowSubtitle(string text, float fadeSeconds);
    public static bool ShowHint(string modId, string title, string[] lines);
    public static bool ShowHint(string modId, string title, string[] lines, HintStyle style);
    public static bool HideHint(string modId);
    public static bool IsHintShowing(string modId);
    public static bool ShowPrompt(string modId, string text, string action);
    public static bool ShowPrompt(string modId, string text, string action, float seconds);
    public static bool ShowPrompt(string modId, string text, string action, PromptStyle style);
    public static bool ShowPrompt(string modId, string text, string action, float seconds, PromptStyle style);
    public static bool ShowPrompt(string modId, string text, ModKeybind bind);
    public static bool ShowPrompt(string modId, string text, ModKeybind bind, float seconds);
    public static bool HidePrompt(string modId);
    public static bool IsPromptShowing(string modId);
    public static bool ShowNote(string noteId);
    public static bool ShowCrosshair();
    public static bool HideCrosshair();
    public static bool HideCrosshair(string owner);
    public static bool ShowCrosshair(string owner);
    public static bool ShowTooltip(string title, string details);
    public static bool HideTooltip();
    public static bool HideGameUi(string owner);
    public static bool ShowGameUi(string owner);
    public static bool Bar(string owner, string title, float fill);
    public static bool Bar(string owner, string title, float fill, Color color);
    public static bool ClearBar(string owner);
}
Method Returns What it does
Notify(text) bool Shows your text in the game’s notification box, under the heading Notice.
Notify(title, body) bool Shows your title and body in the same box.
ShowSubtitle(text, fadeSeconds) bool Types a line at the bottom of the screen, then fades it.
ShowHint(modId, title, lines) bool Shows your mod’s hint in the framework’s own hint panel.
ShowHint(modId, title, lines, style) bool Shows the hint in the panel you pick with HintStyle.
HideHint(modId) bool Removes your mod’s hint.
IsHintShowing(modId) bool Tells whether your mod has a hint up.
ShowPrompt(modId, text, action) bool Shows a key prompt that names the key the player has set for a game input action. It stays until you hide it.
ShowPrompt(modId, text, action, seconds) bool Shows the same prompt and hides it after seconds.
ShowPrompt(modId, text, action, style) bool Shows the prompt in the panel you pick with PromptStyle.
ShowPrompt(modId, text, action, seconds, style) bool Both: a timed prompt in the panel you pick.
ShowPrompt(modId, text, bind) bool Shows a key prompt for one of your own ModKeybinds. It stays until you hide it.
ShowPrompt(modId, text, bind, seconds) bool Shows the same prompt and hides it after seconds.
HidePrompt(modId) bool Removes your mod’s prompt.
IsPromptShowing(modId) bool Tells whether your mod’s prompt is up.
ShowNote(noteId) bool Opens the Notes page at a note the player already has.
ShowCrosshair() bool Shows the crosshair. It has no owner, so it is shared.
HideCrosshair() bool Hides the crosshair. It has no owner, so it is shared.
HideCrosshair(owner) bool Hides the crosshair for this owner.
ShowCrosshair(owner) bool Takes back this owner’s hide.
ShowTooltip(title, details) bool Shows the game’s tooltip box with your text.
HideTooltip() bool Hides the tooltip box.
HideGameUi(owner) bool Hides the whole HUD for this owner.
ShowGameUi(owner) bool Takes back this owner’s hide.
Bar(owner, title, fill) bool Shows or updates this owner’s bar.
Bar(owner, title, fill, color) bool Shows or updates this owner’s bar, in your own colour.
ClearBar(owner) bool Removes this owner’s bar.

Things to know

  • Notify(title, body) uses your own heading, so say where the message comes from. Both title and body must be text, not empty. Notify plays the game’s notification sound.
  • The notification box has no icon, so Notify has no icon option. (The game’s box has no icon slot, and neither overload has an icon parameter.)
  • ShowSubtitle types your text at 20 characters a second, then fades it out over fadeSeconds. The total time on screen is the typing time plus fadeSeconds. Several subtitles stack on screen, oldest at the top. (Before showing, the framework strips the Pixel Crushers Dialogue System RPG Maker codes with the game’s own UITools.StripRPGMakerCodes. That removes \, (quarter pause), \. (full pause), \^ (skip to end), \> (instant open) and \< (instant close). Other backslashes stay. The stack is sorted by start time.)
  • ShowHint draws your lines in the framework’s own hint panel, which does not depend on the card game. Pass HintStyle.GameHintBox to use the card game’s hint box instead, which the player can hide with the Hints key (K by default, changed in the game’s Controls settings). (HintStyle.Framework is the default. GameHintBox is the game’s HintOverlay, the rules box of the card game.)
  • ShowPrompt shows a short key prompt such as “Press E to open”. Give it a game input action name, or one of your own ModKeybinds, and it shows the key the player has set. An unknown action name throws ArgumentException. Pass PromptStyle.GameTutorial to use the game’s tutorial pop-up for an action prompt. A keybind prompt always uses the framework’s panel. The framework’s panel is also the fallback when the tutorial pop-up is not available.
  • Only one prompt shows at a time across all mods, and a new prompt replaces the one before it. HidePrompt and IsPromptShowing only look at your own mod’s prompt. A prompt with no seconds stays until you hide it or the scene changes. seconds must be above zero.
  • Each mod has one hint, and showing a new one replaces the old one. Showing the same hint again changes nothing. Each line is a plain paragraph, not a bullet. Write {key:Action Name} in a line to show the key the player has set for that action, as the game does.
  • Only one hint shows at a time. The box shows the most important hint, and the newest when two are equal. All mod hints are equally important, so the newest mod hint wins. A game hint, such as the card game rules, takes over the same way when it is shown later. (The overlay shows the hint with the highest priority, and among equals the newest. Mod hints all use priority 0.)
  • A hint stays until you hide it or the player loads a new scene. Loading a new scene hides every mod hint, so show it again from your Events.SceneLoaded handler if you still need it. HideHint gives back false if your mod never showed a hint. (A Single scene load hides every mod hint.)
  • ShowNote opens the Notes page at a note the player already has. noteId must match exactly one note or book page the player has collected. If it matches none, or more than one, you get false. (It matches NoteInfo.Id, which is the note’s id, else its addressable path, else its title.)
  • ShowCrosshair() and HideCrosshair() switch the crosshair on and off, with no owner. The game itself never calls these two methods. (HideCrosshair() holds one shared entry, and ShowCrosshair() releases it and shows the crosshair only when no owner hides it. A Single scene load drops every hide and shows the crosshair.)
  • HideCrosshair(owner) and ShowCrosshair(owner) count hides for each owner, so two mods do not undo each other. The crosshair comes back only when every owner has taken back all of its hides.
  • ShowTooltip shows the game’s tooltip box with your heading and text, exactly as you give it, so rich text such as <b> works. The game’s own item tooltips make their heading bold, but yours is not wrapped in bold. An empty details hides the body of the box.
  • HideTooltip hides the box, and it clears what the game thinks the cursor is hovering over. A game tooltip under the cursor stays hidden until the cursor moves onto something again.
  • The tooltip is the game’s one shared box. Your text stays until you call HideTooltip or the game hides the box. The box follows the mouse only while the player uses the mouse. With a controller it stays where it was last placed. This tooltip suits a mod’s own screen where the player has a free cursor.
  • HideGameUi(owner) hides the game’s whole HUD, and ShowGameUi(owner) brings it back. Each owner counts its own hides, so two HideGameUi calls from one owner need two ShowGameUi calls. The HUD comes back when every owner’s count is back at zero. owner must be a valid mod id. (They call GameUIController.HideGameUI and ShowGameUI, which set the HUD canvas alpha.)
  • A HideGameUi that gives back false counts nothing, so it needs no matching ShowGameUi.
  • A screenshot with F12 taken during a hide does not leave the HUD stuck. The game’s no-UI screenshot hides the HUD itself and then shows it again only if it was visible. The framework cleans up after that when the last owner shows the HUD. (TakeScreenshot.ScreenshotNoUI leaves an entry in the game’s list. The framework records that object, and when the last owner shows the HUD it removes those entries.)

Limits

  • A subtitle with no visible text shows nothing and gives back false. That is a text that is empty, or only spaces once the codes are removed.
  • Two subtitles that start at the very same moment can clash, and the framework does not handle this. (The game keys each line by DateTime.Now.Ticks, so two subtitles started in the same clock tick collide.)
  • Pressing the Hints key while a GameHintBox hint is showing hides all hints, and the game remembers that between sessions. A hint you show later stays hidden until the player presses the key again. The game has no hints option in its settings menu, so if a game-box hint does not appear, tell the player to press the Hints key. The framework’s own hint panel has its own toggle, a keybind under Mod Keybinds called Show or hide the mod hint, which is unbound by default.
  • ShowHint and ShowPrompt give back false when the game’s screen is not loaded yet. Call them after the game scene has loaded, for example inside Events.WhenReady. They also give back false while the matching Mods menu setting is off (see below).
  • ShowNote cannot show text of your own. The only way to show other text is to give the player a note, which saves it with the game, and this API does not give notes.
  • HideCrosshair(owner) gives back false and counts nothing when the crosshair is not in the scene. ShowCrosshair(owner) gives back false for an owner with no hide. owner must be a valid mod id (1 to 64 letters, digits, ., _ or -).
  • title must not be empty, and a null details is an error. It gives back false when the game’s tooltip is not in the scene. (A null details throws ArgumentException. The box is the game’s ToolTip.)
  • HideTooltip gives back false when the tooltip is not in the scene.
  • The tooltip is one shared box, so the game can replace your text. When the player hovers over an item or other game tooltip, your text is replaced, and when that hover ends, the box hides.
  • ShowGameUi gives back false for an owner with no hide. Both HideGameUi and ShowGameUi give back false when the game’s HUD is not in the scene.
  • A hint or prompt ends when a new scene loads, so show it again from your Events.SceneLoaded handler if you still need it.
  • Loading a new scene ends every hide, so hide again if you still need it. The game replaces its HUD controller then, so every owner is dropped and the HUD shows. Call HideGameUi again from your own Events.SceneLoaded handler. (A Single scene load ends every hide.)

Mods menu settings

The Mods menu has a Hints section with two settings that control what mods may show. Both are on by default. They are the framework’s own settings, so they do not change the game’s own hints.

  • ShowModHints shows hints from mods. It is separate from the game’s own Hints setting, so turning one off leaves the other alone. While it is off, ShowHint gives back false and the hint does not show. (HudHints.Show reads it, and the log line says the setting is off. A GameHintBox hint is still kept, and it appears when the player turns the setting back on.)
  • ShowModPrompts shows key prompts from mods. While it is off, ShowPrompt gives back false and the prompt does not show, and IsPromptShowing gives back false. (HudHints.Prompt and HudHints.PromptShowing read it.)

The Mods menu has a UI section with two settings for the New Game screen. Both are on by default.

  • NewGameRowsOnAllDifficulties shows the rows a mod registered for the New Game screen on every difficulty, not only on Custom, where the game shows its own difficulty settings. Turn it off if the rows overlap the difficulty description. The framework’s own rows follow the setting; the game’s own setting rows still show only on Custom. (NewGameOptionsScreen.Keep reads it, section UI, on by default.)
  • ModPresetsInSelector lists the difficulty presets mods registered in the game’s own difficulty selector, after the game’s own levels, so the player can pick one while starting a game. Turn it off to leave the selector with the game’s own levels. See Difficulty presets. (DifficultyModPresetsPatches reads it, section UI, on by default. When the core plugin cannot be found the setting is not in the config and the listing stays on.)