Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Implements a three-layer TombEngine Lua property system spanning data model, serialization, compilation-time Lua script generation, and editor UI integration (WadTool global overrides + TombEditor per-instance overrides) via a WPF property grid hosted inside existing DarkUI WinForms surfaces.
Changes:
- Add Lua property core types: boxed-value parsing/validation, XML catalog loading, and script generation helpers.
- Persist properties in assets/projects and compilation output (wad2/prj2 chunks + compiled level Lua property script blob).
- Add WPF property grid UI and integrate it into WadTool and TombEditor (tool window + menu entries), plus refactor visual scripting argument parsing to reuse the shared parser.
Reviewed changes
Copilot reviewed 39 out of 43 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| WadTool/WadTool.csproj | Enables WPF support in WadTool to host the new WPF property grid. |
| WadTool/WadActions.cs | Adds action entry point to open the Lua property editor form. |
| WadTool/Forms/FormMain.cs | Adds handlers to open the property editor (focused/unfocused entry points). |
| WadTool/Forms/FormMain.Designer.cs | Adds a “Property editor” menu entry to launch the editor. |
| WadTool/Forms/FormLuaProperties.resx | New form resource for the global Lua property editor. |
| WadTool/Forms/FormLuaProperties.cs | New global (wad2-level) Lua property editor hosting WPF grid in ElementHost. |
| WadTool/Forms/FormLuaProperties.Designer.cs | New WinForms/DarkUI designer layout for the property editor form. |
| TombLib/TombLib/Wad/WadStatic.cs | Adds global (wad2) LuaPropertyContainer storage + cloning. |
| TombLib/TombLib/Wad/WadMoveable.cs | Adds global (wad2) LuaPropertyContainer storage + cloning. |
| TombLib/TombLib/Wad/Wad2Writer.cs | Serializes global Lua properties into wad2 chunks. |
| TombLib/TombLib/Wad/Wad2Loader.cs | Deserializes global Lua properties from wad2 chunks. |
| TombLib/TombLib/Wad/Wad2Chunks.cs | Defines new wad2 chunk IDs for Lua properties. |
| TombLib/TombLib/Utils/ScriptingUtils.cs | Extends LuaSyntax with Rotation type prefix. |
| TombLib/TombLib/TombLib.csproj | Ships new TEN Property Catalog content files to output. |
| TombLib/TombLib/LuaProperties/LuaValueParser.cs | Introduces shared boxing/unboxing/validation utilities for Lua value formats. |
| TombLib/TombLib/LuaProperties/LuaPropertyType.cs | Adds enum of supported Lua property types. |
| TombLib/TombLib/LuaProperties/LuaPropertyScriptBuilder.cs | Generates Lua API call strings for global + instance property assignment. |
| TombLib/TombLib/LuaProperties/LuaPropertyDefinition.cs | Defines property metadata loaded from XML catalogs. |
| TombLib/TombLib/LuaProperties/LuaPropertyContainer.cs | Adds boxed-string container for storing property overrides. |
| TombLib/TombLib/LuaProperties/LuaPropertyCatalog.cs | Implements XML catalog loader + merging + validation for property definitions. |
| TombLib/TombLib/LevelData/Instances/StaticInstance.cs | Adds per-instance (prj2) LuaPropertyContainer storage. |
| TombLib/TombLib/LevelData/Instances/MoveableInstance.cs | Adds per-instance (prj2) LuaPropertyContainer storage. |
| TombLib/TombLib/LevelData/IO/Prj2Writer.cs | Serializes per-instance Lua properties; bumps TEN object chunk versions to 3. |
| TombLib/TombLib/LevelData/IO/Prj2Loader.cs | Deserializes per-instance Lua properties; adds support for new 3 chunk IDs. |
| TombLib/TombLib/LevelData/IO/Prj2Chunks.cs | Defines new prj2 chunk IDs for TEN movable/static v3 objects. |
| TombLib/TombLib/LevelData/Compilers/TombEngine/TombEngine.cs | Writes Lua property script blob into compiled level dynamic data. |
| TombLib/TombLib/LevelData/Compilers/TombEngine/LevelCompilerTombEngine.cs | Builds the global+instance property script blob during compilation. |
| TombLib/TombLib.Forms/Views/LuaPropertyGridControl.xaml.cs | New WPF control code-behind (color picker interop, converters, UX helpers). |
| TombLib/TombLib.Forms/Views/LuaPropertyGridControl.xaml | New WPF property grid UI templates for all supported types. |
| TombLib/TombLib.Forms/Views/LuaPropertyEditorTemplateSelector.cs | Selects editor templates by LuaPropertyType. |
| TombLib/TombLib.Forms/ViewModels/LuaPropertyRowViewModel.cs | Per-property row ViewModel with typed bindable accessors and live boxing. |
| TombLib/TombLib.Forms/ViewModels/LuaPropertyGridViewModel.cs | Grid ViewModel: load/clear/reset, live-writeback to LuaPropertyContainer. |
| TombLib/TombLib.Forms/Utils/WinFormsUtils.cs | Extends input handling to account for WPF focus hosted in ElementHost. |
| TombLib/TombLib.Forms/Controls/VisualScripting/ArgumentEditor.cs | Refactors argument boxing/unboxing to reuse LuaValueParser. |
| TombEditor/ToolWindows/ItemProperties.cs | New dockable tool window for per-instance Lua properties (WPF hosted). |
| TombEditor/ToolWindows/ItemProperties.Designer.cs | Designer metadata for the new ItemProperties tool window. |
| TombEditor/Forms/FormMain.cs | Registers ItemProperties tool window in the default tool window list. |
| TombEditor/Forms/FormMain.Designer.cs | Adds Window menu toggle entry for the new Item Properties window. |
| TombEditor/Configuration.cs | Updates default docking layout to include ItemProperties. |
| TombEditor/Command.cs | Adds command to show/hide the ItemProperties tool window. |
| DarkUI/DarkUI.WPF/CustomControls/NumericUpDown.cs | Allows negative sign input in WPF NumericUpDown text input filter. |
Files not reviewed (4)
- TombEditor/Forms/FormMain.Designer.cs: Language not supported
- TombEditor/ToolWindows/ItemProperties.Designer.cs: Language not supported
- WadTool/Forms/FormLuaProperties.Designer.cs: Language not supported
- WadTool/Forms/FormMain.Designer.cs: Language not supported
Comments suppressed due to low confidence (1)
TombLib/TombLib/LuaProperties/LuaPropertyCatalog.cs:80
- The XML doc says this lazy initialization is thread-safe, but there is no synchronization here. Either add locking/Interlocked initialization or adjust the comment so callers don’t assume thread-safety.
/// <summary>
/// Gets all property definitions, loading from disk on first access.
/// Thread-safe via lazy initialization.
/// </summary>
public static Dictionary<LuaPropertyObjectKey, List<LuaPropertyDefinition>> Catalog
{
get
{
if (_catalog == null)
_catalog = LoadCatalog(PropertyCatalogPath);
return _catalog;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
TombLib/TombLib/LevelData/Compilers/TombEngine/LevelCompilerTombEngine.cs
Show resolved
Hide resolved
TombLib/TombLib/LevelData/Compilers/TombEngine/LevelCompilerTombEngine.cs
Outdated
Show resolved
Hide resolved
2 tasks
This was referenced Mar 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements a three-layered property system for TombEngine level target.
Linked TEN PR: TombEngine/TombEngine#1903
For the details about defining properties, refer to the documentation.