You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+
## Project Overview
6
+
7
+
MafiaToolkit is a Windows .NET modding toolkit for the Mafia game series (Mafia II, Mafia III, Mafia I: DE, Mafia II: DE). It provides file format parsers, editors, and a 3D map editor with DirectX 11 rendering.
-**MapEditor**: Main 3D scene editor (most complex, integrates rendering + all resource types)
109
+
-**MaterialEditor/Browser**: MTL editing
110
+
-**CutsceneEditor**: Cinematic animation
111
+
-**ActorEditor**: Game entity definitions
112
+
-**XBinEditor**: Game data containers
113
+
-**TranslokatorEditor**: Object placement
114
+
- 15+ additional specialized editors
115
+
116
+
Forms use `WeifenLuo.WinFormsUI.Docking` for flexible panel layout.
117
+
118
+
### Key Dependencies
119
+
120
+
-**Vortice.Direct3D11**: DirectX 11 bindings
121
+
-**SharpGLTF**: GLTF model support
122
+
-**DockPanelSuite**: WinForms docking
123
+
-**Gibbed.IO**: Binary serialization utilities
124
+
-**UnluacNET**: Lua decompilation
125
+
-**OodleSharp**: Oodle compression
126
+
127
+
## Important Patterns
128
+
129
+
### Adding New File Format Support
130
+
1. Create `File<Format>` class extending `FileBase` in `Core/IO/`
131
+
2. Register extension in `FileFactory.ConstructFromFileInfo()`
132
+
3. Create corresponding resource types in `ResourceTypes/FileTypes/`
133
+
4. Optionally add renderer in `Rendering/Graphics/RenderTypes/`
134
+
135
+
### Resource Serialization
136
+
All game resources implement `IResourceType` interface with `Serialize`/`Deserialize` methods. Version-aware loading handles format differences across games.
137
+
138
+
### Rendering Objects
139
+
Implement `IRenderer` interface in `Rendering/Graphics/RenderTypes/`. Use `RenderableFactory` to create instances from resource types.
140
+
141
+
### Adding New Editor Forms
142
+
1. Create `<Name>Editor.cs` form in `Forms/` with TreeView + PropertyGrid layout
143
+
2. Add constructor accepting `FileInfo` parameter
144
+
3. Register in `FileBin.cs` or `FileFactory` based on file extension/magic
145
+
4. Add localization strings in `Utils/Language/` resource files
146
+
5. Standard menu structure: File (Save, Reload, Exit), Tools (Export XML, Import XML)
0 commit comments