This Rust plugin adds a clean and compact on-screen HUD to show useful server info like player count, sleepers, grid location, time, and more. Players can toggle the HUD or hide individual widgets, and admins can customize everything from colors to fonts to layout.
Permissions
infohud.use
- Allows a player to use the HUD command and toggle or edit their display.
Commands
/infohud
- Toggles the entire HUD on/off./infohud list
- Lists all available widgets (built-in and external)./infohud toggle <key>
- Enables or disables a specific widget by its identifier.
Configuration
JSON:
{
"Chat Command": "infohud",
"Refresh Interval Seconds": 1.0,
"Style": {
"Anchor": "TopLeft",
"Offsets (minX, minY, maxX, maxY)": [14.0, -100.0, 260.0, -14.0],
"Background Color (HEX)": "000000",
"Opacity (0..1)": 0.0,
"Widget Background Color (HEX)": "1D2935",
"Widget Opacity (0..1)": 0.7,
"Text Color (HEX)": "FFFFFF",
"Font Size": 12,
"Font Asset Path (defaults to Roboto Condensed Bold if empty)": "",
"Widget Horizontal Padding (px)": 12,
"Widget Vertical Padding (px)": 6,
"Minimum Widget Width (px)": 0,
"Widget Height (px)": 24,
"Horizontal Spacing (px)": 5,
"Vertical Spacing (px)": 5,
"Widgets Per Row": 4,
"Edit Button Color (HEX)": "5E86A8",
"Removable Widget Color (HEX)": "331616",
"Addable Widget Color (HEX)": "16331F",
"Add Icon Color (HEX)": "6EA076",
"Delete Icon Color (HEX)": "8E4B4B",
"Edit Icon Sprite (game asset path)": "assets/icons/pet_move.png",
"Done Icon Sprite (game asset path)": "assets/icons/vote_up.png",
"Delete Icon Sprite (game asset path)": "assets/icons/close.png",
"Add Icon Sprite (game asset path)": "assets/icons/health.png"
},
"Widgets": [
{
"Identifier": "online",
"Enabled By Default": true,
"Data Source": "Online",
"Label Template": "Online {value}",
"Time Format": ""
},
{
"Identifier": "sleeping",
"Enabled By Default": true,
"Data Source": "Sleeping",
"Label Template": "Sleeping {value}",
"Time Format": ""
},
{
"Identifier": "time",
"Enabled By Default": true,
"Data Source": "Time",
"Label Template": "{value}",
"Time Format": "HH:mm:ss"
},
{
"Identifier": "grid",
"Enabled By Default": true,
"Data Source": "Grid",
"Label Template": "Grid {value}",
"Time Format": ""
},
{
"Identifier": "joining",
"Enabled By Default": true,
"Data Source": "Joining",
"Label Template": "Joining {value}",
"Time Format": ""
},
{
"Identifier": "queued",
"Enabled By Default": true,
"Data Source": "Queued",
"Label Template": "Queued {value}",
"Time Format": ""
}
]
}
Chat Command
- The chat command players use to interact with the HUD (e.g. /infohud).Refresh Interval Seconds
- How often the HUD updates in seconds.Style
- Object containing all visual style settings for the HUD.Widgets
- List of widget definitions including identifier, data source, and display format.
Anchor
- Where the HUD is anchored on the screen (TopLeft, TopRight, etc.)Offsets
- Manual offset values for HUD placementBackground Color
- Color of the panel behind the widgets (use hex code, like"000000"
)Opacity
- Transparency of the panel.0.0
= fully see-through,1.0
= solid color.Widget Background Color
- Background color of each widget box.Widget Opacity
- Transparency of the widget boxes themselves.Text Color
- Color of the text inside the boxes.Font Size
- Size of text in each widget.Font Asset Path
- Optional. Leave empty to use the default bold font.Widget Horizontal Padding
- Adds space inside each widget left/right.Widget Vertical Padding
- Adds space inside each widget top/bottom.Minimum Widget Width
- Forces widgets to stay at least this wide (optional).Widget Height
- Height of each widget.Horizontal Spacing
- Space between widgets (left to right).Vertical Spacing
- Space between rows of widgets (top to bottom).Widgets Per Row
- Maximum number of widgets per line before it wraps to a new row.Edit Button Color
- Background color for the edit button.Removable Widget Color
- Color used for currently active (removable) widgets during edit mode.Addable Widget Color
- Color used for available (addable) widgets during edit mode.Add Icon Color
- Color of the plus icon for adding widgets.Delete Icon Color
- Color of the delete (X) icon.Edit Icon Sprite
- Path to the sprite shown for the edit icon.Done Icon Sprite
- Path to the sprite shown when editing is finished.Delete Icon Sprite
- Sprite used for delete (X) icon.Add Icon Sprite
- Sprite used for add (+) icon.
Stored Data
JSON:
{
"HUD Enabled By Player": {
"76561198123456789": true,
"76561198000000000": false
},
"Disabled Widgets By Player": {
"76561198123456789": ["joining", "queued"],
"76561198000000000": ["time"]
}
}
HUD Enabled By Player
- Tracks which players currently have the HUD turned on or off.Disabled Widgets By Player
- Tracks which widgets each player has manually hidden from their HUD.
Localization
JSON:
{
"Error.NoPermission": "You do not have permission to use this command.",
"Info.WidgetsHeader": "Widgets: {0}",
"Info.WidgetsBuiltIns": "online, sleeping, time, grid, joining, queued",
"Info.WidgetsExternalPrefix": " | External: {0}",
"Usage.Header": "Usage:",
"Usage.ToggleHud": "/{0} - toggle HUD on/off",
"Usage.List": "/{0} list - list widgets",
"Usage.ToggleWidget": "/{0} toggle <key> - show or hide a widget",
"Error.ToggleUsage": "Usage: /{0} toggle <key>",
"Status.WidgetHidden": "Widget hidden: {0}",
"Status.WidgetShown": "Widget shown: {0}",
"Status.HudOn": "HUD: On",
"Status.HudOff": "HUD: Off"
}
Developer Hooks
C#:
IEnumerable OnInfoHUDProvideWidgets(BasePlayer player)
player
- The player requesting the HUD so you can provide custom data per-user.
A list or enumerable of dictionaries. Each dictionary should include:
Identifier
- A unique string for your widget (used for toggling).Text
- Final display text (optional ifTextTemplate
andValue
are provided).TextTemplate
- Optional string with{value}
placeholder (e.g."Kills: {value}"
).Value
- The value to substitute into{value}
if usingTextTemplate
.EnabledByDefault
- Optional, whether this widget is enabled by default for players.
C#:
object OnInfoHUDProvideWidgets(BasePlayer player)
{
List<Dictionary<string, object>> widgets = new List<Dictionary<string, object>>();
// Example: show total kills
int kills = GetPlayerKills(player); // your own method to get this value
widgets.Add(new Dictionary<string, object>
{
["Identifier"] = "totalkills",
["TextTemplate"] = "Kills: {value}",
["Value"] = kills.ToString(),
["EnabledByDefault"] = true
});
// Example: show K/D ratio
float kd = GetKD(player); // your own method to get this value
widgets.Add(new Dictionary<string, object>
{
["Identifier"] = "kd",
["Text"] = $"K/D: {kd:F2}",
["EnabledByDefault"] = false
});
return widgets;
}