Commit Graph

17 Commits

Author SHA1 Message Date
8f7476d2db Mandatory actors auto-spawn + navmesh surface overlay (custom material)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 16:14:27 +02:00
93b9c7d927 template demo 2026-04-24 10:44:44 +02:00
5b9174bdcd hud 2026-04-18 20:20:57 +02:00
bc226338e0 hud 2026-04-18 20:13:33 +02:00
bdceecbe56 Add 3-way UI mode switch: Legacy / NewSlate / UMG
Introduce a switchable UI stack so the original Slate widget stays available
as a fallback while the new CodeDesign-inspired redesign and a future UMG
Widget Blueprint implementation coexist.

- PS_Editor_MainWidget_Legacy: pre-refactor Slate widget, restored from HEAD
- PS_Editor_MainWidget: refactored floating-HUD Slate widget with style asset,
  9-slice panels/buttons, rounded brushes, icon pack, Play/Pause/Stop icons,
  spec-aligned palette and radii, File dropdown, outliner per-item icons,
  command palette
- PS_Editor_MainWidget_UMG: abstract base class exposing a Blueprint-callable
  API (SetTransformMode, SaveScenario, Simulate, Selection...) and delegates
  (OnToolChanged, OnSelectionChanged...) so a WBP deriving from it can drive
  the editor end-to-end
- APS_Editor_HUD: UIMode enum + UMGWidgetClass soft ref, picks the right
  widget at BeginPlay; separate typed accessors for each flavor

Adds UI style system (UPS_Editor_UIStyleAsset DataAsset + FPS_Editor_UIStyle
helper) with runtime PNG loading for icons and 9-slice brushes from
Content/UI/icons/ and Content/UI/unreal_9slice/.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 19:57:04 +02:00
27ff2e8d8f temp for later 2026-04-14 20:40:06 +02:00
9c43fd523a Standalone editor: scenario workflow, BaseLevel combo, ReturnToEditor
Editor workflow:
- Removed auto-detection of BaseLevel (strip _Editor). Editor is standalone.
- User selects BaseLevel from ComboBox (populated from MasterCatalog.BaseLevels)
- "None" option for editing without a base level
- Selecting BaseLevel: clears current scenario, hides persistent level actors,
  loads sublevel. Selecting "None" restores persistent level actors.

UI terminology: Scene → Scenario (save field, buttons, notifications)

GameInstanceSubsystem:
- Renamed PendingSceneName → PendingScenarioName
- Added LastEditedScenarioName/LastEditedBaseLevel (persist after Consume)
- SetPendingScenario() stores in both Pending and LastEdited
- ReturnToEditor() restores Pending from LastEdited, opens editor map
- EditorMapName auto-saved on first Play, used by ReturnToEditor
- OpenEditor() / ReturnToEditor() callable from gameplay BP

Play button: resets input mode before OpenLevel (fixes cursor in FirstPerson GM)

Test assets: FirstPerson template for testing Play/ReturnToEditor flow

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 16:12:10 +02:00
861c15c193 Unify spline creation/editing into single seamless mode
Major UX simplification:
- Removed SplineEditing mode — single SplinePlacement mode handles both
  creation and editing with identical behavior
- Actor spawned and tracked on first click (no "finish" step needed)
- Each point add/insert/move has individual undo
- Right-click always = camera fly (no special handling during creation)
- Escape/Done just exits edit mode, nothing to "finish"

Catalog system:
- MasterCatalog DataAsset groups multiple SpawnCatalogs (Tools, Characters, Props)
- PlayerController references one MasterCatalog instead of single catalog
- SpawnManager.AddCatalog() loads sub-catalogs incrementally
- Factory for MasterCatalog creation in Content Browser

