Introduce new sh_schedule.lua module for managing scheduled announcements using either interval-based (every) or cron-based scheduling. Supports both preset announcements and custom title/text combinations.
Features:
- Interval-based scheduling: every = "30m" format (s/m/h/d units)
- Cron-based scheduling: "minute hour day month weekday" format
- Preset reuse from sh_presets.lua or custom title/text
- Server timezone for cron execution
- Pre-configured examples for Discord reminders and custom tips
Add reusable announcement presets that can be selected through the menu (/bannonce) and used by the scheduler. Includes five preset templates: restart, shutdown, maintenance, event, and discord with customizable titles, messages, styles, and durations.
Implement BladW.Announcement.RebuildSchedules() to manage scheduled announcements using two mechanisms:
1. Interval-based scheduling: Parse interval strings (e.g., "30m", "90s", "2h", "1d") and create repeating timers
2. Cron-based scheduling: Parse cron expressions (minute hour day month weekday) and execute on matching times
Features:
- ParseInterval() converts duration strings to seconds
- CompileCron() and CronMatches() handle cron expression parsing and matching
- Single consolidated timer monitors all cron entries with 20s tick to avoid duplicates
- Proper cleanup and hot-reload support via _timers tracking
- Validation with helpful warning messages for invalid configurations
Add two new configuration options to the announcement system:
- announcement_max_length: limit message length to 80 characters
- announcement_sound: specify a sound file to play when announcement appears
Also improve alignment and clarify comments for existing options.
- Add BladW namespace and module structure
- Implement LimitChars() function for UTF-8 safe string truncation
- Add Resolve() function to handle preset-based configuration merging
- Add Broadcast() function to centralize announcement distribution logic
- Update net.Receive handler to support preset system
- Add configurable announcement max length support
- Include announcement sound file registration
- Improve text validation and default values handling
- Add responsive scaling based on screen resolution (1920x1080 baseline)
- Implement two announcement styles: "loader" (fixed border) and "simple" (border timer)
- Add text wrapping utility for responsive message rendering
- Add custom border timer drawing (DrawBorderTimer) for animated border consumption
- Create responsive fonts that rebuild on screen size changes
- Add intro/outro animations with easing (EaseOutCubic)
- Support configurable duration and style per announcement
- Support announcement sound playback on display
- Refactor Show() function to accept style and duration parameters
- Update net message to transmit style and duration from server
- Improve visual hierarchy with proper spacing, padding, and layout
- Change from fixed pixel dimensions to scaled responsive values
BREAKING CHANGE: The announcement API now requires style and duration parameters. The Show() function signature changed from Show(title, text) to Show(title, text, style, duration). Net message format changed to include style and duration fields.
- Add preset system for quick announcement creation with configurable presets
- Implement message length validation with visual feedback (red border, warning icon)
- Add character counter display and configurable max length limit
- Improve UI layout and spacing for better visual hierarchy
- Add status panel showing character count and overflow warnings
- Enhance send button with disabled state when message exceeds limit
- Fix ESC key handling to properly close menu without showing pause menu
- Add helper functions for UTF-8 character counting and warning triangle drawing
- Initialize BladW namespace for better code organization
- Send selected preset identifier to server with announcement data
Implement announcement display system with HUD integration supporting two visual styles:
- Simple: centered text announcement with logo
- Loader: announcement with progress bar showing remaining display time
Features:
- Server to client message handling via net.Receive
- Configurable display duration
- Persistent state across hot-reloads
- Integration with rndx drawing library for styled UI elements
Register three network strings for the announcement system:
- bladWOpenAnnouncementMenu: server to client for opening admin menu
- bladWSendAnnouncement: client admin to server for announcement request
- bladWShowAnnouncement: server to all clients for displaying announcements
Implement client-side network message handler that opens the announcement admin menu when receiving the 'bladWOpenAnnouncementMenu' network message from the server.
Initialize the BladW.Announcement.Conf configuration table with announcement style and duration settings. The announcement_style can be set to either 'simple' or 'loader', and announcement_duration controls the display time in seconds for loader style announcements.
Add server-side functionality for the announcement system:
- Add bladw_amenu console command to open admin announcement menu
- Add /bannonce and !bannonce chat commands for opening the menu
- Implement bladWSendAnnouncement net message handler to broadcast announcements
- Validate admin permissions and sanitize announcement content (title max 64 chars, text max 200 chars)
- Use default title "Annonce" if not provided
Delete the HUD announcement menu implementation that was displaying announcements on the client screen using the rndx drawing library. This feature is no longer needed or has been replaced with an alternative implementation.
Add a new admin menu interface that allows admins to create and send announcements.
The menu features:
- Styled DFrame with logo and title
- Input fields for announcement title and message
- Send button that transmits announcement data to server via net message
- Close button and automatic closing when game UI is opened
- Consistent theming with announcement display (colors, rounded corners, blur effect)
- Prevents multiple menu instances from stacking
Replace simple prefix matching with full glob pattern support for discovering root folders.
Changes:
- Add EscapePattern() to escape Lua magic characters
- Add GlobToPattern() to convert glob patterns (e.g., "bladw_*") to Lua regex patterns
- Refactor FindRootFolders() to support:
• Exact matches without wildcards (e.g., "bladw_announcement")
• Glob patterns with * in prefix/suffix/middle positions
- Update default config root from "bladw_*" to "bladw_announcement"
- Improve documentation with usage examples
- Add new announcement module with client, server, and shared files
- Update rndx.lua library (formatting/whitespace changes)
BREAKING CHANGE: The root config now expects exact folder names or glob patterns instead of simple prefixes. Existing configs using "bladw_*" will still work but the matching behavior changes from prefix-only to glob-based pattern matching.