DevTools

From Turtle WoW Wiki
Revision as of 11:35, 8 August 2025 by >Basedturtle
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

DevTools is a set of debugging, exploration, and diagnostic tools for API development. It provides handy slash commands, frame stack visualization, chat event monitoring, and data inspection features.

Installation

Manual Installation Only

  1. Download this zip: DevTools-1.0pre2-11000.zip
  2. Unpack the .zip into your Interface/AddOns directory and restart the game.


Commands

Command Description Usage Example
/reload Reloads the user interface /reload
/dump <expression> Executes a LUA expression and outputs the result /dump GetPlayerMapPosition("player")
/dtchatevent Toggles chat event tracking /dtchatevent
/dtchatevent buffer Shows current chat event buffer size /dtchatevent buffer
/dtchatevent buffer <size> Sets chat event buffer size /dtchatevent buffer 2000
/dtframestack Toggles the frame stack visualization /dtframestack


Key Bindings

Action Binding Name Default Key
Toggle FrameStack "DevTools:FrameStack_Toggle" /dtframestack
Hold for FrameStack "DevTools:FrameStack_OnHold" (user assigned)


Note: You can customize key bindings via WoW's key binding interface.


Preview


Features

Frame Stack Display

  • Visualizes visible UI frames under the mouse pointer, helping identify overlapping frames or UI issues.
  • Can be toggled on/off with /dtframestack or via assigned key binding.

Data Inspection & Debugging

  • Supports viewing complex nested tables with optional name caching for functions, userdata, and tables.
  • Provides color-coded, readable output in chat.

Reload UI

  • /reload
  • Shortcut: /reload
  • Description: Reloads the user interface.


Usage

Data Dump (/dump)

Purpose: Execute a LUA expression and output its result.

Usage:

  • /dump <expression>

Example:

  • /dump GetPlayerMapPosition("player")

Output:

  • Displays the value or table data of the expression in chat, supporting nested tables and self-references.


Chat Event Monitoring (/dtchatevent)

Commands:

  • /dtchatevent — Toggles chat event tracking (enabled/disabled).
  • /dtchatevent buffer — Shows current buffer size.
  • /dtchatevent buffer <size> — Sets buffer size (default: 1000).

Functionality:

  • When enabled, all chat messages across chat frames are prefixed with an interactive marker. Clicking on it opens a tooltip with detailed event info.

Usage Tips:

  • Use /dtchatevent to toggle monitoring.
  • Use /dtchatevent buffer <size> to adjust how many chat events are stored (max size is configurable).


Frame Stack Visualization (/dtframestack)

Purpose:

  • Displays the hierarchy of UI frames under your mouse cursor, helpful for UI troubleshooting.

Usage:

  • /dtframestack — Toggles the frame stack window on/off.
  • Key Binding (if set): Toggle FrameStack Display


Hold for FrameStack:

  • You can bind the "Hold" command to display the frame stack as long as you hold a key.


Configuration

You can tweak the behavior of /dump using global variables:<syntaxhighlight lang="lua"> DEVTOOLS_MAX_ENTRY_CUTOFF = 30 -- Max table entries displayed DEVTOOLS_LONG_STRING_CUTOFF = 200 -- Max string length shown DEVTOOLS_DEPTH_CUTOFF = 10 -- Max nested table depth DEVTOOLS_USE_TABLE_CACHE = true -- Cache table names DEVTOOLS_USE_FUNCTION_CACHE = true -- Cache function names DEVTOOLS_USE_USERDATA_CACHE = true -- Cache userdata names DEVTOOLS_INDENT=' ' -- Indentation string for nested data </syntaxhighlight>



Color Code

Color Code Example Usage
cff88ff88 Greenish color — Used for displaying data types and values, especially for opaque types like functions, userdata, and tables. It helps these elements stand out.
cffffcc00 Yellowish color — Used for references to table names or references, making them easy to identify.
cffff0000 Red color — Indicates skipped or truncated data, such as skipped table entries or overly deep tables. It signals "attention" or "warning."
cff88cccc Light Cyan — Used for frame or UI element labels, such as the frame strata, for clear visual separation.
cffffff00 Yellow — Additional color used in the frame stack window to highlight strata levels or other labels.

Note: The |c prefix starts a color code, followed by 8 hex digits: AARRGGBB (Alpha, Red, Green, Blue). DevTools uses these to color parts of its output text, making it easier to parse complex data visually.


History

1.0pre2 - 2006-04-09

  • Added /dtchatevent buffer
  • Added tooltip error when clicking on out-of-buffer event link
  • Added line wrapping for long event arguments and escaping of newlines
  • Added easy indication for runs of spaces (and spaces at beginning or end of strings).
  • Added /dtframestack (plus key bindings)

1.0pre1 - 2006-04-03

  • Added /dtchatevent
  • Rearranged code a little

0.7 - 2006-03-27

  • Switched from RunScript to loadstring

0.6 - 2005-08-30

  • Fixed tableEntriesSkipped issue.

0.5 - 2005-07-23

  • Added function cache (gives names of functions if known)
  • Added userdata cache (gives names of userdata if known)
  • Cleaned up trailing comma formatting so it's more consistent
  • Added customizable indentation (DEVTOOLS_INDENT)
  • Restructured scanner to be a little more object oriented (for future development)
  • Switched many formatting tasks to use string.format
  • Handle function/userdata/table table keys better.
  • Made DevTools_Dump(value) friendly enough to use from code for debugging.

0.4 - 2005-03-20

  • Added cutoff for deep tables
  • Added table cache for self-referential tables
  • Cleaned up display of name table keys
  • Added nicer handling for simple variable dumps
  • Added color coding of output

0.3 - 2005-02-05

  • Re-worked output method for large objects.
  • Removed message on load to reduce spam
  • Added limits on max table entries and max string length output

0.2 - 2004-12-27

  • Added some documentation

0.1

  • Initial version, /dump and /reload