Compatible With:
- Oxide
- Carbon
QueuedPopups is a high-performance API system that allows developers to display "Gametip-style" notifications in a vertical queue. It features automatic expiry, performance-optimized batching using NextTick, and supports multiple icon sources including ImageLibrary and Steam IDs.
Features:
To use QueuedPopups in your plugin, add the reference:
Icon Types (typeInt):
Example Implementation:
Configuration:
Features:
- Smooth Queuing: Automatically stacks notifications vertically.
- Smart Batching: Uses NextTick to ensure multiple rapid calls (e.g. mass harvesting) only trigger a single UI redraw.
- Performance Focused: Throttled update loops and optimized CUI handling to keep server MSI low.
- Customizable Appearance: Change fonts, sizes, colors, and background blur via config.
- Multiple Icon Sources: Supports URLs, Local Sprites, ImageLibrary, and Steam64 IDs.
- Auto-Cleanup: Messages automatically expire based on a configurable TTL (Time To Live).
To use QueuedPopups in your plugin, add the reference:
C#:
[PluginReference] private Plugin QueuedPopups;
QueuedPopups?.Call("AddPopup",
BasePlayer player, // The recipient
string message, // The text to display
int typeInt, // Icon type (0-4)
string iconData, // Icon identifier (URL, Sprite, etc.)
string bgColor, // Optional: Background RGBA (e.g., "0 0 0 0.8")
string textColor, // Optional: Text RGBA
string iconColor, // Optional: Icon Tint RGBA
float? height, // Optional: Custom pixel height
int? fontSize, // Optional: Custom font size
float? duration // Optional: Seconds until removal
);
Icon Types (typeInt):
- 0: URL - Fetches image from a web link.
- 1: Icon - Internal Rust sprite (e.g., assets/icons/add.png).
- 2: Avatar - Internal Sprite (skips icon material tint).
- 3: ImageLibrary - Uses a PNG name from ImageLibrary.
- 4: SteamId - Displays the avatar of the provided Steam64 ID.
Example Implementation:
C#:
// Simple notification with a local icon
QueuedPopups?.Call("AddPopup", player, "Item Received!", 1, "assets/icons/loot.png");
// Steam Avatar notification with custom green background
QueuedPopups?.Call("AddPopup", player, "Welcome back!", 4, player.UserIDString, "0.2 0.5 0.2 0.8");
// High-priority announcement (Max parameters: Red bg, White text, Yellow icon, 60px height, 18 font, 30s duration)
QueuedPopups?.Call("AddPopup", player, "SERVER RESTART", 1, "assets/icons/stop.png", "0.8 0.2 0.2 0.9", "1 1 1 1", "1 1 0 1", 60f, 18, 30f);
// Slim notification (Max parameters: Green bg, Grey text, White icon, 32px height, 12 font, 5s duration)
QueuedPopups?.Call("AddPopup", player, "Trade Accepted", 0, "https://i.imgur.com/icon.png", "0.2 0.5 0.2 0.8", "0.9 0.9 0.9 1", "1 1 1 1", 32f, 12, 5f);
Configuration:
JSON:
{
"Max Messages": 3,
"Message TTL (Seconds)": 10,
"Font Size": 14,
"Font Name": "robotocondensed-bold.ttf",
"Default Background Color (RGBA)": "1 0 0 0.6",
"Default Text Color (RGBA)": "1 1 1 1",
"Width (Pixels)": 300,
"Height (Pixels)": 24,
"Bottom Start Offset Y": 80
}