Spline polish:
- SplineActor has built-in SpawnableComponent + EditableComponent
- SplineColor/SplineSelectedColor/SplineTag as UPROPERTY for BP variants
- All spline point operations use World coordinate space (fixes snap-to-ground)
- Snap-to-ground ignores gizmo actor (was hitting gizmo guide lines)
- Tube mesh collision forced with UpdateBounds after CreateMeshSection
- Tube insert and handle selection include active placement actor (not just selected)
- Notification bar shows contextual Delete Point button when CP selected

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 11:06:04 +02:00
ca4f7ee355 Refactor spline system with IPS_Editor_PointPlaceable interface
Architecture:
- New IPS_Editor_PointPlaceable interface for any actor using click-to-place-
  points placement. Decouples the placement system from SplineActor so future
  actors (patrol routes, area polygons) can reuse the same flow.
- SplineActor implements the interface. BP subclasses with SpawnableComponent
  appear in the catalog and automatically enter placement mode when spawned.
- PlayerController methods renamed: BeginPointPlacement/FinishPointPlacement/
  CancelPointPlacement (generic, interface-driven).

Features added:
- SplineColor, SplineSelectedColor, SplineTag as UPROPERTY for BP overrides
- UpdateSplineMaterials() for runtime color changes
- Tube visualization (8-segment cylinder) replacing cross-ribbon
- Spline editing mode with Edit/Done buttons in notification bar
- Delete spline point (Del key or Delete Point button, min 2 points)
- Insert point by clicking on tube mesh in edit mode
- Snap spline point to ground (End key)
- Append points to existing spline (S key or catalog when spline selected)
- Notification bar: contextual messages and buttons per mode
- Auto-generated M_PS_Editor_SplineLine material (unlit opaque, depth tested)
- Material swap: opaque when deselected, no-depth-test when selected
- Serialization of SplineColor/SplineTag in CustomProperties

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 09:44:26 +02:00
1f4b3994ff Add runtime spline creation and editing (WIP)
Spline placement: New Spline button (S key) enters placement mode where clicks
add control points. Right-click/Enter finishes, Escape cancels. Min 2 points.
Spline visualization as cross-shaped quad strip (vertical + horizontal ribbons).

Point editing: select spline to show handles, click a handle to position gizmo
on it, then use translate gizmo to move individual points. Undo supported via
full-state snapshots (SplinePointAction).

Visual feedback: auto-generated M_PS_Editor_SplineLine material (unlit opaque
with depth test) for normal state. Gizmo material (no depth test) for selected
state. Center cube at centroid for whole-spline selection. Handles highlight
on selection.

Serialization: spline points exported to CustomProperties (PointCount + Point_N).
C++ class fallback via FindObject for LoadScene. Spline appears in scene outliner.

Still WIP: depth material swap on selection, serialization edge cases, and
point editing polish to be refined.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 22:44:04 +02:00
50087e5dfb Add runtime property editing, scene outliner, and spawned-only selection
Property Editing:
- New EditableComponent with two-step dropdown (Select Component → Add Property)
  to declare which properties are exposed in the runtime editor
- Dynamic property panel below Transform: supports float, bool, string, FVector,
  FRotator, FLinearColor with per-tick refresh and keyboard focus guard
- PropertyAction undo/redo via ExportText/ImportText reflection
- Custom properties serialized to JSON (TMap in ActorData, version 2)
- Copy/paste/duplicate propagate custom property values

Scene Outliner:
- Scrollable list of spawned actors in the right panel
- Click to select, selected actor highlighted in blue
- Auto-refreshes when actors are added/removed

Selection Filter:
- Only actors spawned by the editor (catalogue, duplicate, paste, load)
  are selectable — static scene geometry is no longer clickable

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 21:15:07 +02:00
03c79a2610 Add auto-generated selection outline post-process and gizmo polish
Selection Outline:
- Post-process material auto-generated in C++ (no manual UE editor work)
- 8-neighbor edge detection on CustomStencil buffer
- Dynamic pixel-accurate offsets via SceneTexture InvSize (any resolution/ratio)
- Lerp blending (no overexposure), color AF1500, 1px thickness
- BL_SceneColorAfterDOF placement (before TAA, matches stencil resolution)
- Deferred creation via OnPostEngineInit (no startup crash)
- Material saved as persistent .uasset, loaded at runtime

