Replace auto paint persistence with a named painting library
Persistence rework: - Drop auto-load on setup and auto-save on teardown; the painter now always seeds fresh from the material. - Named slots under MeshPaint/Saved/<name>.paint via the existing CHMP machinery: SavePaintAs / LoadPaintByName / DeletePaint / ListSavedPaintings / PaintExists. Slot files carry the display name in the header. - Remove the obsolete persistence partials (PlayerCharacterController, PlayerPoseController, ThirdPersonOrbitInput) and their references. Paintings HUD panel: - Authored Panel_Paintings + Save/Load/Delete dialogs into PaintHudPanel.prefab (TMP throughout); PaintHud.Library.cs is now a pure binder that clones the entry template per slot. - Save dialog blocks empty/existing names; Load and Delete confirm first. - Fix dialog z-order: open dialogs SetAsLastSibling so a dragged panel can no longer cover them. - Lib_ListContent horizontal offsets corrected to 0 (was clipping entry labels out of the masked viewport). Multiplayer: - Loading a painting re-syncs to all peers via the snapshot broadcast path (BroadcastLoadedPaint), covering later late-joiners for free. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
56caa0edd8
commit
ee482905f9
16 files changed
+4586
-521
No files matched your search
@@ -117,6 +117,9 @@ public partial class PaintHud : MonoBehaviour
|
||||
_panel = go;
|
||||
}
|
||||
|
||||
// The paint library now lives inside the authored layout prefab; bind its widgets like the brush panel.
|
||||
BindLibrary(_panel ? _panel.transform : null);
|
||||
|
||||
// Bind to a painter as soon as one exists. With networked spawn-on-connect there is none
|
||||
// at scene start; BindLocalPlayer then raises PainterChanged when the local avatar spawns
|
||||
// and OnPainterChanged wires the widgets. In a non-networked scene the painter is already
|
||||
@@ -155,6 +158,8 @@ public partial class PaintHud : MonoBehaviour
|
||||
|
||||
// Restore the saved panel positions + widget values now that the painter exists.
|
||||
RestoreHudState();
|
||||
|
||||
UpdateButtonStates(); // enable Save now that a painter is bound
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
@@ -165,7 +170,13 @@ public partial class PaintHud : MonoBehaviour
|
||||
|
||||
private void OnModeChanged(GameMode mode)
|
||||
{
|
||||
if (_panel) _panel.SetActive(mode is PaintMode);
|
||||
bool paint = mode is PaintMode;
|
||||
if (_panel) _panel.SetActive(paint); // toggles the brush panels and the library panel together
|
||||
if (paint)
|
||||
{
|
||||
if (_libraryBound) RefreshList(); // pick up slots saved/changed since last shown
|
||||
}
|
||||
else HideDialogs();
|
||||
}
|
||||
|
||||
private static Font LoadFont()
|
||||
|
||||
Reference in new issue
Block a user