Unify menu presentation and fix UI regressions
This commit is contained in:
parent
3734d4a168
commit
b18d9392d8
35 changed files with 588 additions and 361 deletions
28
player/player_visual_presenter.gd
Normal file
28
player/player_visual_presenter.gd
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
class_name PlayerVisualPresenter
|
||||
extends RefCounted
|
||||
|
||||
const PlayerScene: PackedScene = preload("res://player/player.tscn")
|
||||
|
||||
|
||||
static func instantiate_visuals() -> Node3D:
|
||||
var source: Player = PlayerScene.instantiate()
|
||||
var visuals := source.get_node("Visuals") as Node3D
|
||||
var presentation := visuals.duplicate(
|
||||
Node.DUPLICATE_SIGNALS
|
||||
| Node.DUPLICATE_GROUPS
|
||||
| Node.DUPLICATE_SCRIPTS
|
||||
| Node.DUPLICATE_USE_INSTANTIATION
|
||||
) as Node3D
|
||||
source.free()
|
||||
presentation.name = "PlayerVisuals"
|
||||
return presentation
|
||||
|
||||
|
||||
static func apply_appearance(
|
||||
_visuals: Node3D,
|
||||
snapshot: Dictionary,
|
||||
) -> void:
|
||||
# Gameplay and preview deliberately share this presentation seam. Modular
|
||||
# visual parts can be applied here without coupling Profile to Player.
|
||||
if not CharacterCustomizationCatalog.validate_snapshot(snapshot):
|
||||
return
|
||||
Loading…
Add table
Add a link
Reference in a new issue