Espelho do AttributeSystem do servidor (Game/MMO/Modules/AttributeSystem).
Sub-modulo C++ Source/ZMMOAttributes/ (Runtime, LoadingPhase=PreDefault)
isolando o cliente do AttributeSystem em pasta propria — pavimentando o
caminho para futuros Inventory/Skills/Combat virem como sub-modulos peer.
Componentes:
- FZMMOAttributesSnapshot (USTRUCT Blueprint, espelha
FZeusAttributesPayload do plugin ZeusNetwork)
- UZMMOAttributeComponent (UActorComponent ligado ao player):
ApplySnapshot / ApplyHpSpUpdate / NotifyLevelUp + 3 delegates
dinamicos (OnAttributesChanged / OnHpSpChanged / OnLevelUp) +
helpers GetHpRatio / GetSpRatio
- UZMMOAttributeNetworkHandler (UWorldSubsystem): ponte
UZeusNetworkSubsystem -> componente via lookup por EntityId
- UZMMOHudHpSpWidget (UUserWidget base): BindWidget (HpBar, SpBar) +
BindWidgetOptional (HpText, SpText, LevelText). NativeConstruct
binda nos delegates do componente; NativeDestruct desliga.
OnSnapshotApplied / OnHpSpDelta (BlueprintNativeEvent) com impl
C++ atualizando progress bars e textos.
Integracao no PlayerCharacter:
- CreateDefaultSubobject<UZMMOAttributeComponent> no ctor
- HudHpSpWidgetClass (TSubclassOf) resolvido via
ConstructorHelpers::FClassFinder em /Game/ZMMO/UI/HUD/WBP_HUD_HpSpBar
- HandleLocalSpawnReady seed do EntityId no componente + spawn do HUD
(CreateWidget + AddToViewport + BindToAttributeComponent)
- EndPlay remove widget do parent
WBP_HUD_HpSpBar (UMG, criado via MCP):
- Overlay root + SizeBox (320x120) + VerticalBox
- 5 widgets BindWidget: LevelText, HpBar (vermelho), HpText,
SpBar (azul), SpText
- Herda de UZMMOHudHpSpWidget
Verificacao (smoke test):
- PIE login -> server envia S_ATTRIBUTE_SNAPSHOT_FULL
- Cliente recebe via OnAttributeSnapshotFull -> handler roteia pra
componente do entity -> ApplySnapshot dispara OnAttributesChanged ->
widget atualiza ProgressBars + TextBlocks
- HUD aparece no canto inferior esquerdo da tela com valores
correspondentes ao DB
Refs:
- Plano: C:/Users/mateu/.claude/plans/temos-uma-lab-input-nested-diffie.md
- Server companion commit: feat(attributes): AttributeSystem modular
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
73 lines
1.1 KiB
Plaintext
73 lines
1.1 KiB
Plaintext
{
|
|
"FileVersion": 3,
|
|
"EngineAssociation": "5.7",
|
|
"Category": "",
|
|
"Description": "",
|
|
"Modules": [
|
|
{
|
|
"Name": "ZMMO",
|
|
"Type": "Runtime",
|
|
"LoadingPhase": "Default"
|
|
},
|
|
{
|
|
"Name": "ZMMOAttributes",
|
|
"Type": "Runtime",
|
|
"LoadingPhase": "PreDefault"
|
|
}
|
|
],
|
|
"Plugins": [
|
|
{
|
|
"Name": "ModelingToolsEditorMode",
|
|
"Enabled": true
|
|
},
|
|
{
|
|
"Name": "StateTree",
|
|
"Enabled": true
|
|
},
|
|
{
|
|
"Name": "GameplayStateTree",
|
|
"Enabled": true
|
|
},
|
|
{
|
|
"Name": "VisualStudioTools",
|
|
"Enabled": true,
|
|
"SupportedTargetPlatforms": [
|
|
"Win64"
|
|
],
|
|
"MarketplaceURL": "com.epicgames.launcher://ue/marketplace/product/362651520df94e4fa65492dbcba44ae2"
|
|
},
|
|
{
|
|
"Name": "ZeusNetwork",
|
|
"Enabled": true
|
|
},
|
|
{
|
|
"Name": "ZeusMapTools",
|
|
"Enabled": true,
|
|
"TargetAllowList": [
|
|
"Editor"
|
|
]
|
|
},
|
|
{
|
|
"Name": "ZeusUMGForge",
|
|
"Enabled": true,
|
|
"TargetAllowList": [
|
|
"Editor"
|
|
]
|
|
},
|
|
{
|
|
"Name": "meshy",
|
|
"Enabled": false,
|
|
"SupportedTargetPlatforms": [
|
|
"Win64",
|
|
"Mac"
|
|
]
|
|
},
|
|
{
|
|
"Name": "CommonUI",
|
|
"Enabled": true
|
|
}
|
|
],
|
|
"AdditionalPluginDirectories": [
|
|
"../../Server/Plugins/Unreal"
|
|
]
|
|
} |