You are viewing a potentially older version of this package.
View all versions.
CooldownUI
A universal UI library for displaying cooldowns, timers, and status indicators above players. Easy to integrate into your ROUNDS mods.
By bellusfennec
| Date uploaded | 5 months ago |
| Version | 1.0.0 |
| Download link | bellusfennec-CooldownUI-1.0.0.zip |
| Downloads | 26315 |
| Dependency string | bellusfennec-CooldownUI-1.0.0 |
This mod requires the following mods to function
BepInEx-BepInExPack_ROUNDS
BepInEx pack for ROUNDS. Preconfigured and ready to use.
Preferred version: 5.4.1901willis81808-UnboundLib
This is a helpful utility for ROUNDS modders aimed at simplifying common tasks.
Preferred version: 3.2.14README
CooldownUI
A universal UI library for ROUNDS that provides easy-to-use cooldown timers, status indicators, and text displays above players.
Features
- Cooldown Timers - Display countdown with color transition (red → green)
- Active Duration - Show remaining active time (cyan color)
- Custom Text - Display any text with custom colors
- Icons - Add icons/symbols next to timers
- Auto-Stacking - Multiple timers automatically stack vertically
- Dynamic Scale Compensation - UI maintains constant size even when player scales up/down
- Standardized Size - Consistent text size across all mods using this library
- Performance - Efficient 4-corner shadow rendering
Installation
- Install via Thunderstore Mod Manager (recommended)
- Or manually: Download and extract to
BepInEx/plugins/
Usage
Add as Dependency
In your mod's manifest.json:
{
"dependencies": [
"BellusFennec-CooldownUI-1.0.0"
]
}
In your plugin class:
[BepInDependency("com.rounds.cooldownui", BepInDependency.DependencyFlags.HardDependency)]
Basic Examples
Creating a Cooldown Timer
using CooldownUILib;
public class MyCardMono : MonoBehaviour
{
private CooldownUI cooldownUI;
private Player player;
private float cooldown = 5f;
private float cooldownTimer = 0f;
void Start()
{
player = GetComponent<Player>();
// Create UI attached to player
cooldownUI = CooldownUI.Create(player.transform);
// Optional: Set an icon
cooldownUI.SetIcon("⚡", Color.yellow);
}
void Update()
{
if (cooldownTimer > 0f)
{
cooldownTimer -= Time.deltaTime;
cooldownUI.ShowCooldown(cooldownTimer, cooldown);
}
else
{
cooldownUI.Hide();
}
}
void OnDestroy()
{
if (cooldownUI != null)
{
Destroy(cooldownUI.gameObject);
}
}
}
Showing Active Duration
// Show remaining active time (cyan color)
cooldownUI.ShowActive(remainingTime);
Custom Text Display
// Show custom text
cooldownUI.ShowText("READY", Color.green);
cooldownUI.ShowText("x3", Color.white); // Stack count
cooldownUI.ShowText("BLOCKED", Color.red);
// Convenience methods
cooldownUI.ShowReady(); // Shows "READY" in green
cooldownUI.ShowStacks(3); // Shows "x3"
cooldownUI.ShowStacks(5, Color.yellow);
Advanced Usage
Custom Colors
// Set custom state colors
cooldownUI.SetColors(
ready: Color.cyan, // When cooldown complete
cooldown: Color.magenta, // During cooldown
active: Color.yellow // During active effect
);
// Set shadow color
cooldownUI.SetShadowColor(new Color(0.2f, 0f, 0f, 0.9f));
Icons
// Set icon with color
cooldownUI.SetIcon("🛡", Color.blue);
cooldownUI.SetIcon("★", new Color(1f, 0.8f, 0f));
// Clear icon
cooldownUI.ClearIcon();
Custom Scale
// Create with custom scale (1.5x larger)
var ui = CooldownUI.Create(player.transform, 1.5f);
// Smaller UI
var smallUI = CooldownUI.Create(player.transform, 0.7f);
Full Card Example
using BepInEx;
using UnboundLib.Cards;
using UnityEngine;
using CooldownUILib;
public class MyAbilityCard : CustomCard
{
public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
// Card setup
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
var mono = player.gameObject.GetOrAddComponent<MyAbilityMono>();
mono.Initialize(player);
}
// ... other required overrides
}
public class MyAbilityMono : MonoBehaviour
{
private Player player;
private CooldownUI cooldownUI;
private float abilityCooldown = 10f;
private float abilityDuration = 3f;
private float cooldownTimer = 0f;
private float activeTimer = 0f;
private bool isActive = false;
public void Initialize(Player player)
{
this.player = player;
// Create cooldown UI
cooldownUI = CooldownUI.Create(player.transform);
cooldownUI.SetIcon("⚡", Color.cyan);
}
void Update()
{
if (player == null) return;
// Active state
if (isActive)
{
activeTimer -= Time.deltaTime;
cooldownUI.ShowActive(activeTimer);
if (activeTimer <= 0f)
{
DeactivateAbility();
}
return;
}
// Cooldown state
if (cooldownTimer > 0f)
{
cooldownTimer -= Time.deltaTime;
cooldownUI.ShowCooldown(cooldownTimer, abilityCooldown);
}
else
{
cooldownUI.ShowReady();
// Check for activation (example: block key)
if (player.data.block.IsBlocking())
{
ActivateAbility();
}
}
}
void ActivateAbility()
{
isActive = true;
activeTimer = abilityDuration;
// Apply ability effects...
}
void DeactivateAbility()
{
isActive = false;
cooldownTimer = abilityCooldown;
// Remove ability effects...
}
void OnDestroy()
{
if (cooldownUI != null)
{
Destroy(cooldownUI.gameObject);
}
}
}
API Reference
Factory Methods
| Method | Description |
|---|---|
CooldownUI.Create(Transform parent, float scale = 1f) |
Creates UI attached to target |
Display Methods
| Method | Description |
|---|---|
ShowCooldown(float remaining, float total) |
Shows cooldown (red→green) |
ShowActive(float remaining) |
Shows active time (cyan) |
ShowText(string text, Color color) |
Shows custom text |
ShowReady() |
Shows "READY" in green |
ShowStacks(int count, Color? color) |
Shows stack count (e.g., "x3") |
Hide() |
Hides the UI |
Customization Methods
| Method | Description |
|---|---|
SetIcon(string icon, Color? color) |
Sets icon character |
ClearIcon() |
Removes icon |
SetColors(Color ready, Color cooldown, Color active) |
Sets state colors |
SetShadowColor(Color color) |
Sets shadow color |
Static Methods
| Method | Description |
|---|---|
CooldownUI.ClearAllRegistrations() |
Clears all tracking data |
CooldownUI.GetActiveUICount(Transform target) |
Gets UI count for target |
Tips
- Always destroy UI in OnDestroy - Prevents memory leaks
- Use ClearAllRegistrations on round end - Already handled by the plugin
- Multiple UIs auto-stack - No manual positioning needed
- Icons support Unicode - Use emoji or special characters
Changelog
1.0.0
- Initial release
- Cooldown, active, and custom text display
- Icon support
- Auto-stacking for multiple timers
- Scale compensation
Credits
Created by BellusFennec for the ROUNDS modding community.
License
MIT License - Feel free to use in your mods!
Feedback
If you have any feedback, please reach out to me on Telegram.
CHANGELOG
Changelog
All notable changes to CooldownUI will be documented in this file.
[1.0.2] - 2025-03-08
Added
- Background panel - Semi-transparent dark backdrop behind timer and icon for better readability on any background
SetBackgroundEnabled(bool)- Show or hide the background panelSetBackgroundColor(Color)- Customize background color and opacity (default: black at 55% opacity)
Changed
- Font size increased from 5 to 6 for better visibility
- Stack offset increased proportionally to prevent overlap between multiple timers on the same player
[1.0.1] - 2025-02-04
Added
- TextMeshPro Support - Migrated from TextMesh to TextMeshPro for better rendering
- Sprite Icons - New
SetIconSprite()method to use custom sprites as icons - Icon Configuration Options:
SetIconPosition(IconPosition)- Place icon on Left or Right of timerSetIconColorSync(bool)- Sync icon color with timer color changesSetHideIconOnReady(bool)- Optionally hide icon when showing READYSetIconScale(float)- Scale icon size (0.1 to 3.0)GetIconType()- Returns None, Text, or SpriteHasIcon()- Check if icon is set
- Outline Customization:
SetOutlineColor(Color)- Set text outline colorSetOutlineWidth(float)- Set outline width (0-1)
Changed
- Text rendering now uses TextMeshPro with built-in outline (replaces 4-corner shadow system)
- Icon positioning is now dynamic based on text width
- Improved visual quality with SDF font rendering
Removed
- Old 4-corner shadow system (replaced by TMP outline)
Technical
- Uses Noto Sans Symbols and Noto Sans Symbols 2 font family for extended Unicode support
- Supports both external AssetBundle and embedded resource loading
[1.0.0] - 2025-01-04
Added
- Initial release
CooldownUI.Create()- Create UI attached to transformShowCooldown()- Display cooldown with color transition (red → green)ShowActive()- Display active duration (cyan)ShowText()- Display custom text with custom colorShowReady()- Display "READY" textShowStacks()- Display stack countHide()- Hide the UI- Icon support with
SetIcon()andClearIcon() - Custom colors with
SetColors()andSetShadowColor() - Automatic vertical stacking when multiple UIs on same player
- Dynamic scale compensation - UI size stays constant even when player scales
- Standardized text size (FONT_SIZE=40, CHAR_SIZE=0.12) for consistency across mods
- Efficient 4-corner shadow rendering
- Automatic cleanup on round/game end