Panel
public sealed class PanelNamespace Hotline.Api
Fluent builder for a mod’s Hotline panel (returned by Hud.RegisterPanel). Everything is a safe no-op when the Hotline host is absent.
Example
Panel panel = Hud.RegisterPanel("MyMod", "My Mod").Log();panel.Write("reloaded", LogLevel.Warning);Properties
Section titled “Properties”public string Id { get; }The panel id (also the default log channel).
Methods
Section titled “Methods”public Panel Text(Func<string> provider)A free-text, multi-line readout in this panel.
public Panel Image(Func<int[]> provider)An image in this panel (e.g. a QR code). Provider returns { width, height, argb… } or null.
| Parameter | |
|---|---|
provider | Returns { width, height, 0xAARRGGBB pixels... }; see Hud.RegisterImage. |
Action
Section titled “Action”public Panel Action(string label, Action run)A clickable button (replaces a debug hotkey action).
| Parameter | |
|---|---|
label | The button text, e.g. “Reload”. It also forms the action id, e.g. MyMod:reload. |
run | Runs on each click or hotline act call. |
Toggle
Section titled “Toggle”public Panel Toggle(string label, Func<bool> get, Action<bool> set)An on/off control (replaces a debug toggle hotkey).
| Parameter | |
|---|---|
label | The control text, e.g. “Verbose”. It also forms the toggle id, e.g. MyMod:verbose. |
get | Returns the current state. |
set | Applies the new state. |
Slider
Section titled “Slider”public Panel Slider( string label, double min, double max, Func<double> get, Action<double> set, double step = 0d, string unit = null)A draggable value (replaces typing a number into a console to find it).
| Parameter | |
|---|---|
label | The text before the value. It also forms the slider id, e.g. MyMod:spawn-radius. |
min | The lowest value. |
max | The highest value. It must be above min. |
get | Returns the current value. |
set | Applies a value that is already clamped and snapped. |
step | The snap size, e.g. 0.05. 0 is continuous. See Hud.RegisterSlider. |
unit | Text shown after the value, e.g. “m”. Null shows none. |
Hotkey
Section titled “Hotkey”public Panel Hotkey(string label, HotlineKey key, Action run)Types: HotlineKey
Bind a central hotkey to an action owned by this panel.
| Parameter | |
|---|---|
label | Names the binding, e.g. “Reload”. The same label again replaces it. |
key | One of F1 to F12, or HotlineKey.None for a label without a key. |
run | Runs when the key goes down. |
public Panel Log()Show this panel’s own log channel inside the panel.
public void Write(string message, LogLevel level = LogLevel.Info)Types: LogLevel
Send a log line to this panel’s channel (and the combined timeline).