Gizmo Polish:
- Arrow shaft thickness halved (0.03), cone tips halved (0.075x0.1)
- Gizmo stays at initial position during rotation/scale (no jitter)
- Gizmo follows selection during translation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 10:36:53 +02:00
5be3a777f9 Add selection outline post-process setup (material pending)
- PostProcessComponent on Pawn (unbound, applies to entire scene)
- Auto-loads M_PS_Editor_SelectionOutline material at BeginPlay
- Removed debug bounding box from Tick
- Custom depth stencil already toggled on selected actors
- Material needs to be created in UE editor (edge detection on CustomStencil)
- Instructions: use TexCoord + Constant2Vector offsets for 4-neighbor sampling

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 21:28:24 +02:00
36b04bee61 Add Phase 4: JSON scene save/load system
Serialization:
- SceneData USTRUCT with Version, SceneName, Timestamp, Actors array
- ActorData: ClassPath, Location, Rotation, Scale per spawned actor
- SceneSerializer: SaveScene/LoadScene/ClearScene/GetSavedSceneNames
- Files stored in Saved/PS_Editor/Scenes/{name}.json
- Uses FJsonObjectConverter for clean USTRUCT-to-JSON conversion

SpawnManager:
- Tracks all spawned actors in SpawnedActors array
- SpawnActorDirect: spawn from class/transform (used by scene loading)
- DestroyAllSpawnedActors: clean scene clear

UI:
- Save field + button in toolbar area
- New Scene button to clear all spawned actors
- Saved scenes list with click-to-load
- Auto-refreshes scene list after save
- Clears selection on load/new

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 20:31:15 +02:00
9f1604f57c Add Phase 3: object spawn system with catalogue UI
Spawn System:
- SpawnableComponent: marker component for Blueprint actors (name, category, thumbnail)
- SpawnCatalog DataAsset: lists all spawnable Blueprints with Factory for easy creation
- SpawnManager: loads catalog, spawns actors in front of camera, ensures Movable mobility
- Reads metadata from Blueprint component templates (no temp spawn needed)

Catalogue UI:
- Left panel with scrollable list grouped by category
- Thumbnail cards (80x80) with name below, click to spawn
- "Capture All Thumbnails" button on DataAsset: auto-generates from UE thumbnails

Undo/Redo improvements:
- SpawnAction: undo hides spawned actor, redo shows it
- Delete confirmation dialog (Yes/No) before soft-delete
- Undo/redo auto-deselects hidden actors and refreshes gizmo
- Proper cleanup of hidden actors when actions pruned from stack

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 20:17:57 +02:00
8b2609669f Add Phase 2 selection system and translate gizmo
- Click-to-select with raycast (Movable actors only)
- Ctrl+click for multi-select, click empty to deselect
- Click vs drag detection (pixel threshold) to avoid accidental selection
- SelectionManager owned by PlayerController with OnSelectionChanged delegate
- Custom depth stencil toggling on selected actors
- Debug bounding box visualization for selection
- Custom translate gizmo actor with colored arrows (R/G/B) and cone tips
- Gizmo renders on top of scene (SDPG_Foreground + Translucent depth test disabled)
- Constant screen-size gizmo scaling based on camera distance
- Unlit gizmo material with Color vector parameter (M_PS_Editor_Gizmo)
- r.CustomDepth=3 enabled for future outline post-process

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 15:06:11 +02:00
b089a20512 Add PS_Editor plugin Phase 1: GameMode + Camera navigation
Runtime editor plugin with UE viewport-style camera controls:
- ZQSD/Arrows movement (always active), E/A for up/down
- LMB: pan (horizontal move + yaw), RMB: free fly look
- Alt+LMB / MMB: orbit around focal point, scroll: zoom
- HUD with controls help, cursor auto-hide during camera ops

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 12:33:55 +02:00