## Version 2.1.1 - Duel Detection Unification & Debounced Updates

### Bug Fixes
- **Unified Duel Detection (Classic & Retail):** Removed usage of Classic-only `UnitIsDueling` and now track duel state via events on all versions (`DUEL_REQUESTED`, `DUEL_FINISHED`, `DUEL_OUTOFBOUNDS`). Prevents nil-call errors and keeps behavior consistent.

### Technical Improvements
- **Debounced Update Handling:** Wrapped `UpdateKeybinding()` with a 0.3s debounce using `C_Timer`, coalescing bursty events (zone changes/login/War Mode toggles) to reduce chat spam and needless binding churn.

---

## Version 2.1.0 - Retail Compatibility Fix

### Bug Fixes
- **Fixed Retail WoW Compatibility**: Resolved Lua errors caused by calling `UnitIsDueling` function which doesn't exist in Retail WoW
- **Enhanced Duel Detection**: Implemented alternative duel detection system for Retail using event tracking
- **Improved Error Handling**: Added safety checks for potentially missing functions in different WoW versions
- **Better Retail Duel Support**: Added proper duel state tracking for Retail with `DUEL_REQUESTED`, `DUEL_FINISHED`, and `DUEL_OUTOFBOUNDS` events
- **Function Safety**: Added fallback handling for `GetZonePVPInfo` function to prevent errors

### Technical Improvements
- **Version-Specific Function Calls**: Added proper version checks before calling Classic-only functions
- **Retail Duel State Management**: Implemented manual duel state tracking for Retail compatibility
- **Debug Tools**: Added `/pvtbdebug` command for troubleshooting PvP state detection
- **Enhanced Event Handling**: Improved duel event handling for better Retail compatibility

### Commands
- `/pvtbdebug` - Debug command to show current PvP state detection (new)

---

## Version 2.0.0 - Multi-Version Support Release

### New Features
- **Multi-Version Support**: Now compatible with both WoW Classic and Retail versions
- **Automatic Version Detection**: Addon automatically detects which WoW version you're running
- **Version Information Command**: New `/pvtb version` command to show WoW version details
- **Enhanced Status Display**: Status command now shows which WoW version is detected
- **Retail PvP Enhancement**: Supports additional Retail PvP instance types:
  - Rated Battlegrounds
  - Epic Battlegrounds (Wintergrasp, etc.)
  - War Games (custom PvP)
  - PvP Scenarios
  - Rated Arenas
- **Detailed PvP Type Display**: Shows specific PvP instance type in status messages
- **Duel Support**: Automatically switches to player-only targeting during duels
- **Open World PvP Detection**: Detects PvP zones and contested territories
- **PvP Flagged Handling**: Optional support for when you're PvP flagged
- **Configurable Settings**: Toggle different PvP scenarios on/off:
  - Duels (default: ON)
  - Open World PvP (default: ON)
  - PvP Flagged (default: OFF)

### Features
- Automatic Tab keybinding switching based on PvP/PvE zones
- PvE zones: Tab targets "Target Nearest Enemy" (includes NPCs)
- PvP instances: Tab targets "Target Nearest Enemy Player" (players only)
- Persistent settings that remember your preferences
- Automatic detection of Battlegrounds and Arenas
- Status messages when keybinding changes

### Commands
- `/pvtb` or `/pvptabbinder` - Show help and commands
- `/pvtb toggle` - Toggle addon on/off
- `/pvtb on` - Enable addon
- `/pvtb off` - Disable addon
- `/pvtb status` - Show current status and zone type
- `/pvtb version` - Show WoW version information
- `/pvtb duels` - Toggle duel handling
- `/pvtb worldpvp` - Toggle open world PvP handling
- `/pvtb pvpflagged` - Toggle PvP flagged handling

### Technical
- Compatible with WoW Classic (Interface 50400) and Retail (Interface 100200+)
- Automatic version detection using build numbers
- No external dependencies required
- Lightweight and efficient
- Automatic event handling for zone changes
- Backward compatible with existing Classic installations
- Enhanced event monitoring for duels and PvP flag changes

### Installation
- Single addon works for both Classic and Retail
- Separate .toc files for different versions
- Automatic adaptation to your WoW version 