3 Commits

Author SHA1 Message Date
98dce2f855 feat(zeus-gas): M7 - migrate HUD/Status to UZeusGASComponent + delete legacy
- ZeusHudWidget: porta de UZeusAttributeComponent legacy pra UZeusGASComponent
  (delegate OnSnapshotAppliedRaw via AddUObject; FZeusAttributesSnapshot
  construido pelo helper estatico FromPayload do plugin ZeusGAS). Logs
  diagnosticos no bind.
- UIPlayerStatus_Window: mesmo porte (snapshot raw + StatAllocReply). Lock
  de spam-click preservado.
- ZeusHudHpSpWidget: movido do plugin ZeusAttributes (deletado) pra ZMMO
  /Game/UI/InGame/. API preservada (WBP filhos nao precisam mudar).
- ZeusCharacter: tira o dual-seed legacy; so' seedea UZeusGASComponent
  via FindComponentByClass no HandleLocalSpawnReady.
- ZeusPlayerState/ZeusCharacter: comentarios atualizados pra refletir o
  UZeusGASComponent como dono unico.
- ZMMO.Build.cs: remove dep "ZeusAttributes", adiciona "ZeusGAS" +
  "GameplayAbilities".
- ZMMO.uproject: remove module "ZeusAttributes" (delete completo).
- DefaultGame.ini: remove linha legacy comentada do Component Registry.
- DefaultEngine.ini: adiciona [CoreRedirects] pra:
  * ZMMOJobs module + ZMMOJobDataAsset class (Package+Class) — 7 DA_Job_*
  * ZMMO.ZMMOMapDef struct (DT_Maps row)
  * ZMMO.ZMMOLoadingTipRow struct (DT_LoadingTips row)
  * ZMMO.ZMMOLoadingProfile/StepDef structs + EZMMOLoadingContext/StepStatus
    enums (DA_LoadingProfiles)
- DELETE: Source/ZeusAttributes/ inteiro (5 .cpp + 5 .h + Build.cs +
  module.json).

Pegadinha aprendida: ActiveClassRedirects so' renomeia classe (sem
package); CoreRedirects (ClassRedirects/StructRedirects/EnumRedirects/
PackageRedirects) e' obrigatorio quando muda modulo OU quando o asset
referencia USTRUCT/UENUM. Tipo errado nao da erro mas tambem nao funciona.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-03 01:26:04 -03:00
94442feca5 chore(uproject): rename plugin ZeusAbilities -> ZeusGAS
Servidor-side plugin foi renomeado de ZeusAbilities pra ZeusGAS (vai
absorver atributos + abilities + bridge ZeusNetwork). .uproject precisa
seguir o novo nome senao plugin deixa de carregar.

Server-side commit: ver Server repo branch GameplayAbilitySystem,
commit refactor(plugin): R.7 - rename plugin ZeusAbilities -> ZeusGAS.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-02 23:23:04 -03:00
6a6a28a086 refactor: prefixo ZMMO -> Zeus em classes/módulos C++ do cliente
- Renomeia ~50 classes UCLASS/USTRUCT/UENUM/UINTERFACE pra Zeus*
  (AZeusGameMode, AZeusCharacter, UZeusGameInstance, IZeusEntityInterface,
  UZeusWorldSubsystem, FZeusEntitySnapshot, etc.)
- Encurta AZMMOPlayerCharacter -> AZeusCharacter
- Renomeia módulos satélite ZMMOAttributes -> ZeusAttributes e
  ZMMOJobs -> ZeusJobs (pasta + .Build.cs + .uproject)
- Mantém módulo principal ZMMO (renomeia depois quando jogo ganhar nome)
- DefaultEngine.ini: ActiveClassRedirects ZMMOX -> ZeusX (preserva BPs/assets)
- DefaultGame.ini: sections atualizadas pra ZeusThemeSubsystem/ZeusPlayerState
- Category="ZMMO|..." -> "Zeus|..." em UPROPERTYs
- Preserva LogZMMO, ZMMO_API, /Script/ZMMO., /Game/ZMMO/, classes Target

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-02 17:24:38 -03:00
128 changed files with 1380 additions and 1897 deletions

View File

@@ -2,9 +2,9 @@
GameDefaultMap=/Game/ZMMO/Maps/FrontEnd/L_FrontEnd.L_FrontEnd GameDefaultMap=/Game/ZMMO/Maps/FrontEnd/L_FrontEnd.L_FrontEnd
EditorStartupMap=/Game/ZMMO/Maps/FrontEnd/L_FrontEnd.L_FrontEnd EditorStartupMap=/Game/ZMMO/Maps/FrontEnd/L_FrontEnd.L_FrontEnd
; GameMode/PlayerController/PlayerCharacter agora moram em C++ (Game/Modes/Entity/Controller). ; GameMode/PlayerController/PlayerCharacter agora moram em C++ (Game/Modes/Entity/Controller).
; O motor pode spawnar AZMMOGameMode directamente; um BP filho continua opcional. ; O motor pode spawnar AZeusGameMode directamente; um BP filho continua opcional.
GlobalDefaultGameMode=/Script/ZMMO.ZMMOGameMode GlobalDefaultGameMode=/Script/ZMMO.ZeusGameMode
GameInstanceClass=/Script/ZMMO.ZMMOGameInstance GameInstanceClass=/Script/ZMMO.ZeusGameInstance
[/Script/Engine.RendererSettings] [/Script/Engine.RendererSettings]
r.ReflectionMethod=1 r.ReflectionMethod=1
@@ -80,12 +80,30 @@ GameViewportClientClassName=/Script/CommonUI.CommonGameViewportClient
+ActiveGameNameRedirects=(OldGameName="TP_ThirdPerson",NewGameName="/Script/ZMMO") +ActiveGameNameRedirects=(OldGameName="TP_ThirdPerson",NewGameName="/Script/ZMMO")
+ActiveGameNameRedirects=(OldGameName="/Script/TP_ThirdPerson",NewGameName="/Script/ZMMO") +ActiveGameNameRedirects=(OldGameName="/Script/TP_ThirdPerson",NewGameName="/Script/ZMMO")
; Redirects do template antigo para a nova arquitectura (Game/Modes/Entity/Controller). ; Redirects do template antigo para a nova arquitectura (Game/Modes/Entity/Controller).
; ZMMOCharacter foi reescrito como ZMMOPlayerCharacter (ACharacter local com CMC livre). ; Pipeline: TP_ThirdPerson* -> ZMMO* (legado) -> Zeus* (atual). Os redirects de
+ActiveClassRedirects=(OldClassName="TP_ThirdPersonPlayerController",NewClassName="ZMMOPlayerController") ; ZMMO*->Zeus* preservam asset/BP refs criadas durante o periodo ZMMO* (Batches 1-3).
+ActiveClassRedirects=(OldClassName="TP_ThirdPersonGameMode",NewClassName="ZMMOGameMode") +ActiveClassRedirects=(OldClassName="TP_ThirdPersonPlayerController",NewClassName="ZeusPlayerController")
+ActiveClassRedirects=(OldClassName="TP_ThirdPersonCharacter",NewClassName="ZMMOPlayerCharacter") +ActiveClassRedirects=(OldClassName="TP_ThirdPersonGameMode",NewClassName="ZeusGameMode")
+ActiveClassRedirects=(OldClassName="ZMMOCharacter",NewClassName="ZMMOPlayerCharacter") +ActiveClassRedirects=(OldClassName="TP_ThirdPersonCharacter",NewClassName="ZeusCharacter")
+ActiveClassRedirects=(OldClassName="ZMMOCharacter",NewClassName="ZeusCharacter")
+ActiveClassRedirects=(OldClassName="ZMMOPlayerCharacter",NewClassName="ZeusCharacter")
+ActiveClassRedirects=(OldClassName="ZMMOPlayerController",NewClassName="ZeusPlayerController")
+ActiveClassRedirects=(OldClassName="ZMMOFrontEndPlayerController",NewClassName="ZeusFrontEndPlayerController")
+ActiveClassRedirects=(OldClassName="ZMMOGameMode",NewClassName="ZeusGameMode")
+ActiveClassRedirects=(OldClassName="ZMMOFrontEndGameMode",NewClassName="ZeusFrontEndGameMode")
+ActiveClassRedirects=(OldClassName="ZMMOGameInstance",NewClassName="ZeusGameInstance")
+ActiveClassRedirects=(OldClassName="ZMMOHUD",NewClassName="ZeusHUD")
+ActiveClassRedirects=(OldClassName="ZMMOPlayerState",NewClassName="ZeusPlayerState")
+ActiveClassRedirects=(OldClassName="ZMMOEntity",NewClassName="ZeusEntity")
+ActiveClassRedirects=(OldClassName="ZMMOPlayerProxy",NewClassName="ZeusPlayerProxy")
+ActiveClassRedirects=(OldClassName="ZMMOProxyMovementComponent",NewClassName="ZeusProxyMovementComponent")
+ActiveClassRedirects=(OldClassName="ZMMOWorldSubsystem",NewClassName="ZeusWorldSubsystem")
+ActiveClassRedirects=(OldClassName="ZMMOThemeDataAsset",NewClassName="ZeusThemeDataAsset")
+ActiveClassRedirects=(OldClassName="ZMMOThemeSubsystem",NewClassName="ZeusThemeSubsystem")
+ActiveClassRedirects=(OldClassName="ZMMOLoginSaveGame",NewClassName="ZeusLoginSaveGame")
+ActiveClassRedirects=(OldClassName="ZMMOHudWidget",NewClassName="ZeusHudWidget")
+ActiveClassRedirects=(OldClassName="ZMMOHudPlayerVitalsWidget",NewClassName="ZeusHudPlayerVitalsWidget")
+ActiveClassRedirects=(OldClassName="ZMMOLoadingProfilesDataAsset",NewClassName="ZeusLoadingProfilesDataAsset")
[CoreRedirects] [CoreRedirects]
; Migração v1→v2 do FUIStylePanel: TMap<EUIPanelTexture,...> (Enum) → TMap<FName,...>. ; Migração v1→v2 do FUIStylePanel: TMap<EUIPanelTexture,...> (Enum) → TMap<FName,...>.
; Os campos *_DEPRECATED preservam a leitura do asset antigo; PostSerialize copia ; Os campos *_DEPRECATED preservam a leitura do asset antigo; PostSerialize copia
@@ -95,6 +113,27 @@ GameViewportClientClassName=/Script/CommonUI.CommonGameViewportClient
+PropertyRedirects=(OldName="/Script/ZMMO.UIStylePanel.PanelOutline",NewName="/Script/ZMMO.UIStylePanel.PanelOutline_DEPRECATED") +PropertyRedirects=(OldName="/Script/ZMMO.UIStylePanel.PanelOutline",NewName="/Script/ZMMO.UIStylePanel.PanelOutline_DEPRECATED")
+PropertyRedirects=(OldName="/Script/ZMMO.UIStylePanel.PanelOutlineEffect",NewName="/Script/ZMMO.UIStylePanel.PanelOutlineEffect_DEPRECATED") +PropertyRedirects=(OldName="/Script/ZMMO.UIStylePanel.PanelOutlineEffect",NewName="/Script/ZMMO.UIStylePanel.PanelOutlineEffect_DEPRECATED")
; --- M7: Modulo cliente "ZMMOJobs" foi renomeado pra "ZeusJobs" + classe
; UZMMOJobDataAsset -> UZeusJobDataAsset. Os 7 DA_Job_* em /Game/ZMMO/Data/Jobs/
; foram salvos apontando pra /Script/ZMMOJobs.ZMMOJobDataAsset (modulo + classe
; antigos). ActiveClassRedirects so' troca o NOME da classe, nao o package;
; precisamos de CoreRedirects com path completo + PackageRedirect.
+PackageRedirects=(OldName="/Script/ZMMOJobs",NewName="/Script/ZeusJobs")
+ClassRedirects=(OldName="/Script/ZMMOJobs.ZMMOJobDataAsset",NewName="/Script/ZeusJobs.ZeusJobDataAsset")
; --- M7: USTRUCTs renomeadas (mesmo modulo ZMMO). DTs salvos com Row Structure
; apontando pro nome antigo (ZMMOMapDef, ZMMOLoadingTipRow). USTRUCT usa
; +StructRedirects (nao +ClassRedirects).
+StructRedirects=(OldName="/Script/ZMMO.ZMMOMapDef",NewName="/Script/ZMMO.ZeusMapDef")
+StructRedirects=(OldName="/Script/ZMMO.ZMMOLoadingTipRow",NewName="/Script/ZMMO.ZeusLoadingTipRow")
; DA_LoadingProfiles salvo com TMap<EZMMOLoadingContext, FZMMOLoadingProfile>;
; FZMMOLoadingProfile contem TArray<FZMMOLoadingStepDef>. Precisa de 3 redirects
; (1 enum + 2 struct) pra carregar sem warnings nem perda de dados.
+EnumRedirects=(OldName="/Script/ZMMO.EZMMOLoadingContext",NewName="/Script/ZMMO.EZeusLoadingContext")
+EnumRedirects=(OldName="/Script/ZMMO.EZMMOLoadingStepStatus",NewName="/Script/ZMMO.EZeusLoadingStepStatus")
+StructRedirects=(OldName="/Script/ZMMO.ZMMOLoadingProfile",NewName="/Script/ZMMO.ZeusLoadingProfile")
+StructRedirects=(OldName="/Script/ZMMO.ZMMOLoadingStepDef",NewName="/Script/ZMMO.ZeusLoadingStepDef")
[/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings] [/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings]
bEnablePlugin=True bEnablePlugin=True
bAllowNetworkConnection=True bAllowNetworkConnection=True

View File

@@ -3,10 +3,10 @@ ProjectID=FC3E256F43B2AFD43009F4949B0814BE
ProjectName=Third Person Game Template ProjectName=Third Person Game Template
; ----------------------------------------------------------------------------- ; -----------------------------------------------------------------------------
; ZMMO Theme subsystem (see Source/ZMMO/Game/UI/ZMMOThemeSubsystem.h and ; ZMMO Theme subsystem (see Source/ZMMO/Game/UI/ZeusThemeSubsystem.h and
; ARQUITETURA.md §1.10 / §4.7). ; ARQUITETURA.md §1.10 / §4.7).
; ;
; - DefaultThemeAsset is the fallback theme (must define every EZMMOThemeKey). ; - DefaultThemeAsset is the fallback theme (must define every EZeusThemeKey).
; - ThemeRegistry maps ThemeId -> seasonal DA_Theme_* asset. ; - ThemeRegistry maps ThemeId -> seasonal DA_Theme_* asset.
; - CalendarTable points to DT_ThemeCalendar (FThemeCalendarRow rows). ; - CalendarTable points to DT_ThemeCalendar (FThemeCalendarRow rows).
; - UIStyleTable points to DT_UI_Styles (FUIStyleRow rows): tokens de estilo ; - UIStyleTable points to DT_UI_Styles (FUIStyleRow rows): tokens de estilo
@@ -18,7 +18,7 @@ ProjectName=Third Person Game Template
; assets are actually created in the editor. ; assets are actually created in the editor.
; ----------------------------------------------------------------------------- ; -----------------------------------------------------------------------------
[/Script/ZMMO.ZMMOThemeSubsystem] [/Script/ZMMO.ZeusThemeSubsystem]
;DefaultThemeAsset=/Game/ZMMO/UI/Themes/DA_Theme_Default.DA_Theme_Default ;DefaultThemeAsset=/Game/ZMMO/UI/Themes/DA_Theme_Default.DA_Theme_Default
;+ThemeRegistry=(("Christmas", "/Game/ZMMO/UI/Themes/DA_Theme_Christmas.DA_Theme_Christmas")) ;+ThemeRegistry=(("Christmas", "/Game/ZMMO/UI/Themes/DA_Theme_Christmas.DA_Theme_Christmas"))
;+ThemeRegistry=(("Halloween", "/Game/ZMMO/UI/Themes/DA_Theme_Halloween.DA_Theme_Halloween")) ;+ThemeRegistry=(("Halloween", "/Game/ZMMO/UI/Themes/DA_Theme_Halloween.DA_Theme_Halloween"))
@@ -33,20 +33,20 @@ ScreenSetAsset=/Game/ZMMO/UI/FrontEnd/DA_FrontEndScreenSet.DA_FrontEndScreenSet
; Fase 4 — char spawn DB-driven. DT_Maps espelha o `maps_config.json` do ; Fase 4 — char spawn DB-driven. DT_Maps espelha o `maps_config.json` do
; server (Server/ZeusServerEngine/Config/DataTables/maps_config.json) — o ; server (Server/ZeusServerEngine/Config/DataTables/maps_config.json) — o
; cliente resolve `mapId -> ClientLevel/spawns` via FZMMOMapDef rows. ; cliente resolve `mapId -> ClientLevel/spawns` via FZeusMapDef rows.
MapsTableAsset=/Game/ZMMO/Data/World/DT_Maps.DT_Maps MapsTableAsset=/Game/ZMMO/Data/World/DT_Maps.DT_Maps
; Loading dinâmico (etapas + dicas). DA_LoadingProfiles tem 1 perfil por ; Loading dinâmico (etapas + dicas). DA_LoadingProfiles tem 1 perfil por
; contexto (EZMMOLoadingContext); DT_LoadingTips rotaciona durante o load. ; contexto (EZeusLoadingContext); DT_LoadingTips rotaciona durante o load.
; Cliente local marca etapas via eventos (sem opcode novo). ; Cliente local marca etapas via eventos (sem opcode novo).
LoadingProfilesAsset=/Game/ZMMO/Data/UI/Loading/DA_LoadingProfiles.DA_LoadingProfiles LoadingProfilesAsset=/Game/ZMMO/Data/UI/Loading/DA_LoadingProfiles.DA_LoadingProfiles
LoadingTipsAsset=/Game/ZMMO/Data/UI/Loading/DT_LoadingTips.DT_LoadingTips LoadingTipsAsset=/Game/ZMMO/Data/UI/Loading/DT_LoadingTips.DT_LoadingTips
; ----------------------------------------------------------------------------- ; -----------------------------------------------------------------------------
; UI in-game (PR 19+). Espelho do front-end pattern: ; UI in-game (PR 19+). Espelho do front-end pattern:
; - ScreenSetAsset mapeia EZMMOInGameUIState -> WBP (Playing -> WBP_HUD, ; - ScreenSetAsset mapeia EZeusInGameUIState -> WBP (Playing -> WBP_HUD,
; StatusWindow -> WBP_StatusWindow, etc.) ; StatusWindow -> WBP_StatusWindow, etc.)
; - Subsystem orquestra: AZMMOHUD::BeginPlay chama StartInGame que vai pra ; - Subsystem orquestra: AZeusHUD::BeginPlay chama StartInGame que vai pra
; Playing. ; Playing.
; Asset criado via MCP em /Game/ZMMO/UI/InGame/DA_InGameScreenSet. ; Asset criado via MCP em /Game/ZMMO/UI/InGame/DA_InGameScreenSet.
; ----------------------------------------------------------------------------- ; -----------------------------------------------------------------------------
@@ -56,16 +56,20 @@ ScreenSetAsset=/Game/ZMMO/UI/InGame/DA_InGameScreenSet.DA_InGameScreenSet
; ----------------------------------------------------------------------------- ; -----------------------------------------------------------------------------
; PlayerState Component Registry (PR 19+). Cada módulo MMO registra seus ; PlayerState Component Registry (PR 19+). Cada módulo MMO registra seus
; UActorComponent aqui. O AZMMOPlayerState lê esta lista no construtor e ; UActorComponent aqui. O AZeusPlayerState lê esta lista no construtor e
; instancia cada classe como subobject — pattern Open-Closed: adicionar ; instancia cada classe como subobject — pattern Open-Closed: adicionar
; Inventory/Skills/Guild = mais uma linha aqui, sem editar AZMMOPlayerState. ; Inventory/Skills/Guild = mais uma linha aqui, sem editar AZeusPlayerState.
; ;
; Convenção: usa o path /Script/<Module>.<ClassName> (sem o "U" do prefixo ; Convenção: usa o path /Script/<Module>.<ClassName> (sem o "U" do prefixo
; C++; UClass resolve pelo nome curto). ; C++; UClass resolve pelo nome curto).
; ----------------------------------------------------------------------------- ; -----------------------------------------------------------------------------
[/Script/ZMMO.ZMMOPlayerState] [/Script/ZMMO.ZeusPlayerState]
+ComponentClasses=/Script/ZMMOAttributes.ZMMOAttributeComponent ; UZeusGASComponent (plugin ZeusGAS) — dono unico dos atributos do char (M7).
; Owns UZeusAbilitySystemComponent + UZeusAttributeSet (26 atributos
; espelhados do server CharAttributeSet). Bridge via UZeusGASNetworkHandler
; (UWorldSubsystem) subscribe nos delegates do UZeusNetworkSubsystem.
+ComponentClasses=/Script/ZeusGAS.ZeusGASComponent
[/Script/Engine.AssetManagerSettings] [/Script/Engine.AssetManagerSettings]
-PrimaryAssetTypesToScan=(PrimaryAssetType="Map",AssetBaseClass=/Script/Engine.World,bHasBlueprintClasses=False,bIsEditorOnly=True,Directories=((Path="/Game/Maps")),SpecificAssets=,Rules=(Priority=-1,ChunkId=-1,bApplyRecursively=True,CookRule=Unknown)) -PrimaryAssetTypesToScan=(PrimaryAssetType="Map",AssetBaseClass=/Script/Engine.World,bHasBlueprintClasses=False,bIsEditorOnly=True,Directories=((Path="/Game/Maps")),SpecificAssets=,Rules=(Priority=-1,ChunkId=-1,bApplyRecursively=True,CookRule=Unknown))

View File

@@ -10,17 +10,17 @@
* *
* Fluxo: Boot → Connecting → Login → ServerSelect → Lobby → EnteringWorld * Fluxo: Boot → Connecting → Login → ServerSelect → Lobby → EnteringWorld
* → InWorld. O Lobby é o hub principal logado; suas páginas internas são * → InWorld. O Lobby é o hub principal logado; suas páginas internas são
* EZMMOLobbyPage (não são estados de topo — ver ARQUITETURA.md §4.8). * EZeusLobbyPage (não são estados de topo — ver ARQUITETURA.md §4.8).
*/ */
UENUM(BlueprintType) UENUM(BlueprintType)
enum class EZMMOFrontEndState : uint8 enum class EZeusFrontEndState : uint8
{ {
None, None,
Boot, // splash inicial enquanto subsistemas sobem Boot, // splash inicial enquanto subsistemas sobem
Connecting, // conectando ao servidor Zeus (UDP) Connecting, // conectando ao servidor Zeus (UDP)
Login, // autenticação Login, // autenticação
ServerSelect, // escolha de servidor/realm ServerSelect, // escolha de servidor/realm
Lobby, // hub principal logado (host das EZMMOLobbyPage) Lobby, // hub principal logado (host das EZeusLobbyPage)
EnteringWorld, // loading/handoff: OpenLevel do mapa de mundo EnteringWorld, // loading/handoff: OpenLevel do mapa de mundo
InWorld // no mundo (HUD de gameplay assume) InWorld // no mundo (HUD de gameplay assume)
}; };
@@ -30,7 +30,7 @@ enum class EZMMOFrontEndState : uint8
* de Lobby ("Switch principal"), não pelo fluxo de topo. * de Lobby ("Switch principal"), não pelo fluxo de topo.
*/ */
UENUM(BlueprintType) UENUM(BlueprintType)
enum class EZMMOLobbyPage : uint8 enum class EZeusLobbyPage : uint8
{ {
None, None,
CharacterSelect, CharacterSelect,

View File

@@ -7,7 +7,7 @@
* Estados da UI in-game. Dirigidos pelo UUIInGameFlowSubsystem; cada estado * Estados da UI in-game. Dirigidos pelo UUIInGameFlowSubsystem; cada estado
* resolve uma tela (UCommonActivatableWidget) via DA_InGameScreenSet. * resolve uma tela (UCommonActivatableWidget) via DA_InGameScreenSet.
* *
* Espelha simetricamente EZMMOFrontEndState (Data/UI/FrontEndTypes.h): * Espelha simetricamente EZeusFrontEndState (Data/UI/FrontEndTypes.h):
* - Front-end usa estados pra Login/ServerSelect/Lobby (UI.Layer.Menu) * - Front-end usa estados pra Login/ServerSelect/Lobby (UI.Layer.Menu)
* - In-game usa estados pra HUD/Status/Inventory/Skills (UI.Layer.Game + GameMenu) * - In-game usa estados pra HUD/Status/Inventory/Skills (UI.Layer.Game + GameMenu)
* *
@@ -22,7 +22,7 @@
* Layer.GameMenu por cima dele. * Layer.GameMenu por cima dele.
*/ */
UENUM(BlueprintType) UENUM(BlueprintType)
enum class EZMMOInGameUIState : uint8 enum class EZeusInGameUIState : uint8
{ {
None, ///< Antes do player local spawnar; UI in-game inativa. None, ///< Antes do player local spawnar; UI in-game inativa.
Playing, ///< HUD principal visivel (HP/SP/level/etc). Playing, ///< HUD principal visivel (HP/SP/level/etc).

View File

@@ -5,14 +5,14 @@
/** /**
* Contexto do loading screen genérico. Cada contexto resolve um perfil * Contexto do loading screen genérico. Cada contexto resolve um perfil
* (lista de etapas) no UZMMOLoadingProfilesDataAsset. * (lista de etapas) no UZeusLoadingProfilesDataAsset.
* *
* Cliente local rastreia o progresso assinando eventos próprios * Cliente local rastreia o progresso assinando eventos próprios
* (HandlePostLoadMap, OnPlayerSpawned, etc) — server não envia opcode de * (HandlePostLoadMap, OnPlayerSpawned, etc) — server não envia opcode de
* progresso, ver decisão em [[project_ui_loading_dynamic]]. * progresso, ver decisão em [[project_ui_loading_dynamic]].
*/ */
UENUM(BlueprintType) UENUM(BlueprintType)
enum class EZMMOLoadingContext : uint8 enum class EZeusLoadingContext : uint8
{ {
None, None,
FrontEndEnteringWorld, ///< FrontEnd → mundo (handoff CharServer→WorldServer + spawn). FrontEndEnteringWorld, ///< FrontEnd → mundo (handoff CharServer→WorldServer + spawn).
@@ -21,7 +21,7 @@ enum class EZMMOLoadingContext : uint8
}; };
UENUM(BlueprintType) UENUM(BlueprintType)
enum class EZMMOLoadingStepStatus : uint8 enum class EZeusLoadingStepStatus : uint8
{ {
Pending, ///< Ainda não começou. Pending, ///< Ainda não começou.
Running, ///< Em andamento (o "barber pole"). Running, ///< Em andamento (o "barber pole").
@@ -34,7 +34,7 @@ enum class EZMMOLoadingStepStatus : uint8
* pra chamar MarkStepDone(StepId); Label é o texto localizado mostrado. * pra chamar MarkStepDone(StepId); Label é o texto localizado mostrado.
*/ */
USTRUCT(BlueprintType) USTRUCT(BlueprintType)
struct FZMMOLoadingStepDef struct FZeusLoadingStepDef
{ {
GENERATED_BODY() GENERATED_BODY()
@@ -52,13 +52,13 @@ struct FZMMOLoadingStepDef
* consulta StepId pra avançar etapa. * consulta StepId pra avançar etapa.
*/ */
USTRUCT(BlueprintType) USTRUCT(BlueprintType)
struct FZMMOLoadingProfile struct FZeusLoadingProfile
{ {
GENERATED_BODY() GENERATED_BODY()
/** Etapas em ordem. ProgressBar = #Done / #Steps. */ /** Etapas em ordem. ProgressBar = #Done / #Steps. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Loading") UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Loading")
TArray<FZMMOLoadingStepDef> Steps; TArray<FZeusLoadingStepDef> Steps;
/** Título da tela (vazio = usa default da classe). */ /** Título da tela (vazio = usa default da classe). */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Loading") UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Loading")

View File

@@ -4,7 +4,7 @@
#include "ThemeKeys.generated.h" #include "ThemeKeys.generated.h"
UENUM(BlueprintType) UENUM(BlueprintType)
enum class EZMMOThemeKey : uint8 enum class EZeusThemeKey : uint8
{ {
// HUD // HUD
HUD_Frame UMETA(DisplayName = "HUD - Frame"), HUD_Frame UMETA(DisplayName = "HUD - Frame"),

View File

@@ -1,6 +1,6 @@
#include "UI/UILayerTags.h" #include "UI/UILayerTags.h"
namespace ZMMOUITags namespace ZeusUITags
{ {
UE_DEFINE_GAMEPLAY_TAG(UI_Layer_Game, "UI.Layer.Game"); UE_DEFINE_GAMEPLAY_TAG(UI_Layer_Game, "UI.Layer.Game");
UE_DEFINE_GAMEPLAY_TAG(UI_Layer_GameMenu, "UI.Layer.GameMenu"); UE_DEFINE_GAMEPLAY_TAG(UI_Layer_GameMenu, "UI.Layer.GameMenu");

View File

@@ -12,7 +12,7 @@
* UI.Layer.Menu — front-end (Boot/Login/ServerSelect/Lobby) * UI.Layer.Menu — front-end (Boot/Login/ServerSelect/Lobby)
* UI.Layer.Modal — diálogos/loading por cima de tudo * UI.Layer.Modal — diálogos/loading por cima de tudo
*/ */
namespace ZMMOUITags namespace ZeusUITags
{ {
ZMMO_API UE_DECLARE_GAMEPLAY_TAG_EXTERN(UI_Layer_Game); ZMMO_API UE_DECLARE_GAMEPLAY_TAG_EXTERN(UI_Layer_Game);
ZMMO_API UE_DECLARE_GAMEPLAY_TAG_EXTERN(UI_Layer_GameMenu); ZMMO_API UE_DECLARE_GAMEPLAY_TAG_EXTERN(UI_Layer_GameMenu);

View File

@@ -73,7 +73,7 @@ struct ZMMO_API FUIStyle
/** /**
* Linha de DT_UI_Styles. O Row Name é o ThemeId (ex.: "Default", "RPG"), * Linha de DT_UI_Styles. O Row Name é o ThemeId (ex.: "Default", "RPG"),
* espelhando DT_ThemeCalendar e ThemeRegistry — assim a camada de estilo * espelhando DT_ThemeCalendar e ThemeRegistry — assim a camada de estilo
* é consumidora do ThemeId já resolvido pelo UZMMOThemeSubsystem. * é consumidora do ThemeId já resolvido pelo UZeusThemeSubsystem.
*/ */
USTRUCT(BlueprintType) USTRUCT(BlueprintType)
struct ZMMO_API FUIStyleRow : public FTableRowBase struct ZMMO_API FUIStyleRow : public FTableRowBase
@@ -87,7 +87,7 @@ struct ZMMO_API FUIStyleRow : public FTableRowBase
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style") UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style")
EUITheme Theme = EUITheme::None; EUITheme Theme = EUITheme::None;
/** Ponte para o ThemeId resolvido pelo UZMMOThemeSubsystem. */ /** Ponte para o ThemeId resolvido pelo UZeusThemeSubsystem. */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style") UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style")
FName ThemeId; FName ThemeId;

View File

@@ -7,7 +7,7 @@
* Enums do sistema de UI Style (tokens de tema visual). * Enums do sistema de UI Style (tokens de tema visual).
* *
* Espelha ThemeKeys.h: enums fortes, BlueprintType, primeiro valor None. * Espelha ThemeKeys.h: enums fortes, BlueprintType, primeiro valor None.
* O conceito de "tema ativo" continua sendo do UZMMOThemeSubsystem * O conceito de "tema ativo" continua sendo do UZeusThemeSubsystem
* (resolvido por FName ThemeId). EUITheme é apenas validação tipada de * (resolvido por FName ThemeId). EUITheme é apenas validação tipada de
* design-time ao preencher DT_UI_Styles — não é a chave de runtime. * design-time ao preencher DT_UI_Styles — não é a chave de runtime.
*/ */

View File

@@ -7,7 +7,7 @@
#include "MapDef.generated.h" #include "MapDef.generated.h"
/** /**
* FZMMOMapSpawn * FZeusMapSpawn
* *
* Ponto de spawn dentro de um mapa, identificado por `Tag`. Usado pelo * Ponto de spawn dentro de um mapa, identificado por `Tag`. Usado pelo
* server pra decidir onde materializar um char quando ele entra: * server pra decidir onde materializar um char quando ele entra:
@@ -15,12 +15,12 @@
* - Char saindo de raid: pode pedir tag="raid_return" * - Char saindo de raid: pode pedir tag="raid_return"
* - Char morto: pode pedir tag="graveyard" * - Char morto: pode pedir tag="graveyard"
* *
* ZeusEditorTools pode auto-popular o `Spawns[]` do FZMMOMapDef varrendo * ZeusEditorTools pode auto-popular o `Spawns[]` do FZeusMapDef varrendo
* todos APlayerStart (ou ator custom AZMMOMapSpawnPoint) presentes no * todos APlayerStart (ou ator custom AZeusMapSpawnPoint) presentes no
* `.umap` do `ClientLevel` — botao "Sync from level". * `.umap` do `ClientLevel` — botao "Sync from level".
*/ */
USTRUCT(BlueprintType) USTRUCT(BlueprintType)
struct ZMMO_API FZMMOMapSpawn struct ZMMO_API FZeusMapSpawn
{ {
GENERATED_BODY() GENERATED_BODY()
@@ -38,7 +38,7 @@ struct ZMMO_API FZMMOMapSpawn
}; };
/** /**
* FZMMOMapDef * FZeusMapDef
* *
* Definicao canonica de um mapa do MMO. Linha da DT_Maps no cliente. * Definicao canonica de um mapa do MMO. Linha da DT_Maps no cliente.
* Exportada para `Server/ZeusServerEngine/Config/DataTables/maps_config.json` * Exportada para `Server/ZeusServerEngine/Config/DataTables/maps_config.json`
@@ -55,7 +55,7 @@ struct ZMMO_API FZMMOMapSpawn
* `mapName` (string), evitando ~10-30 bytes por handoff. * `mapName` (string), evitando ~10-30 bytes por handoff.
*/ */
USTRUCT(BlueprintType) USTRUCT(BlueprintType)
struct ZMMO_API FZMMOMapDef : public FTableRowBase struct ZMMO_API FZeusMapDef : public FTableRowBase
{ {
GENERATED_BODY() GENERATED_BODY()
@@ -77,7 +77,7 @@ struct ZMMO_API FZMMOMapDef : public FTableRowBase
* Pelo menos um com Tag="default" e esperado. * Pelo menos um com Tag="default" e esperado.
*/ */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Map|Spawns") UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Map|Spawns")
TArray<FZMMOMapSpawn> Spawns; TArray<FZeusMapSpawn> Spawns;
/** Regras PvP/Safe/Dungeon. Reusa enum de FZoneRow. */ /** Regras PvP/Safe/Dungeon. Reusa enum de FZoneRow. */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Map") UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Map")

View File

@@ -1,14 +1,14 @@
#include "ZMMOFrontEndPlayerController.h" #include "ZeusFrontEndPlayerController.h"
#include "UIFrontEndFlowSubsystem.h" #include "UIFrontEndFlowSubsystem.h"
#include "Engine/GameInstance.h" #include "Engine/GameInstance.h"
AZMMOFrontEndPlayerController::AZMMOFrontEndPlayerController() AZeusFrontEndPlayerController::AZeusFrontEndPlayerController()
{ {
bShowMouseCursor = true; bShowMouseCursor = true;
} }
void AZMMOFrontEndPlayerController::BeginPlay() void AZeusFrontEndPlayerController::BeginPlay()
{ {
Super::BeginPlay(); Super::BeginPlay();

View File

@@ -2,24 +2,24 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "GameFramework/PlayerController.h" #include "GameFramework/PlayerController.h"
#include "ZMMOFrontEndPlayerController.generated.h" #include "ZeusFrontEndPlayerController.generated.h"
/** /**
* AZMMOFrontEndPlayerController * AZeusFrontEndPlayerController
* *
* Controller do mapa de front-end. Não herda de AZMMOPlayerController (sem * Controller do mapa de front-end. Não herda de AZeusPlayerController (sem
* Enhanced Input de gameplay/touch). Em BeginPlay arranca o fluxo de * Enhanced Input de gameplay/touch). Em BeginPlay arranca o fluxo de
* front-end (UUIFrontEndFlowSubsystem) feito aqui, e não no * front-end (UUIFrontEndFlowSubsystem) feito aqui, e não no
* GameInstance::Init, porque os subsistemas existem neste ponto (ver * GameInstance::Init, porque os subsistemas existem neste ponto (ver
* aviso no header do ZeusNetworkSubsystem). * aviso no header do ZeusNetworkSubsystem).
*/ */
UCLASS(Blueprintable, BlueprintType) UCLASS(Blueprintable, BlueprintType)
class ZMMO_API AZMMOFrontEndPlayerController : public APlayerController class ZMMO_API AZeusFrontEndPlayerController : public APlayerController
{ {
GENERATED_BODY() GENERATED_BODY()
public: public:
AZMMOFrontEndPlayerController(); AZeusFrontEndPlayerController();
protected: protected:
virtual void BeginPlay() override; virtual void BeginPlay() override;

View File

@@ -1,4 +1,4 @@
#include "ZMMOPlayerController.h" #include "ZeusPlayerController.h"
#include "Blueprint/UserWidget.h" #include "Blueprint/UserWidget.h"
#include "Components/InputComponent.h" #include "Components/InputComponent.h"
@@ -13,11 +13,11 @@
#include "UI/InGame/UIInGameFlowSubsystem.h" #include "UI/InGame/UIInGameFlowSubsystem.h"
#include "UI/InGameTypes.h" #include "UI/InGameTypes.h"
AZMMOPlayerController::AZMMOPlayerController() AZeusPlayerController::AZeusPlayerController()
{ {
// Defaults dos Input Mapping Contexts (alinhados ao ZClientMMO). Permitem // Defaults dos Input Mapping Contexts (alinhados ao ZClientMMO). Permitem
// instanciar AZMMOPlayerController directamente como // instanciar AZeusPlayerController directamente como
// `PlayerControllerClass` do AZMMOGameMode sem exigir um BP filho. Se o // `PlayerControllerClass` do AZeusGameMode sem exigir um BP filho. Se o
// projeto adicionar mais IMCs, podemos extender via BP filho ou via // projeto adicionar mais IMCs, podemos extender via BP filho ou via
// arquivos de Config (UPROPERTY EditAnywhere abaixo). // arquivos de Config (UPROPERTY EditAnywhere abaixo).
static ConstructorHelpers::FObjectFinder<UInputMappingContext> DefaultImc( static ConstructorHelpers::FObjectFinder<UInputMappingContext> DefaultImc(
@@ -35,7 +35,7 @@ AZMMOPlayerController::AZMMOPlayerController()
} }
} }
void AZMMOPlayerController::BeginPlay() void AZeusPlayerController::BeginPlay()
{ {
Super::BeginPlay(); Super::BeginPlay();
@@ -43,7 +43,7 @@ void AZMMOPlayerController::BeginPlay()
{ {
// Limpa estado de input herdado da UI do FrontEnd (UIManagerSubsystem // Limpa estado de input herdado da UI do FrontEnd (UIManagerSubsystem
// e LocalPlayerSubsystem — sobrevive ao travel, e o controller anterior // e LocalPlayerSubsystem — sobrevive ao travel, e o controller anterior
// (AZMMOFrontEndPlayerController) tinha setado FInputModeUIOnly + // (AZeusFrontEndPlayerController) tinha setado FInputModeUIOnly +
// bShowMouseCursor=true). Sem este reset, WASD/Look podem nao chegar // bShowMouseCursor=true). Sem este reset, WASD/Look podem nao chegar
// ao pawn porque o Slate ainda esta com foco no widget antigo. // ao pawn porque o Slate ainda esta com foco no widget antigo.
FInputModeGameOnly InputMode; FInputModeGameOnly InputMode;
@@ -67,7 +67,7 @@ void AZMMOPlayerController::BeginPlay()
} }
} }
void AZMMOPlayerController::SetupInputComponent() void AZeusPlayerController::SetupInputComponent()
{ {
Super::SetupInputComponent(); Super::SetupInputComponent();
@@ -101,7 +101,7 @@ void AZMMOPlayerController::SetupInputComponent()
FInputKeyBinding& Binding = InputComponent->BindKey( FInputKeyBinding& Binding = InputComponent->BindKey(
FInputChord(EKeys::A, /*bShift*/ false, /*bCtrl*/ false, /*bAlt*/ true, /*bCmd*/ false), FInputChord(EKeys::A, /*bShift*/ false, /*bCtrl*/ false, /*bAlt*/ true, /*bCmd*/ false),
IE_Pressed, IE_Pressed,
this, &AZMMOPlayerController::ToggleStatusWindow); this, &AZeusPlayerController::ToggleStatusWindow);
Binding.bConsumeInput = true; Binding.bConsumeInput = true;
Binding.bExecuteWhenPaused = true; // dispara mesmo com StatusWindow aberto (CommonUI menu mode) Binding.bExecuteWhenPaused = true; // dispara mesmo com StatusWindow aberto (CommonUI menu mode)
@@ -109,35 +109,35 @@ void AZMMOPlayerController::SetupInputComponent()
FInputKeyBinding& JobBinding = InputComponent->BindKey( FInputKeyBinding& JobBinding = InputComponent->BindKey(
FInputChord(EKeys::J, /*bShift*/ false, /*bCtrl*/ false, /*bAlt*/ false, /*bCmd*/ false), FInputChord(EKeys::J, /*bShift*/ false, /*bCtrl*/ false, /*bAlt*/ false, /*bCmd*/ false),
IE_Pressed, IE_Pressed,
this, &AZMMOPlayerController::ToggleJobChangePanel); this, &AZeusPlayerController::ToggleJobChangePanel);
JobBinding.bConsumeInput = true; JobBinding.bConsumeInput = true;
JobBinding.bExecuteWhenPaused = true; JobBinding.bExecuteWhenPaused = true;
} }
} }
void AZMMOPlayerController::ToggleStatusWindow() void AZeusPlayerController::ToggleStatusWindow()
{ {
if (UGameInstance* GI = GetGameInstance()) if (UGameInstance* GI = GetGameInstance())
{ {
if (UUIInGameFlowSubsystem* Flow = GI->GetSubsystem<UUIInGameFlowSubsystem>()) if (UUIInGameFlowSubsystem* Flow = GI->GetSubsystem<UUIInGameFlowSubsystem>())
{ {
Flow->ToggleScreen(EZMMOInGameUIState::StatusWindow); Flow->ToggleScreen(EZeusInGameUIState::StatusWindow);
} }
} }
} }
void AZMMOPlayerController::ToggleJobChangePanel() void AZeusPlayerController::ToggleJobChangePanel()
{ {
if (UGameInstance* GI = GetGameInstance()) if (UGameInstance* GI = GetGameInstance())
{ {
if (UUIInGameFlowSubsystem* Flow = GI->GetSubsystem<UUIInGameFlowSubsystem>()) if (UUIInGameFlowSubsystem* Flow = GI->GetSubsystem<UUIInGameFlowSubsystem>())
{ {
Flow->ToggleScreen(EZMMOInGameUIState::JobChangePanel); Flow->ToggleScreen(EZeusInGameUIState::JobChangePanel);
} }
} }
} }
bool AZMMOPlayerController::ShouldUseTouchControls() const bool AZeusPlayerController::ShouldUseTouchControls() const
{ {
return SVirtualJoystick::ShouldDisplayTouchInterface() || bForceTouchControls; return SVirtualJoystick::ShouldDisplayTouchInterface() || bForceTouchControls;
} }

View File

@@ -2,26 +2,26 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "GameFramework/PlayerController.h" #include "GameFramework/PlayerController.h"
#include "ZMMOPlayerController.generated.h" #include "ZeusPlayerController.generated.h"
class UInputMappingContext; class UInputMappingContext;
class UUserWidget; class UUserWidget;
/** /**
* AZMMOPlayerController * AZeusPlayerController
* *
* Player controller do cliente Zeus MMO. Responsavel apenas pela camada de * Player controller do cliente Zeus MMO. Responsavel apenas pela camada de
* input do Unreal (Enhanced Input Mapping Contexts e widget opcional de * input do Unreal (Enhanced Input Mapping Contexts e widget opcional de
* controlos touch). Toda a logica de identidade Zeus, envio de input e * controlos touch). Toda a logica de identidade Zeus, envio de input e
* reconciliacao vive em `AZMMOPlayerCharacter`. * reconciliacao vive em `AZeusCharacter`.
*/ */
UCLASS(Blueprintable, BlueprintType) UCLASS(Blueprintable, BlueprintType)
class ZMMO_API AZMMOPlayerController : public APlayerController class ZMMO_API AZeusPlayerController : public APlayerController
{ {
GENERATED_BODY() GENERATED_BODY()
public: public:
AZMMOPlayerController(); AZeusPlayerController();
protected: protected:
/** Mapping contexts default (sempre adicionados). */ /** Mapping contexts default (sempre adicionados). */

View File

@@ -1,25 +0,0 @@
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/CharacterMovementComponent.h"
#include "ZMMOProxyMovementComponent.generated.h"
/**
* CMC customizado para AZMMOPlayerProxy. Expõe escrita direta de Acceleration
* (protected na base) para que o AnimBP veja Acceleration!=0 quando o proxy
* recebe snapshots, alimentando a fórmula ShouldMove e a transição Jump_Start
* do ABP_Unarmed (ambas dependem de aceleração não-nula). Espelha
* UZeusProxyMovementComponent do ZClientMMO.
*/
UCLASS(ClassGroup = (ZMMO), meta = (BlueprintSpawnableComponent))
class ZMMO_API UZMMOProxyMovementComponent : public UCharacterMovementComponent
{
GENERATED_BODY()
public:
void SetZMMOExternalAcceleration(const FVector& InAccelerationCmS2)
{
Acceleration = InAccelerationCmS2;
}
};

View File

@@ -1,4 +1,4 @@
#include "ZMMOPlayerCharacter.h" #include "ZeusCharacter.h"
#include "Animation/AnimInstance.h" #include "Animation/AnimInstance.h"
#include "Camera/CameraComponent.h" #include "Camera/CameraComponent.h"
@@ -17,15 +17,15 @@
#include "Subsystems/WorldSubsystem.h" #include "Subsystems/WorldSubsystem.h"
#include "UObject/ConstructorHelpers.h" #include "UObject/ConstructorHelpers.h"
#include "ZMMO.h" #include "ZMMO.h"
#include "ZMMOAttributeComponent.h" #include "ZeusGASComponent.h"
#include "ZMMOPlayerState.h" #include "ZeusPlayerState.h"
#include "ZMMOWorldSubsystem.h" #include "ZeusWorldSubsystem.h"
#include "ZeusNetworkSubsystem.h" #include "ZeusNetworkSubsystem.h"
#include "UI/FrontEnd/UIFrontEndFlowSubsystem.h" #include "UI/FrontEnd/UIFrontEndFlowSubsystem.h"
DEFINE_LOG_CATEGORY(LogZMMOPlayer); DEFINE_LOG_CATEGORY(LogZeusPlayer);
AZMMOPlayerCharacter::AZMMOPlayerCharacter() AZeusCharacter::AZeusCharacter()
{ {
PrimaryActorTick.bCanEverTick = true; PrimaryActorTick.bCanEverTick = true;
PrimaryActorTick.bStartWithTickEnabled = true; PrimaryActorTick.bStartWithTickEnabled = true;
@@ -55,13 +55,12 @@ AZMMOPlayerCharacter::AZMMOPlayerCharacter()
FollowCamera->SetupAttachment(CameraBoom, USpringArmComponent::SocketName); FollowCamera->SetupAttachment(CameraBoom, USpringArmComponent::SocketName);
FollowCamera->bUsePawnControlRotation = false; FollowCamera->bUsePawnControlRotation = false;
// AttributeComponent migrou pro PlayerState (AZMMOPlayerState + Component // AttributeComponent migrou pro PlayerState (AZeusPlayerState + Component
// Registry config-driven). Pawn fica leve — so' movement/input/camera. // Registry config-driven). Pawn fica leve — so' movement/input/camera.
// Defaults visuais (mesh + AnimBP) — alinhados ao ZClientMMO. Permitem ao // Defaults visuais (mesh + AnimBP). Permitem ao motor spawnar AZeusCharacter
// motor spawnar AZMMOPlayerCharacter directamente como DefaultPawnClass do // directamente como DefaultPawnClass do AZeusGameMode sem exigir um BP filho.
// AZMMOGameMode sem exigir um BP filho. Um BP filho continua opcional para // Um BP filho continua opcional para trocar mesh/AnimBP por mapa.
// trocar mesh/AnimBP por mapa.
if (USkeletalMeshComponent* MeshComponent = GetMesh()) if (USkeletalMeshComponent* MeshComponent = GetMesh())
{ {
static ConstructorHelpers::FObjectFinder<USkeletalMesh> QuinnMesh( static ConstructorHelpers::FObjectFinder<USkeletalMesh> QuinnMesh(
@@ -77,7 +76,7 @@ AZMMOPlayerCharacter::AZMMOPlayerCharacter()
} }
else else
{ {
UE_LOG(LogZMMOPlayer, Warning, TEXT("Default mesh SKM_Quinn_Simple not found for AZMMOPlayerCharacter.")); UE_LOG(LogZeusPlayer, Warning, TEXT("Default mesh SKM_Quinn_Simple not found for AZeusCharacter."));
} }
if (QuinnAnimBp.Succeeded()) if (QuinnAnimBp.Succeeded())
@@ -87,12 +86,12 @@ AZMMOPlayerCharacter::AZMMOPlayerCharacter()
} }
else else
{ {
UE_LOG(LogZMMOPlayer, Warning, TEXT("Default anim blueprint ABP_Unarmed not found for AZMMOPlayerCharacter.")); UE_LOG(LogZeusPlayer, Warning, TEXT("Default anim blueprint ABP_Unarmed not found for AZeusCharacter."));
} }
} }
// Input Actions defaults (Enhanced Input) — IMCs sao adicionados pelo // Input Actions defaults (Enhanced Input) — IMCs sao adicionados pelo
// AZMMOPlayerController. As IAs aqui resolvem o asset por path; um BP filho // AZeusPlayerController. As IAs aqui resolvem o asset por path; um BP filho
// pode sobrescrever caso queira inputs custom. // pode sobrescrever caso queira inputs custom.
static ConstructorHelpers::FObjectFinder<UInputAction> MoveActionAsset( static ConstructorHelpers::FObjectFinder<UInputAction> MoveActionAsset(
TEXT("/Game/Input/Actions/IA_Move.IA_Move")); TEXT("/Game/Input/Actions/IA_Move.IA_Move"));
@@ -109,7 +108,7 @@ AZMMOPlayerCharacter::AZMMOPlayerCharacter()
if (JumpActionAsset.Succeeded()) { JumpAction = JumpActionAsset.Object; } if (JumpActionAsset.Succeeded()) { JumpAction = JumpActionAsset.Object; }
} }
void AZMMOPlayerCharacter::BeginPlay() void AZeusCharacter::BeginPlay()
{ {
Super::BeginPlay(); Super::BeginPlay();
ResolveZeusNetworkSubsystem(); ResolveZeusNetworkSubsystem();
@@ -134,77 +133,77 @@ void AZMMOPlayerCharacter::BeginPlay()
{ {
C->SetControlRotation(NewRot); C->SetControlRotation(NewRot);
} }
UE_LOG(LogZMMOPlayer, Log, UE_LOG(LogZeusPlayer, Log,
TEXT("AZMMOPlayerCharacter: pawn reposicionado pra pos do DB (%s) yaw=%.1f"), TEXT("AZeusCharacter: pawn reposicionado pra pos do DB (%s) yaw=%.1f"),
*PosCm.ToString(), YawDeg); *PosCm.ToString(), YawDeg);
} }
} }
} }
} }
void AZMMOPlayerCharacter::EndPlay(const EEndPlayReason::Type EndPlayReason) void AZeusCharacter::EndPlay(const EEndPlayReason::Type EndPlayReason)
{ {
UnbindZeusSpawnDelegate(); UnbindZeusSpawnDelegate();
ZeusNetwork = nullptr; ZeusNetwork = nullptr;
Super::EndPlay(EndPlayReason); Super::EndPlay(EndPlayReason);
} }
void AZMMOPlayerCharacter::Tick(const float DeltaSeconds) void AZeusCharacter::Tick(const float DeltaSeconds)
{ {
Super::Tick(DeltaSeconds); Super::Tick(DeltaSeconds);
FlushInputAxisToServer(DeltaSeconds); FlushInputAxisToServer(DeltaSeconds);
} }
void AZMMOPlayerCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) void AZeusCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{ {
if (UEnhancedInputComponent* EnhancedInputComponent = Cast<UEnhancedInputComponent>(PlayerInputComponent)) if (UEnhancedInputComponent* EnhancedInputComponent = Cast<UEnhancedInputComponent>(PlayerInputComponent))
{ {
EnhancedInputComponent->BindAction(JumpAction, ETriggerEvent::Started, this, &AZMMOPlayerCharacter::OnJumpPressed); EnhancedInputComponent->BindAction(JumpAction, ETriggerEvent::Started, this, &AZeusCharacter::OnJumpPressed);
EnhancedInputComponent->BindAction(JumpAction, ETriggerEvent::Completed, this, &AZMMOPlayerCharacter::OnJumpReleased); EnhancedInputComponent->BindAction(JumpAction, ETriggerEvent::Completed, this, &AZeusCharacter::OnJumpReleased);
EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Triggered, this, &AZMMOPlayerCharacter::Move); EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Triggered, this, &AZeusCharacter::Move);
EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Completed, this, &AZMMOPlayerCharacter::MoveCompleted); EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Completed, this, &AZeusCharacter::MoveCompleted);
EnhancedInputComponent->BindAction(LookAction, ETriggerEvent::Triggered, this, &AZMMOPlayerCharacter::Look); EnhancedInputComponent->BindAction(LookAction, ETriggerEvent::Triggered, this, &AZeusCharacter::Look);
EnhancedInputComponent->BindAction(MouseLookAction, ETriggerEvent::Triggered, this, &AZMMOPlayerCharacter::Look); EnhancedInputComponent->BindAction(MouseLookAction, ETriggerEvent::Triggered, this, &AZeusCharacter::Look);
} }
else else
{ {
UE_LOG(LogZMMOPlayer, Error, TEXT("'%s' Failed to find an Enhanced Input component."), *GetNameSafe(this)); UE_LOG(LogZeusPlayer, Error, TEXT("'%s' Failed to find an Enhanced Input component."), *GetNameSafe(this));
} }
} }
void AZMMOPlayerCharacter::Move(const FInputActionValue& Value) void AZeusCharacter::Move(const FInputActionValue& Value)
{ {
const FVector2D MovementVector = Value.Get<FVector2D>(); const FVector2D MovementVector = Value.Get<FVector2D>();
DoMove(MovementVector.X, MovementVector.Y); DoMove(MovementVector.X, MovementVector.Y);
} }
void AZMMOPlayerCharacter::MoveCompleted(const FInputActionValue& Value) void AZeusCharacter::MoveCompleted(const FInputActionValue& Value)
{ {
(void)Value; (void)Value;
DoMove(0.0f, 0.0f); DoMove(0.0f, 0.0f);
} }
void AZMMOPlayerCharacter::Look(const FInputActionValue& Value) void AZeusCharacter::Look(const FInputActionValue& Value)
{ {
const FVector2D LookAxisVector = Value.Get<FVector2D>(); const FVector2D LookAxisVector = Value.Get<FVector2D>();
DoLook(LookAxisVector.X, LookAxisVector.Y); DoLook(LookAxisVector.X, LookAxisVector.Y);
} }
void AZMMOPlayerCharacter::OnJumpPressed() void AZeusCharacter::OnJumpPressed()
{ {
bPendingJumpPressed = true; bPendingJumpPressed = true;
DoJumpStart(); DoJumpStart();
} }
void AZMMOPlayerCharacter::OnJumpReleased() void AZeusCharacter::OnJumpReleased()
{ {
bPendingJumpReleased = true; bPendingJumpReleased = true;
DoJumpEnd(); DoJumpEnd();
} }
void AZMMOPlayerCharacter::DoMove(const float Right, const float Forward) void AZeusCharacter::DoMove(const float Right, const float Forward)
{ {
PendingMoveRight = FMath::Clamp(Right, -1.0f, 1.0f); PendingMoveRight = FMath::Clamp(Right, -1.0f, 1.0f);
PendingMoveForward = FMath::Clamp(Forward, -1.0f, 1.0f); PendingMoveForward = FMath::Clamp(Forward, -1.0f, 1.0f);
@@ -220,7 +219,7 @@ void AZMMOPlayerCharacter::DoMove(const float Right, const float Forward)
} }
} }
void AZMMOPlayerCharacter::DoLook(const float Yaw, const float Pitch) void AZeusCharacter::DoLook(const float Yaw, const float Pitch)
{ {
if (GetController() != nullptr) if (GetController() != nullptr)
{ {
@@ -229,29 +228,29 @@ void AZMMOPlayerCharacter::DoLook(const float Yaw, const float Pitch)
} }
} }
void AZMMOPlayerCharacter::DoJumpStart() void AZeusCharacter::DoJumpStart()
{ {
Jump(); Jump();
} }
void AZMMOPlayerCharacter::DoJumpEnd() void AZeusCharacter::DoJumpEnd()
{ {
StopJumping(); StopJumping();
} }
void AZMMOPlayerCharacter::ApplyEntitySnapshot(const FZMMOEntitySnapshot& /*Snapshot*/) void AZeusCharacter::ApplyEntitySnapshot(const FZeusEntitySnapshot& /*Snapshot*/)
{ {
// Cliente local solto: o servidor nao reconcilia posicao em V0 (ADR 0038). // Cliente local solto: o servidor nao reconcilia posicao em V0 (ADR 0038).
// Quando colisao de objetos chegar, podemos ligar uma reconciliacao opcional // Quando colisao de objetos chegar, podemos ligar uma reconciliacao opcional
// horizontal aqui (XY only), preservando o Z do CMC local. // horizontal aqui (XY only), preservando o Z do CMC local.
} }
void AZMMOPlayerCharacter::SetEntityRelevant(bool /*bRelevant*/) void AZeusCharacter::SetEntityRelevant(bool /*bRelevant*/)
{ {
// Nunca despawnamos o jogador local via AOI. // Nunca despawnamos o jogador local via AOI.
} }
void AZMMOPlayerCharacter::ResolveZeusNetworkSubsystem() void AZeusCharacter::ResolveZeusNetworkSubsystem()
{ {
if (ZeusNetwork) if (ZeusNetwork)
{ {
@@ -267,7 +266,7 @@ void AZMMOPlayerCharacter::ResolveZeusNetworkSubsystem()
ZeusNetwork = GI->GetSubsystem<UZeusNetworkSubsystem>(); ZeusNetwork = GI->GetSubsystem<UZeusNetworkSubsystem>();
} }
void AZMMOPlayerCharacter::BindZeusSpawnDelegate() void AZeusCharacter::BindZeusSpawnDelegate()
{ {
if (bSpawnDelegateBound || !IsLocallyControlled()) if (bSpawnDelegateBound || !IsLocallyControlled())
{ {
@@ -278,24 +277,24 @@ void AZMMOPlayerCharacter::BindZeusSpawnDelegate()
return; return;
} }
ZeusNetwork->OnPlayerSpawned.AddDynamic(this, &AZMMOPlayerCharacter::HandleZeusPlayerSpawned); ZeusNetwork->OnPlayerSpawned.AddDynamic(this, &AZeusCharacter::HandleZeusPlayerSpawned);
ZeusNetwork->OnCharInfoReceived.AddDynamic(this, &AZMMOPlayerCharacter::HandleZeusCharInfo); ZeusNetwork->OnCharInfoReceived.AddDynamic(this, &AZeusCharacter::HandleZeusCharInfo);
bSpawnDelegateBound = true; bSpawnDelegateBound = true;
} }
void AZMMOPlayerCharacter::UnbindZeusSpawnDelegate() void AZeusCharacter::UnbindZeusSpawnDelegate()
{ {
if (!bSpawnDelegateBound || !ZeusNetwork) if (!bSpawnDelegateBound || !ZeusNetwork)
{ {
bSpawnDelegateBound = false; bSpawnDelegateBound = false;
return; return;
} }
ZeusNetwork->OnPlayerSpawned.RemoveDynamic(this, &AZMMOPlayerCharacter::HandleZeusPlayerSpawned); ZeusNetwork->OnPlayerSpawned.RemoveDynamic(this, &AZeusCharacter::HandleZeusPlayerSpawned);
ZeusNetwork->OnCharInfoReceived.RemoveDynamic(this, &AZMMOPlayerCharacter::HandleZeusCharInfo); ZeusNetwork->OnCharInfoReceived.RemoveDynamic(this, &AZeusCharacter::HandleZeusCharInfo);
bSpawnDelegateBound = false; bSpawnDelegateBound = false;
} }
void AZMMOPlayerCharacter::TryRegisterLocalEntityFromCachedSpawn() void AZeusCharacter::TryRegisterLocalEntityFromCachedSpawn()
{ {
if (!ZeusNetwork) if (!ZeusNetwork)
{ {
@@ -316,19 +315,19 @@ void AZMMOPlayerCharacter::TryRegisterLocalEntityFromCachedSpawn()
TryApplyCachedCharInfo(); TryApplyCachedCharInfo();
} }
void AZMMOPlayerCharacter::HandleZeusPlayerSpawned(const int64 InEntityId, const bool bIsLocal, void AZeusCharacter::HandleZeusPlayerSpawned(const int64 InEntityId, const bool bIsLocal,
const FVector PosCm, const float YawDeg, const int64 ServerTimeMs) const FVector PosCm, const float YawDeg, const int64 ServerTimeMs)
{ {
if (!bIsLocal) if (!bIsLocal)
{ {
// Remote spawns sao tratados pelo `UZMMOWorldSubsystem`; aqui so reagimos // Remote spawns sao tratados pelo `UZeusWorldSubsystem`; aqui so reagimos
// ao spawn do pawn possessivel local (S_SPAWN_PLAYER com bIsLocal=true). // ao spawn do pawn possessivel local (S_SPAWN_PLAYER com bIsLocal=true).
return; return;
} }
HandleLocalSpawnReady(InEntityId, PosCm, YawDeg, ServerTimeMs); HandleLocalSpawnReady(InEntityId, PosCm, YawDeg, ServerTimeMs);
} }
void AZMMOPlayerCharacter::HandleLocalSpawnReady(const int64 InEntityId, const FVector PosCm, void AZeusCharacter::HandleLocalSpawnReady(const int64 InEntityId, const FVector PosCm,
const float YawDeg, const int64 ServerTimeMs) const float YawDeg, const int64 ServerTimeMs)
{ {
if (InEntityId == 0) if (InEntityId == 0)
@@ -337,55 +336,56 @@ void AZMMOPlayerCharacter::HandleLocalSpawnReady(const int64 InEntityId, const F
} }
// PR-HANDOFF-007 — InEntityId é int64 (era int32) // PR-HANDOFF-007 — InEntityId é int64 (era int32)
if (ZMMOEntityId == InEntityId) if (ZeusEntityId == InEntityId)
{ {
return; return;
} }
ZMMOEntityId = InEntityId; ZeusEntityId = InEntityId;
UE_LOG(LogZMMOPlayer, Log, UE_LOG(LogZeusPlayer, Log,
TEXT("AZMMOPlayerCharacter: local spawn captured EntityId=%lld pos=(%s) yaw=%.1f t=%lld"), TEXT("AZeusCharacter: local spawn captured EntityId=%lld pos=(%s) yaw=%.1f t=%lld"),
InEntityId, *PosCm.ToString(), YawDeg, ServerTimeMs); InEntityId, *PosCm.ToString(), YawDeg, ServerTimeMs);
if (UWorld* World = GetWorld()) if (UWorld* World = GetWorld())
{ {
if (UZMMOWorldSubsystem* WorldSubsystem = World->GetSubsystem<UZMMOWorldSubsystem>()) if (UZeusWorldSubsystem* WorldSubsystem = World->GetSubsystem<UZeusWorldSubsystem>())
{ {
WorldSubsystem->RegisterLocalEntity(InEntityId, this); WorldSubsystem->RegisterLocalEntity(InEntityId, this);
} }
} }
// Identidade publica (EntityId) + seed no AttributeComponent. CharName/Guild // Identidade publica (EntityId) + seed no GAS Component. CharName/Guild
// vem separado via S_CHAR_INFO -> HandleZeusCharInfo. AttributeComponent vive // vem separado via S_CHAR_INFO -> HandleZeusCharInfo. UZeusGASComponent
// como subobject e recebe seed pra que o ZMMOAttributeNetworkHandler consiga // vive como subobject do PlayerState (Component Registry) e recebe seed
// rotear o snapshot por EntityId desde o primeiro pacote. // pra que o UZeusGASNetworkHandler consiga rotear o snapshot por
// EntityId desde o primeiro pacote.
if (APlayerState* PS = GetPlayerState()) if (APlayerState* PS = GetPlayerState())
{ {
if (AZMMOPlayerState* ZMMOPs = Cast<AZMMOPlayerState>(PS)) if (AZeusPlayerState* ZeusPs = Cast<AZeusPlayerState>(PS))
{ {
ZMMOPs->SetPublicIdentity(InEntityId, /*CharId*/ FString(), ZeusPs->SetPublicIdentity(InEntityId, /*CharId*/ FString(),
/*BaseLevel*/ 1, /*ClassId*/ 0); /*BaseLevel*/ 1, /*ClassId*/ 0);
} }
if (UZMMOAttributeComponent* AttrComp = PS->FindComponentByClass<UZMMOAttributeComponent>()) if (UZeusGASComponent* GASComp = PS->FindComponentByClass<UZeusGASComponent>())
{ {
AttrComp->SeedEntityId(InEntityId); GASComp->SeedEntityId(InEntityId);
} }
} }
// Aplica char info cacheada (caso S_CHAR_INFO tenha chegado antes do PS existir). // Aplica char info cacheada (caso S_CHAR_INFO tenha chegado antes do PS existir).
TryApplyCachedCharInfo(); TryApplyCachedCharInfo();
// UI in-game e' responsabilidade do AZMMOHUD (GameMode.HUDClass), nao do // UI in-game e' responsabilidade do AZeusHUD (GameMode.HUDClass), nao do
// Pawn. AHUD::BeginPlay chama UUIInGameFlowSubsystem::StartInGame, que // Pawn. AHUD::BeginPlay chama UUIInGameFlowSubsystem::StartInGame, que
// pushea WBP_HUD em UI.Layer.Game. UZMMOHudWidget::NativeOnActivated auto-binda // pushea WBP_HUD em UI.Layer.Game. UZeusHudWidget::NativeOnActivated auto-binda
// no UZMMOAttributeComponent via PlayerState. // no UZeusGASComponent via PlayerState.
} }
void AZMMOPlayerCharacter::HandleZeusCharInfo(const int64 InEntityId, const FString& CharName, const FString& GuildName) void AZeusCharacter::HandleZeusCharInfo(const int64 InEntityId, const FString& CharName, const FString& GuildName)
{ {
UE_LOG(LogZMMOPlayer, Log, UE_LOG(LogZeusPlayer, Log,
TEXT("AZMMOPlayerCharacter: S_CHAR_INFO recebido EntityId=%lld name=%s guild=%s"), TEXT("AZeusCharacter: S_CHAR_INFO recebido EntityId=%lld name=%s guild=%s"),
InEntityId, *CharName, *GuildName); InEntityId, *CharName, *GuildName);
APlayerState* PS = GetPlayerState(); APlayerState* PS = GetPlayerState();
@@ -396,13 +396,13 @@ void AZMMOPlayerCharacter::HandleZeusCharInfo(const int64 InEntityId, const FStr
// HandleLocalSpawnReady ou em outra oportunidade. // HandleLocalSpawnReady ou em outra oportunidade.
return; return;
} }
if (AZMMOPlayerState* ZMMOPs = Cast<AZMMOPlayerState>(PS)) if (AZeusPlayerState* ZeusPs = Cast<AZeusPlayerState>(PS))
{ {
ZMMOPs->SetCharInfo(CharName, GuildName); ZeusPs->SetCharInfo(CharName, GuildName);
} }
} }
void AZMMOPlayerCharacter::TryApplyCachedCharInfo() void AZeusCharacter::TryApplyCachedCharInfo()
{ {
if (!ZeusNetwork) if (!ZeusNetwork)
{ {
@@ -417,14 +417,14 @@ void AZMMOPlayerCharacter::TryApplyCachedCharInfo()
} }
if (APlayerState* PS = GetPlayerState()) if (APlayerState* PS = GetPlayerState())
{ {
if (AZMMOPlayerState* ZMMOPs = Cast<AZMMOPlayerState>(PS)) if (AZeusPlayerState* ZeusPs = Cast<AZeusPlayerState>(PS))
{ {
ZMMOPs->SetCharInfo(CachedCharName, CachedGuildName); ZeusPs->SetCharInfo(CachedCharName, CachedGuildName);
} }
} }
} }
void AZMMOPlayerCharacter::FlushInputAxisToServer(const float DeltaSeconds) void AZeusCharacter::FlushInputAxisToServer(const float DeltaSeconds)
{ {
ResolveZeusNetworkSubsystem(); ResolveZeusNetworkSubsystem();
if (!ZeusNetwork || !ZeusNetwork->IsConnected()) if (!ZeusNetwork || !ZeusNetwork->IsConnected())

View File

@@ -3,9 +3,9 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "GameFramework/Character.h" #include "GameFramework/Character.h"
#include "Logging/LogMacros.h" #include "Logging/LogMacros.h"
#include "ZMMOEntityInterface.h" #include "ZeusEntityInterface.h"
#include "ZMMOEntityTypes.h" #include "ZeusEntityTypes.h"
#include "ZMMOPlayerCharacter.generated.h" #include "ZeusCharacter.generated.h"
class USpringArmComponent; class USpringArmComponent;
class UCameraComponent; class UCameraComponent;
@@ -13,13 +13,12 @@ class UInputAction;
class UZeusNetworkSubsystem; class UZeusNetworkSubsystem;
struct FInputActionValue; struct FInputActionValue;
DECLARE_LOG_CATEGORY_EXTERN(LogZMMOPlayer, Log, All); DECLARE_LOG_CATEGORY_EXTERN(LogZeusPlayer, Log, All);
/** /**
* AZMMOPlayerCharacter * AZeusCharacter
* *
* Personagem do jogador local. Diferente do template `ThirdPersonCharacter` * Personagem do jogador local. Parte do pipeline de rede Zeus:
* e do antigo `AZMMOCharacter`, este ator e parte do pipeline de rede Zeus:
* *
* - Continua a usar o `UCharacterMovementComponent` LIVRE para correr a * - Continua a usar o `UCharacterMovementComponent` LIVRE para correr a
* fisica do landscape (ADR 0038): o cliente e autoritativo localmente * fisica do landscape (ADR 0038): o cliente e autoritativo localmente
@@ -27,15 +26,15 @@ DECLARE_LOG_CATEGORY_EXTERN(LogZMMOPlayer, Log, All);
* - Envia `C_INPUT_AXIS` ao `UZeusNetworkSubsystem` na cadencia * - Envia `C_INPUT_AXIS` ao `UZeusNetworkSubsystem` na cadencia
* `InputSendRateHz` (com heartbeat 5 Hz quando parado para evitar * `InputSendRateHz` (com heartbeat 5 Hz quando parado para evitar
* starvation do `MovementSystem` no servidor). * starvation do `MovementSystem` no servidor).
* - Implementa `IZMMOEntityInterface` para participar do registry do * - Implementa `IZeusEntityInterface` para participar do registry do
* `UZMMOWorldSubsystem`, mas `ApplyEntitySnapshot` e `SetEntityRelevant` * `UZeusWorldSubsystem`, mas `ApplyEntitySnapshot` e `SetEntityRelevant`
* sao no-op em V0 o cliente local nao reconcilia (cliente solto). * sao no-op em V0 o cliente local nao reconcilia (cliente solto).
* *
* TODO V1: reconciliacao opcional XY quando colisao de objetos chegar; AOI * TODO V1: reconciliacao opcional XY quando colisao de objetos chegar; AOI
* debug spheres; visual smoothing apos correcao do servidor. * debug spheres; visual smoothing apos correcao do servidor.
*/ */
UCLASS(Blueprintable, BlueprintType) UCLASS(Blueprintable, BlueprintType)
class ZMMO_API AZMMOPlayerCharacter : public ACharacter, public IZMMOEntityInterface class ZMMO_API AZeusCharacter : public ACharacter, public IZeusEntityInterface
{ {
GENERATED_BODY() GENERATED_BODY()
@@ -47,8 +46,8 @@ class ZMMO_API AZMMOPlayerCharacter : public ACharacter, public IZMMOEntityInter
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components", meta = (AllowPrivateAccess = "true")) UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components", meta = (AllowPrivateAccess = "true"))
UCameraComponent* FollowCamera; UCameraComponent* FollowCamera;
// AttributeComponent vive no PlayerState (AZMMOPlayerState + Component Registry). // GAS Component vive no PlayerState (AZeusPlayerState + Component Registry).
// Acesso: GetPlayerState<AZMMOPlayerState>()->GetZMMOComponent<UZMMOAttributeComponent>(). // Acesso: GetPlayerState<AZeusPlayerState>()->GetZeusComponent<UZeusGASComponent>().
protected: protected:
UPROPERTY(EditAnywhere, Category = "Input") UPROPERTY(EditAnywhere, Category = "Input")
@@ -64,7 +63,7 @@ protected:
UInputAction* MouseLookAction; UInputAction* MouseLookAction;
/** Cadencia de envio dos pacotes `C_INPUT_AXIS` (Hz). */ /** Cadencia de envio dos pacotes `C_INPUT_AXIS` (Hz). */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "ZMMO|Networking", meta = (ClampMin = "1", ClampMax = "120")) UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Zeus|Networking", meta = (ClampMin = "1", ClampMax = "120"))
int32 InputSendRateHz = 30; int32 InputSendRateHz = 30;
/** /**
@@ -73,22 +72,22 @@ protected:
* evitar starvation do servidor caso pacotes sejam perdidos. Em movimento * evitar starvation do servidor caso pacotes sejam perdidos. Em movimento
* o envio segue `InputSendRateHz` (30 Hz). * o envio segue `InputSendRateHz` (30 Hz).
*/ */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "ZMMO|Networking", meta = (ClampMin = "0.05", ClampMax = "5.0")) UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Zeus|Networking", meta = (ClampMin = "0.05", ClampMax = "5.0"))
float HeartbeatIntervalSec = 0.2f; float HeartbeatIntervalSec = 0.2f;
public: public:
AZMMOPlayerCharacter(); AZeusCharacter();
virtual void Tick(float DeltaSeconds) override; virtual void Tick(float DeltaSeconds) override;
// --- IZMMOEntityInterface --- // --- IZeusEntityInterface ---
virtual int64 GetZMMOEntityId() const override { return ZMMOEntityId; } virtual int64 GetZeusEntityId() const override { return ZeusEntityId; }
virtual EZMMOEntityType GetZMMOEntityType() const override { return EZMMOEntityType::Player; } virtual EZeusEntityType GetZeusEntityType() const override { return EZeusEntityType::Player; }
virtual void ApplyEntitySnapshot(const FZMMOEntitySnapshot& Snapshot) override; virtual void ApplyEntitySnapshot(const FZeusEntitySnapshot& Snapshot) override;
virtual void SetEntityRelevant(bool bRelevant) override; virtual void SetEntityRelevant(bool bRelevant) override;
UFUNCTION(BlueprintCallable, Category = "ZMMO|Entity") UFUNCTION(BlueprintCallable, Category = "Zeus|Entity")
void SetZMMOEntityId(int64 InEntityId) { ZMMOEntityId = InEntityId; } void SetZeusEntityId(int64 InEntityId) { ZeusEntityId = InEntityId; }
FORCEINLINE USpringArmComponent* GetCameraBoom() const { return CameraBoom; } FORCEINLINE USpringArmComponent* GetCameraBoom() const { return CameraBoom; }
FORCEINLINE UCameraComponent* GetFollowCamera() const { return FollowCamera; } FORCEINLINE UCameraComponent* GetFollowCamera() const { return FollowCamera; }
@@ -131,7 +130,7 @@ private:
void TryRegisterLocalEntityFromCachedSpawn(); void TryRegisterLocalEntityFromCachedSpawn();
/** /**
* Memoriza `EntityId` autoritativo e regista o pawn no `UZMMOWorldSubsystem` * Memoriza `EntityId` autoritativo e regista o pawn no `UZeusWorldSubsystem`
* para o registry partilhado por proxies remotos (filtra snapshots locais). * para o registry partilhado por proxies remotos (filtra snapshots locais).
* Metadados publicos do char (Name/Guild) chegam via S_CHAR_INFO em * Metadados publicos do char (Name/Guild) chegam via S_CHAR_INFO em
* HandleZeusCharInfo (servidor envia ANTES de S_SPAWN_PLAYER). * HandleZeusCharInfo (servidor envia ANTES de S_SPAWN_PLAYER).
@@ -152,8 +151,8 @@ private:
bool bSpawnDelegateBound = false; bool bSpawnDelegateBound = false;
/** Identidade autoritativa atribuida quando o servidor envia S_SPAWN_PLAYER local. */ /** Identidade autoritativa atribuida quando o servidor envia S_SPAWN_PLAYER local. */
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Entity", meta = (AllowPrivateAccess = "true")) UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Entity", meta = (AllowPrivateAccess = "true"))
int64 ZMMOEntityId = 0; int64 ZeusEntityId = 0;
float PendingMoveForward = 0.0f; float PendingMoveForward = 0.0f;
float PendingMoveRight = 0.0f; float PendingMoveRight = 0.0f;

View File

@@ -1,31 +1,31 @@
#include "ZMMOEntity.h" #include "ZeusEntity.h"
AZMMOEntity::AZMMOEntity() AZeusEntity::AZeusEntity()
{ {
PrimaryActorTick.bCanEverTick = false; PrimaryActorTick.bCanEverTick = false;
bReplicates = false; bReplicates = false;
} }
void AZMMOEntity::SetZMMOIdentity(const int64 InEntityId, const EZMMOEntityType InEntityType) void AZeusEntity::SetZeusIdentity(const int64 InEntityId, const EZeusEntityType InEntityType)
{ {
EntityId = InEntityId; EntityId = InEntityId;
EntityType = InEntityType; EntityType = InEntityType;
} }
void AZMMOEntity::ApplyEntitySnapshot(const FZMMOEntitySnapshot& Snapshot) void AZeusEntity::ApplyEntitySnapshot(const FZeusEntitySnapshot& Snapshot)
{ {
const FRotator NewRotation(0.0f, Snapshot.YawDeg, 0.0f); const FRotator NewRotation(0.0f, Snapshot.YawDeg, 0.0f);
SetActorLocationAndRotation(Snapshot.PositionCm, NewRotation); SetActorLocationAndRotation(Snapshot.PositionCm, NewRotation);
} }
void AZMMOEntity::SetEntityRelevant(const bool bRelevant) void AZeusEntity::SetEntityRelevant(const bool bRelevant)
{ {
if (bIsZMMORelevant == bRelevant) if (bIsZeusRelevant == bRelevant)
{ {
return; return;
} }
bIsZMMORelevant = bRelevant; bIsZeusRelevant = bRelevant;
SetActorHiddenInGame(!bRelevant); SetActorHiddenInGame(!bRelevant);
SetActorEnableCollision(bRelevant); SetActorEnableCollision(bRelevant);
SetActorTickEnabled(bRelevant); SetActorTickEnabled(bRelevant);

View File

@@ -2,22 +2,22 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "GameFramework/Actor.h" #include "GameFramework/Actor.h"
#include "ZMMOEntityInterface.h" #include "ZeusEntityInterface.h"
#include "ZMMOEntityTypes.h" #include "ZeusEntityTypes.h"
#include "ZMMOEntity.generated.h" #include "ZeusEntity.generated.h"
/** /**
* AZMMOEntity * AZeusEntity
* *
* Classe base para entidades replicadas pelo servidor que NAO precisam de * Classe base para entidades replicadas pelo servidor que NAO precisam de
* capsula + `UCharacterMovementComponent` tipicamente NPCs estaticos, * capsula + `UCharacterMovementComponent` tipicamente NPCs estaticos,
* objetos dinamicos do mundo, mobs simples sem locomotion fisica. * objetos dinamicos do mundo, mobs simples sem locomotion fisica.
* *
* Para personagens com capsula + CMC (proxy de jogador, mobs com locomotion * Para personagens com capsula + CMC (proxy de jogador, mobs com locomotion
* por capsula), use `AZMMOPlayerProxy` ou uma futura `AZMMOMob` que herde * por capsula), use `AZeusPlayerProxy` ou uma futura `AZeusMob` que herde
* de `ACharacter`. * de `ACharacter`.
* *
* Implementa `IZMMOEntityInterface` com: * Implementa `IZeusEntityInterface` com:
* - getters para `EntityId` / `EntityType`; * - getters para `EntityId` / `EntityType`;
* - `ApplyEntitySnapshot` default: `SetActorLocationAndRotation` (sem * - `ApplyEntitySnapshot` default: `SetActorLocationAndRotation` (sem
* interpolacao temporal V1 podera adicionar ring-buffer + lerp); * interpolacao temporal V1 podera adicionar ring-buffer + lerp);
@@ -25,33 +25,33 @@
* desativa tick (preserva o ator no mundo para futuro pooling). * desativa tick (preserva o ator no mundo para futuro pooling).
*/ */
UCLASS(Blueprintable, BlueprintType) UCLASS(Blueprintable, BlueprintType)
class ZMMO_API AZMMOEntity : public AActor, public IZMMOEntityInterface class ZMMO_API AZeusEntity : public AActor, public IZeusEntityInterface
{ {
GENERATED_BODY() GENERATED_BODY()
public: public:
AZMMOEntity(); AZeusEntity();
// --- IZMMOEntityInterface --- // --- IZeusEntityInterface ---
virtual int64 GetZMMOEntityId() const override { return EntityId; } virtual int64 GetZeusEntityId() const override { return EntityId; }
virtual EZMMOEntityType GetZMMOEntityType() const override { return EntityType; } virtual EZeusEntityType GetZeusEntityType() const override { return EntityType; }
virtual void ApplyEntitySnapshot(const FZMMOEntitySnapshot& Snapshot) override; virtual void ApplyEntitySnapshot(const FZeusEntitySnapshot& Snapshot) override;
virtual void SetEntityRelevant(bool bRelevant) override; virtual void SetEntityRelevant(bool bRelevant) override;
/** Setter usado pelo `UZMMOWorldSubsystem` apos o spawn para registrar a identidade. */ /** Setter usado pelo `UZeusWorldSubsystem` apos o spawn para registrar a identidade. */
UFUNCTION(BlueprintCallable, Category = "ZMMO|Entity") UFUNCTION(BlueprintCallable, Category = "Zeus|Entity")
void SetZMMOIdentity(int64 InEntityId, EZMMOEntityType InEntityType); void SetZeusIdentity(int64 InEntityId, EZeusEntityType InEntityType);
protected: protected:
/** Identificador autoritativo do servidor. Atribuido em `SetZMMOIdentity`. */ /** Identificador autoritativo do servidor. Atribuido em `SetZeusIdentity`. */
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Entity") UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Entity")
int64 EntityId = 0; int64 EntityId = 0;
/** Categoria autoritativa (Player/Mob/NPC/Object). */ /** Categoria autoritativa (Player/Mob/NPC/Object). */
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Entity") UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Entity")
EZMMOEntityType EntityType = EZMMOEntityType::Object; EZeusEntityType EntityType = EZeusEntityType::Object;
/** Estado de relevancia atual (espelha as transicoes Hidden<->Relevant do servidor). */ /** Estado de relevancia atual (espelha as transicoes Hidden<->Relevant do servidor). */
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Entity") UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Entity")
bool bIsZMMORelevant = true; bool bIsZeusRelevant = true;
}; };

View File

@@ -2,27 +2,27 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "UObject/Interface.h" #include "UObject/Interface.h"
#include "ZMMOEntityTypes.h" #include "ZeusEntityTypes.h"
#include "ZMMOEntityInterface.generated.h" #include "ZeusEntityInterface.generated.h"
/** /**
* UZMMOEntityInterface * UZeusEntityInterface
* *
* Marcador `UInterface` necessario para o sistema de reflexao da Unreal. Todo o * Marcador `UInterface` necessario para o sistema de reflexao da Unreal. Todo o
* contrato vive em `IZMMOEntityInterface` (puro C++). * contrato vive em `IZeusEntityInterface` (puro C++).
*/ */
UINTERFACE(BlueprintType, MinimalAPI, meta = (CannotImplementInterfaceInBlueprint)) UINTERFACE(BlueprintType, MinimalAPI, meta = (CannotImplementInterfaceInBlueprint))
class UZMMOEntityInterface : public UInterface class UZeusEntityInterface : public UInterface
{ {
GENERATED_BODY() GENERATED_BODY()
}; };
/** /**
* IZMMOEntityInterface * IZeusEntityInterface
* *
* Contrato comum de todas as entidades replicadas pelo Zeus Server (player * Contrato comum de todas as entidades replicadas pelo Zeus Server (player
* local, players remotos, mobs, NPCs, objetos). Inspirado em `IZeusEntityInterface` * local, players remotos, mobs, NPCs, objetos). Adaptado para o nosso modelo
* (ZeusV1) e adaptado para o nosso modelo "cliente solto + servidor valida input". * "cliente solto + servidor valida input".
* *
* Decisoes: * Decisoes:
* 1. **Identidade autoritativa**: `EntityId` e `EntityType` vem do servidor; o * 1. **Identidade autoritativa**: `EntityId` e `EntityType` vem do servidor; o
@@ -30,28 +30,28 @@ class UZMMOEntityInterface : public UInterface
* 2. **Visibilidade gated por AOI**: o servidor envia spawn/despawn quando o * 2. **Visibilidade gated por AOI**: o servidor envia spawn/despawn quando o
* target entra/sai da area de interesse. O cliente reage via * target entra/sai da area de interesse. O cliente reage via
* `SetEntityRelevant(bool)`. * `SetEntityRelevant(bool)`.
* 3. **Player local nao reconcilia em V0**: para o `AZMMOPlayerCharacter` o * 3. **Player local nao reconcilia em V0**: para o `AZeusCharacter` o
* `ApplyEntitySnapshot` e no-op (cliente solto controla landscape). Quando * `ApplyEntitySnapshot` e no-op (cliente solto controla landscape). Quando
* a colisao de objetos chegar no servidor podemos ligar reconciliacao * a colisao de objetos chegar no servidor podemos ligar reconciliacao
* horizontal opcional. * horizontal opcional.
* *
* Por que UInterface (e nao heranca classica)? * Por que UInterface (e nao heranca classica)?
* - `AZMMOPlayerCharacter` ja herda de `ACharacter`. Forcar uma classe base * - `AZeusCharacter` ja herda de `ACharacter`. Forcar uma classe base
* `AZMMOEntity : AActor` para todos perderia o `ACharacter` gratuito. * `AZeusEntity : AActor` para todos perderia o `ACharacter` gratuito.
* A interface permite que o player local (`ACharacter`), o proxy remoto * A interface permite que o player local (`ACharacter`), o proxy remoto
* (`ACharacter`) e entidades genericas (`AActor`) implementem o mesmo * (`ACharacter`) e entidades genericas (`AActor`) implementem o mesmo
* contrato sem heranca multipla concreta. * contrato sem heranca multipla concreta.
*/ */
class ZMMO_API IZMMOEntityInterface class ZMMO_API IZeusEntityInterface
{ {
GENERATED_BODY() GENERATED_BODY()
public: public:
/** Identificador autoritativo da entidade no servidor. */ /** Identificador autoritativo da entidade no servidor. */
virtual int64 GetZMMOEntityId() const = 0; virtual int64 GetZeusEntityId() const = 0;
/** Categoria da entidade (Player, Mob, NPC, Object). */ /** Categoria da entidade (Player, Mob, NPC, Object). */
virtual EZMMOEntityType GetZMMOEntityType() const = 0; virtual EZeusEntityType GetZeusEntityType() const = 0;
/** /**
* Aplica um snapshot autoritativo. Implementacoes podem extender com * Aplica um snapshot autoritativo. Implementacoes podem extender com
@@ -61,7 +61,7 @@ public:
* fisica do landscape de forma autoritativa local, e o servidor apenas * fisica do landscape de forma autoritativa local, e o servidor apenas
* valida input/velocidade (ADR 0038). * valida input/velocidade (ADR 0038).
*/ */
virtual void ApplyEntitySnapshot(const FZMMOEntitySnapshot& Snapshot) = 0; virtual void ApplyEntitySnapshot(const FZeusEntitySnapshot& Snapshot) = 0;
/** /**
* Alterna entre estado visivel/ativo (`true`) e oculto/desativado (`false`). * Alterna entre estado visivel/ativo (`true`) e oculto/desativado (`false`).

View File

@@ -1,14 +1,14 @@
#pragma once #pragma once
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "ZMMOEntityTypes.generated.h" #include "ZeusEntityTypes.generated.h"
/** /**
* Categoria autoritativa replicada pelo servidor. Determina que classe de ator * Categoria autoritativa replicada pelo servidor. Determina que classe de ator
* o `UZMMOWorldSubsystem` deve spawnar para um snapshot recebido. * o `UZeusWorldSubsystem` deve spawnar para um snapshot recebido.
*/ */
UENUM(BlueprintType) UENUM(BlueprintType)
enum class EZMMOEntityType : uint8 enum class EZeusEntityType : uint8
{ {
Player UMETA(DisplayName = "Player"), Player UMETA(DisplayName = "Player"),
Mob UMETA(DisplayName = "Mob"), Mob UMETA(DisplayName = "Mob"),
@@ -17,48 +17,48 @@ enum class EZMMOEntityType : uint8
}; };
/** /**
* Snapshot autoritativo aplicado por `IZMMOEntityInterface::ApplyEntitySnapshot`. * Snapshot autoritativo aplicado por `IZeusEntityInterface::ApplyEntitySnapshot`.
* *
* Construido pelo `UZMMOWorldSubsystem` a partir dos delegates do * Construido pelo `UZeusWorldSubsystem` a partir dos delegates do
* `UZeusNetworkSubsystem` (`OnPlayerStateUpdate` em V0; opcodes para mobs/NPCs * `UZeusNetworkSubsystem` (`OnPlayerStateUpdate` em V0; opcodes para mobs/NPCs
* em V1+). Mantemos os campos minimos que o servidor ja replica hoje * em V1+). Mantemos os campos minimos que o servidor ja replica hoje
* (`S_PLAYER_STATE`); novos campos sao adicionados aqui sempre que o protocolo * (`S_PLAYER_STATE`); novos campos sao adicionados aqui sempre que o protocolo
* evoluir, sem mexer nas classes de proxy. * evoluir, sem mexer nas classes de proxy.
*/ */
USTRUCT(BlueprintType) USTRUCT(BlueprintType)
struct FZMMOEntitySnapshot struct FZeusEntitySnapshot
{ {
GENERATED_BODY() GENERATED_BODY()
/** EntityId autoritativo do servidor. */ /** EntityId autoritativo do servidor. */
UPROPERTY(BlueprintReadOnly, Category = "ZMMO|Entity") UPROPERTY(BlueprintReadOnly, Category = "Zeus|Entity")
int64 EntityId = 0; int64 EntityId = 0;
/** Categoria do ator (define qual proxy class spawnar). */ /** Categoria do ator (define qual proxy class spawnar). */
UPROPERTY(BlueprintReadOnly, Category = "ZMMO|Entity") UPROPERTY(BlueprintReadOnly, Category = "Zeus|Entity")
EZMMOEntityType EntityType = EZMMOEntityType::Player; EZeusEntityType EntityType = EZeusEntityType::Player;
/** Sequencia de input processada no servidor (so faz sentido para players). */ /** Sequencia de input processada no servidor (so faz sentido para players). */
UPROPERTY(BlueprintReadOnly, Category = "ZMMO|Entity") UPROPERTY(BlueprintReadOnly, Category = "Zeus|Entity")
int32 LastProcessedInputSeq = 0; int32 LastProcessedInputSeq = 0;
/** Posicao mundo (cm). */ /** Posicao mundo (cm). */
UPROPERTY(BlueprintReadOnly, Category = "ZMMO|Entity") UPROPERTY(BlueprintReadOnly, Category = "Zeus|Entity")
FVector PositionCm = FVector::ZeroVector; FVector PositionCm = FVector::ZeroVector;
/** Velocidade mundo (cm/s) — usada para network smoothing e drivers de animacao. */ /** Velocidade mundo (cm/s) — usada para network smoothing e drivers de animacao. */
UPROPERTY(BlueprintReadOnly, Category = "ZMMO|Entity") UPROPERTY(BlueprintReadOnly, Category = "Zeus|Entity")
FVector VelocityCmS = FVector::ZeroVector; FVector VelocityCmS = FVector::ZeroVector;
/** Yaw em graus (orientacao visual). */ /** Yaw em graus (orientacao visual). */
UPROPERTY(BlueprintReadOnly, Category = "ZMMO|Entity") UPROPERTY(BlueprintReadOnly, Category = "Zeus|Entity")
float YawDeg = 0.0f; float YawDeg = 0.0f;
/** Indica se o servidor considera o ator em solo. */ /** Indica se o servidor considera o ator em solo. */
UPROPERTY(BlueprintReadOnly, Category = "ZMMO|Entity") UPROPERTY(BlueprintReadOnly, Category = "Zeus|Entity")
bool bGrounded = false; bool bGrounded = false;
/** Tempo do servidor (ms desde epoch) quando este snapshot foi gerado. */ /** Tempo do servidor (ms desde epoch) quando este snapshot foi gerado. */
UPROPERTY(BlueprintReadOnly, Category = "ZMMO|Entity") UPROPERTY(BlueprintReadOnly, Category = "Zeus|Entity")
int64 ServerTimeMs = 0; int64 ServerTimeMs = 0;
}; };

View File

@@ -1,4 +1,4 @@
#include "ZMMOPlayerProxy.h" #include "ZeusPlayerProxy.h"
#include "Animation/AnimInstance.h" #include "Animation/AnimInstance.h"
#include "Components/CapsuleComponent.h" #include "Components/CapsuleComponent.h"
@@ -8,10 +8,10 @@
#include "GameFramework/CharacterMovementComponent.h" #include "GameFramework/CharacterMovementComponent.h"
#include "UObject/ConstructorHelpers.h" #include "UObject/ConstructorHelpers.h"
#include "ZMMO.h" #include "ZMMO.h"
#include "ZMMOProxyMovementComponent.h" #include "ZeusProxyMovementComponent.h"
AZMMOPlayerProxy::AZMMOPlayerProxy(const FObjectInitializer& ObjectInitializer) AZeusPlayerProxy::AZeusPlayerProxy(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer.SetDefaultSubobjectClass<UZMMOProxyMovementComponent>(ACharacter::CharacterMovementComponentName)) : Super(ObjectInitializer.SetDefaultSubobjectClass<UZeusProxyMovementComponent>(ACharacter::CharacterMovementComponentName))
{ {
PrimaryActorTick.bCanEverTick = true; PrimaryActorTick.bCanEverTick = true;
PrimaryActorTick.bStartWithTickEnabled = true; PrimaryActorTick.bStartWithTickEnabled = true;
@@ -43,7 +43,7 @@ AZMMOPlayerProxy::AZMMOPlayerProxy(const FObjectInitializer& ObjectInitializer)
CMC->BrakingFrictionFactor = 0.0f; CMC->BrakingFrictionFactor = 0.0f;
} }
// Defaults visuais (mesh + AnimBP) em paridade com `AZMMOPlayerCharacter`. // Defaults visuais (mesh + AnimBP) em paridade com `AZeusCharacter`.
if (USkeletalMeshComponent* MeshComponent = GetMesh()) if (USkeletalMeshComponent* MeshComponent = GetMesh())
{ {
static ConstructorHelpers::FObjectFinder<USkeletalMesh> QuinnMesh( static ConstructorHelpers::FObjectFinder<USkeletalMesh> QuinnMesh(
@@ -60,7 +60,7 @@ AZMMOPlayerProxy::AZMMOPlayerProxy(const FObjectInitializer& ObjectInitializer)
else else
{ {
UE_LOG(LogZMMO, Warning, UE_LOG(LogZMMO, Warning,
TEXT("AZMMOPlayerProxy: SKM_Quinn_Simple nao encontrado em /Game/Characters/Mannequins/Meshes.")); TEXT("AZeusPlayerProxy: SKM_Quinn_Simple nao encontrado em /Game/Characters/Mannequins/Meshes."));
} }
if (QuinnAnimBp.Succeeded()) if (QuinnAnimBp.Succeeded())
@@ -71,7 +71,7 @@ AZMMOPlayerProxy::AZMMOPlayerProxy(const FObjectInitializer& ObjectInitializer)
else else
{ {
UE_LOG(LogZMMO, Warning, UE_LOG(LogZMMO, Warning,
TEXT("AZMMOPlayerProxy: ABP_Unarmed nao encontrado em /Game/Characters/Mannequins/Anims/Unarmed.")); TEXT("AZeusPlayerProxy: ABP_Unarmed nao encontrado em /Game/Characters/Mannequins/Anims/Unarmed."));
} }
} }
@@ -80,7 +80,7 @@ AZMMOPlayerProxy::AZMMOPlayerProxy(const FObjectInitializer& ObjectInitializer)
bUseControllerRotationRoll = false; bUseControllerRotationRoll = false;
} }
void AZMMOPlayerProxy::BeginPlay() void AZeusPlayerProxy::BeginPlay()
{ {
Super::BeginPlay(); Super::BeginPlay();
@@ -94,7 +94,7 @@ void AZMMOPlayerProxy::BeginPlay()
} }
} }
void AZMMOPlayerProxy::Tick(const float DeltaSeconds) void AZeusPlayerProxy::Tick(const float DeltaSeconds)
{ {
Super::Tick(DeltaSeconds); Super::Tick(DeltaSeconds);
@@ -131,7 +131,7 @@ void AZMMOPlayerProxy::Tick(const float DeltaSeconds)
// Sem snapshot futuro: extrapolacao curta com a ultima velocidade // Sem snapshot futuro: extrapolacao curta com a ultima velocidade
// conhecida, clampada por `MaxExtrapolationSeconds` para nao deixar // conhecida, clampada por `MaxExtrapolationSeconds` para nao deixar
// o proxy fugir se a rede ficar muda. // o proxy fugir se a rede ficar muda.
const FZMMOProxySnapshot& Last = SnapshotBuffer.Last(); const FZeusProxySnapshot& Last = SnapshotBuffer.Last();
const float ExtrapSec = FMath::Clamp( const float ExtrapSec = FMath::Clamp(
static_cast<float>(RenderMs - Last.ServerTimeMs) / 1000.0f, static_cast<float>(RenderMs - Last.ServerTimeMs) / 1000.0f,
0.0f, MaxExtrapolationSeconds); 0.0f, MaxExtrapolationSeconds);
@@ -141,8 +141,8 @@ void AZMMOPlayerProxy::Tick(const float DeltaSeconds)
} }
else else
{ {
const FZMMOProxySnapshot& A = SnapshotBuffer[IdxB - 1]; const FZeusProxySnapshot& A = SnapshotBuffer[IdxB - 1];
const FZMMOProxySnapshot& B = SnapshotBuffer[IdxB]; const FZeusProxySnapshot& B = SnapshotBuffer[IdxB];
const double Span = FMath::Max<double>(1.0, static_cast<double>(B.ServerTimeMs - A.ServerTimeMs)); const double Span = FMath::Max<double>(1.0, static_cast<double>(B.ServerTimeMs - A.ServerTimeMs));
InterpAlpha = static_cast<float>(FMath::Clamp( InterpAlpha = static_cast<float>(FMath::Clamp(
static_cast<double>(RenderMs - A.ServerTimeMs) / Span, 0.0, 1.0)); static_cast<double>(RenderMs - A.ServerTimeMs) / Span, 0.0, 1.0));
@@ -208,19 +208,19 @@ void AZMMOPlayerProxy::Tick(const float DeltaSeconds)
const int64 NewestMs = SnapshotBuffer.Last().ServerTimeMs; const int64 NewestMs = SnapshotBuffer.Last().ServerTimeMs;
const int64 RenderLagMs = ServerNowMs - NewestMs; const int64 RenderLagMs = ServerNowMs - NewestMs;
UE_LOG(LogZMMO, Verbose, UE_LOG(LogZMMO, Verbose,
TEXT("ZMMOPlayerProxy[%lld] buffer=%d renderLagMs=%lld interpAlpha=%.2f extrap=%d delayMs=%.0f"), TEXT("ZeusPlayerProxy[%lld] buffer=%d renderLagMs=%lld interpAlpha=%.2f extrap=%d delayMs=%.0f"),
EntityId, SnapshotBuffer.Num(), RenderLagMs, InterpAlpha, EntityId, SnapshotBuffer.Num(), RenderLagMs, InterpAlpha,
bExtrapolating ? 1 : 0, InterpolationDelayMs); bExtrapolating ? 1 : 0, InterpolationDelayMs);
} }
} }
void AZMMOPlayerProxy::SetZMMOIdentity(const int64 InEntityId, const EZMMOEntityType InEntityType) void AZeusPlayerProxy::SetZeusIdentity(const int64 InEntityId, const EZeusEntityType InEntityType)
{ {
EntityId = InEntityId; EntityId = InEntityId;
EntityType = InEntityType; EntityType = InEntityType;
} }
void AZMMOPlayerProxy::ApplyEntitySnapshot(const FZMMOEntitySnapshot& Snapshot) void AZeusPlayerProxy::ApplyEntitySnapshot(const FZeusEntitySnapshot& Snapshot)
{ {
// Estabiliza o offset de relogio na primeira amostra. Subsequente nao // Estabiliza o offset de relogio na primeira amostra. Subsequente nao
// re-sincroniza para evitar saltos visuais; um esquema mais sofisticado // re-sincroniza para evitar saltos visuais; um esquema mais sofisticado
@@ -231,7 +231,7 @@ void AZMMOPlayerProxy::ApplyEntitySnapshot(const FZMMOEntitySnapshot& Snapshot)
ServerClockOffsetMs = LocalNowMs - Snapshot.ServerTimeMs; ServerClockOffsetMs = LocalNowMs - Snapshot.ServerTimeMs;
} }
FZMMOProxySnapshot S; FZeusProxySnapshot S;
S.PosCm = Snapshot.PositionCm; S.PosCm = Snapshot.PositionCm;
S.VelCmS = Snapshot.VelocityCmS; S.VelCmS = Snapshot.VelocityCmS;
S.bGrounded = Snapshot.bGrounded; S.bGrounded = Snapshot.bGrounded;
@@ -282,20 +282,20 @@ void AZMMOPlayerProxy::ApplyEntitySnapshot(const FZMMOEntitySnapshot& Snapshot)
ApplyCollisionPolicy(); ApplyCollisionPolicy();
} }
void AZMMOPlayerProxy::SetEntityRelevant(const bool bRelevant) void AZeusPlayerProxy::SetEntityRelevant(const bool bRelevant)
{ {
if (bIsZMMORelevant == bRelevant) if (bIsZeusRelevant == bRelevant)
{ {
return; return;
} }
bIsZMMORelevant = bRelevant; bIsZeusRelevant = bRelevant;
SetActorHiddenInGame(!bRelevant); SetActorHiddenInGame(!bRelevant);
SetActorTickEnabled(bRelevant); SetActorTickEnabled(bRelevant);
ApplyCollisionPolicy(); ApplyCollisionPolicy();
} }
void AZMMOPlayerProxy::RefreshAnimationDrivers() void AZeusPlayerProxy::RefreshAnimationDrivers()
{ {
UCharacterMovementComponent* CMC = GetCharacterMovement(); UCharacterMovementComponent* CMC = GetCharacterMovement();
if (!CMC) if (!CMC)
@@ -314,13 +314,13 @@ void AZMMOPlayerProxy::RefreshAnimationDrivers()
// Acceleration externa via CMC custom — alimenta `Get Current Acceleration` // Acceleration externa via CMC custom — alimenta `Get Current Acceleration`
// que o AnimBP do Quinn usa em `ShouldMove` e nas transições de Jump_Start. // que o AnimBP do Quinn usa em `ShouldMove` e nas transições de Jump_Start.
if (UZMMOProxyMovementComponent* ProxyCMC = Cast<UZMMOProxyMovementComponent>(CMC)) if (UZeusProxyMovementComponent* ProxyCMC = Cast<UZeusProxyMovementComponent>(CMC))
{ {
ProxyCMC->SetZMMOExternalAcceleration(LastDerivedAccelerationCmS2); ProxyCMC->SetZeusExternalAcceleration(LastDerivedAccelerationCmS2);
} }
} }
void AZMMOPlayerProxy::ApplyCollisionPolicy() void AZeusPlayerProxy::ApplyCollisionPolicy()
{ {
UCapsuleComponent* Capsule = GetCapsuleComponent(); UCapsuleComponent* Capsule = GetCapsuleComponent();
if (!Capsule) if (!Capsule)
@@ -328,6 +328,6 @@ void AZMMOPlayerProxy::ApplyCollisionPolicy()
return; return;
} }
const bool bShouldCollide = bIsZMMORelevant && bHasFirstSnapshot; const bool bShouldCollide = bIsZeusRelevant && bHasFirstSnapshot;
Capsule->SetCollisionEnabled(bShouldCollide ? ECollisionEnabled::QueryOnly : ECollisionEnabled::NoCollision); Capsule->SetCollisionEnabled(bShouldCollide ? ECollisionEnabled::QueryOnly : ECollisionEnabled::NoCollision);
} }

View File

@@ -2,19 +2,18 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "GameFramework/Character.h" #include "GameFramework/Character.h"
#include "ZMMOEntityInterface.h" #include "ZeusEntityInterface.h"
#include "ZMMOEntityTypes.h" #include "ZeusEntityTypes.h"
#include "ZMMOPlayerProxy.generated.h" #include "ZeusPlayerProxy.generated.h"
/** /**
* AZMMOPlayerProxy * AZeusPlayerProxy
* *
* Proxy visual para jogadores remotos (e, no futuro, mobs com locomotion * Proxy visual para jogadores remotos (e, no futuro, mobs com locomotion
* por capsula) cuja posicao vem 100% do servidor via snapshots * por capsula) cuja posicao vem 100% do servidor via snapshots
* (`UZeusNetworkSubsystem::OnPlayerStateUpdate`). * (`UZeusNetworkSubsystem::OnPlayerStateUpdate`).
* *
* Inspirado em `AZeusRemoteCharacter` (ZeusV1). Diferencas chave vs. * Diferencas chave vs. `AZeusCharacter` (jogador local):
* `AZMMOPlayerCharacter` (jogador local):
* - SEM `EnhancedInput`, sem envio de `C_INPUT_AXIS`. * - SEM `EnhancedInput`, sem envio de `C_INPUT_AXIS`.
* - SEM buffer de pending inputs nem reconciliacao. * - SEM buffer de pending inputs nem reconciliacao.
* - Posicao aplicada por snapshot (`ApplyEntitySnapshot`); a `ACharacter` * - Posicao aplicada por snapshot (`ApplyEntitySnapshot`); a `ACharacter`
@@ -22,19 +21,18 @@
* mas o CMC fica em modo "kinematic-ish" (nao integra fisica). * mas o CMC fica em modo "kinematic-ish" (nao integra fisica).
* *
* Animacao no AnimBP do Quinn (`ABP_Unarmed`): a formula `ShouldMove` exige * Animacao no AnimBP do Quinn (`ABP_Unarmed`): a formula `ShouldMove` exige
* `Acceleration != 0`. Como proxies nao tem input, adoptamos a mesma * `Acceleration != 0`. Como proxies nao tem input, adoptamos a estrategia
* estrategia do ZClientMMO: CMC custom (`UZMMOProxyMovementComponent`) com * de CMC custom (`UZeusProxyMovementComponent`) com escrita externa de
* escrita externa de `Acceleration`, alimentada pela derivada da velocidade * `Acceleration`, alimentada pela derivada da velocidade entre snapshots.
* entre snapshots. Tick do proxy roda **antes** do mesh tick para que * Tick do proxy roda **antes** do mesh tick para que Velocity+Acceleration
* Velocity+Acceleration estejam populados quando o `NativeUpdateAnimation` * estejam populados quando o `NativeUpdateAnimation` do AnimBP os ler.
* do AnimBP os ler.
*/ */
/** /**
* Snapshot bruto guardado no buffer de interpolacao. Mantido como struct privada * Snapshot bruto guardado no buffer de interpolacao. Mantido como struct privada
* ao .h porque so o proxy (e debugging local) precisa olhar para ele. * ao .h porque so o proxy (e debugging local) precisa olhar para ele.
*/ */
USTRUCT() USTRUCT()
struct FZMMOProxySnapshot struct FZeusProxySnapshot
{ {
GENERATED_BODY() GENERATED_BODY()
@@ -53,37 +51,37 @@ struct FZMMOProxySnapshot
}; };
UCLASS(Blueprintable, BlueprintType) UCLASS(Blueprintable, BlueprintType)
class ZMMO_API AZMMOPlayerProxy : public ACharacter, public IZMMOEntityInterface class ZMMO_API AZeusPlayerProxy : public ACharacter, public IZeusEntityInterface
{ {
GENERATED_BODY() GENERATED_BODY()
public: public:
AZMMOPlayerProxy(const FObjectInitializer& ObjectInitializer); AZeusPlayerProxy(const FObjectInitializer& ObjectInitializer);
virtual void BeginPlay() override; virtual void BeginPlay() override;
virtual void Tick(float DeltaSeconds) override; virtual void Tick(float DeltaSeconds) override;
// --- IZMMOEntityInterface --- // --- IZeusEntityInterface ---
virtual int64 GetZMMOEntityId() const override { return EntityId; } virtual int64 GetZeusEntityId() const override { return EntityId; }
virtual EZMMOEntityType GetZMMOEntityType() const override { return EntityType; } virtual EZeusEntityType GetZeusEntityType() const override { return EntityType; }
virtual void ApplyEntitySnapshot(const FZMMOEntitySnapshot& Snapshot) override; virtual void ApplyEntitySnapshot(const FZeusEntitySnapshot& Snapshot) override;
virtual void SetEntityRelevant(bool bRelevant) override; virtual void SetEntityRelevant(bool bRelevant) override;
UFUNCTION(BlueprintCallable, Category = "ZMMO|Entity") UFUNCTION(BlueprintCallable, Category = "Zeus|Entity")
void SetZMMOIdentity(int64 InEntityId, EZMMOEntityType InEntityType); void SetZeusIdentity(int64 InEntityId, EZeusEntityType InEntityType);
protected: protected:
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Entity") UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Entity")
int64 EntityId = 0; int64 EntityId = 0;
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Entity") UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Entity")
EZMMOEntityType EntityType = EZMMOEntityType::Player; EZeusEntityType EntityType = EZeusEntityType::Player;
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Entity") UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Entity")
bool bIsZMMORelevant = true; bool bIsZeusRelevant = true;
/** True apos o primeiro snapshot ser aplicado — antes disso o ator pode ficar oculto. */ /** True apos o primeiro snapshot ser aplicado — antes disso o ator pode ficar oculto. */
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Entity") UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Entity")
bool bHasFirstSnapshot = false; bool bHasFirstSnapshot = false;
/** /**
@@ -91,15 +89,15 @@ protected:
* de `InterpolatedPosCm` (visual) separar os dois e essencial para * de `InterpolatedPosCm` (visual) separar os dois e essencial para
* comparar drift autoritativo vs visual via debug overlay/logs. * comparar drift autoritativo vs visual via debug overlay/logs.
*/ */
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Entity") UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Entity")
FVector AuthoritativePosCm = FVector::ZeroVector; FVector AuthoritativePosCm = FVector::ZeroVector;
/** Posicao **visual** atual (resultado da interpolacao do tick). */ /** Posicao **visual** atual (resultado da interpolacao do tick). */
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Entity") UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Entity")
FVector InterpolatedPosCm = FVector::ZeroVector; FVector InterpolatedPosCm = FVector::ZeroVector;
/** Compat: alias para `AuthoritativePosCm` (preserva binding de Blueprint, se houver). */ /** Compat: alias para `AuthoritativePosCm` (preserva binding de Blueprint, se houver). */
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Entity") UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Entity")
FVector LastSnapshotPosition = FVector::ZeroVector; FVector LastSnapshotPosition = FVector::ZeroVector;
/** /**
@@ -108,7 +106,7 @@ protected:
* em cada `Tick` para manter os drivers de animacao alimentados entre * em cada `Tick` para manter os drivers de animacao alimentados entre
* updates de rede. * updates de rede.
*/ */
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Entity") UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Entity")
FVector VisualVelocity = FVector::ZeroVector; FVector VisualVelocity = FVector::ZeroVector;
/** /**
@@ -116,23 +114,23 @@ protected:
* expresso no dominio do tempo do servidor. Padrao 100 ms (~3 snapshots a 30 Hz) * expresso no dominio do tempo do servidor. Padrao 100 ms (~3 snapshots a 30 Hz)
* cobre 1 perda + 1 jitter sem extrapolar. * cobre 1 perda + 1 jitter sem extrapolar.
*/ */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ZMMO|Network", UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Zeus|Network",
meta = (ClampMin = "0.0", ClampMax = "500.0")) meta = (ClampMin = "0.0", ClampMax = "500.0"))
double InterpolationDelayMs = 100.0; double InterpolationDelayMs = 100.0;
/** Tamanho maximo do buffer (em snapshots). Cobre ~270 ms a 30 Hz. */ /** Tamanho maximo do buffer (em snapshots). Cobre ~270 ms a 30 Hz. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ZMMO|Network", UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Zeus|Network",
meta = (ClampMin = "2", ClampMax = "32")) meta = (ClampMin = "2", ClampMax = "32"))
int32 SnapshotBufferCapacity = 8; int32 SnapshotBufferCapacity = 8;
/** Limite duro de extrapolacao (s) quando nao ha snapshot futuro. */ /** Limite duro de extrapolacao (s) quando nao ha snapshot futuro. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ZMMO|Network", UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Zeus|Network",
meta = (ClampMin = "0.0", ClampMax = "0.5")) meta = (ClampMin = "0.0", ClampMax = "0.5"))
float MaxExtrapolationSeconds = 0.1f; float MaxExtrapolationSeconds = 0.1f;
/** Buffer ordenado por `ServerTimeMs` ascendente. */ /** Buffer ordenado por `ServerTimeMs` ascendente. */
UPROPERTY() UPROPERTY()
TArray<FZMMOProxySnapshot> SnapshotBuffer; TArray<FZeusProxySnapshot> SnapshotBuffer;
/** /**
* Offset entre o relogio local (`FPlatformTime::Seconds * 1000`) e o * Offset entre o relogio local (`FPlatformTime::Seconds * 1000`) e o

View File

@@ -0,0 +1,24 @@
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/CharacterMovementComponent.h"
#include "ZeusProxyMovementComponent.generated.h"
/**
* CMC customizado para AZeusPlayerProxy. Expõe escrita direta de Acceleration
* (protected na base) para que o AnimBP veja Acceleration!=0 quando o proxy
* recebe snapshots, alimentando a fórmula ShouldMove e a transição Jump_Start
* do ABP_Unarmed (ambas dependem de aceleração não-nula).
*/
UCLASS(ClassGroup = (Zeus), meta = (BlueprintSpawnableComponent))
class ZMMO_API UZeusProxyMovementComponent : public UCharacterMovementComponent
{
GENERATED_BODY()
public:
void SetZeusExternalAcceleration(const FVector& InAccelerationCmS2)
{
Acceleration = InAccelerationCmS2;
}
};

View File

@@ -1,10 +0,0 @@
#include "ZMMOFrontEndGameMode.h"
#include "ZMMOFrontEndPlayerController.h"
AZMMOFrontEndGameMode::AZMMOFrontEndGameMode()
{
// UI pura: sem pawn. O controller cria o root layout e arranca o fluxo.
DefaultPawnClass = nullptr;
PlayerControllerClass = AZMMOFrontEndPlayerController::StaticClass();
}

View File

@@ -1,14 +0,0 @@
#include "ZMMOGameMode.h"
#include "ZMMOHUD.h"
#include "ZMMOPlayerCharacter.h"
#include "ZMMOPlayerController.h"
#include "ZMMOPlayerState.h"
AZMMOGameMode::AZMMOGameMode()
{
DefaultPawnClass = AZMMOPlayerCharacter::StaticClass();
PlayerControllerClass = AZMMOPlayerController::StaticClass();
PlayerStateClass = AZMMOPlayerState::StaticClass();
HUDClass = AZMMOHUD::StaticClass();
}

View File

@@ -0,0 +1,10 @@
#include "ZeusFrontEndGameMode.h"
#include "ZeusFrontEndPlayerController.h"
AZeusFrontEndGameMode::AZeusFrontEndGameMode()
{
// UI pura: sem pawn. O controller cria o root layout e arranca o fluxo.
DefaultPawnClass = nullptr;
PlayerControllerClass = AZeusFrontEndPlayerController::StaticClass();
}

View File

@@ -2,21 +2,21 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "GameFramework/GameModeBase.h" #include "GameFramework/GameModeBase.h"
#include "ZMMOFrontEndGameMode.generated.h" #include "ZeusFrontEndGameMode.generated.h"
/** /**
* AZMMOFrontEndGameMode * AZeusFrontEndGameMode
* *
* GameMode do mapa de front-end (L_FrontEnd): UI, sem pawn nem network * GameMode do mapa de front-end (L_FrontEnd): UI, sem pawn nem network
* play. NÃO é o GameMode global (esse continua AZMMOGameMode para mapas de * play. NÃO é o GameMode global (esse continua AZeusGameMode para mapas de
* mundo) aplicado via override no World Settings de L_FrontEnd * mundo) aplicado via override no World Settings de L_FrontEnd
* (ARQUITETURA.md §3.3 / decisão de mapa dedicado). * (ARQUITETURA.md §3.3 / decisão de mapa dedicado).
*/ */
UCLASS(Blueprintable, BlueprintType) UCLASS(Blueprintable, BlueprintType)
class ZMMO_API AZMMOFrontEndGameMode : public AGameModeBase class ZMMO_API AZeusFrontEndGameMode : public AGameModeBase
{ {
GENERATED_BODY() GENERATED_BODY()
public: public:
AZMMOFrontEndGameMode(); AZeusFrontEndGameMode();
}; };

View File

@@ -1,13 +1,13 @@
#include "ZMMOGameInstance.h" #include "ZeusGameInstance.h"
#include "ZMMO.h" #include "ZMMO.h"
#include "ZeusNetworkSubsystem.h" #include "ZeusNetworkSubsystem.h"
void UZMMOGameInstance::Init() void UZeusGameInstance::Init()
{ {
Super::Init(); Super::Init();
UE_LOG(LogZMMO, Log, TEXT("ZMMOGameInstance::Init AutoConnect=%s Host=%s Port=%d"), UE_LOG(LogZMMO, Log, TEXT("ZeusGameInstance::Init AutoConnect=%s Host=%s Port=%d"),
bAutoConnectOnStart ? TEXT("true") : TEXT("false"), bAutoConnectOnStart ? TEXT("true") : TEXT("false"),
*ZeusServerHost, *ZeusServerHost,
ZeusServerPort); ZeusServerPort);
@@ -15,7 +15,7 @@ void UZMMOGameInstance::Init()
UZeusNetworkSubsystem* ZeusNet = GetZeusNetwork(); UZeusNetworkSubsystem* ZeusNet = GetZeusNetwork();
if (!ZeusNet) if (!ZeusNet)
{ {
UE_LOG(LogZMMO, Warning, TEXT("ZMMOGameInstance: ZeusNetworkSubsystem unavailable; ZeusNetwork plugin enabled?")); UE_LOG(LogZMMO, Warning, TEXT("ZeusGameInstance: ZeusNetworkSubsystem unavailable; ZeusNetwork plugin enabled?"));
return; return;
} }
@@ -29,7 +29,7 @@ void UZMMOGameInstance::Init()
ZeusNet->ConnectToZeusServer(ZeusServerHost, ZeusServerPort); ZeusNet->ConnectToZeusServer(ZeusServerHost, ZeusServerPort);
} }
void UZMMOGameInstance::Shutdown() void UZeusGameInstance::Shutdown()
{ {
if (UZeusNetworkSubsystem* ZeusNet = GetZeusNetwork()) if (UZeusNetworkSubsystem* ZeusNet = GetZeusNetwork())
{ {
@@ -43,55 +43,55 @@ void UZMMOGameInstance::Shutdown()
Super::Shutdown(); Super::Shutdown();
} }
UZeusNetworkSubsystem* UZMMOGameInstance::GetZeusNetwork() const UZeusNetworkSubsystem* UZeusGameInstance::GetZeusNetwork() const
{ {
return GetSubsystem<UZeusNetworkSubsystem>(); return GetSubsystem<UZeusNetworkSubsystem>();
} }
void UZMMOGameInstance::BindZeusDelegates(UZeusNetworkSubsystem* Zeus) void UZeusGameInstance::BindZeusDelegates(UZeusNetworkSubsystem* Zeus)
{ {
if (!Zeus) if (!Zeus)
{ {
return; return;
} }
Zeus->OnConnected.AddDynamic(this, &UZMMOGameInstance::HandleZeusConnected); Zeus->OnConnected.AddDynamic(this, &UZeusGameInstance::HandleZeusConnected);
Zeus->OnConnectionFailed.AddDynamic(this, &UZMMOGameInstance::HandleZeusConnectionFailed); Zeus->OnConnectionFailed.AddDynamic(this, &UZeusGameInstance::HandleZeusConnectionFailed);
Zeus->OnDisconnected.AddDynamic(this, &UZMMOGameInstance::HandleZeusDisconnected); Zeus->OnDisconnected.AddDynamic(this, &UZeusGameInstance::HandleZeusDisconnected);
// OnNetworkLog: NAO assinamos. Plugin ja loga em LogZeusNetwork (console) // OnNetworkLog: NAO assinamos. Plugin ja loga em LogZeusNetwork (console)
// + arquivo proprio em Saved/Logs/ZeusNetwork/. Forwarding em LogZMMO era // + arquivo proprio em Saved/Logs/ZeusNetwork/. Forwarding em LogZMMO era
// diagnostico inicial (sessao 2026-05-07); agora gera duplicacao de cada // diagnostico inicial (sessao 2026-05-07); agora gera duplicacao de cada
// linha. Remova esta nota e descomente abaixo se quiser ver no LogZMMO: // linha. Remova esta nota e descomente abaixo se quiser ver no LogZMMO:
// Zeus->OnNetworkLog.AddDynamic(this, &UZMMOGameInstance::HandleZeusNetworkLog); // Zeus->OnNetworkLog.AddDynamic(this, &UZeusGameInstance::HandleZeusNetworkLog);
} }
void UZMMOGameInstance::UnbindZeusDelegates(UZeusNetworkSubsystem* Zeus) void UZeusGameInstance::UnbindZeusDelegates(UZeusNetworkSubsystem* Zeus)
{ {
if (!Zeus) if (!Zeus)
{ {
return; return;
} }
Zeus->OnConnected.RemoveDynamic(this, &UZMMOGameInstance::HandleZeusConnected); Zeus->OnConnected.RemoveDynamic(this, &UZeusGameInstance::HandleZeusConnected);
Zeus->OnConnectionFailed.RemoveDynamic(this, &UZMMOGameInstance::HandleZeusConnectionFailed); Zeus->OnConnectionFailed.RemoveDynamic(this, &UZeusGameInstance::HandleZeusConnectionFailed);
Zeus->OnDisconnected.RemoveDynamic(this, &UZMMOGameInstance::HandleZeusDisconnected); Zeus->OnDisconnected.RemoveDynamic(this, &UZeusGameInstance::HandleZeusDisconnected);
// OnNetworkLog: nao foi assinado (ver BindZeusDelegates) — nada a remover. // OnNetworkLog: nao foi assinado (ver BindZeusDelegates) — nada a remover.
} }
void UZMMOGameInstance::HandleZeusConnected() void UZeusGameInstance::HandleZeusConnected()
{ {
UE_LOG(LogZMMO, Log, TEXT("[Zeus] Connected to server %s:%d"), *ZeusServerHost, ZeusServerPort); UE_LOG(LogZMMO, Log, TEXT("[Zeus] Connected to server %s:%d"), *ZeusServerHost, ZeusServerPort);
} }
void UZMMOGameInstance::HandleZeusConnectionFailed(FString Reason) void UZeusGameInstance::HandleZeusConnectionFailed(FString Reason)
{ {
UE_LOG(LogZMMO, Warning, TEXT("[Zeus] Connection failed: %s"), *Reason); UE_LOG(LogZMMO, Warning, TEXT("[Zeus] Connection failed: %s"), *Reason);
} }
void UZMMOGameInstance::HandleZeusDisconnected() void UZeusGameInstance::HandleZeusDisconnected()
{ {
UE_LOG(LogZMMO, Log, TEXT("[Zeus] Disconnected.")); UE_LOG(LogZMMO, Log, TEXT("[Zeus] Disconnected."));
} }
void UZMMOGameInstance::HandleZeusNetworkLog(FString Message) void UZeusGameInstance::HandleZeusNetworkLog(FString Message)
{ {
UE_LOG(LogZMMO, Log, TEXT("[Zeus] %s"), *Message); UE_LOG(LogZMMO, Log, TEXT("[Zeus] %s"), *Message);
} }

View File

@@ -2,12 +2,12 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "Engine/GameInstance.h" #include "Engine/GameInstance.h"
#include "ZMMOGameInstance.generated.h" #include "ZeusGameInstance.generated.h"
class UZeusNetworkSubsystem; class UZeusNetworkSubsystem;
/** /**
* UZMMOGameInstance * UZeusGameInstance
* *
* Game instance do cliente Zeus MMO. O `UZeusNetworkSubsystem` (do plugin * Game instance do cliente Zeus MMO. O `UZeusNetworkSubsystem` (do plugin
* `ZeusNetwork`) e um `UGameInstanceSubsystem` e portanto e criado * `ZeusNetwork`) e um `UGameInstanceSubsystem` e portanto e criado
@@ -22,7 +22,7 @@ class UZeusNetworkSubsystem;
* overrides de configuracao por build (dev / staging / prod). * overrides de configuracao por build (dev / staging / prod).
*/ */
UCLASS(Blueprintable, BlueprintType) UCLASS(Blueprintable, BlueprintType)
class ZMMO_API UZMMOGameInstance : public UGameInstance class ZMMO_API UZeusGameInstance : public UGameInstance
{ {
GENERATED_BODY() GENERATED_BODY()
@@ -36,20 +36,20 @@ public:
* dirigida pelo `UUIFrontEndFlowSubsystem` (fluxo BootConnectingLogin). * dirigida pelo `UUIFrontEndFlowSubsystem` (fluxo BootConnectingLogin).
* Pôr `true` apenas para smoke test legado sem front-end. * Pôr `true` apenas para smoke test legado sem front-end.
*/ */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Config, Category = "ZMMO|Network") UPROPERTY(EditAnywhere, BlueprintReadWrite, Config, Category = "Zeus|Network")
bool bAutoConnectOnStart = false; bool bAutoConnectOnStart = false;
/** Host (IPv4 ou hostname) do servidor Zeus. */ /** Host (IPv4 ou hostname) do servidor Zeus. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Config, Category = "ZMMO|Network") UPROPERTY(EditAnywhere, BlueprintReadWrite, Config, Category = "Zeus|Network")
FString ZeusServerHost = TEXT("127.0.0.1"); FString ZeusServerHost = TEXT("127.0.0.1");
/** Porta UDP do servidor Zeus (1..65535). */ /** Porta UDP do servidor Zeus (1..65535). */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Config, Category = "ZMMO|Network", meta = (ClampMin = "1", ClampMax = "65535")) UPROPERTY(EditAnywhere, BlueprintReadWrite, Config, Category = "Zeus|Network", meta = (ClampMin = "1", ClampMax = "65535"))
int32 ZeusServerPort = 27777; int32 ZeusServerPort = 27777;
protected: protected:
/** Devolve o subsystem Zeus desta game instance (criado automaticamente pelo plugin). */ /** Devolve o subsystem Zeus desta game instance (criado automaticamente pelo plugin). */
UFUNCTION(BlueprintPure, Category = "ZMMO|Network") UFUNCTION(BlueprintPure, Category = "Zeus|Network")
UZeusNetworkSubsystem* GetZeusNetwork() const; UZeusNetworkSubsystem* GetZeusNetwork() const;
void BindZeusDelegates(UZeusNetworkSubsystem* Zeus); void BindZeusDelegates(UZeusNetworkSubsystem* Zeus);

View File

@@ -0,0 +1,14 @@
#include "ZeusGameMode.h"
#include "ZeusHUD.h"
#include "ZeusCharacter.h"
#include "ZeusPlayerController.h"
#include "ZeusPlayerState.h"
AZeusGameMode::AZeusGameMode()
{
DefaultPawnClass = AZeusCharacter::StaticClass();
PlayerControllerClass = AZeusPlayerController::StaticClass();
PlayerStateClass = AZeusPlayerState::StaticClass();
HUDClass = AZeusHUD::StaticClass();
}

View File

@@ -2,24 +2,24 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "GameFramework/GameModeBase.h" #include "GameFramework/GameModeBase.h"
#include "ZMMOGameMode.generated.h" #include "ZeusGameMode.generated.h"
/** /**
* AZMMOGameMode * AZeusGameMode
* *
* Game mode do cliente Zeus MMO. Configura `AZMMOPlayerCharacter` como * Game mode do cliente Zeus MMO. Configura `AZeusCharacter` como
* `DefaultPawnClass` e `AZMMOPlayerController` como `PlayerControllerClass`. * `DefaultPawnClass` e `AZeusPlayerController` como `PlayerControllerClass`.
* *
* A classe e instanciavel directamente (apontada por * A classe e instanciavel directamente (apontada por
* `GlobalDefaultGameMode=/Script/ZMMO.ZMMOGameMode` em * `GlobalDefaultGameMode=/Script/ZMMO.ZeusGameMode` em
* `Config/DefaultEngine.ini`); um BP filho e opcional para overrides * `Config/DefaultEngine.ini`); um BP filho e opcional para overrides
* por mapa / build (skeletal mesh, AnimBP custom, etc.). * por mapa / build (skeletal mesh, AnimBP custom, etc.).
*/ */
UCLASS(Blueprintable, BlueprintType) UCLASS(Blueprintable, BlueprintType)
class ZMMO_API AZMMOGameMode : public AGameModeBase class ZMMO_API AZeusGameMode : public AGameModeBase
{ {
GENERATED_BODY() GENERATED_BODY()
public: public:
AZMMOGameMode(); AZeusGameMode();
}; };

View File

@@ -1,16 +1,16 @@
#include "ZMMOHUD.h" #include "ZeusHUD.h"
#include "Engine/GameInstance.h" #include "Engine/GameInstance.h"
#include "ZMMO.h" #include "ZMMO.h"
#include "UI/InGame/UIInGameFlowSubsystem.h" #include "UI/InGame/UIInGameFlowSubsystem.h"
AZMMOHUD::AZMMOHUD() AZeusHUD::AZeusHUD()
{ {
// AHUD nao precisa tick — toda atualizacao vem via UMG (delegates + // AHUD nao precisa tick — toda atualizacao vem via UMG (delegates +
// CommonUI). PrimaryActorTick default e' off; mantemos. // CommonUI). PrimaryActorTick default e' off; mantemos.
} }
void AZMMOHUD::BeginPlay() void AZeusHUD::BeginPlay()
{ {
Super::BeginPlay(); Super::BeginPlay();
@@ -25,12 +25,12 @@ void AZMMOHUD::BeginPlay()
else else
{ {
UE_LOG(LogZMMO, Warning, UE_LOG(LogZMMO, Warning,
TEXT("AZMMOHUD: UUIInGameFlowSubsystem nao encontrado — HUD nao sera spawnado")); TEXT("AZeusHUD: UUIInGameFlowSubsystem nao encontrado — HUD nao sera spawnado"));
} }
} }
} }
void AZMMOHUD::EndPlay(const EEndPlayReason::Type EndPlayReason) void AZeusHUD::EndPlay(const EEndPlayReason::Type EndPlayReason)
{ {
// UUIInGameFlowSubsystem persiste no GameInstance entre OpenLevel — nao // UUIInGameFlowSubsystem persiste no GameInstance entre OpenLevel — nao
// limpamos UI in-game aqui (o front-end flow vai tomar conta na proxima // limpamos UI in-game aqui (o front-end flow vai tomar conta na proxima

View File

@@ -2,7 +2,7 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "GameFramework/HUD.h" #include "GameFramework/HUD.h"
#include "ZMMOHUD.generated.h" #include "ZeusHUD.generated.h"
/** /**
* HUD do MMO. Pattern UE5 idiomatico: o GameMode atribui `HUDClass`, o * HUD do MMO. Pattern UE5 idiomatico: o GameMode atribui `HUDClass`, o
@@ -14,21 +14,21 @@
* subsystem cuida do cleanup. * subsystem cuida do cleanup.
* *
* Separacao de responsabilidades: * Separacao de responsabilidades:
* - AZMMOPlayerCharacter (Pawn) movimento, input, AttributeComponent * - AZeusCharacter (Pawn) movimento, input, AttributeComponent
* - AZMMOPlayerController input mapping, mouse * - AZeusPlayerController input mapping, mouse
* - AZMMOHUD UI lifecycle * - AZeusHUD UI lifecycle
* - AZMMOGameMode wires tudo via class slots * - AZeusGameMode wires tudo via class slots
* *
* NAO desenha nada via canvas (AHUD::DrawHUD). UI inteira vive em UMG + * NAO desenha nada via canvas (AHUD::DrawHUD). UI inteira vive em UMG +
* CommonUI (UI.Layer.Game / GameMenu / Modal). * CommonUI (UI.Layer.Game / GameMenu / Modal).
*/ */
UCLASS() UCLASS()
class ZMMO_API AZMMOHUD : public AHUD class ZMMO_API AZeusHUD : public AHUD
{ {
GENERATED_BODY() GENERATED_BODY()
public: public:
AZMMOHUD(); AZeusHUD();
protected: protected:
virtual void BeginPlay() override; virtual void BeginPlay() override;

View File

@@ -1,14 +1,14 @@
#include "ZMMOPlayerState.h" #include "ZeusPlayerState.h"
#include "Components/ActorComponent.h" #include "Components/ActorComponent.h"
#include "Misc/ConfigCacheIni.h" #include "Misc/ConfigCacheIni.h"
#include "Net/UnrealNetwork.h" #include "Net/UnrealNetwork.h"
#include "ZMMO.h" #include "ZMMO.h"
AZMMOPlayerState::AZMMOPlayerState() AZeusPlayerState::AZeusPlayerState()
{ {
// Component Registry: instancia cada classe declarada em // Component Registry: instancia cada classe declarada em
// DefaultGame.ini::[/Script/ZMMO.ZMMOPlayerState]+ComponentClasses=... // DefaultGame.ini::[/Script/ZMMO.ZeusPlayerState]+ComponentClasses=...
// //
// Le manualmente via GConfig para evitar timing do UPROPERTY(Config), // Le manualmente via GConfig para evitar timing do UPROPERTY(Config),
// que requer LoadConfig() ja ter rodado no CDO antes da instance ser // que requer LoadConfig() ja ter rodado no CDO antes da instance ser
@@ -17,7 +17,7 @@ AZMMOPlayerState::AZMMOPlayerState()
if (ComponentClasses.Num() == 0 && GConfig) if (ComponentClasses.Num() == 0 && GConfig)
{ {
TArray<FString> ClassPaths; TArray<FString> ClassPaths;
GConfig->GetArray(TEXT("/Script/ZMMO.ZMMOPlayerState"), GConfig->GetArray(TEXT("/Script/ZMMO.ZeusPlayerState"),
TEXT("ComponentClasses"), TEXT("ComponentClasses"),
ClassPaths, ClassPaths,
GGameIni); GGameIni);
@@ -30,13 +30,13 @@ AZMMOPlayerState::AZMMOPlayerState()
else else
{ {
UE_LOG(LogZMMO, Warning, UE_LOG(LogZMMO, Warning,
TEXT("ZMMOPlayerState: ComponentClasses path nao resolveu: %s"), *Path); TEXT("ZeusPlayerState: ComponentClasses path nao resolveu: %s"), *Path);
} }
} }
} }
UE_LOG(LogZMMO, Log, UE_LOG(LogZMMO, Log,
TEXT("AZMMOPlayerState ctor: %d componente(s) no registry (instance=%s)"), TEXT("AZeusPlayerState ctor: %d componente(s) no registry (instance=%s)"),
ComponentClasses.Num(), *GetName()); ComponentClasses.Num(), *GetName());
int32 SubobjectIndex = 0; int32 SubobjectIndex = 0;
@@ -46,13 +46,13 @@ AZMMOPlayerState::AZMMOPlayerState()
if (!CompClass) if (!CompClass)
{ {
UE_LOG(LogZMMO, Warning, UE_LOG(LogZMMO, Warning,
TEXT("ZMMOPlayerState: ComponentClass null em ComponentClasses[%d]"), TEXT("ZeusPlayerState: ComponentClass null em ComponentClasses[%d]"),
SubobjectIndex); SubobjectIndex);
++SubobjectIndex; ++SubobjectIndex;
continue; continue;
} }
const FName CompName = MakeUniqueObjectName(this, CompClass, const FName CompName = MakeUniqueObjectName(this, CompClass,
FName(*FString::Printf(TEXT("ZMMOComp_%d_%s"), SubobjectIndex, *CompClass->GetName()))); FName(*FString::Printf(TEXT("ZeusComp_%d_%s"), SubobjectIndex, *CompClass->GetName())));
// Overload runtime de CreateDefaultSubobject retorna UObject* (sem template) — // Overload runtime de CreateDefaultSubobject retorna UObject* (sem template) —
// precisa cast para UActorComponent. // precisa cast para UActorComponent.
UActorComponent* Comp = Cast<UActorComponent>(CreateDefaultSubobject(CompName, CompClass, CompClass, UActorComponent* Comp = Cast<UActorComponent>(CreateDefaultSubobject(CompName, CompClass, CompClass,
@@ -60,40 +60,40 @@ AZMMOPlayerState::AZMMOPlayerState()
if (Comp) if (Comp)
{ {
UE_LOG(LogZMMO, Log, UE_LOG(LogZMMO, Log,
TEXT("ZMMOPlayerState: componente registrado [%d] %s"), TEXT("ZeusPlayerState: componente registrado [%d] %s"),
SubobjectIndex, *CompClass->GetName()); SubobjectIndex, *CompClass->GetName());
} }
else else
{ {
UE_LOG(LogZMMO, Warning, UE_LOG(LogZMMO, Warning,
TEXT("ZMMOPlayerState: CreateDefaultSubobject falhou para %s"), TEXT("ZeusPlayerState: CreateDefaultSubobject falhou para %s"),
*CompClass->GetName()); *CompClass->GetName());
} }
++SubobjectIndex; ++SubobjectIndex;
} }
} }
void AZMMOPlayerState::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const void AZeusPlayerState::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{ {
Super::GetLifetimeReplicatedProps(OutLifetimeProps); Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME(AZMMOPlayerState, ZMMOEntityId); DOREPLIFETIME(AZeusPlayerState, ZeusEntityId);
DOREPLIFETIME(AZMMOPlayerState, CharId); DOREPLIFETIME(AZeusPlayerState, CharId);
DOREPLIFETIME(AZMMOPlayerState, CharName); DOREPLIFETIME(AZeusPlayerState, CharName);
DOREPLIFETIME(AZMMOPlayerState, BaseLevel); DOREPLIFETIME(AZeusPlayerState, BaseLevel);
DOREPLIFETIME(AZMMOPlayerState, ClassId); DOREPLIFETIME(AZeusPlayerState, ClassId);
DOREPLIFETIME(AZMMOPlayerState, GuildName); DOREPLIFETIME(AZeusPlayerState, GuildName);
} }
void AZMMOPlayerState::SetPublicIdentity(int64 InEntityId, const FString& InCharId, void AZeusPlayerState::SetPublicIdentity(int64 InEntityId, const FString& InCharId,
int32 InBaseLevel, int32 InClassId) int32 InBaseLevel, int32 InClassId)
{ {
ZMMOEntityId = InEntityId; ZeusEntityId = InEntityId;
CharId = InCharId; CharId = InCharId;
BaseLevel = InBaseLevel; BaseLevel = InBaseLevel;
ClassId = InClassId; ClassId = InClassId;
} }
void AZMMOPlayerState::SetCharInfo(const FString& InCharName, const FString& InGuildName) void AZeusPlayerState::SetCharInfo(const FString& InCharName, const FString& InGuildName)
{ {
CharName = InCharName; CharName = InCharName;
GuildName = InGuildName; GuildName = InGuildName;

View File

@@ -3,7 +3,7 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "GameFramework/PlayerState.h" #include "GameFramework/PlayerState.h"
#include "Templates/SubclassOf.h" #include "Templates/SubclassOf.h"
#include "ZMMOPlayerState.generated.h" #include "ZeusPlayerState.generated.h"
class FLifetimeProperty; class FLifetimeProperty;
class UActorComponent; class UActorComponent;
@@ -28,29 +28,29 @@ class UActorComponent;
* *
* ## Component Registry (Open-Closed) * ## Component Registry (Open-Closed)
* *
* Cada modulo (ZMMOAttributes, ZMMOInventory, ZMMOSkills futuros) declara * Cada modulo (ZeusGAS, ZeusInventory, ZeusSkills futuros) declara
* sua component class em DefaultGame.ini: * sua component class em DefaultGame.ini:
* *
* [/Script/ZMMO.ZMMOPlayerState] * [/Script/ZMMO.ZeusPlayerState]
* +ComponentClasses=/Script/ZMMOAttributes.ZMMOAttributeComponent * +ComponentClasses=/Script/ZeusGAS.ZeusGASComponent
* +ComponentClasses=/Script/ZMMOInventory.ZMMOInventoryComponent * +ComponentClasses=/Script/ZeusInventory.ZeusInventoryComponent
* +ComponentClasses=/Script/ZMMOSkills.ZMMOSkillComponent * +ComponentClasses=/Script/ZeusSkills.ZeusSkillComponent
* *
* O construtor de AZMMOPlayerState le essa lista (Config) e instancia * O construtor de AZeusPlayerState le essa lista (Config) e instancia
* cada classe como subobject. PlayerState fica fechado pra modificacao, * cada classe como subobject. PlayerState fica fechado pra modificacao,
* modulos abertos pra extensao adicionar Inventory NAO requer * modulos abertos pra extensao adicionar Inventory NAO requer
* recompilar/editar AZMMOPlayerState. * recompilar/editar AZeusPlayerState.
* *
* Acesso: `PlayerState->FindComponentByClass<UZMMOAttributeComponent>()` * Acesso: `PlayerState->FindComponentByClass<UZeusGASComponent>()`
* ou o helper `GetZMMOComponent<T>()`. * ou o helper `GetZeusComponent<T>()`.
*/ */
UCLASS(Config = Game, BlueprintType) UCLASS(Config = Game, BlueprintType)
class ZMMO_API AZMMOPlayerState : public APlayerState class ZMMO_API AZeusPlayerState : public APlayerState
{ {
GENERATED_BODY() GENERATED_BODY()
public: public:
AZMMOPlayerState(); AZeusPlayerState();
// === Identidade publica === // === Identidade publica ===
// //
@@ -60,51 +60,51 @@ public:
// passe a usar dedicated UE5 no futuro. // passe a usar dedicated UE5 no futuro.
/** EntityId autoritativo do server. 0 ate o spawn local confirmar. */ /** EntityId autoritativo do server. 0 ate o spawn local confirmar. */
UPROPERTY(Replicated, VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Identity") UPROPERTY(Replicated, VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Identity")
int64 ZMMOEntityId = 0; int64 ZeusEntityId = 0;
/** CharId (BIGINT no DB; FString pra preservar 64 bits em Blueprint). */ /** CharId (BIGINT no DB; FString pra preservar 64 bits em Blueprint). */
UPROPERTY(Replicated, VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Identity") UPROPERTY(Replicated, VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Identity")
FString CharId; FString CharId;
/** Nome do char vindo do DB (`characters.name`). Setado por /** Nome do char vindo do DB (`characters.name`). Setado por
* AZMMOPlayerCharacter::HandleLocalSpawnReady com o payload do * AZeusCharacter::HandleLocalSpawnReady com o payload do
* S_SPAWN_PLAYER. UI prefere isto a APlayerState::GetPlayerName(). */ * S_SPAWN_PLAYER. UI prefere isto a APlayerState::GetPlayerName(). */
UPROPERTY(Replicated, VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Identity") UPROPERTY(Replicated, VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Identity")
FString CharName; FString CharName;
// === Progressao publica === // === Progressao publica ===
UPROPERTY(Replicated, VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Progress") UPROPERTY(Replicated, VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Progress")
int32 BaseLevel = 1; int32 BaseLevel = 1;
UPROPERTY(Replicated, VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Progress") UPROPERTY(Replicated, VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Progress")
int32 ClassId = 0; int32 ClassId = 0;
// === Guild (futuro) === // === Guild (futuro) ===
UPROPERTY(Replicated, VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Guild") UPROPERTY(Replicated, VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Guild")
FString GuildName; FString GuildName;
virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override; virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
// === Helpers === // === Helpers ===
/// Setado por AZMMOPlayerCharacter::HandleLocalSpawnReady (pose/EntityId) /// Setado por AZeusCharacter::HandleLocalSpawnReady (pose/EntityId)
/// e atualizado por handlers de snapshot/level up para refletir dados /// e atualizado por handlers de snapshot/level up para refletir dados
/// publicos do char no PlayerState. /// publicos do char no PlayerState.
UFUNCTION(BlueprintCallable, Category = "ZMMO|Identity") UFUNCTION(BlueprintCallable, Category = "Zeus|Identity")
void SetPublicIdentity(int64 InEntityId, const FString& InCharId, void SetPublicIdentity(int64 InEntityId, const FString& InCharId,
int32 InBaseLevel, int32 InClassId); int32 InBaseLevel, int32 InClassId);
/// Setado pelo handler do S_CHAR_INFO (chega antes de S_SPAWN_PLAYER) — /// Setado pelo handler do S_CHAR_INFO (chega antes de S_SPAWN_PLAYER) —
/// metadados publicos do char vindos do servidor. /// metadados publicos do char vindos do servidor.
UFUNCTION(BlueprintCallable, Category = "ZMMO|Identity") UFUNCTION(BlueprintCallable, Category = "Zeus|Identity")
void SetCharInfo(const FString& InCharName, const FString& InGuildName); void SetCharInfo(const FString& InCharName, const FString& InGuildName);
/// Template helper: PS->GetZMMOComponent<UZMMOAttributeComponent>() /// Template helper: PS->GetZeusComponent<UZeusGASComponent>()
template <typename T> template <typename T>
T* GetZMMOComponent() const T* GetZeusComponent() const
{ {
return Cast<T>(FindComponentByClass(T::StaticClass())); return Cast<T>(FindComponentByClass(T::StaticClass()));
} }
@@ -119,6 +119,6 @@ protected:
* diretamente. Modulos C++ precisam estar carregados antes do CDO ser * diretamente. Modulos C++ precisam estar carregados antes do CDO ser
* instanciado garantido por LoadingPhase=PreDefault no .uproject. * instanciado garantido por LoadingPhase=PreDefault no .uproject.
*/ */
UPROPERTY(Config, EditDefaultsOnly, Category = "ZMMO|Components") UPROPERTY(Config, EditDefaultsOnly, Category = "Zeus|Components")
TArray<TSubclassOf<UActorComponent>> ComponentClasses; TArray<TSubclassOf<UActorComponent>> ComponentClasses;
}; };

View File

@@ -1,23 +1,23 @@
#include "ZMMOWorldSubsystem.h" #include "ZeusWorldSubsystem.h"
#include "Engine/GameInstance.h" #include "Engine/GameInstance.h"
#include "Engine/World.h" #include "Engine/World.h"
#include "ZMMO.h" #include "ZMMO.h"
#include "ZMMOEntity.h" #include "ZeusEntity.h"
#include "ZMMOEntityInterface.h" #include "ZeusEntityInterface.h"
#include "ZMMOPlayerProxy.h" #include "ZeusPlayerProxy.h"
#include "ZeusNetworkSubsystem.h" #include "ZeusNetworkSubsystem.h"
void UZMMOWorldSubsystem::Initialize(FSubsystemCollectionBase& Collection) void UZeusWorldSubsystem::Initialize(FSubsystemCollectionBase& Collection)
{ {
Super::Initialize(Collection); Super::Initialize(Collection);
if (RemoteEntityClasses.IsEmpty()) if (RemoteEntityClasses.IsEmpty())
{ {
RemoteEntityClasses.Add(EZMMOEntityType::Player, AZMMOPlayerProxy::StaticClass()); RemoteEntityClasses.Add(EZeusEntityType::Player, AZeusPlayerProxy::StaticClass());
RemoteEntityClasses.Add(EZMMOEntityType::Mob, AZMMOEntity::StaticClass()); RemoteEntityClasses.Add(EZeusEntityType::Mob, AZeusEntity::StaticClass());
RemoteEntityClasses.Add(EZMMOEntityType::NPC, AZMMOEntity::StaticClass()); RemoteEntityClasses.Add(EZeusEntityType::NPC, AZeusEntity::StaticClass());
RemoteEntityClasses.Add(EZMMOEntityType::Object, AZMMOEntity::StaticClass()); RemoteEntityClasses.Add(EZeusEntityType::Object, AZeusEntity::StaticClass());
} }
// Bind + replay vivem em OnWorldBeginPlay (mundo pronto). Initialize roda // Bind + replay vivem em OnWorldBeginPlay (mundo pronto). Initialize roda
// MUITO cedo no pipeline de LoadMap — antes do GameMode ser instanciado // MUITO cedo no pipeline de LoadMap — antes do GameMode ser instanciado
@@ -25,16 +25,16 @@ void UZMMOWorldSubsystem::Initialize(FSubsystemCollectionBase& Collection)
// feitos aqui podem ser perdidos durante a fase de setup posterior. // feitos aqui podem ser perdidos durante a fase de setup posterior.
} }
void UZMMOWorldSubsystem::OnWorldBeginPlay(UWorld& InWorld) void UZeusWorldSubsystem::OnWorldBeginPlay(UWorld& InWorld)
{ {
Super::OnWorldBeginPlay(InWorld); Super::OnWorldBeginPlay(InWorld);
if (UZeusNetworkSubsystem* ZeusNet = ResolveZeusNetworkSubsystem()) if (UZeusNetworkSubsystem* ZeusNet = ResolveZeusNetworkSubsystem())
{ {
ZeusNet->OnPlayerSpawned.AddDynamic(this, &UZMMOWorldSubsystem::HandlePlayerSpawned); ZeusNet->OnPlayerSpawned.AddDynamic(this, &UZeusWorldSubsystem::HandlePlayerSpawned);
ZeusNet->OnPlayerDespawned.AddDynamic(this, &UZMMOWorldSubsystem::HandlePlayerDespawned); ZeusNet->OnPlayerDespawned.AddDynamic(this, &UZeusWorldSubsystem::HandlePlayerDespawned);
ZeusNet->OnPlayerStateUpdate.AddDynamic(this, &UZMMOWorldSubsystem::HandlePlayerStateUpdate); ZeusNet->OnPlayerStateUpdate.AddDynamic(this, &UZeusWorldSubsystem::HandlePlayerStateUpdate);
UE_LOG(LogZMMO, Log, TEXT("ZMMOWorldSubsystem bound to ZeusNetworkSubsystem delegates.")); UE_LOG(LogZMMO, Log, TEXT("ZeusWorldSubsystem bound to ZeusNetworkSubsystem delegates."));
// Catch-up race fix (Fase 3): broadcasts de proxies remotos chegam // Catch-up race fix (Fase 3): broadcasts de proxies remotos chegam
// enquanto o cliente novo ainda esta em OpenLevel. UZeusNetworkSubsystem // enquanto o cliente novo ainda esta em OpenLevel. UZeusNetworkSubsystem
@@ -49,22 +49,22 @@ void UZMMOWorldSubsystem::OnWorldBeginPlay(UWorld& InWorld)
}); });
if (ReplayCount > 0) if (ReplayCount > 0)
{ {
UE_LOG(LogZMMO, Log, TEXT("ZMMOWorldSubsystem: replay de %d proxy(ies) cacheados."), ReplayCount); UE_LOG(LogZMMO, Log, TEXT("ZeusWorldSubsystem: replay de %d proxy(ies) cacheados."), ReplayCount);
} }
} }
else else
{ {
UE_LOG(LogZMMO, Warning, TEXT("ZMMOWorldSubsystem: ZeusNetworkSubsystem not found at OnWorldBeginPlay.")); UE_LOG(LogZMMO, Warning, TEXT("ZeusWorldSubsystem: ZeusNetworkSubsystem not found at OnWorldBeginPlay."));
} }
} }
void UZMMOWorldSubsystem::Deinitialize() void UZeusWorldSubsystem::Deinitialize()
{ {
if (UZeusNetworkSubsystem* ZeusNet = ResolveZeusNetworkSubsystem()) if (UZeusNetworkSubsystem* ZeusNet = ResolveZeusNetworkSubsystem())
{ {
ZeusNet->OnPlayerSpawned.RemoveDynamic(this, &UZMMOWorldSubsystem::HandlePlayerSpawned); ZeusNet->OnPlayerSpawned.RemoveDynamic(this, &UZeusWorldSubsystem::HandlePlayerSpawned);
ZeusNet->OnPlayerDespawned.RemoveDynamic(this, &UZMMOWorldSubsystem::HandlePlayerDespawned); ZeusNet->OnPlayerDespawned.RemoveDynamic(this, &UZeusWorldSubsystem::HandlePlayerDespawned);
ZeusNet->OnPlayerStateUpdate.RemoveDynamic(this, &UZMMOWorldSubsystem::HandlePlayerStateUpdate); ZeusNet->OnPlayerStateUpdate.RemoveDynamic(this, &UZeusWorldSubsystem::HandlePlayerStateUpdate);
} }
RemoteEntities.Reset(); RemoteEntities.Reset();
@@ -72,7 +72,7 @@ void UZMMOWorldSubsystem::Deinitialize()
Super::Deinitialize(); Super::Deinitialize();
} }
void UZMMOWorldSubsystem::RegisterLocalEntity(const int64 EntityId, AActor* LocalActor) void UZeusWorldSubsystem::RegisterLocalEntity(const int64 EntityId, AActor* LocalActor)
{ {
if (EntityId == 0 || LocalActor == nullptr) if (EntityId == 0 || LocalActor == nullptr)
{ {
@@ -81,11 +81,11 @@ void UZMMOWorldSubsystem::RegisterLocalEntity(const int64 EntityId, AActor* Loca
LocalEntityId = EntityId; LocalEntityId = EntityId;
RemoteEntities.Add(EntityId, TWeakObjectPtr<AActor>(LocalActor)); RemoteEntities.Add(EntityId, TWeakObjectPtr<AActor>(LocalActor));
UE_LOG(LogZMMO, Log, TEXT("ZMMOWorldSubsystem: local entity registered EntityId=%lld actor=%s"), UE_LOG(LogZMMO, Log, TEXT("ZeusWorldSubsystem: local entity registered EntityId=%lld actor=%s"),
EntityId, *GetNameSafe(LocalActor)); EntityId, *GetNameSafe(LocalActor));
} }
void UZMMOWorldSubsystem::HandlePlayerSpawned(const int64 EntityId, const bool bIsLocal, void UZeusWorldSubsystem::HandlePlayerSpawned(const int64 EntityId, const bool bIsLocal,
const FVector PosCm, const float YawDeg, const int64 ServerTimeMs) const FVector PosCm, const float YawDeg, const int64 ServerTimeMs)
{ {
if (EntityId == 0) if (EntityId == 0)
@@ -95,7 +95,7 @@ void UZMMOWorldSubsystem::HandlePlayerSpawned(const int64 EntityId, const bool b
if (bIsLocal) if (bIsLocal)
{ {
// O proprio AZMMOPlayerCharacter cuida da sua identidade quando recebe o // O proprio AZeusCharacter cuida da sua identidade quando recebe o
// delegate por outro caminho. Aqui apenas memorizamos para filtrar // delegate por outro caminho. Aqui apenas memorizamos para filtrar
// snapshots locais (cliente solto, sem reconciliacao em V0). // snapshots locais (cliente solto, sem reconciliacao em V0).
LocalEntityId = EntityId; LocalEntityId = EntityId;
@@ -110,17 +110,17 @@ void UZMMOWorldSubsystem::HandlePlayerSpawned(const int64 EntityId, const bool b
// silenciosamente ignorado depois de oscilacoes na AOI. // silenciosamente ignorado depois de oscilacoes na AOI.
if (AActor* Existing = RemoteEntities[EntityId].Get()) if (AActor* Existing = RemoteEntities[EntityId].Get())
{ {
if (IZMMOEntityInterface* AsEntity = Cast<IZMMOEntityInterface>(Existing)) if (IZeusEntityInterface* AsEntity = Cast<IZeusEntityInterface>(Existing))
{ {
AsEntity->SetEntityRelevant(true); AsEntity->SetEntityRelevant(true);
} }
Existing->SetActorLocationAndRotation(PosCm, FRotator(0.0f, YawDeg, 0.0f)); Existing->SetActorLocationAndRotation(PosCm, FRotator(0.0f, YawDeg, 0.0f));
UE_LOG(LogZMMO, Verbose, TEXT("ZMMOWorldSubsystem: re-snap EntityId=%d"), EntityId); UE_LOG(LogZMMO, Verbose, TEXT("ZeusWorldSubsystem: re-snap EntityId=%d"), EntityId);
return; return;
} }
// weak ptr stale — limpa entry e cai pro spawn novo abaixo. // weak ptr stale — limpa entry e cai pro spawn novo abaixo.
RemoteEntities.Remove(EntityId); RemoteEntities.Remove(EntityId);
UE_LOG(LogZMMO, Log, TEXT("ZMMOWorldSubsystem: stale entry para EntityId=%d, respawnando"), EntityId); UE_LOG(LogZMMO, Log, TEXT("ZeusWorldSubsystem: stale entry para EntityId=%d, respawnando"), EntityId);
} }
UWorld* World = GetWorld(); UWorld* World = GetWorld();
@@ -129,10 +129,10 @@ void UZMMOWorldSubsystem::HandlePlayerSpawned(const int64 EntityId, const bool b
return; return;
} }
UClass* ProxyClass = ResolveActorClass(EZMMOEntityType::Player); UClass* ProxyClass = ResolveActorClass(EZeusEntityType::Player);
if (!ProxyClass) if (!ProxyClass)
{ {
UE_LOG(LogZMMO, Warning, TEXT("ZMMOWorldSubsystem: no class registered for Player; spawn aborted.")); UE_LOG(LogZMMO, Warning, TEXT("ZeusWorldSubsystem: no class registered for Player; spawn aborted."));
return; return;
} }
@@ -142,30 +142,30 @@ void UZMMOWorldSubsystem::HandlePlayerSpawned(const int64 EntityId, const bool b
AActor* SpawnedActor = World->SpawnActor<AActor>(ProxyClass, PosCm, SpawnRot, Params); AActor* SpawnedActor = World->SpawnActor<AActor>(ProxyClass, PosCm, SpawnRot, Params);
if (!SpawnedActor) if (!SpawnedActor)
{ {
UE_LOG(LogZMMO, Warning, TEXT("ZMMOWorldSubsystem: SpawnActor failed for EntityId=%d"), EntityId); UE_LOG(LogZMMO, Warning, TEXT("ZeusWorldSubsystem: SpawnActor failed for EntityId=%d"), EntityId);
return; return;
} }
if (IZMMOEntityInterface* AsEntity = Cast<IZMMOEntityInterface>(SpawnedActor)) if (IZeusEntityInterface* AsEntity = Cast<IZeusEntityInterface>(SpawnedActor))
{ {
// Inject identity via dedicated setter when the spawned actor exposes one. // Inject identity via dedicated setter when the spawned actor exposes one.
if (AZMMOPlayerProxy* Proxy = Cast<AZMMOPlayerProxy>(SpawnedActor)) if (AZeusPlayerProxy* Proxy = Cast<AZeusPlayerProxy>(SpawnedActor))
{ {
Proxy->SetZMMOIdentity(EntityId, EZMMOEntityType::Player); Proxy->SetZeusIdentity(EntityId, EZeusEntityType::Player);
} }
else if (AZMMOEntity* Entity = Cast<AZMMOEntity>(SpawnedActor)) else if (AZeusEntity* Entity = Cast<AZeusEntity>(SpawnedActor))
{ {
Entity->SetZMMOIdentity(EntityId, EZMMOEntityType::Player); Entity->SetZeusIdentity(EntityId, EZeusEntityType::Player);
} }
AsEntity->SetEntityRelevant(true); AsEntity->SetEntityRelevant(true);
} }
RemoteEntities.Add(EntityId, TWeakObjectPtr<AActor>(SpawnedActor)); RemoteEntities.Add(EntityId, TWeakObjectPtr<AActor>(SpawnedActor));
UE_LOG(LogZMMO, Log, TEXT("ZMMOWorldSubsystem: spawned remote EntityId=%d at (%s) yaw=%.1f t=%lld"), UE_LOG(LogZMMO, Log, TEXT("ZeusWorldSubsystem: spawned remote EntityId=%d at (%s) yaw=%.1f t=%lld"),
EntityId, *PosCm.ToString(), YawDeg, ServerTimeMs); EntityId, *PosCm.ToString(), YawDeg, ServerTimeMs);
} }
void UZMMOWorldSubsystem::HandlePlayerDespawned(const int64 EntityId) void UZeusWorldSubsystem::HandlePlayerDespawned(const int64 EntityId)
{ {
const TWeakObjectPtr<AActor>* Entry = RemoteEntities.Find(EntityId); const TWeakObjectPtr<AActor>* Entry = RemoteEntities.Find(EntityId);
if (!Entry) if (!Entry)
@@ -181,7 +181,7 @@ void UZMMOWorldSubsystem::HandlePlayerDespawned(const int64 EntityId)
// confirmado nos logs do AOI ao oscilar entrada/saida da ZI/ZD. // confirmado nos logs do AOI ao oscilar entrada/saida da ZI/ZD.
if (AActor* Actor = Entry->Get()) if (AActor* Actor = Entry->Get())
{ {
if (IZMMOEntityInterface* AsEntity = Cast<IZMMOEntityInterface>(Actor)) if (IZeusEntityInterface* AsEntity = Cast<IZeusEntityInterface>(Actor))
{ {
AsEntity->SetEntityRelevant(false); AsEntity->SetEntityRelevant(false);
} }
@@ -189,10 +189,10 @@ void UZMMOWorldSubsystem::HandlePlayerDespawned(const int64 EntityId)
} }
RemoteEntities.Remove(EntityId); RemoteEntities.Remove(EntityId);
UE_LOG(LogZMMO, Log, TEXT("ZMMOWorldSubsystem: despawn EntityId=%d (destroyed)"), EntityId); UE_LOG(LogZMMO, Log, TEXT("ZeusWorldSubsystem: despawn EntityId=%d (destroyed)"), EntityId);
} }
void UZMMOWorldSubsystem::HandlePlayerStateUpdate(const int64 EntityId, const int32 InputSeq, void UZeusWorldSubsystem::HandlePlayerStateUpdate(const int64 EntityId, const int32 InputSeq,
const FVector PosCm, const FVector VelCmS, const bool bGrounded, const int64 ServerTimeMs) const FVector PosCm, const FVector VelCmS, const bool bGrounded, const int64 ServerTimeMs)
{ {
if (EntityId == 0) if (EntityId == 0)
@@ -204,7 +204,7 @@ void UZMMOWorldSubsystem::HandlePlayerStateUpdate(const int64 EntityId, const in
{ {
// Cliente local solto: ignoramos snapshots autoritativos para o nosso // Cliente local solto: ignoramos snapshots autoritativos para o nosso
// proprio personagem em V0 (ADR 0038). Reconciliacao opcional pode ser // proprio personagem em V0 (ADR 0038). Reconciliacao opcional pode ser
// activada por flag em `AZMMOPlayerCharacter` quando colisao de objetos // activada por flag em `AZeusCharacter` quando colisao de objetos
// chegar. // chegar.
return; return;
} }
@@ -223,15 +223,15 @@ void UZMMOWorldSubsystem::HandlePlayerStateUpdate(const int64 EntityId, const in
return; return;
} }
IZMMOEntityInterface* AsEntity = Cast<IZMMOEntityInterface>(Actor); IZeusEntityInterface* AsEntity = Cast<IZeusEntityInterface>(Actor);
if (!AsEntity) if (!AsEntity)
{ {
return; return;
} }
FZMMOEntitySnapshot Snapshot; FZeusEntitySnapshot Snapshot;
Snapshot.EntityId = EntityId; Snapshot.EntityId = EntityId;
Snapshot.EntityType = AsEntity->GetZMMOEntityType(); Snapshot.EntityType = AsEntity->GetZeusEntityType();
Snapshot.LastProcessedInputSeq = InputSeq; Snapshot.LastProcessedInputSeq = InputSeq;
Snapshot.PositionCm = PosCm; Snapshot.PositionCm = PosCm;
Snapshot.VelocityCmS = VelCmS; Snapshot.VelocityCmS = VelCmS;
@@ -281,7 +281,7 @@ void UZMMOWorldSubsystem::HandlePlayerStateUpdate(const int64 EntityId, const in
AsEntity->ApplyEntitySnapshot(Snapshot); AsEntity->ApplyEntitySnapshot(Snapshot);
} }
UClass* UZMMOWorldSubsystem::ResolveActorClass(const EZMMOEntityType EntityType) const UClass* UZeusWorldSubsystem::ResolveActorClass(const EZeusEntityType EntityType) const
{ {
if (const TSubclassOf<AActor>* Found = RemoteEntityClasses.Find(EntityType)) if (const TSubclassOf<AActor>* Found = RemoteEntityClasses.Find(EntityType))
{ {
@@ -290,10 +290,10 @@ UClass* UZMMOWorldSubsystem::ResolveActorClass(const EZMMOEntityType EntityType)
return Found->Get(); return Found->Get();
} }
} }
return AZMMOEntity::StaticClass(); return AZeusEntity::StaticClass();
} }
UZeusNetworkSubsystem* UZMMOWorldSubsystem::ResolveZeusNetworkSubsystem() const UZeusNetworkSubsystem* UZeusWorldSubsystem::ResolveZeusNetworkSubsystem() const
{ {
const UWorld* World = GetWorld(); const UWorld* World = GetWorld();
if (!World) if (!World)

View File

@@ -2,16 +2,16 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "Subsystems/WorldSubsystem.h" #include "Subsystems/WorldSubsystem.h"
#include "ZMMOEntityTypes.h" #include "ZeusEntityTypes.h"
#include "ZMMOWorldSubsystem.generated.h" #include "ZeusWorldSubsystem.generated.h"
class AActor; class AActor;
class AZMMOPlayerCharacter; class AZeusCharacter;
class AZMMOPlayerProxy; class AZeusPlayerProxy;
class UZeusNetworkSubsystem; class UZeusNetworkSubsystem;
/** /**
* UZMMOWorldSubsystem * UZeusWorldSubsystem
* *
* Subsistema por-mundo que orquestra a aplicacao de pacotes de replicacao * Subsistema por-mundo que orquestra a aplicacao de pacotes de replicacao
* recebidos do servidor (`S_SPAWN_PLAYER`, `S_DESPAWN_PLAYER`, * recebidos do servidor (`S_SPAWN_PLAYER`, `S_DESPAWN_PLAYER`,
@@ -26,19 +26,19 @@ class UZeusNetworkSubsystem;
* conexao UDP e dos delegates; este subsistema apenas escuta os * conexao UDP e dos delegates; este subsistema apenas escuta os
* delegates e materializa atores na cena atual. * delegates e materializa atores na cena atual.
* *
* Resolucao de classe por `EZMMOEntityType`: * Resolucao de classe por `EZeusEntityType`:
* - `RemoteEntityClasses` e um TMap configuravel (BlueprintReadWrite) * - `RemoteEntityClasses` e um TMap configuravel (BlueprintReadWrite)
* com defaults seguros em `Initialize`. Permite trocar * com defaults seguros em `Initialize`. Permite trocar
* `AZMMOPlayerProxy` por um BP filho com mesh customizada sem * `AZeusPlayerProxy` por um BP filho com mesh customizada sem
* recompilar C++. * recompilar C++.
* *
* Despawn: * Despawn:
* - V0: chama `IZMMOEntityInterface::SetEntityRelevant(false)` (preserva * - V0: chama `IZeusEntityInterface::SetEntityRelevant(false)` (preserva
* o ator para futuro pooling). * o ator para futuro pooling).
* - V1: pool real por `EntityType`, limites de memoria, expiracao. * - V1: pool real por `EntityType`, limites de memoria, expiracao.
*/ */
UCLASS() UCLASS()
class ZMMO_API UZMMOWorldSubsystem : public UWorldSubsystem class ZMMO_API UZeusWorldSubsystem : public UWorldSubsystem
{ {
GENERATED_BODY() GENERATED_BODY()
@@ -48,27 +48,27 @@ public:
virtual void Deinitialize() override; virtual void Deinitialize() override;
/** /**
* Regista o jogador local no registry. Chamado por `AZMMOPlayerCharacter` * Regista o jogador local no registry. Chamado por `AZeusCharacter`
* apos receber o `EntityId` autoritativo do servidor (delegate * apos receber o `EntityId` autoritativo do servidor (delegate
* `OnPlayerSpawned` com `bIsLocal=true`). * `OnPlayerSpawned` com `bIsLocal=true`).
*/ */
UFUNCTION(BlueprintCallable, Category = "ZMMO|World") UFUNCTION(BlueprintCallable, Category = "Zeus|World")
void RegisterLocalEntity(int64 EntityId, AActor* LocalActor); void RegisterLocalEntity(int64 EntityId, AActor* LocalActor);
/** Numero de entidades remotas actualmente trackeadas. Util em debug overlays. */ /** Numero de entidades remotas actualmente trackeadas. Util em debug overlays. */
UFUNCTION(BlueprintPure, Category = "ZMMO|World") UFUNCTION(BlueprintPure, Category = "Zeus|World")
int32 GetTrackedEntityCount() const { return RemoteEntities.Num(); } int32 GetTrackedEntityCount() const { return RemoteEntities.Num(); }
protected: protected:
/** /**
* Mapa configuravel de classe a usar por `EZMMOEntityType`. Caso vazio, * Mapa configuravel de classe a usar por `EZeusEntityType`. Caso vazio,
* usamos defaults seguros (`AZMMOPlayerProxy` para Player, `AZMMOEntity` * usamos defaults seguros (`AZeusPlayerProxy` para Player, `AZeusEntity`
* para Mob/NPC/Object actualizado quando classes especificas existirem). * para Mob/NPC/Object actualizado quando classes especificas existirem).
* *
* Pode ser preenchido via Blueprint subclassing ou em runtime. * Pode ser preenchido via Blueprint subclassing ou em runtime.
*/ */
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "ZMMO|World") UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Zeus|World")
TMap<EZMMOEntityType, TSubclassOf<AActor>> RemoteEntityClasses; TMap<EZeusEntityType, TSubclassOf<AActor>> RemoteEntityClasses;
private: private:
UFUNCTION() UFUNCTION()
@@ -80,7 +80,7 @@ private:
UFUNCTION() UFUNCTION()
void HandlePlayerStateUpdate(int64 EntityId, int32 InputSeq, FVector PosCm, FVector VelCmS, bool bGrounded, int64 ServerTimeMs); void HandlePlayerStateUpdate(int64 EntityId, int32 InputSeq, FVector PosCm, FVector VelCmS, bool bGrounded, int64 ServerTimeMs);
UClass* ResolveActorClass(EZMMOEntityType EntityType) const; UClass* ResolveActorClass(EZeusEntityType EntityType) const;
UZeusNetworkSubsystem* ResolveZeusNetworkSubsystem() const; UZeusNetworkSubsystem* ResolveZeusNetworkSubsystem() const;
/** /**

View File

@@ -20,7 +20,7 @@ void UUIDraggableWindow_Base::ApplySavedPosition()
const FName Id = GetWindowId(); const FName Id = GetWindowId();
if (Id.IsNone()) return; if (Id.IsNone()) return;
UZMMOUISaveGame* Save = UZMMOUISaveGame::LoadOrCreate(); UZeusUISaveGame* Save = UZeusUISaveGame::LoadOrCreate();
FVector2D Pos; FVector2D Pos;
if (Save && Save->TryGetWindowPosition(Id, Pos)) if (Save && Save->TryGetWindowPosition(Id, Pos))
{ {
@@ -33,10 +33,10 @@ void UUIDraggableWindow_Base::PersistCurrentPosition()
const FName Id = GetWindowId(); const FName Id = GetWindowId();
if (Id.IsNone()) return; if (Id.IsNone()) return;
UZMMOUISaveGame* Save = UZMMOUISaveGame::LoadOrCreate(); UZeusUISaveGame* Save = UZeusUISaveGame::LoadOrCreate();
if (!Save) return; if (!Save) return;
Save->SetWindowPosition(Id, GetRenderTransform().Translation); Save->SetWindowPosition(Id, GetRenderTransform().Translation);
UZMMOUISaveGame::SaveNow(Save); UZeusUISaveGame::SaveNow(Save);
} }
bool UUIDraggableWindow_Base::IsDragHandleHit(const FPointerEvent& MouseEvent) const bool UUIDraggableWindow_Base::IsDragHandleHit(const FPointerEvent& MouseEvent) const

View File

@@ -5,12 +5,12 @@
#include "UIDraggableWindow_Base.generated.h" #include "UIDraggableWindow_Base.generated.h"
class UBorder; class UBorder;
class UZMMOUISaveGame; class UZeusUISaveGame;
/** /**
* Base de janelas in-game movel + persistente. Subclasse define WindowId * Base de janelas in-game movel + persistente. Subclasse define WindowId
* (FName estavel) via override de GetWindowId(); a Base cuida do drag * (FName estavel) via override de GetWindowId(); a Base cuida do drag
* (RenderTransform.Translation) e da persistencia (UZMMOUISaveGame). * (RenderTransform.Translation) e da persistencia (UZeusUISaveGame).
* *
* Convencao do WBP: * Convencao do WBP:
* - Bind opcional `Border_DragHandle` cobrindo a area arrastavel (header). * - Bind opcional `Border_DragHandle` cobrindo a area arrastavel (header).

View File

@@ -1,10 +1,10 @@
#include "UILoadingProfilesDataAsset.h" #include "UILoadingProfilesDataAsset.h"
FZMMOLoadingProfile UZMMOLoadingProfilesDataAsset::GetProfile(EZMMOLoadingContext Context) const FZeusLoadingProfile UZeusLoadingProfilesDataAsset::GetProfile(EZeusLoadingContext Context) const
{ {
if (const FZMMOLoadingProfile* Found = Profiles.Find(Context)) if (const FZeusLoadingProfile* Found = Profiles.Find(Context))
{ {
return *Found; return *Found;
} }
return FZMMOLoadingProfile(); return FZeusLoadingProfile();
} }

View File

@@ -7,7 +7,7 @@
/** /**
* Mapa data-driven contexto → perfil (etapas + título). Designer edita o * Mapa data-driven contexto → perfil (etapas + título). Designer edita o
* asset; código consulta por EZMMOLoadingContext na hora de configurar a * asset; código consulta por EZeusLoadingContext na hora de configurar a
* tela. Asset canônico: DA_LoadingProfiles em /Game/ZMMO/Data/UI/Loading/. * tela. Asset canônico: DA_LoadingProfiles em /Game/ZMMO/Data/UI/Loading/.
* *
* Configurado em DefaultGame.ini: * Configurado em DefaultGame.ini:
@@ -15,15 +15,15 @@
* LoadingProfilesAsset=/Game/ZMMO/Data/UI/Loading/DA_LoadingProfiles.DA_LoadingProfiles * LoadingProfilesAsset=/Game/ZMMO/Data/UI/Loading/DA_LoadingProfiles.DA_LoadingProfiles
*/ */
UCLASS(BlueprintType) UCLASS(BlueprintType)
class ZMMO_API UZMMOLoadingProfilesDataAsset : public UDataAsset class ZMMO_API UZeusLoadingProfilesDataAsset : public UDataAsset
{ {
GENERATED_BODY() GENERATED_BODY()
public: public:
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Loading") UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Loading")
TMap<EZMMOLoadingContext, FZMMOLoadingProfile> Profiles; TMap<EZeusLoadingContext, FZeusLoadingProfile> Profiles;
/** Retorna o perfil do contexto ou um perfil vazio (sem etapas). */ /** Retorna o perfil do contexto ou um perfil vazio (sem etapas). */
UFUNCTION(BlueprintCallable, Category = "Loading") UFUNCTION(BlueprintCallable, Category = "Loading")
FZMMOLoadingProfile GetProfile(EZMMOLoadingContext Context) const; FZeusLoadingProfile GetProfile(EZeusLoadingContext Context) const;
}; };

View File

@@ -8,8 +8,8 @@
#include "UILoadingProfilesDataAsset.h" #include "UILoadingProfilesDataAsset.h"
#include "UILoadingTipRow.h" #include "UILoadingTipRow.h"
void UUILoadingScreen_Base::Configure(EZMMOLoadingContext InContext, void UUILoadingScreen_Base::Configure(EZeusLoadingContext InContext,
UZMMOLoadingProfilesDataAsset* Profiles, UZeusLoadingProfilesDataAsset* Profiles,
UDataTable* TipsTable) UDataTable* TipsTable)
{ {
Context_ = InContext; Context_ = InContext;
@@ -18,22 +18,22 @@ void UUILoadingScreen_Base::Configure(EZMMOLoadingContext InContext,
// Perfil (etapas + título). // Perfil (etapas + título).
Profile_ = (Profiles != nullptr) Profile_ = (Profiles != nullptr)
? Profiles->GetProfile(InContext) ? Profiles->GetProfile(InContext)
: FZMMOLoadingProfile(); : FZeusLoadingProfile();
StepStatus_.Reset(); StepStatus_.Reset();
for (const FZMMOLoadingStepDef& Step : Profile_.Steps) for (const FZeusLoadingStepDef& Step : Profile_.Steps)
{ {
StepStatus_.Add(Step.StepId, EZMMOLoadingStepStatus::Pending); StepStatus_.Add(Step.StepId, EZeusLoadingStepStatus::Pending);
} }
// Pool de dicas filtrada por contexto (None = qualquer). // Pool de dicas filtrada por contexto (None = qualquer).
TipPool_.Reset(); TipPool_.Reset();
if (TipsTable != nullptr) if (TipsTable != nullptr)
{ {
TipsTable->ForeachRow<FZMMOLoadingTipRow>(TEXT("UUILoadingScreen_Base::Configure"), TipsTable->ForeachRow<FZeusLoadingTipRow>(TEXT("UUILoadingScreen_Base::Configure"),
[this](const FName& /*Key*/, const FZMMOLoadingTipRow& Row) [this](const FName& /*Key*/, const FZeusLoadingTipRow& Row)
{ {
if (Row.Context == EZMMOLoadingContext::None || Row.Context == Context_) if (Row.Context == EZeusLoadingContext::None || Row.Context == Context_)
{ {
if (!Row.Tip.IsEmpty()) if (!Row.Tip.IsEmpty())
{ {
@@ -67,12 +67,12 @@ void UUILoadingScreen_Base::NativeOnDeactivated()
void UUILoadingScreen_Base::MarkStepRunning(FName StepId) void UUILoadingScreen_Base::MarkStepRunning(FName StepId)
{ {
if (EZMMOLoadingStepStatus* Status = StepStatus_.Find(StepId)) if (EZeusLoadingStepStatus* Status = StepStatus_.Find(StepId))
{ {
// Já Done não regride. // Já Done não regride.
if (*Status != EZMMOLoadingStepStatus::Done && *Status != EZMMOLoadingStepStatus::Failed) if (*Status != EZeusLoadingStepStatus::Done && *Status != EZeusLoadingStepStatus::Failed)
{ {
*Status = EZMMOLoadingStepStatus::Running; *Status = EZeusLoadingStepStatus::Running;
RefreshUI(); RefreshUI();
} }
} }
@@ -80,9 +80,9 @@ void UUILoadingScreen_Base::MarkStepRunning(FName StepId)
void UUILoadingScreen_Base::MarkStepDone(FName StepId) void UUILoadingScreen_Base::MarkStepDone(FName StepId)
{ {
if (EZMMOLoadingStepStatus* Status = StepStatus_.Find(StepId)) if (EZeusLoadingStepStatus* Status = StepStatus_.Find(StepId))
{ {
*Status = EZMMOLoadingStepStatus::Done; *Status = EZeusLoadingStepStatus::Done;
RefreshUI(); RefreshUI();
if (!bCompleteFired_ && AreAllStepsDone()) if (!bCompleteFired_ && AreAllStepsDone())
@@ -95,9 +95,9 @@ void UUILoadingScreen_Base::MarkStepDone(FName StepId)
void UUILoadingScreen_Base::MarkStepFailed(FName StepId, const FText& Reason) void UUILoadingScreen_Base::MarkStepFailed(FName StepId, const FText& Reason)
{ {
if (EZMMOLoadingStepStatus* Status = StepStatus_.Find(StepId)) if (EZeusLoadingStepStatus* Status = StepStatus_.Find(StepId))
{ {
*Status = EZMMOLoadingStepStatus::Failed; *Status = EZeusLoadingStepStatus::Failed;
if (Text_Status && !Reason.IsEmpty()) if (Text_Status && !Reason.IsEmpty())
{ {
Text_Status->SetText(Reason); Text_Status->SetText(Reason);
@@ -112,10 +112,10 @@ bool UUILoadingScreen_Base::AreAllStepsDone() const
{ {
return false; return false;
} }
for (const FZMMOLoadingStepDef& Step : Profile_.Steps) for (const FZeusLoadingStepDef& Step : Profile_.Steps)
{ {
const EZMMOLoadingStepStatus* Status = StepStatus_.Find(Step.StepId); const EZeusLoadingStepStatus* Status = StepStatus_.Find(Step.StepId);
if (Status == nullptr || *Status != EZMMOLoadingStepStatus::Done) if (Status == nullptr || *Status != EZeusLoadingStepStatus::Done)
{ {
return false; return false;
} }
@@ -135,11 +135,11 @@ int32 UUILoadingScreen_Base::FindStepIndex(FName StepId) const
return INDEX_NONE; return INDEX_NONE;
} }
EZMMOLoadingStepStatus UUILoadingScreen_Base::GetStepStatus(int32 Index) const EZeusLoadingStepStatus UUILoadingScreen_Base::GetStepStatus(int32 Index) const
{ {
if (!Profile_.Steps.IsValidIndex(Index)) return EZMMOLoadingStepStatus::Pending; if (!Profile_.Steps.IsValidIndex(Index)) return EZeusLoadingStepStatus::Pending;
const EZMMOLoadingStepStatus* Status = StepStatus_.Find(Profile_.Steps[Index].StepId); const EZeusLoadingStepStatus* Status = StepStatus_.Find(Profile_.Steps[Index].StepId);
return Status ? *Status : EZMMOLoadingStepStatus::Pending; return Status ? *Status : EZeusLoadingStepStatus::Pending;
} }
FText UUILoadingScreen_Base::ComputeCurrentStatusText() const FText UUILoadingScreen_Base::ComputeCurrentStatusText() const
@@ -148,12 +148,12 @@ FText UUILoadingScreen_Base::ComputeCurrentStatusText() const
int32 LastDone = INDEX_NONE; int32 LastDone = INDEX_NONE;
for (int32 i = 0; i < Profile_.Steps.Num(); ++i) for (int32 i = 0; i < Profile_.Steps.Num(); ++i)
{ {
const EZMMOLoadingStepStatus St = GetStepStatus(i); const EZeusLoadingStepStatus St = GetStepStatus(i);
if (St == EZMMOLoadingStepStatus::Running) if (St == EZeusLoadingStepStatus::Running)
{ {
return Profile_.Steps[i].Label; return Profile_.Steps[i].Label;
} }
if (St == EZMMOLoadingStepStatus::Done) if (St == EZeusLoadingStepStatus::Done)
{ {
LastDone = i; LastDone = i;
} }
@@ -176,9 +176,9 @@ float UUILoadingScreen_Base::ComputeProgress01() const
float Acc = 0.f; float Acc = 0.f;
for (int32 i = 0; i < N; ++i) for (int32 i = 0; i < N; ++i)
{ {
const EZMMOLoadingStepStatus St = GetStepStatus(i); const EZeusLoadingStepStatus St = GetStepStatus(i);
if (St == EZMMOLoadingStepStatus::Done) Acc += 1.f; if (St == EZeusLoadingStepStatus::Done) Acc += 1.f;
else if (St == EZMMOLoadingStepStatus::Running) Acc += 0.5f; else if (St == EZeusLoadingStepStatus::Running) Acc += 0.5f;
} }
return FMath::Clamp(Acc / static_cast<float>(N), 0.f, 1.f); return FMath::Clamp(Acc / static_cast<float>(N), 0.f, 1.f);
} }

View File

@@ -8,15 +8,15 @@
class UCommonTextBlock; class UCommonTextBlock;
class UProgressBar; class UProgressBar;
class UDataTable; class UDataTable;
class UZMMOLoadingProfilesDataAsset; class UZeusLoadingProfilesDataAsset;
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FZMMOOnLoadingComplete); DECLARE_DYNAMIC_MULTICAST_DELEGATE(FZeusOnLoadingComplete);
/** /**
* Tela de loading genérica. Reusada pelo FrontEnd (handoff CharServer → * Tela de loading genérica. Reusada pelo FrontEnd (handoff CharServer →
* WorldServer) e pelo InGame (entrada em instance/dungeon, respawn). Cada * WorldServer) e pelo InGame (entrada em instance/dungeon, respawn). Cada
* uso passa um EZMMOLoadingContext em Configure(), que resolve o perfil * uso passa um EZeusLoadingContext em Configure(), que resolve o perfil
* no UZMMOLoadingProfilesDataAsset (lista de etapas + título). * no UZeusLoadingProfilesDataAsset (lista de etapas + título).
* *
* Quem orquestra (UIFrontEndFlowSubsystem, futuro UIInGameFlowSubsystem) * Quem orquestra (UIFrontEndFlowSubsystem, futuro UIInGameFlowSubsystem)
* assina os próprios eventos (HandlePostLoadMap, OnPlayerSpawned, etc) e * assina os próprios eventos (HandlePostLoadMap, OnPlayerSpawned, etc) e
@@ -41,8 +41,8 @@ public:
* de NativeOnActivated (estado é reaplicado em RefreshUI). * de NativeOnActivated (estado é reaplicado em RefreshUI).
*/ */
UFUNCTION(BlueprintCallable, Category = "Loading") UFUNCTION(BlueprintCallable, Category = "Loading")
void Configure(EZMMOLoadingContext InContext, void Configure(EZeusLoadingContext InContext,
UZMMOLoadingProfilesDataAsset* Profiles, UZeusLoadingProfilesDataAsset* Profiles,
UDataTable* TipsTable); UDataTable* TipsTable);
UFUNCTION(BlueprintCallable, Category = "Loading") UFUNCTION(BlueprintCallable, Category = "Loading")
@@ -59,7 +59,7 @@ public:
/** Disparado UMA vez quando todas as etapas viram Done. */ /** Disparado UMA vez quando todas as etapas viram Done. */
UPROPERTY(BlueprintAssignable, Category = "Loading") UPROPERTY(BlueprintAssignable, Category = "Loading")
FZMMOOnLoadingComplete OnLoadingComplete; FZeusOnLoadingComplete OnLoadingComplete;
protected: protected:
virtual void NativeOnActivated() override; virtual void NativeOnActivated() override;
@@ -75,7 +75,7 @@ protected:
int32 FindStepIndex(FName StepId) const; int32 FindStepIndex(FName StepId) const;
/** Status atual da etapa em [Steps_]; Pending se não rastreada. */ /** Status atual da etapa em [Steps_]; Pending se não rastreada. */
EZMMOLoadingStepStatus GetStepStatus(int32 Index) const; EZeusLoadingStepStatus GetStepStatus(int32 Index) const;
/** Texto exibido em Text_Status — etapa Running atual ou última Done. */ /** Texto exibido em Text_Status — etapa Running atual ou última Done. */
FText ComputeCurrentStatusText() const; FText ComputeCurrentStatusText() const;
@@ -107,13 +107,13 @@ protected:
float TipRotationIntervalSeconds = 6.f; float TipRotationIntervalSeconds = 6.f;
private: private:
EZMMOLoadingContext Context_ = EZMMOLoadingContext::None; EZeusLoadingContext Context_ = EZeusLoadingContext::None;
UPROPERTY(Transient) UPROPERTY(Transient)
FZMMOLoadingProfile Profile_; FZeusLoadingProfile Profile_;
UPROPERTY(Transient) UPROPERTY(Transient)
TMap<FName, EZMMOLoadingStepStatus> StepStatus_; TMap<FName, EZeusLoadingStepStatus> StepStatus_;
UPROPERTY(Transient) UPROPERTY(Transient)
TArray<FText> TipPool_; TArray<FText> TipPool_;

View File

@@ -12,7 +12,7 @@
* UE). Filtra por contexto: Context=None significa "qualquer loading". * UE). Filtra por contexto: Context=None significa "qualquer loading".
*/ */
USTRUCT(BlueprintType) USTRUCT(BlueprintType)
struct FZMMOLoadingTipRow : public FTableRowBase struct FZeusLoadingTipRow : public FTableRowBase
{ {
GENERATED_BODY() GENERATED_BODY()
@@ -22,7 +22,7 @@ struct FZMMOLoadingTipRow : public FTableRowBase
/** Restringe a dica a um contexto. None = todos. */ /** Restringe a dica a um contexto. None = todos. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Loading") UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Loading")
EZMMOLoadingContext Context = EZMMOLoadingContext::None; EZeusLoadingContext Context = EZeusLoadingContext::None;
/** Tag opcional pra categorizar (PvE/PvP/Crafting...) — futuro filtro. */ /** Tag opcional pra categorizar (PvE/PvP/Crafting...) — futuro filtro. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Loading") UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Loading")

View File

@@ -2,23 +2,23 @@
#include "Kismet/GameplayStatics.h" #include "Kismet/GameplayStatics.h"
const FString UZMMOUISaveGame::SlotName = TEXT("UIPrefs"); const FString UZeusUISaveGame::SlotName = TEXT("UIPrefs");
UZMMOUISaveGame* UZMMOUISaveGame::LoadOrCreate() UZeusUISaveGame* UZeusUISaveGame::LoadOrCreate()
{ {
if (UGameplayStatics::DoesSaveGameExist(SlotName, UserIndex)) if (UGameplayStatics::DoesSaveGameExist(SlotName, UserIndex))
{ {
if (UZMMOUISaveGame* Loaded = Cast<UZMMOUISaveGame>( if (UZeusUISaveGame* Loaded = Cast<UZeusUISaveGame>(
UGameplayStatics::LoadGameFromSlot(SlotName, UserIndex))) UGameplayStatics::LoadGameFromSlot(SlotName, UserIndex)))
{ {
return Loaded; return Loaded;
} }
} }
return Cast<UZMMOUISaveGame>( return Cast<UZeusUISaveGame>(
UGameplayStatics::CreateSaveGameObject(UZMMOUISaveGame::StaticClass())); UGameplayStatics::CreateSaveGameObject(UZeusUISaveGame::StaticClass()));
} }
void UZMMOUISaveGame::SaveNow(UZMMOUISaveGame* Save) void UZeusUISaveGame::SaveNow(UZeusUISaveGame* Save)
{ {
if (Save) if (Save)
{ {
@@ -26,7 +26,7 @@ void UZMMOUISaveGame::SaveNow(UZMMOUISaveGame* Save)
} }
} }
bool UZMMOUISaveGame::TryGetWindowPosition(FName WindowId, FVector2D& OutPos) const bool UZeusUISaveGame::TryGetWindowPosition(FName WindowId, FVector2D& OutPos) const
{ {
if (const FVector2D* Found = WindowPositions.Find(WindowId)) if (const FVector2D* Found = WindowPositions.Find(WindowId))
{ {
@@ -37,7 +37,7 @@ bool UZMMOUISaveGame::TryGetWindowPosition(FName WindowId, FVector2D& OutPos) co
return false; return false;
} }
void UZMMOUISaveGame::SetWindowPosition(FName WindowId, FVector2D Pos) void UZeusUISaveGame::SetWindowPosition(FName WindowId, FVector2D Pos)
{ {
WindowPositions.Add(WindowId, Pos); WindowPositions.Add(WindowId, Pos);
} }

View File

@@ -10,13 +10,13 @@
* movel registra uma chave (FName WindowId) e grava aqui ao soltar o drag. * movel registra uma chave (FName WindowId) e grava aqui ao soltar o drag.
* *
* Arquivo: [Project]/Saved/SaveGames/UIPrefs_0.sav (binary blob via * Arquivo: [Project]/Saved/SaveGames/UIPrefs_0.sav (binary blob via
* UE serializer). Mesmo padrao do [[ZMMOLoginSaveGame]]. * UE serializer). Mesmo padrao do [[ZeusLoginSaveGame]].
* *
* Helpers static abaixo encapsulam load-or-create do slot e Get/Set/Save * Helpers static abaixo encapsulam load-or-create do slot e Get/Set/Save
* pra que a Base nao precise repetir a cerimonia. * pra que a Base nao precise repetir a cerimonia.
*/ */
UCLASS() UCLASS()
class ZMMO_API UZMMOUISaveGame : public USaveGame class ZMMO_API UZeusUISaveGame : public USaveGame
{ {
GENERATED_BODY() GENERATED_BODY()
@@ -32,10 +32,10 @@ public:
* Carrega o save existente ou cria um novo (nao salva ainda). * Carrega o save existente ou cria um novo (nao salva ainda).
* Sempre retorna instancia valida. * Sempre retorna instancia valida.
*/ */
static UZMMOUISaveGame* LoadOrCreate(); static UZeusUISaveGame* LoadOrCreate();
/** Salva o slot atual (sincrono — chamado on-mouse-up, custo baixo). */ /** Salva o slot atual (sincrono — chamado on-mouse-up, custo baixo). */
static void SaveNow(UZMMOUISaveGame* Save); static void SaveNow(UZeusUISaveGame* Save);
/** Get com default — se WindowId nao foi gravado retorna FVector2D::ZeroVector. */ /** Get com default — se WindowId nao foi gravado retorna FVector2D::ZeroVector. */
UFUNCTION(BlueprintCallable, Category = "UI|Prefs") UFUNCTION(BlueprintCallable, Category = "UI|Prefs")

View File

@@ -10,9 +10,9 @@
* é responsabilidade do UZeusCharServerSubsystem (Send/OnRawMessage operam * é responsabilidade do UZeusCharServerSubsystem (Send/OnRawMessage operam
* sobre o payload já sem header). * sobre o payload já sem header).
*/ */
namespace ZMMOCharOp namespace ZeusCharOp
{ {
// Autenticação — payload começa com uint8 method (ver ZMMOCharAuthMethod) // Autenticação — payload começa com uint8 method (ver ZeusCharAuthMethod)
constexpr int32 C_CHAR_AUTH_REQUEST = 2000; constexpr int32 C_CHAR_AUTH_REQUEST = 2000;
constexpr int32 S_CHAR_AUTH_OK = 2001; // string(accountId)+string(user)+uint64(expiresMs) constexpr int32 S_CHAR_AUTH_OK = 2001; // string(accountId)+string(user)+uint64(expiresMs)
constexpr int32 S_CHAR_AUTH_REJECT = 2002; // uint16(reason) constexpr int32 S_CHAR_AUTH_REJECT = 2002; // uint16(reason)
@@ -52,14 +52,14 @@ namespace ZMMOCharOp
* Método de autenticação enviado como uint8 prefix no payload do * Método de autenticação enviado como uint8 prefix no payload do
* C_CHAR_AUTH_REQUEST. * C_CHAR_AUTH_REQUEST.
*/ */
namespace ZMMOCharAuthMethod namespace ZeusCharAuthMethod
{ {
constexpr uint8 TOKEN = 0; constexpr uint8 TOKEN = 0;
constexpr uint8 PASSWORD = 1; constexpr uint8 PASSWORD = 1;
} }
/** Espelha `CharRejectReason` em CharOpcodes.ts. */ /** Espelha `CharRejectReason` em CharOpcodes.ts. */
namespace ZMMOCharRejectReason namespace ZeusCharRejectReason
{ {
constexpr uint16 Unknown = 0; constexpr uint16 Unknown = 0;
constexpr uint16 InvalidToken = 1; constexpr uint16 InvalidToken = 1;
@@ -85,7 +85,7 @@ namespace ZMMOCharRejectReason
} }
/** Estado do Realm no wire (uint8). Espelha `WireRealmState` em CharOpcodes.ts. */ /** Estado do Realm no wire (uint8). Espelha `WireRealmState` em CharOpcodes.ts. */
namespace ZMMOWireRealmState namespace ZeusWireRealmState
{ {
constexpr uint8 Offline = 0; constexpr uint8 Offline = 0;
constexpr uint8 Online = 1; constexpr uint8 Online = 1;

View File

@@ -1,6 +1,6 @@
#include "UIActivatableScreen_Base.h" #include "UIActivatableScreen_Base.h"
#include "ZMMOThemeSubsystem.h" #include "ZeusThemeSubsystem.h"
#include "UIFrontEndFlowSubsystem.h" #include "UIFrontEndFlowSubsystem.h"
#include "Engine/GameInstance.h" #include "Engine/GameInstance.h"
#include "Input/UIActionBindingHandle.h" #include "Input/UIActionBindingHandle.h"
@@ -10,13 +10,13 @@ TOptional<FUIInputConfig> UUIActivatableScreen_Base::GetDesiredInputConfig() con
{ {
switch (InputConfig) switch (InputConfig)
{ {
case EZMMOScreenInputMode::GameAndMenu: case EZeusScreenInputMode::GameAndMenu:
return FUIInputConfig(ECommonInputMode::All, GameMouseCaptureMode); return FUIInputConfig(ECommonInputMode::All, GameMouseCaptureMode);
case EZMMOScreenInputMode::Game: case EZeusScreenInputMode::Game:
return FUIInputConfig(ECommonInputMode::Game, GameMouseCaptureMode); return FUIInputConfig(ECommonInputMode::Game, GameMouseCaptureMode);
case EZMMOScreenInputMode::Menu: case EZeusScreenInputMode::Menu:
return FUIInputConfig(ECommonInputMode::Menu, EMouseCaptureMode::NoCapture); return FUIInputConfig(ECommonInputMode::Menu, EMouseCaptureMode::NoCapture);
case EZMMOScreenInputMode::Default: case EZeusScreenInputMode::Default:
default: default:
return TOptional<FUIInputConfig>(); return TOptional<FUIInputConfig>();
} }
@@ -25,7 +25,7 @@ TOptional<FUIInputConfig> UUIActivatableScreen_Base::GetDesiredInputConfig() con
void UUIActivatableScreen_Base::RefreshUIStyle_Implementation() void UUIActivatableScreen_Base::RefreshUIStyle_Implementation()
{ {
// Base no-op: cada WBP/filho sobrescreve para reaplicar tokens do tema // Base no-op: cada WBP/filho sobrescreve para reaplicar tokens do tema
// ativo (via UZMMOThemeSubsystem). Mantém o contrato igual a // ativo (via UZeusThemeSubsystem). Mantém o contrato igual a
// UUIButton_Base::RefreshUIStyle / UUIPanel_Base::RefreshUIStyle. // UUIButton_Base::RefreshUIStyle / UUIPanel_Base::RefreshUIStyle.
} }
@@ -37,7 +37,7 @@ void UUIActivatableScreen_Base::NativeConstruct()
{ {
if (const UGameInstance* GI = GetGameInstance()) if (const UGameInstance* GI = GetGameInstance())
{ {
if (UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>()) if (UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
{ {
Theme->OnThemeChanged.AddDynamic(this, &UUIActivatableScreen_Base::HandleThemeChanged); Theme->OnThemeChanged.AddDynamic(this, &UUIActivatableScreen_Base::HandleThemeChanged);
bThemeBound = true; bThemeBound = true;
@@ -54,7 +54,7 @@ void UUIActivatableScreen_Base::NativeDestruct()
{ {
if (const UGameInstance* GI = GetGameInstance()) if (const UGameInstance* GI = GetGameInstance())
{ {
if (UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>()) if (UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
{ {
Theme->OnThemeChanged.RemoveDynamic(this, &UUIActivatableScreen_Base::HandleThemeChanged); Theme->OnThemeChanged.RemoveDynamic(this, &UUIActivatableScreen_Base::HandleThemeChanged);
} }

View File

@@ -11,7 +11,7 @@
* GetDesiredInputConfig. * GetDesiredInputConfig.
*/ */
UENUM(BlueprintType) UENUM(BlueprintType)
enum class EZMMOScreenInputMode : uint8 enum class EZeusScreenInputMode : uint8
{ {
Default, // não força nada (herda do CommonUI) Default, // não força nada (herda do CommonUI)
GameAndMenu, // jogo + UI (ex.: HUD com cursor) GameAndMenu, // jogo + UI (ex.: HUD com cursor)
@@ -27,7 +27,7 @@ enum class EZMMOScreenInputMode : uint8
* desta classe C++ (UMG não encadeia árvores — ARQUITETURA.md §3.3). Os WBPs * desta classe C++ (UMG não encadeia árvores — ARQUITETURA.md §3.3). Os WBPs
* gerados pelo Zeus UMG Forge são reparented para cá (§4.8). * gerados pelo Zeus UMG Forge são reparented para cá (§4.8).
* *
* Reage à troca de tema via UZMMOThemeSubsystem (mesmo padrão de * Reage à troca de tema via UZeusThemeSubsystem (mesmo padrão de
* UUIButton_Base) e encaminha o "voltar" ao UUIFrontEndFlowSubsystem. * UUIButton_Base) e encaminha o "voltar" ao UUIFrontEndFlowSubsystem.
*/ */
UCLASS(Abstract, Blueprintable) UCLASS(Abstract, Blueprintable)
@@ -44,7 +44,7 @@ public:
protected: protected:
// ---- Input config (desktop/gamepad) ---- // ---- Input config (desktop/gamepad) ----
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Input") UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Input")
EZMMOScreenInputMode InputConfig = EZMMOScreenInputMode::Menu; EZeusScreenInputMode InputConfig = EZeusScreenInputMode::Menu;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Input") UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Input")
EMouseCaptureMode GameMouseCaptureMode = EMouseCaptureMode::CapturePermanently; EMouseCaptureMode GameMouseCaptureMode = EMouseCaptureMode::CapturePermanently;

View File

@@ -4,7 +4,7 @@
#include "UIButton_Base.h" #include "UIButton_Base.h"
#include "UISpinner_Base.h" #include "UISpinner_Base.h"
#include "UIFrontEndFlowSubsystem.h" #include "UIFrontEndFlowSubsystem.h"
#include "ZMMOThemeSubsystem.h" #include "ZeusThemeSubsystem.h"
#include "ZeusCharServerSubsystem.h" #include "ZeusCharServerSubsystem.h"
#include "CommonTextBlock.h" #include "CommonTextBlock.h"
#include "Components/Border.h" #include "Components/Border.h"
@@ -22,7 +22,7 @@ namespace
{ {
if (const UGameInstance* GI = Widget->GetGameInstance()) if (const UGameInstance* GI = Widget->GetGameInstance())
{ {
if (const UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>()) if (const UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
{ {
return Theme->GetActiveUIStyle(); return Theme->GetActiveUIStyle();
} }

View File

@@ -5,7 +5,7 @@
#include "Engine/World.h" #include "Engine/World.h"
#include "TimerManager.h" #include "TimerManager.h"
#include "UI/Widgets/UIButton_Base.h" #include "UI/Widgets/UIButton_Base.h"
#include "ZMMOJobsLibrary.h" #include "ZeusJobsLibrary.h"
void UUICharCard_Base::NativeConstruct() void UUICharCard_Base::NativeConstruct()
{ {
@@ -34,7 +34,7 @@ void UUICharCard_Base::NativeDestruct()
Super::NativeDestruct(); Super::NativeDestruct();
} }
void UUICharCard_Base::SetFromSummary(const FZMMOCharSummary& InSummary) void UUICharCard_Base::SetFromSummary(const FZeusCharSummary& InSummary)
{ {
Summary = InSummary; Summary = InSummary;
const bool bDeleteScheduled = Summary.DeleteScheduledAtMs > 0; const bool bDeleteScheduled = Summary.DeleteScheduledAtMs > 0;
@@ -49,7 +49,7 @@ void UUICharCard_Base::SetFromSummary(const FZMMOCharSummary& InSummary)
} }
if (Text_Class) if (Text_Class)
{ {
Text_Class->SetText(UZMMOJobsLibrary::GetJobDisplayName(this, Summary.ClassId)); Text_Class->SetText(UZeusJobsLibrary::GetJobDisplayName(this, Summary.ClassId));
} }
const ESlateVisibility ActionVis = bDeleteScheduled ? ESlateVisibility::Collapsed : ESlateVisibility::Visible; const ESlateVisibility ActionVis = bDeleteScheduled ? ESlateVisibility::Collapsed : ESlateVisibility::Visible;

View File

@@ -2,7 +2,7 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "Blueprint/UserWidget.h" #include "Blueprint/UserWidget.h"
#include "ZMMOCharSummary.h" #include "ZeusCharSummary.h"
#include "UICharCard_Base.generated.h" #include "UICharCard_Base.generated.h"
class UCommonTextBlock; class UCommonTextBlock;
@@ -10,10 +10,10 @@ class UBorder;
class UUIButton_Base; class UUIButton_Base;
class UWidget; class UWidget;
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FZMMOOnCharCardSelected, FString, CharId); DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FZeusOnCharCardSelected, FString, CharId);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FZMMOOnCharCardDeleteRequest, FString, CharId); DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FZeusOnCharCardDeleteRequest, FString, CharId);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FZMMOOnCharCardDeleteAccept, FString, CharId); DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FZeusOnCharCardDeleteAccept, FString, CharId);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FZMMOOnCharCardDeleteCancel, FString, CharId); DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FZeusOnCharCardDeleteCancel, FString, CharId);
/** /**
* Card de personagem (instanciado dinamicamente pelo Lobby/CharSelect). * Card de personagem (instanciado dinamicamente pelo Lobby/CharSelect).
@@ -34,22 +34,22 @@ class ZMMO_API UUICharCard_Base : public UUserWidget
public: public:
UFUNCTION(BlueprintCallable, Category = "Zeus|CharCard") UFUNCTION(BlueprintCallable, Category = "Zeus|CharCard")
void SetFromSummary(const FZMMOCharSummary& InSummary); void SetFromSummary(const FZeusCharSummary& InSummary);
UPROPERTY(BlueprintReadOnly, Category = "Zeus|CharCard") UPROPERTY(BlueprintReadOnly, Category = "Zeus|CharCard")
FZMMOCharSummary Summary; FZeusCharSummary Summary;
UPROPERTY(BlueprintAssignable, Category = "Zeus|CharCard") UPROPERTY(BlueprintAssignable, Category = "Zeus|CharCard")
FZMMOOnCharCardSelected OnCardSelected; FZeusOnCharCardSelected OnCardSelected;
UPROPERTY(BlueprintAssignable, Category = "Zeus|CharCard") UPROPERTY(BlueprintAssignable, Category = "Zeus|CharCard")
FZMMOOnCharCardDeleteRequest OnCardDeleteRequest; FZeusOnCharCardDeleteRequest OnCardDeleteRequest;
UPROPERTY(BlueprintAssignable, Category = "Zeus|CharCard") UPROPERTY(BlueprintAssignable, Category = "Zeus|CharCard")
FZMMOOnCharCardDeleteAccept OnCardDeleteAccept; FZeusOnCharCardDeleteAccept OnCardDeleteAccept;
UPROPERTY(BlueprintAssignable, Category = "Zeus|CharCard") UPROPERTY(BlueprintAssignable, Category = "Zeus|CharCard")
FZMMOOnCharCardDeleteCancel OnCardDeleteCancel; FZeusOnCharCardDeleteCancel OnCardDeleteCancel;
/** /**
* Hook BP — chamado apos SetFromSummary aplicar valores. Util pra * Hook BP — chamado apos SetFromSummary aplicar valores. Util pra

View File

@@ -11,11 +11,11 @@
#include "Engine/GameInstance.h" #include "Engine/GameInstance.h"
#include "UI/Widgets/UIButton_Base.h" #include "UI/Widgets/UIButton_Base.h"
using ZMMOWire::WriteUuid16; using ZeusWire::WriteUuid16;
using ZMMOWire::WriteUInt8; using ZeusWire::WriteUInt8;
using ZMMOWire::WriteUInt16; using ZeusWire::WriteUInt16;
using ZMMOWire::WriteUInt32; using ZeusWire::WriteUInt32;
using ZMMOWire::WriteStringUtf8; using ZeusWire::WriteStringUtf8;
void UUICharacterCreatePage_Base::NativeConstruct() void UUICharacterCreatePage_Base::NativeConstruct()
{ {
@@ -86,7 +86,7 @@ void UUICharacterCreatePage_Base::SubmitCreate()
WriteUInt32(Payload, 0); // skinColor WriteUInt32(Payload, 0); // skinColor
WriteUInt8(Payload, 0); // bodyType WriteUInt8(Payload, 0); // bodyType
Char->SendCharRequest(ZMMOCharOp::C_CHAR_CREATE, Payload); Char->SendCharRequest(ZeusCharOp::C_CHAR_CREATE, Payload);
if (Text_Error) Text_Error->SetText(FText::GetEmpty()); if (Text_Error) Text_Error->SetText(FText::GetEmpty());
OnRequestSent.Broadcast(); OnRequestSent.Broadcast();
} }

View File

@@ -9,8 +9,8 @@ class UComboBoxString;
class UCommonTextBlock; class UCommonTextBlock;
class UUIButton_Base; class UUIButton_Base;
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FZMMOOnCharCreateRequestSent); DECLARE_DYNAMIC_MULTICAST_DELEGATE(FZeusOnCharCreateRequestSent);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FZMMOOnCharCreateCancelled); DECLARE_DYNAMIC_MULTICAST_DELEGATE(FZeusOnCharCreateCancelled);
/** /**
* Page de criacao de personagem dentro do Lobby. Form minimo: nome + classId * Page de criacao de personagem dentro do Lobby. Form minimo: nome + classId
@@ -35,10 +35,10 @@ public:
void CancelCreate(); void CancelCreate();
UPROPERTY(BlueprintAssignable, Category = "Zeus|CharCreate") UPROPERTY(BlueprintAssignable, Category = "Zeus|CharCreate")
FZMMOOnCharCreateRequestSent OnRequestSent; FZeusOnCharCreateRequestSent OnRequestSent;
UPROPERTY(BlueprintAssignable, Category = "Zeus|CharCreate") UPROPERTY(BlueprintAssignable, Category = "Zeus|CharCreate")
FZMMOOnCharCreateCancelled OnCancelled; FZeusOnCharCreateCancelled OnCancelled;
protected: protected:
virtual void NativeConstruct() override; virtual void NativeConstruct() override;

View File

@@ -8,8 +8,8 @@
#include "UI/Common/UILoadingProfilesDataAsset.h" #include "UI/Common/UILoadingProfilesDataAsset.h"
#include "UI/Common/UILoadingScreen_Base.h" #include "UI/Common/UILoadingScreen_Base.h"
#include "UI/UILayerTags.h" #include "UI/UILayerTags.h"
#include "ZMMOGameInstance.h" #include "ZeusGameInstance.h"
#include "ZMMOThemeSubsystem.h" #include "ZeusThemeSubsystem.h"
#include "ZeusNetworkSubsystem.h" #include "ZeusNetworkSubsystem.h"
#include "ZeusCharServerSubsystem.h" #include "ZeusCharServerSubsystem.h"
#include "CommonActivatableWidget.h" #include "CommonActivatableWidget.h"
@@ -48,7 +48,7 @@ void UUIFrontEndFlowSubsystem::StartFrontEnd()
EnsureRootLayout(); EnsureRootLayout();
BindNetwork(); BindNetwork();
SetState(EZMMOFrontEndState::Boot); SetState(EZeusFrontEndState::Boot);
// Pré-login fala com o ZeusCharServer (WebSocket), NÃO com o world server // Pré-login fala com o ZeusCharServer (WebSocket), NÃO com o world server
// UDP. A tela Boot observa o CharServer e libera o botão ao conectar. // UDP. A tela Boot observa o CharServer e libera o botão ao conectar.
@@ -82,7 +82,7 @@ void UUIFrontEndFlowSubsystem::EnsureRootLayout()
UE_LOG(LogZMMO, Log, TEXT("FrontEndFlow::EnsureRootLayout: RootLayout recriado")); UE_LOG(LogZMMO, Log, TEXT("FrontEndFlow::EnsureRootLayout: RootLayout recriado"));
} }
void UUIFrontEndFlowSubsystem::SetState(EZMMOFrontEndState NewState) void UUIFrontEndFlowSubsystem::SetState(EZeusFrontEndState NewState)
{ {
if (NewState == CurrentState) if (NewState == CurrentState)
{ {
@@ -94,16 +94,16 @@ void UUIFrontEndFlowSubsystem::SetState(EZMMOFrontEndState NewState)
*UEnum::GetValueAsString(NewState)); *UEnum::GetValueAsString(NewState));
OnStateChanged.Broadcast(NewState); OnStateChanged.Broadcast(NewState);
const FGameplayTag MenuLayer = ZMMOUITags::UI_Layer_Menu.GetTag(); const FGameplayTag MenuLayer = ZeusUITags::UI_Layer_Menu.GetTag();
const FGameplayTag ModalLayer = ZMMOUITags::UI_Layer_Modal.GetTag(); const FGameplayTag ModalLayer = ZeusUITags::UI_Layer_Modal.GetTag();
switch (NewState) switch (NewState)
{ {
case EZMMOFrontEndState::Boot: case EZeusFrontEndState::Boot:
case EZMMOFrontEndState::Connecting: case EZeusFrontEndState::Connecting:
case EZMMOFrontEndState::Login: case EZeusFrontEndState::Login:
case EZMMOFrontEndState::ServerSelect: case EZeusFrontEndState::ServerSelect:
case EZMMOFrontEndState::Lobby: case EZeusFrontEndState::Lobby:
// Telas do front-end vivem na camada Menu (uma por vez). // Telas do front-end vivem na camada Menu (uma por vez).
if (UUIManagerSubsystem* Mgr = GetUIManager()) if (UUIManagerSubsystem* Mgr = GetUIManager())
{ {
@@ -112,12 +112,12 @@ void UUIFrontEndFlowSubsystem::SetState(EZMMOFrontEndState NewState)
ResolveAndPushScreen(NewState); ResolveAndPushScreen(NewState);
break; break;
case EZMMOFrontEndState::EnteringWorld: case EZeusFrontEndState::EnteringWorld:
// Loading/handoff por cima de tudo (camada Modal). // Loading/handoff por cima de tudo (camada Modal).
ResolveAndPushScreen(NewState); ResolveAndPushScreen(NewState);
break; break;
case EZMMOFrontEndState::InWorld: case EZeusFrontEndState::InWorld:
// HUD de gameplay assume — limpa front-end e loading. // HUD de gameplay assume — limpa front-end e loading.
if (UUIManagerSubsystem* Mgr = GetUIManager()) if (UUIManagerSubsystem* Mgr = GetUIManager())
{ {
@@ -126,13 +126,13 @@ void UUIFrontEndFlowSubsystem::SetState(EZMMOFrontEndState NewState)
} }
break; break;
case EZMMOFrontEndState::None: case EZeusFrontEndState::None:
default: default:
break; break;
} }
} }
void UUIFrontEndFlowSubsystem::ShowLobbyPage(EZMMOLobbyPage Page) void UUIFrontEndFlowSubsystem::ShowLobbyPage(EZeusLobbyPage Page)
{ {
UUIFrontEndScreenSet* SS = GetScreenSet(); UUIFrontEndScreenSet* SS = GetScreenSet();
UUIManagerSubsystem* Mgr = GetUIManager(); UUIManagerSubsystem* Mgr = GetUIManager();
@@ -149,7 +149,7 @@ void UUIFrontEndFlowSubsystem::ShowLobbyPage(EZMMOLobbyPage Page)
return; return;
} }
const FGameplayTag MenuLayer = ZMMOUITags::UI_Layer_Menu.GetTag(); const FGameplayTag MenuLayer = ZeusUITags::UI_Layer_Menu.GetTag();
const FSoftObjectPath Path = Soft.ToSoftObjectPath(); const FSoftObjectPath Path = Soft.ToSoftObjectPath();
UAssetManager::GetStreamableManager().RequestAsyncLoad( UAssetManager::GetStreamableManager().RequestAsyncLoad(
Path, Path,
@@ -169,22 +169,22 @@ bool UUIFrontEndFlowSubsystem::RequestBack()
{ {
switch (CurrentState) switch (CurrentState)
{ {
case EZMMOFrontEndState::Login: case EZeusFrontEndState::Login:
// Volta à Boot (CharServer segue conectado; só re-mostra a tela). // Volta à Boot (CharServer segue conectado; só re-mostra a tela).
SetState(EZMMOFrontEndState::Boot); SetState(EZeusFrontEndState::Boot);
return true; return true;
case EZMMOFrontEndState::ServerSelect: case EZeusFrontEndState::ServerSelect:
SetState(EZMMOFrontEndState::Login); SetState(EZeusFrontEndState::Login);
return true; return true;
case EZMMOFrontEndState::Lobby: case EZeusFrontEndState::Lobby:
SetState(EZMMOFrontEndState::ServerSelect); SetState(EZeusFrontEndState::ServerSelect);
return true; return true;
default: default:
return false; return false;
} }
} }
void UUIFrontEndFlowSubsystem::ResolveAndPushScreen(EZMMOFrontEndState State) void UUIFrontEndFlowSubsystem::ResolveAndPushScreen(EZeusFrontEndState State)
{ {
UUIFrontEndScreenSet* SS = GetScreenSet(); UUIFrontEndScreenSet* SS = GetScreenSet();
if (!SS) if (!SS)
@@ -209,9 +209,9 @@ void UUIFrontEndFlowSubsystem::ResolveAndPushScreen(EZMMOFrontEndState State)
return; return;
} }
const FGameplayTag Layer = (State == EZMMOFrontEndState::EnteringWorld) const FGameplayTag Layer = (State == EZeusFrontEndState::EnteringWorld)
? ZMMOUITags::UI_Layer_Modal.GetTag() ? ZeusUITags::UI_Layer_Modal.GetTag()
: ZMMOUITags::UI_Layer_Menu.GetTag(); : ZeusUITags::UI_Layer_Menu.GetTag();
const FSoftObjectPath Path = Soft.ToSoftObjectPath(); const FSoftObjectPath Path = Soft.ToSoftObjectPath();
UAssetManager::GetStreamableManager().RequestAsyncLoad( UAssetManager::GetStreamableManager().RequestAsyncLoad(
@@ -226,12 +226,12 @@ void UUIFrontEndFlowSubsystem::ResolveAndPushScreen(EZMMOFrontEndState State)
// Loading: configura logo após o push e marca etapa "Travel" // Loading: configura logo após o push e marca etapa "Travel"
// (chegamos aqui via HandleServerTravelRequested → SetState). // (chegamos aqui via HandleServerTravelRequested → SetState).
if (State == EZMMOFrontEndState::EnteringWorld) if (State == EZeusFrontEndState::EnteringWorld)
{ {
if (UUILoadingScreen_Base* Loading = Cast<UUILoadingScreen_Base>(Pushed)) if (UUILoadingScreen_Base* Loading = Cast<UUILoadingScreen_Base>(Pushed))
{ {
ActiveLoadingScreen = Loading; ActiveLoadingScreen = Loading;
Loading->Configure(EZMMOLoadingContext::FrontEndEnteringWorld, Loading->Configure(EZeusLoadingContext::FrontEndEnteringWorld,
GetLoadingProfiles(), GetLoadingTips()); GetLoadingProfiles(), GetLoadingTips());
Loading->OnLoadingComplete.AddDynamic(this, &UUIFrontEndFlowSubsystem::HandleLoadingComplete); Loading->OnLoadingComplete.AddDynamic(this, &UUIFrontEndFlowSubsystem::HandleLoadingComplete);
Loading->MarkStepDone(TEXT("Travel")); Loading->MarkStepDone(TEXT("Travel"));
@@ -362,11 +362,11 @@ void UUIFrontEndFlowSubsystem::HandleCharDisconnected(int32 StatusCode, FString
UE_LOG(LogZMMO, Log, TEXT("FrontEndFlow: CharServer desconectou (code=%d, %s)."), UE_LOG(LogZMMO, Log, TEXT("FrontEndFlow: CharServer desconectou (code=%d, %s)."),
StatusCode, *Reason); StatusCode, *Reason);
// Se caiu antes de entrar no mundo, volta a Boot para reconectar. // Se caiu antes de entrar no mundo, volta a Boot para reconectar.
if (CurrentState != EZMMOFrontEndState::InWorld && if (CurrentState != EZeusFrontEndState::InWorld &&
CurrentState != EZMMOFrontEndState::EnteringWorld && CurrentState != EZeusFrontEndState::EnteringWorld &&
CurrentState != EZMMOFrontEndState::Boot) CurrentState != EZeusFrontEndState::Boot)
{ {
SetState(EZMMOFrontEndState::Boot); SetState(EZeusFrontEndState::Boot);
if (UZeusCharServerSubsystem* Char = GetCharServer()) if (UZeusCharServerSubsystem* Char = GetCharServer())
{ {
Char->ConnectToDefaultCharServer(); Char->ConnectToDefaultCharServer();
@@ -376,17 +376,17 @@ void UUIFrontEndFlowSubsystem::HandleCharDisconnected(int32 StatusCode, FString
void UUIFrontEndFlowSubsystem::RequestEnterLogin() void UUIFrontEndFlowSubsystem::RequestEnterLogin()
{ {
if (CurrentState == EZMMOFrontEndState::Boot) if (CurrentState == EZeusFrontEndState::Boot)
{ {
SetState(EZMMOFrontEndState::Login); SetState(EZeusFrontEndState::Login);
} }
} }
void UUIFrontEndFlowSubsystem::RequestEnterServerSelect() void UUIFrontEndFlowSubsystem::RequestEnterServerSelect()
{ {
if (CurrentState == EZMMOFrontEndState::Login) if (CurrentState == EZeusFrontEndState::Login)
{ {
SetState(EZMMOFrontEndState::ServerSelect); SetState(EZeusFrontEndState::ServerSelect);
} }
} }
@@ -439,9 +439,9 @@ void UUIFrontEndFlowSubsystem::HandleServerTravelRequested(const FString& MapNam
TEXT("FrontEndFlow: ja estamos em %s — ignorando OpenLevel do S_TRAVEL_TO_MAP (mantem HUD/PlayerState)"), TEXT("FrontEndFlow: ja estamos em %s — ignorando OpenLevel do S_TRAVEL_TO_MAP (mantem HUD/PlayerState)"),
*TargetShort); *TargetShort);
bTravelingToWorld = false; bTravelingToWorld = false;
if (CurrentState != EZMMOFrontEndState::InWorld) if (CurrentState != EZeusFrontEndState::InWorld)
{ {
SetState(EZMMOFrontEndState::InWorld); SetState(EZeusFrontEndState::InWorld);
} }
return; return;
} }
@@ -449,15 +449,15 @@ void UUIFrontEndFlowSubsystem::HandleServerTravelRequested(const FString& MapNam
} }
bTravelingToWorld = true; bTravelingToWorld = true;
SetState(EZMMOFrontEndState::EnteringWorld); SetState(EZeusFrontEndState::EnteringWorld);
if (!MapPath.IsEmpty()) if (!MapPath.IsEmpty())
{ {
// Forca ZMMOGameMode em qualquer mapa que venha do WorldServer. // Forca ZeusGameMode em qualquer mapa que venha do WorldServer.
// World Settings do .umap podem ter override herdado de L_FrontEnd // World Settings do .umap podem ter override herdado de L_FrontEnd
// (GameModeOverride=ZMMOFrontEndGameMode) — sobrescrevemos via URL // (GameModeOverride=ZeusFrontEndGameMode) — sobrescrevemos via URL
// option pra nao depender de cada artista configurar. // option pra nao depender de cada artista configurar.
const FString Options = TEXT("game=/Script/ZMMO.ZMMOGameMode"); const FString Options = TEXT("game=/Script/ZMMO.ZeusGameMode");
UGameplayStatics::OpenLevel(GetGameInstance(), FName(*MapPath), /*bAbsolute=*/true, Options); UGameplayStatics::OpenLevel(GetGameInstance(), FName(*MapPath), /*bAbsolute=*/true, Options);
} }
} }
@@ -514,10 +514,10 @@ void UUIFrontEndFlowSubsystem::HandleLoadingComplete()
ActiveLoadingScreen.Reset(); ActiveLoadingScreen.Reset();
PendingLoadingSteps_.Reset(); PendingLoadingSteps_.Reset();
bTravelingToWorld = false; bTravelingToWorld = false;
SetState(EZMMOFrontEndState::InWorld); SetState(EZeusFrontEndState::InWorld);
} }
UZMMOLoadingProfilesDataAsset* UUIFrontEndFlowSubsystem::GetLoadingProfiles() UZeusLoadingProfilesDataAsset* UUIFrontEndFlowSubsystem::GetLoadingProfiles()
{ {
if (LoadingProfiles) return LoadingProfiles; if (LoadingProfiles) return LoadingProfiles;
if (!LoadingProfilesAsset.IsNull()) if (!LoadingProfilesAsset.IsNull())
@@ -543,14 +543,14 @@ void UUIFrontEndFlowSubsystem::HandleServerHelloTheme(FName ThemeId)
// ThemeId do ServerHello. Mantido pronto para quando o plugin expuser. // ThemeId do ServerHello. Mantido pronto para quando o plugin expuser.
if (const UGameInstance* GI = GetGameInstance()) if (const UGameInstance* GI = GetGameInstance())
{ {
if (UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>()) if (UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
{ {
Theme->ApplyServerTheme(ThemeId); Theme->ApplyServerTheme(ThemeId);
} }
} }
} }
const FZMMOMapDef* UUIFrontEndFlowSubsystem::FindMapDef(int32 MapId) const const FZeusMapDef* UUIFrontEndFlowSubsystem::FindMapDef(int32 MapId) const
{ {
if (MapId <= 0) return nullptr; if (MapId <= 0) return nullptr;
if (MapsTableAsset.IsNull()) if (MapsTableAsset.IsNull())
@@ -563,7 +563,7 @@ const FZMMOMapDef* UUIFrontEndFlowSubsystem::FindMapDef(int32 MapId) const
for (const TPair<FName, uint8*>& Row : Table->GetRowMap()) for (const TPair<FName, uint8*>& Row : Table->GetRowMap())
{ {
const FZMMOMapDef* Def = reinterpret_cast<const FZMMOMapDef*>(Row.Value); const FZeusMapDef* Def = reinterpret_cast<const FZeusMapDef*>(Row.Value);
if (Def && Def->MapId == MapId) if (Def && Def->MapId == MapId)
{ {
return Def; return Def;
@@ -574,7 +574,7 @@ const FZMMOMapDef* UUIFrontEndFlowSubsystem::FindMapDef(int32 MapId) const
FString UUIFrontEndFlowSubsystem::ResolveLevelPathByMapId(int32 MapId) const FString UUIFrontEndFlowSubsystem::ResolveLevelPathByMapId(int32 MapId) const
{ {
const FZMMOMapDef* Def = FindMapDef(MapId); const FZeusMapDef* Def = FindMapDef(MapId);
if (!Def) return FString(); if (!Def) return FString();
const FSoftObjectPath ObjPath = Def->ClientLevel.ToSoftObjectPath(); const FSoftObjectPath ObjPath = Def->ClientLevel.ToSoftObjectPath();
if (!ObjPath.IsValid()) return FString(); if (!ObjPath.IsValid()) return FString();
@@ -611,8 +611,8 @@ bool UUIFrontEndFlowSubsystem::TravelToMapById(int32 MapId)
} }
UE_LOG(LogZMMO, Log, TEXT("FrontEndFlow: TravelToMapById(%d) -> %s"), MapId, *MapPath); UE_LOG(LogZMMO, Log, TEXT("FrontEndFlow: TravelToMapById(%d) -> %s"), MapId, *MapPath);
bTravelingToWorld = true; bTravelingToWorld = true;
SetState(EZMMOFrontEndState::EnteringWorld); SetState(EZeusFrontEndState::EnteringWorld);
const FString Options = TEXT("game=/Script/ZMMO.ZMMOGameMode"); const FString Options = TEXT("game=/Script/ZMMO.ZeusGameMode");
UGameplayStatics::OpenLevel(GetGameInstance(), FName(*MapPath), /*bAbsolute=*/true, Options); UGameplayStatics::OpenLevel(GetGameInstance(), FName(*MapPath), /*bAbsolute=*/true, Options);
return true; return true;
} }

View File

@@ -9,12 +9,12 @@
class UUIFrontEndScreenSet; class UUIFrontEndScreenSet;
class UUIManagerSubsystem; class UUIManagerSubsystem;
class UUILoadingScreen_Base; class UUILoadingScreen_Base;
class UZMMOLoadingProfilesDataAsset; class UZeusLoadingProfilesDataAsset;
class UZeusNetworkSubsystem; class UZeusNetworkSubsystem;
class UZeusCharServerSubsystem; class UZeusCharServerSubsystem;
struct FZMMOMapDef; struct FZeusMapDef;
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnZMMOFrontEndStateChanged, EZMMOFrontEndState, NewState); DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnZeusFrontEndStateChanged, EZeusFrontEndState, NewState);
/** /**
* Orquestrador do fluxo de front-end. UGameInstanceSubsystem porque o * Orquestrador do fluxo de front-end. UGameInstanceSubsystem porque o
@@ -22,7 +22,7 @@ DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnZMMOFrontEndStateChanged, EZMMOFr
* morrer no OpenLevel). * morrer no OpenLevel).
* *
* Responsável por: (a) dirigir a conexão via UZeusNetworkSubsystem; * Responsável por: (a) dirigir a conexão via UZeusNetworkSubsystem;
* (b) manter EZMMOFrontEndState; (c) resolver estado→tela pelo * (b) manter EZeusFrontEndState; (c) resolver estado→tela pelo
* DA_FrontEndScreenSet e pedir ao UUIManagerSubsystem para empurrar na * DA_FrontEndScreenSet e pedir ao UUIManagerSubsystem para empurrar na
* camada certa; (d) detectar a chegada ao mundo. * camada certa; (d) detectar a chegada ao mundo.
* *
@@ -40,7 +40,7 @@ public:
virtual void Deinitialize() override; virtual void Deinitialize() override;
/** /**
* Ponto de entrada chamado pelo AZMMOFrontEndPlayerController::BeginPlay * Ponto de entrada chamado pelo AZeusFrontEndPlayerController::BeginPlay
* (garante que os subsistemas já existem — ver aviso no header do * (garante que os subsistemas já existem — ver aviso no header do
* ZeusNetworkSubsystem sobre GameInstance::Init). Cria o root layout, * ZeusNetworkSubsystem sobre GameInstance::Init). Cria o root layout,
* liga os delegates de rede e dispara Boot→Connecting. * liga os delegates de rede e dispara Boot→Connecting.
@@ -61,14 +61,14 @@ public:
void EnsureRootLayout(); void EnsureRootLayout();
UFUNCTION(BlueprintCallable, Category = "FrontEnd") UFUNCTION(BlueprintCallable, Category = "FrontEnd")
void SetState(EZMMOFrontEndState NewState); void SetState(EZeusFrontEndState NewState);
UFUNCTION(BlueprintPure, Category = "FrontEnd") UFUNCTION(BlueprintPure, Category = "FrontEnd")
EZMMOFrontEndState GetCurrentState() const { return CurrentState; } EZeusFrontEndState GetCurrentState() const { return CurrentState; }
/** Mostra uma página interna do Lobby ("switch principal"). */ /** Mostra uma página interna do Lobby ("switch principal"). */
UFUNCTION(BlueprintCallable, Category = "FrontEnd") UFUNCTION(BlueprintCallable, Category = "FrontEnd")
void ShowLobbyPage(EZMMOLobbyPage Page); void ShowLobbyPage(EZeusLobbyPage Page);
/** "Voltar". Retorna true se o fluxo consumiu (tela base encaminha aqui). */ /** "Voltar". Retorna true se o fluxo consumiu (tela base encaminha aqui). */
UFUNCTION(BlueprintCallable, Category = "FrontEnd") UFUNCTION(BlueprintCallable, Category = "FrontEnd")
@@ -102,7 +102,7 @@ public:
* Retorna nullptr se MapId=0, DT_Maps nao configurado, ou mapId nao * Retorna nullptr se MapId=0, DT_Maps nao configurado, ou mapId nao
* encontrado. * encontrado.
*/ */
const FZMMOMapDef* FindMapDef(int32 MapId) const; const FZeusMapDef* FindMapDef(int32 MapId) const;
/** /**
* Helper: resolve `MapId` no DT_Maps e retorna `ClientLevel.ToSoftObjectPath().GetLongPackageName()` * Helper: resolve `MapId` no DT_Maps e retorna `ClientLevel.ToSoftObjectPath().GetLongPackageName()`
@@ -113,7 +113,7 @@ public:
/** /**
* Inicia transicao pra mundo dado um `MapId`: faz `OpenLevel` com * Inicia transicao pra mundo dado um `MapId`: faz `OpenLevel` com
* `?game=/Script/ZMMO.ZMMOGameMode`. No-op se `MapId` invalido ou * `?game=/Script/ZMMO.ZeusGameMode`. No-op se `MapId` invalido ou
* DT_Maps nao tem entrada. * DT_Maps nao tem entrada.
*/ */
UFUNCTION(BlueprintCallable, Category = "FrontEnd|Maps") UFUNCTION(BlueprintCallable, Category = "FrontEnd|Maps")
@@ -122,7 +122,7 @@ public:
/** /**
* Memoriza a pose autoritativa do char vinda no `S_CHAR_SELECT_OK` * Memoriza a pose autoritativa do char vinda no `S_CHAR_SELECT_OK`
* (pos salva no DB + yaw). Sobrevive ao travel porque vivemos no * (pos salva no DB + yaw). Sobrevive ao travel porque vivemos no
* GameInstance. Lida pelo `AZMMOPlayerCharacter::BeginPlay` pra * GameInstance. Lida pelo `AZeusCharacter::BeginPlay` pra
* reposicionar o pawn local em vez de spawnar no PlayerStart default * reposicionar o pawn local em vez de spawnar no PlayerStart default
* do level. Limpa apos consumo (a proxima sessao reenvia). * do level. Limpa apos consumo (a proxima sessao reenvia).
*/ */
@@ -133,7 +133,7 @@ public:
bool ConsumePendingSpawnPose(FVector& OutPosCm, float& OutYawDeg); bool ConsumePendingSpawnPose(FVector& OutPosCm, float& OutYawDeg);
UPROPERTY(BlueprintAssignable, Category = "FrontEnd") UPROPERTY(BlueprintAssignable, Category = "FrontEnd")
FOnZMMOFrontEndStateChanged OnStateChanged; FOnZeusFrontEndStateChanged OnStateChanged;
protected: protected:
/** DA com o mapa estado→tela. Config em DefaultGame.ini. */ /** DA com o mapa estado→tela. Config em DefaultGame.ini. */
@@ -141,7 +141,7 @@ protected:
TSoftObjectPtr<UUIFrontEndScreenSet> ScreenSetAsset; TSoftObjectPtr<UUIFrontEndScreenSet> ScreenSetAsset;
/** /**
* DataTable com FZMMOMapDef. Source of truth client-side para * DataTable com FZeusMapDef. Source of truth client-side para
* `MapId -> ClientLevel/spawns/displayName`. Configure em DefaultGame.ini: * `MapId -> ClientLevel/spawns/displayName`. Configure em DefaultGame.ini:
* [/Script/ZMMO.UIFrontEndFlowSubsystem] * [/Script/ZMMO.UIFrontEndFlowSubsystem]
* MapsTableAsset=/Game/ZMMO/Data/World/DT_Maps.DT_Maps * MapsTableAsset=/Game/ZMMO/Data/World/DT_Maps.DT_Maps
@@ -156,10 +156,10 @@ protected:
* LoadingProfilesAsset=/Game/ZMMO/Data/UI/Loading/DA_LoadingProfiles.DA_LoadingProfiles * LoadingProfilesAsset=/Game/ZMMO/Data/UI/Loading/DA_LoadingProfiles.DA_LoadingProfiles
*/ */
UPROPERTY(Config, EditDefaultsOnly, Category = "FrontEnd|Loading") UPROPERTY(Config, EditDefaultsOnly, Category = "FrontEnd|Loading")
TSoftObjectPtr<UZMMOLoadingProfilesDataAsset> LoadingProfilesAsset; TSoftObjectPtr<UZeusLoadingProfilesDataAsset> LoadingProfilesAsset;
/** /**
* DataTable com dicas (rows = FZMMOLoadingTipRow). Opcional — vazio * DataTable com dicas (rows = FZeusLoadingTipRow). Opcional — vazio
* significa "sem dicas". Configure em DefaultGame.ini: * significa "sem dicas". Configure em DefaultGame.ini:
* [/Script/ZMMO.UIFrontEndFlowSubsystem] * [/Script/ZMMO.UIFrontEndFlowSubsystem]
* LoadingTipsAsset=/Game/ZMMO/Data/UI/Loading/DT_LoadingTips.DT_LoadingTips * LoadingTipsAsset=/Game/ZMMO/Data/UI/Loading/DT_LoadingTips.DT_LoadingTips
@@ -176,7 +176,7 @@ private:
UUIFrontEndScreenSet* GetScreenSet(); UUIFrontEndScreenSet* GetScreenSet();
/** Resolve a soft class do estado e empurra na camada Menu (no-op+log se vazio). */ /** Resolve a soft class do estado e empurra na camada Menu (no-op+log se vazio). */
void ResolveAndPushScreen(EZMMOFrontEndState State); void ResolveAndPushScreen(EZeusFrontEndState State);
UFUNCTION() UFUNCTION()
void HandleConnected(); void HandleConnected();
@@ -205,7 +205,7 @@ private:
void HandlePostLoadMap(UWorld* LoadedWorld); void HandlePostLoadMap(UWorld* LoadedWorld);
/** Resolve+carrega o DA de perfis (sync). */ /** Resolve+carrega o DA de perfis (sync). */
UZMMOLoadingProfilesDataAsset* GetLoadingProfiles(); UZeusLoadingProfilesDataAsset* GetLoadingProfiles();
/** Resolve+carrega o DT de dicas (sync). */ /** Resolve+carrega o DT de dicas (sync). */
UDataTable* GetLoadingTips(); UDataTable* GetLoadingTips();
@@ -213,13 +213,13 @@ private:
/** /**
* Dívida técnica (D5): ServerHello traz ThemeId, mas o UZeusNetworkSubsystem * Dívida técnica (D5): ServerHello traz ThemeId, mas o UZeusNetworkSubsystem
* ainda não expõe um delegate/getter dedicado. Quando expuser, ligar aqui * ainda não expõe um delegate/getter dedicado. Quando expuser, ligar aqui
* → UZMMOThemeSubsystem::ApplyServerTheme. Sem isto, o tema resolve por * → UZeusThemeSubsystem::ApplyServerTheme. Sem isto, o tema resolve por
* calendário/Default (ARQUITETURA.md §1.10). * calendário/Default (ARQUITETURA.md §1.10).
*/ */
void HandleServerHelloTheme(FName ThemeId); void HandleServerHelloTheme(FName ThemeId);
UPROPERTY(Transient) UPROPERTY(Transient)
EZMMOFrontEndState CurrentState = EZMMOFrontEndState::None; EZeusFrontEndState CurrentState = EZeusFrontEndState::None;
UPROPERTY(Transient) UPROPERTY(Transient)
FString SelectedRealmId; FString SelectedRealmId;
@@ -238,7 +238,7 @@ private:
TObjectPtr<UUIFrontEndScreenSet> ScreenSet; TObjectPtr<UUIFrontEndScreenSet> ScreenSet;
UPROPERTY(Transient) UPROPERTY(Transient)
TObjectPtr<UZMMOLoadingProfilesDataAsset> LoadingProfiles; TObjectPtr<UZeusLoadingProfilesDataAsset> LoadingProfiles;
UPROPERTY(Transient) UPROPERTY(Transient)
TObjectPtr<UDataTable> LoadingTips; TObjectPtr<UDataTable> LoadingTips;

View File

@@ -1,6 +1,6 @@
#include "UIFrontEndScreenSet.h" #include "UIFrontEndScreenSet.h"
TSoftClassPtr<UCommonActivatableWidget> UUIFrontEndScreenSet::GetScreenForState(EZMMOFrontEndState State) const TSoftClassPtr<UCommonActivatableWidget> UUIFrontEndScreenSet::GetScreenForState(EZeusFrontEndState State) const
{ {
if (const TSoftClassPtr<UCommonActivatableWidget>* Found = StateScreens.Find(State)) if (const TSoftClassPtr<UCommonActivatableWidget>* Found = StateScreens.Find(State))
{ {
@@ -9,7 +9,7 @@ TSoftClassPtr<UCommonActivatableWidget> UUIFrontEndScreenSet::GetScreenForState(
return TSoftClassPtr<UCommonActivatableWidget>(); return TSoftClassPtr<UCommonActivatableWidget>();
} }
TSoftClassPtr<UCommonActivatableWidget> UUIFrontEndScreenSet::GetLobbyPage(EZMMOLobbyPage Page) const TSoftClassPtr<UCommonActivatableWidget> UUIFrontEndScreenSet::GetLobbyPage(EZeusLobbyPage Page) const
{ {
if (const TSoftClassPtr<UCommonActivatableWidget>* Found = LobbyPages.Find(Page)) if (const TSoftClassPtr<UCommonActivatableWidget>* Found = LobbyPages.Find(Page))
{ {

View File

@@ -29,17 +29,17 @@ public:
/** Tela por estado de topo do fluxo. */ /** Tela por estado de topo do fluxo. */
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "FrontEnd") UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "FrontEnd")
TMap<EZMMOFrontEndState, TSoftClassPtr<UCommonActivatableWidget>> StateScreens; TMap<EZeusFrontEndState, TSoftClassPtr<UCommonActivatableWidget>> StateScreens;
/** Páginas internas do Lobby (host = a tela de Lobby; "switch principal"). */ /** Páginas internas do Lobby (host = a tela de Lobby; "switch principal"). */
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "FrontEnd") UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "FrontEnd")
TMap<EZMMOLobbyPage, TSoftClassPtr<UCommonActivatableWidget>> LobbyPages; TMap<EZeusLobbyPage, TSoftClassPtr<UCommonActivatableWidget>> LobbyPages;
/** Soft class da tela do estado (vazio se não configurado). */ /** Soft class da tela do estado (vazio se não configurado). */
UFUNCTION(BlueprintCallable, Category = "FrontEnd") UFUNCTION(BlueprintCallable, Category = "FrontEnd")
TSoftClassPtr<UCommonActivatableWidget> GetScreenForState(EZMMOFrontEndState State) const; TSoftClassPtr<UCommonActivatableWidget> GetScreenForState(EZeusFrontEndState State) const;
/** Soft class da página de Lobby (vazio se não configurado). */ /** Soft class da página de Lobby (vazio se não configurado). */
UFUNCTION(BlueprintCallable, Category = "FrontEnd") UFUNCTION(BlueprintCallable, Category = "FrontEnd")
TSoftClassPtr<UCommonActivatableWidget> GetLobbyPage(EZMMOLobbyPage Page) const; TSoftClassPtr<UCommonActivatableWidget> GetLobbyPage(EZeusLobbyPage Page) const;
}; };

View File

@@ -5,10 +5,10 @@
#include "UIButton_Base.h" #include "UIButton_Base.h"
#include "UICheckBox_Base.h" #include "UICheckBox_Base.h"
#include "UILabel_Base.h" #include "UILabel_Base.h"
#include "ZMMOLoginSaveGame.h" #include "ZeusLoginSaveGame.h"
#include "Kismet/GameplayStatics.h" #include "Kismet/GameplayStatics.h"
#include "UIFrontEndFlowSubsystem.h" #include "UIFrontEndFlowSubsystem.h"
#include "ZMMOThemeSubsystem.h" #include "ZeusThemeSubsystem.h"
#include "ZeusCharServerSubsystem.h" #include "ZeusCharServerSubsystem.h"
#include "ZeusPacketWriter.h" #include "ZeusPacketWriter.h"
#include "ZeusPacketReader.h" #include "ZeusPacketReader.h"
@@ -28,7 +28,7 @@ namespace
{ {
if (const UGameInstance* GI = Widget->GetGameInstance()) if (const UGameInstance* GI = Widget->GetGameInstance())
{ {
if (const UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>()) if (const UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
{ {
return Theme->GetActiveUIStyle(); return Theme->GetActiveUIStyle();
} }
@@ -198,12 +198,12 @@ void UUILoginScreen_Base::HandleLoginClicked()
SaveOrClearRememberedAccess(User); SaveOrClearRememberedAccess(User);
FZeusPacketWriter W; FZeusPacketWriter W;
W.WriteUInt8(ZMMOCharAuthMethod::PASSWORD); W.WriteUInt8(ZeusCharAuthMethod::PASSWORD);
W.WriteStringUtf8(User.TrimStartAndEnd()); W.WriteStringUtf8(User.TrimStartAndEnd());
W.WriteStringUtf8(Pass); W.WriteStringUtf8(Pass);
const bool bSent = Char->SendCharRequest( const bool bSent = Char->SendCharRequest(
ZMMOCharOp::C_CHAR_AUTH_REQUEST, W.GetBuffer()); ZeusCharOp::C_CHAR_AUTH_REQUEST, W.GetBuffer());
if (!bSent) if (!bSent)
{ {
UE_LOG(LogZMMO, Warning, TEXT("Login: falha ao enviar C_CHAR_AUTH_REQUEST.")); UE_LOG(LogZMMO, Warning, TEXT("Login: falha ao enviar C_CHAR_AUTH_REQUEST."));
@@ -235,7 +235,7 @@ void UUILoginScreen_Base::HandleCharRawMessage(int32 Opcode, const TArray<uint8>
return; // só nos interessa a resposta do auth que disparamos return; // só nos interessa a resposta do auth que disparamos
} }
if (Opcode == ZMMOCharOp::S_CHAR_AUTH_OK) if (Opcode == ZeusCharOp::S_CHAR_AUTH_OK)
{ {
bAwaitingAuth = false; bAwaitingAuth = false;
FZeusPacketReader R(Payload.GetData(), Payload.Num()); FZeusPacketReader R(Payload.GetData(), Payload.Num());
@@ -255,7 +255,7 @@ void UUILoginScreen_Base::HandleCharRawMessage(int32 Opcode, const TArray<uint8>
} }
} }
} }
else if (Opcode == ZMMOCharOp::S_CHAR_AUTH_REJECT) else if (Opcode == ZeusCharOp::S_CHAR_AUTH_REJECT)
{ {
bAwaitingAuth = false; bAwaitingAuth = false;
FZeusPacketReader R(Payload.GetData(), Payload.Num()); FZeusPacketReader R(Payload.GetData(), Payload.Num());
@@ -267,11 +267,11 @@ void UUILoginScreen_Base::HandleCharRawMessage(int32 Opcode, const TArray<uint8>
FText Message; FText Message;
switch (Reason) switch (Reason)
{ {
case ZMMOCharRejectReason::InvalidCredentials: Message = InvalidCredentialsText; break; case ZeusCharRejectReason::InvalidCredentials: Message = InvalidCredentialsText; break;
case ZMMOCharRejectReason::AccountLocked: Message = AccountLockedText; break; case ZeusCharRejectReason::AccountLocked: Message = AccountLockedText; break;
case ZMMOCharRejectReason::AccountSuspended: Message = AccountSuspendedText; break; case ZeusCharRejectReason::AccountSuspended: Message = AccountSuspendedText; break;
case ZMMOCharRejectReason::AccountBanned: Message = AccountSuspendedText; break; case ZeusCharRejectReason::AccountBanned: Message = AccountSuspendedText; break;
case ZMMOCharRejectReason::CredentialsAuthDisabled: Message = CredentialsDisabledText; break; case ZeusCharRejectReason::CredentialsAuthDisabled: Message = CredentialsDisabledText; break;
default: default:
Message = FText::Format( Message = FText::Format(
NSLOCTEXT("ZMMO", "LoginRejectFmt", "{0} (cód. {1})"), NSLOCTEXT("ZMMO", "LoginRejectFmt", "{0} (cód. {1})"),
@@ -285,7 +285,7 @@ void UUILoginScreen_Base::HandleCharRawMessage(int32 Opcode, const TArray<uint8>
void UUILoginScreen_Base::LoadRememberedAccess() void UUILoginScreen_Base::LoadRememberedAccess()
{ {
if (!UGameplayStatics::DoesSaveGameExist( if (!UGameplayStatics::DoesSaveGameExist(
UZMMOLoginSaveGame::SlotName, UZMMOLoginSaveGame::UserIndex)) UZeusLoginSaveGame::SlotName, UZeusLoginSaveGame::UserIndex))
{ {
return; return;
} }
@@ -294,13 +294,13 @@ void UUILoginScreen_Base::LoadRememberedAccess()
Delegate.BindUFunction(this, Delegate.BindUFunction(this,
FName(TEXT("HandleLoadLoginCacheCompleted"))); FName(TEXT("HandleLoadLoginCacheCompleted")));
UGameplayStatics::AsyncLoadGameFromSlot( UGameplayStatics::AsyncLoadGameFromSlot(
UZMMOLoginSaveGame::SlotName, UZMMOLoginSaveGame::UserIndex, Delegate); UZeusLoginSaveGame::SlotName, UZeusLoginSaveGame::UserIndex, Delegate);
} }
void UUILoginScreen_Base::HandleLoadLoginCacheCompleted(const FString& /*InSlotName*/, void UUILoginScreen_Base::HandleLoadLoginCacheCompleted(const FString& /*InSlotName*/,
int32 /*InUserIndex*/, USaveGame* LoadedGame) int32 /*InUserIndex*/, USaveGame* LoadedGame)
{ {
const UZMMOLoginSaveGame* Save = Cast<UZMMOLoginSaveGame>(LoadedGame); const UZeusLoginSaveGame* Save = Cast<UZeusLoginSaveGame>(LoadedGame);
if (!Save || !Save->bRememberAccess || Save->SavedUsername.IsEmpty()) if (!Save || !Save->bRememberAccess || Save->SavedUsername.IsEmpty())
{ {
return; return;
@@ -320,21 +320,21 @@ void UUILoginScreen_Base::SaveOrClearRememberedAccess(const FString& User)
const bool bRemember = RememberAccess ? RememberAccess->IsChecked() : false; const bool bRemember = RememberAccess ? RememberAccess->IsChecked() : false;
if (bRemember) if (bRemember)
{ {
UZMMOLoginSaveGame* Save = Cast<UZMMOLoginSaveGame>( UZeusLoginSaveGame* Save = Cast<UZeusLoginSaveGame>(
UGameplayStatics::CreateSaveGameObject(UZMMOLoginSaveGame::StaticClass())); UGameplayStatics::CreateSaveGameObject(UZeusLoginSaveGame::StaticClass()));
if (Save) if (Save)
{ {
Save->SavedUsername = User.TrimStartAndEnd(); Save->SavedUsername = User.TrimStartAndEnd();
Save->bRememberAccess = true; Save->bRememberAccess = true;
UGameplayStatics::AsyncSaveGameToSlot( UGameplayStatics::AsyncSaveGameToSlot(
Save, UZMMOLoginSaveGame::SlotName, UZMMOLoginSaveGame::UserIndex); Save, UZeusLoginSaveGame::SlotName, UZeusLoginSaveGame::UserIndex);
} }
} }
else if (UGameplayStatics::DoesSaveGameExist( else if (UGameplayStatics::DoesSaveGameExist(
UZMMOLoginSaveGame::SlotName, UZMMOLoginSaveGame::UserIndex)) UZeusLoginSaveGame::SlotName, UZeusLoginSaveGame::UserIndex))
{ {
// Checkbox desmarcada: apaga save antigo (não vamos lembrar mais). // Checkbox desmarcada: apaga save antigo (não vamos lembrar mais).
UGameplayStatics::DeleteGameInSlot( UGameplayStatics::DeleteGameInSlot(
UZMMOLoginSaveGame::SlotName, UZMMOLoginSaveGame::UserIndex); UZeusLoginSaveGame::SlotName, UZeusLoginSaveGame::UserIndex);
} }
} }

View File

@@ -8,10 +8,10 @@ void UUIPrimaryGameLayout_Base::NativeOnInitialized()
{ {
Super::NativeOnInitialized(); Super::NativeOnInitialized();
RegisterLayer(ZMMOUITags::UI_Layer_Game, Stack_Game); RegisterLayer(ZeusUITags::UI_Layer_Game, Stack_Game);
RegisterLayer(ZMMOUITags::UI_Layer_GameMenu, Stack_GameMenu); RegisterLayer(ZeusUITags::UI_Layer_GameMenu, Stack_GameMenu);
RegisterLayer(ZMMOUITags::UI_Layer_Menu, Stack_Menu); RegisterLayer(ZeusUITags::UI_Layer_Menu, Stack_Menu);
RegisterLayer(ZMMOUITags::UI_Layer_Modal, Stack_Modal); RegisterLayer(ZeusUITags::UI_Layer_Modal, Stack_Modal);
} }
void UUIPrimaryGameLayout_Base::RegisterLayer(FGameplayTag LayerTag, UCommonActivatableWidgetStack* Stack) void UUIPrimaryGameLayout_Base::RegisterLayer(FGameplayTag LayerTag, UCommonActivatableWidgetStack* Stack)

View File

@@ -41,7 +41,7 @@ void UUIServerCard_Base::NativeDestruct()
Super::NativeDestruct(); Super::NativeDestruct();
} }
void UUIServerCard_Base::SetFromEntry(const FZMMORealmEntry& InEntry) void UUIServerCard_Base::SetFromEntry(const FZeusRealmEntry& InEntry)
{ {
Entry = InEntry; Entry = InEntry;

View File

@@ -2,7 +2,7 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "Blueprint/UserWidget.h" #include "Blueprint/UserWidget.h"
#include "ZMMORealmEntry.h" #include "ZeusRealmEntry.h"
#include "UIServerCard_Base.generated.h" #include "UIServerCard_Base.generated.h"
class UCommonTextBlock; class UCommonTextBlock;
@@ -13,7 +13,7 @@ class UProgressBar;
/** /**
* Card de servidor (realm) instanciado dinamicamente pela ServerSelect. * Card de servidor (realm) instanciado dinamicamente pela ServerSelect.
* *
* Recebe um `FZMMORealmEntry` e renderiza nome/pop/status/bar; ao clicar * Recebe um `FZeusRealmEntry` e renderiza nome/pop/status/bar; ao clicar
* em "Entrar" dispara `OnCardPressed.Broadcast(RealmId, State)`. A tela * em "Entrar" dispara `OnCardPressed.Broadcast(RealmId, State)`. A tela
* dona (UUIServerSelectScreen_Base) escuta esse delegate. * dona (UUIServerSelectScreen_Base) escuta esse delegate.
* *
@@ -25,7 +25,7 @@ class UProgressBar;
* - Btn_Enter : Button * - Btn_Enter : Button
* - Bar_Pop : ProgressBar (opcional) * - Bar_Pop : ProgressBar (opcional)
*/ */
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FZMMOOnServerCardPressed, FString, RealmId, uint8, State); DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FZeusOnServerCardPressed, FString, RealmId, uint8, State);
UCLASS(Abstract, Blueprintable) UCLASS(Abstract, Blueprintable)
class ZMMO_API UUIServerCard_Base : public UUserWidget class ZMMO_API UUIServerCard_Base : public UUserWidget
@@ -37,18 +37,18 @@ public:
* Aplica os dados de um realm no card. * Aplica os dados de um realm no card.
*/ */
UFUNCTION(BlueprintCallable, Category = "Zeus|ServerCard") UFUNCTION(BlueprintCallable, Category = "Zeus|ServerCard")
void SetFromEntry(const FZMMORealmEntry& Entry); void SetFromEntry(const FZeusRealmEntry& Entry);
/** Dados atuais (copia). */ /** Dados atuais (copia). */
UPROPERTY(BlueprintReadOnly, Category = "Zeus|ServerCard") UPROPERTY(BlueprintReadOnly, Category = "Zeus|ServerCard")
FZMMORealmEntry Entry; FZeusRealmEntry Entry;
/** /**
* Disparado quando o botao "Entrar" do card e clicado. * Disparado quando o botao "Entrar" do card e clicado.
* State e o wire state (0=Offline, 1=Online, 2=Maintenance). * State e o wire state (0=Offline, 1=Online, 2=Maintenance).
*/ */
UPROPERTY(BlueprintAssignable, Category = "Zeus|ServerCard") UPROPERTY(BlueprintAssignable, Category = "Zeus|ServerCard")
FZMMOOnServerCardPressed OnCardPressed; FZeusOnServerCardPressed OnCardPressed;
protected: protected:
virtual void NativePreConstruct() override; virtual void NativePreConstruct() override;

View File

@@ -1,7 +1,7 @@
#include "UIServerSelectScreen_Base.h" #include "UIServerSelectScreen_Base.h"
#include "ZMMO.h" #include "ZMMO.h"
#include "ZMMOThemeSubsystem.h" #include "ZeusThemeSubsystem.h"
#include "CharServerOpcodes.h" #include "CharServerOpcodes.h"
#include "UIFrontEndFlowSubsystem.h" #include "UIFrontEndFlowSubsystem.h"
#include "UIServerCard_Base.h" #include "UIServerCard_Base.h"
@@ -16,9 +16,9 @@
#include "Engine/DataTable.h" #include "Engine/DataTable.h"
#include "UI/UIStyleRow.h" #include "UI/UIStyleRow.h"
using ZMMOWire::ReadU8; using ZeusWire::ReadU8;
using ZMMOWire::ReadU16; using ZeusWire::ReadU16;
using ZMMOWire::ReadStringUtf8; using ZeusWire::ReadStringUtf8;
namespace namespace
{ {
@@ -28,7 +28,7 @@ namespace
{ {
if (const UGameInstance* GI = Widget->GetGameInstance()) if (const UGameInstance* GI = Widget->GetGameInstance())
{ {
if (const UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>()) if (const UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
{ {
return Theme->GetActiveUIStyle(); return Theme->GetActiveUIStyle();
} }
@@ -119,7 +119,7 @@ void UUIServerSelectScreen_Base::RequestRealmList()
return; return;
} }
TArray<uint8> EmptyPayload; TArray<uint8> EmptyPayload;
Char->SendCharRequest(ZMMOCharOp::C_REALM_LIST_REQUEST, EmptyPayload); Char->SendCharRequest(ZeusCharOp::C_REALM_LIST_REQUEST, EmptyPayload);
} }
void UUIServerSelectScreen_Base::SelectRealmAndProceed(const FString& RealmId) void UUIServerSelectScreen_Base::SelectRealmAndProceed(const FString& RealmId)
@@ -137,17 +137,17 @@ void UUIServerSelectScreen_Base::SelectRealmAndProceed(const FString& RealmId)
if (UUIFrontEndFlowSubsystem* Flow = GI->GetSubsystem<UUIFrontEndFlowSubsystem>()) if (UUIFrontEndFlowSubsystem* Flow = GI->GetSubsystem<UUIFrontEndFlowSubsystem>())
{ {
Flow->SetSelectedRealmId(RealmId); Flow->SetSelectedRealmId(RealmId);
Flow->SetState(EZMMOFrontEndState::Lobby); Flow->SetState(EZeusFrontEndState::Lobby);
} }
} }
void UUIServerSelectScreen_Base::HandleCharRawMessage(int32 Opcode, const TArray<uint8>& Payload) void UUIServerSelectScreen_Base::HandleCharRawMessage(int32 Opcode, const TArray<uint8>& Payload)
{ {
if (Opcode == ZMMOCharOp::S_REALM_LIST) if (Opcode == ZeusCharOp::S_REALM_LIST)
{ {
ParseRealmList(Payload); ParseRealmList(Payload);
} }
else if (Opcode == ZMMOCharOp::S_REALM_STATUS_UPDATE) else if (Opcode == ZeusCharOp::S_REALM_STATUS_UPDATE)
{ {
ApplyStatusUpdate(Payload); ApplyStatusUpdate(Payload);
} }
@@ -186,7 +186,7 @@ void UUIServerSelectScreen_Base::ApplyStatusUpdate(const TArray<uint8>& Payload)
RequestRealmList(); RequestRealmList();
return; return;
} }
FZMMORealmEntry& Entry = Realms[Idx]; FZeusRealmEntry& Entry = Realms[Idx];
Entry.Pop = static_cast<int32>(Pop); Entry.Pop = static_cast<int32>(Pop);
Entry.QueueLen = static_cast<int32>(QueueLen); Entry.QueueLen = static_cast<int32>(QueueLen);
Entry.State = State; Entry.State = State;
@@ -210,12 +210,12 @@ void UUIServerSelectScreen_Base::ParseRealmList(const TArray<uint8>& Payload)
return; return;
} }
TArray<FZMMORealmEntry> NewRealms; TArray<FZeusRealmEntry> NewRealms;
NewRealms.Reserve(Count); NewRealms.Reserve(Count);
for (uint16 i = 0; i < Count; ++i) for (uint16 i = 0; i < Count; ++i)
{ {
FZMMORealmEntry Entry; FZeusRealmEntry Entry;
FString RegionStr; FString RegionStr;
uint16 Cap = 0; uint16 Cap = 0;
uint16 Pop = 0; uint16 Pop = 0;
@@ -280,7 +280,7 @@ void UUIServerSelectScreen_Base::RebuildCards()
const int32 GridColumns = 2; // bate com o mock (ColumnFill[0]/[1]) const int32 GridColumns = 2; // bate com o mock (ColumnFill[0]/[1])
int32 Index = 0; int32 Index = 0;
for (const FZMMORealmEntry& R : Realms) for (const FZeusRealmEntry& R : Realms)
{ {
UUIServerCard_Base* Card = CreateWidget<UUIServerCard_Base>(this, CardClass); UUIServerCard_Base* Card = CreateWidget<UUIServerCard_Base>(this, CardClass);
if (!Card) if (!Card)

View File

@@ -2,7 +2,7 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "UIActivatableScreen_Base.h" #include "UIActivatableScreen_Base.h"
#include "ZMMORealmEntry.h" #include "ZeusRealmEntry.h"
#include "UIServerSelectScreen_Base.generated.h" #include "UIServerSelectScreen_Base.generated.h"
class UCommonTextBlock; class UCommonTextBlock;
@@ -35,7 +35,7 @@ public:
void SelectRealmAndProceed(const FString& RealmId); void SelectRealmAndProceed(const FString& RealmId);
UPROPERTY(BlueprintReadOnly, Category = "Zeus|ServerSelect") UPROPERTY(BlueprintReadOnly, Category = "Zeus|ServerSelect")
TArray<FZMMORealmEntry> Realms; TArray<FZeusRealmEntry> Realms;
UFUNCTION(BlueprintImplementableEvent, Category = "Zeus|ServerSelect") UFUNCTION(BlueprintImplementableEvent, Category = "Zeus|ServerSelect")
void OnRealmListReceived(); void OnRealmListReceived();

View File

@@ -14,14 +14,14 @@
#include "Engine/GameInstance.h" #include "Engine/GameInstance.h"
#include "UI/Widgets/UIButton_Base.h" #include "UI/Widgets/UIButton_Base.h"
using ZMMOWire::ReadU8; using ZeusWire::ReadU8;
using ZMMOWire::ReadU16; using ZeusWire::ReadU16;
using ZMMOWire::ReadU32; using ZeusWire::ReadU32;
using ZMMOWire::ReadU64; using ZeusWire::ReadU64;
using ZMMOWire::ReadFloat; using ZeusWire::ReadFloat;
using ZMMOWire::ReadStringUtf8; using ZeusWire::ReadStringUtf8;
using ZMMOWire::ReadUuid16; using ZeusWire::ReadUuid16;
using ZMMOWire::WriteUuid16; using ZeusWire::WriteUuid16;
void UUIUserLobbyScreen_Base::NativeOnActivated() void UUIUserLobbyScreen_Base::NativeOnActivated()
{ {
@@ -91,7 +91,7 @@ void UUIUserLobbyScreen_Base::RequestCharList()
Payload.Add(0); Payload.Add(0);
} }
} }
Char->SendCharRequest(ZMMOCharOp::C_CHAR_LIST_REQUEST, Payload); Char->SendCharRequest(ZeusCharOp::C_CHAR_LIST_REQUEST, Payload);
} }
void UUIUserLobbyScreen_Base::ShowCharSelectPage() void UUIUserLobbyScreen_Base::ShowCharSelectPage()
@@ -111,7 +111,7 @@ void UUIUserLobbyScreen_Base::BackToServerSelect()
if (UUIFrontEndFlowSubsystem* Flow = GI->GetSubsystem<UUIFrontEndFlowSubsystem>()) if (UUIFrontEndFlowSubsystem* Flow = GI->GetSubsystem<UUIFrontEndFlowSubsystem>())
{ {
Flow->ClearSelectedRealm(); Flow->ClearSelectedRealm();
Flow->SetState(EZMMOFrontEndState::ServerSelect); Flow->SetState(EZeusFrontEndState::ServerSelect);
} }
} }
@@ -119,14 +119,14 @@ void UUIUserLobbyScreen_Base::HandleCharRawMessage(int32 Opcode, const TArray<ui
{ {
switch (Opcode) switch (Opcode)
{ {
case ZMMOCharOp::S_CHAR_LIST: ParseCharList(Payload); break; case ZeusCharOp::S_CHAR_LIST: ParseCharList(Payload); break;
case ZMMOCharOp::S_CHAR_SELECT_OK: HandleCharSelectOk(Payload); break; case ZeusCharOp::S_CHAR_SELECT_OK: HandleCharSelectOk(Payload); break;
case ZMMOCharOp::S_CHAR_SELECT_REJECT: HandleCharSelectReject(Payload); break; case ZeusCharOp::S_CHAR_SELECT_REJECT: HandleCharSelectReject(Payload); break;
case ZMMOCharOp::S_CHAR_CREATE_OK: HandleCharCreateOk(Payload); break; case ZeusCharOp::S_CHAR_CREATE_OK: HandleCharCreateOk(Payload); break;
case ZMMOCharOp::S_CHAR_CREATE_REJECT: HandleCharCreateReject(Payload); break; case ZeusCharOp::S_CHAR_CREATE_REJECT: HandleCharCreateReject(Payload); break;
case ZMMOCharOp::S_CHAR_DELETE_ACK: HandleCharDeleteAck(Payload); break; case ZeusCharOp::S_CHAR_DELETE_ACK: HandleCharDeleteAck(Payload); break;
case ZMMOCharOp::S_CHAR_DELETE_ACCEPT_ACK: HandleCharDeleteAcceptAck(Payload); break; case ZeusCharOp::S_CHAR_DELETE_ACCEPT_ACK: HandleCharDeleteAcceptAck(Payload); break;
case ZMMOCharOp::S_CHAR_DELETE_CANCEL_ACK: HandleCharDeleteCancelAck(Payload); break; case ZeusCharOp::S_CHAR_DELETE_CANCEL_ACK: HandleCharDeleteCancelAck(Payload); break;
default: break; default: break;
} }
} }
@@ -141,12 +141,12 @@ void UUIUserLobbyScreen_Base::ParseCharList(const TArray<uint8>& Payload)
return; return;
} }
TArray<FZMMOCharSummary> New; TArray<FZeusCharSummary> New;
New.Reserve(Count); New.Reserve(Count);
for (uint16 i = 0; i < Count; ++i) for (uint16 i = 0; i < Count; ++i)
{ {
FZMMOCharSummary E; FZeusCharSummary E;
uint64 charId64 = 0; uint64 charId64 = 0;
uint8 slot = 0; uint8 slot = 0;
uint16 classId = 0; uint16 classId = 0;
@@ -222,7 +222,7 @@ void UUIUserLobbyScreen_Base::RebuildCards()
SpawnedCards.Reset(); SpawnedCards.Reset();
CardContainer->ClearChildren(); CardContainer->ClearChildren();
for (const FZMMOCharSummary& C : Chars) for (const FZeusCharSummary& C : Chars)
{ {
UUICharCard_Base* Card = CreateWidget<UUICharCard_Base>(this, CharCardClass); UUICharCard_Base* Card = CreateWidget<UUICharCard_Base>(this, CharCardClass);
if (!Card) continue; if (!Card) continue;
@@ -246,25 +246,25 @@ void UUIUserLobbyScreen_Base::HandleCardSelected(FString CharId)
// Wire: uint64 charId // Wire: uint64 charId
TArray<uint8> Payload; TArray<uint8> Payload;
for (int32 i = 0; i < 8; ++i) Payload.Add(static_cast<uint8>((CharId64 >> (8 * i)) & 0xFF)); for (int32 i = 0; i < 8; ++i) Payload.Add(static_cast<uint8>((CharId64 >> (8 * i)) & 0xFF));
Char->SendCharRequest(ZMMOCharOp::C_CHAR_SELECT, Payload); Char->SendCharRequest(ZeusCharOp::C_CHAR_SELECT, Payload);
} }
void UUIUserLobbyScreen_Base::HandleCardDeleteRequest(FString CharId) void UUIUserLobbyScreen_Base::HandleCardDeleteRequest(FString CharId)
{ {
UE_LOG(LogZMMO, Log, TEXT("Lobby: DELETE_REQUEST char %s"), *CharId); UE_LOG(LogZMMO, Log, TEXT("Lobby: DELETE_REQUEST char %s"), *CharId);
SendCharIdOpcode(ZMMOCharOp::C_CHAR_DELETE_REQUEST, CharId); SendCharIdOpcode(ZeusCharOp::C_CHAR_DELETE_REQUEST, CharId);
} }
void UUIUserLobbyScreen_Base::HandleCardAcceptDeleteRequest(FString CharId) void UUIUserLobbyScreen_Base::HandleCardAcceptDeleteRequest(FString CharId)
{ {
UE_LOG(LogZMMO, Log, TEXT("Lobby: DELETE_ACCEPT char %s"), *CharId); UE_LOG(LogZMMO, Log, TEXT("Lobby: DELETE_ACCEPT char %s"), *CharId);
SendCharIdOpcode(ZMMOCharOp::C_CHAR_DELETE_ACCEPT, CharId); SendCharIdOpcode(ZeusCharOp::C_CHAR_DELETE_ACCEPT, CharId);
} }
void UUIUserLobbyScreen_Base::HandleCardCancelDeleteRequest(FString CharId) void UUIUserLobbyScreen_Base::HandleCardCancelDeleteRequest(FString CharId)
{ {
UE_LOG(LogZMMO, Log, TEXT("Lobby: DELETE_CANCEL char %s"), *CharId); UE_LOG(LogZMMO, Log, TEXT("Lobby: DELETE_CANCEL char %s"), *CharId);
SendCharIdOpcode(ZMMOCharOp::C_CHAR_DELETE_CANCEL, CharId); SendCharIdOpcode(ZeusCharOp::C_CHAR_DELETE_CANCEL, CharId);
} }
void UUIUserLobbyScreen_Base::SendCharIdOpcode(int32 Opcode, const FString& CharId) void UUIUserLobbyScreen_Base::SendCharIdOpcode(int32 Opcode, const FString& CharId)
@@ -373,8 +373,8 @@ void UUIUserLobbyScreen_Base::HandleCharSelectOk(const TArray<uint8>& Payload)
UUIFrontEndFlowSubsystem* Flow = GI->GetSubsystem<UUIFrontEndFlowSubsystem>(); UUIFrontEndFlowSubsystem* Flow = GI->GetSubsystem<UUIFrontEndFlowSubsystem>();
if (Flow) if (Flow)
{ {
Flow->SetState(EZMMOFrontEndState::EnteringWorld); Flow->SetState(EZeusFrontEndState::EnteringWorld);
// Memoriza pose pra `AZMMOPlayerCharacter::BeginPlay` reposicionar // Memoriza pose pra `AZeusCharacter::BeginPlay` reposicionar
// o pawn local na pos salva no DB (em vez do PlayerStart default). // o pawn local na pos salva no DB (em vez do PlayerStart default).
Flow->SetPendingSpawnPose(FVector(Px, Py, Pz), Yaw); Flow->SetPendingSpawnPose(FVector(Px, Py, Pz), Yaw);
} }

View File

@@ -2,7 +2,7 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "UIActivatableScreen_Base.h" #include "UIActivatableScreen_Base.h"
#include "ZMMOCharSummary.h" #include "ZeusCharSummary.h"
#include "UIUserLobbyScreen_Base.generated.h" #include "UIUserLobbyScreen_Base.generated.h"
class UCommonTextBlock; class UCommonTextBlock;
@@ -49,7 +49,7 @@ public:
void BackToServerSelect(); void BackToServerSelect();
UPROPERTY(BlueprintReadOnly, Category = "Zeus|Lobby") UPROPERTY(BlueprintReadOnly, Category = "Zeus|Lobby")
TArray<FZMMOCharSummary> Chars; TArray<FZeusCharSummary> Chars;
UFUNCTION(BlueprintImplementableEvent, Category = "Zeus|Lobby") UFUNCTION(BlueprintImplementableEvent, Category = "Zeus|Lobby")
void OnCharListReceived(); void OnCharListReceived();

View File

@@ -8,7 +8,7 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
namespace ZMMOWire namespace ZeusWire
{ {
inline bool ReadU8(const TArray<uint8>& Buf, int32& Pos, uint8& Out) inline bool ReadU8(const TArray<uint8>& Buf, int32& Pos, uint8& Out)
{ {

View File

@@ -1,3 +0,0 @@
#include "ZMMOLoginSaveGame.h"
const FString UZMMOLoginSaveGame::SlotName = TEXT("LoginCache");

View File

@@ -1,11 +1,11 @@
#pragma once #pragma once
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "ZMMOCharSummary.generated.h" #include "ZeusCharSummary.generated.h"
/** Stats primarios do personagem (espelha `CharStats` em char.types.ts). */ /** Stats primarios do personagem (espelha `CharStats` em char.types.ts). */
USTRUCT(BlueprintType) USTRUCT(BlueprintType)
struct FZMMOCharStats struct FZeusCharStats
{ {
GENERATED_BODY() GENERATED_BODY()
@@ -19,7 +19,7 @@ struct FZMMOCharStats
/** Aparencia (espelha `CharAppearance` em char.types.ts). */ /** Aparencia (espelha `CharAppearance` em char.types.ts). */
USTRUCT(BlueprintType) USTRUCT(BlueprintType)
struct FZMMOCharAppearance struct FZeusCharAppearance
{ {
GENERATED_BODY() GENERATED_BODY()
@@ -34,7 +34,7 @@ struct FZMMOCharAppearance
* Espelha `CharSummary` em `Server/ZeusCharServer/src/types/char.types.ts`. * Espelha `CharSummary` em `Server/ZeusCharServer/src/types/char.types.ts`.
*/ */
USTRUCT(BlueprintType) USTRUCT(BlueprintType)
struct FZMMOCharSummary struct FZeusCharSummary
{ {
GENERATED_BODY() GENERATED_BODY()
@@ -67,7 +67,7 @@ struct FZMMOCharSummary
int32 JobExp = 0; int32 JobExp = 0;
UPROPERTY(BlueprintReadOnly, Category = "Zeus|Char") UPROPERTY(BlueprintReadOnly, Category = "Zeus|Char")
FZMMOCharStats Stats; FZeusCharStats Stats;
UPROPERTY(BlueprintReadOnly, Category = "Zeus|Char") UPROPERTY(BlueprintReadOnly, Category = "Zeus|Char")
int32 Hp = 0; int32 Hp = 0;
@@ -95,7 +95,7 @@ struct FZMMOCharSummary
float YawDeg = 0.f; float YawDeg = 0.f;
UPROPERTY(BlueprintReadOnly, Category = "Zeus|Char") UPROPERTY(BlueprintReadOnly, Category = "Zeus|Char")
FZMMOCharAppearance Appearance; FZeusCharAppearance Appearance;
/** Epoch ms em que o delete vai efetivar. 0 = nao agendado. */ /** Epoch ms em que o delete vai efetivar. 0 = nao agendado. */
UPROPERTY(BlueprintReadOnly, Category = "Zeus|Char") UPROPERTY(BlueprintReadOnly, Category = "Zeus|Char")

View File

@@ -0,0 +1,3 @@
#include "ZeusLoginSaveGame.h"
const FString UZeusLoginSaveGame::SlotName = TEXT("LoginCache");

View File

@@ -2,7 +2,7 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "GameFramework/SaveGame.h" #include "GameFramework/SaveGame.h"
#include "ZMMOLoginSaveGame.generated.h" #include "ZeusLoginSaveGame.generated.h"
/** /**
* Cache local da tela de Login. Persiste APENAS o nome do usuário (texto * Cache local da tela de Login. Persiste APENAS o nome do usuário (texto
@@ -18,7 +18,7 @@
* UPROPERTY não-Transient via UE serializer). * UPROPERTY não-Transient via UE serializer).
*/ */
UCLASS() UCLASS()
class ZMMO_API UZMMOLoginSaveGame : public USaveGame class ZMMO_API UZeusLoginSaveGame : public USaveGame
{ {
GENERATED_BODY() GENERATED_BODY()

View File

@@ -1,7 +1,7 @@
#pragma once #pragma once
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "ZMMORealmEntry.generated.h" #include "ZeusRealmEntry.generated.h"
/** /**
* Entrada de Realm (cluster Gateway+Provinces) recebida do CharServer via * Entrada de Realm (cluster Gateway+Provinces) recebida do CharServer via
@@ -13,10 +13,10 @@
* anterior). Cliente faz split por `:` quando precisa abrir UDP. * anterior). Cliente faz split por `:` quando precisa abrir UDP.
* *
* State usa o wire raw (0=Offline, 1=Online, 2=Maintenance ver * State usa o wire raw (0=Offline, 1=Online, 2=Maintenance ver
* ZMMOWireRealmState em CharServerOpcodes.h). * ZeusWireRealmState em CharServerOpcodes.h).
*/ */
USTRUCT(BlueprintType) USTRUCT(BlueprintType)
struct FZMMORealmEntry struct FZeusRealmEntry
{ {
GENERATED_BODY() GENERATED_BODY()
@@ -42,7 +42,7 @@ struct FZMMORealmEntry
UPROPERTY(BlueprintReadOnly, Category = "Zeus|Realm") UPROPERTY(BlueprintReadOnly, Category = "Zeus|Realm")
int32 QueueLen = 0; int32 QueueLen = 0;
/** 0=Offline, 1=Online, 2=Maintenance (vide ZMMOWireRealmState). */ /** 0=Offline, 1=Online, 2=Maintenance (vide ZeusWireRealmState). */
UPROPERTY(BlueprintReadOnly, Category = "Zeus|Realm") UPROPERTY(BlueprintReadOnly, Category = "Zeus|Realm")
uint8 State = 0; uint8 State = 0;
}; };

View File

@@ -21,13 +21,13 @@ void UUIInGameFlowSubsystem::Initialize(FSubsystemCollectionBase& Collection)
void UUIInGameFlowSubsystem::Deinitialize() void UUIInGameFlowSubsystem::Deinitialize()
{ {
ScreenSet = nullptr; ScreenSet = nullptr;
CurrentState = EZMMOInGameUIState::None; CurrentState = EZeusInGameUIState::None;
Super::Deinitialize(); Super::Deinitialize();
} }
void UUIInGameFlowSubsystem::StartInGame() void UUIInGameFlowSubsystem::StartInGame()
{ {
if (CurrentState != EZMMOInGameUIState::None) if (CurrentState != EZeusInGameUIState::None)
{ {
// Idempotente: chamadas extras (ex.: respawn) sao no-op se ja in-world. // Idempotente: chamadas extras (ex.: respawn) sao no-op se ja in-world.
UE_LOG(LogZMMO, Verbose, UE_LOG(LogZMMO, Verbose,
@@ -55,22 +55,22 @@ void UUIInGameFlowSubsystem::StartInGame()
// dialogs orfaos do handoff). Layer.Game vai receber o HUD novo. // dialogs orfaos do handoff). Layer.Game vai receber o HUD novo.
if (UUIManagerSubsystem* Mgr = GetUIManager()) if (UUIManagerSubsystem* Mgr = GetUIManager())
{ {
Mgr->ClearLayer(ZMMOUITags::UI_Layer_Menu.GetTag()); Mgr->ClearLayer(ZeusUITags::UI_Layer_Menu.GetTag());
Mgr->ClearLayer(ZMMOUITags::UI_Layer_Modal.GetTag()); Mgr->ClearLayer(ZeusUITags::UI_Layer_Modal.GetTag());
Mgr->ClearLayer(ZMMOUITags::UI_Layer_GameMenu.GetTag()); Mgr->ClearLayer(ZeusUITags::UI_Layer_GameMenu.GetTag());
} }
SetState(EZMMOInGameUIState::Playing); SetState(EZeusInGameUIState::Playing);
} }
void UUIInGameFlowSubsystem::SetState(EZMMOInGameUIState NewState) void UUIInGameFlowSubsystem::SetState(EZeusInGameUIState NewState)
{ {
if (NewState == CurrentState) if (NewState == CurrentState)
{ {
return; return;
} }
const EZMMOInGameUIState OldState = CurrentState; const EZeusInGameUIState OldState = CurrentState;
CurrentState = NewState; CurrentState = NewState;
UE_LOG(LogZMMO, Log, TEXT("InGameFlow: state %s -> %s"), UE_LOG(LogZMMO, Log, TEXT("InGameFlow: state %s -> %s"),
@@ -81,12 +81,12 @@ void UUIInGameFlowSubsystem::SetState(EZMMOInGameUIState NewState)
// (Status/Inventory/Menu) limpando o Layer.GameMenu — HUD em Layer.Game // (Status/Inventory/Menu) limpando o Layer.GameMenu — HUD em Layer.Game
// permanece. Para qualquer outro estado, mantemos HUD e empilhamos no // permanece. Para qualquer outro estado, mantemos HUD e empilhamos no
// layer correspondente. // layer correspondente.
const bool bGoingToPlaying = (NewState == EZMMOInGameUIState::Playing); const bool bGoingToPlaying = (NewState == EZeusInGameUIState::Playing);
if (UUIManagerSubsystem* Mgr = GetUIManager()) if (UUIManagerSubsystem* Mgr = GetUIManager())
{ {
if (bGoingToPlaying) if (bGoingToPlaying)
{ {
Mgr->ClearLayer(ZMMOUITags::UI_Layer_GameMenu.GetTag()); Mgr->ClearLayer(ZeusUITags::UI_Layer_GameMenu.GetTag());
} }
} }
@@ -95,8 +95,8 @@ void UUIInGameFlowSubsystem::SetState(EZMMOInGameUIState NewState)
// que o usuario fechar StatusWindow/Inventory/etc, o HUD seria recriado // que o usuario fechar StatusWindow/Inventory/etc, o HUD seria recriado
// — flicker em todos os textos (HP/SP/etc) por causa do Construct novo. // — flicker em todos os textos (HP/SP/etc) por causa do Construct novo.
const bool bSkipRepush = bGoingToPlaying const bool bSkipRepush = bGoingToPlaying
&& OldState != EZMMOInGameUIState::None && OldState != EZeusInGameUIState::None
&& OldState != EZMMOInGameUIState::Playing; && OldState != EZeusInGameUIState::Playing;
if (!bSkipRepush) if (!bSkipRepush)
{ {
ResolveAndPushScreen(NewState); ResolveAndPushScreen(NewState);
@@ -104,16 +104,16 @@ void UUIInGameFlowSubsystem::SetState(EZMMOInGameUIState NewState)
OnStateChanged.Broadcast(NewState); OnStateChanged.Broadcast(NewState);
} }
void UUIInGameFlowSubsystem::ToggleScreen(EZMMOInGameUIState Screen) void UUIInGameFlowSubsystem::ToggleScreen(EZeusInGameUIState Screen)
{ {
if (Screen == EZMMOInGameUIState::Playing || Screen == EZMMOInGameUIState::None) if (Screen == EZeusInGameUIState::Playing || Screen == EZeusInGameUIState::None)
{ {
// Toggle para Playing nao faz sentido (estado base). Use SetState direto. // Toggle para Playing nao faz sentido (estado base). Use SetState direto.
return; return;
} }
if (CurrentState == Screen) if (CurrentState == Screen)
{ {
SetState(EZMMOInGameUIState::Playing); SetState(EZeusInGameUIState::Playing);
} }
else else
{ {
@@ -148,26 +148,26 @@ UUIManagerSubsystem* UUIInGameFlowSubsystem::GetUIManager() const
return nullptr; return nullptr;
} }
FGameplayTag UUIInGameFlowSubsystem::LayerForState(EZMMOInGameUIState State) const FGameplayTag UUIInGameFlowSubsystem::LayerForState(EZeusInGameUIState State) const
{ {
switch (State) switch (State)
{ {
case EZMMOInGameUIState::Playing: case EZeusInGameUIState::Playing:
return ZMMOUITags::UI_Layer_Game.GetTag(); return ZeusUITags::UI_Layer_Game.GetTag();
case EZMMOInGameUIState::Loading: case EZeusInGameUIState::Loading:
return ZMMOUITags::UI_Layer_Modal.GetTag(); return ZeusUITags::UI_Layer_Modal.GetTag();
case EZMMOInGameUIState::StatusWindow: case EZeusInGameUIState::StatusWindow:
case EZMMOInGameUIState::Inventory: case EZeusInGameUIState::Inventory:
case EZMMOInGameUIState::SkillTree: case EZeusInGameUIState::SkillTree:
case EZMMOInGameUIState::EscapeMenu: case EZeusInGameUIState::EscapeMenu:
default: default:
return ZMMOUITags::UI_Layer_GameMenu.GetTag(); return ZeusUITags::UI_Layer_GameMenu.GetTag();
} }
} }
void UUIInGameFlowSubsystem::ResolveAndPushScreen(EZMMOInGameUIState State) void UUIInGameFlowSubsystem::ResolveAndPushScreen(EZeusInGameUIState State)
{ {
if (State == EZMMOInGameUIState::None) { return; } if (State == EZeusInGameUIState::None) { return; }
UUIInGameScreenSet* SS = GetScreenSet(); UUIInGameScreenSet* SS = GetScreenSet();
if (!SS) if (!SS)

View File

@@ -10,7 +10,7 @@ class UUIManagerSubsystem;
class UCommonActivatableWidget; class UCommonActivatableWidget;
struct FGameplayTag; struct FGameplayTag;
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnZMMOInGameStateChanged, EZMMOInGameUIState, NewState); DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnZeusInGameStateChanged, EZeusInGameUIState, NewState);
/** /**
* Orquestrador da UI in-game. Espelho simetrico do UUIFrontEndFlowSubsystem * Orquestrador da UI in-game. Espelho simetrico do UUIFrontEndFlowSubsystem
@@ -20,7 +20,7 @@ DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnZMMOInGameStateChanged, EZMMOInGa
* *
* UGameInstanceSubsystem pra persistir entre OpenLevel (futuro: trocar * UGameInstanceSubsystem pra persistir entre OpenLevel (futuro: trocar
* de mapa in-game preserva estado da UI). Inicializa em modo `None`; * de mapa in-game preserva estado da UI). Inicializa em modo `None`;
* caller (`AZMMOPlayerCharacter::HandleLocalSpawnReady`) chama * caller (`AZeusCharacter::HandleLocalSpawnReady`) chama
* `StartInGame()` ao confirmar spawn local, que vai pra `Playing`. * `StartInGame()` ao confirmar spawn local, que vai pra `Playing`.
* *
* Convencao de layer (resolvida internamente): * Convencao de layer (resolvida internamente):
@@ -30,7 +30,7 @@ DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnZMMOInGameStateChanged, EZMMOInGa
* - Loading -> UI.Layer.Modal * - Loading -> UI.Layer.Modal
* *
* Adicionar nova tela in-game = 3 passos: * Adicionar nova tela in-game = 3 passos:
* 1. Adicionar entry em `EZMMOInGameUIState` * 1. Adicionar entry em `EZeusInGameUIState`
* 2. Adicionar entry no DA_InGameScreenSet (estado -> WBP) * 2. Adicionar entry no DA_InGameScreenSet (estado -> WBP)
* 3. (se for em layer custom) adicionar caso em `LayerForState` * 3. (se for em layer custom) adicionar caso em `LayerForState`
* Subsystem nao precisa de mudancas. * Subsystem nao precisa de mudancas.
@@ -45,7 +45,7 @@ public:
virtual void Deinitialize() override; virtual void Deinitialize() override;
/** /**
* Ativa a UI in-game. Chamado pelo `AZMMOPlayerCharacter::HandleLocalSpawnReady` * Ativa a UI in-game. Chamado pelo `AZeusCharacter::HandleLocalSpawnReady`
* quando o servidor confirma o spawn local. Garante root layout, limpa * quando o servidor confirma o spawn local. Garante root layout, limpa
* layers do front-end (Menu/Modal residuais), e vai pra `Playing` (HUD). * layers do front-end (Menu/Modal residuais), e vai pra `Playing` (HUD).
*/ */
@@ -54,10 +54,10 @@ public:
/** Define o estado top-level. Resolve a tela do DA + push no layer correto. */ /** Define o estado top-level. Resolve a tela do DA + push no layer correto. */
UFUNCTION(BlueprintCallable, Category = "InGame|UI") UFUNCTION(BlueprintCallable, Category = "InGame|UI")
void SetState(EZMMOInGameUIState NewState); void SetState(EZeusInGameUIState NewState);
UFUNCTION(BlueprintPure, Category = "InGame|UI") UFUNCTION(BlueprintPure, Category = "InGame|UI")
EZMMOInGameUIState GetCurrentState() const { return CurrentState; } EZeusInGameUIState GetCurrentState() const { return CurrentState; }
/** /**
* Atalho UX: alterna entre `Playing` e a tela passada. Util pra teclas * Atalho UX: alterna entre `Playing` e a tela passada. Util pra teclas
@@ -65,11 +65,11 @@ public:
* Se ja' estiver em `Screen`, volta pra Playing; senao vai pra `Screen`. * Se ja' estiver em `Screen`, volta pra Playing; senao vai pra `Screen`.
*/ */
UFUNCTION(BlueprintCallable, Category = "InGame|UI") UFUNCTION(BlueprintCallable, Category = "InGame|UI")
void ToggleScreen(EZMMOInGameUIState Screen); void ToggleScreen(EZeusInGameUIState Screen);
/** Disparado a cada SetState bem-sucedido. */ /** Disparado a cada SetState bem-sucedido. */
UPROPERTY(BlueprintAssignable, Category = "InGame|UI") UPROPERTY(BlueprintAssignable, Category = "InGame|UI")
FOnZMMOInGameStateChanged OnStateChanged; FOnZeusInGameStateChanged OnStateChanged;
protected: protected:
/** DA com o mapa estado->tela. Config em DefaultGame.ini: /** DA com o mapa estado->tela. Config em DefaultGame.ini:
@@ -84,13 +84,13 @@ private:
UUIManagerSubsystem* GetUIManager() const; UUIManagerSubsystem* GetUIManager() const;
/** Retorna a layer tag onde a tela do estado deve ir. */ /** Retorna a layer tag onde a tela do estado deve ir. */
FGameplayTag LayerForState(EZMMOInGameUIState State) const; FGameplayTag LayerForState(EZeusInGameUIState State) const;
/** Resolve a soft class + push no layer apropriado (async load). */ /** Resolve a soft class + push no layer apropriado (async load). */
void ResolveAndPushScreen(EZMMOInGameUIState State); void ResolveAndPushScreen(EZeusInGameUIState State);
UPROPERTY(Transient) UPROPERTY(Transient)
EZMMOInGameUIState CurrentState = EZMMOInGameUIState::None; EZeusInGameUIState CurrentState = EZeusInGameUIState::None;
UPROPERTY(Transient) UPROPERTY(Transient)
TObjectPtr<UUIInGameScreenSet> ScreenSet; TObjectPtr<UUIInGameScreenSet> ScreenSet;

View File

@@ -1,6 +1,6 @@
#include "UIInGameScreenSet.h" #include "UIInGameScreenSet.h"
TSoftClassPtr<UCommonActivatableWidget> UUIInGameScreenSet::GetScreenForState(EZMMOInGameUIState State) const TSoftClassPtr<UCommonActivatableWidget> UUIInGameScreenSet::GetScreenForState(EZeusInGameUIState State) const
{ {
const TSoftClassPtr<UCommonActivatableWidget>* Found = StateScreens.Find(State); const TSoftClassPtr<UCommonActivatableWidget>* Found = StateScreens.Find(State);
return Found ? *Found : TSoftClassPtr<UCommonActivatableWidget>(); return Found ? *Found : TSoftClassPtr<UCommonActivatableWidget>();

View File

@@ -16,7 +16,7 @@ class UCommonActivatableWidget;
* Asset concreto: DA_InGameScreenSet em Content/ZMMO/UI/InGame/ * Asset concreto: DA_InGameScreenSet em Content/ZMMO/UI/InGame/
* (criado via MCP no editor). * (criado via MCP no editor).
* *
* Adicionar nova tela = adicionar entry em EZMMOInGameUIState + entry no DA * Adicionar nova tela = adicionar entry em EZeusInGameUIState + entry no DA
* + WBP herdando UCommonActivatableWidget. Subsystem nao muda. * + WBP herdando UCommonActivatableWidget. Subsystem nao muda.
*/ */
UCLASS(BlueprintType) UCLASS(BlueprintType)
@@ -27,9 +27,9 @@ class ZMMO_API UUIInGameScreenSet : public UDataAsset
public: public:
/** Tela por estado in-game. */ /** Tela por estado in-game. */
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "InGame") UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "InGame")
TMap<EZMMOInGameUIState, TSoftClassPtr<UCommonActivatableWidget>> StateScreens; TMap<EZeusInGameUIState, TSoftClassPtr<UCommonActivatableWidget>> StateScreens;
/** Soft class da tela do estado (vazio se nao configurado). */ /** Soft class da tela do estado (vazio se nao configurado). */
UFUNCTION(BlueprintCallable, Category = "InGame") UFUNCTION(BlueprintCallable, Category = "InGame")
TSoftClassPtr<UCommonActivatableWidget> GetScreenForState(EZMMOInGameUIState State) const; TSoftClassPtr<UCommonActivatableWidget> GetScreenForState(EZeusInGameUIState State) const;
}; };

View File

@@ -1,181 +0,0 @@
#include "ZMMOHudWidget.h"
#include "Components/TextBlock.h"
#include "Components/Widget.h"
#include "CommonInputTypeEnum.h" // ECommonInputMode
#include "Engine/World.h"
#include "GameFramework/PlayerController.h"
#include "GameFramework/PlayerState.h"
#include "TimerManager.h"
#include "ZMMO.h"
#include "ZMMOAttributeComponent.h"
#include "ZMMOHudHpSpWidget.h"
#include "ZMMOHudPlayerVitalsWidget.h"
#include "ZMMOJobsLibrary.h"
#include "ZMMOPlayerState.h"
UZMMOHudWidget::UZMMOHudWidget(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
// HUD nao bloqueia "back" (Esc / B no controller). Menus reais (StatusWindow,
// EscapeMenu) sim — eles setam bIsBackHandler=true.
bIsBackHandler = false;
// HUD nao reativa stack ao virar topo (e' sempre fundo). Garante que o
// UCommonActivatableWidgetStack do Layer.Game nao force activate/deactivate.
bAutoActivate = true;
}
TOptional<FUIInputConfig> UZMMOHudWidget::GetDesiredInputConfig() const
{
// Modo Game: input flui pro PlayerController/Pawn, mouse capturado (3a pessoa).
// Sem isso, CommonUI assume Menu config (mostra cursor + bloqueia movimento).
return FUIInputConfig(ECommonInputMode::Game, EMouseCaptureMode::CapturePermanently);
}
void UZMMOHudWidget::NativeOnActivated()
{
Super::NativeOnActivated();
// HUD nao intercepta cliques — mouse passa direto pro Pawn (camera, etc.).
// Sub-widgets que precisam de click (futuro: hotkeys) podem override.
SetVisibility(ESlateVisibility::HitTestInvisible);
// Toast comeca escondido — so' aparece em HandleLevelUp.
HideLevelUpToast();
BindToLocalPlayer();
UE_LOG(LogZMMO, Log, TEXT("ZMMOHudWidget activated (HpSpBar=%s)"),
HpSpBar ? *HpSpBar->GetName() : TEXT("none"));
}
void UZMMOHudWidget::NativeOnDeactivated()
{
UnbindFromComponent();
Super::NativeOnDeactivated();
}
void UZMMOHudWidget::NativeDestruct()
{
UnbindFromComponent();
Super::NativeDestruct();
}
void UZMMOHudWidget::BindToLocalPlayer()
{
UWorld* World = GetWorld();
if (!World) { return; }
APlayerController* PC = World->GetFirstPlayerController();
if (!PC) { return; }
APlayerState* PS = PC->PlayerState;
if (!PS)
{
// PlayerState pode nao existir ainda — race com GameMode setup.
// AZMMOPlayerCharacter::HandleLocalSpawnReady chama BindToAttributeComponent
// manualmente como fallback (seed do EntityId).
UE_LOG(LogZMMO, Log, TEXT("ZMMOHudWidget: PlayerState ausente no activate (race fix via HandleLocalSpawnReady esperado)"));
return;
}
UZMMOAttributeComponent* Comp = PS->FindComponentByClass<UZMMOAttributeComponent>();
if (!Comp) { return; }
if (Comp == BoundComponent.Get()) { return; } // idempotente
UnbindFromComponent();
BoundComponent = Comp;
Comp->OnAttributesChanged.AddDynamic(this, &UZMMOHudWidget::HandleAttributesChanged);
Comp->OnHpSpChanged.AddDynamic(this, &UZMMOHudWidget::HandleHpSpChanged);
Comp->OnLevelUp.AddDynamic(this, &UZMMOHudWidget::HandleLevelUp);
// Refresh imediato — caso o snapshot ja' tenha chegado.
HandleAttributesChanged(Comp->GetSnapshot());
}
void UZMMOHudWidget::UnbindFromComponent()
{
if (UZMMOAttributeComponent* Old = BoundComponent.Get())
{
Old->OnAttributesChanged.RemoveDynamic(this, &UZMMOHudWidget::HandleAttributesChanged);
Old->OnHpSpChanged.RemoveDynamic(this, &UZMMOHudWidget::HandleHpSpChanged);
Old->OnLevelUp.RemoveDynamic(this, &UZMMOHudWidget::HandleLevelUp);
}
BoundComponent.Reset();
}
void UZMMOHudWidget::HandleAttributesChanged(const FZMMOAttributesSnapshot& Snapshot)
{
// Propaga snapshot aos sub-widgets que ja existem.
if (HpSpBar)
{
HpSpBar->ApplySnapshot(Snapshot);
}
if (PlayerVitals)
{
PlayerVitals->ApplySnapshot(Snapshot);
// Identidade: nome vem do PlayerState (não está no snapshot); job vem
// do JobsSubsystem resolvendo ClassId -> display name.
if (UZMMOAttributeComponent* Comp = BoundComponent.Get())
{
if (const AZMMOPlayerState* PS = Cast<AZMMOPlayerState>(Comp->GetOwner()))
{
PlayerVitals->SetCharName(PS->CharName);
}
}
PlayerVitals->SetClassName(
UZMMOJobsLibrary::GetJobDisplayName(this, Snapshot.ClassId).ToString());
}
// Futuros: Buffs->RefreshIcons, etc.
}
void UZMMOHudWidget::HandleHpSpChanged(int32 Hp, int32 Sp)
{
if (UZMMOAttributeComponent* Comp = BoundComponent.Get())
{
const FZMMOAttributesSnapshot& Snap = Comp->GetSnapshot();
if (HpSpBar)
{
HpSpBar->ApplyHpSp(Hp, Snap.MaxHp, Sp, Snap.MaxSp);
}
if (PlayerVitals)
{
PlayerVitals->ApplyHpSp(Hp, Snap.MaxHp, Sp, Snap.MaxSp);
}
}
}
void UZMMOHudWidget::HandleLevelUp(int32 NewBaseLevel, int32 StatusPointDelta)
{
// Snapshot subsequente atualiza HpSpBar (level/maxhp/maxsp). Aqui mostra
// toast visual instantaneo. StatusPointDelta nao usado no texto (UI mostra
// no StatusWindow). Polish futuro: SFX + particle aura.
UE_LOG(LogZMMO, Log, TEXT("[HUD] LEVEL UP! newLevel=%d +sp=%d"), NewBaseLevel, StatusPointDelta);
ShowLevelUpToast(NewBaseLevel);
}
void UZMMOHudWidget::ShowLevelUpToast(int32 NewBaseLevel)
{
if (LevelUpToastText)
{
LevelUpToastText->SetText(FText::FromString(
FString::Printf(TEXT("LEVEL UP! Lv %d"), NewBaseLevel)));
}
if (LevelUpToastContainer)
{
LevelUpToastContainer->SetVisibility(ESlateVisibility::HitTestInvisible);
}
// Cancela timer anterior (caso level up duplo em sequencia) + agenda hide.
if (UWorld* World = GetWorld())
{
World->GetTimerManager().ClearTimer(LevelUpToastHideTimer);
World->GetTimerManager().SetTimer(LevelUpToastHideTimer,
FTimerDelegate::CreateUObject(this, &UZMMOHudWidget::HideLevelUpToast),
LevelUpToastDurationSec, /*loop*/ false);
}
}
void UZMMOHudWidget::HideLevelUpToast()
{
if (LevelUpToastContainer)
{
LevelUpToastContainer->SetVisibility(ESlateVisibility::Collapsed);
}
}

View File

@@ -1,16 +1,16 @@
#include "ZMMOHudHpSpWidget.h" #include "ZeusHudHpSpWidget.h"
#include "Components/ProgressBar.h" #include "Components/ProgressBar.h"
#include "Components/TextBlock.h" #include "Components/TextBlock.h"
#include "Internationalization/Text.h" #include "Internationalization/Text.h"
void UZMMOHudHpSpWidget::ApplySnapshot(const FZMMOAttributesSnapshot& Snapshot) void UZeusHudHpSpWidget::ApplySnapshot(const FZeusAttributesSnapshot& Snapshot)
{ {
LastSnapshot = Snapshot; LastSnapshot = Snapshot;
OnSnapshotApplied(Snapshot); OnSnapshotApplied(Snapshot);
} }
void UZMMOHudHpSpWidget::ApplyHpSp(int32 Hp, int32 MaxHp, int32 Sp, int32 MaxSp) void UZeusHudHpSpWidget::ApplyHpSp(int32 Hp, int32 MaxHp, int32 Sp, int32 MaxSp)
{ {
LastSnapshot.Hp = Hp; LastSnapshot.Hp = Hp;
LastSnapshot.MaxHp = MaxHp; LastSnapshot.MaxHp = MaxHp;
@@ -35,7 +35,7 @@ void UZMMOHudHpSpWidget::ApplyHpSp(int32 Hp, int32 MaxHp, int32 Sp, int32 MaxSp)
} }
} }
void UZMMOHudHpSpWidget::OnSnapshotApplied_Implementation(const FZMMOAttributesSnapshot& Snapshot) void UZeusHudHpSpWidget::OnSnapshotApplied_Implementation(const FZeusAttributesSnapshot& Snapshot)
{ {
ApplyHpSp(Snapshot.Hp, Snapshot.MaxHp, Snapshot.Sp, Snapshot.MaxSp); ApplyHpSp(Snapshot.Hp, Snapshot.MaxHp, Snapshot.Sp, Snapshot.MaxSp);
if (LevelText) if (LevelText)

View File

@@ -2,42 +2,32 @@
#include "Blueprint/UserWidget.h" #include "Blueprint/UserWidget.h"
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "ZMMOAttributeTypes.h" #include "ZeusAttributesSnapshot.h"
#include "ZMMOHudHpSpWidget.generated.h" #include "ZeusHudHpSpWidget.generated.h"
class UProgressBar; class UProgressBar;
class UTextBlock; class UTextBlock;
/** /**
* Sub-widget do HUD: barras de HP/SP + label de level. Sem auto-bind no * Sub-widget do HUD: barras de HP/SP + label de level. Sem auto-bind no
* AttributeComponent o parent (`UZMMOHudWidget`) propaga snapshots via * GAS Component o parent (`UZeusHudWidget`) propaga snapshots via
* `ApplySnapshot` / `ApplyHpSpDelta` quando o player local recebe updates. * `ApplySnapshot` / `ApplyHpSp` quando o player local recebe updates.
* *
* Composicao do HUD (ver `UZMMOHudWidget`): * Migrado de ZeusAttributes plugin pra ZMMO em M7 (delecao do plugin
* WBP_HUD (UZMMOHudWidget root) * legacy). API preservada WBP que herda dele nao precisa mudar.
* |-- HpSpBar (UZMMOHudHpSpWidget este)
* |-- PlayerInfo (futuro nome/job/level)
* |-- Minimap (futuro)
* |-- QuickBar (futuro hotkeys)
* |-- Buffs (futuro icones SC)
* |-- Chat (futuro)
* |-- TargetInfo (futuro mob/player targetado)
*
* Cada sub-widget tem responsabilidade unica (SRP). O parent (UZMMOHudWidget)
* faz binding com AttributeComponent e propaga deltas.
* *
* Convencao `meta=(BindWidget)`: o WBP filho deve ter widgets com nomes * Convencao `meta=(BindWidget)`: o WBP filho deve ter widgets com nomes
* exatos (HpBar, SpBar). `BindWidgetOptional` permite omitir. * exatos (HpBar, SpBar). `BindWidgetOptional` permite omitir.
*/ */
UCLASS(Abstract, Blueprintable, BlueprintType) UCLASS(Abstract, Blueprintable, BlueprintType)
class ZMMOATTRIBUTES_API UZMMOHudHpSpWidget : public UUserWidget class ZMMO_API UZeusHudHpSpWidget : public UUserWidget
{ {
GENERATED_BODY() GENERATED_BODY()
public: public:
/** Atualiza todos os campos a partir do snapshot. Chamado pelo UZMMOHudWidget. */ /** Atualiza todos os campos a partir do snapshot. Chamado pelo UZeusHudWidget. */
UFUNCTION(BlueprintCallable, Category = "Zeus|HUD") UFUNCTION(BlueprintCallable, Category = "Zeus|HUD")
void ApplySnapshot(const FZMMOAttributesSnapshot& Snapshot); void ApplySnapshot(const FZeusAttributesSnapshot& Snapshot);
/** Atualiza apenas HP/SP (sem mexer no level/text). Otimizacao do tick. */ /** Atualiza apenas HP/SP (sem mexer no level/text). Otimizacao do tick. */
UFUNCTION(BlueprintCallable, Category = "Zeus|HUD") UFUNCTION(BlueprintCallable, Category = "Zeus|HUD")
@@ -50,8 +40,8 @@ protected:
* atualiza progress bars + textos via BindWidget/BindWidgetOptional. * atualiza progress bars + textos via BindWidget/BindWidgetOptional.
*/ */
UFUNCTION(BlueprintNativeEvent, Category = "Zeus|HUD") UFUNCTION(BlueprintNativeEvent, Category = "Zeus|HUD")
void OnSnapshotApplied(const FZMMOAttributesSnapshot& Snapshot); void OnSnapshotApplied(const FZeusAttributesSnapshot& Snapshot);
virtual void OnSnapshotApplied_Implementation(const FZMMOAttributesSnapshot& Snapshot); virtual void OnSnapshotApplied_Implementation(const FZeusAttributesSnapshot& Snapshot);
// === BindWidget — devem existir no WBP com EXATAMENTE estes nomes === // === BindWidget — devem existir no WBP com EXATAMENTE estes nomes ===
UPROPERTY(BlueprintReadOnly, meta = (BindWidget), Category = "Zeus|HUD") UPROPERTY(BlueprintReadOnly, meta = (BindWidget), Category = "Zeus|HUD")
@@ -70,7 +60,7 @@ protected:
UTextBlock* LevelText = nullptr; UTextBlock* LevelText = nullptr;
private: private:
/// Ultimo snapshot recebido (cache pra ApplyHpSp manter MaxHp/MaxSp). */ /// Ultimo snapshot recebido (cache pra ApplyHpSp manter MaxHp/MaxSp).
UPROPERTY(Transient) UPROPERTY(Transient)
FZMMOAttributesSnapshot LastSnapshot; FZeusAttributesSnapshot LastSnapshot;
}; };

View File

@@ -1,4 +1,4 @@
#include "ZMMOHudPlayerVitalsWidget.h" #include "ZeusHudPlayerVitalsWidget.h"
#include "Components/RichTextBlock.h" #include "Components/RichTextBlock.h"
#include "Components/TextBlock.h" #include "Components/TextBlock.h"
@@ -30,7 +30,7 @@ namespace
} }
} }
void UZMMOHudPlayerVitalsWidget::ApplySnapshot(const FZMMOAttributesSnapshot& Snapshot) void UZeusHudPlayerVitalsWidget::ApplySnapshot(const FZeusAttributesSnapshot& Snapshot)
{ {
LastSnapshot = Snapshot; LastSnapshot = Snapshot;
@@ -67,7 +67,7 @@ void UZMMOHudPlayerVitalsWidget::ApplySnapshot(const FZMMOAttributesSnapshot& Sn
OnSnapshotApplied(Snapshot); OnSnapshotApplied(Snapshot);
} }
void UZMMOHudPlayerVitalsWidget::ApplyHpSp(int32 Hp, int32 MaxHp, int32 Sp, int32 MaxSp) void UZeusHudPlayerVitalsWidget::ApplyHpSp(int32 Hp, int32 MaxHp, int32 Sp, int32 MaxSp)
{ {
LastSnapshot.Hp = Hp; LastSnapshot.Hp = Hp;
LastSnapshot.MaxHp = MaxHp; LastSnapshot.MaxHp = MaxHp;
@@ -99,7 +99,7 @@ void UZMMOHudPlayerVitalsWidget::ApplyHpSp(int32 Hp, int32 MaxHp, int32 Sp, int3
} }
} }
void UZMMOHudPlayerVitalsWidget::SetCharName(const FString& InName) void UZeusHudPlayerVitalsWidget::SetCharName(const FString& InName)
{ {
if (NameText) if (NameText)
{ {
@@ -107,7 +107,7 @@ void UZMMOHudPlayerVitalsWidget::SetCharName(const FString& InName)
} }
} }
void UZMMOHudPlayerVitalsWidget::SetClassName(const FString& InClassName) void UZeusHudPlayerVitalsWidget::SetClassName(const FString& InClassName)
{ {
if (ClassText) if (ClassText)
{ {
@@ -115,7 +115,7 @@ void UZMMOHudPlayerVitalsWidget::SetClassName(const FString& InClassName)
} }
} }
void UZMMOHudPlayerVitalsWidget::OnSnapshotApplied_Implementation(const FZMMOAttributesSnapshot& /*Snapshot*/) void UZeusHudPlayerVitalsWidget::OnSnapshotApplied_Implementation(const FZeusAttributesSnapshot& /*Snapshot*/)
{ {
// Default vazio — skin do WBP estende se quiser (low-HP flash, etc.). // Default vazio — skin do WBP estende se quiser (low-HP flash, etc.).
} }

View File

@@ -2,8 +2,8 @@
#include "CommonUserWidget.h" #include "CommonUserWidget.h"
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "ZMMOAttributeTypes.h" #include "ZeusAttributesSnapshot.h"
#include "ZMMOHudPlayerVitalsWidget.generated.h" #include "ZeusHudPlayerVitalsWidget.generated.h"
class UUIProgressBar_Base; class UUIProgressBar_Base;
class UTextBlock; class UTextBlock;
@@ -12,7 +12,7 @@ class URichTextBlock;
/** /**
* Sub-widget do HUD: painel de vitais do player (portrait + nome/job/level + * Sub-widget do HUD: painel de vitais do player (portrait + nome/job/level +
* barras HP/SP/BASE EXP/JOB EXP). Sem auto-bind no AttributeComponent o * barras HP/SP/BASE EXP/JOB EXP). Sem auto-bind no AttributeComponent o
* parent (UZMMOHudWidget) propaga snapshots via ApplySnapshot/ApplyHpSp. * parent (UZeusHudWidget) propaga snapshots via ApplySnapshot/ApplyHpSp.
* *
* Barras são UUIProgressBar_Base (material custom Primary/Secondary). HP/SP * Barras são UUIProgressBar_Base (material custom Primary/Secondary). HP/SP
* têm pool efetivo no snapshot % real. BASE/JOB EXP têm exp acumulado * têm pool efetivo no snapshot % real. BASE/JOB EXP têm exp acumulado
@@ -24,14 +24,14 @@ class URichTextBlock;
* LvlText, HpReadout, SpReadout, ExpReadout, JobReadout (opcionais). * LvlText, HpReadout, SpReadout, ExpReadout, JobReadout (opcionais).
*/ */
UCLASS(Abstract, Blueprintable, BlueprintType) UCLASS(Abstract, Blueprintable, BlueprintType)
class ZMMO_API UZMMOHudPlayerVitalsWidget : public UCommonUserWidget class ZMMO_API UZeusHudPlayerVitalsWidget : public UCommonUserWidget
{ {
GENERATED_BODY() GENERATED_BODY()
public: public:
/** Atualiza todos os campos a partir do snapshot. Chamado pelo UZMMOHudWidget. */ /** Atualiza todos os campos a partir do snapshot. Chamado pelo UZeusHudWidget. */
UFUNCTION(BlueprintCallable, Category = "Zeus|HUD") UFUNCTION(BlueprintCallable, Category = "Zeus|HUD")
void ApplySnapshot(const FZMMOAttributesSnapshot& Snapshot); void ApplySnapshot(const FZeusAttributesSnapshot& Snapshot);
/** Atualiza apenas HP/SP (otimização do tick — sem mexer em level/exp). */ /** Atualiza apenas HP/SP (otimização do tick — sem mexer em level/exp). */
UFUNCTION(BlueprintCallable, Category = "Zeus|HUD") UFUNCTION(BlueprintCallable, Category = "Zeus|HUD")
@@ -48,8 +48,8 @@ public:
protected: protected:
/** Hook BP pra skin reagir (cores low-HP, animações, etc.). */ /** Hook BP pra skin reagir (cores low-HP, animações, etc.). */
UFUNCTION(BlueprintNativeEvent, Category = "Zeus|HUD") UFUNCTION(BlueprintNativeEvent, Category = "Zeus|HUD")
void OnSnapshotApplied(const FZMMOAttributesSnapshot& Snapshot); void OnSnapshotApplied(const FZeusAttributesSnapshot& Snapshot);
virtual void OnSnapshotApplied_Implementation(const FZMMOAttributesSnapshot& Snapshot); virtual void OnSnapshotApplied_Implementation(const FZeusAttributesSnapshot& Snapshot);
// === BindWidget — barras (HP/SP obrigatórias) === // === BindWidget — barras (HP/SP obrigatórias) ===
UPROPERTY(BlueprintReadOnly, meta = (BindWidget), Category = "Zeus|HUD") UPROPERTY(BlueprintReadOnly, meta = (BindWidget), Category = "Zeus|HUD")
@@ -89,5 +89,5 @@ protected:
private: private:
/** Último snapshot recebido (cache pra ApplyHpSp manter MaxHp/MaxSp). */ /** Último snapshot recebido (cache pra ApplyHpSp manter MaxHp/MaxSp). */
UPROPERTY(Transient) UPROPERTY(Transient)
FZMMOAttributesSnapshot LastSnapshot; FZeusAttributesSnapshot LastSnapshot;
}; };

View File

@@ -0,0 +1,204 @@
#include "ZeusHudWidget.h"
#include "Components/TextBlock.h"
#include "Components/Widget.h"
#include "CommonInputTypeEnum.h" // ECommonInputMode
#include "Engine/World.h"
#include "GameFramework/PlayerController.h"
#include "GameFramework/PlayerState.h"
#include "TimerManager.h"
#include "ZMMO.h"
#include "ZeusAttributesPayload.h" // FZeusAttributesPayload (ZeusNetwork)
#include "ZeusGASComponent.h" // UZeusGASComponent (ZeusGAS)
#include "ZeusHudHpSpWidget.h"
#include "ZeusHudPlayerVitalsWidget.h"
#include "ZeusJobsLibrary.h"
#include "ZeusPlayerState.h"
UZeusHudWidget::UZeusHudWidget(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
// HUD nao bloqueia "back" (Esc / B no controller). Menus reais (StatusWindow,
// EscapeMenu) sim — eles setam bIsBackHandler=true.
bIsBackHandler = false;
// HUD nao reativa stack ao virar topo (e' sempre fundo). Garante que o
// UCommonActivatableWidgetStack do Layer.Game nao force activate/deactivate.
bAutoActivate = true;
}
TOptional<FUIInputConfig> UZeusHudWidget::GetDesiredInputConfig() const
{
// Modo Game: input flui pro PlayerController/Pawn, mouse capturado (3a pessoa).
// Sem isso, CommonUI assume Menu config (mostra cursor + bloqueia movimento).
return FUIInputConfig(ECommonInputMode::Game, EMouseCaptureMode::CapturePermanently);
}
void UZeusHudWidget::NativeOnActivated()
{
Super::NativeOnActivated();
// HUD nao intercepta cliques — mouse passa direto pro Pawn (camera, etc.).
// Sub-widgets que precisam de click (futuro: hotkeys) podem override.
SetVisibility(ESlateVisibility::HitTestInvisible);
// Toast comeca escondido — so' aparece em HandleLevelUp.
HideLevelUpToast();
BindToLocalPlayer();
UE_LOG(LogZMMO, Log, TEXT("ZeusHudWidget activated (HpSpBar=%s)"),
HpSpBar ? *HpSpBar->GetName() : TEXT("none"));
}
void UZeusHudWidget::NativeOnDeactivated()
{
UnbindFromComponent();
Super::NativeOnDeactivated();
}
void UZeusHudWidget::NativeDestruct()
{
UnbindFromComponent();
Super::NativeDestruct();
}
void UZeusHudWidget::BindToLocalPlayer()
{
UWorld* World = GetWorld();
if (!World) { return; }
APlayerController* PC = World->GetFirstPlayerController();
if (!PC) { return; }
APlayerState* PS = PC->PlayerState;
if (!PS)
{
// PlayerState pode nao existir ainda — race com GameMode setup.
UE_LOG(LogZMMO, Log, TEXT("ZeusHudWidget: PlayerState ausente no activate (esperado se ativou antes do replicar)"));
return;
}
UZeusGASComponent* Comp = PS->FindComponentByClass<UZeusGASComponent>();
if (!Comp)
{
UE_LOG(LogZMMO, Warning, TEXT("ZeusHudWidget::BindToLocalPlayer: UZeusGASComponent NAO encontrado em PS=%s"),
*PS->GetName());
return;
}
if (Comp == BoundComponent.Get()) { return; } // idempotente
UnbindFromComponent();
BoundComponent = Comp;
// Raw e' non-dynamic (FZeusAttributesPayload nao e' BlueprintType) — AddUObject.
SnapshotRawHandle = Comp->OnSnapshotAppliedRaw.AddUObject(this, &UZeusHudWidget::HandleSnapshotRaw);
Comp->OnHpSpUpdated.AddDynamic(this, &UZeusHudWidget::HandleHpSpUpdated);
Comp->OnLevelUp.AddDynamic(this, &UZeusHudWidget::HandleLevelUp);
UE_LOG(LogZMMO, Log, TEXT("ZeusHudWidget::BindToLocalPlayer: bound to %s (HasSnapshot=%d, PlayerVitals=%s, HpSpBar=%s)"),
*Comp->GetName(), Comp->HasSnapshot() ? 1 : 0,
PlayerVitals ? *PlayerVitals->GetName() : TEXT("nullptr"),
HpSpBar ? *HpSpBar->GetName() : TEXT("nullptr"));
// Refresh imediato — caso o snapshot ja' tenha chegado antes do bind.
if (Comp->HasSnapshot())
{
HandleSnapshotRaw(Comp->GetLastSnapshot());
}
}
void UZeusHudWidget::UnbindFromComponent()
{
if (UZeusGASComponent* Old = BoundComponent.Get())
{
if (SnapshotRawHandle.IsValid())
{
Old->OnSnapshotAppliedRaw.Remove(SnapshotRawHandle);
SnapshotRawHandle.Reset();
}
Old->OnHpSpUpdated.RemoveDynamic(this, &UZeusHudWidget::HandleHpSpUpdated);
Old->OnLevelUp.RemoveDynamic(this, &UZeusHudWidget::HandleLevelUp);
}
BoundComponent.Reset();
}
void UZeusHudWidget::HandleSnapshotRaw(const FZeusAttributesPayload& Payload)
{
const FZeusAttributesSnapshot Snapshot = FZeusAttributesSnapshot::FromPayload(Payload);
UE_LOG(LogZMMO, Log, TEXT("ZeusHudWidget::HandleSnapshotRaw: entity=%lld level=%d hp=%d/%d (PlayerVitals=%s)"),
Snapshot.EntityId, Snapshot.BaseLevel, Snapshot.Hp, Snapshot.MaxHp,
PlayerVitals ? TEXT("ok") : TEXT("NULLPTR"));
if (HpSpBar)
{
HpSpBar->ApplySnapshot(Snapshot);
}
if (PlayerVitals)
{
PlayerVitals->ApplySnapshot(Snapshot);
// Identidade: nome vem do PlayerState; job vem do JobsSubsystem.
if (UZeusGASComponent* Comp = BoundComponent.Get())
{
if (const AZeusPlayerState* PS = Cast<AZeusPlayerState>(Comp->GetOwner()))
{
PlayerVitals->SetCharName(PS->CharName);
}
}
PlayerVitals->SetClassName(
UZeusJobsLibrary::GetJobDisplayName(this, Snapshot.ClassId).ToString());
}
// Futuros: Buffs->RefreshIcons, etc.
}
void UZeusHudWidget::HandleHpSpUpdated(float Hp, float Sp)
{
UZeusGASComponent* Comp = BoundComponent.Get();
if (!Comp || !Comp->HasSnapshot()) { return; }
const FZeusAttributesPayload& P = Comp->GetLastSnapshot();
const int32 HpInt = static_cast<int32>(Hp);
const int32 SpInt = static_cast<int32>(Sp);
if (HpSpBar)
{
HpSpBar->ApplyHpSp(HpInt, P.MaxHp, SpInt, P.MaxSp);
}
if (PlayerVitals)
{
PlayerVitals->ApplyHpSp(HpInt, P.MaxHp, SpInt, P.MaxSp);
}
}
void UZeusHudWidget::HandleLevelUp(int32 NewBaseLevel, int32 StatusPointDelta)
{
// Snapshot subsequente atualiza HpSpBar (level/maxhp/maxsp). Aqui mostra
// toast visual instantaneo. StatusPointDelta nao usado no texto (UI mostra
// no StatusWindow). Polish futuro: SFX + particle aura.
UE_LOG(LogZMMO, Log, TEXT("[HUD] LEVEL UP! newLevel=%d +sp=%d"), NewBaseLevel, StatusPointDelta);
ShowLevelUpToast(NewBaseLevel);
}
void UZeusHudWidget::ShowLevelUpToast(int32 NewBaseLevel)
{
if (LevelUpToastText)
{
LevelUpToastText->SetText(FText::FromString(
FString::Printf(TEXT("LEVEL UP! Lv %d"), NewBaseLevel)));
}
if (LevelUpToastContainer)
{
LevelUpToastContainer->SetVisibility(ESlateVisibility::HitTestInvisible);
}
// Cancela timer anterior (caso level up duplo em sequencia) + agenda hide.
if (UWorld* World = GetWorld())
{
World->GetTimerManager().ClearTimer(LevelUpToastHideTimer);
World->GetTimerManager().SetTimer(LevelUpToastHideTimer,
FTimerDelegate::CreateUObject(this, &UZeusHudWidget::HideLevelUpToast),
LevelUpToastDurationSec, /*loop*/ false);
}
}
void UZeusHudWidget::HideLevelUpToast()
{
if (LevelUpToastContainer)
{
LevelUpToastContainer->SetVisibility(ESlateVisibility::Collapsed);
}
}

View File

@@ -3,14 +3,15 @@
#include "CommonActivatableWidget.h" #include "CommonActivatableWidget.h"
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "Engine/TimerHandle.h" #include "Engine/TimerHandle.h"
#include "ZMMOAttributeTypes.h" #include "ZeusAttributesSnapshot.h"
#include "ZMMOHudWidget.generated.h" #include "ZeusHudWidget.generated.h"
class UTextBlock; class UTextBlock;
class UWidget; class UWidget;
class UZMMOAttributeComponent; class UZeusGASComponent;
class UZMMOHudHpSpWidget; class UZeusHudHpSpWidget;
class UZMMOHudPlayerVitalsWidget; class UZeusHudPlayerVitalsWidget;
struct FZeusAttributesPayload;
/** /**
* Root da HUD de gameplay. UCommonActivatableWidget pushed pelo * Root da HUD de gameplay. UCommonActivatableWidget pushed pelo
@@ -18,12 +19,12 @@ class UZMMOHudPlayerVitalsWidget;
* *
* **Vive em ZMMO core** (UI/InGame/) porque o HUD root e' generico pra * **Vive em ZMMO core** (UI/InGame/) porque o HUD root e' generico pra
* qualquer GameType sub-widgets vem dos modulos especializados * qualquer GameType sub-widgets vem dos modulos especializados
* (HpSpBar do sub-modulo ZMMOAttributes, Minimap de ZMMOMap futuro, * (HpSpBar local do ZMMO, Minimap de ZeusMap futuro,
* Chat de ZMMOChat futuro, etc.). * Chat de ZeusChat futuro, etc.).
* *
* Padrao **composite**: o WBP_HUD (filho) declara as PECAS visuais como * Padrao **composite**: o WBP_HUD (filho) declara as PECAS visuais como
* sub-widgets BindWidgetOptional, e este C++ orquestra: * sub-widgets BindWidgetOptional, e este C++ orquestra:
* 1. Em NativeOnActivated: auto-binda no UZMMOAttributeComponent do * 1. Em NativeOnActivated: auto-binda no UZeusAttributeComponent do
* player local (vive no PlayerState via Component Registry) * player local (vive no PlayerState via Component Registry)
* 2. Subscreve aos delegates do componente (OnAttributesChanged, * 2. Subscreve aos delegates do componente (OnAttributesChanged,
* OnHpSpChanged, OnLevelUp) * OnHpSpChanged, OnLevelUp)
@@ -32,7 +33,7 @@ class UZMMOHudPlayerVitalsWidget;
* *
* Composicao prevista (sub-widgets todos `BindWidgetOptional` pra * Composicao prevista (sub-widgets todos `BindWidgetOptional` pra
* permitir GameTypes sem modulos opcionais ex.: Survival sem stats RO): * permitir GameTypes sem modulos opcionais ex.: Survival sem stats RO):
* - HpSpBar (UZMMOHudHpSpWidget sub-modulo ZMMOAttributes) impl * - HpSpBar (UZeusHudHpSpWidget local UI/InGame/) impl
* - PlayerInfo (futuro nome/job/level/exp bar) * - PlayerInfo (futuro nome/job/level/exp bar)
* - Minimap (futuro) * - Minimap (futuro)
* - QuickBar (futuro hotkeys de skills) * - QuickBar (futuro hotkeys de skills)
@@ -47,12 +48,12 @@ class UZMMOHudPlayerVitalsWidget;
* no Designer sem tocar este C++. * no Designer sem tocar este C++.
*/ */
UCLASS(Abstract, Blueprintable, BlueprintType) UCLASS(Abstract, Blueprintable, BlueprintType)
class ZMMO_API UZMMOHudWidget : public UCommonActivatableWidget class ZMMO_API UZeusHudWidget : public UCommonActivatableWidget
{ {
GENERATED_BODY() GENERATED_BODY()
public: public:
UZMMOHudWidget(const FObjectInitializer& ObjectInitializer); UZeusHudWidget(const FObjectInitializer& ObjectInitializer);
protected: protected:
virtual void NativeOnActivated() override; virtual void NativeOnActivated() override;
@@ -70,16 +71,16 @@ protected:
*/ */
virtual TOptional<FUIInputConfig> GetDesiredInputConfig() const override; virtual TOptional<FUIInputConfig> GetDesiredInputConfig() const override;
/// Sub-widget HP/SP/level (sub-modulo ZMMOAttributes). BindWidgetOptional /// Sub-widget HP/SP/level (local UI/InGame/). BindWidgetOptional
/// — WBP_HUD pode omitir se o GameType nao usa Attributes (Survival, etc.). /// — WBP_HUD pode omitir se o GameType nao usa Attributes (Survival, etc.).
UPROPERTY(BlueprintReadOnly, meta = (BindWidgetOptional), Category = "Zeus|HUD") UPROPERTY(BlueprintReadOnly, meta = (BindWidgetOptional), Category = "Zeus|HUD")
UZMMOHudHpSpWidget* HpSpBar = nullptr; UZeusHudHpSpWidget* HpSpBar = nullptr;
/// Painel de vitais novo (portrait + nome/job/level + HP/SP/EXP/JOB bars). /// Painel de vitais novo (portrait + nome/job/level + HP/SP/EXP/JOB bars).
/// Substitui o HpSpBar legado. BindWidgetOptional — coexiste durante a /// Substitui o HpSpBar legado. BindWidgetOptional — coexiste durante a
/// migração; o WBP_HUD pode ter um ou outro. /// migração; o WBP_HUD pode ter um ou outro.
UPROPERTY(BlueprintReadOnly, meta = (BindWidgetOptional), Category = "Zeus|HUD") UPROPERTY(BlueprintReadOnly, meta = (BindWidgetOptional), Category = "Zeus|HUD")
UZMMOHudPlayerVitalsWidget* PlayerVitals = nullptr; UZeusHudPlayerVitalsWidget* PlayerVitals = nullptr;
/// Container do toast "LEVEL UP!" (Fase 3). Hidden por default; em /// Container do toast "LEVEL UP!" (Fase 3). Hidden por default; em
/// `HandleLevelUp` vira visivel por `LevelUpToastDurationSec` segundos /// `HandleLevelUp` vira visivel por `LevelUpToastDurationSec` segundos
@@ -98,33 +99,39 @@ protected:
float LevelUpToastDurationSec = 2.5f; float LevelUpToastDurationSec = 2.5f;
// === Futuros sub-widgets === // === Futuros sub-widgets ===
// UPROPERTY(BlueprintReadOnly, meta = (BindWidgetOptional)) UZMMOHudPlayerInfoWidget* PlayerInfo = nullptr; // UPROPERTY(BlueprintReadOnly, meta = (BindWidgetOptional)) UZeusHudPlayerInfoWidget* PlayerInfo = nullptr;
// UPROPERTY(BlueprintReadOnly, meta = (BindWidgetOptional)) UZMMOHudMinimapWidget* Minimap = nullptr; // UPROPERTY(BlueprintReadOnly, meta = (BindWidgetOptional)) UZeusHudMinimapWidget* Minimap = nullptr;
// UPROPERTY(BlueprintReadOnly, meta = (BindWidgetOptional)) UZMMOHudQuickBarWidget* QuickBar = nullptr; // UPROPERTY(BlueprintReadOnly, meta = (BindWidgetOptional)) UZeusHudQuickBarWidget* QuickBar = nullptr;
// UPROPERTY(BlueprintReadOnly, meta = (BindWidgetOptional)) UZMMOHudBuffsWidget* Buffs = nullptr; // UPROPERTY(BlueprintReadOnly, meta = (BindWidgetOptional)) UZeusHudBuffsWidget* Buffs = nullptr;
// UPROPERTY(BlueprintReadOnly, meta = (BindWidgetOptional)) UZMMOHudChatWidget* Chat = nullptr; // UPROPERTY(BlueprintReadOnly, meta = (BindWidgetOptional)) UZeusHudChatWidget* Chat = nullptr;
// UPROPERTY(BlueprintReadOnly, meta = (BindWidgetOptional)) UZMMOHudTargetInfoWidget* TargetInfo = nullptr; // UPROPERTY(BlueprintReadOnly, meta = (BindWidgetOptional)) UZeusHudTargetInfoWidget* TargetInfo = nullptr;
UFUNCTION(BlueprintPure, Category = "Zeus|HUD") UFUNCTION(BlueprintPure, Category = "Zeus|HUD")
UZMMOAttributeComponent* GetBoundComponent() const { return BoundComponent.Get(); } UZeusGASComponent* GetBoundComponent() const { return BoundComponent.Get(); }
private: private:
/// Tenta achar o UZMMOAttributeComponent do player local + subscrever /// Tenta achar o UZeusGASComponent do player local + subscrever nos
/// nos delegates. Idempotente. /// delegates. Idempotente.
void BindToLocalPlayer(); void BindToLocalPlayer();
void UnbindFromComponent(); void UnbindFromComponent();
UFUNCTION() /// Listener C++ no payload bruto do UZeusGASComponent (nao e' UFUNCTION
void HandleAttributesChanged(const FZMMOAttributesSnapshot& Snapshot); /// porque FZeusAttributesPayload nao e' BlueprintType — delegate multicast
/// nativo).
void HandleSnapshotRaw(const FZeusAttributesPayload& Payload);
UFUNCTION() UFUNCTION()
void HandleHpSpChanged(int32 Hp, int32 Sp); void HandleHpSpUpdated(float Hp, float Sp);
UFUNCTION() UFUNCTION()
void HandleLevelUp(int32 NewBaseLevel, int32 StatusPointDelta); void HandleLevelUp(int32 NewBaseLevel, int32 StatusPointDelta);
UPROPERTY(Transient) UPROPERTY(Transient)
TWeakObjectPtr<UZMMOAttributeComponent> BoundComponent; TWeakObjectPtr<UZeusGASComponent> BoundComponent;
/// Handle do listener nao-dynamic em OnSnapshotAppliedRaw — guardar pra remover
/// em UnbindFromComponent (AddUObject nao auto-cleanup como AddDynamic).
FDelegateHandle SnapshotRawHandle;
void ShowLevelUpToast(int32 NewBaseLevel); void ShowLevelUpToast(int32 NewBaseLevel);
void HideLevelUpToast(); void HideLevelUpToast();

View File

@@ -1,6 +1,6 @@
#include "UICheckBox_Base.h" #include "UICheckBox_Base.h"
#include "ZMMOThemeSubsystem.h" #include "ZeusThemeSubsystem.h"
#include "Engine/GameInstance.h" #include "Engine/GameInstance.h"
#include "Engine/DataTable.h" #include "Engine/DataTable.h"
#include "Components/CheckBox.h" #include "Components/CheckBox.h"
@@ -18,7 +18,7 @@ namespace
{ {
if (const UGameInstance* GI = Widget->GetGameInstance()) if (const UGameInstance* GI = Widget->GetGameInstance())
{ {
if (const UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>()) if (const UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
{ {
return Theme->GetActiveUIStyle(); return Theme->GetActiveUIStyle();
} }
@@ -174,7 +174,7 @@ void UUICheckBox_Base::NativeConstruct()
{ {
if (const UGameInstance* GI = GetGameInstance()) if (const UGameInstance* GI = GetGameInstance())
{ {
if (UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>()) if (UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
{ {
Theme->OnThemeChanged.AddDynamic(this, &UUICheckBox_Base::HandleThemeChanged); Theme->OnThemeChanged.AddDynamic(this, &UUICheckBox_Base::HandleThemeChanged);
bThemeBound = true; bThemeBound = true;
@@ -195,7 +195,7 @@ void UUICheckBox_Base::NativeDestruct()
{ {
if (const UGameInstance* GI = GetGameInstance()) if (const UGameInstance* GI = GetGameInstance())
{ {
if (UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>()) if (UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
{ {
Theme->OnThemeChanged.RemoveDynamic(this, &UUICheckBox_Base::HandleThemeChanged); Theme->OnThemeChanged.RemoveDynamic(this, &UUICheckBox_Base::HandleThemeChanged);
} }

View File

@@ -16,7 +16,7 @@ DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FUICheckBoxStateChanged, bool, bIsCh
* WBP concreto (UI_CheckBox_Master) herda DIRETO desta classe C++ (UMG não * WBP concreto (UI_CheckBox_Master) herda DIRETO desta classe C++ (UMG não
* encadeia árvores — ARQUITETURA.md §3.3). * encadeia árvores — ARQUITETURA.md §3.3).
* *
* Visual data-driven por FUIStyle.CheckBox (UZMMOThemeSubsystem). C++ aplica * Visual data-driven por FUIStyle.CheckBox (UZeusThemeSubsystem). C++ aplica
* o que dá no UCheckBox; cor/brush finos vão pelo hook BP_ApplyCheckBoxStyle * o que dá no UCheckBox; cor/brush finos vão pelo hook BP_ApplyCheckBoxStyle
* (o WBP tinge os brushes do estilo do UCheckBox). * (o WBP tinge os brushes do estilo do UCheckBox).
*/ */

View File

@@ -1,6 +1,6 @@
#include "UICommonText_Base.h" #include "UICommonText_Base.h"
#include "ZMMOThemeSubsystem.h" #include "ZeusThemeSubsystem.h"
#include "Engine/GameInstance.h" #include "Engine/GameInstance.h"
#include "Engine/DataTable.h" #include "Engine/DataTable.h"
#include "Styling/CoreStyle.h" #include "Styling/CoreStyle.h"
@@ -18,7 +18,7 @@ namespace
{ {
if (const UGameInstance* GI = Widget->GetGameInstance()) if (const UGameInstance* GI = Widget->GetGameInstance())
{ {
if (const UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>()) if (const UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
{ {
return Theme->GetActiveUIStyle(); return Theme->GetActiveUIStyle();
} }

View File

@@ -8,7 +8,7 @@
* Texto compartilhado do ZMMO. Subclasse de UCommonTextBlock (leaf, usado * Texto compartilhado do ZMMO. Subclasse de UCommonTextBlock (leaf, usado
* direto na árvore). A categoria tipográfica NÃO é um enum fixo: é um nome * direto na árvore). A categoria tipográfica NÃO é um enum fixo: é um nome
* (FName) resolvido contra o mapa FUIStyle.TextRoles do DT_UI_Styles via * (FName) resolvido contra o mapa FUIStyle.TextRoles do DT_UI_Styles via
* UZMMOThemeSubsystem — o dropdown do Details é populado a partir do DT * UZeusThemeSubsystem — o dropdown do Details é populado a partir do DT
* (GetOptions). Data-driven, sem struct/enum pré-definido (pedido do autor). * (GetOptions). Data-driven, sem struct/enum pré-definido (pedido do autor).
* *
* Fallback: se a chave não existir no mapa, cai nas categorias clássicas de * Fallback: se a chave não existir no mapa, cai nas categorias clássicas de

View File

@@ -1,6 +1,6 @@
#include "UIInput_Base.h" #include "UIInput_Base.h"
#include "ZMMOThemeSubsystem.h" #include "ZeusThemeSubsystem.h"
#include "Engine/GameInstance.h" #include "Engine/GameInstance.h"
#include "Engine/DataTable.h" #include "Engine/DataTable.h"
#include "Components/EditableTextBox.h" #include "Components/EditableTextBox.h"
@@ -20,7 +20,7 @@ namespace
{ {
if (const UGameInstance* GI = Widget->GetGameInstance()) if (const UGameInstance* GI = Widget->GetGameInstance())
{ {
if (const UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>()) if (const UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
{ {
return Theme->GetActiveUIStyle(); return Theme->GetActiveUIStyle();
} }
@@ -277,7 +277,7 @@ void UUIInput_Base::NativeConstruct()
{ {
if (const UGameInstance* GI = GetGameInstance()) if (const UGameInstance* GI = GetGameInstance())
{ {
if (UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>()) if (UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
{ {
Theme->OnThemeChanged.AddDynamic(this, &UUIInput_Base::HandleThemeChanged); Theme->OnThemeChanged.AddDynamic(this, &UUIInput_Base::HandleThemeChanged);
bThemeBound = true; bThemeBound = true;
@@ -299,7 +299,7 @@ void UUIInput_Base::NativeDestruct()
{ {
if (const UGameInstance* GI = GetGameInstance()) if (const UGameInstance* GI = GetGameInstance())
{ {
if (UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>()) if (UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
{ {
Theme->OnThemeChanged.RemoveDynamic(this, &UUIInput_Base::HandleThemeChanged); Theme->OnThemeChanged.RemoveDynamic(this, &UUIInput_Base::HandleThemeChanged);
} }

View File

@@ -1,6 +1,6 @@
#include "UIPanel_Base.h" #include "UIPanel_Base.h"
#include "ZMMOThemeSubsystem.h" #include "ZeusThemeSubsystem.h"
#include "Engine/GameInstance.h" #include "Engine/GameInstance.h"
#include "Components/Border.h" #include "Components/Border.h"
#include "Styling/SlateBrush.h" #include "Styling/SlateBrush.h"
@@ -15,7 +15,7 @@ namespace
{ {
if (const UGameInstance* GI = Widget->GetGameInstance()) if (const UGameInstance* GI = Widget->GetGameInstance())
{ {
if (const UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>()) if (const UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
{ {
return Theme->GetActiveUIStyle(); return Theme->GetActiveUIStyle();
} }
@@ -106,7 +106,7 @@ void UUIPanel_Base::NativeConstruct()
{ {
if (const UGameInstance* GI = GetGameInstance()) if (const UGameInstance* GI = GetGameInstance())
{ {
if (UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>()) if (UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
{ {
Theme->OnThemeChanged.AddDynamic(this, &UUIPanel_Base::HandleThemeChanged); Theme->OnThemeChanged.AddDynamic(this, &UUIPanel_Base::HandleThemeChanged);
bThemeBound = true; bThemeBound = true;
@@ -122,7 +122,7 @@ void UUIPanel_Base::NativeDestruct()
{ {
if (const UGameInstance* GI = GetGameInstance()) if (const UGameInstance* GI = GetGameInstance())
{ {
if (UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>()) if (UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
{ {
Theme->OnThemeChanged.RemoveDynamic(this, &UUIPanel_Base::HandleThemeChanged); Theme->OnThemeChanged.RemoveDynamic(this, &UUIPanel_Base::HandleThemeChanged);
} }

View File

@@ -14,7 +14,7 @@ class UBorder;
* (UI_Panel_Master) herda DIRETO desta classe C++ (UMG não encadeia árvores * (UI_Panel_Master) herda DIRETO desta classe C++ (UMG não encadeia árvores
* de WBP — ver ARQUITETURA.md §3.3). * de WBP — ver ARQUITETURA.md §3.3).
* *
* Visual data-driven por FUIStyle.Panel (UZMMOThemeSubsystem). Designers * Visual data-driven por FUIStyle.Panel (UZeusThemeSubsystem). Designers
* injetam o conteúdo no NamedSlot "Content". * injetam o conteúdo no NamedSlot "Content".
*/ */
UCLASS(Abstract, Blueprintable) UCLASS(Abstract, Blueprintable)

View File

@@ -8,7 +8,7 @@ class UButton;
class UHorizontalBox; class UHorizontalBox;
class UTextBlock; class UTextBlock;
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FZMMOOnStatRowPlusClicked, int32, StatId); DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FZeusOnStatRowPlusClicked, int32, StatId);
/** /**
* Linha de um stat primário (STR/AGI/VIT/INT/DEX/LUK) na janela de Status. * Linha de um stat primário (STR/AGI/VIT/INT/DEX/LUK) na janela de Status.
@@ -44,7 +44,7 @@ public:
/** Disparado quando o usuário clica em "+". */ /** Disparado quando o usuário clica em "+". */
UPROPERTY(BlueprintAssignable, Category = "Zeus|Status") UPROPERTY(BlueprintAssignable, Category = "Zeus|Status")
FZMMOOnStatRowPlusClicked OnPlusClicked; FZeusOnStatRowPlusClicked OnPlusClicked;
protected: protected:
virtual void NativeOnInitialized() override; virtual void NativeOnInitialized() override;

View File

@@ -10,10 +10,11 @@
#include "GameFramework/PlayerState.h" #include "GameFramework/PlayerState.h"
#include "Internationalization/Text.h" #include "Internationalization/Text.h"
#include "ZMMO.h" #include "ZMMO.h"
#include "ZMMOAttributeComponent.h" #include "ZeusAttributesPayload.h" // FZeusAttributesPayload (ZeusNetwork)
#include "ZMMOJobDataAsset.h" #include "ZeusGASComponent.h" // UZeusGASComponent (ZeusGAS)
#include "ZMMOJobsSubsystem.h" #include "ZeusJobDataAsset.h"
#include "ZMMOPlayerState.h" #include "ZeusJobsSubsystem.h"
#include "ZeusPlayerState.h"
#include "UI/InGame/UIInGameFlowSubsystem.h" #include "UI/InGame/UIInGameFlowSubsystem.h"
#include "UI/InGameTypes.h" #include "UI/InGameTypes.h"
#include "UI/Widgets/UIPlayerStatus_BonusRow.h" #include "UI/Widgets/UIPlayerStatus_BonusRow.h"
@@ -107,46 +108,56 @@ void UUIPlayerStatus_Window::BindToLocalPlayer()
APlayerController* PC = World->GetFirstPlayerController(); APlayerController* PC = World->GetFirstPlayerController();
if (!PC || !PC->PlayerState) return; if (!PC || !PC->PlayerState) return;
// CharName vem do AZMMOPlayerState (setado pelo S_SPAWN_PLAYER no spawn // CharName vem do AZeusPlayerState (setado pelo S_SPAWN_PLAYER no spawn
// local). Fallback pra APlayerState::GetPlayerName() se o cast falhar ou // local). Fallback pra APlayerState::GetPlayerName() se o cast falhar ou
// se CharName ainda nao chegou (race com handler que dispara o widget). // se CharName ainda nao chegou (race com handler que dispara o widget).
if (Text_CharName) if (Text_CharName)
{ {
FString DisplayName = PC->PlayerState->GetPlayerName(); FString DisplayName = PC->PlayerState->GetPlayerName();
if (const AZMMOPlayerState* ZMMOPs = Cast<AZMMOPlayerState>(PC->PlayerState)) if (const AZeusPlayerState* ZeusPs = Cast<AZeusPlayerState>(PC->PlayerState))
{ {
if (!ZMMOPs->CharName.IsEmpty()) if (!ZeusPs->CharName.IsEmpty())
{ {
DisplayName = ZMMOPs->CharName; DisplayName = ZeusPs->CharName;
} }
} }
Text_CharName->SetText(FText::FromString(DisplayName)); Text_CharName->SetText(FText::FromString(DisplayName));
} }
UZMMOAttributeComponent* Comp = PC->PlayerState->FindComponentByClass<UZMMOAttributeComponent>(); UZeusGASComponent* Comp = PC->PlayerState->FindComponentByClass<UZeusGASComponent>();
if (!Comp || Comp == BoundComponent.Get()) return; if (!Comp || Comp == BoundComponent.Get()) return;
UnbindFromComponent(); UnbindFromComponent();
BoundComponent = Comp; BoundComponent = Comp;
Comp->OnAttributesChanged.AddDynamic(this, &UUIPlayerStatus_Window::HandleAttributesChanged); // Raw e' non-dynamic (FZeusAttributesPayload nao e' BlueprintType) — AddUObject.
SnapshotRawHandle = Comp->OnSnapshotAppliedRaw.AddUObject(this, &UUIPlayerStatus_Window::HandleSnapshotRaw);
Comp->OnStatAllocReply.AddDynamic(this, &UUIPlayerStatus_Window::HandleStatAllocReply); Comp->OnStatAllocReply.AddDynamic(this, &UUIPlayerStatus_Window::HandleStatAllocReply);
RefreshFromSnapshot(Comp->GetSnapshot());
// Refresh imediato — caso o snapshot ja' tenha chegado antes do bind.
if (Comp->HasSnapshot())
{
HandleSnapshotRaw(Comp->GetLastSnapshot());
}
} }
void UUIPlayerStatus_Window::UnbindFromComponent() void UUIPlayerStatus_Window::UnbindFromComponent()
{ {
if (UZMMOAttributeComponent* Old = BoundComponent.Get()) if (UZeusGASComponent* Old = BoundComponent.Get())
{ {
Old->OnAttributesChanged.RemoveDynamic(this, &UUIPlayerStatus_Window::HandleAttributesChanged); if (SnapshotRawHandle.IsValid())
{
Old->OnSnapshotAppliedRaw.Remove(SnapshotRawHandle);
SnapshotRawHandle.Reset();
}
Old->OnStatAllocReply.RemoveDynamic(this, &UUIPlayerStatus_Window::HandleStatAllocReply); Old->OnStatAllocReply.RemoveDynamic(this, &UUIPlayerStatus_Window::HandleStatAllocReply);
} }
BoundComponent.Reset(); BoundComponent.Reset();
} }
void UUIPlayerStatus_Window::HandleAttributesChanged(const FZMMOAttributesSnapshot& Snapshot) void UUIPlayerStatus_Window::HandleSnapshotRaw(const FZeusAttributesPayload& Payload)
{ {
bPlusButtonsLocked = false; bPlusButtonsLocked = false;
RefreshFromSnapshot(Snapshot); RefreshFromSnapshot(FZeusAttributesSnapshot::FromPayload(Payload));
} }
void UUIPlayerStatus_Window::HandleStatAllocReply(bool bAccepted, int32 Reason) void UUIPlayerStatus_Window::HandleStatAllocReply(bool bAccepted, int32 Reason)
@@ -155,17 +166,20 @@ void UUIPlayerStatus_Window::HandleStatAllocReply(bool bAccepted, int32 Reason)
bAccepted ? 1 : 0, Reason); bAccepted ? 1 : 0, Reason);
bPlusButtonsLocked = false; bPlusButtonsLocked = false;
if (UZMMOAttributeComponent* Comp = BoundComponent.Get()) if (UZeusGASComponent* Comp = BoundComponent.Get())
{ {
const FZMMOAttributesSnapshot& S = Comp->GetSnapshot(); if (Comp->HasSnapshot())
SetAllPrimaryRowsPlusEnabled(S.StatusPoint > 0); {
const FZeusAttributesPayload& P = Comp->GetLastSnapshot();
SetAllPrimaryRowsPlusEnabled(P.StatusPoint > 0);
}
} }
} }
void UUIPlayerStatus_Window::HandleRowPlusClicked(int32 StatId) void UUIPlayerStatus_Window::HandleRowPlusClicked(int32 StatId)
{ {
if (bPlusButtonsLocked) return; if (bPlusButtonsLocked) return;
UZMMOAttributeComponent* Comp = BoundComponent.Get(); UZeusGASComponent* Comp = BoundComponent.Get();
if (!Comp) return; if (!Comp) return;
bPlusButtonsLocked = true; bPlusButtonsLocked = true;
@@ -184,7 +198,7 @@ void UUIPlayerStatus_Window::SetAllPrimaryRowsPlusEnabled(bool bEnabled)
Set(Row_Int); Set(Row_Dex); Set(Row_Luk); Set(Row_Int); Set(Row_Dex); Set(Row_Luk);
} }
void UUIPlayerStatus_Window::RefreshFromSnapshot(const FZMMOAttributesSnapshot& S) void UUIPlayerStatus_Window::RefreshFromSnapshot(const FZeusAttributesSnapshot& S)
{ {
// Primários: snapshot atual não splita base/bonus de primários (só derivados). // Primários: snapshot atual não splita base/bonus de primários (só derivados).
if (Row_Str) Row_Str->SetValues(S.Str, 0); if (Row_Str) Row_Str->SetValues(S.Str, 0);
@@ -202,9 +216,9 @@ void UUIPlayerStatus_Window::RefreshFromSnapshot(const FZMMOAttributesSnapshot&
FText JobName; FText JobName;
if (UGameInstance* GI = GetGameInstance()) if (UGameInstance* GI = GetGameInstance())
{ {
if (const UZMMOJobsSubsystem* Jobs = GI->GetSubsystem<UZMMOJobsSubsystem>()) if (const UZeusJobsSubsystem* Jobs = GI->GetSubsystem<UZeusJobsSubsystem>())
{ {
if (const UZMMOJobDataAsset* Data = Jobs->GetJobData(S.ClassId)) if (const UZeusJobDataAsset* Data = Jobs->GetJobData(S.ClassId))
{ {
JobName = Data->DisplayName; JobName = Data->DisplayName;
} }
@@ -244,7 +258,7 @@ void UUIPlayerStatus_Window::HandleCloseClicked()
{ {
if (UUIInGameFlowSubsystem* Flow = GI->GetSubsystem<UUIInGameFlowSubsystem>()) if (UUIInGameFlowSubsystem* Flow = GI->GetSubsystem<UUIInGameFlowSubsystem>())
{ {
Flow->SetState(EZMMOInGameUIState::Playing); Flow->SetState(EZeusInGameUIState::Playing);
} }
} }
} }
@@ -259,7 +273,7 @@ FReply UUIPlayerStatus_Window::NativeOnKeyDown(const FGeometry& Geom, const FKey
{ {
if (UUIInGameFlowSubsystem* Flow = GI->GetSubsystem<UUIInGameFlowSubsystem>()) if (UUIInGameFlowSubsystem* Flow = GI->GetSubsystem<UUIInGameFlowSubsystem>())
{ {
Flow->SetState(EZMMOInGameUIState::Playing); Flow->SetState(EZeusInGameUIState::Playing);
return FReply::Handled(); return FReply::Handled();
} }
} }

View File

@@ -2,7 +2,7 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "UI/Common/UIDraggableWindow_Base.h" #include "UI/Common/UIDraggableWindow_Base.h"
#include "ZMMOAttributeTypes.h" #include "ZeusAttributesSnapshot.h"
#include "UIPlayerStatus_Window.generated.h" #include "UIPlayerStatus_Window.generated.h"
class UButton; class UButton;
@@ -10,13 +10,14 @@ class UTextBlock;
class UHorizontalBox; class UHorizontalBox;
class UUIPlayerStatus_BonusRow; class UUIPlayerStatus_BonusRow;
class UUIPlayerStatus_StatRow; class UUIPlayerStatus_StatRow;
class UZMMOAttributeComponent; class UZeusGASComponent;
struct FZeusAttributesPayload;
/** /**
* Janela de Status do player — composta por instâncias dos sub-widgets * Janela de Status do player — composta por instâncias dos sub-widgets
* UUIPlayerStatus_StatRow (6 primários) e UUIPlayerStatus_BonusRow (8 derivados). * UUIPlayerStatus_StatRow (6 primários) e UUIPlayerStatus_BonusRow (8 derivados).
* *
* Consome o UZMMOAttributeComponent do PlayerState e a pipeline de * Consome o UZeusAttributeComponent do PlayerState e a pipeline de
* C_STAT_ALLOC (RequestStatAlloc → server valida → OnStatAllocReply). * C_STAT_ALLOC (RequestStatAlloc → server valida → OnStatAllocReply).
* *
* Pareada com o WBP UI_PlayerStatus_Window. Os 14 rows são BindWidgetOptional * Pareada com o WBP UI_PlayerStatus_Window. Os 14 rows são BindWidgetOptional
@@ -30,7 +31,7 @@ class ZMMO_API UUIPlayerStatus_Window : public UUIDraggableWindow_Base
public: public:
UUIPlayerStatus_Window(const FObjectInitializer& ObjectInitializer); UUIPlayerStatus_Window(const FObjectInitializer& ObjectInitializer);
/** Chave de persistencia no UZMMOUISaveGame. Estavel — nao renomear. */ /** Chave de persistencia no UZeusUISaveGame. Estavel — nao renomear. */
virtual FName GetWindowId() const override { return TEXT("PlayerStatus"); } virtual FName GetWindowId() const override { return TEXT("PlayerStatus"); }
protected: protected:
@@ -94,17 +95,25 @@ protected:
private: private:
void BindToLocalPlayer(); void BindToLocalPlayer();
void UnbindFromComponent(); void UnbindFromComponent();
void RefreshFromSnapshot(const FZMMOAttributesSnapshot& Snap); void RefreshFromSnapshot(const FZeusAttributesSnapshot& Snap);
void SetAllPrimaryRowsPlusEnabled(bool bEnabled); void SetAllPrimaryRowsPlusEnabled(bool bEnabled);
void BindRow(UUIPlayerStatus_StatRow* Row, int32 StatId, const TCHAR* IconLetter, const TCHAR* DisplayName); void BindRow(UUIPlayerStatus_StatRow* Row, int32 StatId, const TCHAR* IconLetter, const TCHAR* DisplayName);
UFUNCTION() void HandleAttributesChanged(const FZMMOAttributesSnapshot& Snapshot); /// Listener C++ no payload bruto (FZeusAttributesPayload nao e' BlueprintType
/// — delegate multicast nativo). Converte pra FZeusAttributesSnapshot e
/// chama RefreshFromSnapshot.
void HandleSnapshotRaw(const FZeusAttributesPayload& Payload);
UFUNCTION() void HandleStatAllocReply(bool bAccepted, int32 Reason); UFUNCTION() void HandleStatAllocReply(bool bAccepted, int32 Reason);
UFUNCTION() void HandleRowPlusClicked(int32 StatId); UFUNCTION() void HandleRowPlusClicked(int32 StatId);
UFUNCTION() void HandleCloseClicked(); UFUNCTION() void HandleCloseClicked();
UPROPERTY(Transient) UPROPERTY(Transient)
TWeakObjectPtr<UZMMOAttributeComponent> BoundComponent; TWeakObjectPtr<UZeusGASComponent> BoundComponent;
/// Handle do listener nao-dynamic em OnSnapshotAppliedRaw — guardar pra remover
/// em UnbindFromComponent (AddUObject nao auto-cleanup como AddDynamic).
FDelegateHandle SnapshotRawHandle;
/** Trava local pra evitar spam-click: vira true ao clicar, false ao /** Trava local pra evitar spam-click: vira true ao clicar, false ao
* receber StatAllocReply (ou snapshot novo, o que vier primeiro). */ * receber StatAllocReply (ou snapshot novo, o que vier primeiro). */

View File

@@ -10,7 +10,7 @@
#include "Styling/SlateTypes.h" #include "Styling/SlateTypes.h"
#include "UI/UIStyleRow.h" #include "UI/UIStyleRow.h"
#include "UI/UIStyleTokens.h" #include "UI/UIStyleTokens.h"
#include "ZMMOThemeSubsystem.h" #include "ZeusThemeSubsystem.h"
namespace namespace
{ {
@@ -59,7 +59,7 @@ namespace
{ {
if (const UGameInstance* GI = Widget->GetGameInstance()) if (const UGameInstance* GI = Widget->GetGameInstance())
{ {
if (const UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>()) if (const UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
{ {
return Theme->GetActiveUIStyle(); return Theme->GetActiveUIStyle();
} }
@@ -135,7 +135,7 @@ void UUIProgressBar_Base::NativeConstruct()
{ {
if (const UGameInstance* GI = GetGameInstance()) if (const UGameInstance* GI = GetGameInstance())
{ {
if (UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>()) if (UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
{ {
Theme->OnThemeChanged.AddDynamic(this, &UUIProgressBar_Base::HandleThemeChanged); Theme->OnThemeChanged.AddDynamic(this, &UUIProgressBar_Base::HandleThemeChanged);
bThemeBound = true; bThemeBound = true;
@@ -163,7 +163,7 @@ void UUIProgressBar_Base::NativeDestruct()
{ {
if (const UGameInstance* GI = GetGameInstance()) if (const UGameInstance* GI = GetGameInstance())
{ {
if (UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>()) if (UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
{ {
Theme->OnThemeChanged.RemoveDynamic(this, &UUIProgressBar_Base::HandleThemeChanged); Theme->OnThemeChanged.RemoveDynamic(this, &UUIProgressBar_Base::HandleThemeChanged);
} }

View File

@@ -1,6 +1,6 @@
#include "UISpinner_Base.h" #include "UISpinner_Base.h"
#include "ZMMOThemeSubsystem.h" #include "ZeusThemeSubsystem.h"
#include "Engine/GameInstance.h" #include "Engine/GameInstance.h"
#include "Engine/DataTable.h" #include "Engine/DataTable.h"
#include "Components/CircularThrobber.h" #include "Components/CircularThrobber.h"
@@ -16,7 +16,7 @@ namespace
{ {
if (const UGameInstance* GI = Widget->GetGameInstance()) if (const UGameInstance* GI = Widget->GetGameInstance())
{ {
if (const UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>()) if (const UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
{ {
return Theme->GetActiveUIStyle(); return Theme->GetActiveUIStyle();
} }
@@ -103,7 +103,7 @@ void UUISpinner_Base::NativeConstruct()
{ {
if (const UGameInstance* GI = GetGameInstance()) if (const UGameInstance* GI = GetGameInstance())
{ {
if (UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>()) if (UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
{ {
Theme->OnThemeChanged.AddDynamic(this, &UUISpinner_Base::HandleThemeChanged); Theme->OnThemeChanged.AddDynamic(this, &UUISpinner_Base::HandleThemeChanged);
bThemeBound = true; bThemeBound = true;
@@ -119,7 +119,7 @@ void UUISpinner_Base::NativeDestruct()
{ {
if (const UGameInstance* GI = GetGameInstance()) if (const UGameInstance* GI = GetGameInstance())
{ {
if (UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>()) if (UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
{ {
Theme->OnThemeChanged.RemoveDynamic(this, &UUISpinner_Base::HandleThemeChanged); Theme->OnThemeChanged.RemoveDynamic(this, &UUISpinner_Base::HandleThemeChanged);
} }

View File

@@ -13,7 +13,7 @@ class UCircularThrobber;
* (UI_Spinner_Master) herda DIRETO desta classe C++ (UMG não encadeia * (UI_Spinner_Master) herda DIRETO desta classe C++ (UMG não encadeia
* árvores — ARQUITETURA.md §3.3). * árvores — ARQUITETURA.md §3.3).
* *
* Visual data-driven por FUIStyle.Spinner (UZMMOThemeSubsystem). C++ aplica * Visual data-driven por FUIStyle.Spinner (UZeusThemeSubsystem). C++ aplica
* NumberOfPieces/Period/Radius no UCircularThrobber; cor/brush vão pelo hook * NumberOfPieces/Period/Radius no UCircularThrobber; cor/brush vão pelo hook
* BP_ApplySpinnerStyle (o WBP tinge a imagem do throbber). * BP_ApplySpinnerStyle (o WBP tinge a imagem do throbber).
*/ */

View File

@@ -1,11 +0,0 @@
#include "ZMMOThemeDataAsset.h"
bool UZMMOThemeDataAsset::HasKey(EZMMOThemeKey Key) const
{
return Entries.Contains(Key);
}
const FThemeEntry* UZMMOThemeDataAsset::FindEntry(EZMMOThemeKey Key) const
{
return Entries.Find(Key);
}

View File

@@ -0,0 +1,11 @@
#include "ZeusThemeDataAsset.h"
bool UZeusThemeDataAsset::HasKey(EZeusThemeKey Key) const
{
return Entries.Contains(Key);
}
const FThemeEntry* UZeusThemeDataAsset::FindEntry(EZeusThemeKey Key) const
{
return Entries.Find(Key);
}

Some files were not shown because too many files have changed in this diff Show More