Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
429 commits
Select commit Hold shift + click to select a range
a6771b7
Update installer script and TEN API
Lwmte Aug 10, 2025
531b3b3
Make deselection by clicking outside rooms more responsive
Lwmte Aug 13, 2025
4f911e1
Update version
Lwmte Aug 13, 2025
85f3e0b
Update TEN.zip
Lwmte Aug 13, 2025
130ba7d
Add inheritance to `LaraObject` + Remove ctors for Settings subclasses
Nickelony Aug 14, 2025
61cc1a0
Update TEN.zip
Lwmte Aug 16, 2025
628e657
Update TEN.zip
Lwmte Aug 17, 2025
77026bd
Fixed bug with incorrect bone weight writing if tint was changed
Lwmte Aug 17, 2025
ba2cf2f
Edited changelog
MontyTRC89 Aug 21, 2025
411b347
Shared FormAnimatedTextures in TombLib;
MontyTRC89 Jul 9, 2025
5718cfa
Added animated textures for objects in TEN level compiler
MontyTRC89 Jul 10, 2025
71fa111
Implemented UVRotate for TEN
MontyTRC89 Jul 11, 2025
844e80a
Animated textures on imported geometry;
MontyTRC89 Jul 15, 2025
ffa0096
Optimized heavily ImageC Get/SetPixel functions and hashing of textur…
MontyTRC89 Jul 29, 2025
2959eca
Disabled legacy setting for scanning other sets for animated textures…
MontyTRC89 Jul 29, 2025
d030cde
Optimized ImageC.Fill function
MontyTRC89 Jul 29, 2025
5b611c7
More optimizations to ImageC class;
MontyTRC89 Jul 29, 2025
d4f6778
Inlined ImageC.ColorToUint function
MontyTRC89 Jul 29, 2025
cdc8a97
Restored remap animated textures checkbox for TEN in level settings
MontyTRC89 Jul 29, 2025
2ae7032
Added boundaries checks in ImageC
MontyTRC89 Jul 29, 2025
5cd25d0
More micro-optimizations to texture packer
MontyTRC89 Jul 30, 2025
2668402
More optimizations
MontyTRC89 Jul 30, 2025
318d4a2
More optimizations to ImageC class
MontyTRC89 Jul 30, 2025
6a13b40
Optimized methods of ImageC for using SIMD instructions
MontyTRC89 Jul 30, 2025
13b86d8
Removed bleeding for UVRotate
MontyTRC89 Jul 30, 2025
45353fe
Fixed UVRotate FPS combobox
MontyTRC89 Aug 1, 2025
08a9fac
Split the parent texture areas in three groups for making level compi…
MontyTRC89 Aug 2, 2025
adde86b
Changed compression from ZLIB to LZ4;
MontyTRC89 Aug 5, 2025
1357f3c
Optimized PNG writer;
MontyTRC89 Aug 6, 2025
dd023bd
Fixed UVRotate speed
MontyTRC89 Aug 7, 2025
71723b4
Diagonal UVRotate
MontyTRC89 Aug 8, 2025
81400a3
Added spatial grid search in texture packer;
MontyTRC89 Aug 8, 2025
010c8a7
Use hashsets in texture packer
MontyTRC89 Aug 8, 2025
24c325b
Reverted changes for imported geonetry support, now the workflow does…
MontyTRC89 Aug 9, 2025
dacf59b
Diagonal UVRotate in every direction
MontyTRC89 Aug 9, 2025
dcbc5c7
Fixed values randomly returning to default for UVRotate
MontyTRC89 Aug 11, 2025
d3a2a91
Optimized CollectionUtils
MontyTRC89 Aug 11, 2025
b463782
More optimizations to CollectionUtils
MontyTRC89 Aug 11, 2025
e32ed93
Optimized existing index search in rooms builder for TEN
MontyTRC89 Aug 11, 2025
ef08d22
Small optimizations in room builder;
MontyTRC89 Aug 12, 2025
be5d59d
Revert "Small optimizations in room builder;"
MontyTRC89 Aug 12, 2025
dcfda65
User friendly elapsed time;
MontyTRC89 Aug 13, 2025
c1f547e
Fixed italian comments;
MontyTRC89 Aug 18, 2025
da02da8
Fix some UI problems
Lwmte Aug 15, 2025
bfc7a73
Removed VS tab indentations
MontyTRC89 Aug 18, 2025
857ed8b
Removed debug line from TombEngine compiler
MontyTRC89 Aug 18, 2025
0ceeec2
Fixed bug in rooms compiler
MontyTRC89 Aug 18, 2025
69bdeb0
Removed unused imports;
MontyTRC89 Aug 18, 2025
04406c3
Optimized portals access and handling for great performance improveme…
MontyTRC89 Aug 21, 2025
6e05981
Update TombLib/TombLib/Utils/ImageC.cs
Nickelony Aug 18, 2025
ffacf9e
Refactor `PanelTextureMapForAnimations.cs` to modern C#
Nickelony Aug 18, 2025
1411d70
Cleanups
Nickelony Aug 18, 2025
95e0f2d
Cleanups + Untabify
Nickelony Aug 18, 2025
de942cf
Untabify again
Nickelony Aug 18, 2025
81e90c8
More modernizations
Nickelony Aug 18, 2025
19c3411
Remove TombLibSpeedTest
Nickelony Aug 18, 2025
47bf2d9
Untabify
Nickelony Aug 18, 2025
c5dfda3
Untabify again
Nickelony Aug 18, 2025
d2eae95
Created toolstrip in mesh editor and added all buttons inside it
MontyTRC89 Aug 21, 2025
0a437d5
Removed ugly legacy hacks that made texture packer misrotate textures…
MontyTRC89 Aug 21, 2025
3877d76
Fixed italian comments
MontyTRC89 Aug 21, 2025
931209c
Updated Changes.txt
MontyTRC89 Aug 21, 2025
378dc82
Revert "Created toolstrip in mesh editor and added all buttons inside…
Lwmte Aug 21, 2025
dab3f0d
Place animated textures button in mesh editor to a proper place
Lwmte Aug 21, 2025
1c98107
Fixed UI problems
Lwmte Aug 21, 2025
78b277c
Hide animated textures button for non-TEN wad versions
Lwmte Aug 21, 2025
550cd65
Added missing chunks and IO for Wad2 and Prj2 UVRotate
MontyTRC89 Aug 22, 2025
6ec0911
Switched to Blake3 library and use 128 bits for hashes for avoiding c…
MontyTRC89 Aug 22, 2025
4a6bd1c
Removed not needed package K4os.Hash.xxHash
MontyTRC89 Aug 22, 2025
f11b4a5
Allow use of unapplied textures in Wad2 for animated textures
MontyTRC89 Aug 23, 2025
4edab8e
Update Changes.txt
Lwmte Aug 22, 2025
12e1a80
Update Changes.txt
Lwmte Aug 22, 2025
b463c2d
Fixed sphere import
Lwmte Aug 23, 2025
985f07f
Renamed Moveable 1115 MESHSWAP_CYBORG
Stranger1992 Aug 23, 2025
00fecfe
Added ability to fill all bone weights with specified values
Lwmte Aug 24, 2025
0c5a605
Fixed vertex weight UI display
Lwmte Aug 24, 2025
5aa160d
Update PLAY.exe
Nickelony Aug 24, 2025
b6740bb
Update PLAY.exe again
Nickelony Aug 24, 2025
28d8e9e
Update PLAY.exe yet again
Nickelony Aug 25, 2025
6fe3d93
Better logging in TEN level compiler
MontyTRC89 Aug 26, 2025
b748bf6
Improved GetHashOfAreaFast()
MontyTRC89 Aug 26, 2025
430aaef
Removed legacy map animated textures flag from settings if TEN project
MontyTRC89 Aug 28, 2025
1e54a7f
More SIMD optimizations to ImageC class
MontyTRC89 Aug 27, 2025
0d68094
Added SIMD utility class for Vector3 operations for future usage
MontyTRC89 Aug 27, 2025
2c46984
Removed italian comments and renamed Simd3 class
MontyTRC89 Aug 27, 2025
847be86
Update Changes.txt
Lwmte Sep 2, 2025
2c35aa8
Update FormMeshEditor.Designer.cs
Lwmte Sep 2, 2025
6703bbc
Added pickup highlighter assets
Lwmte Sep 4, 2025
0837840
Also add talk icon
Lwmte Sep 4, 2025
945651a
Update TombEngine.wad2
Lwmte Sep 4, 2025
8e5d571
Fixed rounding errors in realtime color dialog
Lwmte Sep 7, 2025
c3a4a06
Fixed position and color controls in nodes not accepting objects via …
Lwmte Sep 13, 2025
e8bb8ae
Added reset tint button
Lwmte Sep 15, 2025
976c251
Add `TR1X` and `TR2X` level targets (#1056)
Nickelony Sep 20, 2025
117ee59
Potentially fix #1062
Lwmte Sep 23, 2025
9b25e15
Edit Batch Nodes (#1064)
davidmarr Oct 15, 2025
127de29
Update Changes.txt
Lwmte Oct 15, 2025
11ce623
Update TRX presets + IntelliSense rework (#1070)
Nickelony Oct 19, 2025
e3fb4a3
Add TR1X ladder support (#1065)
lahm86 Oct 19, 2025
47a6a09
Update Changes.txt
Nickelony Oct 19, 2025
1fa3815
Added TombLib.WPF baseline + Ported GeometryIOSettings window to WPF …
Nickelony Oct 21, 2025
2db6077
Update Changes.txt
Lwmte Oct 21, 2025
686fffb
New material system (#1060)
MontyTRC89 Oct 22, 2025
7355c20
Update GlobalAssemblyInfo.cs
Lwmte Oct 22, 2025
11ab892
Replace TEN font with D-DIN
Lwmte Oct 22, 2025
8b86b1a
Update install_script_NET6_x64.nsi
Lwmte Oct 22, 2025
66f6c29
Fixed TEN version comparison
Lwmte Oct 22, 2025
9df86e5
Added SNOWMOBILE_TRACKS object
Lwmte Oct 23, 2025
3bcf8c2
Fixed embedded texture filename display
Lwmte Oct 23, 2025
d3209ca
Use vertices for generating object mesh poly normals
Lwmte Oct 24, 2025
5101a42
Implement parallax mapping and refactor material handling
Lwmte Oct 26, 2025
3c7ccbd
Update TombEngineTexInfoManager.cs
Lwmte Oct 27, 2025
a0101c1
Don't spam build progress reporter with material messages
Lwmte Oct 30, 2025
43a8f43
Decopypaste, remove abandoned variable
Lwmte Nov 1, 2025
eb33992
Update FormMaterialEditor.cs
Lwmte Nov 1, 2025
de56f43
Apply room effect value to ceiling water portals as well
Lwmte Nov 3, 2025
ef85e96
Update Changes.txt
Lwmte Nov 3, 2025
7319ea6
Update TombEngineTexInfoManager.cs
Lwmte Nov 3, 2025
d54472c
Implement #1073
Lwmte Nov 4, 2025
5820db6
Fixed #1074
Lwmte Nov 4, 2025
2f2bba0
Fixed item browser tooltip path
Lwmte Nov 4, 2025
72a1dcd
Update Rooms.cs
Lwmte Nov 5, 2025
9ed7c48
Added a node for checking moveable visibility
Lwmte Nov 5, 2025
baa4f1f
Update Moveables.lua
Lwmte Nov 5, 2025
1ef90f2
Fixed exceptions when copying objects to a TEN wad without a referenc…
Lwmte Nov 5, 2025
b6baf82
Update API.xml
Lwmte Nov 5, 2025
bcf5935
Update TEN.zip
Lwmte Nov 6, 2025
92722de
Ignore build number while comparing editor and engine versions
Lwmte Nov 6, 2025
e7be6fc
Added SIMD supportede instructions log message in level compiler
MontyTRC89 Nov 7, 2025
0ac7764
Commented hot paths in texture packer
MontyTRC89 Nov 7, 2025
a8ec35b
Added SIMD supportede instructions log message in level compiler #2
MontyTRC89 Nov 7, 2025
ad83a8e
Reverted SIMD for TestUVSimilarity quads for avoiding bugs with diffe…
MontyTRC89 Nov 7, 2025
29051ab
Update TEN.zip
Lwmte Nov 7, 2025
6d5e7ad
Move material code out of main CompileLevel function
Lwmte Nov 7, 2025
502f808
Update TEN.zip
Lwmte Nov 7, 2025
e763eac
Update TEN.zip
Lwmte Nov 8, 2025
2b255c7
Update TEN.zip
Lwmte Nov 8, 2025
f88828a
Update TEN.zip
Lwmte Nov 8, 2025
7bab0e1
Fixed flipmap node only accepting arguments up to 16
Lwmte Nov 10, 2025
c18de41
Implement #1076
Lwmte Nov 15, 2025
06611a3
Update Changes.txt
Lwmte Nov 15, 2025
cfd73a5
Delete external material xml file if material settings are reset to d…
Lwmte Nov 15, 2025
ee90b64
Fixed incorrect prompt about other missing resources when reconnectin…
Lwmte Nov 16, 2025
ff833ec
Fixed potential null reference exceptions in FormOperationsDialog
Lwmte Nov 16, 2025
0b95734
Update Changes.txt
Lwmte Nov 17, 2025
de573a6
Catalogs: add state & anim names for TR4 Ahmet and TR5 brown beast
JoeyQuint Nov 19, 2025
29a18e5
Hide internally used objects for TEN targets
JoeyQuint Nov 20, 2025
5ecff7c
Remove redundant flag in TR4 catalog
JoeyQuint Nov 20, 2025
dd8cf8c
Remove obsolete sprite entries in TR4 Moveables catalog
JoeyQuint Nov 20, 2025
193a4f4
Add missing state names in TR5 and TEN catalogs
JoeyQuint Nov 20, 2025
e9d1bb2
Fixed incorrect bounding box resizing for several pushable objects wh…
Lwmte Nov 20, 2025
0e4c992
Update Changes.txt
Lwmte Nov 20, 2025
5fd2ab6
Clear bounding box for firerope object on TEN conversion
Lwmte Nov 22, 2025
6f95e55
Update version and API.xml
Lwmte Nov 22, 2025
4191b5a
Update TEN.zip
Lwmte Nov 22, 2025
c25285c
Restore load/save pickup visibility
Lwmte Nov 22, 2025
6db76ca
Update TEN.zip
Lwmte Nov 22, 2025
37e427f
Update TEN.zip
Lwmte Nov 22, 2025
7a162db
Added nodes to check the color of a moveable or static mesh.
Stranger1992 Nov 23, 2025
6a61405
Added node to add an interaction highlight to a moveable.
Stranger1992 Nov 24, 2025
5970bb0
TEN Compiler optimizations
MontyTRC89 Dec 5, 2025
50b8d8d
Fix TEN remapping for TR3 scuba harpoon
JoeyQuint Nov 30, 2025
723c4f6
Add scuba diver states and anims in TR3 & TEN catalogs
JoeyQuint Nov 30, 2025
0c7ff6e
Correctly display Lara holster slots in WT
JoeyQuint Dec 5, 2025
ae9a4b6
Fix jeep sounds in TEN
JoeyQuint Dec 5, 2025
da60eb6
Actually remove the "TR4_Vehicle_Jeep_Accelerate_01.wav" sample
JoeyQuint Dec 5, 2025
ee4553d
Block level compilation if some objects are not found.
MontyTRC89 Dec 13, 2025
91fbf45
Fixed previous commit
MontyTRC89 Dec 13, 2025
ba9bece
Optimized WadPolygon equality test
MontyTRC89 Dec 13, 2025
a57c56e
Revert "Block level compilation if some objects are not found."
MontyTRC89 Dec 15, 2025
299ab6c
Ignore missing static meshes while building TEN levels
MontyTRC89 Dec 15, 2025
0ef00fe
Partially address #1090
Lwmte Dec 13, 2025
fb9b239
TEN level compiler update for animation refactors (#845)
Sezzary Dec 13, 2025
a127270
Added additional argument for choosing interactive highlight icon .
Stranger1992 Dec 14, 2025
37224fc
Fix TR2 pickup definitions (#1096)
lahm86 Dec 17, 2025
fb36748
Fix ranges in Add item to Inventory Node, Relative for Environment nodes
TrainWrack Dec 18, 2025
7aacdcd
Revert
TrainWrack Dec 18, 2025
6e9ebf9
Fixed #1094
Lwmte Dec 19, 2025
bf15898
Fixed #1086
Lwmte Dec 20, 2025
76e6b2a
Fixed external wad textures not loading if wad was moved
Lwmte Dec 20, 2025
ee9d727
Indentation consistency
Lwmte Dec 20, 2025
a81743b
Update Changes.txt
Lwmte Dec 20, 2025
c03bfab
Less intrusive missing texture warning
Lwmte Dec 20, 2025
56c08f7
Update PanelTextureMap.cs
Lwmte Dec 20, 2025
82f60aa
Fix `BezierCurve2` XML serialisation
Sezzary Dec 20, 2025
c503395
Adjust `BezierCurve2` presets
Sezzary Dec 20, 2025
1dd6d80
Possible fixes to pathfinding for underwater enemies and crocodile
MontyTRC89 Dec 31, 2025
55446fb
Update node editor tooltips
Lwmte Dec 20, 2025
1dca46b
Fixed #1100
Lwmte Dec 24, 2025
d9403ea
Fixed #1102
Lwmte Dec 26, 2025
54b7e45
Update Changes.txt
Lwmte Dec 26, 2025
29d93e1
Fix state change crash with `BezierCurve2`
Sezzary Dec 26, 2025
44a9f00
Correct anim blending labels in state dispatch editor
Sezzary Dec 29, 2025
548b106
Proper way to fix nullref BlendCurve exception in state change editor
Lwmte Jan 5, 2026
f3851b9
Add TRX locked camera support (#1092)
lahm86 Jan 14, 2026
197b9b0
Update TRX room flag support (#1085)
lahm86 Jan 14, 2026
9bb2a98
Update TRX presets (#1087)
lahm86 Jan 14, 2026
a2d7c46
Add TRX additive blending support (#1078)
lahm86 Jan 14, 2026
088995a
Add TRX triangulation support (#1077)
lahm86 Jan 14, 2026
feb2159
Auto-fix hair when importing into TEN wads #1030 (#1084)
JoeyQuint Jan 17, 2026
333d1b9
Update Changes.txt
Lwmte Jan 17, 2026
f484b09
Update Changes.txt
Lwmte Jan 17, 2026
2130813
Merge branch 'develop' into copilot/implement-property-system
TrainWrack Jan 27, 2026
2ff942c
Fix batch editing, static editor, and ComboBox dropdown styling
Copilot Jan 27, 2026
56ef3cd
Add PRJ2 persistence for custom properties (TombEngine chunks v3)
Copilot Jan 27, 2026
0bb0983
Fix compilation errors: add missing using directives and correct cons…
Copilot Jan 27, 2026
baed867
Fix WriteCustomProperties to use BinaryWriterFast and PropertyCollect…
Copilot Jan 27, 2026
34df96b
Fix batch editing: check if right-clicked object is part of ObjectGro…
Copilot Jan 27, 2026
be9424f
WIP
TrainWrack Jan 27, 2026
8147890
WIP
TrainWrack Jan 27, 2026
ffaf68d
Update property windows to follow DarkUI.WPF style conventions
Copilot Jan 27, 2026
05cd30a
Fix BatchPropertyEditorWindow to match PropertyEditorWindow layout an…
Copilot Jan 27, 2026
8ceab49
Plan: Consolidate PropertyEditorWindow and BatchPropertyEditorWindow …
Copilot Jan 27, 2026
2c89167
Add checkbox for booleans and description panel to both property windows
Copilot Jan 27, 2026
9fcc322
Consolidate PropertyEditorWindow to handle both single and batch editing
Copilot Jan 27, 2026
146b239
Delete BatchPropertyEditorWindow files - no longer needed after conso…
Copilot Jan 27, 2026
f4b6751
Phase 1: Add CustomProperties to WadMoveable class
Copilot Jan 27, 2026
e471466
Phase 2: Add WAD2 property serialization for TombEngine moveables
Copilot Jan 27, 2026
3ce0161
Phase 3: Add WAD2 property deserialization with backward compatibility
Copilot Jan 27, 2026
8723ed1
Phase 4 (partial): Add PropertyEditorWindow context awareness and Wad…
Copilot Jan 27, 2026
3e6d626
Add complete statics support for property system in Wadtool
Copilot Jan 27, 2026
726f593
Implement WAD2 property loading and context-aware reset button
Copilot Jan 27, 2026
eecb99a
Update PROPERTY_SYSTEM.md to reflect complete current implementation
Copilot Jan 27, 2026
00f6302
Fix all compilation errors in property system
Copilot Jan 28, 2026
9514a55
Fix WadTool compilation errors - icon, ambiguous reference, and const…
Copilot Jan 28, 2026
5ca2a9b
Fix PropertyManager singleton usage and icon resource in WadTool
Copilot Jan 28, 2026
367160c
Fix font
TrainWrack Jan 28, 2026
c6e416e
Add Edit Properties context menu integration to WadTool
Copilot Jan 28, 2026
3bc5e60
Fix all FormMain.cs compilation errors in property editor handlers
Copilot Jan 28, 2026
203e697
Fix OCB persistence by storing it in CustomProperties instead of Ocb …
Copilot Jan 28, 2026
38d03f1
Fix XML loading in WadTool by passing correct game version to Propert…
Copilot Jan 28, 2026
d4cab1d
Initialize PropertyManager in WadTool to enable XML file loading
Copilot Jan 28, 2026
6eeed16
Use Default.xml and StaticProperties.xml instead of hardcoded properties
Copilot Jan 28, 2026
46037a3
Fix Reset in TombEditor by properly converting saved property values …
Copilot Jan 28, 2026
0567944
Add Horseman xml
TrainWrack Jan 28, 2026
c7b8ac4
Fix OCB saving by merging object-specific XML properties with Default…
Copilot Jan 28, 2026
d7e6dac
Fix checkbox properties by properly serializing/deserializing List<st…
Copilot Jan 28, 2026
0352d76
Fix
TrainWrack Jan 28, 2026
aac63c1
Fix Reset to load CustomProperties from WAD in TombEditor
Copilot Jan 29, 2026
a835a8e
Fix EditorActions.cs compilation errors - add using directive and fix…
Copilot Jan 29, 2026
761f164
Add ReloadAllPropertiesFromWad and ResetAllProperties methods to Edit…
Copilot Jan 29, 2026
47f1347
Fix compilation errors - use editor.LevelSet and editor.Form in Reloa…
Copilot Jan 29, 2026
a908179
Fix compilation errors - add owner parameter and remove LevelSet calls
Copilot Jan 29, 2026
688dc81
Add Reload All Properties from WAD and Reset All Properties menu item…
Copilot Jan 29, 2026
45eff16
Add comprehensive property system architecture diagram with data flow
Copilot Jan 29, 2026
3db03fc
Adjust menus
TrainWrack Jan 30, 2026
69ad66e
Fix StaticInstance edit behavior for non-TombEngine levels by correct…
Copilot Jan 30, 2026
0d02097
Fix MissingMethodException by filtering args for non-TombEngine forms
Copilot Jan 31, 2026
b50b054
Refactor: Replace hacky args length check with clean method overloads…
Copilot Jan 31, 2026
bb856b6
Add GetObjectSetupWindow overload for TriggerInstance with 4 arguments
Copilot Jan 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
781 changes: 781 additions & 0 deletions PROPERTY_SYSTEM.md

Large diffs are not rendered by default.

783 changes: 783 additions & 0 deletions PROPERTY_SYSTEM_ARCHITECTURE.md

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion TombEditor/Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1210,7 +1210,7 @@ static CommandHandler()
return;
}

args.Editor.Action = new EditorActionPlace(false, (r, l) => ItemInstance.FromItemType(currentItem.Value));
args.Editor.Action = new EditorActionPlace(false, (level, room) => ItemInstance.FromItemType(level, currentItem.Value));
});

AddCommand("LocateItem", "Locate item", CommandType.Objects, delegate (CommandArgs args)
Expand Down Expand Up @@ -2379,6 +2379,16 @@ static CommandHandler()
args.Editor.HighlightedSplit = 9;
});

AddCommand("ReloadAllPropertiesFromWad", "Reload all properties from WAD", CommandType.Objects, delegate (CommandArgs args)
{
EditorActions.ReloadAllPropertiesFromWad(args.Editor, args.Window);
});

AddCommand("ResetAllProperties", "Reset all properties", CommandType.Objects, delegate (CommandArgs args)
{
EditorActions.ResetAllProperties(args.Editor, args.Window);
});

_commands = _commands.OrderBy(o => o.Type).ToList();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ public MaterialObjectContextMenu(Editor editor, IWin32Window owner, ObjectInstan
{
Items.Add(new ToolStripMenuItem("Edit object", Properties.Resources.general_edit_16, (o, e) =>
{
EditorActions.EditObject(targetObject, owner);
// If the target object is part of an ObjectGroup selection, edit the whole group
var objectToEdit = targetObject;
if (_editor.SelectedObject is ObjectGroup group && group.Contains(targetObject as PositionBasedObjectInstance))
objectToEdit = group;

EditorActions.EditObject(objectToEdit, owner);
}));
}

Expand Down
204 changes: 194 additions & 10 deletions TombEditor/EditorActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
using TombLib.Wad;
using TombLib.Wad.Catalog;
using TombLib.WPF;
using TombEditor.Windows;

namespace TombEditor
{
Expand Down Expand Up @@ -1013,7 +1014,21 @@ public static void RebuildLightsForObject(ObjectInstance instance)
instance.Room.RebuildLighting(_editor.Configuration.Rendering3D_HighQualityLightPreview);
}

public static DarkForm GetObjectSetupWindow(params object[] args)
// Overload for non-TombEngine levels (TR4, NG, etc.) - only needs instance
public static DarkForm GetObjectSetupWindow(object instance)
{
return GetObjectSetupWindow(instance, null);
}

// Specific overload for TriggerInstance with actions
public static DarkForm GetObjectSetupWindow(TriggerInstance trigger, Level level,
Action<ObjectInstance> selectObject, Action<Room> selectRoom)
{
return new FormTrigger(trigger, level, selectObject, selectRoom);
}

// Full implementation with optional Level parameter
public static DarkForm GetObjectSetupWindow(object instance, Level level)
{
// This function decides on which window version to use based on game version.
// Right now it is primarily future-proof setup for TEN objects which will feature
Expand All @@ -1025,11 +1040,11 @@ public static DarkForm GetObjectSetupWindow(params object[] args)
// 3. If game version is NOT TEN, always use "TombEditor.Forms" namespace
// 4. If no window was found in either namespace, throw an exception, since there's no setup window for such object.

if (!args.Any() || !(args[0] is ObjectInstance))
throw new ArgumentException("Object instance was not provided as first argument for this function.");
if (!(instance is ObjectInstance))
throw new ArgumentException("Object instance was not provided for this function.");

var triedAlternateNamespace = false;
var objectName = (args[0] as ObjectInstance).GetType().Name.Replace("Instance", string.Empty);
var objectName = (instance as ObjectInstance).GetType().Name.Replace("Instance", string.Empty);

// Additional filter for volume types
if (objectName.Contains("Volume")) objectName = "Volume";
Expand All @@ -1040,10 +1055,24 @@ public static DarkForm GetObjectSetupWindow(params object[] args)

while (true)
{
var formType = Type.GetType("TombEditor.Forms" + (_editor.Level.IsTombEngine && !triedAlternateNamespace ? ".TombEngine" : "") + ".Form" + objectName);
var isTombEngine = level != null && level.IsTombEngine;
var formType = Type.GetType("TombEditor.Forms" + (isTombEngine && !triedAlternateNamespace ? ".TombEngine" : "") + ".Form" + objectName);

if (formType != null)
{
// Create args array based on whether this is a TombEngine form or non-TombEngine form
object[] args;
if (isTombEngine && !triedAlternateNamespace)
{
// TombEngine forms expect (instance, level)
args = new object[] { instance, level };
}
else
{
// Non-TombEngine forms expect (instance) only
args = new object[] { instance };
}

var form = Activator.CreateInstance(formType, args);
if (form is DarkForm) return (DarkForm)form;
}
Expand Down Expand Up @@ -1091,13 +1120,45 @@ public static void RenameObject(ObjectInstance instance, IWin32Window owner)

public static void EditObject(ObjectInstance instance, IWin32Window owner)
{
// Handle batch editing for ObjectGroup containing moveables or statics
if (instance is ObjectGroup group && _editor.Level.IsTombEngine)
{
var moveables = group.OfType<MoveableInstance>().ToList();
var statics = group.OfType<StaticInstance>().ToList();

if (moveables.Any() && !statics.Any())
{
// Batch edit moveables using unified PropertyEditorWindow
var window = new TombEditor.Windows.PropertyEditorWindow(moveables.Cast<ItemInstance>().ToList(), true, PropertyEditorContext.TombEditor, null, _editor.Level);
if (window.ShowDialog() == true)
{
foreach (var obj in moveables)
_editor.ObjectChange(obj, ObjectChangeType.Change);
}
return;
}
else if (statics.Any() && !moveables.Any())
{
// Batch edit statics using unified PropertyEditorWindow
var window = new TombEditor.Windows.PropertyEditorWindow(statics.Cast<ItemInstance>().ToList(), true, PropertyEditorContext.TombEditor, null, _editor.Level);
if (window.ShowDialog() == true)
{
foreach (var obj in statics)
_editor.ObjectChange(obj, ObjectChangeType.Change);
}
return;
}
}

if (instance is MoveableInstance)
{
if (instance.CanBeColored() && Control.ModifierKeys.HasFlag(Keys.Control))
EditColor(owner, (MoveableInstance)instance);
else
{
using (var formMoveable = GetObjectSetupWindow((MoveableInstance)instance))
using (var formMoveable = _editor.Level.IsTombEngine
? GetObjectSetupWindow((MoveableInstance)instance, _editor.Level)
: GetObjectSetupWindow((MoveableInstance)instance))
if (formMoveable.ShowDialog(owner) != DialogResult.OK)
return;
}
Expand All @@ -1106,14 +1167,16 @@ public static void EditObject(ObjectInstance instance, IWin32Window owner)
}
else if (instance is StaticInstance)
{
// Use static editing dialog only for NG levels for now (bypass it if Ctrl/Alt key is pressed)
if (instance.CanBeColored() && (!_editor.Level.IsNG || Control.ModifierKeys.HasFlag(Keys.Control)))
// Use static editing dialog for NG and TombEngine levels (bypass it if Ctrl key is pressed)
if (instance.CanBeColored() && ((!_editor.Level.IsNG && !_editor.Level.IsTombEngine) || Control.ModifierKeys.HasFlag(Keys.Control)))
{
EditColor(owner, (StaticInstance)instance);
}
else if (_editor.Level.IsNG)
else if (_editor.Level.IsNG || _editor.Level.IsTombEngine)
{
using (var formStaticMesh = GetObjectSetupWindow((StaticInstance)instance))
using (var formStaticMesh = _editor.Level.IsTombEngine
? GetObjectSetupWindow((StaticInstance)instance, _editor.Level)
: GetObjectSetupWindow((StaticInstance)instance))
if (formStaticMesh.ShowDialog(owner) != DialogResult.OK)
return;
}
Expand Down Expand Up @@ -5942,5 +6005,126 @@ public static void ConvertAreaToQuads(Room room, RectangleInt2 area, SectorVerti
if (success)
SmartBuildGeometry(room, area);
}

public static void ReloadAllPropertiesFromWad(Editor editor, IWin32Window owner)
{
if (editor?.Level == null || !editor.Level.IsTombEngine)
{
editor.SendMessage("This feature is only available for Tomb Engine levels.", PopupType.Warning);
return;
}

int updatedCount = 0;
var level = editor.Level;

// Reload properties for all moveables
foreach (var room in level.Rooms.Where(r => r != null))
{
foreach (var obj in room.Objects.OfType<MoveableInstance>())
{
var wadMoveable = level.Settings?.WadTryGetMoveable(obj.WadObjectId);
if (wadMoveable?.CustomProperties != null && wadMoveable.CustomProperties.GetAll().Count > 0)
{
// Clear existing properties
obj.CustomProperties = new TombLib.LevelData.Properties.PropertyCollection();

// Copy from WAD
foreach (var kvp in wadMoveable.CustomProperties.GetAll())
{
obj.CustomProperties.SetProperty(kvp.Key, kvp.Value);
}

updatedCount++;
editor.ObjectChange(obj, ObjectChangeType.Change);
}
}

// Reload properties for all statics
foreach (var obj in room.Objects.OfType<StaticInstance>())
{
var wadStatic = level.Settings?.WadTryGetStatic(obj.WadObjectId);
if (wadStatic?.CustomProperties != null && wadStatic.CustomProperties.GetAll().Count > 0)
{
// Clear existing properties
obj.CustomProperties = new TombLib.LevelData.Properties.PropertyCollection();

// Copy from WAD
foreach (var kvp in wadStatic.CustomProperties.GetAll())
{
obj.CustomProperties.SetProperty(kvp.Key, kvp.Value);
}

updatedCount++;
editor.ObjectChange(obj, ObjectChangeType.Change);
}
}
}

if (updatedCount > 0)
{
editor.SendMessage($"Reloaded properties from WAD for {updatedCount} objects.", PopupType.Info);
}
else
{
editor.SendMessage("No objects with WAD properties found to reload.", PopupType.Info);
}
}

public static void ResetAllProperties(Editor editor, IWin32Window owner)
{
if (editor?.Level == null || !editor.Level.IsTombEngine)
{
editor.SendMessage("This feature is only available for Tomb Engine levels.", PopupType.Warning);
return;
}

if (DarkMessageBox.Show(owner,
"This will clear all custom properties from all objects in the level.\n\n" +
"Objects will revert to default properties from XML files or WAD.\n\n" +
"This action cannot be undone. Continue?",
"Reset All Properties",
MessageBoxButtons.YesNo,
MessageBoxIcon.Warning) != DialogResult.Yes)
{
return;
}

int clearedCount = 0;
var level = editor.Level;

// Clear properties for all moveables
foreach (var room in level.Rooms.Where(r => r != null))
{
foreach (var obj in room.Objects.OfType<MoveableInstance>())
{
if (obj.CustomProperties.GetAll().Count > 0)
{
obj.CustomProperties = new TombLib.LevelData.Properties.PropertyCollection();
clearedCount++;
editor.ObjectChange(obj, ObjectChangeType.Change);
}
}

// Clear properties for all statics
foreach (var obj in room.Objects.OfType<StaticInstance>())
{
if (obj.CustomProperties.GetAll().Count > 0)
{
obj.CustomProperties = new TombLib.LevelData.Properties.PropertyCollection();
clearedCount++;
editor.ObjectChange(obj, ObjectChangeType.Change);
}
}
}

if (clearedCount > 0)
{
editor.SendMessage($"Cleared properties for {clearedCount} objects.", PopupType.Info);
}
else
{
editor.SendMessage("No objects with custom properties found.", PopupType.Info);
}
}
}
}
Loading