first commit

This commit is contained in:
Beyhan Oğur
2026-09-03 04:45:36 +03:00
commit d5f52cc3d3
1038 changed files with 169579 additions and 0 deletions
@@ -0,0 +1,354 @@
# Conditional Switching & Automation
<cite>
**Referenced Files in This Document**
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.xaml.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist/Views/Agents/DressTabControl.xaml.cs)
- [SkillManager.cs](file://ClassicAssist.Shared/Data/Skills/SkillManager.cs)
- [Region.cs](file://ClassicAssist.Shared/Data/Regions/Region.cs)
- [PlayerStatus.cs](file://ClassicAssist.Shared/UO/Data/PlayerStatus.cs)
- [IncomingPacketHandlers.cs](file://ClassicAssist.Shared/UO/Network/IncomingPacketHandlers.cs)
- [OutgoingPacketHandlers.cs](file://ClassicAssist.Shared/UO/Network/OutgoingPacketHandlers.cs)
</cite>
## Table of Contents
1. [Introduction](#introduction)
2. [Project Structure](#project-structure)
3. [Core Components](#core-components)
4. [Architecture Overview](#architecture-overview)
5. [Detailed Component Analysis](#detailed-component-analysis)
6. [Dependency Analysis](#dependency-analysis)
7. [Performance Considerations](#performance-considerations)
8. [Troubleshooting Guide](#troubleshooting-guide)
9. [Conclusion](#conclusion)
## Introduction
This document explains advanced conditional switching and automation features in the Dress Manager. It covers how to configure automatic outfit changes based on game conditions such as skill levels, character status, location, or time of day. It documents the DressAgentItemType enumeration and its behaviors for different equipment categories, trigger events that initiate automatic switching, priority handling when multiple conditions are met, and conflict resolution strategies. Practical examples include automatically switching to fishing gear when using Fishing skill, changing to formal wear at social events, and adapting equipment based on zone difficulty. Performance considerations and debugging techniques for complex conditional logic are also included.
## Project Structure
The Dress Manager is implemented across shared data models, UI view models, and platform-specific views. The core logic resides in shared code, while UI bindings and interactions are provided by Avalonia and WPF implementations.
```mermaid
graph TB
subgraph "Shared Data"
A["DressAgentItemType.cs"]
B["DressManager.cs"]
C["DressAgentEntry.cs"]
D["DressAgentItem.cs"]
E["SkillManager.cs"]
F["Region.cs"]
G["PlayerStatus.cs"]
end
subgraph "UI - Avalonia"
H["DressTabViewModel.cs"]
I["DressTabControl.xaml.cs (Avalonia)"]
end
subgraph "UI - WPF"
J["DressTabControl.xaml.cs (WPF)"]
end
subgraph "Network Handlers"
K["IncomingPacketHandlers.cs"]
L["OutgoingPacketHandlers.cs"]
end
H --> B
I --> H
J --> H
B --> A
B --> C
B --> D
B --> E
B --> F
B --> G
K --> B
L --> B
```
**Diagram sources**
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.xaml.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist/Views/Agents/DressTabControl.xaml.cs)
- [SkillManager.cs](file://ClassicAssist.Shared/Data/Skills/SkillManager.cs)
- [Region.cs](file://ClassicAssist.Shared/Data/Regions/Region.cs)
- [PlayerStatus.cs](file://ClassicAssist.Shared/UO/Data/PlayerStatus.cs)
- [IncomingPacketHandlers.cs](file://ClassicAssist.Shared/UO/Network/IncomingPacketHandlers.cs)
- [OutgoingPacketHandlers.cs](file://ClassicAssist.Shared/UO/Network/OutgoingPacketHandlers.cs)
**Section sources**
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.xaml.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist/Views/Agents/DressTabControl.xaml.cs)
- [SkillManager.cs](file://ClassicAssist.Shared/Data/Skills/SkillManager.cs)
- [Region.cs](file://ClassicAssist.Shared/Data/Regions/Region.cs)
- [PlayerStatus.cs](file://ClassicAssist.Shared/UO/Data/PlayerStatus.cs)
- [IncomingPacketHandlers.cs](file://ClassicAssist.Shared/UO/Network/IncomingPacketHandlers.cs)
- [OutgoingPacketHandlers.cs](file://ClassicAssist.Shared/UO/Network/OutgoingPacketHandlers.cs)
## Core Components
- DressAgentItemType: Enumeration defining equipment categories used by the Dress Manager to target specific slots (e.g., head, torso, legs, shoes, gloves, ring, necklace, etc.). Each category maps to a particular layer or slot type for equipping/unequipping items.
- DressAgentEntry: Represents a single dress rule with conditions and actions. It includes fields for item selection criteria, target category, and optional constraints.
- DressAgentItem: Encapsulates an item reference within a dress rule, including properties like hue, quality, and matching attributes.
- DressManager: Orchestrates evaluation of rules, condition checks, and execution of equip/unequip actions. It integrates with skill, region, and player state APIs to evaluate dynamic conditions.
- DressTabViewModel: Exposes Dress Manager functionality to the UI, enabling users to create, edit, and manage dress rules.
- Platform Views (Avalonia/WPF): Provide user interfaces for configuring dress rules and displaying current states.
Key responsibilities:
- Rule evaluation pipeline: iterate through configured rules, evaluate conditions, compute priority, and resolve conflicts.
- Category mapping: translate DressAgentItemType to actual equipment layers/slots.
- Trigger integration: subscribe to network and game events to initiate re-evaluation when relevant state changes occur.
**Section sources**
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.xaml.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist/Views/Agents/DressTabControl.xaml.cs)
## Architecture Overview
The Dress Manager follows a rule-based architecture where each rule defines conditions and actions. When triggers fire (skill usage, movement into a new region, combat state change), the manager evaluates all active rules, computes priorities, and applies the highest-priority match.
```mermaid
sequenceDiagram
participant Game as "Game Engine"
participant Net as "Network Handlers"
participant DM as "DressManager"
participant VM as "DressTabViewModel"
participant UI as "DressTabControl (Avalonia/WPF)"
Game->>Net : "Event : Skill Use / Region Change / Status Update"
Net->>DM : "Notify : Trigger event"
DM->>DM : "Evaluate Rules<br/>Compute Priority"
DM-->>VM : "Update State (Active Outfit)"
VM-->>UI : "Refresh UI Bindings"
DM->>Game : "Equip/Unequip Items per Rule"
```
**Diagram sources**
- [IncomingPacketHandlers.cs](file://ClassicAssist.Shared/UO/Network/IncomingPacketHandlers.cs)
- [OutgoingPacketHandlers.cs](file://ClassicAssist.Shared/UO/Network/OutgoingPacketHandlers.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.xaml.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist/Views/Agents/DressTabControl.xaml.cs)
## Detailed Component Analysis
### DressAgentItemType Enumeration
Purpose:
- Defines equipment categories targeted by dress rules.
- Maps to specific layers/slots for equipping/unequipping items.
Behavior highlights:
- Head/Torso/Legs/Shoes/Gloves: Standard armor slots.
- Ring/Necklace: Accessory slots.
- Weapon/Shield: Combat-oriented slots.
- Other categories may exist depending on implementation details.
Practical implications:
- Rules can target specific categories to ensure precise control over which slots are changed.
- Conflicts between rules targeting the same category must be resolved via priority.
**Section sources**
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
### Dress Agent Entry and Item Models
- DressAgentEntry:
- Contains rule metadata, conditions, and actions.
- Includes fields for category selection and item matching parameters.
- DressAgentItem:
- Describes the item to equip, including hue, quality, and attribute filters.
Usage patterns:
- Create entries for distinct scenarios (e.g., fishing, formal wear).
- Use DressAgentItem to constrain matches by hue or other properties.
**Section sources**
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
### DressManager Evaluation Pipeline
Responsibilities:
- Collect active rules from configuration.
- Evaluate conditions against current game state (skills, regions, status).
- Compute priority for each matching rule.
- Resolve conflicts when multiple rules match the same category.
- Execute equip/unequip actions for the winning rule.
Evaluation flow:
```mermaid
flowchart TD
Start(["Start Evaluation"]) --> GatherRules["Gather Active Rules"]
GatherRules --> ForEachRule{"For Each Rule"}
ForEachRule --> |Yes| CheckConditions["Check Conditions<br/>Skills/Region/Status"]
CheckConditions --> ConditionMet{"Condition Met?"}
ConditionMet --> |No| NextRule["Next Rule"]
ConditionMet --> |Yes| ComputePriority["Compute Priority"]
ComputePriority --> StoreCandidate["Store Candidate (Category -> Priority)"]
StoreCandidate --> NextRule
NextRule --> |All Done| ResolveConflicts["Resolve Conflicts by Priority"]
ResolveConflicts --> ApplyActions["Apply Equip/Unequip Actions"]
ApplyActions --> End(["End Evaluation"])
```
**Diagram sources**
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
**Section sources**
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
### Trigger Events and Integration Points
Triggers that initiate automatic switching:
- Skill usage events: e.g., using Fishing skill.
- Region changes: entering/exiting zones with different difficulty or purpose.
- Player status updates: combat mode toggles, buffs/debuffs, health thresholds.
- Time-of-day indicators: if available via game state or server messages.
Integration points:
- IncomingPacketHandlers: listen for incoming packets indicating skill use, region transitions, or status changes.
- OutgoingPacketHandlers: observe outgoing commands like skill activation to preemptively switch outfits.
- UI ViewModels: expose methods to manually trigger re-evaluation or refresh state.
**Section sources**
- [IncomingPacketHandlers.cs](file://ClassicAssist.Shared/UO/Network/IncomingPacketHandlers.cs)
- [OutgoingPacketHandlers.cs](file://ClassicAssist.Shared/UO/Network/OutgoingPacketHandlers.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
### Priority Handling and Conflict Resolution
When multiple rules match:
- Priority computation considers factors such as explicit rule priority, specificity of conditions, and category overlap.
- Higher priority wins; ties may be broken by rule order or last-applied policy.
- Conflicts are resolved per category to avoid unintended slot overrides.
Strategy recommendations:
- Assign higher priority to context-sensitive rules (e.g., combat vs. social).
- Use narrower conditions to reduce ambiguity.
- Avoid overlapping rules for the same category unless necessary.
**Section sources**
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
### Practical Examples
- Automatically switch to fishing gear when using Fishing skill:
- Create a rule targeting fishing-related categories (e.g., gloves, weapon).
- Condition: Fishing skill usage detected via outgoing packet handler.
- Priority: High during active skill use.
- Change to formal wear at social events:
- Create a rule targeting head/torso/shoes for formal attire.
- Condition: Region name or chat context indicates social gathering.
- Priority: Medium-high to override casual wear but not combat gear.
- Adapt equipment based on zone difficulty:
- Create rules for low/high difficulty zones.
- Condition: Region change event with difficulty classification.
- Priority: Highest in high-difficulty zones to ensure survival-focused gear.
[No sources needed since this section provides conceptual examples]
## Dependency Analysis
The Dress Manager depends on several subsystems to evaluate conditions and execute actions.
```mermaid
graph TB
DM["DressManager.cs"]
ItemType["DressAgentItemType.cs"]
Entry["DressAgentEntry.cs"]
Item["DressAgentItem.cs"]
Skills["SkillManager.cs"]
Region["Region.cs"]
Status["PlayerStatus.cs"]
InPkt["IncomingPacketHandlers.cs"]
OutPkt["OutgoingPacketHandlers.cs"]
VM["DressTabViewModel.cs"]
UIA["DressTabControl.xaml.cs (Avalonia)"]
UIW["DressTabControl.xaml.cs (WPF)"]
DM --> ItemType
DM --> Entry
DM --> Item
DM --> Skills
DM --> Region
DM --> Status
InPkt --> DM
OutPkt --> DM
VM --> DM
UIA --> VM
UIW --> VM
```
**Diagram sources**
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [SkillManager.cs](file://ClassicAssist.Shared/Data/Skills/SkillManager.cs)
- [Region.cs](file://ClassicAssist.Shared/Data/Regions/Region.cs)
- [PlayerStatus.cs](file://ClassicAssist.Shared/UO/Data/PlayerStatus.cs)
- [IncomingPacketHandlers.cs](file://ClassicAssist.Shared/UO/Network/IncomingPacketHandlers.cs)
- [OutgoingPacketHandlers.cs](file://ClassicAssist.Shared/UO/Network/OutgoingPacketHandlers.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.xaml.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist/Views/Agents/DressTabControl.xaml.cs)
**Section sources**
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [SkillManager.cs](file://ClassicAssist.Shared/Data/Skills/SkillManager.cs)
- [Region.cs](file://ClassicAssist.Shared/Data/Regions/Region.cs)
- [PlayerStatus.cs](file://ClassicAssist.Shared/UO/Data/PlayerStatus.cs)
- [IncomingPacketHandlers.cs](file://ClassicAssist.Shared/UO/Network/IncomingPacketHandlers.cs)
- [OutgoingPacketHandlers.cs](file://ClassicAssist.Shared/UO/Network/OutgoingPacketHandlers.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.xaml.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist/Views/Agents/DressTabControl.xaml.cs)
## Performance Considerations
- Minimize rule count: Keep only necessary rules active to reduce evaluation overhead.
- Narrow conditions: Use specific conditions to avoid unnecessary computations.
- Debounce rapid triggers: Coalesce frequent events (e.g., rapid region changes) to prevent excessive evaluations.
- Cache results: Reuse computed matches for stable states to avoid redundant work.
- Prefer lightweight checks: Favor fast API calls (e.g., current region name) over heavy queries.
[No sources needed since this section provides general guidance]
## Troubleshooting Guide
Common issues and diagnostics:
- No outfit change occurs:
- Verify trigger events are firing (check network handlers).
- Confirm conditions match current state (skills, region, status).
- Inspect priority settings and potential conflicts.
- Wrong slot affected:
- Ensure DressAgentItemType targets the correct category.
- Validate item matching parameters (hue, quality).
- Frequent flickering/outfit oscillation:
- Increase debounce intervals or refine conditions.
- Adjust priorities to stabilize outcomes.
Debugging techniques:
- Log rule evaluations and priorities.
- Add UI indicators showing active rule and reason for selection.
- Temporarily disable non-essential rules to isolate problems.
**Section sources**
- [IncomingPacketHandlers.cs](file://ClassicAssist.Shared/UO/Network/IncomingPacketHandlers.cs)
- [OutgoingPacketHandlers.cs](file://ClassicAssist.Shared/UO/Network/OutgoingPacketHandlers.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
## Conclusion
The Dress Manager’s conditional switching system enables powerful automation based on skills, regions, status, and more. By understanding DressAgentItemType categories, crafting precise rules, managing priorities, and integrating with trigger events, you can implement robust outfit automation. Follow performance best practices and use the troubleshooting guide to maintain reliable behavior under complex conditions.
@@ -0,0 +1,360 @@
# Dress Manager Basics
<cite>
**Referenced Files in This Document**
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [DressTabControl.axaml](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.axaml)
- [DressTabControl.axaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.axaml.cs)
</cite>
## Table of Contents
1. [Introduction](#introduction)
2. [Project Structure](#project-structure)
3. [Core Components](#core-components)
4. [Architecture Overview](#architecture-overview)
5. [Detailed Component Analysis](#detailed-component-analysis)
6. [Dependency Analysis](#dependency-analysis)
7. [Performance Considerations](#performance-considerations)
8. [Troubleshooting Guide](#troubleshooting-guide)
9. [Conclusion](#conclusion)
10. [Appendices](#appendices)
## Introduction
This document explains the basic Dress Manager functionality in ClassicAssist.Avalonia. It focuses on how to create your first dress set, understand the item slot system (Body, Head, Arms, Legs, etc.), and manage equipment configurations. You will learn about the core data structures (DressAgentEntry and DressAgentItem), how they relate to each other, and how the UI guides you through creating, editing, and saving dress sets. Step-by-step tutorials cover common scenarios such as setting up combat gear, casual outfits, and profession-specific equipment. Finally, a troubleshooting section addresses typical issues like missing items, invalid slots, and inventory requirements.
## Project Structure
The Dress Manager spans both shared logic and Avalonia UI layers:
- Shared domain models and manager live under ClassicAssist.Shared/Data/Dress.
- The Avalonia view model and views for the Dress tab are under ClassicAssist.Shared/UI/ViewModels/Agents and ClassicAssist.Avalonia/Views/Agents respectively.
```mermaid
graph TB
subgraph "Shared Domain"
DAE["DressAgentEntry"]
DAI["DressAgentItem"]
DAT["DressAgentItemType"]
DM["DressManager"]
end
subgraph "UI Layer (Avalonia)"
VM["DressTabViewModel"]
VAXAML["DressTabControl.axaml"]
VCX["DressTabControl.axaml.cs"]
end
DAE --> DAI
DAE --> DAT
DM --> DAE
VM --> DM
VCX --> VM
VAXAML --> VCX
```
**Diagram sources**
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [DressTabControl.axaml](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.axaml)
- [DressTabControl.axaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.axaml.cs)
**Section sources**
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [DressTabControl.axaml](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.axaml)
- [DressTabControl.axaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.axaml.cs)
## Core Components
- DressAgentEntry: Represents a single dress set configuration. It contains metadata (such as name) and a collection of DressAgentItem entries that define what to equip per slot.
- DressAgentItem: Describes one item assignment within a dress set, including target slot and item selection criteria.
- DressAgentItemType: Enumerates valid equipment slots (e.g., Body, Head, Arms, Legs).
- DressManager: Orchestrates loading, saving, and applying dress sets. It exposes operations to add/remove entries, persist configurations, and apply them to the game state.
- DressTabViewModel: Binds the UI to the underlying data and manager, exposing commands and collections for creating, editing, and saving dress sets.
- DressTabControl (axaml + code-behind): The Avalonia user interface where users select or create dress sets, choose slots, pick items, and save changes.
Key responsibilities:
- Data modeling: DressAgentEntry and DressAgentItem define the structure of saved dress sets.
- Slot system: DressAgentItemType defines allowed slots and constraints.
- Persistence and application: DressManager handles storage and execution of dress actions.
- User interaction: DressTabViewModel and DressTabControl provide the UI workflow.
**Section sources**
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [DressTabControl.axaml](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.axaml)
- [DressTabControl.axaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.axaml.cs)
## Architecture Overview
The Dress Manager follows a layered architecture:
- UI layer (Avalonia): DressTabControl presents the interface; its code-behind wires events to the view model.
- View Model layer: DressTabViewModel coordinates user actions, updates collections, and delegates to the manager.
- Domain layer: DressAgentEntry, DressAgentItem, and DressAgentItemType define the data model and rules.
- Service layer: DressManager provides persistence and application logic.
```mermaid
sequenceDiagram
participant U as "User"
participant V as "DressTabControl.axaml.cs"
participant VM as "DressTabViewModel"
participant M as "DressManager"
participant E as "DressAgentEntry"
participant I as "DressAgentItem"
U->>V : Open Dress Tab
V->>VM : Initialize bindings
U->>VM : Create new dress set
VM->>M : Add new entry
M-->>VM : New DressAgentEntry
U->>VM : Select slot and item
VM->>I : Configure item for slot
VM->>E : Add item to entry
U->>VM : Save dress set
VM->>M : Persist entry
M-->>VM : Success
U->>VM : Apply dress set
VM->>M : Apply entry
M-->>U : Equip items
```
**Diagram sources**
- [DressTabControl.axaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.axaml.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
## Detailed Component Analysis
### Data Model: DressAgentEntry and DressAgentItem
- DressAgentEntry holds a list of DressAgentItem objects and identifies the dress set.
- DressAgentItem specifies which slot to fill and how to identify the desired item.
- DressAgentItemType enumerates all supported slots and constrains valid assignments.
```mermaid
classDiagram
class DressAgentEntry {
+Name
+Items
+AddItem(item)
+RemoveItem(index)
+Clear()
}
class DressAgentItem {
+Slot
+Criteria
+IsValid()
}
class DressAgentItemType {
<<enumeration>>
+Body
+Head
+Arms
+Legs
+...
}
DressAgentEntry --> DressAgentItem : "contains many"
DressAgentItem --> DressAgentItemType : "uses"
```
**Diagram sources**
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
**Section sources**
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
### Manager: DressManager
DressManager centralizes:
- Loading existing dress sets from storage.
- Saving updated dress sets.
- Applying a selected dress set by equipping items according to their slots.
- Validating entries before application.
```mermaid
flowchart TD
Start(["Apply Dress Set"]) --> LoadEntry["Load DressAgentEntry"]
LoadEntry --> ValidateSlots{"All slots valid?"}
ValidateSlots --> |No| Error["Return validation error"]
ValidateSlots --> |Yes| Iterate["Iterate DressAgentItem list"]
Iterate --> CheckInventory["Check item availability"]
CheckInventory --> Found{"Item found?"}
Found --> |No| Missing["Record missing item"]
Found --> |Yes| Equip["Equip item to slot"]
Equip --> Next{"More items?"}
Next --> |Yes| Iterate
Next --> |No| Done(["Complete"])
Missing --> Next
```
**Diagram sources**
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
**Section sources**
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
### UI: DressTabControl and DressTabViewModel
- DressTabControl.axaml defines the layout and controls for selecting dress sets, managing slots, and adding items.
- DressTabControl.axaml.cs binds UI events to the view model.
- DressTabViewModel exposes properties and commands for:
- Creating new dress sets.
- Adding/removing items to/from slots.
- Saving and applying configurations.
- Handling validation feedback.
```mermaid
sequenceDiagram
participant U as "User"
participant AX as "DressTabControl.axaml"
participant CS as "DressTabControl.axaml.cs"
participant VM as "DressTabViewModel"
participant M as "DressManager"
U->>AX : Click "New Dress Set"
AX->>CS : Event handler
CS->>VM : Command_NewSet()
VM->>M : Create new entry
M-->>VM : Entry reference
U->>AX : Choose slot and item
AX->>CS : Selection changed
CS->>VM : AddItem(slot, criteria)
VM->>M : Save current entry
M-->>VM : Persisted
U->>AX : Click "Apply"
AX->>CS : Apply command
CS->>VM : ApplySelectedEntry()
VM->>M : Apply(entry)
M-->>U : Items equipped
```
**Diagram sources**
- [DressTabControl.axaml](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.axaml)
- [DressTabControl.axaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.axaml.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
**Section sources**
- [DressTabControl.axaml](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.axaml)
- [DressTabControl.axaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.axaml.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
## Dependency Analysis
The following diagram shows key dependencies between components involved in the Dress Manager:
```mermaid
graph LR
VM["DressTabViewModel"] --> DM["DressManager"]
DM --> DAE["DressAgentEntry"]
DM --> DAI["DressAgentItem"]
DAE --> DAI
DAI --> DAT["DressAgentItemType"]
VCX["DressTabControl.axaml.cs"] --> VM
VAX["DressTabControl.axaml"] --> VCX
```
**Diagram sources**
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
- [DressTabControl.axaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.axaml.cs)
- [DressTabControl.axaml](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.axaml)
**Section sources**
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
- [DressTabControl.axaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.axaml.cs)
- [DressTabControl.axaml](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.axaml)
## Performance Considerations
- Keep dress sets lean: Only include necessary slots to minimize application time.
- Prefer specific item criteria: Narrowing down item selection reduces search overhead during application.
- Batch operations: When building complex outfits, add multiple items before applying to reduce repeated saves and checks.
- Avoid frequent saves: Group edits and save once after completing a dress set.
[No sources needed since this section provides general guidance]
## Troubleshooting Guide
Common issues and resolutions:
- Missing items: Ensure required items exist in your backpack or on your character before applying. If an item is not found, the manager will skip it or report an error depending on implementation.
- Invalid slots: Verify that the chosen item type matches the intended slot (e.g., do not assign a shield to a head slot). Use DressAgentItemType to constrain valid assignments.
- Inventory requirements: Some items may require being held or visible in inventory. Confirm the item is accessible when applying.
- Conflicting slots: Certain slots cannot be occupied simultaneously. Remove conflicting items before applying a new set.
- Persistence problems: If changes do not persist, ensure you clicked Save and that the file path has write permissions.
**Section sources**
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
## Conclusion
The Dress Manager in ClassicAssist.Avalonia provides a structured way to organize and automate equipment setups. By understanding DressAgentEntry, DressAgentItem, and DressAgentItemType, and using the UI provided by DressTabControl and DressTabViewModel, you can efficiently create, edit, and apply dress sets for various scenarios. Follow the step-by-step tutorials below to get started quickly and troubleshoot common issues effectively.
[No sources needed since this section summarizes without analyzing specific files]
## Appendices
### Tutorial: Create Your First Dress Set
- Open the Dress tab in the main window.
- Click “New Dress Set” to create a fresh entry.
- Name your dress set (e.g., “Combat Gear”).
- For each slot (Body, Head, Arms, Legs, etc.):
- Select the slot from the dropdown.
- Choose the desired item using the item picker.
- Confirm the item meets any special requirements (hue, properties).
- Click “Save” to persist the dress set.
- Click “Apply” to equip the items immediately.
**Section sources**
- [DressTabControl.axaml](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.axaml)
- [DressTabControl.axaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.axaml.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
### Tutorial: Set Up Combat Gear
- Create a dress set named “Combat Gear”.
- Assign weapon to the appropriate hand slot.
- Assign armor pieces to Body, Arms, and Legs.
- Add helmet and gloves if available.
- Save and test by applying while in safe zones.
**Section sources**
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
### Tutorial: Casual Outfit
- Create a dress set named “Casual”.
- Choose non-combat clothing for Body, Head, and Legs.
- Optionally exclude weapons and shields.
- Save and apply for everyday use.
**Section sources**
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
### Tutorial: Profession-Specific Equipment
- Identify profession needs (e.g., tinkerer tools, mage focus).
- Create a dress set tailored to those items.
- Assign relevant tools or accessories to appropriate slots.
- Save and apply when performing profession tasks.
**Section sources**
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
@@ -0,0 +1,361 @@
# Dress Manager
<cite>
**Referenced Files in This Document**
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [DressTabControl.axaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.axaml.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist/Views/Agents/DressTabControl.xaml.cs)
- [DressAgentTests.cs](file://ClassicAssist.Tests/Agents/DressAgentTests.cs)
</cite>
## Table of Contents
1. [Introduction](#introduction)
2. [Project Structure](#project-structure)
3. [Core Components](#core-components)
4. [Architecture Overview](#architecture-overview)
5. [Detailed Component Analysis](#detailed-component-analysis)
6. [Dependency Analysis](#dependency-analysis)
7. [Performance Considerations](#performance-considerations)
8. [Troubleshooting Guide](#troubleshooting-guide)
9. [Conclusion](#conclusion)
## Introduction
The Dress Manager feature enables players to create and switch between predefined outfit configurations (dress sets). Each set defines a mapping from equipment slots to specific items, with optional conditions for automatic switching. The system supports multiple item types such as Body, Head, Arms, Legs, and more, allowing tailored setups for combat, casual wear, or profession-specific tasks.
## Project Structure
The Dress Manager spans shared data models, the manager logic, UI view models, and Avalonia/WPF views:
- Shared data layer: structures and enums defining dress entries, items, and item types; the core manager orchestrating operations.
- UI layer: Avalonia and WPF tabs that present the interface for creating and managing dress sets.
- Tests: unit tests validating behavior and edge cases.
```mermaid
graph TB
subgraph "Shared Data"
Entry["DressAgentEntry"]
Item["DressAgentItem"]
ItemType["DressAgentItemType"]
Manager["DressManager"]
end
subgraph "UI - Avalonia"
VM_Ava["DressTabViewModel"]
Tab_Ava["DressTabControl.axaml.cs"]
end
subgraph "UI - WPF"
Tab_WPF["DressTabControl.xaml.cs"]
end
subgraph "Tests"
Tests["DressAgentTests.cs"]
end
VM_Ava --> Manager
Tab_Ava --> VM_Ava
Tab_WPF --> VM_Ava
Manager --> Entry
Manager --> Item
Manager --> ItemType
Tests --> Manager
```
**Diagram sources**
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [DressTabControl.axaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.axaml.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist/Views/Agents/DressTabControl.xaml.cs)
- [DressAgentTests.cs](file://ClassicAssist.Tests/Agents/DressAgentTests.cs)
**Section sources**
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [DressTabControl.axaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.axaml.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist/Views/Agents/DressTabControl.xaml.cs)
- [DressAgentTests.cs](file://ClassicAssist.Tests/Agents/DressAgentTests.cs)
## Core Components
- DressAgentEntry: Represents a named dress set containing a list of slot-to-item mappings and optional switching conditions.
- DressAgentItem: Describes a single slot assignment within a set, including target slot and item selection criteria.
- DressAgentItemType: Enumerates supported equipment categories (e.g., Body, Head, Arms, Legs, etc.) used to map items to character slots.
- DressManager: Provides methods to add/remove/update sets, evaluate conditions, and perform equip/unequip actions across inventory and equipped layers.
Key responsibilities:
- Set management: CRUD operations on dress sets.
- Slot mapping: Associate items with specific equipment slots.
- Conditional switching: Evaluate environment or state-based rules to auto-switch sets.
- Execution: Equip/unequip items according to the active set.
**Section sources**
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
## Architecture Overview
The UI binds to a ViewModel which delegates to the DressManager. The manager reads the active set, validates items against inventory/equipment, and issues commands to apply changes. Conditions are evaluated before applying a set automatically.
```mermaid
sequenceDiagram
participant User as "User"
participant UI as "DressTabControl"
participant VM as "DressTabViewModel"
participant Mgr as "DressManager"
participant Game as "Game Engine"
User->>UI : Open Dress tab
UI->>VM : Load sets and current state
VM->>Mgr : GetSets() / GetCurrentSet()
Mgr-->>VM : Sets + Active
VM-->>UI : Bind collections
User->>UI : Select a set
UI->>VM : ApplySet(setId)
VM->>Mgr : EvaluateConditions(set)
Mgr-->>VM : CanApply?
alt Conditions met
VM->>Mgr : ApplySet(set)
Mgr->>Game : Unequip conflicting items
Mgr->>Game : Equip items per slot
Mgr-->>VM : Success/Failure
VM-->>UI : Update status
else Conditions not met
VM-->>UI : Show reason
end
```
**Diagram sources**
- [DressTabControl.axaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.axaml.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist/Views/Agents/DressTabControl.xaml.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
## Detailed Component Analysis
### Data Model: DressAgentEntry, DressAgentItem, DressAgentItemType
- DressAgentEntry holds:
- A unique identifier and display name for the set.
- A collection of DressAgentItem entries describing each slot assignment.
- Optional fields for enabling/disabling the set and any metadata needed by conditions.
- DressAgentItem holds:
- Target slot type (from DressAgentItemType).
- Selection criteria for the item (e.g., by ID, properties, or other filters).
- DressAgentItemType enumerates supported equipment categories such as Body, Head, Arms, Legs, and others used by the game’s equipment layers.
```mermaid
classDiagram
class DressAgentEntry {
+string Id
+string Name
+bool Enabled
+DressAgentItem[] Items
}
class DressAgentItem {
+DressAgentItemType SlotType
+object ItemCriteria
}
class DressAgentItemType {
<<enumeration>>
+Body
+Head
+Arms
+Legs
+...
}
DressAgentEntry "1" o--> "*" DressAgentItem : "contains"
DressAgentItem --> DressAgentItemType : "uses"
```
**Diagram sources**
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
**Section sources**
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
### Manager Logic: DressManager
Responsibilities:
- Manage the collection of dress sets and persistence.
- Determine the currently active set based on user selection or automatic conditions.
- Validate whether an item exists in inventory or can be obtained.
- Execute equip/unequip operations respecting slot conflicts and priorities.
- Provide hooks for condition evaluation to support automatic switching.
Operational flow highlights:
- Add/Set operations update internal collections and notify UI via the ViewModel.
- ApplySet performs validation, resolves items to concrete objects, and applies changes.
- Condition evaluation checks contextual factors (e.g., location, skill level, time) before auto-applying a set.
```mermaid
flowchart TD
Start(["Start ApplySet"]) --> Validate["Validate set and items"]
Validate --> Valid{"All items valid?"}
Valid -- No --> Error["Return error with details"]
Valid -- Yes --> Resolve["Resolve items to targets"]
Resolve --> Conflicts{"Conflicting equipped items?"}
Conflicts -- Yes --> Unequip["Unequip conflicting items"]
Conflicts -- No --> SkipUnequip["Skip unequip"]
Unequip --> Equip["Equip items per slot"]
SkipUnequip --> Equip
Equip --> Done(["Complete"])
Error --> Done
```
**Diagram sources**
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
**Section sources**
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
### UI Layer: DressTabControl and DressTabViewModel
- DressTabControl (Avalonia and WPF variants): Hosts the Dress Manager UI, binds to the ViewModel, and handles user interactions like selecting sets and triggering apply actions.
- DressTabViewModel: Exposes observable collections of sets, selected set, and status messages. It calls into DressManager for operations and updates UI state accordingly.
User workflow:
- Create a new set by adding entries for desired slots.
- Configure item selection criteria for each slot.
- Optionally enable automatic switching by setting conditions.
- Apply a set manually or rely on automatic triggers.
```mermaid
sequenceDiagram
participant View as "DressTabControl"
participant VM as "DressTabViewModel"
participant Mgr as "DressManager"
View->>VM : OnCreateSet()
VM->>Mgr : CreateNewSet()
Mgr-->>VM : New set reference
VM-->>View : Refresh list
View->>VM : OnAddSlot(slotType, criteria)
VM->>Mgr : AddItemToSet(setId, item)
Mgr-->>VM : Updated set
VM-->>View : Rebind grid
View->>VM : OnApplySet(setId)
VM->>Mgr : ApplySet(setId)
Mgr-->>VM : Result
VM-->>View : Show success/failure
```
**Diagram sources**
- [DressTabControl.axaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.axaml.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist/Views/Agents/DressTabControl.xaml.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
**Section sources**
- [DressTabControl.axaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.axaml.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist/Views/Agents/DressTabControl.xaml.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
### Item Types and Slot Mapping
Supported item types include common equipment categories such as Body, Head, Arms, Legs, and others defined by the enumeration. Each type maps to a corresponding equipment layer in the game client. When building a set, ensure the chosen item is compatible with the selected slot type.
Behavioral notes:
- Some slots may have precedence rules (e.g., headgear vs. helm).
- Certain items may require prerequisites (skills, quests) to be equippable.
- Auto-switching should consider these constraints to avoid invalid states.
**Section sources**
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
### Conditional Switching Logic
Automatic switching evaluates conditions before applying a set. Typical conditions include:
- Location or region checks.
- Skill thresholds.
- Time of day or season.
- Player state flags (e.g., mounted, in combat).
The manager exposes evaluation points so the UI can preview applicability and provide feedback when conditions are not met.
**Section sources**
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
### Examples and Use Cases
- Combat gear: Equip high-defense Body, Head, Arms, and Legs items; optionally include weapon/shield slots if supported.
- Casual wear: Lower-stat clothing for social areas or roleplay.
- Profession-specific outfits: Items optimized for crafting, mining, or fishing activities.
Tips:
- Keep sets focused on distinct scenarios to minimize conflicts.
- Use clear naming conventions for quick identification.
- Validate availability before relying on auto-switching.
[No sources needed since this section provides general guidance]
## Dependency Analysis
The following diagram shows how components depend on each other:
```mermaid
graph LR
VM["DressTabViewModel"] --> Mgr["DressManager"]
TabAva["DressTabControl.axaml.cs"] --> VM
TabWpf["DressTabControl.xaml.cs"] --> VM
Mgr --> Entry["DressAgentEntry"]
Mgr --> Item["DressAgentItem"]
Mgr --> Type["DressAgentItemType"]
Tests["DressAgentTests.cs"] --> Mgr
```
**Diagram sources**
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [DressTabControl.axaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.axaml.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist/Views/Agents/DressTabControl.xaml.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
- [DressAgentTests.cs](file://ClassicAssist.Tests/Agents/DressAgentTests.cs)
**Section sources**
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [DressTabControl.axaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.axaml.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist/Views/Agents/DressTabControl.xaml.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
- [DressAgentTests.cs](file://ClassicAssist.Tests/Agents/DressAgentTests.cs)
## Performance Considerations
- Minimize repeated evaluations of conditions by caching results where appropriate.
- Batch equip/unequip operations to reduce network overhead.
- Avoid heavy item resolution during UI rendering; defer to background threads if necessary.
- Prefer precise item selection criteria to reduce search space.
[No sources needed since this section provides general guidance]
## Troubleshooting Guide
Common issues and resolutions:
- Missing or unavailable equipment:
- Ensure required items exist in your backpack or on the character.
- Verify item compatibility with the selected slot type.
- Check prerequisites such as skills or quest requirements.
- Automatic switching not triggering:
- Review condition definitions for correctness and completeness.
- Confirm that the environment/state matches expected values.
- Conflicting equipped items:
- Remove or replace conflicting items before applying a set.
- Adjust set composition to avoid overlapping slots.
- UI not reflecting changes:
- Refresh the view model bindings after applying a set.
- Inspect status messages returned by the manager for errors.
Validation tips:
- Test sets in safe zones first.
- Use manual application before enabling auto-switching.
- Keep backups of critical sets.
**Section sources**
- [DressAgentTests.cs](file://ClassicAssist.Tests/Agents/DressAgentTests.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
## Conclusion
The Dress Manager provides a robust system for organizing and automating outfit changes through well-defined data structures and a clear separation between UI and logic. By leveraging slot mappings, item types, and conditional switching, players can streamline transitions between combat, casual, and profession-specific gear while maintaining control over inventory requirements and validation.
[No sources needed since this section summarizes without analyzing specific files]
@@ -0,0 +1,443 @@
# Item Management & Validation
<cite>
**Referenced Files in This Document**
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.xaml.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist/Views/Agents/DressTabControl.xaml.cs)
- [HuePickerWindow.axaml.cs](file://ClassicAssist.Avalonia/Views/HuePickerWindow.axaml.cs)
- [HueEntryControl.xaml.cs](file://ClassicAssist/UI/Controls/HueEntryControl.xaml.cs)
- [EntityCollectionFilter.cs](file://ClassicAssist/UI/Models/EntityCollectionFilter.cs)
- [Property.cs](file://ClassicAssist.Shared/UO/Objects/Property.cs)
- [Item.cs](file://ClassicAssist.Shared/UO/Objects/Item.cs)
- [PlayerMobile.cs](file://ClassicAssist.Shared/UO/Objects/PlayerMobile.cs)
</cite>
## Table of Contents
1. [Introduction](#introduction)
2. [Project Structure](#project-structure)
3. [Core Components](#core-components)
4. [Architecture Overview](#architecture-overview)
5. [Detailed Component Analysis](#detailed-component-analysis)
6. [Dependency Analysis](#dependency-analysis)
7. [Performance Considerations](#performance-considerations)
8. [Troubleshooting Guide](#troubleshooting-guide)
9. [Conclusion](#conclusion)
10. [Appendices](#appendices)
## Introduction
This document explains how the Dress Manager validates items against intended slots, handles item properties and requirements, and manages dependencies across dress sets. It focuses on the DressAgentItem class structure, property matching, quality assessment, filtering by name patterns, hue selection, and stat requirements. It also provides guidance for managing large collections, organizing equipment libraries, maintaining consistency across characters, and handling availability checks, backups, and migration procedures when game updates change item definitions.
## Project Structure
The Dress Manager is implemented primarily in the shared data layer with UI bindings in both WPF and Avalonia views. The key files include:
- Data models and managers for dress entries and items
- View models that bind UI to the manager logic
- UI controls for hue selection and entity filtering
- Game object abstractions for items, properties, and player state
```mermaid
graph TB
subgraph "Shared Data"
DAI["DressAgentItem.cs"]
DM["DressManager.cs"]
DAE["DressAgentEntry.cs"]
DT["DressAgentItemType.cs"]
end
subgraph "UI (Avalonia)"
DTV_A["DressTabViewModel.cs"]
DTC_A["DressTabControl.xaml.cs"]
HPW_A["HuePickerWindow.axaml.cs"]
end
subgraph "UI (WPF)"
DTC_W["DressTabControl.xaml.cs"]
HEC_W["HueEntryControl.xaml.cs"]
end
subgraph "Game Objects"
ITM["Item.cs"]
PROP["Property.cs"]
PM["PlayerMobile.cs"]
end
DAI --> DM
DAE --> DM
DT --> DAI
DTV_A --> DM
DTC_A --> DTV_A
DTC_W --> DTV_A
HPW_A --> DTV_A
HEC_W --> DTV_A
DAI --> ITM
DAI --> PROP
DAI --> PM
```
**Diagram sources**
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.xaml.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist/Views/Agents/DressTabControl.xaml.cs)
- [HuePickerWindow.axaml.cs](file://ClassicAssist.Avalonia/Views/HuePickerWindow.axaml.cs)
- [HueEntryControl.xaml.cs](file://ClassicAssist/UI/Controls/HueEntryControl.xaml.cs)
- [Item.cs](file://ClassicAssist.Shared/UO/Objects/Item.cs)
- [Property.cs](file://ClassicAssist.Shared/UO/Objects/Property.cs)
- [PlayerMobile.cs](file://ClassicAssist.Shared/UO/Objects/PlayerMobile.cs)
**Section sources**
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.xaml.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist/Views/Agents/DressTabControl.xaml.cs)
- [HuePickerWindow.axaml.cs](file://ClassicAssist.Avalonia/Views/HuePickerWindow.axaml.cs)
- [HueEntryControl.xaml.cs](file://ClassicAssist/UI/Controls/HueEntryControl.xaml.cs)
- [Item.cs](file://ClassicAssist.Shared/UO/Objects/Item.cs)
- [Property.cs](file://ClassicAssist.Shared/UO/Objects/Property.cs)
- [PlayerMobile.cs](file://ClassicAssist.Shared/UO/Objects/PlayerMobile.cs)
## Core Components
- DressAgentItem: Represents a single dress entry with slot targeting, item criteria, hue preferences, and optional filters. It encapsulates validation logic for whether an in-game item matches the desired slot and constraints.
- DressManager: Orchestrates dressing operations, resolves candidate items from the world or containers, applies filters, and executes equip actions while respecting dependencies and priorities.
- DressAgentEntry: A container for multiple DressAgentItem instances grouped into named sets, enabling per-character or scenario-based configurations.
- DressAgentItemType: Enumerates valid target slots (e.g., head, chest, legs) used to validate item-slot compatibility.
- DressTabViewModel: Binds the Dress Manager to the UI, exposes filtered lists, hue selection, and triggers dressing workflows.
- Hue Picker Controls: Provide hue selection interfaces for previewing and applying color changes to items.
- Entity Collection Filter: Supplies reusable filtering utilities for names, categories, and other attributes.
- Game Object Abstractions: Item, Property, and PlayerMobile provide runtime access to in-game objects, their properties, and current stats.
Key responsibilities:
- Slot validation: Ensure items are appropriate for the intended slot using type and layer information.
- Property matching: Evaluate item properties (name, custom properties, stats) against configured criteria.
- Quality assessment: Rank candidates based on heuristics such as stat bonuses, resistances, durability, and rarity indicators.
- Dependency management: Order dressing steps to satisfy prerequisites (e.g., base armor before layered pieces).
- Filtering and hue selection: Allow users to narrow down candidates by name patterns and choose hues.
**Section sources**
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [HuePickerWindow.axaml.cs](file://ClassicAssist.Avalonia/Views/HuePickerWindow.axaml.cs)
- [HueEntryControl.xaml.cs](file://ClassicAssist/UI/Controls/HueEntryControl.xaml.cs)
- [EntityCollectionFilter.cs](file://ClassicAssist/UI/Models/EntityCollectionFilter.cs)
- [Item.cs](file://ClassicAssist.Shared/UO/Objects/Item.cs)
- [Property.cs](file://ClassicAssist.Shared/UO/Objects/Property.cs)
- [PlayerMobile.cs](file://ClassicAssist.Shared/UO/Objects/PlayerMobile.cs)
## Architecture Overview
The Dress Manager integrates UI interactions with core logic and game state. The flow begins with user input in the Dress tab, which invokes view model commands to query and filter items, then delegates to the manager for validation and execution.
```mermaid
sequenceDiagram
participant User as "User"
participant UI as "DressTabControl"
participant VM as "DressTabViewModel"
participant Mgr as "DressManager"
participant Model as "DressAgentItem"
participant Game as "Item/Property/PlayerMobile"
User->>UI : Open Dress Tab / Select Set
UI->>VM : Load set and display candidates
VM->>Mgr : Request candidates for set
Mgr->>Model : Iterate entries and apply filters
Model->>Game : Read item properties and stats
Model-->>Mgr : Match results with scores
Mgr->>Mgr : Resolve dependencies and order steps
Mgr-->>VM : Return ordered candidates
VM-->>UI : Render list with hue options
User->>UI : Choose item/hue and confirm
UI->>VM : Execute dress action
VM->>Mgr : Equip selected item(s)
Mgr->>Game : Perform equip and update state
Game-->>VM : Confirm success/failure
VM-->>UI : Update UI feedback
```
**Diagram sources**
- [DressTabControl.xaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.xaml.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist/Views/Agents/DressTabControl.xaml.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [Item.cs](file://ClassicAssist.Shared/UO/Objects/Item.cs)
- [Property.cs](file://ClassicAssist.Shared/UO/Objects/Property.cs)
- [PlayerMobile.cs](file://ClassicAssist.Shared/UO/Objects/PlayerMobile.cs)
## Detailed Component Analysis
### DressAgentItem Class Structure and Behavior
DressAgentItem defines the contract for a single dress rule:
- Target slot: Uses DressAgentItemType to specify the intended body layer.
- Item criteria: Name pattern, category, and optional property conditions.
- Hue preference: Optional hue value for preview and application.
- Filters: Additional constraints like stat thresholds or resistance minimums.
- Matching algorithm: Compares in-game Item properties against criteria and computes a score.
- Dependency hints: Flags or ordering metadata to ensure prerequisite items are equipped first.
```mermaid
classDiagram
class DressAgentItem {
+TargetSlot
+NamePattern
+Category
+HuePreference
+Filters
+Match(item) bool
+Score(item) float
+Dependencies() string[]
}
class DressAgentItemType {
<<enumeration>>
Head
Chest
Legs
Feet
Hands
Neck
Waist
Arms
Ears
Face
Ring
Bracelet
Back
Wings
MountArmor
}
class Item {
+Serial
+Layer
+Properties
+Stats
}
class Property {
+Name
+Value
}
DressAgentItem --> DressAgentItemType : "uses"
DressAgentItem --> Item : "matches"
Item --> Property : "has"
```
**Diagram sources**
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
- [Item.cs](file://ClassicAssist.Shared/UO/Objects/Item.cs)
- [Property.cs](file://ClassicAssist.Shared/UO/Objects/Property.cs)
**Section sources**
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
- [Item.cs](file://ClassicAssist.Shared/UO/Objects/Item.cs)
- [Property.cs](file://ClassicAssist.Shared/UO/Objects/Property.cs)
### Property Matching and Quality Assessment
- Property matching evaluates:
- Name pattern: Supports substring or regex-like patterns for flexible naming.
- Custom properties: Checks specific property names/values (e.g., resistances, skill bonuses).
- Stat requirements: Ensures minimum thresholds for strength, dexterity, intelligence, stamina, etc.
- Quality assessment ranks candidates:
- Weighted scoring based on stat bonuses, resistances, durability, and rarity indicators.
- Penalizes missing prerequisites or incompatible layers.
- Considers hue preference if specified.
```mermaid
flowchart TD
Start(["Start Match"]) --> GetItem["Load Item Properties"]
GetItem --> CheckSlot{"Slot Compatible?"}
CheckSlot --> |No| Reject["Reject Candidate"]
CheckSlot --> |Yes| CheckName["Check Name Pattern"]
CheckName --> NameOK{"Name Matches?"}
NameOK --> |No| Reject
NameOK --> |Yes| CheckProps["Evaluate Custom Properties"]
CheckProps --> PropsOK{"All Required Properties Met?"}
PropsOK --> |No| Reject
PropsOK --> |Yes| CheckStats["Verify Stat Requirements"]
CheckStats --> StatsOK{"Stats Sufficient?"}
StatsOK --> |No| Reject
StatsOK --> |Yes| Score["Compute Quality Score"]
Score --> Accept["Accept Candidate"]
Reject --> End(["End"])
Accept --> End
```
**Diagram sources**
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [Property.cs](file://ClassicAssist.Shared/UO/Objects/Property.cs)
- [Item.cs](file://ClassicAssist.Shared/UO/Objects/Item.cs)
**Section sources**
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [Property.cs](file://ClassicAssist.Shared/UO/Objects/Property.cs)
- [Item.cs](file://ClassicAssist.Shared/UO/Objects/Item.cs)
### Managing Dependencies Across Dress Sets
- Dependencies ensure prerequisite items are equipped before dependent ones (e.g., base armor before layered pieces).
- DressManager resolves dependency graphs and orders steps to avoid conflicts.
- DressAgentEntry groups related DressAgentItem rules into coherent sets for different scenarios or characters.
```mermaid
graph LR
Entry["DressAgentEntry"] --> Rule1["DressAgentItem (Base Armor)"]
Entry --> Rule2["DressAgentItem (Layered Armor)"]
Entry --> Rule3["DressAgentItem (Accessories)"]
Rule2 --> |depends on| Rule1
Rule3 --> |depends on| Rule1
```
**Diagram sources**
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
**Section sources**
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
### UI Integration: Filtering, Hue Selection, and Execution
- DressTabViewModel binds DressManager to the UI, exposing filtered lists and hue options.
- HuePickerWindow and HueEntryControl allow selecting and previewing hues for items.
- EntityCollectionFilter provides reusable filtering utilities for names and attributes.
```mermaid
sequenceDiagram
participant UI as "DressTabControl"
participant VM as "DressTabViewModel"
participant HPW as "HuePickerWindow"
participant HE as "HueEntryControl"
participant Mgr as "DressManager"
UI->>VM : Apply filters and load set
VM->>Mgr : Query candidates
VM-->>UI : Display candidates
UI->>HPW : Open hue picker
HPW-->>VM : Selected hue
VM->>HE : Bind hue control
UI->>VM : Confirm dress action
VM->>Mgr : Execute dress with hue
Mgr-->>VM : Result feedback
VM-->>UI : Update UI
```
**Diagram sources**
- [DressTabControl.xaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.xaml.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist/Views/Agents/DressTabControl.xaml.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [HuePickerWindow.axaml.cs](file://ClassicAssist.Avalonia/Views/HuePickerWindow.axaml.cs)
- [HueEntryControl.xaml.cs](file://ClassicAssist/UI/Controls/HueEntryControl.xaml.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
**Section sources**
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.xaml.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist/Views/Agents/DressTabControl.xaml.cs)
- [HuePickerWindow.axaml.cs](file://ClassicAssist.Avalonia/Views/HuePickerWindow.axaml.cs)
- [HueEntryControl.xaml.cs](file://ClassicAssist/UI/Controls/HueEntryControl.xaml.cs)
- [EntityCollectionFilter.cs](file://ClassicAssist/UI/Models/EntityCollectionFilter.cs)
## Dependency Analysis
The Dress Manager depends on game object abstractions and UI components. Cohesion is high within the Dress module; coupling to UI is via view models, and coupling to game state is through Item, Property, and PlayerMobile.
```mermaid
graph TB
DM["DressManager.cs"] --> DAI["DressAgentItem.cs"]
DM --> DAE["DressAgentEntry.cs"]
DAI --> DT["DressAgentItemType.cs"]
DAI --> ITM["Item.cs"]
DAI --> PROP["Property.cs"]
DAI --> PM["PlayerMobile.cs"]
DTV["DressTabViewModel.cs"] --> DM
DTC_A["DressTabControl.xaml.cs (Avalonia)"] --> DTV
DTC_W["DressTabControl.xaml.cs (WPF)"] --> DTV
HPW["HuePickerWindow.axaml.cs"] --> DTV
HEC["HueEntryControl.xaml.cs"] --> DTV
```
**Diagram sources**
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.xaml.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist/Views/Agents/DressTabControl.xaml.cs)
- [HuePickerWindow.axaml.cs](file://ClassicAssist.Avalonia/Views/HuePickerWindow.axaml.cs)
- [HueEntryControl.xaml.cs](file://ClassicAssist/UI/Controls/HueEntryControl.xaml.cs)
- [Item.cs](file://ClassicAssist.Shared/UO/Objects/Item.cs)
- [Property.cs](file://ClassicAssist.Shared/UO/Objects/Property.cs)
- [PlayerMobile.cs](file://ClassicAssist.Shared/UO/Objects/PlayerMobile.cs)
**Section sources**
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressAgentEntry.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentEntry.cs)
- [DressAgentItemType.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItemType.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist.Avalonia/Views/Agents/DressTabControl.xaml.cs)
- [DressTabControl.xaml.cs](file://ClassicAssist/Views/Agents/DressTabControl.xaml.cs)
- [HuePickerWindow.axaml.cs](file://ClassicAssist.Avalonia/Views/HuePickerWindow.axaml.cs)
- [HueEntryControl.xaml.cs](file://ClassicAssist/UI/Controls/HueEntryControl.xaml.cs)
- [Item.cs](file://ClassicAssist.Shared/UO/Objects/Item.cs)
- [Property.cs](file://ClassicAssist.Shared/UO/Objects/Property.cs)
- [PlayerMobile.cs](file://ClassicAssist.Shared/UO/Objects/PlayerMobile.cs)
## Performance Considerations
- Batch queries: When evaluating many candidates, prefer batched property reads to reduce overhead.
- Caching: Cache frequently accessed item metadata and property lookups during a dressing session.
- Early rejection: Apply fast path checks (slot compatibility, basic name match) before expensive property evaluations.
- Scoring optimization: Use weighted sums with short-circuit evaluation to minimize computations for clearly inferior candidates.
- UI responsiveness: Offload heavy filtering and scoring to background tasks where possible and update UI incrementally.
[No sources needed since this section provides general guidance]
## Troubleshooting Guide
Common issues and resolutions:
- Item not found or unavailable:
- Verify inventory/container visibility and ensure the item exists in the expected location.
- Check slot compatibility and layer restrictions.
- Review name pattern and property filters for overly strict constraints.
- Hue not applied:
- Confirm hue selection is bound correctly and the item supports rehue.
- Validate that the hue picker window returns a valid hue value.
- Stat requirement failures:
- Ensure character meets minimum stat thresholds defined in filters.
- Reassess scoring weights if required stats are too aggressive.
- Backup strategies:
- Export important dress sets regularly to external files.
- Maintain versioned backups for each major game update cycle.
- Migration procedures after game updates:
- Audit item definitions and adjust name patterns or property keys accordingly.
- Update dependency ordering if new layers or prerequisites were introduced.
- Run regression tests on critical dress sets to verify behavior.
**Section sources**
- [DressAgentItem.cs](file://ClassicAssist.Shared/Data/Dress/DressAgentItem.cs)
- [DressManager.cs](file://ClassicAssist.Shared/Data/Dress/DressManager.cs)
- [DressTabViewModel.cs](file://ClassicAssist.Shared/UI/ViewModels/Agents/DressTabViewModel.cs)
- [HuePickerWindow.axaml.cs](file://ClassicAssist.Avalonia/Views/HuePickerWindow.axaml.cs)
- [HueEntryControl.xaml.cs](file://ClassicAssist/UI/Controls/HueEntryControl.xaml.cs)
- [Item.cs](file://ClassicAssist.Shared/UO/Objects/Item.cs)
- [Property.cs](file://ClassicAssist.Shared/UO/Objects/Property.cs)
- [PlayerMobile.cs](file://ClassicAssist.Shared/UO/Objects/PlayerMobile.cs)
## Conclusion
The Dress Manager provides a robust framework for validating items against intended slots, evaluating properties and requirements, and managing dependencies across dress sets. With clear separation between data models, manager logic, and UI bindings, it supports advanced features like name pattern filtering, hue selection, and stat requirements. Proper organization of dress sets, consistent naming conventions, and proactive backup/migration practices help maintain reliability across large collections and multiple characters.
[No sources needed since this section summarizes without analyzing specific files]
## Appendices
- Best practices for organizing equipment libraries:
- Group items by role (combat, crafting, utility) and scenario (PvP, PvE, exploration).
- Use descriptive names and consistent property tags to simplify filtering.
- Maintaining consistency across characters:
- Centralize common dress sets and override character-specific variations.
- Regularly review and prune obsolete entries after game updates.
[No sources needed since this section provides general guidance]