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. Bothtitleandbodymust be text, not empty.Notifyplays the game’s notification sound.- The notification box has no icon, so
Notifyhas no icon option. (The game’s box has no icon slot, and neither overload has an icon parameter.) ShowSubtitletypes your text at 20 characters a second, then fades it out overfadeSeconds. The total time on screen is the typing time plusfadeSeconds. 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 ownUITools.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.)ShowHintdraws your lines in the framework’s own hint panel, which does not depend on the card game. PassHintStyle.GameHintBoxto 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.Frameworkis the default.GameHintBoxis the game’sHintOverlay, the rules box of the card game.)ShowPromptshows a short key prompt such as “Press E to open”. Give it a game input action name, or one of your ownModKeybinds, and it shows the key the player has set. An unknown action name throwsArgumentException. PassPromptStyle.GameTutorialto 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.
HidePromptandIsPromptShowingonly look at your own mod’s prompt. A prompt with nosecondsstays until you hide it or the scene changes.secondsmust 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.SceneLoadedhandler if you still need it.HideHintgives backfalseif your mod never showed a hint. (A Single scene load hides every mod hint.) ShowNoteopens the Notes page at a note the player already has.noteIdmust match exactly one note or book page the player has collected. If it matches none, or more than one, you getfalse. (It matchesNoteInfo.Id, which is the note’sid, else its addressable path, else its title.)ShowCrosshair()andHideCrosshair()switch the crosshair on and off, with no owner. The game itself never calls these two methods. (HideCrosshair()holds one shared entry, andShowCrosshair()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)andShowCrosshair(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.ShowTooltipshows 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 emptydetailshides the body of the box.HideTooltiphides 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
HideTooltipor 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, andShowGameUi(owner)brings it back. Each owner counts its own hides, so twoHideGameUicalls from one owner need twoShowGameUicalls. The HUD comes back when every owner’s count is back at zero.ownermust be a valid mod id. (They callGameUIController.HideGameUIandShowGameUI, which set the HUD canvas alpha.)- A
HideGameUithat gives backfalsecounts nothing, so it needs no matchingShowGameUi. - 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.ScreenshotNoUIleaves 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
GameHintBoxhint 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 calledShow or hide the mod hint, which is unbound by default. ShowHintandShowPromptgive backfalsewhen the game’s screen is not loaded yet. Call them after the game scene has loaded, for example insideEvents.WhenReady. They also give backfalsewhile the matching Mods menu setting is off (see below).ShowNotecannot 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 backfalseand counts nothing when the crosshair is not in the scene.ShowCrosshair(owner)gives backfalsefor an owner with no hide.ownermust be a valid mod id (1 to 64 letters, digits,.,_or-).titlemust not be empty, and anulldetailsis an error. It gives backfalsewhen the game’s tooltip is not in the scene. (A nulldetailsthrowsArgumentException. The box is the game’sToolTip.)HideTooltipgives backfalsewhen 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.
ShowGameUigives backfalsefor an owner with no hide. BothHideGameUiandShowGameUigive backfalsewhen 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.SceneLoadedhandler 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
HideGameUiagain from your ownEvents.SceneLoadedhandler. (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.
ShowModHintsshows 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,ShowHintgives backfalseand the hint does not show. (HudHints.Showreads it, and the log line says the setting is off. AGameHintBoxhint is still kept, and it appears when the player turns the setting back on.)ShowModPromptsshows key prompts from mods. While it is off,ShowPromptgives backfalseand the prompt does not show, andIsPromptShowinggives backfalse. (HudHints.PromptandHudHints.PromptShowingread it.)
The Mods menu has a UI section with two settings for the New Game screen. Both are on by default.
NewGameRowsOnAllDifficultiesshows 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.Keepreads it, sectionUI, on by default.)ModPresetsInSelectorlists 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. (DifficultyModPresetsPatchesreads it, sectionUI, on by default. When the core plugin cannot be found the setting is not in the config and the listing stays on.)