Simple Status
Provides an API for adding custom status messages that fit alongside the vanilla Rust status UI. Simple Status does not add gameplay statuses on its own; it provides an API that other plugins can use to display them.
codefling.com
Overview
Provides an API for adding custom status messages that fit alongside the vanilla Rust status UI. Simple Status does not add gameplay statuses on its own; it provides an API that other plugins can use to display them.
As of version 1.3.0, Simple Status supports Facepunch's native CustomVitals system. Compatible statuses are rendered using the native Rust status UI, while unsupported features automatically fall back to the Legacy CUI renderer when required.
Simple Status also supports Advanced Status integration and can automatically switch between Advanced Status, native CustomVitals, and Legacy CUI depending on the server configuration and the features used by each status.
Commands
/ts
Toggles the visibility of statuses for a player. This command can be changed in the config settings.
Configuration
{
"ChatMessageSteamId": 0,
"ToggleStatusCommand": "ts",
"UseCustomVitals": true,
"UseInternalCustomVitalsWrapper": true,
"ForceCustomVitalsForUnsupportedStatuses": false,
"IgnoreAdvancedStatus": false
}
UseCustomVitals - Enables the native Facepunch CustomVitals renderer when available.
UseInternalCustomVitalsWrapper - Uses Simple Status' built-in Facepunch CustomVitals wrapper. This does not require Carbon. If disabled, Simple Status will attempt to use the Carbon/CarbonAliases CustomVitalManager provider instead.
ForceCustomVitalsForUnsupportedStatuses - Forces statuses to remain on CustomVitals even when they use unsupported features. Unsupported features such as progress bars or asset-path icons will not be rendered.
IgnoreAdvancedStatus - When enabled, Simple Status will not use Advanced Status as its renderer and will instead use CustomVitals or Legacy CUI.
Custom Status Framework
This plugin is a sequel to Custom Status Framework and features much better performance. They do the same thing, but are NOT compatible with each other. Do not load both on your server or you may run into issues. Plugins that require Custom Status Framework will need to be updated to support Simple Status, it is not backwards compatible. If you are a plugin developer and need help writing your plugin to use Simple Status, please reach out to me!
void CreateStatus(Plugin plugin, string statusId, Dictionary<string, object> properties)
// Registers a status definition.
// OnSimpleStatusReady() is recommended when Simple Status may load after your plugin.
// See the Properties section for supported values.
void SetStatus(string userId, string statusId, int duration = int.MaxValue, bool pauseOffline = true)
// Assigns a player a status with a duration. Set duration to int.MaxValue for an infinite status. Set to 0 to clear a status.
void SetStatusProperty(string userId, string statusId, Dictionary<string, object> properties)
// Set multiple properties for a player status with a single API call. Will minimize the number of redraws, so its better than individually setting properties.
// See the properties section for a list of properties to set.
int GetDuration(string userId, string statusId)
// Returns the duration in seconds of a status that a player has. Returns 0 if the player does not have that status.
void OnStatusSet(string userId, string statusId, int duration)
// Called when a status is initially set for a player.
void OnStatusEnd(string userId, string statusId, int duration)
// Called when a status is removed for a player. (When the duration reaches 0).
void OnStatusUpdate(string userId, string statusId, string property, string value)
// Called when a status property is updated.
// See the properties section for a list of properties to set.
// The following are valid property keys that are used in multiple API methods
var properties = new Dictionary<string, object>
{
["color"] = "1 1 1 1", // Background color
["title"] = "hello", // Left-side text. Localization keys are supported.
["titleColor"] = "0 0 0 1", // Left-side text color
["text"] = "subtext", // Right-side text. Set null to use the duration counter for timed statuses.
["textColor"] = "0 0 0 1", // Right-side text color
["icon"] = "star", // ImageLibrary key, direct URL, raw image key, asset path, or itemid. See Image Types.
["iconColor"] = "0 0 0 1", // Icon color
["progress"] = 0.0, // Progress value between 0.0 and 1.0. Progress bars require Legacy CUI.
["progressColor"] = "0 0 0 0.5", // Progress bar color
["rank"] = 0 // Lower ranks are rendered before higher ranks.
};
["icon"] = "my_icon"
["icon"] = "
["icon"] = "raw:my_icon"
["icon"] = "assets/icons/example.png"
["icon"] = "itemid:123456789"
By default, if any active Simple Status status for a player requires one of these features, all regular Simple Status statuses for that player are temporarily rendered through Legacy CUI. This keeps status ordering and layout consistent.
bool IsInternalCustomVitalsWrapperAvailable()
bool SetCustomVital(Plugin plugin, ulong userId, string vitalId, Dictionary<string, object> properties)
bool RemoveCustomVital(Plugin plugin, ulong userId, string vitalId)
bool RemoveCustomVitals(Plugin plugin, ulong userId)
bool RemoveAllCustomVitals(Plugin plugin)
bool HasCustomVital(Plugin plugin, ulong userId, string vitalId)
