Skip to content

WPF port of multiple tool windows + Convert to vertical slices 🍕#1154

Draft
Nickelony wants to merge 10 commits intodevelopfrom
Nickelony/NEW-WPF
Draft

WPF port of multiple tool windows + Convert to vertical slices 🍕#1154
Nickelony wants to merge 10 commits intodevelopfrom
Nickelony/NEW-WPF

Conversation

@Nickelony
Copy link
Copy Markdown
Collaborator

@Nickelony Nickelony commented Mar 14, 2026

ToDo list:

  • Review ViewModels
  • Review new 2D Grid panel code
  • Fix ToolWindow heights - bottom is getting cut off by a few pixels
  • Replace SVG icons in RoomOptions panel with the old PNG icons (experiment leftovers)
  • Fix broken strings in light quality menu

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Ports several TombEditor tool windows from WinForms to WPF (hosted via ElementHost) and reorganizes UI code into Features/* namespaces, while also updating localization key resolution to be more resilient to common view suffixes.

Changes:

  • Added WPF-based dockable views (Sector/Room options, Lighting, Palette, Texture panel, etc.) and corresponding ViewModels.
  • Introduced WPF utility helpers (color/brush conversions, frozen pens/brushes) and new WPF converters/styles in DarkUI.
  • Updated localization to trim common component suffixes (View, Window, Page, Dialog) during key resolution.

Reviewed changes

Copilot reviewed 84 out of 106 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
TombLib/TombLib.WPF/WPFUtils.cs New WPF helper utilities (interop + color/brush helpers + control enumeration).
TombLib/TombLib.WPF/Services/Abstract/ILocalizationService.cs Documentation update describing suffix trimming behavior.
TombLib/TombLib.WPF/Localizer.cs Trims common component suffixes in localized key lookups.
TombLib/TombLib.WPF/LocalizeExtension.cs Documentation update for suffix trimming behavior.
TombEditor/ToolWindows/ToolPaletteFloating.cs Removed legacy ToolPalette floating toolbox implementation.
TombEditor/ToolWindows/ToolPalette.cs Removed legacy ToolPalette tool window implementation.
TombEditor/ToolWindows/SectorOptions.cs Removed legacy SectorOptions tool window implementation.
TombEditor/ToolWindows/RoomOptions.cs Removed legacy RoomOptions tool window implementation.
TombEditor/ToolWindows/Palette.cs Removed legacy Palette tool window implementation.
TombEditor/ToolWindows/Palette.Designer.cs Removed legacy Palette designer file.
TombEditor/ToolWindows/Lighting.cs Removed legacy Lighting tool window implementation.
TombEditor/TombEditor.csproj Enables C# 12, adds WPF behaviors package, updates resources/compile items.
TombEditor/Forms/FormMain.cs Switches tool window/toolbox references to new Features/* locations.
TombEditor/Features/Panel3D/ToolPalette/ToolboxViewModel.cs Renames/moves Toolbox ViewModel into Features.Panel3D.ToolPalette.
TombEditor/Features/Panel3D/ToolPalette/ToolboxView.xaml.cs Renames/moves Toolbox WPF view code-behind.
TombEditor/Features/Panel3D/ToolPalette/ToolboxView.xaml Updates Toolbox WPF view XAML class/namespace bindings.
TombEditor/Features/Panel3D/ToolPalette/Toolbox.resx New resources for Toolbox WinForms host control.
TombEditor/Features/Panel3D/ToolPalette/Toolbox.cs Renames/moves WinForms host control to Toolbox.
TombEditor/Features/Panel3D/ToolPalette/Toolbox.Designer.cs Updates designer to instantiate new ToolboxView.
TombEditor/Features/Panel3D/ToolPalette/ToolPaletteFloating.resx New resources for floating ToolPalette.
TombEditor/Features/Panel3D/ToolPalette/ToolPaletteFloating.cs New floating ToolPalette wrapper class.
TombEditor/Features/Panel3D/ToolPalette/ToolPaletteFloating.Designer.cs Designer updated to use new Toolbox control type.
TombEditor/Features/Panel3D/ToolPalette/ToolPalette.resx New resources for docked ToolPalette.
TombEditor/Features/Panel3D/ToolPalette/ToolPalette.cs New docked ToolPalette wrapper class.
TombEditor/Features/Panel3D/ToolPalette/ToolPalette.Designer.cs Designer updated to use new Toolbox control type.
TombEditor/Features/Panel3D/ObjectBrush/ObjectBrushToolboxViewModel.cs Moves ObjectBrush toolbox VM into Features.Panel3D.ObjectBrush.
TombEditor/Features/Panel3D/ObjectBrush/ObjectBrushToolboxView.xaml.cs Moves ObjectBrush toolbox WPF view into new namespace.
TombEditor/Features/Panel3D/ObjectBrush/ObjectBrushToolboxView.xaml Updates ObjectBrush toolbox XAML class/namespace bindings.
TombEditor/Features/Panel3D/ObjectBrush/ObjectBrushToolbox.resx New resources for ObjectBrush toolbox host.
TombEditor/Features/Panel3D/ObjectBrush/ObjectBrushToolbox.cs New ObjectBrush floating toolbox host (ElementHost).
TombEditor/Features/Panel3D/ObjectBrush/ObjectBrushToolbox.Designer.cs Designer updated to instantiate new WPF view.
TombEditor/Features/Panel3D/ObjectBrush/Helper.cs Renames helper class to Helpers and adjusts logic/cleanup.
TombEditor/Features/Panel3D/ObjectBrush/Constants.cs New shared constants for object brush feature.
TombEditor/Features/Panel3D/ObjectBrush/Actions.cs Updates brush actions to use renamed helpers/constants.
TombEditor/Features/DockableViews/TriggerList/TriggerListView.xaml.cs New WPF TriggerList view code-behind.
TombEditor/Features/DockableViews/TriggerList/TriggerListView.xaml New WPF TriggerList layout (WindowsFormsHost + buttons).
TombEditor/Features/DockableViews/TriggerList/TriggerList.resx New resources for TriggerList.
TombEditor/Features/DockableViews/TriggerList/TriggerList.cs Moves TriggerList tool window into Features.DockableViews.
TombEditor/Features/DockableViews/TriggerList/TriggerList.Designer.cs Updates TriggerList designer namespace.
TombEditor/Features/DockableViews/TexturePanel/TexturePanelView.xaml.cs New WPF TexturePanel view code-behind.
TombEditor/Features/DockableViews/TexturePanel/TexturePanelView.xaml New WPF TexturePanel layout (WindowsFormsHost + toolbars).
TombEditor/Features/DockableViews/TexturePanel/TexturePanel.resx New resources for TexturePanel.
TombEditor/Features/DockableViews/TexturePanel/TexturePanel.cs Moves TexturePanel tool window into Features.DockableViews.
TombEditor/Features/DockableViews/TexturePanel/TexturePanel.Designer.cs Updates TexturePanel designer namespace.
TombEditor/Features/DockableViews/SectorOptionsPanel/SectorOptionsViewModel.cs New WPF/MVVM SectorOptions logic + command bindings.
TombEditor/Features/DockableViews/SectorOptionsPanel/SectorOptionsView.xaml.cs New WPF SectorOptions view code-behind and cleanup wiring.
TombEditor/Features/DockableViews/SectorOptionsPanel/SectorOptions.resx New resources for SectorOptionsPanel.
TombEditor/Features/DockableViews/SectorOptionsPanel/SectorOptions.cs New tool window host for SectorOptions WPF view.
TombEditor/Features/DockableViews/SectorOptionsPanel/SectorOptions.Designer.cs ElementHost-based designer wiring for SectorOptions.
TombEditor/Features/DockableViews/RoomOptionsPanel/RoomOptionsView.xaml.cs New WPF RoomOptions view code-behind.
TombEditor/Features/DockableViews/RoomOptionsPanel/RoomOptions.resx New resources for RoomOptionsPanel.
TombEditor/Features/DockableViews/RoomOptionsPanel/RoomOptions.cs New tool window host for RoomOptions WPF view.
TombEditor/Features/DockableViews/RoomOptionsPanel/RoomOptions.Designer.cs ElementHost-based designer wiring for RoomOptions.
TombEditor/Features/DockableViews/PalettePanel/PaletteViewModel.cs New Palette MVVM state + command wrappers.
TombEditor/Features/DockableViews/PalettePanel/PaletteView.xaml.cs New Palette WPF view hosting custom PaletteGrid.
TombEditor/Features/DockableViews/PalettePanel/PaletteView.xaml New Palette WPF layout + command bindings.
TombEditor/Features/DockableViews/PalettePanel/PaletteGrid.cs New custom-rendered WPF palette grid with interaction logic.
TombEditor/Features/DockableViews/PalettePanel/Palette.resx New resources for PalettePanel.
TombEditor/Features/DockableViews/PalettePanel/Palette.cs New tool window host for Palette WPF view.
TombEditor/Features/DockableViews/PalettePanel/Palette.Designer.cs ElementHost-based designer wiring for Palette.
TombEditor/Features/DockableViews/ObjectList/ObjectListView.xaml.cs New WPF ObjectList view code-behind.
TombEditor/Features/DockableViews/ObjectList/ObjectListView.xaml New WPF ObjectList layout (WindowsFormsHost + buttons).
TombEditor/Features/DockableViews/ObjectList/ObjectList.resx New resources for ObjectList.
TombEditor/Features/DockableViews/ObjectList/ObjectList.cs Moves ObjectList tool window into Features.DockableViews.
TombEditor/Features/DockableViews/ObjectList/ObjectList.Designer.cs Updates ObjectList designer namespace/minor formatting.
TombEditor/Features/DockableViews/LightingPanel/LightingViewModel.cs New Lighting MVVM logic (properties + commands + state).
TombEditor/Features/DockableViews/LightingPanel/LightingView.xaml.cs New Lighting WPF view code-behind and cleanup.
TombEditor/Features/DockableViews/LightingPanel/LightingView.xaml New Lighting WPF layout + bindings for numeric/checkbox controls.
TombEditor/Features/DockableViews/LightingPanel/Lighting.resx New resources for LightingPanel.
TombEditor/Features/DockableViews/LightingPanel/Lighting.cs New tool window host for Lighting WPF view.
TombEditor/Features/DockableViews/LightingPanel/Lighting.Designer.cs ElementHost-based designer wiring for Lighting.
TombEditor/Features/DockableViews/ItemBrowser/ItemBrowserView.xaml.cs New WPF ItemBrowser view code-behind.
TombEditor/Features/DockableViews/ItemBrowser/ItemBrowserView.xaml New WPF ItemBrowser layout (WindowsFormsHost + buttons).
TombEditor/Features/DockableViews/ItemBrowser/ItemBrowser.resx New resources for ItemBrowser.
TombEditor/Features/DockableViews/ItemBrowser/ItemBrowser.cs Moves ItemBrowser tool window into Features.DockableViews.
TombEditor/Features/DockableViews/ItemBrowser/ItemBrowser.Designer.cs Updates ItemBrowser designer namespace/minor formatting.
TombEditor/Features/DockableViews/ImportedGeometryBrowser/ImportedGeometryBrowserView.xaml.cs New WPF ImportedGeometryBrowser view code-behind.
TombEditor/Features/DockableViews/ImportedGeometryBrowser/ImportedGeometryBrowserView.xaml New WPF ImportedGeometryBrowser layout (WindowsFormsHost + buttons).
TombEditor/Features/DockableViews/ImportedGeometryBrowser/ImportedGeometryBrowser.resx New resources for ImportedGeometryBrowser.
TombEditor/Features/DockableViews/ImportedGeometryBrowser/ImportedGeometryBrowser.cs Moves ImportedGeometryBrowser tool window into Features.DockableViews.
TombEditor/Features/DockableViews/ImportedGeometryBrowser/ImportedGeometryBrowser.Designer.cs Updates ImportedGeometryBrowser designer namespace/minor formatting.
TombEditor/Features/DockableViews/ContentBrowser/FilterOption.cs Extracts filter option model from VM into standalone type.
TombEditor/Features/DockableViews/ContentBrowser/ContentBrowserViewModel.cs Moves ContentBrowser VM into Features.DockableViews.ContentBrowser and removes embedded models/enums.
TombEditor/Features/DockableViews/ContentBrowser/ContentBrowserView.xaml.cs Moves ContentBrowser view code-behind into new namespace.
TombEditor/Features/DockableViews/ContentBrowser/ContentBrowserView.xaml Updates ContentBrowser XAML class/namespace and DataTemplate type refs.
TombEditor/Features/DockableViews/ContentBrowser/ContentBrowser.cs Moves ContentBrowser tool window into Features.DockableViews.
TombEditor/Features/DockableViews/ContentBrowser/ContentBrowser.Designer.cs Designer updated to instantiate new ContentBrowserView.
TombEditor/Features/DockableViews/ContentBrowser/AssetItemViewModel.cs Extracts asset tile view model into its own file.
TombEditor/Features/DockableViews/ContentBrowser/AssetCategory.cs Extracts asset category enum into its own file.
TombEditor/Controls/Panel3D/Panel3DObjectBrush.cs Updates object brush references to new Features.Panel3D.ObjectBrush types.
TombEditor/Controls/ObjectBrush/ObjectBrushToolbox.cs Removes legacy ObjectBrush toolbox host.
TombEditor/Controls/ObjectBrush/ObjectBrushConstants.cs Removes legacy ObjectBrush constants.
TombEditor/Command.cs Adds WPF ICommand adapter and constructor overload for CommandArgs; updates usings for moved tool windows.
DarkUI/DarkUI.WPF/Styles/NumericUpDown.xaml Ensures NumericUpDown foreground uses theme text brush.
DarkUI/DarkUI.WPF/Converters/VectorToUIColorConverter.cs New converter for Vector4 <-> WPF Color.
DarkUI/DarkUI.WPF/Converters/VectorToBrushConverter.cs New converter for Vector4 <-> SolidColorBrush.
DarkUI/DarkUI.WPF/Converters/HtmlToUIColorConverter.cs New converter for HTML color strings <-> WPF Color.
.gitignore Ignores TEMP_WPF/.
Files not reviewed (8)
  • TombEditor/Features/DockableViews/LightingPanel/Lighting.Designer.cs: Language not supported
  • TombEditor/Features/DockableViews/PalettePanel/Palette.Designer.cs: Language not supported
  • TombEditor/Features/DockableViews/RoomOptionsPanel/RoomOptions.Designer.cs: Language not supported
  • TombEditor/Features/DockableViews/SectorOptionsPanel/SectorOptions.Designer.cs: Language not supported
  • TombEditor/ToolWindows/Lighting.Designer.cs: Language not supported
  • TombEditor/ToolWindows/Palette.Designer.cs: Language not supported
  • TombEditor/ToolWindows/RoomOptions.Designer.cs: Language not supported
  • TombEditor/ToolWindows/SectorOptions.Designer.cs: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +233 to +241
int oldColumns = _oldPaletteSize.Width > 0 ? (int)(_oldPaletteSize.Width / CellWidth) : ColumnCount;
int newColumns = ColumnCount;

if (oldColumns > 0 && newColumns > 0 && oldColumns != newColumns)
{
int x = _selectedIndex % oldColumns;
int y = _selectedIndex / oldColumns;
_selectedIndex = (y * oldColumns) + x;
}
Comment thread TombEditor/Command.cs
Comment on lines 61 to +73
public class CommandArgs
{
public Editor Editor;
public IWin32Window Window;
public Keys KeyData = Keys.None;

public CommandArgs() { }

public CommandArgs(IWin32Window window, Editor editor)
{
Window = window;
Editor = editor;
}
Comment on lines +279 to +285
for (int x = 0; x < columns; x++)
{
int index = (y * columns) + x;
var color = GetColorAtIndex(index);
var brush = WPFUtils.CreateFrozenBrush(color);
dc.DrawRectangle(brush, null, new Rect(x * CellWidth, y * CellHeight, CellWidth, CellHeight));
}
Comment on lines +67 to +72
public static IEnumerable<Control> AllSubControls(DependencyObject depObj)
{
if (depObj == null)
yield return (Control)Enumerable.Empty<Control>();

foreach (var child in LogicalTreeHelper.GetChildren(depObj))
Comment on lines +19 to +21

public static Brush ToWPFBrush(this Vector3 color) => new Vector4(color, 255.0f).ToWPFBrush();
public static Vector3 ToFloat3Color(this Color color) => new Vector3(color.R, color.G, color.B) / 255.0f;
Base automatically changed from Nickelony/Content-Browser to develop March 15, 2026 12:06
# Conflicts:
#	TombEditor/Controls/Panel3D/Panel3DObjectBrush.cs
@Nickelony Nickelony added this to the Version 2.0 milestone Mar 23, 2026
@Nickelony Nickelony added enhancement A task which adds something new or improves on existing features. new feature This is a new feature task. refactoring Task which involves a refactor. work in progress The Pull Request is not finished yet or needs some extra work done to it. labels Mar 23, 2026
@Nickelony Nickelony changed the title WPF port of SectorOptions, RoomOptions, Lighting and Palette ToolWindows WPF port of multiple tool windows + Convert to vertical slices 🍕 Mar 27, 2026
# Conflicts:
#	.gitignore
#	TombEditor/TombEditor.csproj
#	TombLib/TombLib.WPF/Resources/Localization/EN/TombEditor.json
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR continues the WPF migration by porting multiple TombEditor tool windows to WPF (hosted via WinForms ElementHost) and reorganizing code into feature/vertical-slice namespaces (e.g., TombEditor.Features.*). It also extends localization key resolution and aligns DarkUI.WPF styling with DarkUI runtime brightness.

Changes:

  • Ported several dockable tool windows (Palette, Lighting, Sector Options, Trigger List, Texture Panel, etc.) to WPF views/viewmodels and moved them under TombEditor.Features.*.
  • Refactored FlybyTimeline and ObjectBrush/ToolPalette into new feature namespaces and updated references/tests accordingly.
  • Added WPF/DarkUI utilities: localization component-suffix trimming, runtime brightness propagation into DarkUI.WPF resource dictionaries, and new WPF helper/converters.

Reviewed changes

Copilot reviewed 127 out of 149 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
WadTool/Program.cs Moves WPF initialization to after config/brightness is applied.
TombLib/TombLib.WPF/WPFUtils.cs Adds WPF helper utilities (color/brush conversions, control traversal, WinForms owner lookup).
TombLib/TombLib.WPF/Services/Abstract/ILocalizationService.cs Documents component-suffix trimming behavior in localization context.
TombLib/TombLib.WPF/Localizer.cs Trims known component suffixes during localization key lookup.
TombLib/TombLib.WPF/LocalizeExtension.cs Updates docs to match new component-suffix trimming behavior.
TombEditor/ToolWindows/ToolPaletteFloating.cs Removes old WinForms/DarkUI ToolPaletteFloating implementation.
TombEditor/ToolWindows/ToolPalette.cs Removes old WinForms/DarkUI ToolPalette implementation.
TombEditor/ToolWindows/SectorOptions.cs Removes old WinForms/DarkUI SectorOptions implementation.
TombEditor/ToolWindows/Palette.Designer.cs Removes old WinForms/DarkUI Palette designer.
TombEditor/ToolWindows/Palette.cs Removes old WinForms/DarkUI Palette implementation.
TombEditor/ToolWindows/MainView.Designer.cs Updates FlybyTimeline view type/namespace reference.
TombEditor/ToolWindows/Lighting.cs Removes old WinForms/DarkUI Lighting implementation.
TombEditor/TombEditor.csproj Updates compile items/resources and adds Microsoft.Xaml.Behaviors.Wpf package.
TombEditor/Program.cs Moves WPF initialization to after config/brightness is applied.
TombEditor/ObjectClipboardData.cs Updates FlybyTimeline namespace import.
TombEditor/Forms/FormMain.cs Switches tool window types to new feature namespaces (ToolPalette/ObjectBrush/etc.).
TombEditor/Forms/FormFlybyCamera.cs Updates FlybyTimeline.Sequence namespace import.
TombEditor/Features/Panel3D/ToolPalette/ToolPaletteFloating.resx Adds resource file for new ToolPaletteFloating.
TombEditor/Features/Panel3D/ToolPalette/ToolPaletteFloating.Designer.cs New namespace + Toolbox control type update.
TombEditor/Features/Panel3D/ToolPalette/ToolPaletteFloating.cs New ToolPaletteFloating implementation in feature namespace.
TombEditor/Features/Panel3D/ToolPalette/ToolPalette.resx Adds resource file for new ToolPalette.
TombEditor/Features/Panel3D/ToolPalette/ToolPalette.Designer.cs New namespace + Toolbox control type update.
TombEditor/Features/Panel3D/ToolPalette/ToolPalette.cs New ToolPalette implementation in feature namespace.
TombEditor/Features/Panel3D/ToolPalette/ToolboxViewModel.cs Renames/moves ToolBox ViewModel into feature namespace (ToolboxViewModel).
TombEditor/Features/Panel3D/ToolPalette/ToolboxView.xaml.cs Renames/moves WPF ToolboxView code-behind into feature namespace.
TombEditor/Features/Panel3D/ToolPalette/ToolboxView.xaml Updates XAML class/namespace + design-time DataContext.
TombEditor/Features/Panel3D/ToolPalette/Toolbox.resx Adds resource file for Toolbox control.
TombEditor/Features/Panel3D/ToolPalette/Toolbox.Designer.cs Moves Toolbox WinForms host control into feature namespace.
TombEditor/Features/Panel3D/ToolPalette/Toolbox.cs Moves Toolbox WinForms host control into feature namespace.
TombEditor/Features/Panel3D/ObjectBrush/ObjectBrushToolboxViewModel.cs Moves ObjectBrush toolbox VM into feature namespace and updates constants usage.
TombEditor/Features/Panel3D/ObjectBrush/ObjectBrushToolboxView.xaml.cs Moves ObjectBrush toolbox view into feature namespace.
TombEditor/Features/Panel3D/ObjectBrush/ObjectBrushToolboxView.xaml Updates XAML class/namespace + design-time DataContext.
TombEditor/Features/Panel3D/ObjectBrush/ObjectBrushToolbox.resx Adds resource file for new ObjectBrush toolbox.
TombEditor/Features/Panel3D/ObjectBrush/ObjectBrushToolbox.Designer.cs Updates toolbox host to use new view type/namespace.
TombEditor/Features/Panel3D/ObjectBrush/ObjectBrushToolbox.cs New floating toolbox wrapper that sizes to WPF content.
TombEditor/Features/Panel3D/ObjectBrush/Helper.cs Renames Helper→Helpers and adjusts object-brush helper logic/formatting.
TombEditor/Features/Panel3D/ObjectBrush/Constants.cs Adds feature-local constants for object brush behavior.
TombEditor/Features/Panel3D/ObjectBrush/Actions.cs Moves brush actions into feature namespace and updates helper references.
TombEditor/Features/FlybyTimeline/ViewModel/FlybyTimelineViewModel.Timeline.cs Updates FlybyTimeline namespaces to new feature slice.
TombEditor/Features/FlybyTimeline/ViewModel/FlybyTimelineViewModel.Sequence.cs Updates FlybyTimeline namespaces to new feature slice.
TombEditor/Features/FlybyTimeline/ViewModel/FlybyTimelineViewModel.Selection.cs Updates FlybyTimeline namespaces to new feature slice.
TombEditor/Features/FlybyTimeline/ViewModel/FlybyTimelineViewModel.Refresh.cs Updates FlybyTimeline namespaces to new feature slice.
TombEditor/Features/FlybyTimeline/ViewModel/FlybyTimelineViewModel.Properties.cs Updates FlybyTimeline namespaces to new feature slice.
TombEditor/Features/FlybyTimeline/ViewModel/FlybyTimelineViewModel.cs Updates FlybyTimeline namespaces to new feature slice.
TombEditor/Features/FlybyTimeline/ViewModel/FlybyTimelineViewModel.Cache.cs Updates FlybyTimeline namespaces to new feature slice.
TombEditor/Features/FlybyTimeline/ViewModel/FlybyCameraItemViewModel.cs Updates FlybyTimeline namespaces to new feature slice.
TombEditor/Features/FlybyTimeline/UI/FlybyTimelineView.xaml.cs Updates FlybyTimeline UI namespaces to new feature slice.
TombEditor/Features/FlybyTimeline/UI/FlybyTimelineView.xaml Updates XAML class/namespace to new feature slice.
TombEditor/Features/FlybyTimeline/UI/FlybyTimelineRenderState.cs Updates FlybyTimeline UI namespaces to new feature slice.
TombEditor/Features/FlybyTimeline/UI/FlybyTimelineMarker.cs Updates FlybyTimeline UI namespaces to new feature slice.
TombEditor/Features/FlybyTimeline/UI/FlybyTimelineControl.Viewport.cs Updates FlybyTimeline UI namespaces to new feature slice.
TombEditor/Features/FlybyTimeline/UI/FlybyTimelineControl.Rendering.cs Updates FlybyTimeline UI namespaces to new feature slice.
TombEditor/Features/FlybyTimeline/UI/FlybyTimelineControl.Input.cs Updates FlybyTimeline UI namespaces to new feature slice.
TombEditor/Features/FlybyTimeline/UI/FlybyTimelineControl.cs Updates FlybyTimeline UI namespaces to new feature slice.
TombEditor/Features/FlybyTimeline/Sequence/FlybySequenceTiming.cs Updates FlybyTimeline Sequence namespaces to new feature slice.
TombEditor/Features/FlybyTimeline/Sequence/FlybySequenceHelper.cs Updates FlybyTimeline Sequence namespaces to new feature slice.
TombEditor/Features/FlybyTimeline/Sequence/FlybySequenceCache.cs Updates FlybyTimeline Sequence namespaces to new feature slice.
TombEditor/Features/FlybyTimeline/Preview/FlybyPreviewController.cs Updates FlybyTimeline Preview namespaces to new feature slice.
TombEditor/Features/FlybyTimeline/Preview/FlybyPreview.cs Updates FlybyTimeline Preview namespaces to new feature slice.
TombEditor/Features/FlybyTimeline/Preview/FlybyFrameState.cs Updates FlybyTimeline Preview namespaces to new feature slice.
TombEditor/Features/FlybyTimeline/FlybyConstants.cs Updates FlybyTimeline root namespace to new feature slice.
TombEditor/Features/DockableViews/TriggerList/TriggerListView.xaml.cs Adds new WPF TriggerList view code-behind.
TombEditor/Features/DockableViews/TriggerList/TriggerListView.xaml Adds new WPF TriggerList XAML layout.
TombEditor/Features/DockableViews/TriggerList/TriggerList.resx Adds resource file for TriggerList.
TombEditor/Features/DockableViews/TriggerList/TriggerList.Designer.cs Moves TriggerList tool window into feature namespace.
TombEditor/Features/DockableViews/TriggerList/TriggerList.cs Moves TriggerList tool window into feature namespace.
TombEditor/Features/DockableViews/TexturePanel/TexturePanelView.xaml.cs Adds new WPF TexturePanel view code-behind.
TombEditor/Features/DockableViews/TexturePanel/TexturePanelView.xaml Adds new WPF TexturePanel XAML layout.
TombEditor/Features/DockableViews/TexturePanel/TexturePanel.resx Adds resource file for TexturePanel.
TombEditor/Features/DockableViews/TexturePanel/TexturePanel.Designer.cs Moves TexturePanel tool window into feature namespace.
TombEditor/Features/DockableViews/TexturePanel/TexturePanel.cs Minor formatting change in TexturePanel update logic.
TombEditor/Features/DockableViews/SectorOptionsPanel/SectorOptionsViewModel.cs Adds WPF SectorOptions VM with command wiring and version-dependent UI state.
TombEditor/Features/DockableViews/SectorOptionsPanel/SectorOptionsView.xaml.cs Adds SectorOptions WPF view host + cleanup/event bridging.
TombEditor/Features/DockableViews/SectorOptionsPanel/SectorOptions.resx Adds resource file for SectorOptions.
TombEditor/Features/DockableViews/SectorOptionsPanel/SectorOptions.Designer.cs Adds WinForms ElementHost wrapper for SectorOptions WPF view.
TombEditor/Features/DockableViews/SectorOptionsPanel/SectorOptions.cs Adds Dockable SectorOptions tool window wrapper + cleanup.
TombEditor/Features/DockableViews/RoomOptionsPanel/RoomOptionsView.xaml.cs Adds RoomOptions WPF view host + cleanup.
TombEditor/Features/DockableViews/RoomOptionsPanel/RoomOptions.resx Adds resource file for RoomOptions.
TombEditor/Features/DockableViews/RoomOptionsPanel/RoomOptions.Designer.cs Adds WinForms ElementHost wrapper for RoomOptions WPF view.
TombEditor/Features/DockableViews/RoomOptionsPanel/RoomOptions.cs Adds RoomOptions tool window wrapper + cleanup.
TombEditor/Features/DockableViews/PalettePanel/PaletteViewModel.cs Adds Palette WPF VM and command wiring.
TombEditor/Features/DockableViews/PalettePanel/PaletteView.xaml.cs Adds Palette WPF view host + event bridging and palette sync.
TombEditor/Features/DockableViews/PalettePanel/PaletteView.xaml Adds Palette WPF XAML layout with icon-only buttons and PaletteGrid.
TombEditor/Features/DockableViews/PalettePanel/Palette.resx Adds resource file for Palette.
TombEditor/Features/DockableViews/PalettePanel/Palette.Designer.cs Adds WinForms ElementHost wrapper for Palette WPF view.
TombEditor/Features/DockableViews/PalettePanel/Palette.cs Adds Palette tool window wrapper + cleanup.
TombEditor/Features/DockableViews/ObjectList/ObjectListView.xaml.cs Adds new WPF ObjectList view code-behind.
TombEditor/Features/DockableViews/ObjectList/ObjectListView.xaml Adds new WPF ObjectList XAML layout.
TombEditor/Features/DockableViews/ObjectList/ObjectList.resx Adds resource file for ObjectList.
TombEditor/Features/DockableViews/ObjectList/ObjectList.Designer.cs Moves ObjectList tool window into feature namespace.
TombEditor/Features/DockableViews/ObjectList/ObjectList.cs Moves ObjectList tool window into feature namespace.
TombEditor/Features/DockableViews/LightingPanel/LightingViewModel.cs Adds Lighting WPF VM (bindings, enablement logic, commands).
TombEditor/Features/DockableViews/LightingPanel/LightingView.xaml.cs Adds Lighting WPF view host + cleanup.
TombEditor/Features/DockableViews/LightingPanel/Lighting.resx Adds resource file for Lighting.
TombEditor/Features/DockableViews/LightingPanel/Lighting.Designer.cs Adds WinForms ElementHost wrapper for Lighting WPF view.
TombEditor/Features/DockableViews/LightingPanel/Lighting.cs Adds Lighting tool window wrapper + cleanup.
TombEditor/Features/DockableViews/ItemBrowser/ItemBrowserView.xaml.cs Adds new WPF ItemBrowser view code-behind.
TombEditor/Features/DockableViews/ItemBrowser/ItemBrowserView.xaml Adds new WPF ItemBrowser XAML layout.
TombEditor/Features/DockableViews/ItemBrowser/ItemBrowser.resx Adds resource file for ItemBrowser.
TombEditor/Features/DockableViews/ItemBrowser/ItemBrowser.Designer.cs Moves ItemBrowser tool window into feature namespace.
TombEditor/Features/DockableViews/ItemBrowser/ItemBrowser.cs Moves ItemBrowser tool window into feature namespace; minor formatting.
TombEditor/Features/DockableViews/ImportedGeometryBrowser/ImportedGeometryBrowserView.xaml.cs Adds new WPF ImportedGeometryBrowser view code-behind.
TombEditor/Features/DockableViews/ImportedGeometryBrowser/ImportedGeometryBrowserView.xaml Adds new WPF ImportedGeometryBrowser XAML layout.
TombEditor/Features/DockableViews/ImportedGeometryBrowser/ImportedGeometryBrowser.resx Adds resource file for ImportedGeometryBrowser.
TombEditor/Features/DockableViews/ImportedGeometryBrowser/ImportedGeometryBrowser.Designer.cs Moves ImportedGeometryBrowser tool window into feature namespace.
TombEditor/Features/DockableViews/ImportedGeometryBrowser/ImportedGeometryBrowser.cs Moves ImportedGeometryBrowser tool window into feature namespace.
TombEditor/Features/DockableViews/ContentBrowser/FilterOption.cs Extracts FilterOption into its own file under feature namespace.
TombEditor/Features/DockableViews/ContentBrowser/ContentBrowserViewModel.cs Moves ContentBrowser VM to feature namespace and extracts nested types.
TombEditor/Features/DockableViews/ContentBrowser/ContentBrowserView.xaml.cs Moves ContentBrowser view code-behind to feature namespace.
TombEditor/Features/DockableViews/ContentBrowser/ContentBrowserView.xaml Updates XAML class/namespace and DataTemplate type mapping.
TombEditor/Features/DockableViews/ContentBrowser/ContentBrowser.Designer.cs Updates designer to host feature-namespace ContentBrowserView.
TombEditor/Features/DockableViews/ContentBrowser/ContentBrowser.cs Moves ContentBrowser tool window to feature namespace.
TombEditor/Features/DockableViews/ContentBrowser/AssetItemViewModel.cs Extracts AssetItemViewModel into its own file under feature namespace.
TombEditor/Features/DockableViews/ContentBrowser/AssetCategory.cs Extracts AssetCategory enum into its own file under feature namespace.
TombEditor/Editor.cs Updates FlybyTimeline Preview namespace import.
TombEditor/Controls/Panel3D/Panel3DObjectBrush.cs Repoints object brush calls/constants to new feature namespace.
TombEditor/Controls/Panel3D/Panel3DHelpers.cs Updates FlybyTimeline Sequence namespace import.
TombEditor/Controls/Panel3D/Panel3DCameraMovement.cs Updates FlybyTimeline Preview namespace import.
TombEditor/Controls/Panel3D/Panel3D.cs Updates FlybyTimeline Preview namespace import.
TombEditor/Controls/ObjectBrush/ObjectBrushToolbox.cs Removes old ObjectBrushToolbox implementation (replaced by feature version).
TombEditor/Controls/ObjectBrush/ObjectBrushConstants.cs Removes old ObjectBrush constants (replaced by feature version).
TombEditor/Command.cs Adds ICommand wrapper API for existing command system; updates usings for new tool windows.
TombEditor.Tests/FlybyTimeline/FlybySequenceTimingTests.cs Updates FlybyTimeline namespaces used by tests.
TombEditor.Tests/FlybyTimeline/FlybySequenceHelperTests.cs Updates FlybyTimeline namespaces used by tests.
TombEditor.Tests/FlybyTimeline/FlybySequenceCacheTests.cs Updates FlybyTimeline namespaces used by tests.
TombEditor.Tests/FlybyTimeline/FlybyPreviewTests.cs Updates FlybyTimeline namespaces used by tests.
DarkUI/DarkUI/Config/Colors.cs Adds HasBrightnessChanged flag for WPF resource dictionary integration.
DarkUI/DarkUI.WPF/Styles/NumericUpDown.xaml Ensures NumericUpDown foreground uses theme text brush.
DarkUI/DarkUI.WPF/Styles/Icon.xaml Adds icon opacity binding to theme resource.
DarkUI/DarkUI.WPF/Styles/ColorPickerButton.xaml Fixes ColorPickerButton border thickness resource usage.
DarkUI/DarkUI.WPF/Dictionaries/LightColors.xaml Adds Opacity_Icon resource.
DarkUI/DarkUI.WPF/Dictionaries/DarkColors.xaml.cs Adds code-behind to apply DarkUI runtime colors when brightness changes.
DarkUI/DarkUI.WPF/Dictionaries/DarkColors.xaml Adds x:Class and Opacity_Icon resource.
DarkUI/DarkUI.WPF/Dictionaries/BlackColors.xaml Adds Opacity_Icon resource.
DarkUI/DarkUI.WPF/DarkUI.WPF.csproj Adds reference to DarkUI project for runtime color synchronization.
DarkUI/DarkUI.WPF/Converters/VectorToUIColorConverter.cs Adds Vector4↔WPF Color converter.
DarkUI/DarkUI.WPF/Converters/VectorToBrushConverter.cs Adds Vector4↔WPF Brush converter.
DarkUI/DarkUI.WPF/Converters/HtmlToUIColorConverter.cs Adds HTML↔WPF Color converter.
Files not reviewed (9)
  • TombEditor/Features/DockableViews/LightingPanel/Lighting.Designer.cs: Language not supported
  • TombEditor/Features/DockableViews/PalettePanel/Palette.Designer.cs: Language not supported
  • TombEditor/Features/DockableViews/RoomOptionsPanel/RoomOptions.Designer.cs: Language not supported
  • TombEditor/Features/DockableViews/SectorOptionsPanel/SectorOptions.Designer.cs: Language not supported
  • TombEditor/ToolWindows/Lighting.Designer.cs: Language not supported
  • TombEditor/ToolWindows/MainView.Designer.cs: Language not supported
  • TombEditor/ToolWindows/Palette.Designer.cs: Language not supported
  • TombEditor/ToolWindows/RoomOptions.Designer.cs: Language not supported
  • TombEditor/ToolWindows/SectorOptions.Designer.cs: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +14 to +15
public static System.Windows.Forms.IWin32Window? GetWin32WindowFromCaller(INotifyPropertyChanged caller)
=> System.Windows.Forms.Application.OpenForms.Count > 0 ? System.Windows.Forms.Application.OpenForms[0] : null;
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetWin32WindowFromCaller can return null when no WinForms forms are open, but many commands ultimately pass args.Window into EditorActions/DarkMessageBox APIs that expect a non-null owner. This can lead to runtime exceptions or dialogs without an owner. Consider ensuring a non-null owner (e.g., resolve the active Form, fall back to a hidden NativeWindow wrapper/IntPtr.Zero, or make CommandArgs.Window nullable and handle null in the called code).

Copilot uses AI. Check for mistakes.
Comment on lines +63 to +67
SetFloorCommand = CommandHandler.GetCommand("SetFloor", new CommandArgs(WPFUtils.GetWin32WindowFromCaller(this), _editor));
SetCeilingCommand = CommandHandler.GetCommand("SetCeiling", new CommandArgs(WPFUtils.GetWin32WindowFromCaller(this), _editor));
SetBoxCommand = CommandHandler.GetCommand("SetBox", new CommandArgs(WPFUtils.GetWin32WindowFromCaller(this), _editor));
SetNotWalkableCommand = CommandHandler.GetCommand("SetNotWalkable", new CommandArgs(WPFUtils.GetWin32WindowFromCaller(this), _editor));
SetMonkeyswingCommand = CommandHandler.GetCommand("SetMonkeyswing", new CommandArgs(WPFUtils.GetWin32WindowFromCaller(this), _editor));
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CommandArgs is constructed with WPFUtils.GetWin32WindowFromCaller(this), which can be null; many commands use args.Window as the owner for dialogs/message boxes, so a null owner can cause runtime failures or unowned dialogs. Consider resolving a non-null owner window (e.g., active Form) or providing a safe fallback when building CommandArgs.

Copilot uses AI. Check for mistakes.
Comment on lines +194 to +198
[RelayCommand]
private void EditLightColor()
{
EditorActions.EditLightColor(WPFUtils.GetWin32WindowFromCaller(this));
}
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EditLightColor passes WPFUtils.GetWin32WindowFromCaller(this) as the dialog owner, but that helper can return null when no WinForms form is open. EditorActions.EditLightColor expects a non-null IWin32Window (it calls ShowDialog(owner)), so this can throw at runtime. Consider providing a non-null owner (active Form) or a safe fallback before calling.

Copilot uses AI. Check for mistakes.
Comment on lines +68 to +72
{
if (depObj == null)
yield return (Control)Enumerable.Empty<Control>();

foreach (var child in LogicalTreeHelper.GetChildren(depObj))
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AllSubControls has a broken null-guard: it attempts to cast Enumerable.Empty() to Control (won’t compile) and then still calls LogicalTreeHelper.GetChildren(depObj) even when depObj is null (will throw). Replace this with an early yield break (and/or make the parameter nullable) before iterating children.

Copilot uses AI. Check for mistakes.
Comment thread TombLib/TombLib.WPF/WPFUtils.cs
Comment thread TombEditor/Command.cs
Comment on lines +92 to +94
var command = GetCommand(name);
return new CommunityToolkit.Mvvm.Input.RelayCommand(
() => command.Execute?.Invoke(args));
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetCommand(name, CommandArgs args) captures a single CommandArgs instance inside the returned RelayCommand. If args.Window is null/stale at construction time (common during startup), it will remain wrong for all future executions. Consider changing this overload to accept a factory (e.g., Func) so the owner window can be resolved at execution time, or validate args.Window before invoking.

Suggested change
var command = GetCommand(name);
return new CommunityToolkit.Mvvm.Input.RelayCommand(
() => command.Execute?.Invoke(args));
return GetCommand(name, () =>
{
IWin32Window window = args?.Window;
if (window == null || (window is Control control && control.IsDisposed))
window = Form.ActiveForm;
return new CommandArgs
{
Editor = args?.Editor,
Window = window,
KeyData = args?.KeyData ?? Keys.None
};
});
}
public static System.Windows.Input.ICommand GetCommand(string name, Func<CommandArgs> argsFactory)
{
var command = GetCommand(name);
return new CommunityToolkit.Mvvm.Input.RelayCommand(
() => command.Execute?.Invoke(argsFactory?.Invoke()));

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement A task which adds something new or improves on existing features. new feature This is a new feature task. refactoring Task which involves a refactor. work in progress The Pull Request is not finished yet or needs some extra work done to it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants