API ReferenceGE Extensionsui
Messages Debugger
ImGui debug window for composing, sending, and clearing UI message events.
ImGui debug window for composing, sending, and clearing UI message events.
Overview
ui_messagesDebugger provides a developer-facing ImGui window to test the Message guihook system. You can compose messages with custom text, category, icon, and TTL, then send or clear them interactively.
Extension path: lua/ge/extensions/ui/messagesDebugger.lua
Dependencies: ui_imgui
Exports (M)
| Function | Signature | Description |
|---|---|---|
show | () | Opens the debug window. |
hide | () | Closes the debug window. |
toggle | () | Toggles window visibility. |
onUpdate | (dtReal, dtSim, dtRaw) | Draws the ImGui window each frame. |
Data Fields
| Field | Description |
|---|---|
M.dependencies | {"ui_imgui"} - required for ImGui debug window. |
Internals
UI State
txtMsg- 1024-char buffer for message bodytxtCategory- 128-char buffer for category stringtxtIcon- 256-char buffer for icon path or font idttlSeconds- Float slider (0.5–30s) for time-to-liveuseRegexClear- Checkbox to use regex when clearing categoriesbypassTtl- Checkbox to disable TTL (sendsMessagesDebugevent to UI)
Local Helpers
_sendMessage(msg, ttl, category, icon)- Callsguihooks.message(...)._clearCategory(category, isRegex)- TriggersMessagewithclear = true._clearAll()- TriggersClearAllMessages.
Window Layout
The window contains:
- Bypass TTL checkbox - sends
MessagesDebugto the CEF layer - Multiline text input for the message body
- Category and Icon inputs side-by-side
- TTL slider (0.5–30 seconds)
- Send Message / Send Binding Example buttons
- Clear Category (with regex toggle) / Clear All buttons
- Test 3 Messages - fires three messages with different categories
How It Works
- Open via
extensions.ui_messagesDebugger.show()or console. - Compose a message in the text area, set category/icon/TTL.
- Click Send Message to fire
guihooks.message(...). - Use Clear Category or Clear All to dismiss messages.
- Send Binding Example demonstrates input-binding placeholders like
[action=switch_next_vehicle].
Lua Examples
-- Open the debugger window
extensions.ui_messagesDebugger.show()
-- Toggle from console
extensions.ui_messagesDebugger.toggle()Hooks Triggered
| Hook | Payload | When |
|---|---|---|
guihooks.message(...) | (msg, ttl, category, icon) | Send Message clicked |
MessagesDebug | {bypassTtl} | Bypass TTL checkbox toggled |
Message | {category, clear=true} | Clear Category clicked |
ClearAllMessages | - | Clear All clicked |
Additional Exports
The following exports are available but not yet documented in detail:
M.hideM.onUpdateM.showM.toggle