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>
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
GameDefaultMap=/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).
|
||||
; O motor pode spawnar AZMMOGameMode directamente; um BP filho continua opcional.
|
||||
GlobalDefaultGameMode=/Script/ZMMO.ZMMOGameMode
|
||||
GameInstanceClass=/Script/ZMMO.ZMMOGameInstance
|
||||
; O motor pode spawnar AZeusGameMode directamente; um BP filho continua opcional.
|
||||
GlobalDefaultGameMode=/Script/ZMMO.ZeusGameMode
|
||||
GameInstanceClass=/Script/ZMMO.ZeusGameInstance
|
||||
|
||||
[/Script/Engine.RendererSettings]
|
||||
r.ReflectionMethod=1
|
||||
@@ -80,11 +80,30 @@ GameViewportClientClassName=/Script/CommonUI.CommonGameViewportClient
|
||||
+ActiveGameNameRedirects=(OldGameName="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).
|
||||
; ZMMOCharacter foi reescrito como ZMMOPlayerCharacter (ACharacter local com CMC livre).
|
||||
+ActiveClassRedirects=(OldClassName="TP_ThirdPersonPlayerController",NewClassName="ZMMOPlayerController")
|
||||
+ActiveClassRedirects=(OldClassName="TP_ThirdPersonGameMode",NewClassName="ZMMOGameMode")
|
||||
+ActiveClassRedirects=(OldClassName="TP_ThirdPersonCharacter",NewClassName="ZMMOPlayerCharacter")
|
||||
+ActiveClassRedirects=(OldClassName="ZMMOCharacter",NewClassName="ZMMOPlayerCharacter")
|
||||
; Pipeline: TP_ThirdPerson* -> ZMMO* (legado) -> Zeus* (atual). Os redirects de
|
||||
; ZMMO*->Zeus* preservam asset/BP refs criadas durante o periodo ZMMO* (Batches 1-3).
|
||||
+ActiveClassRedirects=(OldClassName="TP_ThirdPersonPlayerController",NewClassName="ZeusPlayerController")
|
||||
+ActiveClassRedirects=(OldClassName="TP_ThirdPersonGameMode",NewClassName="ZeusGameMode")
|
||||
+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]
|
||||
; Migração v1→v2 do FUIStylePanel: TMap<EUIPanelTexture,...> (Enum) → TMap<FName,...>.
|
||||
|
||||
@@ -3,10 +3,10 @@ ProjectID=FC3E256F43B2AFD43009F4949B0814BE
|
||||
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).
|
||||
;
|
||||
; - 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.
|
||||
; - CalendarTable points to DT_ThemeCalendar (FThemeCalendarRow rows).
|
||||
; - 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.
|
||||
; -----------------------------------------------------------------------------
|
||||
|
||||
[/Script/ZMMO.ZMMOThemeSubsystem]
|
||||
[/Script/ZMMO.ZeusThemeSubsystem]
|
||||
;DefaultThemeAsset=/Game/ZMMO/UI/Themes/DA_Theme_Default.DA_Theme_Default
|
||||
;+ThemeRegistry=(("Christmas", "/Game/ZMMO/UI/Themes/DA_Theme_Christmas.DA_Theme_Christmas"))
|
||||
;+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
|
||||
; 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
|
||||
|
||||
; 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).
|
||||
LoadingProfilesAsset=/Game/ZMMO/Data/UI/Loading/DA_LoadingProfiles.DA_LoadingProfiles
|
||||
LoadingTipsAsset=/Game/ZMMO/Data/UI/Loading/DT_LoadingTips.DT_LoadingTips
|
||||
|
||||
; -----------------------------------------------------------------------------
|
||||
; 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.)
|
||||
; - Subsystem orquestra: AZMMOHUD::BeginPlay chama StartInGame que vai pra
|
||||
; - Subsystem orquestra: AZeusHUD::BeginPlay chama StartInGame que vai pra
|
||||
; Playing.
|
||||
; Asset criado via MCP em /Game/ZMMO/UI/InGame/DA_InGameScreenSet.
|
||||
; -----------------------------------------------------------------------------
|
||||
@@ -56,16 +56,16 @@ ScreenSetAsset=/Game/ZMMO/UI/InGame/DA_InGameScreenSet.DA_InGameScreenSet
|
||||
|
||||
; -----------------------------------------------------------------------------
|
||||
; 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
|
||||
; 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
|
||||
; C++; UClass resolve pelo nome curto).
|
||||
; -----------------------------------------------------------------------------
|
||||
|
||||
[/Script/ZMMO.ZMMOPlayerState]
|
||||
+ComponentClasses=/Script/ZMMOAttributes.ZMMOAttributeComponent
|
||||
[/Script/ZMMO.ZeusPlayerState]
|
||||
+ComponentClasses=/Script/ZeusAttributes.ZeusAttributeComponent
|
||||
|
||||
[/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))
|
||||
|
||||
@@ -10,17 +10,17 @@
|
||||
*
|
||||
* Fluxo: Boot → Connecting → Login → ServerSelect → Lobby → EnteringWorld
|
||||
* → 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)
|
||||
enum class EZMMOFrontEndState : uint8
|
||||
enum class EZeusFrontEndState : uint8
|
||||
{
|
||||
None,
|
||||
Boot, // splash inicial enquanto subsistemas sobem
|
||||
Connecting, // conectando ao servidor Zeus (UDP)
|
||||
Login, // autenticação
|
||||
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
|
||||
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.
|
||||
*/
|
||||
UENUM(BlueprintType)
|
||||
enum class EZMMOLobbyPage : uint8
|
||||
enum class EZeusLobbyPage : uint8
|
||||
{
|
||||
None,
|
||||
CharacterSelect,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Estados da UI in-game. Dirigidos pelo UUIInGameFlowSubsystem; cada estado
|
||||
* 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)
|
||||
* - In-game usa estados pra HUD/Status/Inventory/Skills (UI.Layer.Game + GameMenu)
|
||||
*
|
||||
@@ -22,7 +22,7 @@
|
||||
* Layer.GameMenu por cima dele.
|
||||
*/
|
||||
UENUM(BlueprintType)
|
||||
enum class EZMMOInGameUIState : uint8
|
||||
enum class EZeusInGameUIState : uint8
|
||||
{
|
||||
None, ///< Antes do player local spawnar; UI in-game inativa.
|
||||
Playing, ///< HUD principal visivel (HP/SP/level/etc).
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
|
||||
/**
|
||||
* 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
|
||||
* (HandlePostLoadMap, OnPlayerSpawned, etc) — server não envia opcode de
|
||||
* progresso, ver decisão em [[project_ui_loading_dynamic]].
|
||||
*/
|
||||
UENUM(BlueprintType)
|
||||
enum class EZMMOLoadingContext : uint8
|
||||
enum class EZeusLoadingContext : uint8
|
||||
{
|
||||
None,
|
||||
FrontEndEnteringWorld, ///< FrontEnd → mundo (handoff CharServer→WorldServer + spawn).
|
||||
@@ -21,7 +21,7 @@ enum class EZMMOLoadingContext : uint8
|
||||
};
|
||||
|
||||
UENUM(BlueprintType)
|
||||
enum class EZMMOLoadingStepStatus : uint8
|
||||
enum class EZeusLoadingStepStatus : uint8
|
||||
{
|
||||
Pending, ///< Ainda não começou.
|
||||
Running, ///< Em andamento (o "barber pole").
|
||||
@@ -34,7 +34,7 @@ enum class EZMMOLoadingStepStatus : uint8
|
||||
* pra chamar MarkStepDone(StepId); Label é o texto localizado mostrado.
|
||||
*/
|
||||
USTRUCT(BlueprintType)
|
||||
struct FZMMOLoadingStepDef
|
||||
struct FZeusLoadingStepDef
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -52,13 +52,13 @@ struct FZMMOLoadingStepDef
|
||||
* consulta StepId pra avançar etapa.
|
||||
*/
|
||||
USTRUCT(BlueprintType)
|
||||
struct FZMMOLoadingProfile
|
||||
struct FZeusLoadingProfile
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
/** Etapas em ordem. ProgressBar = #Done / #Steps. */
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Loading")
|
||||
TArray<FZMMOLoadingStepDef> Steps;
|
||||
TArray<FZeusLoadingStepDef> Steps;
|
||||
|
||||
/** Título da tela (vazio = usa default da classe). */
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Loading")
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "ThemeKeys.generated.h"
|
||||
|
||||
UENUM(BlueprintType)
|
||||
enum class EZMMOThemeKey : uint8
|
||||
enum class EZeusThemeKey : uint8
|
||||
{
|
||||
// HUD
|
||||
HUD_Frame UMETA(DisplayName = "HUD - Frame"),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "UI/UILayerTags.h"
|
||||
|
||||
namespace ZMMOUITags
|
||||
namespace ZeusUITags
|
||||
{
|
||||
UE_DEFINE_GAMEPLAY_TAG(UI_Layer_Game, "UI.Layer.Game");
|
||||
UE_DEFINE_GAMEPLAY_TAG(UI_Layer_GameMenu, "UI.Layer.GameMenu");
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* UI.Layer.Menu — front-end (Boot/Login/ServerSelect/Lobby)
|
||||
* 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_GameMenu);
|
||||
|
||||
@@ -73,7 +73,7 @@ struct ZMMO_API FUIStyle
|
||||
/**
|
||||
* Linha de DT_UI_Styles. O Row Name é o ThemeId (ex.: "Default", "RPG"),
|
||||
* 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)
|
||||
struct ZMMO_API FUIStyleRow : public FTableRowBase
|
||||
@@ -87,7 +87,7 @@ struct ZMMO_API FUIStyleRow : public FTableRowBase
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style")
|
||||
EUITheme Theme = EUITheme::None;
|
||||
|
||||
/** Ponte para o ThemeId resolvido pelo UZMMOThemeSubsystem. */
|
||||
/** Ponte para o ThemeId resolvido pelo UZeusThemeSubsystem. */
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style")
|
||||
FName ThemeId;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Enums do sistema de UI Style (tokens de tema visual).
|
||||
*
|
||||
* 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
|
||||
* design-time ao preencher DT_UI_Styles — não é a chave de runtime.
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "MapDef.generated.h"
|
||||
|
||||
/**
|
||||
* FZMMOMapSpawn
|
||||
* FZeusMapSpawn
|
||||
*
|
||||
* Ponto de spawn dentro de um mapa, identificado por `Tag`. Usado pelo
|
||||
* server pra decidir onde materializar um char quando ele entra:
|
||||
@@ -15,12 +15,12 @@
|
||||
* - Char saindo de raid: pode pedir tag="raid_return"
|
||||
* - Char morto: pode pedir tag="graveyard"
|
||||
*
|
||||
* ZeusEditorTools pode auto-popular o `Spawns[]` do FZMMOMapDef varrendo
|
||||
* todos APlayerStart (ou ator custom AZMMOMapSpawnPoint) presentes no
|
||||
* ZeusEditorTools pode auto-popular o `Spawns[]` do FZeusMapDef varrendo
|
||||
* todos APlayerStart (ou ator custom AZeusMapSpawnPoint) presentes no
|
||||
* `.umap` do `ClientLevel` — botao "Sync from level".
|
||||
*/
|
||||
USTRUCT(BlueprintType)
|
||||
struct ZMMO_API FZMMOMapSpawn
|
||||
struct ZMMO_API FZeusMapSpawn
|
||||
{
|
||||
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.
|
||||
* 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.
|
||||
*/
|
||||
USTRUCT(BlueprintType)
|
||||
struct ZMMO_API FZMMOMapDef : public FTableRowBase
|
||||
struct ZMMO_API FZeusMapDef : public FTableRowBase
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -77,7 +77,7 @@ struct ZMMO_API FZMMOMapDef : public FTableRowBase
|
||||
* Pelo menos um com Tag="default" e esperado.
|
||||
*/
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Map|Spawns")
|
||||
TArray<FZMMOMapSpawn> Spawns;
|
||||
TArray<FZeusMapSpawn> Spawns;
|
||||
|
||||
/** Regras PvP/Safe/Dungeon. Reusa enum de FZoneRow. */
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Map")
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#include "ZMMOFrontEndPlayerController.h"
|
||||
#include "ZeusFrontEndPlayerController.h"
|
||||
|
||||
#include "UIFrontEndFlowSubsystem.h"
|
||||
#include "Engine/GameInstance.h"
|
||||
|
||||
AZMMOFrontEndPlayerController::AZMMOFrontEndPlayerController()
|
||||
AZeusFrontEndPlayerController::AZeusFrontEndPlayerController()
|
||||
{
|
||||
bShowMouseCursor = true;
|
||||
}
|
||||
|
||||
void AZMMOFrontEndPlayerController::BeginPlay()
|
||||
void AZeusFrontEndPlayerController::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
@@ -2,24 +2,24 @@
|
||||
|
||||
#include "CoreMinimal.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
|
||||
* front-end (UUIFrontEndFlowSubsystem) — feito aqui, e não no
|
||||
* GameInstance::Init, porque os subsistemas já existem neste ponto (ver
|
||||
* aviso no header do ZeusNetworkSubsystem).
|
||||
*/
|
||||
UCLASS(Blueprintable, BlueprintType)
|
||||
class ZMMO_API AZMMOFrontEndPlayerController : public APlayerController
|
||||
class ZMMO_API AZeusFrontEndPlayerController : public APlayerController
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
AZMMOFrontEndPlayerController();
|
||||
AZeusFrontEndPlayerController();
|
||||
|
||||
protected:
|
||||
virtual void BeginPlay() override;
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "ZMMOPlayerController.h"
|
||||
#include "ZeusPlayerController.h"
|
||||
|
||||
#include "Blueprint/UserWidget.h"
|
||||
#include "Components/InputComponent.h"
|
||||
@@ -13,11 +13,11 @@
|
||||
#include "UI/InGame/UIInGameFlowSubsystem.h"
|
||||
#include "UI/InGameTypes.h"
|
||||
|
||||
AZMMOPlayerController::AZMMOPlayerController()
|
||||
AZeusPlayerController::AZeusPlayerController()
|
||||
{
|
||||
// Defaults dos Input Mapping Contexts (alinhados ao ZClientMMO). Permitem
|
||||
// instanciar AZMMOPlayerController directamente como
|
||||
// `PlayerControllerClass` do AZMMOGameMode sem exigir um BP filho. Se o
|
||||
// instanciar AZeusPlayerController directamente como
|
||||
// `PlayerControllerClass` do AZeusGameMode sem exigir um BP filho. Se o
|
||||
// projeto adicionar mais IMCs, podemos extender via BP filho ou via
|
||||
// arquivos de Config (UPROPERTY EditAnywhere abaixo).
|
||||
static ConstructorHelpers::FObjectFinder<UInputMappingContext> DefaultImc(
|
||||
@@ -35,7 +35,7 @@ AZMMOPlayerController::AZMMOPlayerController()
|
||||
}
|
||||
}
|
||||
|
||||
void AZMMOPlayerController::BeginPlay()
|
||||
void AZeusPlayerController::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
@@ -43,7 +43,7 @@ void AZMMOPlayerController::BeginPlay()
|
||||
{
|
||||
// Limpa estado de input herdado da UI do FrontEnd (UIManagerSubsystem
|
||||
// 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
|
||||
// ao pawn porque o Slate ainda esta com foco no widget antigo.
|
||||
FInputModeGameOnly InputMode;
|
||||
@@ -67,7 +67,7 @@ void AZMMOPlayerController::BeginPlay()
|
||||
}
|
||||
}
|
||||
|
||||
void AZMMOPlayerController::SetupInputComponent()
|
||||
void AZeusPlayerController::SetupInputComponent()
|
||||
{
|
||||
Super::SetupInputComponent();
|
||||
|
||||
@@ -101,7 +101,7 @@ void AZMMOPlayerController::SetupInputComponent()
|
||||
FInputKeyBinding& Binding = InputComponent->BindKey(
|
||||
FInputChord(EKeys::A, /*bShift*/ false, /*bCtrl*/ false, /*bAlt*/ true, /*bCmd*/ false),
|
||||
IE_Pressed,
|
||||
this, &AZMMOPlayerController::ToggleStatusWindow);
|
||||
this, &AZeusPlayerController::ToggleStatusWindow);
|
||||
Binding.bConsumeInput = true;
|
||||
Binding.bExecuteWhenPaused = true; // dispara mesmo com StatusWindow aberto (CommonUI menu mode)
|
||||
|
||||
@@ -109,35 +109,35 @@ void AZMMOPlayerController::SetupInputComponent()
|
||||
FInputKeyBinding& JobBinding = InputComponent->BindKey(
|
||||
FInputChord(EKeys::J, /*bShift*/ false, /*bCtrl*/ false, /*bAlt*/ false, /*bCmd*/ false),
|
||||
IE_Pressed,
|
||||
this, &AZMMOPlayerController::ToggleJobChangePanel);
|
||||
this, &AZeusPlayerController::ToggleJobChangePanel);
|
||||
JobBinding.bConsumeInput = true;
|
||||
JobBinding.bExecuteWhenPaused = true;
|
||||
}
|
||||
}
|
||||
|
||||
void AZMMOPlayerController::ToggleStatusWindow()
|
||||
void AZeusPlayerController::ToggleStatusWindow()
|
||||
{
|
||||
if (UGameInstance* GI = GetGameInstance())
|
||||
{
|
||||
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 (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;
|
||||
}
|
||||
@@ -2,26 +2,26 @@
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/PlayerController.h"
|
||||
#include "ZMMOPlayerController.generated.h"
|
||||
#include "ZeusPlayerController.generated.h"
|
||||
|
||||
class UInputMappingContext;
|
||||
class UUserWidget;
|
||||
|
||||
/**
|
||||
* AZMMOPlayerController
|
||||
* AZeusPlayerController
|
||||
*
|
||||
* Player controller do cliente Zeus MMO. Responsavel apenas pela camada de
|
||||
* input do Unreal (Enhanced Input Mapping Contexts e widget opcional de
|
||||
* controlos touch). Toda a logica de identidade Zeus, envio de input e
|
||||
* reconciliacao vive em `AZMMOPlayerCharacter`.
|
||||
* reconciliacao vive em `AZeusCharacter`.
|
||||
*/
|
||||
UCLASS(Blueprintable, BlueprintType)
|
||||
class ZMMO_API AZMMOPlayerController : public APlayerController
|
||||
class ZMMO_API AZeusPlayerController : public APlayerController
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
AZMMOPlayerController();
|
||||
AZeusPlayerController();
|
||||
|
||||
protected:
|
||||
/** Mapping contexts default (sempre adicionados). */
|
||||
@@ -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;
|
||||
}
|
||||
};
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "ZMMOPlayerCharacter.h"
|
||||
#include "ZeusCharacter.h"
|
||||
|
||||
#include "Animation/AnimInstance.h"
|
||||
#include "Camera/CameraComponent.h"
|
||||
@@ -17,15 +17,15 @@
|
||||
#include "Subsystems/WorldSubsystem.h"
|
||||
#include "UObject/ConstructorHelpers.h"
|
||||
#include "ZMMO.h"
|
||||
#include "ZMMOAttributeComponent.h"
|
||||
#include "ZMMOPlayerState.h"
|
||||
#include "ZMMOWorldSubsystem.h"
|
||||
#include "ZeusAttributeComponent.h"
|
||||
#include "ZeusPlayerState.h"
|
||||
#include "ZeusWorldSubsystem.h"
|
||||
#include "ZeusNetworkSubsystem.h"
|
||||
#include "UI/FrontEnd/UIFrontEndFlowSubsystem.h"
|
||||
|
||||
DEFINE_LOG_CATEGORY(LogZMMOPlayer);
|
||||
DEFINE_LOG_CATEGORY(LogZeusPlayer);
|
||||
|
||||
AZMMOPlayerCharacter::AZMMOPlayerCharacter()
|
||||
AZeusCharacter::AZeusCharacter()
|
||||
{
|
||||
PrimaryActorTick.bCanEverTick = true;
|
||||
PrimaryActorTick.bStartWithTickEnabled = true;
|
||||
@@ -55,13 +55,12 @@ AZMMOPlayerCharacter::AZMMOPlayerCharacter()
|
||||
FollowCamera->SetupAttachment(CameraBoom, USpringArmComponent::SocketName);
|
||||
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.
|
||||
|
||||
// Defaults visuais (mesh + AnimBP) — alinhados ao ZClientMMO. Permitem ao
|
||||
// motor spawnar AZMMOPlayerCharacter directamente como DefaultPawnClass do
|
||||
// AZMMOGameMode sem exigir um BP filho. Um BP filho continua opcional para
|
||||
// trocar mesh/AnimBP por mapa.
|
||||
// Defaults visuais (mesh + AnimBP). Permitem ao motor spawnar AZeusCharacter
|
||||
// directamente como DefaultPawnClass do AZeusGameMode sem exigir um BP filho.
|
||||
// Um BP filho continua opcional para trocar mesh/AnimBP por mapa.
|
||||
if (USkeletalMeshComponent* MeshComponent = GetMesh())
|
||||
{
|
||||
static ConstructorHelpers::FObjectFinder<USkeletalMesh> QuinnMesh(
|
||||
@@ -77,7 +76,7 @@ AZMMOPlayerCharacter::AZMMOPlayerCharacter()
|
||||
}
|
||||
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())
|
||||
@@ -87,12 +86,12 @@ AZMMOPlayerCharacter::AZMMOPlayerCharacter()
|
||||
}
|
||||
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
|
||||
// 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.
|
||||
static ConstructorHelpers::FObjectFinder<UInputAction> MoveActionAsset(
|
||||
TEXT("/Game/Input/Actions/IA_Move.IA_Move"));
|
||||
@@ -109,7 +108,7 @@ AZMMOPlayerCharacter::AZMMOPlayerCharacter()
|
||||
if (JumpActionAsset.Succeeded()) { JumpAction = JumpActionAsset.Object; }
|
||||
}
|
||||
|
||||
void AZMMOPlayerCharacter::BeginPlay()
|
||||
void AZeusCharacter::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
ResolveZeusNetworkSubsystem();
|
||||
@@ -134,77 +133,77 @@ void AZMMOPlayerCharacter::BeginPlay()
|
||||
{
|
||||
C->SetControlRotation(NewRot);
|
||||
}
|
||||
UE_LOG(LogZMMOPlayer, Log,
|
||||
TEXT("AZMMOPlayerCharacter: pawn reposicionado pra pos do DB (%s) yaw=%.1f"),
|
||||
UE_LOG(LogZeusPlayer, Log,
|
||||
TEXT("AZeusCharacter: pawn reposicionado pra pos do DB (%s) yaw=%.1f"),
|
||||
*PosCm.ToString(), YawDeg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AZMMOPlayerCharacter::EndPlay(const EEndPlayReason::Type EndPlayReason)
|
||||
void AZeusCharacter::EndPlay(const EEndPlayReason::Type EndPlayReason)
|
||||
{
|
||||
UnbindZeusSpawnDelegate();
|
||||
ZeusNetwork = nullptr;
|
||||
Super::EndPlay(EndPlayReason);
|
||||
}
|
||||
|
||||
void AZMMOPlayerCharacter::Tick(const float DeltaSeconds)
|
||||
void AZeusCharacter::Tick(const float DeltaSeconds)
|
||||
{
|
||||
Super::Tick(DeltaSeconds);
|
||||
FlushInputAxisToServer(DeltaSeconds);
|
||||
}
|
||||
|
||||
void AZMMOPlayerCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
|
||||
void AZeusCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
|
||||
{
|
||||
if (UEnhancedInputComponent* EnhancedInputComponent = Cast<UEnhancedInputComponent>(PlayerInputComponent))
|
||||
{
|
||||
EnhancedInputComponent->BindAction(JumpAction, ETriggerEvent::Started, this, &AZMMOPlayerCharacter::OnJumpPressed);
|
||||
EnhancedInputComponent->BindAction(JumpAction, ETriggerEvent::Completed, this, &AZMMOPlayerCharacter::OnJumpReleased);
|
||||
EnhancedInputComponent->BindAction(JumpAction, ETriggerEvent::Started, this, &AZeusCharacter::OnJumpPressed);
|
||||
EnhancedInputComponent->BindAction(JumpAction, ETriggerEvent::Completed, this, &AZeusCharacter::OnJumpReleased);
|
||||
|
||||
EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Triggered, this, &AZMMOPlayerCharacter::Move);
|
||||
EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Completed, this, &AZMMOPlayerCharacter::MoveCompleted);
|
||||
EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Triggered, this, &AZeusCharacter::Move);
|
||||
EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Completed, this, &AZeusCharacter::MoveCompleted);
|
||||
|
||||
EnhancedInputComponent->BindAction(LookAction, ETriggerEvent::Triggered, this, &AZMMOPlayerCharacter::Look);
|
||||
EnhancedInputComponent->BindAction(MouseLookAction, ETriggerEvent::Triggered, this, &AZMMOPlayerCharacter::Look);
|
||||
EnhancedInputComponent->BindAction(LookAction, ETriggerEvent::Triggered, this, &AZeusCharacter::Look);
|
||||
EnhancedInputComponent->BindAction(MouseLookAction, ETriggerEvent::Triggered, this, &AZeusCharacter::Look);
|
||||
}
|
||||
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>();
|
||||
DoMove(MovementVector.X, MovementVector.Y);
|
||||
}
|
||||
|
||||
void AZMMOPlayerCharacter::MoveCompleted(const FInputActionValue& Value)
|
||||
void AZeusCharacter::MoveCompleted(const FInputActionValue& Value)
|
||||
{
|
||||
(void)Value;
|
||||
DoMove(0.0f, 0.0f);
|
||||
}
|
||||
|
||||
void AZMMOPlayerCharacter::Look(const FInputActionValue& Value)
|
||||
void AZeusCharacter::Look(const FInputActionValue& Value)
|
||||
{
|
||||
const FVector2D LookAxisVector = Value.Get<FVector2D>();
|
||||
DoLook(LookAxisVector.X, LookAxisVector.Y);
|
||||
}
|
||||
|
||||
void AZMMOPlayerCharacter::OnJumpPressed()
|
||||
void AZeusCharacter::OnJumpPressed()
|
||||
{
|
||||
bPendingJumpPressed = true;
|
||||
DoJumpStart();
|
||||
}
|
||||
|
||||
void AZMMOPlayerCharacter::OnJumpReleased()
|
||||
void AZeusCharacter::OnJumpReleased()
|
||||
{
|
||||
bPendingJumpReleased = true;
|
||||
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);
|
||||
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)
|
||||
{
|
||||
@@ -229,29 +228,29 @@ void AZMMOPlayerCharacter::DoLook(const float Yaw, const float Pitch)
|
||||
}
|
||||
}
|
||||
|
||||
void AZMMOPlayerCharacter::DoJumpStart()
|
||||
void AZeusCharacter::DoJumpStart()
|
||||
{
|
||||
Jump();
|
||||
}
|
||||
|
||||
void AZMMOPlayerCharacter::DoJumpEnd()
|
||||
void AZeusCharacter::DoJumpEnd()
|
||||
{
|
||||
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).
|
||||
// Quando colisao de objetos chegar, podemos ligar uma reconciliacao opcional
|
||||
// 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.
|
||||
}
|
||||
|
||||
void AZMMOPlayerCharacter::ResolveZeusNetworkSubsystem()
|
||||
void AZeusCharacter::ResolveZeusNetworkSubsystem()
|
||||
{
|
||||
if (ZeusNetwork)
|
||||
{
|
||||
@@ -267,7 +266,7 @@ void AZMMOPlayerCharacter::ResolveZeusNetworkSubsystem()
|
||||
ZeusNetwork = GI->GetSubsystem<UZeusNetworkSubsystem>();
|
||||
}
|
||||
|
||||
void AZMMOPlayerCharacter::BindZeusSpawnDelegate()
|
||||
void AZeusCharacter::BindZeusSpawnDelegate()
|
||||
{
|
||||
if (bSpawnDelegateBound || !IsLocallyControlled())
|
||||
{
|
||||
@@ -278,24 +277,24 @@ void AZMMOPlayerCharacter::BindZeusSpawnDelegate()
|
||||
return;
|
||||
}
|
||||
|
||||
ZeusNetwork->OnPlayerSpawned.AddDynamic(this, &AZMMOPlayerCharacter::HandleZeusPlayerSpawned);
|
||||
ZeusNetwork->OnCharInfoReceived.AddDynamic(this, &AZMMOPlayerCharacter::HandleZeusCharInfo);
|
||||
ZeusNetwork->OnPlayerSpawned.AddDynamic(this, &AZeusCharacter::HandleZeusPlayerSpawned);
|
||||
ZeusNetwork->OnCharInfoReceived.AddDynamic(this, &AZeusCharacter::HandleZeusCharInfo);
|
||||
bSpawnDelegateBound = true;
|
||||
}
|
||||
|
||||
void AZMMOPlayerCharacter::UnbindZeusSpawnDelegate()
|
||||
void AZeusCharacter::UnbindZeusSpawnDelegate()
|
||||
{
|
||||
if (!bSpawnDelegateBound || !ZeusNetwork)
|
||||
{
|
||||
bSpawnDelegateBound = false;
|
||||
return;
|
||||
}
|
||||
ZeusNetwork->OnPlayerSpawned.RemoveDynamic(this, &AZMMOPlayerCharacter::HandleZeusPlayerSpawned);
|
||||
ZeusNetwork->OnCharInfoReceived.RemoveDynamic(this, &AZMMOPlayerCharacter::HandleZeusCharInfo);
|
||||
ZeusNetwork->OnPlayerSpawned.RemoveDynamic(this, &AZeusCharacter::HandleZeusPlayerSpawned);
|
||||
ZeusNetwork->OnCharInfoReceived.RemoveDynamic(this, &AZeusCharacter::HandleZeusCharInfo);
|
||||
bSpawnDelegateBound = false;
|
||||
}
|
||||
|
||||
void AZMMOPlayerCharacter::TryRegisterLocalEntityFromCachedSpawn()
|
||||
void AZeusCharacter::TryRegisterLocalEntityFromCachedSpawn()
|
||||
{
|
||||
if (!ZeusNetwork)
|
||||
{
|
||||
@@ -316,19 +315,19 @@ void AZMMOPlayerCharacter::TryRegisterLocalEntityFromCachedSpawn()
|
||||
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)
|
||||
{
|
||||
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).
|
||||
return;
|
||||
}
|
||||
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)
|
||||
{
|
||||
if (InEntityId == 0)
|
||||
@@ -337,20 +336,20 @@ void AZMMOPlayerCharacter::HandleLocalSpawnReady(const int64 InEntityId, const F
|
||||
}
|
||||
|
||||
// PR-HANDOFF-007 — InEntityId é int64 (era int32)
|
||||
if (ZMMOEntityId == InEntityId)
|
||||
if (ZeusEntityId == InEntityId)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ZMMOEntityId = InEntityId;
|
||||
ZeusEntityId = InEntityId;
|
||||
|
||||
UE_LOG(LogZMMOPlayer, Log,
|
||||
TEXT("AZMMOPlayerCharacter: local spawn captured EntityId=%lld pos=(%s) yaw=%.1f t=%lld"),
|
||||
UE_LOG(LogZeusPlayer, Log,
|
||||
TEXT("AZeusCharacter: local spawn captured EntityId=%lld pos=(%s) yaw=%.1f t=%lld"),
|
||||
InEntityId, *PosCm.ToString(), YawDeg, ServerTimeMs);
|
||||
|
||||
if (UWorld* World = GetWorld())
|
||||
{
|
||||
if (UZMMOWorldSubsystem* WorldSubsystem = World->GetSubsystem<UZMMOWorldSubsystem>())
|
||||
if (UZeusWorldSubsystem* WorldSubsystem = World->GetSubsystem<UZeusWorldSubsystem>())
|
||||
{
|
||||
WorldSubsystem->RegisterLocalEntity(InEntityId, this);
|
||||
}
|
||||
@@ -358,16 +357,16 @@ void AZMMOPlayerCharacter::HandleLocalSpawnReady(const int64 InEntityId, const F
|
||||
|
||||
// Identidade publica (EntityId) + seed no AttributeComponent. CharName/Guild
|
||||
// vem separado via S_CHAR_INFO -> HandleZeusCharInfo. AttributeComponent vive
|
||||
// como subobject e recebe seed pra que o ZMMOAttributeNetworkHandler consiga
|
||||
// como subobject e recebe seed pra que o ZeusAttributeNetworkHandler consiga
|
||||
// rotear o snapshot por EntityId desde o primeiro pacote.
|
||||
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);
|
||||
}
|
||||
if (UZMMOAttributeComponent* AttrComp = PS->FindComponentByClass<UZMMOAttributeComponent>())
|
||||
if (UZeusAttributeComponent* AttrComp = PS->FindComponentByClass<UZeusAttributeComponent>())
|
||||
{
|
||||
AttrComp->SeedEntityId(InEntityId);
|
||||
}
|
||||
@@ -376,16 +375,16 @@ void AZMMOPlayerCharacter::HandleLocalSpawnReady(const int64 InEntityId, const F
|
||||
// Aplica char info cacheada (caso S_CHAR_INFO tenha chegado antes do PS existir).
|
||||
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
|
||||
// pushea WBP_HUD em UI.Layer.Game. UZMMOHudWidget::NativeOnActivated auto-binda
|
||||
// no UZMMOAttributeComponent via PlayerState.
|
||||
// pushea WBP_HUD em UI.Layer.Game. UZeusHudWidget::NativeOnActivated auto-binda
|
||||
// no UZeusAttributeComponent 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,
|
||||
TEXT("AZMMOPlayerCharacter: S_CHAR_INFO recebido EntityId=%lld name=%s guild=%s"),
|
||||
UE_LOG(LogZeusPlayer, Log,
|
||||
TEXT("AZeusCharacter: S_CHAR_INFO recebido EntityId=%lld name=%s guild=%s"),
|
||||
InEntityId, *CharName, *GuildName);
|
||||
|
||||
APlayerState* PS = GetPlayerState();
|
||||
@@ -396,13 +395,13 @@ void AZMMOPlayerCharacter::HandleZeusCharInfo(const int64 InEntityId, const FStr
|
||||
// HandleLocalSpawnReady ou em outra oportunidade.
|
||||
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)
|
||||
{
|
||||
@@ -417,14 +416,14 @@ void AZMMOPlayerCharacter::TryApplyCachedCharInfo()
|
||||
}
|
||||
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();
|
||||
if (!ZeusNetwork || !ZeusNetwork->IsConnected())
|
||||
@@ -3,9 +3,9 @@
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/Character.h"
|
||||
#include "Logging/LogMacros.h"
|
||||
#include "ZMMOEntityInterface.h"
|
||||
#include "ZMMOEntityTypes.h"
|
||||
#include "ZMMOPlayerCharacter.generated.h"
|
||||
#include "ZeusEntityInterface.h"
|
||||
#include "ZeusEntityTypes.h"
|
||||
#include "ZeusCharacter.generated.h"
|
||||
|
||||
class USpringArmComponent;
|
||||
class UCameraComponent;
|
||||
@@ -13,13 +13,12 @@ class UInputAction;
|
||||
class UZeusNetworkSubsystem;
|
||||
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`
|
||||
* e do antigo `AZMMOCharacter`, este ator e parte do pipeline de rede Zeus:
|
||||
* Personagem do jogador local. Parte do pipeline de rede Zeus:
|
||||
*
|
||||
* - Continua a usar o `UCharacterMovementComponent` LIVRE para correr a
|
||||
* 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
|
||||
* `InputSendRateHz` (com heartbeat 5 Hz quando parado para evitar
|
||||
* starvation do `MovementSystem` no servidor).
|
||||
* - Implementa `IZMMOEntityInterface` para participar do registry do
|
||||
* `UZMMOWorldSubsystem`, mas `ApplyEntitySnapshot` e `SetEntityRelevant`
|
||||
* - Implementa `IZeusEntityInterface` para participar do registry do
|
||||
* `UZeusWorldSubsystem`, mas `ApplyEntitySnapshot` e `SetEntityRelevant`
|
||||
* sao no-op em V0 — o cliente local nao reconcilia (cliente solto).
|
||||
*
|
||||
* TODO V1: reconciliacao opcional XY quando colisao de objetos chegar; AOI
|
||||
* debug spheres; visual smoothing apos correcao do servidor.
|
||||
*/
|
||||
UCLASS(Blueprintable, BlueprintType)
|
||||
class ZMMO_API AZMMOPlayerCharacter : public ACharacter, public IZMMOEntityInterface
|
||||
class ZMMO_API AZeusCharacter : public ACharacter, public IZeusEntityInterface
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -47,8 +46,8 @@ class ZMMO_API AZMMOPlayerCharacter : public ACharacter, public IZMMOEntityInter
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components", meta = (AllowPrivateAccess = "true"))
|
||||
UCameraComponent* FollowCamera;
|
||||
|
||||
// AttributeComponent vive no PlayerState (AZMMOPlayerState + Component Registry).
|
||||
// Acesso: GetPlayerState<AZMMOPlayerState>()->GetZMMOComponent<UZMMOAttributeComponent>().
|
||||
// AttributeComponent vive no PlayerState (AZeusPlayerState + Component Registry).
|
||||
// Acesso: GetPlayerState<AZeusPlayerState>()->GetZeusComponent<UZeusAttributeComponent>().
|
||||
|
||||
protected:
|
||||
UPROPERTY(EditAnywhere, Category = "Input")
|
||||
@@ -64,7 +63,7 @@ protected:
|
||||
UInputAction* MouseLookAction;
|
||||
|
||||
/** 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;
|
||||
|
||||
/**
|
||||
@@ -73,22 +72,22 @@ protected:
|
||||
* evitar starvation do servidor caso pacotes sejam perdidos. Em movimento
|
||||
* 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;
|
||||
|
||||
public:
|
||||
AZMMOPlayerCharacter();
|
||||
AZeusCharacter();
|
||||
|
||||
virtual void Tick(float DeltaSeconds) override;
|
||||
|
||||
// --- IZMMOEntityInterface ---
|
||||
virtual int64 GetZMMOEntityId() const override { return ZMMOEntityId; }
|
||||
virtual EZMMOEntityType GetZMMOEntityType() const override { return EZMMOEntityType::Player; }
|
||||
virtual void ApplyEntitySnapshot(const FZMMOEntitySnapshot& Snapshot) override;
|
||||
// --- IZeusEntityInterface ---
|
||||
virtual int64 GetZeusEntityId() const override { return ZeusEntityId; }
|
||||
virtual EZeusEntityType GetZeusEntityType() const override { return EZeusEntityType::Player; }
|
||||
virtual void ApplyEntitySnapshot(const FZeusEntitySnapshot& Snapshot) override;
|
||||
virtual void SetEntityRelevant(bool bRelevant) override;
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "ZMMO|Entity")
|
||||
void SetZMMOEntityId(int64 InEntityId) { ZMMOEntityId = InEntityId; }
|
||||
UFUNCTION(BlueprintCallable, Category = "Zeus|Entity")
|
||||
void SetZeusEntityId(int64 InEntityId) { ZeusEntityId = InEntityId; }
|
||||
|
||||
FORCEINLINE USpringArmComponent* GetCameraBoom() const { return CameraBoom; }
|
||||
FORCEINLINE UCameraComponent* GetFollowCamera() const { return FollowCamera; }
|
||||
@@ -131,7 +130,7 @@ private:
|
||||
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).
|
||||
* Metadados publicos do char (Name/Guild) chegam via S_CHAR_INFO em
|
||||
* HandleZeusCharInfo (servidor envia ANTES de S_SPAWN_PLAYER).
|
||||
@@ -152,8 +151,8 @@ private:
|
||||
bool bSpawnDelegateBound = false;
|
||||
|
||||
/** Identidade autoritativa atribuida quando o servidor envia S_SPAWN_PLAYER local. */
|
||||
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Entity", meta = (AllowPrivateAccess = "true"))
|
||||
int64 ZMMOEntityId = 0;
|
||||
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Entity", meta = (AllowPrivateAccess = "true"))
|
||||
int64 ZeusEntityId = 0;
|
||||
|
||||
float PendingMoveForward = 0.0f;
|
||||
float PendingMoveRight = 0.0f;
|
||||
@@ -1,31 +1,31 @@
|
||||
#include "ZMMOEntity.h"
|
||||
#include "ZeusEntity.h"
|
||||
|
||||
AZMMOEntity::AZMMOEntity()
|
||||
AZeusEntity::AZeusEntity()
|
||||
{
|
||||
PrimaryActorTick.bCanEverTick = false;
|
||||
bReplicates = false;
|
||||
}
|
||||
|
||||
void AZMMOEntity::SetZMMOIdentity(const int64 InEntityId, const EZMMOEntityType InEntityType)
|
||||
void AZeusEntity::SetZeusIdentity(const int64 InEntityId, const EZeusEntityType InEntityType)
|
||||
{
|
||||
EntityId = InEntityId;
|
||||
EntityType = InEntityType;
|
||||
}
|
||||
|
||||
void AZMMOEntity::ApplyEntitySnapshot(const FZMMOEntitySnapshot& Snapshot)
|
||||
void AZeusEntity::ApplyEntitySnapshot(const FZeusEntitySnapshot& Snapshot)
|
||||
{
|
||||
const FRotator NewRotation(0.0f, Snapshot.YawDeg, 0.0f);
|
||||
SetActorLocationAndRotation(Snapshot.PositionCm, NewRotation);
|
||||
}
|
||||
|
||||
void AZMMOEntity::SetEntityRelevant(const bool bRelevant)
|
||||
void AZeusEntity::SetEntityRelevant(const bool bRelevant)
|
||||
{
|
||||
if (bIsZMMORelevant == bRelevant)
|
||||
if (bIsZeusRelevant == bRelevant)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
bIsZMMORelevant = bRelevant;
|
||||
bIsZeusRelevant = bRelevant;
|
||||
SetActorHiddenInGame(!bRelevant);
|
||||
SetActorEnableCollision(bRelevant);
|
||||
SetActorTickEnabled(bRelevant);
|
||||
@@ -2,22 +2,22 @@
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/Actor.h"
|
||||
#include "ZMMOEntityInterface.h"
|
||||
#include "ZMMOEntityTypes.h"
|
||||
#include "ZMMOEntity.generated.h"
|
||||
#include "ZeusEntityInterface.h"
|
||||
#include "ZeusEntityTypes.h"
|
||||
#include "ZeusEntity.generated.h"
|
||||
|
||||
/**
|
||||
* AZMMOEntity
|
||||
* AZeusEntity
|
||||
*
|
||||
* Classe base para entidades replicadas pelo servidor que NAO precisam de
|
||||
* capsula + `UCharacterMovementComponent` — tipicamente NPCs estaticos,
|
||||
* objetos dinamicos do mundo, mobs simples sem locomotion fisica.
|
||||
*
|
||||
* 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`.
|
||||
*
|
||||
* Implementa `IZMMOEntityInterface` com:
|
||||
* Implementa `IZeusEntityInterface` com:
|
||||
* - getters para `EntityId` / `EntityType`;
|
||||
* - `ApplyEntitySnapshot` default: `SetActorLocationAndRotation` (sem
|
||||
* interpolacao temporal — V1 podera adicionar ring-buffer + lerp);
|
||||
@@ -25,33 +25,33 @@
|
||||
* desativa tick (preserva o ator no mundo para futuro pooling).
|
||||
*/
|
||||
UCLASS(Blueprintable, BlueprintType)
|
||||
class ZMMO_API AZMMOEntity : public AActor, public IZMMOEntityInterface
|
||||
class ZMMO_API AZeusEntity : public AActor, public IZeusEntityInterface
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
AZMMOEntity();
|
||||
AZeusEntity();
|
||||
|
||||
// --- IZMMOEntityInterface ---
|
||||
virtual int64 GetZMMOEntityId() const override { return EntityId; }
|
||||
virtual EZMMOEntityType GetZMMOEntityType() const override { return EntityType; }
|
||||
virtual void ApplyEntitySnapshot(const FZMMOEntitySnapshot& Snapshot) override;
|
||||
// --- IZeusEntityInterface ---
|
||||
virtual int64 GetZeusEntityId() const override { return EntityId; }
|
||||
virtual EZeusEntityType GetZeusEntityType() const override { return EntityType; }
|
||||
virtual void ApplyEntitySnapshot(const FZeusEntitySnapshot& Snapshot) override;
|
||||
virtual void SetEntityRelevant(bool bRelevant) override;
|
||||
|
||||
/** Setter usado pelo `UZMMOWorldSubsystem` apos o spawn para registrar a identidade. */
|
||||
UFUNCTION(BlueprintCallable, Category = "ZMMO|Entity")
|
||||
void SetZMMOIdentity(int64 InEntityId, EZMMOEntityType InEntityType);
|
||||
/** Setter usado pelo `UZeusWorldSubsystem` apos o spawn para registrar a identidade. */
|
||||
UFUNCTION(BlueprintCallable, Category = "Zeus|Entity")
|
||||
void SetZeusIdentity(int64 InEntityId, EZeusEntityType InEntityType);
|
||||
|
||||
protected:
|
||||
/** Identificador autoritativo do servidor. Atribuido em `SetZMMOIdentity`. */
|
||||
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Entity")
|
||||
/** Identificador autoritativo do servidor. Atribuido em `SetZeusIdentity`. */
|
||||
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Entity")
|
||||
int64 EntityId = 0;
|
||||
|
||||
/** Categoria autoritativa (Player/Mob/NPC/Object). */
|
||||
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Entity")
|
||||
EZMMOEntityType EntityType = EZMMOEntityType::Object;
|
||||
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Entity")
|
||||
EZeusEntityType EntityType = EZeusEntityType::Object;
|
||||
|
||||
/** Estado de relevancia atual (espelha as transicoes Hidden<->Relevant do servidor). */
|
||||
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Entity")
|
||||
bool bIsZMMORelevant = true;
|
||||
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Entity")
|
||||
bool bIsZeusRelevant = true;
|
||||
};
|
||||
@@ -2,27 +2,27 @@
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "UObject/Interface.h"
|
||||
#include "ZMMOEntityTypes.h"
|
||||
#include "ZMMOEntityInterface.generated.h"
|
||||
#include "ZeusEntityTypes.h"
|
||||
#include "ZeusEntityInterface.generated.h"
|
||||
|
||||
/**
|
||||
* UZMMOEntityInterface
|
||||
* UZeusEntityInterface
|
||||
*
|
||||
* 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))
|
||||
class UZMMOEntityInterface : public UInterface
|
||||
class UZeusEntityInterface : public UInterface
|
||||
{
|
||||
GENERATED_BODY()
|
||||
};
|
||||
|
||||
/**
|
||||
* IZMMOEntityInterface
|
||||
* IZeusEntityInterface
|
||||
*
|
||||
* Contrato comum de todas as entidades replicadas pelo Zeus Server (player
|
||||
* local, players remotos, mobs, NPCs, objetos). Inspirado em `IZeusEntityInterface`
|
||||
* (ZeusV1) e adaptado para o nosso modelo "cliente solto + servidor valida input".
|
||||
* local, players remotos, mobs, NPCs, objetos). Adaptado para o nosso modelo
|
||||
* "cliente solto + servidor valida input".
|
||||
*
|
||||
* Decisoes:
|
||||
* 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
|
||||
* target entra/sai da area de interesse. O cliente reage via
|
||||
* `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
|
||||
* a colisao de objetos chegar no servidor podemos ligar reconciliacao
|
||||
* horizontal opcional.
|
||||
*
|
||||
* Por que UInterface (e nao heranca classica)?
|
||||
* - `AZMMOPlayerCharacter` ja herda de `ACharacter`. Forcar uma classe base
|
||||
* `AZMMOEntity : AActor` para todos perderia o `ACharacter` gratuito.
|
||||
* - `AZeusCharacter` ja herda de `ACharacter`. Forcar uma classe base
|
||||
* `AZeusEntity : AActor` para todos perderia o `ACharacter` gratuito.
|
||||
* A interface permite que o player local (`ACharacter`), o proxy remoto
|
||||
* (`ACharacter`) e entidades genericas (`AActor`) implementem o mesmo
|
||||
* contrato sem heranca multipla concreta.
|
||||
*/
|
||||
class ZMMO_API IZMMOEntityInterface
|
||||
class ZMMO_API IZeusEntityInterface
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
/** Identificador autoritativo da entidade no servidor. */
|
||||
virtual int64 GetZMMOEntityId() const = 0;
|
||||
virtual int64 GetZeusEntityId() const = 0;
|
||||
|
||||
/** 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
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
* fisica do landscape de forma autoritativa local, e o servidor apenas
|
||||
* 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`).
|
||||
@@ -1,14 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "ZMMOEntityTypes.generated.h"
|
||||
#include "ZeusEntityTypes.generated.h"
|
||||
|
||||
/**
|
||||
* 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)
|
||||
enum class EZMMOEntityType : uint8
|
||||
enum class EZeusEntityType : uint8
|
||||
{
|
||||
Player UMETA(DisplayName = "Player"),
|
||||
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
|
||||
* em V1+). Mantemos os campos minimos que o servidor ja replica hoje
|
||||
* (`S_PLAYER_STATE`); novos campos sao adicionados aqui sempre que o protocolo
|
||||
* evoluir, sem mexer nas classes de proxy.
|
||||
*/
|
||||
USTRUCT(BlueprintType)
|
||||
struct FZMMOEntitySnapshot
|
||||
struct FZeusEntitySnapshot
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
/** EntityId autoritativo do servidor. */
|
||||
UPROPERTY(BlueprintReadOnly, Category = "ZMMO|Entity")
|
||||
UPROPERTY(BlueprintReadOnly, Category = "Zeus|Entity")
|
||||
int64 EntityId = 0;
|
||||
|
||||
/** Categoria do ator (define qual proxy class spawnar). */
|
||||
UPROPERTY(BlueprintReadOnly, Category = "ZMMO|Entity")
|
||||
EZMMOEntityType EntityType = EZMMOEntityType::Player;
|
||||
UPROPERTY(BlueprintReadOnly, Category = "Zeus|Entity")
|
||||
EZeusEntityType EntityType = EZeusEntityType::Player;
|
||||
|
||||
/** Sequencia de input processada no servidor (so faz sentido para players). */
|
||||
UPROPERTY(BlueprintReadOnly, Category = "ZMMO|Entity")
|
||||
UPROPERTY(BlueprintReadOnly, Category = "Zeus|Entity")
|
||||
int32 LastProcessedInputSeq = 0;
|
||||
|
||||
/** Posicao mundo (cm). */
|
||||
UPROPERTY(BlueprintReadOnly, Category = "ZMMO|Entity")
|
||||
UPROPERTY(BlueprintReadOnly, Category = "Zeus|Entity")
|
||||
FVector PositionCm = FVector::ZeroVector;
|
||||
|
||||
/** 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;
|
||||
|
||||
/** Yaw em graus (orientacao visual). */
|
||||
UPROPERTY(BlueprintReadOnly, Category = "ZMMO|Entity")
|
||||
UPROPERTY(BlueprintReadOnly, Category = "Zeus|Entity")
|
||||
float YawDeg = 0.0f;
|
||||
|
||||
/** Indica se o servidor considera o ator em solo. */
|
||||
UPROPERTY(BlueprintReadOnly, Category = "ZMMO|Entity")
|
||||
UPROPERTY(BlueprintReadOnly, Category = "Zeus|Entity")
|
||||
bool bGrounded = false;
|
||||
|
||||
/** Tempo do servidor (ms desde epoch) quando este snapshot foi gerado. */
|
||||
UPROPERTY(BlueprintReadOnly, Category = "ZMMO|Entity")
|
||||
UPROPERTY(BlueprintReadOnly, Category = "Zeus|Entity")
|
||||
int64 ServerTimeMs = 0;
|
||||
};
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "ZMMOPlayerProxy.h"
|
||||
#include "ZeusPlayerProxy.h"
|
||||
|
||||
#include "Animation/AnimInstance.h"
|
||||
#include "Components/CapsuleComponent.h"
|
||||
@@ -8,10 +8,10 @@
|
||||
#include "GameFramework/CharacterMovementComponent.h"
|
||||
#include "UObject/ConstructorHelpers.h"
|
||||
#include "ZMMO.h"
|
||||
#include "ZMMOProxyMovementComponent.h"
|
||||
#include "ZeusProxyMovementComponent.h"
|
||||
|
||||
AZMMOPlayerProxy::AZMMOPlayerProxy(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer.SetDefaultSubobjectClass<UZMMOProxyMovementComponent>(ACharacter::CharacterMovementComponentName))
|
||||
AZeusPlayerProxy::AZeusPlayerProxy(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer.SetDefaultSubobjectClass<UZeusProxyMovementComponent>(ACharacter::CharacterMovementComponentName))
|
||||
{
|
||||
PrimaryActorTick.bCanEverTick = true;
|
||||
PrimaryActorTick.bStartWithTickEnabled = true;
|
||||
@@ -43,7 +43,7 @@ AZMMOPlayerProxy::AZMMOPlayerProxy(const FObjectInitializer& ObjectInitializer)
|
||||
CMC->BrakingFrictionFactor = 0.0f;
|
||||
}
|
||||
|
||||
// Defaults visuais (mesh + AnimBP) em paridade com `AZMMOPlayerCharacter`.
|
||||
// Defaults visuais (mesh + AnimBP) em paridade com `AZeusCharacter`.
|
||||
if (USkeletalMeshComponent* MeshComponent = GetMesh())
|
||||
{
|
||||
static ConstructorHelpers::FObjectFinder<USkeletalMesh> QuinnMesh(
|
||||
@@ -60,7 +60,7 @@ AZMMOPlayerProxy::AZMMOPlayerProxy(const FObjectInitializer& ObjectInitializer)
|
||||
else
|
||||
{
|
||||
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())
|
||||
@@ -71,7 +71,7 @@ AZMMOPlayerProxy::AZMMOPlayerProxy(const FObjectInitializer& ObjectInitializer)
|
||||
else
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
void AZMMOPlayerProxy::BeginPlay()
|
||||
void AZeusPlayerProxy::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);
|
||||
|
||||
@@ -131,7 +131,7 @@ void AZMMOPlayerProxy::Tick(const float DeltaSeconds)
|
||||
// Sem snapshot futuro: extrapolacao curta com a ultima velocidade
|
||||
// conhecida, clampada por `MaxExtrapolationSeconds` para nao deixar
|
||||
// o proxy fugir se a rede ficar muda.
|
||||
const FZMMOProxySnapshot& Last = SnapshotBuffer.Last();
|
||||
const FZeusProxySnapshot& Last = SnapshotBuffer.Last();
|
||||
const float ExtrapSec = FMath::Clamp(
|
||||
static_cast<float>(RenderMs - Last.ServerTimeMs) / 1000.0f,
|
||||
0.0f, MaxExtrapolationSeconds);
|
||||
@@ -141,8 +141,8 @@ void AZMMOPlayerProxy::Tick(const float DeltaSeconds)
|
||||
}
|
||||
else
|
||||
{
|
||||
const FZMMOProxySnapshot& A = SnapshotBuffer[IdxB - 1];
|
||||
const FZMMOProxySnapshot& B = SnapshotBuffer[IdxB];
|
||||
const FZeusProxySnapshot& A = SnapshotBuffer[IdxB - 1];
|
||||
const FZeusProxySnapshot& B = SnapshotBuffer[IdxB];
|
||||
const double Span = FMath::Max<double>(1.0, static_cast<double>(B.ServerTimeMs - A.ServerTimeMs));
|
||||
InterpAlpha = static_cast<float>(FMath::Clamp(
|
||||
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 RenderLagMs = ServerNowMs - NewestMs;
|
||||
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,
|
||||
bExtrapolating ? 1 : 0, InterpolationDelayMs);
|
||||
}
|
||||
}
|
||||
|
||||
void AZMMOPlayerProxy::SetZMMOIdentity(const int64 InEntityId, const EZMMOEntityType InEntityType)
|
||||
void AZeusPlayerProxy::SetZeusIdentity(const int64 InEntityId, const EZeusEntityType InEntityType)
|
||||
{
|
||||
EntityId = InEntityId;
|
||||
EntityType = InEntityType;
|
||||
}
|
||||
|
||||
void AZMMOPlayerProxy::ApplyEntitySnapshot(const FZMMOEntitySnapshot& Snapshot)
|
||||
void AZeusPlayerProxy::ApplyEntitySnapshot(const FZeusEntitySnapshot& Snapshot)
|
||||
{
|
||||
// Estabiliza o offset de relogio na primeira amostra. Subsequente nao
|
||||
// re-sincroniza para evitar saltos visuais; um esquema mais sofisticado
|
||||
@@ -231,7 +231,7 @@ void AZMMOPlayerProxy::ApplyEntitySnapshot(const FZMMOEntitySnapshot& Snapshot)
|
||||
ServerClockOffsetMs = LocalNowMs - Snapshot.ServerTimeMs;
|
||||
}
|
||||
|
||||
FZMMOProxySnapshot S;
|
||||
FZeusProxySnapshot S;
|
||||
S.PosCm = Snapshot.PositionCm;
|
||||
S.VelCmS = Snapshot.VelocityCmS;
|
||||
S.bGrounded = Snapshot.bGrounded;
|
||||
@@ -282,20 +282,20 @@ void AZMMOPlayerProxy::ApplyEntitySnapshot(const FZMMOEntitySnapshot& Snapshot)
|
||||
ApplyCollisionPolicy();
|
||||
}
|
||||
|
||||
void AZMMOPlayerProxy::SetEntityRelevant(const bool bRelevant)
|
||||
void AZeusPlayerProxy::SetEntityRelevant(const bool bRelevant)
|
||||
{
|
||||
if (bIsZMMORelevant == bRelevant)
|
||||
if (bIsZeusRelevant == bRelevant)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
bIsZMMORelevant = bRelevant;
|
||||
bIsZeusRelevant = bRelevant;
|
||||
SetActorHiddenInGame(!bRelevant);
|
||||
SetActorTickEnabled(bRelevant);
|
||||
ApplyCollisionPolicy();
|
||||
}
|
||||
|
||||
void AZMMOPlayerProxy::RefreshAnimationDrivers()
|
||||
void AZeusPlayerProxy::RefreshAnimationDrivers()
|
||||
{
|
||||
UCharacterMovementComponent* CMC = GetCharacterMovement();
|
||||
if (!CMC)
|
||||
@@ -314,13 +314,13 @@ void AZMMOPlayerProxy::RefreshAnimationDrivers()
|
||||
|
||||
// Acceleration externa via CMC custom — alimenta `Get Current Acceleration`
|
||||
// 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();
|
||||
if (!Capsule)
|
||||
@@ -328,6 +328,6 @@ void AZMMOPlayerProxy::ApplyCollisionPolicy()
|
||||
return;
|
||||
}
|
||||
|
||||
const bool bShouldCollide = bIsZMMORelevant && bHasFirstSnapshot;
|
||||
const bool bShouldCollide = bIsZeusRelevant && bHasFirstSnapshot;
|
||||
Capsule->SetCollisionEnabled(bShouldCollide ? ECollisionEnabled::QueryOnly : ECollisionEnabled::NoCollision);
|
||||
}
|
||||
@@ -2,19 +2,18 @@
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/Character.h"
|
||||
#include "ZMMOEntityInterface.h"
|
||||
#include "ZMMOEntityTypes.h"
|
||||
#include "ZMMOPlayerProxy.generated.h"
|
||||
#include "ZeusEntityInterface.h"
|
||||
#include "ZeusEntityTypes.h"
|
||||
#include "ZeusPlayerProxy.generated.h"
|
||||
|
||||
/**
|
||||
* AZMMOPlayerProxy
|
||||
* AZeusPlayerProxy
|
||||
*
|
||||
* Proxy visual para jogadores remotos (e, no futuro, mobs com locomotion
|
||||
* por capsula) cuja posicao vem 100% do servidor via snapshots
|
||||
* (`UZeusNetworkSubsystem::OnPlayerStateUpdate`).
|
||||
*
|
||||
* Inspirado em `AZeusRemoteCharacter` (ZeusV1). Diferencas chave vs.
|
||||
* `AZMMOPlayerCharacter` (jogador local):
|
||||
* Diferencas chave vs. `AZeusCharacter` (jogador local):
|
||||
* - SEM `EnhancedInput`, sem envio de `C_INPUT_AXIS`.
|
||||
* - SEM buffer de pending inputs nem reconciliacao.
|
||||
* - Posicao aplicada por snapshot (`ApplyEntitySnapshot`); a `ACharacter`
|
||||
@@ -22,19 +21,18 @@
|
||||
* mas o CMC fica em modo "kinematic-ish" (nao integra fisica).
|
||||
*
|
||||
* Animacao no AnimBP do Quinn (`ABP_Unarmed`): a formula `ShouldMove` exige
|
||||
* `Acceleration != 0`. Como proxies nao tem input, adoptamos a mesma
|
||||
* estrategia do ZClientMMO: CMC custom (`UZMMOProxyMovementComponent`) com
|
||||
* escrita externa de `Acceleration`, alimentada pela derivada da velocidade
|
||||
* entre snapshots. Tick do proxy roda **antes** do mesh tick para que
|
||||
* Velocity+Acceleration estejam populados quando o `NativeUpdateAnimation`
|
||||
* do AnimBP os ler.
|
||||
* `Acceleration != 0`. Como proxies nao tem input, adoptamos a estrategia
|
||||
* de CMC custom (`UZeusProxyMovementComponent`) com escrita externa de
|
||||
* `Acceleration`, alimentada pela derivada da velocidade entre snapshots.
|
||||
* Tick do proxy roda **antes** do mesh tick para que Velocity+Acceleration
|
||||
* estejam populados quando o `NativeUpdateAnimation` do AnimBP os ler.
|
||||
*/
|
||||
/**
|
||||
* Snapshot bruto guardado no buffer de interpolacao. Mantido como struct privada
|
||||
* ao .h porque so o proxy (e debugging local) precisa olhar para ele.
|
||||
*/
|
||||
USTRUCT()
|
||||
struct FZMMOProxySnapshot
|
||||
struct FZeusProxySnapshot
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -53,37 +51,37 @@ struct FZMMOProxySnapshot
|
||||
};
|
||||
|
||||
UCLASS(Blueprintable, BlueprintType)
|
||||
class ZMMO_API AZMMOPlayerProxy : public ACharacter, public IZMMOEntityInterface
|
||||
class ZMMO_API AZeusPlayerProxy : public ACharacter, public IZeusEntityInterface
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
AZMMOPlayerProxy(const FObjectInitializer& ObjectInitializer);
|
||||
AZeusPlayerProxy(const FObjectInitializer& ObjectInitializer);
|
||||
|
||||
virtual void BeginPlay() override;
|
||||
virtual void Tick(float DeltaSeconds) override;
|
||||
|
||||
// --- IZMMOEntityInterface ---
|
||||
virtual int64 GetZMMOEntityId() const override { return EntityId; }
|
||||
virtual EZMMOEntityType GetZMMOEntityType() const override { return EntityType; }
|
||||
virtual void ApplyEntitySnapshot(const FZMMOEntitySnapshot& Snapshot) override;
|
||||
// --- IZeusEntityInterface ---
|
||||
virtual int64 GetZeusEntityId() const override { return EntityId; }
|
||||
virtual EZeusEntityType GetZeusEntityType() const override { return EntityType; }
|
||||
virtual void ApplyEntitySnapshot(const FZeusEntitySnapshot& Snapshot) override;
|
||||
virtual void SetEntityRelevant(bool bRelevant) override;
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "ZMMO|Entity")
|
||||
void SetZMMOIdentity(int64 InEntityId, EZMMOEntityType InEntityType);
|
||||
UFUNCTION(BlueprintCallable, Category = "Zeus|Entity")
|
||||
void SetZeusIdentity(int64 InEntityId, EZeusEntityType InEntityType);
|
||||
|
||||
protected:
|
||||
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Entity")
|
||||
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Entity")
|
||||
int64 EntityId = 0;
|
||||
|
||||
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Entity")
|
||||
EZMMOEntityType EntityType = EZMMOEntityType::Player;
|
||||
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Entity")
|
||||
EZeusEntityType EntityType = EZeusEntityType::Player;
|
||||
|
||||
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Entity")
|
||||
bool bIsZMMORelevant = true;
|
||||
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Entity")
|
||||
bool bIsZeusRelevant = true;
|
||||
|
||||
/** 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;
|
||||
|
||||
/**
|
||||
@@ -91,15 +89,15 @@ protected:
|
||||
* de `InterpolatedPosCm` (visual) — separar os dois e essencial para
|
||||
* 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;
|
||||
|
||||
/** Posicao **visual** atual (resultado da interpolacao do tick). */
|
||||
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Entity")
|
||||
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Entity")
|
||||
FVector InterpolatedPosCm = FVector::ZeroVector;
|
||||
|
||||
/** 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;
|
||||
|
||||
/**
|
||||
@@ -108,7 +106,7 @@ protected:
|
||||
* em cada `Tick` para manter os drivers de animacao alimentados entre
|
||||
* updates de rede.
|
||||
*/
|
||||
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Entity")
|
||||
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Entity")
|
||||
FVector VisualVelocity = FVector::ZeroVector;
|
||||
|
||||
/**
|
||||
@@ -116,23 +114,23 @@ protected:
|
||||
* expresso no dominio do tempo do servidor. Padrao 100 ms (~3 snapshots a 30 Hz)
|
||||
* 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"))
|
||||
double InterpolationDelayMs = 100.0;
|
||||
|
||||
/** 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"))
|
||||
int32 SnapshotBufferCapacity = 8;
|
||||
|
||||
/** 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"))
|
||||
float MaxExtrapolationSeconds = 0.1f;
|
||||
|
||||
/** Buffer ordenado por `ServerTimeMs` ascendente. */
|
||||
UPROPERTY()
|
||||
TArray<FZMMOProxySnapshot> SnapshotBuffer;
|
||||
TArray<FZeusProxySnapshot> SnapshotBuffer;
|
||||
|
||||
/**
|
||||
* Offset entre o relogio local (`FPlatformTime::Seconds * 1000`) e o
|
||||
24
Source/ZMMO/Game/Entity/ZeusProxyMovementComponent.h
Normal file
24
Source/ZMMO/Game/Entity/ZeusProxyMovementComponent.h
Normal 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;
|
||||
}
|
||||
};
|
||||
@@ -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();
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
10
Source/ZMMO/Game/Modes/ZeusFrontEndGameMode.cpp
Normal file
10
Source/ZMMO/Game/Modes/ZeusFrontEndGameMode.cpp
Normal 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();
|
||||
}
|
||||
@@ -2,21 +2,21 @@
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/GameModeBase.h"
|
||||
#include "ZMMOFrontEndGameMode.generated.h"
|
||||
#include "ZeusFrontEndGameMode.generated.h"
|
||||
|
||||
/**
|
||||
* AZMMOFrontEndGameMode
|
||||
* AZeusFrontEndGameMode
|
||||
*
|
||||
* GameMode do mapa de front-end (L_FrontEnd): só 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
|
||||
* (ARQUITETURA.md §3.3 / decisão de mapa dedicado).
|
||||
*/
|
||||
UCLASS(Blueprintable, BlueprintType)
|
||||
class ZMMO_API AZMMOFrontEndGameMode : public AGameModeBase
|
||||
class ZMMO_API AZeusFrontEndGameMode : public AGameModeBase
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
AZMMOFrontEndGameMode();
|
||||
AZeusFrontEndGameMode();
|
||||
};
|
||||
@@ -1,13 +1,13 @@
|
||||
#include "ZMMOGameInstance.h"
|
||||
#include "ZeusGameInstance.h"
|
||||
|
||||
#include "ZMMO.h"
|
||||
#include "ZeusNetworkSubsystem.h"
|
||||
|
||||
void UZMMOGameInstance::Init()
|
||||
void UZeusGameInstance::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"),
|
||||
*ZeusServerHost,
|
||||
ZeusServerPort);
|
||||
@@ -15,7 +15,7 @@ void UZMMOGameInstance::Init()
|
||||
UZeusNetworkSubsystem* ZeusNet = GetZeusNetwork();
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ void UZMMOGameInstance::Init()
|
||||
ZeusNet->ConnectToZeusServer(ZeusServerHost, ZeusServerPort);
|
||||
}
|
||||
|
||||
void UZMMOGameInstance::Shutdown()
|
||||
void UZeusGameInstance::Shutdown()
|
||||
{
|
||||
if (UZeusNetworkSubsystem* ZeusNet = GetZeusNetwork())
|
||||
{
|
||||
@@ -43,55 +43,55 @@ void UZMMOGameInstance::Shutdown()
|
||||
Super::Shutdown();
|
||||
}
|
||||
|
||||
UZeusNetworkSubsystem* UZMMOGameInstance::GetZeusNetwork() const
|
||||
UZeusNetworkSubsystem* UZeusGameInstance::GetZeusNetwork() const
|
||||
{
|
||||
return GetSubsystem<UZeusNetworkSubsystem>();
|
||||
}
|
||||
|
||||
void UZMMOGameInstance::BindZeusDelegates(UZeusNetworkSubsystem* Zeus)
|
||||
void UZeusGameInstance::BindZeusDelegates(UZeusNetworkSubsystem* Zeus)
|
||||
{
|
||||
if (!Zeus)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Zeus->OnConnected.AddDynamic(this, &UZMMOGameInstance::HandleZeusConnected);
|
||||
Zeus->OnConnectionFailed.AddDynamic(this, &UZMMOGameInstance::HandleZeusConnectionFailed);
|
||||
Zeus->OnDisconnected.AddDynamic(this, &UZMMOGameInstance::HandleZeusDisconnected);
|
||||
Zeus->OnConnected.AddDynamic(this, &UZeusGameInstance::HandleZeusConnected);
|
||||
Zeus->OnConnectionFailed.AddDynamic(this, &UZeusGameInstance::HandleZeusConnectionFailed);
|
||||
Zeus->OnDisconnected.AddDynamic(this, &UZeusGameInstance::HandleZeusDisconnected);
|
||||
// OnNetworkLog: NAO assinamos. Plugin ja loga em LogZeusNetwork (console)
|
||||
// + arquivo proprio em Saved/Logs/ZeusNetwork/. Forwarding em LogZMMO era
|
||||
// diagnostico inicial (sessao 2026-05-07); agora gera duplicacao de cada
|
||||
// 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)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Zeus->OnConnected.RemoveDynamic(this, &UZMMOGameInstance::HandleZeusConnected);
|
||||
Zeus->OnConnectionFailed.RemoveDynamic(this, &UZMMOGameInstance::HandleZeusConnectionFailed);
|
||||
Zeus->OnDisconnected.RemoveDynamic(this, &UZMMOGameInstance::HandleZeusDisconnected);
|
||||
Zeus->OnConnected.RemoveDynamic(this, &UZeusGameInstance::HandleZeusConnected);
|
||||
Zeus->OnConnectionFailed.RemoveDynamic(this, &UZeusGameInstance::HandleZeusConnectionFailed);
|
||||
Zeus->OnDisconnected.RemoveDynamic(this, &UZeusGameInstance::HandleZeusDisconnected);
|
||||
// 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);
|
||||
}
|
||||
|
||||
void UZMMOGameInstance::HandleZeusConnectionFailed(FString Reason)
|
||||
void UZeusGameInstance::HandleZeusConnectionFailed(FString Reason)
|
||||
{
|
||||
UE_LOG(LogZMMO, Warning, TEXT("[Zeus] Connection failed: %s"), *Reason);
|
||||
}
|
||||
|
||||
void UZMMOGameInstance::HandleZeusDisconnected()
|
||||
void UZeusGameInstance::HandleZeusDisconnected()
|
||||
{
|
||||
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);
|
||||
}
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Engine/GameInstance.h"
|
||||
#include "ZMMOGameInstance.generated.h"
|
||||
#include "ZeusGameInstance.generated.h"
|
||||
|
||||
class UZeusNetworkSubsystem;
|
||||
|
||||
/**
|
||||
* UZMMOGameInstance
|
||||
* UZeusGameInstance
|
||||
*
|
||||
* Game instance do cliente Zeus MMO. O `UZeusNetworkSubsystem` (do plugin
|
||||
* `ZeusNetwork`) e um `UGameInstanceSubsystem` e portanto e criado
|
||||
@@ -22,7 +22,7 @@ class UZeusNetworkSubsystem;
|
||||
* overrides de configuracao por build (dev / staging / prod).
|
||||
*/
|
||||
UCLASS(Blueprintable, BlueprintType)
|
||||
class ZMMO_API UZMMOGameInstance : public UGameInstance
|
||||
class ZMMO_API UZeusGameInstance : public UGameInstance
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -36,20 +36,20 @@ public:
|
||||
* dirigida pelo `UUIFrontEndFlowSubsystem` (fluxo Boot→Connecting→Login).
|
||||
* 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;
|
||||
|
||||
/** 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");
|
||||
|
||||
/** 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;
|
||||
|
||||
protected:
|
||||
/** Devolve o subsystem Zeus desta game instance (criado automaticamente pelo plugin). */
|
||||
UFUNCTION(BlueprintPure, Category = "ZMMO|Network")
|
||||
UFUNCTION(BlueprintPure, Category = "Zeus|Network")
|
||||
UZeusNetworkSubsystem* GetZeusNetwork() const;
|
||||
|
||||
void BindZeusDelegates(UZeusNetworkSubsystem* Zeus);
|
||||
14
Source/ZMMO/Game/Modes/ZeusGameMode.cpp
Normal file
14
Source/ZMMO/Game/Modes/ZeusGameMode.cpp
Normal 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();
|
||||
}
|
||||
@@ -2,24 +2,24 @@
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/GameModeBase.h"
|
||||
#include "ZMMOGameMode.generated.h"
|
||||
#include "ZeusGameMode.generated.h"
|
||||
|
||||
/**
|
||||
* AZMMOGameMode
|
||||
* AZeusGameMode
|
||||
*
|
||||
* Game mode do cliente Zeus MMO. Configura `AZMMOPlayerCharacter` como
|
||||
* `DefaultPawnClass` e `AZMMOPlayerController` como `PlayerControllerClass`.
|
||||
* Game mode do cliente Zeus MMO. Configura `AZeusCharacter` como
|
||||
* `DefaultPawnClass` e `AZeusPlayerController` como `PlayerControllerClass`.
|
||||
*
|
||||
* 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
|
||||
* por mapa / build (skeletal mesh, AnimBP custom, etc.).
|
||||
*/
|
||||
UCLASS(Blueprintable, BlueprintType)
|
||||
class ZMMO_API AZMMOGameMode : public AGameModeBase
|
||||
class ZMMO_API AZeusGameMode : public AGameModeBase
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
AZMMOGameMode();
|
||||
AZeusGameMode();
|
||||
};
|
||||
@@ -1,16 +1,16 @@
|
||||
#include "ZMMOHUD.h"
|
||||
#include "ZeusHUD.h"
|
||||
|
||||
#include "Engine/GameInstance.h"
|
||||
#include "ZMMO.h"
|
||||
#include "UI/InGame/UIInGameFlowSubsystem.h"
|
||||
|
||||
AZMMOHUD::AZMMOHUD()
|
||||
AZeusHUD::AZeusHUD()
|
||||
{
|
||||
// AHUD nao precisa tick — toda atualizacao vem via UMG (delegates +
|
||||
// CommonUI). PrimaryActorTick default e' off; mantemos.
|
||||
}
|
||||
|
||||
void AZMMOHUD::BeginPlay()
|
||||
void AZeusHUD::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
@@ -25,12 +25,12 @@ void AZMMOHUD::BeginPlay()
|
||||
else
|
||||
{
|
||||
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
|
||||
// limpamos UI in-game aqui (o front-end flow vai tomar conta na proxima
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/HUD.h"
|
||||
#include "ZMMOHUD.generated.h"
|
||||
#include "ZeusHUD.generated.h"
|
||||
|
||||
/**
|
||||
* HUD do MMO. Pattern UE5 idiomatico: o GameMode atribui `HUDClass`, o
|
||||
@@ -14,21 +14,21 @@
|
||||
* subsystem cuida do cleanup.
|
||||
*
|
||||
* Separacao de responsabilidades:
|
||||
* - AZMMOPlayerCharacter (Pawn) — movimento, input, AttributeComponent
|
||||
* - AZMMOPlayerController — input mapping, mouse
|
||||
* - AZMMOHUD — UI lifecycle
|
||||
* - AZMMOGameMode — wires tudo via class slots
|
||||
* - AZeusCharacter (Pawn) — movimento, input, AttributeComponent
|
||||
* - AZeusPlayerController — input mapping, mouse
|
||||
* - AZeusHUD — UI lifecycle
|
||||
* - AZeusGameMode — wires tudo via class slots
|
||||
*
|
||||
* NAO desenha nada via canvas (AHUD::DrawHUD). UI inteira vive em UMG +
|
||||
* CommonUI (UI.Layer.Game / GameMenu / Modal).
|
||||
*/
|
||||
UCLASS()
|
||||
class ZMMO_API AZMMOHUD : public AHUD
|
||||
class ZMMO_API AZeusHUD : public AHUD
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
AZMMOHUD();
|
||||
AZeusHUD();
|
||||
|
||||
protected:
|
||||
virtual void BeginPlay() override;
|
||||
@@ -1,14 +1,14 @@
|
||||
#include "ZMMOPlayerState.h"
|
||||
#include "ZeusPlayerState.h"
|
||||
|
||||
#include "Components/ActorComponent.h"
|
||||
#include "Misc/ConfigCacheIni.h"
|
||||
#include "Net/UnrealNetwork.h"
|
||||
#include "ZMMO.h"
|
||||
|
||||
AZMMOPlayerState::AZMMOPlayerState()
|
||||
AZeusPlayerState::AZeusPlayerState()
|
||||
{
|
||||
// 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),
|
||||
// que requer LoadConfig() ja ter rodado no CDO antes da instance ser
|
||||
@@ -17,7 +17,7 @@ AZMMOPlayerState::AZMMOPlayerState()
|
||||
if (ComponentClasses.Num() == 0 && GConfig)
|
||||
{
|
||||
TArray<FString> ClassPaths;
|
||||
GConfig->GetArray(TEXT("/Script/ZMMO.ZMMOPlayerState"),
|
||||
GConfig->GetArray(TEXT("/Script/ZMMO.ZeusPlayerState"),
|
||||
TEXT("ComponentClasses"),
|
||||
ClassPaths,
|
||||
GGameIni);
|
||||
@@ -30,13 +30,13 @@ AZMMOPlayerState::AZMMOPlayerState()
|
||||
else
|
||||
{
|
||||
UE_LOG(LogZMMO, Warning,
|
||||
TEXT("ZMMOPlayerState: ComponentClasses path nao resolveu: %s"), *Path);
|
||||
TEXT("ZeusPlayerState: ComponentClasses path nao resolveu: %s"), *Path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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());
|
||||
|
||||
int32 SubobjectIndex = 0;
|
||||
@@ -46,13 +46,13 @@ AZMMOPlayerState::AZMMOPlayerState()
|
||||
if (!CompClass)
|
||||
{
|
||||
UE_LOG(LogZMMO, Warning,
|
||||
TEXT("ZMMOPlayerState: ComponentClass null em ComponentClasses[%d]"),
|
||||
TEXT("ZeusPlayerState: ComponentClass null em ComponentClasses[%d]"),
|
||||
SubobjectIndex);
|
||||
++SubobjectIndex;
|
||||
continue;
|
||||
}
|
||||
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) —
|
||||
// precisa cast para UActorComponent.
|
||||
UActorComponent* Comp = Cast<UActorComponent>(CreateDefaultSubobject(CompName, CompClass, CompClass,
|
||||
@@ -60,40 +60,40 @@ AZMMOPlayerState::AZMMOPlayerState()
|
||||
if (Comp)
|
||||
{
|
||||
UE_LOG(LogZMMO, Log,
|
||||
TEXT("ZMMOPlayerState: componente registrado [%d] %s"),
|
||||
TEXT("ZeusPlayerState: componente registrado [%d] %s"),
|
||||
SubobjectIndex, *CompClass->GetName());
|
||||
}
|
||||
else
|
||||
{
|
||||
UE_LOG(LogZMMO, Warning,
|
||||
TEXT("ZMMOPlayerState: CreateDefaultSubobject falhou para %s"),
|
||||
TEXT("ZeusPlayerState: CreateDefaultSubobject falhou para %s"),
|
||||
*CompClass->GetName());
|
||||
}
|
||||
++SubobjectIndex;
|
||||
}
|
||||
}
|
||||
|
||||
void AZMMOPlayerState::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
|
||||
void AZeusPlayerState::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
|
||||
{
|
||||
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
|
||||
DOREPLIFETIME(AZMMOPlayerState, ZMMOEntityId);
|
||||
DOREPLIFETIME(AZMMOPlayerState, CharId);
|
||||
DOREPLIFETIME(AZMMOPlayerState, CharName);
|
||||
DOREPLIFETIME(AZMMOPlayerState, BaseLevel);
|
||||
DOREPLIFETIME(AZMMOPlayerState, ClassId);
|
||||
DOREPLIFETIME(AZMMOPlayerState, GuildName);
|
||||
DOREPLIFETIME(AZeusPlayerState, ZeusEntityId);
|
||||
DOREPLIFETIME(AZeusPlayerState, CharId);
|
||||
DOREPLIFETIME(AZeusPlayerState, CharName);
|
||||
DOREPLIFETIME(AZeusPlayerState, BaseLevel);
|
||||
DOREPLIFETIME(AZeusPlayerState, ClassId);
|
||||
DOREPLIFETIME(AZeusPlayerState, GuildName);
|
||||
}
|
||||
|
||||
void AZMMOPlayerState::SetPublicIdentity(int64 InEntityId, const FString& InCharId,
|
||||
void AZeusPlayerState::SetPublicIdentity(int64 InEntityId, const FString& InCharId,
|
||||
int32 InBaseLevel, int32 InClassId)
|
||||
{
|
||||
ZMMOEntityId = InEntityId;
|
||||
ZeusEntityId = InEntityId;
|
||||
CharId = InCharId;
|
||||
BaseLevel = InBaseLevel;
|
||||
ClassId = InClassId;
|
||||
}
|
||||
|
||||
void AZMMOPlayerState::SetCharInfo(const FString& InCharName, const FString& InGuildName)
|
||||
void AZeusPlayerState::SetCharInfo(const FString& InCharName, const FString& InGuildName)
|
||||
{
|
||||
CharName = InCharName;
|
||||
GuildName = InGuildName;
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/PlayerState.h"
|
||||
#include "Templates/SubclassOf.h"
|
||||
#include "ZMMOPlayerState.generated.h"
|
||||
#include "ZeusPlayerState.generated.h"
|
||||
|
||||
class FLifetimeProperty;
|
||||
class UActorComponent;
|
||||
@@ -28,29 +28,29 @@ class UActorComponent;
|
||||
*
|
||||
* ## Component Registry (Open-Closed)
|
||||
*
|
||||
* Cada modulo (ZMMOAttributes, ZMMOInventory, ZMMOSkills futuros) declara
|
||||
* Cada modulo (ZeusAttributes, ZeusInventory, ZeusSkills futuros) declara
|
||||
* sua component class em DefaultGame.ini:
|
||||
*
|
||||
* [/Script/ZMMO.ZMMOPlayerState]
|
||||
* +ComponentClasses=/Script/ZMMOAttributes.ZMMOAttributeComponent
|
||||
* +ComponentClasses=/Script/ZMMOInventory.ZMMOInventoryComponent
|
||||
* +ComponentClasses=/Script/ZMMOSkills.ZMMOSkillComponent
|
||||
* [/Script/ZMMO.ZeusPlayerState]
|
||||
* +ComponentClasses=/Script/ZeusAttributes.ZeusAttributeComponent
|
||||
* +ComponentClasses=/Script/ZeusInventory.ZeusInventoryComponent
|
||||
* +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,
|
||||
* modulos abertos pra extensao — adicionar Inventory NAO requer
|
||||
* recompilar/editar AZMMOPlayerState.
|
||||
* recompilar/editar AZeusPlayerState.
|
||||
*
|
||||
* Acesso: `PlayerState->FindComponentByClass<UZMMOAttributeComponent>()`
|
||||
* ou o helper `GetZMMOComponent<T>()`.
|
||||
* Acesso: `PlayerState->FindComponentByClass<UZeusAttributeComponent>()`
|
||||
* ou o helper `GetZeusComponent<T>()`.
|
||||
*/
|
||||
UCLASS(Config = Game, BlueprintType)
|
||||
class ZMMO_API AZMMOPlayerState : public APlayerState
|
||||
class ZMMO_API AZeusPlayerState : public APlayerState
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
AZMMOPlayerState();
|
||||
AZeusPlayerState();
|
||||
|
||||
// === Identidade publica ===
|
||||
//
|
||||
@@ -60,51 +60,51 @@ public:
|
||||
// passe a usar dedicated UE5 no futuro.
|
||||
|
||||
/** EntityId autoritativo do server. 0 ate o spawn local confirmar. */
|
||||
UPROPERTY(Replicated, VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Identity")
|
||||
int64 ZMMOEntityId = 0;
|
||||
UPROPERTY(Replicated, VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Identity")
|
||||
int64 ZeusEntityId = 0;
|
||||
|
||||
/** 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;
|
||||
|
||||
/** 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(). */
|
||||
UPROPERTY(Replicated, VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Identity")
|
||||
UPROPERTY(Replicated, VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Identity")
|
||||
FString CharName;
|
||||
|
||||
// === Progressao publica ===
|
||||
|
||||
UPROPERTY(Replicated, VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Progress")
|
||||
UPROPERTY(Replicated, VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Progress")
|
||||
int32 BaseLevel = 1;
|
||||
|
||||
UPROPERTY(Replicated, VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Progress")
|
||||
UPROPERTY(Replicated, VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Progress")
|
||||
int32 ClassId = 0;
|
||||
|
||||
// === Guild (futuro) ===
|
||||
|
||||
UPROPERTY(Replicated, VisibleInstanceOnly, BlueprintReadOnly, Category = "ZMMO|Guild")
|
||||
UPROPERTY(Replicated, VisibleInstanceOnly, BlueprintReadOnly, Category = "Zeus|Guild")
|
||||
FString GuildName;
|
||||
|
||||
virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
|
||||
|
||||
// === Helpers ===
|
||||
|
||||
/// Setado por AZMMOPlayerCharacter::HandleLocalSpawnReady (pose/EntityId)
|
||||
/// Setado por AZeusCharacter::HandleLocalSpawnReady (pose/EntityId)
|
||||
/// e atualizado por handlers de snapshot/level up para refletir dados
|
||||
/// publicos do char no PlayerState.
|
||||
UFUNCTION(BlueprintCallable, Category = "ZMMO|Identity")
|
||||
UFUNCTION(BlueprintCallable, Category = "Zeus|Identity")
|
||||
void SetPublicIdentity(int64 InEntityId, const FString& InCharId,
|
||||
int32 InBaseLevel, int32 InClassId);
|
||||
|
||||
/// Setado pelo handler do S_CHAR_INFO (chega antes de S_SPAWN_PLAYER) —
|
||||
/// 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);
|
||||
|
||||
/// Template helper: PS->GetZMMOComponent<UZMMOAttributeComponent>()
|
||||
/// Template helper: PS->GetZeusComponent<UZeusAttributeComponent>()
|
||||
template <typename T>
|
||||
T* GetZMMOComponent() const
|
||||
T* GetZeusComponent() const
|
||||
{
|
||||
return Cast<T>(FindComponentByClass(T::StaticClass()));
|
||||
}
|
||||
@@ -119,6 +119,6 @@ protected:
|
||||
* diretamente. Modulos C++ precisam estar carregados antes do CDO ser
|
||||
* instanciado — garantido por LoadingPhase=PreDefault no .uproject.
|
||||
*/
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "ZMMO|Components")
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Zeus|Components")
|
||||
TArray<TSubclassOf<UActorComponent>> ComponentClasses;
|
||||
};
|
||||
@@ -1,23 +1,23 @@
|
||||
#include "ZMMOWorldSubsystem.h"
|
||||
#include "ZeusWorldSubsystem.h"
|
||||
|
||||
#include "Engine/GameInstance.h"
|
||||
#include "Engine/World.h"
|
||||
#include "ZMMO.h"
|
||||
#include "ZMMOEntity.h"
|
||||
#include "ZMMOEntityInterface.h"
|
||||
#include "ZMMOPlayerProxy.h"
|
||||
#include "ZeusEntity.h"
|
||||
#include "ZeusEntityInterface.h"
|
||||
#include "ZeusPlayerProxy.h"
|
||||
#include "ZeusNetworkSubsystem.h"
|
||||
|
||||
void UZMMOWorldSubsystem::Initialize(FSubsystemCollectionBase& Collection)
|
||||
void UZeusWorldSubsystem::Initialize(FSubsystemCollectionBase& Collection)
|
||||
{
|
||||
Super::Initialize(Collection);
|
||||
|
||||
if (RemoteEntityClasses.IsEmpty())
|
||||
{
|
||||
RemoteEntityClasses.Add(EZMMOEntityType::Player, AZMMOPlayerProxy::StaticClass());
|
||||
RemoteEntityClasses.Add(EZMMOEntityType::Mob, AZMMOEntity::StaticClass());
|
||||
RemoteEntityClasses.Add(EZMMOEntityType::NPC, AZMMOEntity::StaticClass());
|
||||
RemoteEntityClasses.Add(EZMMOEntityType::Object, AZMMOEntity::StaticClass());
|
||||
RemoteEntityClasses.Add(EZeusEntityType::Player, AZeusPlayerProxy::StaticClass());
|
||||
RemoteEntityClasses.Add(EZeusEntityType::Mob, AZeusEntity::StaticClass());
|
||||
RemoteEntityClasses.Add(EZeusEntityType::NPC, AZeusEntity::StaticClass());
|
||||
RemoteEntityClasses.Add(EZeusEntityType::Object, AZeusEntity::StaticClass());
|
||||
}
|
||||
// Bind + replay vivem em OnWorldBeginPlay (mundo pronto). Initialize roda
|
||||
// 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.
|
||||
}
|
||||
|
||||
void UZMMOWorldSubsystem::OnWorldBeginPlay(UWorld& InWorld)
|
||||
void UZeusWorldSubsystem::OnWorldBeginPlay(UWorld& InWorld)
|
||||
{
|
||||
Super::OnWorldBeginPlay(InWorld);
|
||||
|
||||
if (UZeusNetworkSubsystem* ZeusNet = ResolveZeusNetworkSubsystem())
|
||||
{
|
||||
ZeusNet->OnPlayerSpawned.AddDynamic(this, &UZMMOWorldSubsystem::HandlePlayerSpawned);
|
||||
ZeusNet->OnPlayerDespawned.AddDynamic(this, &UZMMOWorldSubsystem::HandlePlayerDespawned);
|
||||
ZeusNet->OnPlayerStateUpdate.AddDynamic(this, &UZMMOWorldSubsystem::HandlePlayerStateUpdate);
|
||||
UE_LOG(LogZMMO, Log, TEXT("ZMMOWorldSubsystem bound to ZeusNetworkSubsystem delegates."));
|
||||
ZeusNet->OnPlayerSpawned.AddDynamic(this, &UZeusWorldSubsystem::HandlePlayerSpawned);
|
||||
ZeusNet->OnPlayerDespawned.AddDynamic(this, &UZeusWorldSubsystem::HandlePlayerDespawned);
|
||||
ZeusNet->OnPlayerStateUpdate.AddDynamic(this, &UZeusWorldSubsystem::HandlePlayerStateUpdate);
|
||||
UE_LOG(LogZMMO, Log, TEXT("ZeusWorldSubsystem bound to ZeusNetworkSubsystem delegates."));
|
||||
|
||||
// Catch-up race fix (Fase 3): broadcasts de proxies remotos chegam
|
||||
// enquanto o cliente novo ainda esta em OpenLevel. UZeusNetworkSubsystem
|
||||
@@ -49,22 +49,22 @@ void UZMMOWorldSubsystem::OnWorldBeginPlay(UWorld& InWorld)
|
||||
});
|
||||
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
|
||||
{
|
||||
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())
|
||||
{
|
||||
ZeusNet->OnPlayerSpawned.RemoveDynamic(this, &UZMMOWorldSubsystem::HandlePlayerSpawned);
|
||||
ZeusNet->OnPlayerDespawned.RemoveDynamic(this, &UZMMOWorldSubsystem::HandlePlayerDespawned);
|
||||
ZeusNet->OnPlayerStateUpdate.RemoveDynamic(this, &UZMMOWorldSubsystem::HandlePlayerStateUpdate);
|
||||
ZeusNet->OnPlayerSpawned.RemoveDynamic(this, &UZeusWorldSubsystem::HandlePlayerSpawned);
|
||||
ZeusNet->OnPlayerDespawned.RemoveDynamic(this, &UZeusWorldSubsystem::HandlePlayerDespawned);
|
||||
ZeusNet->OnPlayerStateUpdate.RemoveDynamic(this, &UZeusWorldSubsystem::HandlePlayerStateUpdate);
|
||||
}
|
||||
|
||||
RemoteEntities.Reset();
|
||||
@@ -72,7 +72,7 @@ void UZMMOWorldSubsystem::Deinitialize()
|
||||
Super::Deinitialize();
|
||||
}
|
||||
|
||||
void UZMMOWorldSubsystem::RegisterLocalEntity(const int64 EntityId, AActor* LocalActor)
|
||||
void UZeusWorldSubsystem::RegisterLocalEntity(const int64 EntityId, AActor* LocalActor)
|
||||
{
|
||||
if (EntityId == 0 || LocalActor == nullptr)
|
||||
{
|
||||
@@ -81,11 +81,11 @@ void UZMMOWorldSubsystem::RegisterLocalEntity(const int64 EntityId, AActor* Loca
|
||||
|
||||
LocalEntityId = EntityId;
|
||||
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));
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
if (EntityId == 0)
|
||||
@@ -95,7 +95,7 @@ void UZMMOWorldSubsystem::HandlePlayerSpawned(const int64 EntityId, const bool b
|
||||
|
||||
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
|
||||
// snapshots locais (cliente solto, sem reconciliacao em V0).
|
||||
LocalEntityId = EntityId;
|
||||
@@ -110,17 +110,17 @@ void UZMMOWorldSubsystem::HandlePlayerSpawned(const int64 EntityId, const bool b
|
||||
// silenciosamente ignorado depois de oscilacoes na AOI.
|
||||
if (AActor* Existing = RemoteEntities[EntityId].Get())
|
||||
{
|
||||
if (IZMMOEntityInterface* AsEntity = Cast<IZMMOEntityInterface>(Existing))
|
||||
if (IZeusEntityInterface* AsEntity = Cast<IZeusEntityInterface>(Existing))
|
||||
{
|
||||
AsEntity->SetEntityRelevant(true);
|
||||
}
|
||||
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;
|
||||
}
|
||||
// weak ptr stale — limpa entry e cai pro spawn novo abaixo.
|
||||
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();
|
||||
@@ -129,10 +129,10 @@ void UZMMOWorldSubsystem::HandlePlayerSpawned(const int64 EntityId, const bool b
|
||||
return;
|
||||
}
|
||||
|
||||
UClass* ProxyClass = ResolveActorClass(EZMMOEntityType::Player);
|
||||
UClass* ProxyClass = ResolveActorClass(EZeusEntityType::Player);
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -142,30 +142,30 @@ void UZMMOWorldSubsystem::HandlePlayerSpawned(const int64 EntityId, const bool b
|
||||
AActor* SpawnedActor = World->SpawnActor<AActor>(ProxyClass, PosCm, SpawnRot, Params);
|
||||
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;
|
||||
}
|
||||
|
||||
if (IZMMOEntityInterface* AsEntity = Cast<IZMMOEntityInterface>(SpawnedActor))
|
||||
if (IZeusEntityInterface* AsEntity = Cast<IZeusEntityInterface>(SpawnedActor))
|
||||
{
|
||||
// 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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
void UZMMOWorldSubsystem::HandlePlayerDespawned(const int64 EntityId)
|
||||
void UZeusWorldSubsystem::HandlePlayerDespawned(const int64 EntityId)
|
||||
{
|
||||
const TWeakObjectPtr<AActor>* Entry = RemoteEntities.Find(EntityId);
|
||||
if (!Entry)
|
||||
@@ -181,7 +181,7 @@ void UZMMOWorldSubsystem::HandlePlayerDespawned(const int64 EntityId)
|
||||
// confirmado nos logs do AOI ao oscilar entrada/saida da ZI/ZD.
|
||||
if (AActor* Actor = Entry->Get())
|
||||
{
|
||||
if (IZMMOEntityInterface* AsEntity = Cast<IZMMOEntityInterface>(Actor))
|
||||
if (IZeusEntityInterface* AsEntity = Cast<IZeusEntityInterface>(Actor))
|
||||
{
|
||||
AsEntity->SetEntityRelevant(false);
|
||||
}
|
||||
@@ -189,10 +189,10 @@ void UZMMOWorldSubsystem::HandlePlayerDespawned(const int64 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)
|
||||
{
|
||||
if (EntityId == 0)
|
||||
@@ -204,7 +204,7 @@ void UZMMOWorldSubsystem::HandlePlayerStateUpdate(const int64 EntityId, const in
|
||||
{
|
||||
// Cliente local solto: ignoramos snapshots autoritativos para o nosso
|
||||
// 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.
|
||||
return;
|
||||
}
|
||||
@@ -223,15 +223,15 @@ void UZMMOWorldSubsystem::HandlePlayerStateUpdate(const int64 EntityId, const in
|
||||
return;
|
||||
}
|
||||
|
||||
IZMMOEntityInterface* AsEntity = Cast<IZMMOEntityInterface>(Actor);
|
||||
IZeusEntityInterface* AsEntity = Cast<IZeusEntityInterface>(Actor);
|
||||
if (!AsEntity)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
FZMMOEntitySnapshot Snapshot;
|
||||
FZeusEntitySnapshot Snapshot;
|
||||
Snapshot.EntityId = EntityId;
|
||||
Snapshot.EntityType = AsEntity->GetZMMOEntityType();
|
||||
Snapshot.EntityType = AsEntity->GetZeusEntityType();
|
||||
Snapshot.LastProcessedInputSeq = InputSeq;
|
||||
Snapshot.PositionCm = PosCm;
|
||||
Snapshot.VelocityCmS = VelCmS;
|
||||
@@ -281,7 +281,7 @@ void UZMMOWorldSubsystem::HandlePlayerStateUpdate(const int64 EntityId, const in
|
||||
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))
|
||||
{
|
||||
@@ -290,10 +290,10 @@ UClass* UZMMOWorldSubsystem::ResolveActorClass(const EZMMOEntityType EntityType)
|
||||
return Found->Get();
|
||||
}
|
||||
}
|
||||
return AZMMOEntity::StaticClass();
|
||||
return AZeusEntity::StaticClass();
|
||||
}
|
||||
|
||||
UZeusNetworkSubsystem* UZMMOWorldSubsystem::ResolveZeusNetworkSubsystem() const
|
||||
UZeusNetworkSubsystem* UZeusWorldSubsystem::ResolveZeusNetworkSubsystem() const
|
||||
{
|
||||
const UWorld* World = GetWorld();
|
||||
if (!World)
|
||||
@@ -2,16 +2,16 @@
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Subsystems/WorldSubsystem.h"
|
||||
#include "ZMMOEntityTypes.h"
|
||||
#include "ZMMOWorldSubsystem.generated.h"
|
||||
#include "ZeusEntityTypes.h"
|
||||
#include "ZeusWorldSubsystem.generated.h"
|
||||
|
||||
class AActor;
|
||||
class AZMMOPlayerCharacter;
|
||||
class AZMMOPlayerProxy;
|
||||
class AZeusCharacter;
|
||||
class AZeusPlayerProxy;
|
||||
class UZeusNetworkSubsystem;
|
||||
|
||||
/**
|
||||
* UZMMOWorldSubsystem
|
||||
* UZeusWorldSubsystem
|
||||
*
|
||||
* Subsistema por-mundo que orquestra a aplicacao de pacotes de replicacao
|
||||
* 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
|
||||
* delegates e materializa atores na cena atual.
|
||||
*
|
||||
* Resolucao de classe por `EZMMOEntityType`:
|
||||
* Resolucao de classe por `EZeusEntityType`:
|
||||
* - `RemoteEntityClasses` e um TMap configuravel (BlueprintReadWrite)
|
||||
* 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++.
|
||||
*
|
||||
* Despawn:
|
||||
* - V0: chama `IZMMOEntityInterface::SetEntityRelevant(false)` (preserva
|
||||
* - V0: chama `IZeusEntityInterface::SetEntityRelevant(false)` (preserva
|
||||
* o ator para futuro pooling).
|
||||
* - V1: pool real por `EntityType`, limites de memoria, expiracao.
|
||||
*/
|
||||
UCLASS()
|
||||
class ZMMO_API UZMMOWorldSubsystem : public UWorldSubsystem
|
||||
class ZMMO_API UZeusWorldSubsystem : public UWorldSubsystem
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -48,27 +48,27 @@ public:
|
||||
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
|
||||
* `OnPlayerSpawned` com `bIsLocal=true`).
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category = "ZMMO|World")
|
||||
UFUNCTION(BlueprintCallable, Category = "Zeus|World")
|
||||
void RegisterLocalEntity(int64 EntityId, AActor* LocalActor);
|
||||
|
||||
/** 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(); }
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Mapa configuravel de classe a usar por `EZMMOEntityType`. Caso vazio,
|
||||
* usamos defaults seguros (`AZMMOPlayerProxy` para Player, `AZMMOEntity`
|
||||
* Mapa configuravel de classe a usar por `EZeusEntityType`. Caso vazio,
|
||||
* usamos defaults seguros (`AZeusPlayerProxy` para Player, `AZeusEntity`
|
||||
* para Mob/NPC/Object — actualizado quando classes especificas existirem).
|
||||
*
|
||||
* Pode ser preenchido via Blueprint subclassing ou em runtime.
|
||||
*/
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "ZMMO|World")
|
||||
TMap<EZMMOEntityType, TSubclassOf<AActor>> RemoteEntityClasses;
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Zeus|World")
|
||||
TMap<EZeusEntityType, TSubclassOf<AActor>> RemoteEntityClasses;
|
||||
|
||||
private:
|
||||
UFUNCTION()
|
||||
@@ -80,7 +80,7 @@ private:
|
||||
UFUNCTION()
|
||||
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;
|
||||
|
||||
/**
|
||||
@@ -20,7 +20,7 @@ void UUIDraggableWindow_Base::ApplySavedPosition()
|
||||
const FName Id = GetWindowId();
|
||||
if (Id.IsNone()) return;
|
||||
|
||||
UZMMOUISaveGame* Save = UZMMOUISaveGame::LoadOrCreate();
|
||||
UZeusUISaveGame* Save = UZeusUISaveGame::LoadOrCreate();
|
||||
FVector2D Pos;
|
||||
if (Save && Save->TryGetWindowPosition(Id, Pos))
|
||||
{
|
||||
@@ -33,10 +33,10 @@ void UUIDraggableWindow_Base::PersistCurrentPosition()
|
||||
const FName Id = GetWindowId();
|
||||
if (Id.IsNone()) return;
|
||||
|
||||
UZMMOUISaveGame* Save = UZMMOUISaveGame::LoadOrCreate();
|
||||
UZeusUISaveGame* Save = UZeusUISaveGame::LoadOrCreate();
|
||||
if (!Save) return;
|
||||
Save->SetWindowPosition(Id, GetRenderTransform().Translation);
|
||||
UZMMOUISaveGame::SaveNow(Save);
|
||||
UZeusUISaveGame::SaveNow(Save);
|
||||
}
|
||||
|
||||
bool UUIDraggableWindow_Base::IsDragHandleHit(const FPointerEvent& MouseEvent) const
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
#include "UIDraggableWindow_Base.generated.h"
|
||||
|
||||
class UBorder;
|
||||
class UZMMOUISaveGame;
|
||||
class UZeusUISaveGame;
|
||||
|
||||
/**
|
||||
* Base de janelas in-game movel + persistente. Subclasse define WindowId
|
||||
* (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:
|
||||
* - Bind opcional `Border_DragHandle` cobrindo a area arrastavel (header).
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#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 FZMMOLoadingProfile();
|
||||
return FZeusLoadingProfile();
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
/**
|
||||
* 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/.
|
||||
*
|
||||
* Configurado em DefaultGame.ini:
|
||||
@@ -15,15 +15,15 @@
|
||||
* LoadingProfilesAsset=/Game/ZMMO/Data/UI/Loading/DA_LoadingProfiles.DA_LoadingProfiles
|
||||
*/
|
||||
UCLASS(BlueprintType)
|
||||
class ZMMO_API UZMMOLoadingProfilesDataAsset : public UDataAsset
|
||||
class ZMMO_API UZeusLoadingProfilesDataAsset : public UDataAsset
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Loading")
|
||||
TMap<EZMMOLoadingContext, FZMMOLoadingProfile> Profiles;
|
||||
TMap<EZeusLoadingContext, FZeusLoadingProfile> Profiles;
|
||||
|
||||
/** Retorna o perfil do contexto ou um perfil vazio (sem etapas). */
|
||||
UFUNCTION(BlueprintCallable, Category = "Loading")
|
||||
FZMMOLoadingProfile GetProfile(EZMMOLoadingContext Context) const;
|
||||
FZeusLoadingProfile GetProfile(EZeusLoadingContext Context) const;
|
||||
};
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
#include "UILoadingProfilesDataAsset.h"
|
||||
#include "UILoadingTipRow.h"
|
||||
|
||||
void UUILoadingScreen_Base::Configure(EZMMOLoadingContext InContext,
|
||||
UZMMOLoadingProfilesDataAsset* Profiles,
|
||||
void UUILoadingScreen_Base::Configure(EZeusLoadingContext InContext,
|
||||
UZeusLoadingProfilesDataAsset* Profiles,
|
||||
UDataTable* TipsTable)
|
||||
{
|
||||
Context_ = InContext;
|
||||
@@ -18,22 +18,22 @@ void UUILoadingScreen_Base::Configure(EZMMOLoadingContext InContext,
|
||||
// Perfil (etapas + título).
|
||||
Profile_ = (Profiles != nullptr)
|
||||
? Profiles->GetProfile(InContext)
|
||||
: FZMMOLoadingProfile();
|
||||
: FZeusLoadingProfile();
|
||||
|
||||
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).
|
||||
TipPool_.Reset();
|
||||
if (TipsTable != nullptr)
|
||||
{
|
||||
TipsTable->ForeachRow<FZMMOLoadingTipRow>(TEXT("UUILoadingScreen_Base::Configure"),
|
||||
[this](const FName& /*Key*/, const FZMMOLoadingTipRow& Row)
|
||||
TipsTable->ForeachRow<FZeusLoadingTipRow>(TEXT("UUILoadingScreen_Base::Configure"),
|
||||
[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())
|
||||
{
|
||||
@@ -67,12 +67,12 @@ void UUILoadingScreen_Base::NativeOnDeactivated()
|
||||
|
||||
void UUILoadingScreen_Base::MarkStepRunning(FName StepId)
|
||||
{
|
||||
if (EZMMOLoadingStepStatus* Status = StepStatus_.Find(StepId))
|
||||
if (EZeusLoadingStepStatus* Status = StepStatus_.Find(StepId))
|
||||
{
|
||||
// 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();
|
||||
}
|
||||
}
|
||||
@@ -80,9 +80,9 @@ void UUILoadingScreen_Base::MarkStepRunning(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();
|
||||
|
||||
if (!bCompleteFired_ && AreAllStepsDone())
|
||||
@@ -95,9 +95,9 @@ void UUILoadingScreen_Base::MarkStepDone(FName StepId)
|
||||
|
||||
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())
|
||||
{
|
||||
Text_Status->SetText(Reason);
|
||||
@@ -112,10 +112,10 @@ bool UUILoadingScreen_Base::AreAllStepsDone() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
for (const FZMMOLoadingStepDef& Step : Profile_.Steps)
|
||||
for (const FZeusLoadingStepDef& Step : Profile_.Steps)
|
||||
{
|
||||
const EZMMOLoadingStepStatus* Status = StepStatus_.Find(Step.StepId);
|
||||
if (Status == nullptr || *Status != EZMMOLoadingStepStatus::Done)
|
||||
const EZeusLoadingStepStatus* Status = StepStatus_.Find(Step.StepId);
|
||||
if (Status == nullptr || *Status != EZeusLoadingStepStatus::Done)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -135,11 +135,11 @@ int32 UUILoadingScreen_Base::FindStepIndex(FName StepId) const
|
||||
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;
|
||||
const EZMMOLoadingStepStatus* Status = StepStatus_.Find(Profile_.Steps[Index].StepId);
|
||||
return Status ? *Status : EZMMOLoadingStepStatus::Pending;
|
||||
if (!Profile_.Steps.IsValidIndex(Index)) return EZeusLoadingStepStatus::Pending;
|
||||
const EZeusLoadingStepStatus* Status = StepStatus_.Find(Profile_.Steps[Index].StepId);
|
||||
return Status ? *Status : EZeusLoadingStepStatus::Pending;
|
||||
}
|
||||
|
||||
FText UUILoadingScreen_Base::ComputeCurrentStatusText() const
|
||||
@@ -148,12 +148,12 @@ FText UUILoadingScreen_Base::ComputeCurrentStatusText() const
|
||||
int32 LastDone = INDEX_NONE;
|
||||
for (int32 i = 0; i < Profile_.Steps.Num(); ++i)
|
||||
{
|
||||
const EZMMOLoadingStepStatus St = GetStepStatus(i);
|
||||
if (St == EZMMOLoadingStepStatus::Running)
|
||||
const EZeusLoadingStepStatus St = GetStepStatus(i);
|
||||
if (St == EZeusLoadingStepStatus::Running)
|
||||
{
|
||||
return Profile_.Steps[i].Label;
|
||||
}
|
||||
if (St == EZMMOLoadingStepStatus::Done)
|
||||
if (St == EZeusLoadingStepStatus::Done)
|
||||
{
|
||||
LastDone = i;
|
||||
}
|
||||
@@ -176,9 +176,9 @@ float UUILoadingScreen_Base::ComputeProgress01() const
|
||||
float Acc = 0.f;
|
||||
for (int32 i = 0; i < N; ++i)
|
||||
{
|
||||
const EZMMOLoadingStepStatus St = GetStepStatus(i);
|
||||
if (St == EZMMOLoadingStepStatus::Done) Acc += 1.f;
|
||||
else if (St == EZMMOLoadingStepStatus::Running) Acc += 0.5f;
|
||||
const EZeusLoadingStepStatus St = GetStepStatus(i);
|
||||
if (St == EZeusLoadingStepStatus::Done) Acc += 1.f;
|
||||
else if (St == EZeusLoadingStepStatus::Running) Acc += 0.5f;
|
||||
}
|
||||
return FMath::Clamp(Acc / static_cast<float>(N), 0.f, 1.f);
|
||||
}
|
||||
|
||||
@@ -8,15 +8,15 @@
|
||||
class UCommonTextBlock;
|
||||
class UProgressBar;
|
||||
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 →
|
||||
* WorldServer) e pelo InGame (entrada em instance/dungeon, respawn). Cada
|
||||
* uso passa um EZMMOLoadingContext em Configure(), que resolve o perfil
|
||||
* no UZMMOLoadingProfilesDataAsset (lista de etapas + título).
|
||||
* uso passa um EZeusLoadingContext em Configure(), que resolve o perfil
|
||||
* no UZeusLoadingProfilesDataAsset (lista de etapas + título).
|
||||
*
|
||||
* Quem orquestra (UIFrontEndFlowSubsystem, futuro UIInGameFlowSubsystem)
|
||||
* assina os próprios eventos (HandlePostLoadMap, OnPlayerSpawned, etc) e
|
||||
@@ -41,8 +41,8 @@ public:
|
||||
* de NativeOnActivated (estado é reaplicado em RefreshUI).
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category = "Loading")
|
||||
void Configure(EZMMOLoadingContext InContext,
|
||||
UZMMOLoadingProfilesDataAsset* Profiles,
|
||||
void Configure(EZeusLoadingContext InContext,
|
||||
UZeusLoadingProfilesDataAsset* Profiles,
|
||||
UDataTable* TipsTable);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "Loading")
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
|
||||
/** Disparado UMA vez quando todas as etapas viram Done. */
|
||||
UPROPERTY(BlueprintAssignable, Category = "Loading")
|
||||
FZMMOOnLoadingComplete OnLoadingComplete;
|
||||
FZeusOnLoadingComplete OnLoadingComplete;
|
||||
|
||||
protected:
|
||||
virtual void NativeOnActivated() override;
|
||||
@@ -75,7 +75,7 @@ protected:
|
||||
int32 FindStepIndex(FName StepId) const;
|
||||
|
||||
/** 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. */
|
||||
FText ComputeCurrentStatusText() const;
|
||||
@@ -107,13 +107,13 @@ protected:
|
||||
float TipRotationIntervalSeconds = 6.f;
|
||||
|
||||
private:
|
||||
EZMMOLoadingContext Context_ = EZMMOLoadingContext::None;
|
||||
EZeusLoadingContext Context_ = EZeusLoadingContext::None;
|
||||
|
||||
UPROPERTY(Transient)
|
||||
FZMMOLoadingProfile Profile_;
|
||||
FZeusLoadingProfile Profile_;
|
||||
|
||||
UPROPERTY(Transient)
|
||||
TMap<FName, EZMMOLoadingStepStatus> StepStatus_;
|
||||
TMap<FName, EZeusLoadingStepStatus> StepStatus_;
|
||||
|
||||
UPROPERTY(Transient)
|
||||
TArray<FText> TipPool_;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* UE). Filtra por contexto: Context=None significa "qualquer loading".
|
||||
*/
|
||||
USTRUCT(BlueprintType)
|
||||
struct FZMMOLoadingTipRow : public FTableRowBase
|
||||
struct FZeusLoadingTipRow : public FTableRowBase
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -22,7 +22,7 @@ struct FZMMOLoadingTipRow : public FTableRowBase
|
||||
|
||||
/** Restringe a dica a um contexto. None = todos. */
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Loading")
|
||||
EZMMOLoadingContext Context = EZMMOLoadingContext::None;
|
||||
EZeusLoadingContext Context = EZeusLoadingContext::None;
|
||||
|
||||
/** Tag opcional pra categorizar (PvE/PvP/Crafting...) — futuro filtro. */
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Loading")
|
||||
|
||||
@@ -2,23 +2,23 @@
|
||||
|
||||
#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 (UZMMOUISaveGame* Loaded = Cast<UZMMOUISaveGame>(
|
||||
if (UZeusUISaveGame* Loaded = Cast<UZeusUISaveGame>(
|
||||
UGameplayStatics::LoadGameFromSlot(SlotName, UserIndex)))
|
||||
{
|
||||
return Loaded;
|
||||
}
|
||||
}
|
||||
return Cast<UZMMOUISaveGame>(
|
||||
UGameplayStatics::CreateSaveGameObject(UZMMOUISaveGame::StaticClass()));
|
||||
return Cast<UZeusUISaveGame>(
|
||||
UGameplayStatics::CreateSaveGameObject(UZeusUISaveGame::StaticClass()));
|
||||
}
|
||||
|
||||
void UZMMOUISaveGame::SaveNow(UZMMOUISaveGame* Save)
|
||||
void UZeusUISaveGame::SaveNow(UZeusUISaveGame* 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))
|
||||
{
|
||||
@@ -37,7 +37,7 @@ bool UZMMOUISaveGame::TryGetWindowPosition(FName WindowId, FVector2D& OutPos) co
|
||||
return false;
|
||||
}
|
||||
|
||||
void UZMMOUISaveGame::SetWindowPosition(FName WindowId, FVector2D Pos)
|
||||
void UZeusUISaveGame::SetWindowPosition(FName WindowId, FVector2D Pos)
|
||||
{
|
||||
WindowPositions.Add(WindowId, Pos);
|
||||
}
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
* movel registra uma chave (FName WindowId) e grava aqui ao soltar o drag.
|
||||
*
|
||||
* 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
|
||||
* pra que a Base nao precise repetir a cerimonia.
|
||||
*/
|
||||
UCLASS()
|
||||
class ZMMO_API UZMMOUISaveGame : public USaveGame
|
||||
class ZMMO_API UZeusUISaveGame : public USaveGame
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -32,10 +32,10 @@ public:
|
||||
* Carrega o save existente ou cria um novo (nao salva ainda).
|
||||
* Sempre retorna instancia valida.
|
||||
*/
|
||||
static UZMMOUISaveGame* LoadOrCreate();
|
||||
static UZeusUISaveGame* LoadOrCreate();
|
||||
|
||||
/** 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. */
|
||||
UFUNCTION(BlueprintCallable, Category = "UI|Prefs")
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
* é responsabilidade do UZeusCharServerSubsystem (Send/OnRawMessage operam
|
||||
* 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 S_CHAR_AUTH_OK = 2001; // string(accountId)+string(user)+uint64(expiresMs)
|
||||
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
|
||||
* C_CHAR_AUTH_REQUEST.
|
||||
*/
|
||||
namespace ZMMOCharAuthMethod
|
||||
namespace ZeusCharAuthMethod
|
||||
{
|
||||
constexpr uint8 TOKEN = 0;
|
||||
constexpr uint8 PASSWORD = 1;
|
||||
}
|
||||
|
||||
/** Espelha `CharRejectReason` em CharOpcodes.ts. */
|
||||
namespace ZMMOCharRejectReason
|
||||
namespace ZeusCharRejectReason
|
||||
{
|
||||
constexpr uint16 Unknown = 0;
|
||||
constexpr uint16 InvalidToken = 1;
|
||||
@@ -85,7 +85,7 @@ namespace ZMMOCharRejectReason
|
||||
}
|
||||
|
||||
/** Estado do Realm no wire (uint8). Espelha `WireRealmState` em CharOpcodes.ts. */
|
||||
namespace ZMMOWireRealmState
|
||||
namespace ZeusWireRealmState
|
||||
{
|
||||
constexpr uint8 Offline = 0;
|
||||
constexpr uint8 Online = 1;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "UIActivatableScreen_Base.h"
|
||||
|
||||
#include "ZMMOThemeSubsystem.h"
|
||||
#include "ZeusThemeSubsystem.h"
|
||||
#include "UIFrontEndFlowSubsystem.h"
|
||||
#include "Engine/GameInstance.h"
|
||||
#include "Input/UIActionBindingHandle.h"
|
||||
@@ -10,13 +10,13 @@ TOptional<FUIInputConfig> UUIActivatableScreen_Base::GetDesiredInputConfig() con
|
||||
{
|
||||
switch (InputConfig)
|
||||
{
|
||||
case EZMMOScreenInputMode::GameAndMenu:
|
||||
case EZeusScreenInputMode::GameAndMenu:
|
||||
return FUIInputConfig(ECommonInputMode::All, GameMouseCaptureMode);
|
||||
case EZMMOScreenInputMode::Game:
|
||||
case EZeusScreenInputMode::Game:
|
||||
return FUIInputConfig(ECommonInputMode::Game, GameMouseCaptureMode);
|
||||
case EZMMOScreenInputMode::Menu:
|
||||
case EZeusScreenInputMode::Menu:
|
||||
return FUIInputConfig(ECommonInputMode::Menu, EMouseCaptureMode::NoCapture);
|
||||
case EZMMOScreenInputMode::Default:
|
||||
case EZeusScreenInputMode::Default:
|
||||
default:
|
||||
return TOptional<FUIInputConfig>();
|
||||
}
|
||||
@@ -25,7 +25,7 @@ TOptional<FUIInputConfig> UUIActivatableScreen_Base::GetDesiredInputConfig() con
|
||||
void UUIActivatableScreen_Base::RefreshUIStyle_Implementation()
|
||||
{
|
||||
// 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.
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ void UUIActivatableScreen_Base::NativeConstruct()
|
||||
{
|
||||
if (const UGameInstance* GI = GetGameInstance())
|
||||
{
|
||||
if (UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>())
|
||||
if (UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
|
||||
{
|
||||
Theme->OnThemeChanged.AddDynamic(this, &UUIActivatableScreen_Base::HandleThemeChanged);
|
||||
bThemeBound = true;
|
||||
@@ -54,7 +54,7 @@ void UUIActivatableScreen_Base::NativeDestruct()
|
||||
{
|
||||
if (const UGameInstance* GI = GetGameInstance())
|
||||
{
|
||||
if (UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>())
|
||||
if (UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
|
||||
{
|
||||
Theme->OnThemeChanged.RemoveDynamic(this, &UUIActivatableScreen_Base::HandleThemeChanged);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
* GetDesiredInputConfig.
|
||||
*/
|
||||
UENUM(BlueprintType)
|
||||
enum class EZMMOScreenInputMode : uint8
|
||||
enum class EZeusScreenInputMode : uint8
|
||||
{
|
||||
Default, // não força nada (herda do CommonUI)
|
||||
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
|
||||
* 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.
|
||||
*/
|
||||
UCLASS(Abstract, Blueprintable)
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
protected:
|
||||
// ---- Input config (desktop/gamepad) ----
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Input")
|
||||
EZMMOScreenInputMode InputConfig = EZMMOScreenInputMode::Menu;
|
||||
EZeusScreenInputMode InputConfig = EZeusScreenInputMode::Menu;
|
||||
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Input")
|
||||
EMouseCaptureMode GameMouseCaptureMode = EMouseCaptureMode::CapturePermanently;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "UIButton_Base.h"
|
||||
#include "UISpinner_Base.h"
|
||||
#include "UIFrontEndFlowSubsystem.h"
|
||||
#include "ZMMOThemeSubsystem.h"
|
||||
#include "ZeusThemeSubsystem.h"
|
||||
#include "ZeusCharServerSubsystem.h"
|
||||
#include "CommonTextBlock.h"
|
||||
#include "Components/Border.h"
|
||||
@@ -22,7 +22,7 @@ namespace
|
||||
{
|
||||
if (const UGameInstance* GI = Widget->GetGameInstance())
|
||||
{
|
||||
if (const UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>())
|
||||
if (const UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
|
||||
{
|
||||
return Theme->GetActiveUIStyle();
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "Engine/World.h"
|
||||
#include "TimerManager.h"
|
||||
#include "UI/Widgets/UIButton_Base.h"
|
||||
#include "ZMMOJobsLibrary.h"
|
||||
#include "ZeusJobsLibrary.h"
|
||||
|
||||
void UUICharCard_Base::NativeConstruct()
|
||||
{
|
||||
@@ -34,7 +34,7 @@ void UUICharCard_Base::NativeDestruct()
|
||||
Super::NativeDestruct();
|
||||
}
|
||||
|
||||
void UUICharCard_Base::SetFromSummary(const FZMMOCharSummary& InSummary)
|
||||
void UUICharCard_Base::SetFromSummary(const FZeusCharSummary& InSummary)
|
||||
{
|
||||
Summary = InSummary;
|
||||
const bool bDeleteScheduled = Summary.DeleteScheduledAtMs > 0;
|
||||
@@ -49,7 +49,7 @@ void UUICharCard_Base::SetFromSummary(const FZMMOCharSummary& InSummary)
|
||||
}
|
||||
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;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Blueprint/UserWidget.h"
|
||||
#include "ZMMOCharSummary.h"
|
||||
#include "ZeusCharSummary.h"
|
||||
#include "UICharCard_Base.generated.h"
|
||||
|
||||
class UCommonTextBlock;
|
||||
@@ -10,10 +10,10 @@ class UBorder;
|
||||
class UUIButton_Base;
|
||||
class UWidget;
|
||||
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FZMMOOnCharCardSelected, FString, CharId);
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FZMMOOnCharCardDeleteRequest, FString, CharId);
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FZMMOOnCharCardDeleteAccept, FString, CharId);
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FZMMOOnCharCardDeleteCancel, FString, CharId);
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FZeusOnCharCardSelected, FString, CharId);
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FZeusOnCharCardDeleteRequest, FString, CharId);
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FZeusOnCharCardDeleteAccept, FString, CharId);
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FZeusOnCharCardDeleteCancel, FString, CharId);
|
||||
|
||||
/**
|
||||
* Card de personagem (instanciado dinamicamente pelo Lobby/CharSelect).
|
||||
@@ -34,22 +34,22 @@ class ZMMO_API UUICharCard_Base : public UUserWidget
|
||||
|
||||
public:
|
||||
UFUNCTION(BlueprintCallable, Category = "Zeus|CharCard")
|
||||
void SetFromSummary(const FZMMOCharSummary& InSummary);
|
||||
void SetFromSummary(const FZeusCharSummary& InSummary);
|
||||
|
||||
UPROPERTY(BlueprintReadOnly, Category = "Zeus|CharCard")
|
||||
FZMMOCharSummary Summary;
|
||||
FZeusCharSummary Summary;
|
||||
|
||||
UPROPERTY(BlueprintAssignable, Category = "Zeus|CharCard")
|
||||
FZMMOOnCharCardSelected OnCardSelected;
|
||||
FZeusOnCharCardSelected OnCardSelected;
|
||||
|
||||
UPROPERTY(BlueprintAssignable, Category = "Zeus|CharCard")
|
||||
FZMMOOnCharCardDeleteRequest OnCardDeleteRequest;
|
||||
FZeusOnCharCardDeleteRequest OnCardDeleteRequest;
|
||||
|
||||
UPROPERTY(BlueprintAssignable, Category = "Zeus|CharCard")
|
||||
FZMMOOnCharCardDeleteAccept OnCardDeleteAccept;
|
||||
FZeusOnCharCardDeleteAccept OnCardDeleteAccept;
|
||||
|
||||
UPROPERTY(BlueprintAssignable, Category = "Zeus|CharCard")
|
||||
FZMMOOnCharCardDeleteCancel OnCardDeleteCancel;
|
||||
FZeusOnCharCardDeleteCancel OnCardDeleteCancel;
|
||||
|
||||
/**
|
||||
* Hook BP — chamado apos SetFromSummary aplicar valores. Util pra
|
||||
|
||||
@@ -11,11 +11,11 @@
|
||||
#include "Engine/GameInstance.h"
|
||||
#include "UI/Widgets/UIButton_Base.h"
|
||||
|
||||
using ZMMOWire::WriteUuid16;
|
||||
using ZMMOWire::WriteUInt8;
|
||||
using ZMMOWire::WriteUInt16;
|
||||
using ZMMOWire::WriteUInt32;
|
||||
using ZMMOWire::WriteStringUtf8;
|
||||
using ZeusWire::WriteUuid16;
|
||||
using ZeusWire::WriteUInt8;
|
||||
using ZeusWire::WriteUInt16;
|
||||
using ZeusWire::WriteUInt32;
|
||||
using ZeusWire::WriteStringUtf8;
|
||||
|
||||
void UUICharacterCreatePage_Base::NativeConstruct()
|
||||
{
|
||||
@@ -86,7 +86,7 @@ void UUICharacterCreatePage_Base::SubmitCreate()
|
||||
WriteUInt32(Payload, 0); // skinColor
|
||||
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());
|
||||
OnRequestSent.Broadcast();
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@ class UComboBoxString;
|
||||
class UCommonTextBlock;
|
||||
class UUIButton_Base;
|
||||
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FZMMOOnCharCreateRequestSent);
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FZMMOOnCharCreateCancelled);
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FZeusOnCharCreateRequestSent);
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FZeusOnCharCreateCancelled);
|
||||
|
||||
/**
|
||||
* Page de criacao de personagem dentro do Lobby. Form minimo: nome + classId
|
||||
@@ -35,10 +35,10 @@ public:
|
||||
void CancelCreate();
|
||||
|
||||
UPROPERTY(BlueprintAssignable, Category = "Zeus|CharCreate")
|
||||
FZMMOOnCharCreateRequestSent OnRequestSent;
|
||||
FZeusOnCharCreateRequestSent OnRequestSent;
|
||||
|
||||
UPROPERTY(BlueprintAssignable, Category = "Zeus|CharCreate")
|
||||
FZMMOOnCharCreateCancelled OnCancelled;
|
||||
FZeusOnCharCreateCancelled OnCancelled;
|
||||
|
||||
protected:
|
||||
virtual void NativeConstruct() override;
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
#include "UI/Common/UILoadingProfilesDataAsset.h"
|
||||
#include "UI/Common/UILoadingScreen_Base.h"
|
||||
#include "UI/UILayerTags.h"
|
||||
#include "ZMMOGameInstance.h"
|
||||
#include "ZMMOThemeSubsystem.h"
|
||||
#include "ZeusGameInstance.h"
|
||||
#include "ZeusThemeSubsystem.h"
|
||||
#include "ZeusNetworkSubsystem.h"
|
||||
#include "ZeusCharServerSubsystem.h"
|
||||
#include "CommonActivatableWidget.h"
|
||||
@@ -48,7 +48,7 @@ void UUIFrontEndFlowSubsystem::StartFrontEnd()
|
||||
EnsureRootLayout();
|
||||
BindNetwork();
|
||||
|
||||
SetState(EZMMOFrontEndState::Boot);
|
||||
SetState(EZeusFrontEndState::Boot);
|
||||
|
||||
// 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.
|
||||
@@ -82,7 +82,7 @@ void UUIFrontEndFlowSubsystem::EnsureRootLayout()
|
||||
UE_LOG(LogZMMO, Log, TEXT("FrontEndFlow::EnsureRootLayout: RootLayout recriado"));
|
||||
}
|
||||
|
||||
void UUIFrontEndFlowSubsystem::SetState(EZMMOFrontEndState NewState)
|
||||
void UUIFrontEndFlowSubsystem::SetState(EZeusFrontEndState NewState)
|
||||
{
|
||||
if (NewState == CurrentState)
|
||||
{
|
||||
@@ -94,16 +94,16 @@ void UUIFrontEndFlowSubsystem::SetState(EZMMOFrontEndState NewState)
|
||||
*UEnum::GetValueAsString(NewState));
|
||||
OnStateChanged.Broadcast(NewState);
|
||||
|
||||
const FGameplayTag MenuLayer = ZMMOUITags::UI_Layer_Menu.GetTag();
|
||||
const FGameplayTag ModalLayer = ZMMOUITags::UI_Layer_Modal.GetTag();
|
||||
const FGameplayTag MenuLayer = ZeusUITags::UI_Layer_Menu.GetTag();
|
||||
const FGameplayTag ModalLayer = ZeusUITags::UI_Layer_Modal.GetTag();
|
||||
|
||||
switch (NewState)
|
||||
{
|
||||
case EZMMOFrontEndState::Boot:
|
||||
case EZMMOFrontEndState::Connecting:
|
||||
case EZMMOFrontEndState::Login:
|
||||
case EZMMOFrontEndState::ServerSelect:
|
||||
case EZMMOFrontEndState::Lobby:
|
||||
case EZeusFrontEndState::Boot:
|
||||
case EZeusFrontEndState::Connecting:
|
||||
case EZeusFrontEndState::Login:
|
||||
case EZeusFrontEndState::ServerSelect:
|
||||
case EZeusFrontEndState::Lobby:
|
||||
// Telas do front-end vivem na camada Menu (uma por vez).
|
||||
if (UUIManagerSubsystem* Mgr = GetUIManager())
|
||||
{
|
||||
@@ -112,12 +112,12 @@ void UUIFrontEndFlowSubsystem::SetState(EZMMOFrontEndState NewState)
|
||||
ResolveAndPushScreen(NewState);
|
||||
break;
|
||||
|
||||
case EZMMOFrontEndState::EnteringWorld:
|
||||
case EZeusFrontEndState::EnteringWorld:
|
||||
// Loading/handoff por cima de tudo (camada Modal).
|
||||
ResolveAndPushScreen(NewState);
|
||||
break;
|
||||
|
||||
case EZMMOFrontEndState::InWorld:
|
||||
case EZeusFrontEndState::InWorld:
|
||||
// HUD de gameplay assume — limpa front-end e loading.
|
||||
if (UUIManagerSubsystem* Mgr = GetUIManager())
|
||||
{
|
||||
@@ -126,13 +126,13 @@ void UUIFrontEndFlowSubsystem::SetState(EZMMOFrontEndState NewState)
|
||||
}
|
||||
break;
|
||||
|
||||
case EZMMOFrontEndState::None:
|
||||
case EZeusFrontEndState::None:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void UUIFrontEndFlowSubsystem::ShowLobbyPage(EZMMOLobbyPage Page)
|
||||
void UUIFrontEndFlowSubsystem::ShowLobbyPage(EZeusLobbyPage Page)
|
||||
{
|
||||
UUIFrontEndScreenSet* SS = GetScreenSet();
|
||||
UUIManagerSubsystem* Mgr = GetUIManager();
|
||||
@@ -149,7 +149,7 @@ void UUIFrontEndFlowSubsystem::ShowLobbyPage(EZMMOLobbyPage Page)
|
||||
return;
|
||||
}
|
||||
|
||||
const FGameplayTag MenuLayer = ZMMOUITags::UI_Layer_Menu.GetTag();
|
||||
const FGameplayTag MenuLayer = ZeusUITags::UI_Layer_Menu.GetTag();
|
||||
const FSoftObjectPath Path = Soft.ToSoftObjectPath();
|
||||
UAssetManager::GetStreamableManager().RequestAsyncLoad(
|
||||
Path,
|
||||
@@ -169,22 +169,22 @@ bool UUIFrontEndFlowSubsystem::RequestBack()
|
||||
{
|
||||
switch (CurrentState)
|
||||
{
|
||||
case EZMMOFrontEndState::Login:
|
||||
case EZeusFrontEndState::Login:
|
||||
// Volta à Boot (CharServer segue conectado; só re-mostra a tela).
|
||||
SetState(EZMMOFrontEndState::Boot);
|
||||
SetState(EZeusFrontEndState::Boot);
|
||||
return true;
|
||||
case EZMMOFrontEndState::ServerSelect:
|
||||
SetState(EZMMOFrontEndState::Login);
|
||||
case EZeusFrontEndState::ServerSelect:
|
||||
SetState(EZeusFrontEndState::Login);
|
||||
return true;
|
||||
case EZMMOFrontEndState::Lobby:
|
||||
SetState(EZMMOFrontEndState::ServerSelect);
|
||||
case EZeusFrontEndState::Lobby:
|
||||
SetState(EZeusFrontEndState::ServerSelect);
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void UUIFrontEndFlowSubsystem::ResolveAndPushScreen(EZMMOFrontEndState State)
|
||||
void UUIFrontEndFlowSubsystem::ResolveAndPushScreen(EZeusFrontEndState State)
|
||||
{
|
||||
UUIFrontEndScreenSet* SS = GetScreenSet();
|
||||
if (!SS)
|
||||
@@ -209,9 +209,9 @@ void UUIFrontEndFlowSubsystem::ResolveAndPushScreen(EZMMOFrontEndState State)
|
||||
return;
|
||||
}
|
||||
|
||||
const FGameplayTag Layer = (State == EZMMOFrontEndState::EnteringWorld)
|
||||
? ZMMOUITags::UI_Layer_Modal.GetTag()
|
||||
: ZMMOUITags::UI_Layer_Menu.GetTag();
|
||||
const FGameplayTag Layer = (State == EZeusFrontEndState::EnteringWorld)
|
||||
? ZeusUITags::UI_Layer_Modal.GetTag()
|
||||
: ZeusUITags::UI_Layer_Menu.GetTag();
|
||||
|
||||
const FSoftObjectPath Path = Soft.ToSoftObjectPath();
|
||||
UAssetManager::GetStreamableManager().RequestAsyncLoad(
|
||||
@@ -226,12 +226,12 @@ void UUIFrontEndFlowSubsystem::ResolveAndPushScreen(EZMMOFrontEndState State)
|
||||
|
||||
// Loading: configura logo após o push e marca etapa "Travel"
|
||||
// (chegamos aqui via HandleServerTravelRequested → SetState).
|
||||
if (State == EZMMOFrontEndState::EnteringWorld)
|
||||
if (State == EZeusFrontEndState::EnteringWorld)
|
||||
{
|
||||
if (UUILoadingScreen_Base* Loading = Cast<UUILoadingScreen_Base>(Pushed))
|
||||
{
|
||||
ActiveLoadingScreen = Loading;
|
||||
Loading->Configure(EZMMOLoadingContext::FrontEndEnteringWorld,
|
||||
Loading->Configure(EZeusLoadingContext::FrontEndEnteringWorld,
|
||||
GetLoadingProfiles(), GetLoadingTips());
|
||||
Loading->OnLoadingComplete.AddDynamic(this, &UUIFrontEndFlowSubsystem::HandleLoadingComplete);
|
||||
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)."),
|
||||
StatusCode, *Reason);
|
||||
// Se caiu antes de entrar no mundo, volta a Boot para reconectar.
|
||||
if (CurrentState != EZMMOFrontEndState::InWorld &&
|
||||
CurrentState != EZMMOFrontEndState::EnteringWorld &&
|
||||
CurrentState != EZMMOFrontEndState::Boot)
|
||||
if (CurrentState != EZeusFrontEndState::InWorld &&
|
||||
CurrentState != EZeusFrontEndState::EnteringWorld &&
|
||||
CurrentState != EZeusFrontEndState::Boot)
|
||||
{
|
||||
SetState(EZMMOFrontEndState::Boot);
|
||||
SetState(EZeusFrontEndState::Boot);
|
||||
if (UZeusCharServerSubsystem* Char = GetCharServer())
|
||||
{
|
||||
Char->ConnectToDefaultCharServer();
|
||||
@@ -376,17 +376,17 @@ void UUIFrontEndFlowSubsystem::HandleCharDisconnected(int32 StatusCode, FString
|
||||
|
||||
void UUIFrontEndFlowSubsystem::RequestEnterLogin()
|
||||
{
|
||||
if (CurrentState == EZMMOFrontEndState::Boot)
|
||||
if (CurrentState == EZeusFrontEndState::Boot)
|
||||
{
|
||||
SetState(EZMMOFrontEndState::Login);
|
||||
SetState(EZeusFrontEndState::Login);
|
||||
}
|
||||
}
|
||||
|
||||
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)"),
|
||||
*TargetShort);
|
||||
bTravelingToWorld = false;
|
||||
if (CurrentState != EZMMOFrontEndState::InWorld)
|
||||
if (CurrentState != EZeusFrontEndState::InWorld)
|
||||
{
|
||||
SetState(EZMMOFrontEndState::InWorld);
|
||||
SetState(EZeusFrontEndState::InWorld);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -449,15 +449,15 @@ void UUIFrontEndFlowSubsystem::HandleServerTravelRequested(const FString& MapNam
|
||||
}
|
||||
|
||||
bTravelingToWorld = true;
|
||||
SetState(EZMMOFrontEndState::EnteringWorld);
|
||||
SetState(EZeusFrontEndState::EnteringWorld);
|
||||
|
||||
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
|
||||
// (GameModeOverride=ZMMOFrontEndGameMode) — sobrescrevemos via URL
|
||||
// (GameModeOverride=ZeusFrontEndGameMode) — sobrescrevemos via URL
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
@@ -514,10 +514,10 @@ void UUIFrontEndFlowSubsystem::HandleLoadingComplete()
|
||||
ActiveLoadingScreen.Reset();
|
||||
PendingLoadingSteps_.Reset();
|
||||
bTravelingToWorld = false;
|
||||
SetState(EZMMOFrontEndState::InWorld);
|
||||
SetState(EZeusFrontEndState::InWorld);
|
||||
}
|
||||
|
||||
UZMMOLoadingProfilesDataAsset* UUIFrontEndFlowSubsystem::GetLoadingProfiles()
|
||||
UZeusLoadingProfilesDataAsset* UUIFrontEndFlowSubsystem::GetLoadingProfiles()
|
||||
{
|
||||
if (LoadingProfiles) return LoadingProfiles;
|
||||
if (!LoadingProfilesAsset.IsNull())
|
||||
@@ -543,14 +543,14 @@ void UUIFrontEndFlowSubsystem::HandleServerHelloTheme(FName ThemeId)
|
||||
// ThemeId do ServerHello. Mantido pronto para quando o plugin expuser.
|
||||
if (const UGameInstance* GI = GetGameInstance())
|
||||
{
|
||||
if (UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>())
|
||||
if (UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
|
||||
{
|
||||
Theme->ApplyServerTheme(ThemeId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const FZMMOMapDef* UUIFrontEndFlowSubsystem::FindMapDef(int32 MapId) const
|
||||
const FZeusMapDef* UUIFrontEndFlowSubsystem::FindMapDef(int32 MapId) const
|
||||
{
|
||||
if (MapId <= 0) return nullptr;
|
||||
if (MapsTableAsset.IsNull())
|
||||
@@ -563,7 +563,7 @@ const FZMMOMapDef* UUIFrontEndFlowSubsystem::FindMapDef(int32 MapId) const
|
||||
|
||||
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)
|
||||
{
|
||||
return Def;
|
||||
@@ -574,7 +574,7 @@ const FZMMOMapDef* UUIFrontEndFlowSubsystem::FindMapDef(int32 MapId) const
|
||||
|
||||
FString UUIFrontEndFlowSubsystem::ResolveLevelPathByMapId(int32 MapId) const
|
||||
{
|
||||
const FZMMOMapDef* Def = FindMapDef(MapId);
|
||||
const FZeusMapDef* Def = FindMapDef(MapId);
|
||||
if (!Def) return FString();
|
||||
const FSoftObjectPath ObjPath = Def->ClientLevel.ToSoftObjectPath();
|
||||
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);
|
||||
bTravelingToWorld = true;
|
||||
SetState(EZMMOFrontEndState::EnteringWorld);
|
||||
const FString Options = TEXT("game=/Script/ZMMO.ZMMOGameMode");
|
||||
SetState(EZeusFrontEndState::EnteringWorld);
|
||||
const FString Options = TEXT("game=/Script/ZMMO.ZeusGameMode");
|
||||
UGameplayStatics::OpenLevel(GetGameInstance(), FName(*MapPath), /*bAbsolute=*/true, Options);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
class UUIFrontEndScreenSet;
|
||||
class UUIManagerSubsystem;
|
||||
class UUILoadingScreen_Base;
|
||||
class UZMMOLoadingProfilesDataAsset;
|
||||
class UZeusLoadingProfilesDataAsset;
|
||||
class UZeusNetworkSubsystem;
|
||||
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
|
||||
@@ -22,7 +22,7 @@ DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnZMMOFrontEndStateChanged, EZMMOFr
|
||||
* morrer no OpenLevel).
|
||||
*
|
||||
* 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
|
||||
* camada certa; (d) detectar a chegada ao mundo.
|
||||
*
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
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
|
||||
* ZeusNetworkSubsystem sobre GameInstance::Init). Cria o root layout,
|
||||
* liga os delegates de rede e dispara Boot→Connecting.
|
||||
@@ -61,14 +61,14 @@ public:
|
||||
void EnsureRootLayout();
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "FrontEnd")
|
||||
void SetState(EZMMOFrontEndState NewState);
|
||||
void SetState(EZeusFrontEndState NewState);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category = "FrontEnd")
|
||||
EZMMOFrontEndState GetCurrentState() const { return CurrentState; }
|
||||
EZeusFrontEndState GetCurrentState() const { return CurrentState; }
|
||||
|
||||
/** Mostra uma página interna do Lobby ("switch principal"). */
|
||||
UFUNCTION(BlueprintCallable, Category = "FrontEnd")
|
||||
void ShowLobbyPage(EZMMOLobbyPage Page);
|
||||
void ShowLobbyPage(EZeusLobbyPage Page);
|
||||
|
||||
/** "Voltar". Retorna true se o fluxo consumiu (tela base encaminha aqui). */
|
||||
UFUNCTION(BlueprintCallable, Category = "FrontEnd")
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
* Retorna nullptr se MapId=0, DT_Maps nao configurado, ou mapId nao
|
||||
* encontrado.
|
||||
*/
|
||||
const FZMMOMapDef* FindMapDef(int32 MapId) const;
|
||||
const FZeusMapDef* FindMapDef(int32 MapId) const;
|
||||
|
||||
/**
|
||||
* 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
|
||||
* `?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.
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category = "FrontEnd|Maps")
|
||||
@@ -122,7 +122,7 @@ public:
|
||||
/**
|
||||
* Memoriza a pose autoritativa do char vinda no `S_CHAR_SELECT_OK`
|
||||
* (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
|
||||
* do level. Limpa apos consumo (a proxima sessao reenvia).
|
||||
*/
|
||||
@@ -133,7 +133,7 @@ public:
|
||||
bool ConsumePendingSpawnPose(FVector& OutPosCm, float& OutYawDeg);
|
||||
|
||||
UPROPERTY(BlueprintAssignable, Category = "FrontEnd")
|
||||
FOnZMMOFrontEndStateChanged OnStateChanged;
|
||||
FOnZeusFrontEndStateChanged OnStateChanged;
|
||||
|
||||
protected:
|
||||
/** DA com o mapa estado→tela. Config em DefaultGame.ini. */
|
||||
@@ -141,7 +141,7 @@ protected:
|
||||
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:
|
||||
* [/Script/ZMMO.UIFrontEndFlowSubsystem]
|
||||
* MapsTableAsset=/Game/ZMMO/Data/World/DT_Maps.DT_Maps
|
||||
@@ -156,10 +156,10 @@ protected:
|
||||
* LoadingProfilesAsset=/Game/ZMMO/Data/UI/Loading/DA_LoadingProfiles.DA_LoadingProfiles
|
||||
*/
|
||||
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:
|
||||
* [/Script/ZMMO.UIFrontEndFlowSubsystem]
|
||||
* LoadingTipsAsset=/Game/ZMMO/Data/UI/Loading/DT_LoadingTips.DT_LoadingTips
|
||||
@@ -176,7 +176,7 @@ private:
|
||||
UUIFrontEndScreenSet* GetScreenSet();
|
||||
|
||||
/** 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()
|
||||
void HandleConnected();
|
||||
@@ -205,7 +205,7 @@ private:
|
||||
void HandlePostLoadMap(UWorld* LoadedWorld);
|
||||
|
||||
/** Resolve+carrega o DA de perfis (sync). */
|
||||
UZMMOLoadingProfilesDataAsset* GetLoadingProfiles();
|
||||
UZeusLoadingProfilesDataAsset* GetLoadingProfiles();
|
||||
|
||||
/** Resolve+carrega o DT de dicas (sync). */
|
||||
UDataTable* GetLoadingTips();
|
||||
@@ -213,13 +213,13 @@ private:
|
||||
/**
|
||||
* Dívida técnica (D5): ServerHello traz ThemeId, mas o UZeusNetworkSubsystem
|
||||
* 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).
|
||||
*/
|
||||
void HandleServerHelloTheme(FName ThemeId);
|
||||
|
||||
UPROPERTY(Transient)
|
||||
EZMMOFrontEndState CurrentState = EZMMOFrontEndState::None;
|
||||
EZeusFrontEndState CurrentState = EZeusFrontEndState::None;
|
||||
|
||||
UPROPERTY(Transient)
|
||||
FString SelectedRealmId;
|
||||
@@ -238,7 +238,7 @@ private:
|
||||
TObjectPtr<UUIFrontEndScreenSet> ScreenSet;
|
||||
|
||||
UPROPERTY(Transient)
|
||||
TObjectPtr<UZMMOLoadingProfilesDataAsset> LoadingProfiles;
|
||||
TObjectPtr<UZeusLoadingProfilesDataAsset> LoadingProfiles;
|
||||
|
||||
UPROPERTY(Transient)
|
||||
TObjectPtr<UDataTable> LoadingTips;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#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))
|
||||
{
|
||||
@@ -9,7 +9,7 @@ TSoftClassPtr<UCommonActivatableWidget> UUIFrontEndScreenSet::GetScreenForState(
|
||||
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))
|
||||
{
|
||||
|
||||
@@ -29,17 +29,17 @@ public:
|
||||
|
||||
/** Tela por estado de topo do fluxo. */
|
||||
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"). */
|
||||
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). */
|
||||
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). */
|
||||
UFUNCTION(BlueprintCallable, Category = "FrontEnd")
|
||||
TSoftClassPtr<UCommonActivatableWidget> GetLobbyPage(EZMMOLobbyPage Page) const;
|
||||
TSoftClassPtr<UCommonActivatableWidget> GetLobbyPage(EZeusLobbyPage Page) const;
|
||||
};
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
#include "UIButton_Base.h"
|
||||
#include "UICheckBox_Base.h"
|
||||
#include "UILabel_Base.h"
|
||||
#include "ZMMOLoginSaveGame.h"
|
||||
#include "ZeusLoginSaveGame.h"
|
||||
#include "Kismet/GameplayStatics.h"
|
||||
#include "UIFrontEndFlowSubsystem.h"
|
||||
#include "ZMMOThemeSubsystem.h"
|
||||
#include "ZeusThemeSubsystem.h"
|
||||
#include "ZeusCharServerSubsystem.h"
|
||||
#include "ZeusPacketWriter.h"
|
||||
#include "ZeusPacketReader.h"
|
||||
@@ -28,7 +28,7 @@ namespace
|
||||
{
|
||||
if (const UGameInstance* GI = Widget->GetGameInstance())
|
||||
{
|
||||
if (const UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>())
|
||||
if (const UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
|
||||
{
|
||||
return Theme->GetActiveUIStyle();
|
||||
}
|
||||
@@ -198,12 +198,12 @@ void UUILoginScreen_Base::HandleLoginClicked()
|
||||
SaveOrClearRememberedAccess(User);
|
||||
|
||||
FZeusPacketWriter W;
|
||||
W.WriteUInt8(ZMMOCharAuthMethod::PASSWORD);
|
||||
W.WriteUInt8(ZeusCharAuthMethod::PASSWORD);
|
||||
W.WriteStringUtf8(User.TrimStartAndEnd());
|
||||
W.WriteStringUtf8(Pass);
|
||||
|
||||
const bool bSent = Char->SendCharRequest(
|
||||
ZMMOCharOp::C_CHAR_AUTH_REQUEST, W.GetBuffer());
|
||||
ZeusCharOp::C_CHAR_AUTH_REQUEST, W.GetBuffer());
|
||||
if (!bSent)
|
||||
{
|
||||
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
|
||||
}
|
||||
|
||||
if (Opcode == ZMMOCharOp::S_CHAR_AUTH_OK)
|
||||
if (Opcode == ZeusCharOp::S_CHAR_AUTH_OK)
|
||||
{
|
||||
bAwaitingAuth = false;
|
||||
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;
|
||||
FZeusPacketReader R(Payload.GetData(), Payload.Num());
|
||||
@@ -267,11 +267,11 @@ void UUILoginScreen_Base::HandleCharRawMessage(int32 Opcode, const TArray<uint8>
|
||||
FText Message;
|
||||
switch (Reason)
|
||||
{
|
||||
case ZMMOCharRejectReason::InvalidCredentials: Message = InvalidCredentialsText; break;
|
||||
case ZMMOCharRejectReason::AccountLocked: Message = AccountLockedText; break;
|
||||
case ZMMOCharRejectReason::AccountSuspended: Message = AccountSuspendedText; break;
|
||||
case ZMMOCharRejectReason::AccountBanned: Message = AccountSuspendedText; break;
|
||||
case ZMMOCharRejectReason::CredentialsAuthDisabled: Message = CredentialsDisabledText; break;
|
||||
case ZeusCharRejectReason::InvalidCredentials: Message = InvalidCredentialsText; break;
|
||||
case ZeusCharRejectReason::AccountLocked: Message = AccountLockedText; break;
|
||||
case ZeusCharRejectReason::AccountSuspended: Message = AccountSuspendedText; break;
|
||||
case ZeusCharRejectReason::AccountBanned: Message = AccountSuspendedText; break;
|
||||
case ZeusCharRejectReason::CredentialsAuthDisabled: Message = CredentialsDisabledText; break;
|
||||
default:
|
||||
Message = FText::Format(
|
||||
NSLOCTEXT("ZMMO", "LoginRejectFmt", "{0} (cód. {1})"),
|
||||
@@ -285,7 +285,7 @@ void UUILoginScreen_Base::HandleCharRawMessage(int32 Opcode, const TArray<uint8>
|
||||
void UUILoginScreen_Base::LoadRememberedAccess()
|
||||
{
|
||||
if (!UGameplayStatics::DoesSaveGameExist(
|
||||
UZMMOLoginSaveGame::SlotName, UZMMOLoginSaveGame::UserIndex))
|
||||
UZeusLoginSaveGame::SlotName, UZeusLoginSaveGame::UserIndex))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -294,13 +294,13 @@ void UUILoginScreen_Base::LoadRememberedAccess()
|
||||
Delegate.BindUFunction(this,
|
||||
FName(TEXT("HandleLoadLoginCacheCompleted")));
|
||||
UGameplayStatics::AsyncLoadGameFromSlot(
|
||||
UZMMOLoginSaveGame::SlotName, UZMMOLoginSaveGame::UserIndex, Delegate);
|
||||
UZeusLoginSaveGame::SlotName, UZeusLoginSaveGame::UserIndex, Delegate);
|
||||
}
|
||||
|
||||
void UUILoginScreen_Base::HandleLoadLoginCacheCompleted(const FString& /*InSlotName*/,
|
||||
int32 /*InUserIndex*/, USaveGame* LoadedGame)
|
||||
{
|
||||
const UZMMOLoginSaveGame* Save = Cast<UZMMOLoginSaveGame>(LoadedGame);
|
||||
const UZeusLoginSaveGame* Save = Cast<UZeusLoginSaveGame>(LoadedGame);
|
||||
if (!Save || !Save->bRememberAccess || Save->SavedUsername.IsEmpty())
|
||||
{
|
||||
return;
|
||||
@@ -320,21 +320,21 @@ void UUILoginScreen_Base::SaveOrClearRememberedAccess(const FString& User)
|
||||
const bool bRemember = RememberAccess ? RememberAccess->IsChecked() : false;
|
||||
if (bRemember)
|
||||
{
|
||||
UZMMOLoginSaveGame* Save = Cast<UZMMOLoginSaveGame>(
|
||||
UGameplayStatics::CreateSaveGameObject(UZMMOLoginSaveGame::StaticClass()));
|
||||
UZeusLoginSaveGame* Save = Cast<UZeusLoginSaveGame>(
|
||||
UGameplayStatics::CreateSaveGameObject(UZeusLoginSaveGame::StaticClass()));
|
||||
if (Save)
|
||||
{
|
||||
Save->SavedUsername = User.TrimStartAndEnd();
|
||||
Save->bRememberAccess = true;
|
||||
UGameplayStatics::AsyncSaveGameToSlot(
|
||||
Save, UZMMOLoginSaveGame::SlotName, UZMMOLoginSaveGame::UserIndex);
|
||||
Save, UZeusLoginSaveGame::SlotName, UZeusLoginSaveGame::UserIndex);
|
||||
}
|
||||
}
|
||||
else if (UGameplayStatics::DoesSaveGameExist(
|
||||
UZMMOLoginSaveGame::SlotName, UZMMOLoginSaveGame::UserIndex))
|
||||
UZeusLoginSaveGame::SlotName, UZeusLoginSaveGame::UserIndex))
|
||||
{
|
||||
// Checkbox desmarcada: apaga save antigo (não vamos lembrar mais).
|
||||
UGameplayStatics::DeleteGameInSlot(
|
||||
UZMMOLoginSaveGame::SlotName, UZMMOLoginSaveGame::UserIndex);
|
||||
UZeusLoginSaveGame::SlotName, UZeusLoginSaveGame::UserIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,10 +8,10 @@ void UUIPrimaryGameLayout_Base::NativeOnInitialized()
|
||||
{
|
||||
Super::NativeOnInitialized();
|
||||
|
||||
RegisterLayer(ZMMOUITags::UI_Layer_Game, Stack_Game);
|
||||
RegisterLayer(ZMMOUITags::UI_Layer_GameMenu, Stack_GameMenu);
|
||||
RegisterLayer(ZMMOUITags::UI_Layer_Menu, Stack_Menu);
|
||||
RegisterLayer(ZMMOUITags::UI_Layer_Modal, Stack_Modal);
|
||||
RegisterLayer(ZeusUITags::UI_Layer_Game, Stack_Game);
|
||||
RegisterLayer(ZeusUITags::UI_Layer_GameMenu, Stack_GameMenu);
|
||||
RegisterLayer(ZeusUITags::UI_Layer_Menu, Stack_Menu);
|
||||
RegisterLayer(ZeusUITags::UI_Layer_Modal, Stack_Modal);
|
||||
}
|
||||
|
||||
void UUIPrimaryGameLayout_Base::RegisterLayer(FGameplayTag LayerTag, UCommonActivatableWidgetStack* Stack)
|
||||
|
||||
@@ -41,7 +41,7 @@ void UUIServerCard_Base::NativeDestruct()
|
||||
Super::NativeDestruct();
|
||||
}
|
||||
|
||||
void UUIServerCard_Base::SetFromEntry(const FZMMORealmEntry& InEntry)
|
||||
void UUIServerCard_Base::SetFromEntry(const FZeusRealmEntry& InEntry)
|
||||
{
|
||||
Entry = InEntry;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Blueprint/UserWidget.h"
|
||||
#include "ZMMORealmEntry.h"
|
||||
#include "ZeusRealmEntry.h"
|
||||
#include "UIServerCard_Base.generated.h"
|
||||
|
||||
class UCommonTextBlock;
|
||||
@@ -13,7 +13,7 @@ class UProgressBar;
|
||||
/**
|
||||
* 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
|
||||
* dona (UUIServerSelectScreen_Base) escuta esse delegate.
|
||||
*
|
||||
@@ -25,7 +25,7 @@ class UProgressBar;
|
||||
* - Btn_Enter : Button
|
||||
* - 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)
|
||||
class ZMMO_API UUIServerCard_Base : public UUserWidget
|
||||
@@ -37,18 +37,18 @@ public:
|
||||
* Aplica os dados de um realm no card.
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category = "Zeus|ServerCard")
|
||||
void SetFromEntry(const FZMMORealmEntry& Entry);
|
||||
void SetFromEntry(const FZeusRealmEntry& Entry);
|
||||
|
||||
/** Dados atuais (copia). */
|
||||
UPROPERTY(BlueprintReadOnly, Category = "Zeus|ServerCard")
|
||||
FZMMORealmEntry Entry;
|
||||
FZeusRealmEntry Entry;
|
||||
|
||||
/**
|
||||
* Disparado quando o botao "Entrar" do card e clicado.
|
||||
* State e o wire state (0=Offline, 1=Online, 2=Maintenance).
|
||||
*/
|
||||
UPROPERTY(BlueprintAssignable, Category = "Zeus|ServerCard")
|
||||
FZMMOOnServerCardPressed OnCardPressed;
|
||||
FZeusOnServerCardPressed OnCardPressed;
|
||||
|
||||
protected:
|
||||
virtual void NativePreConstruct() override;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "UIServerSelectScreen_Base.h"
|
||||
|
||||
#include "ZMMO.h"
|
||||
#include "ZMMOThemeSubsystem.h"
|
||||
#include "ZeusThemeSubsystem.h"
|
||||
#include "CharServerOpcodes.h"
|
||||
#include "UIFrontEndFlowSubsystem.h"
|
||||
#include "UIServerCard_Base.h"
|
||||
@@ -16,9 +16,9 @@
|
||||
#include "Engine/DataTable.h"
|
||||
#include "UI/UIStyleRow.h"
|
||||
|
||||
using ZMMOWire::ReadU8;
|
||||
using ZMMOWire::ReadU16;
|
||||
using ZMMOWire::ReadStringUtf8;
|
||||
using ZeusWire::ReadU8;
|
||||
using ZeusWire::ReadU16;
|
||||
using ZeusWire::ReadStringUtf8;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -28,7 +28,7 @@ namespace
|
||||
{
|
||||
if (const UGameInstance* GI = Widget->GetGameInstance())
|
||||
{
|
||||
if (const UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>())
|
||||
if (const UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
|
||||
{
|
||||
return Theme->GetActiveUIStyle();
|
||||
}
|
||||
@@ -119,7 +119,7 @@ void UUIServerSelectScreen_Base::RequestRealmList()
|
||||
return;
|
||||
}
|
||||
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)
|
||||
@@ -137,17 +137,17 @@ void UUIServerSelectScreen_Base::SelectRealmAndProceed(const FString& RealmId)
|
||||
if (UUIFrontEndFlowSubsystem* Flow = GI->GetSubsystem<UUIFrontEndFlowSubsystem>())
|
||||
{
|
||||
Flow->SetSelectedRealmId(RealmId);
|
||||
Flow->SetState(EZMMOFrontEndState::Lobby);
|
||||
Flow->SetState(EZeusFrontEndState::Lobby);
|
||||
}
|
||||
}
|
||||
|
||||
void UUIServerSelectScreen_Base::HandleCharRawMessage(int32 Opcode, const TArray<uint8>& Payload)
|
||||
{
|
||||
if (Opcode == ZMMOCharOp::S_REALM_LIST)
|
||||
if (Opcode == ZeusCharOp::S_REALM_LIST)
|
||||
{
|
||||
ParseRealmList(Payload);
|
||||
}
|
||||
else if (Opcode == ZMMOCharOp::S_REALM_STATUS_UPDATE)
|
||||
else if (Opcode == ZeusCharOp::S_REALM_STATUS_UPDATE)
|
||||
{
|
||||
ApplyStatusUpdate(Payload);
|
||||
}
|
||||
@@ -186,7 +186,7 @@ void UUIServerSelectScreen_Base::ApplyStatusUpdate(const TArray<uint8>& Payload)
|
||||
RequestRealmList();
|
||||
return;
|
||||
}
|
||||
FZMMORealmEntry& Entry = Realms[Idx];
|
||||
FZeusRealmEntry& Entry = Realms[Idx];
|
||||
Entry.Pop = static_cast<int32>(Pop);
|
||||
Entry.QueueLen = static_cast<int32>(QueueLen);
|
||||
Entry.State = State;
|
||||
@@ -210,12 +210,12 @@ void UUIServerSelectScreen_Base::ParseRealmList(const TArray<uint8>& Payload)
|
||||
return;
|
||||
}
|
||||
|
||||
TArray<FZMMORealmEntry> NewRealms;
|
||||
TArray<FZeusRealmEntry> NewRealms;
|
||||
NewRealms.Reserve(Count);
|
||||
|
||||
for (uint16 i = 0; i < Count; ++i)
|
||||
{
|
||||
FZMMORealmEntry Entry;
|
||||
FZeusRealmEntry Entry;
|
||||
FString RegionStr;
|
||||
uint16 Cap = 0;
|
||||
uint16 Pop = 0;
|
||||
@@ -280,7 +280,7 @@ void UUIServerSelectScreen_Base::RebuildCards()
|
||||
const int32 GridColumns = 2; // bate com o mock (ColumnFill[0]/[1])
|
||||
|
||||
int32 Index = 0;
|
||||
for (const FZMMORealmEntry& R : Realms)
|
||||
for (const FZeusRealmEntry& R : Realms)
|
||||
{
|
||||
UUIServerCard_Base* Card = CreateWidget<UUIServerCard_Base>(this, CardClass);
|
||||
if (!Card)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "UIActivatableScreen_Base.h"
|
||||
#include "ZMMORealmEntry.h"
|
||||
#include "ZeusRealmEntry.h"
|
||||
#include "UIServerSelectScreen_Base.generated.h"
|
||||
|
||||
class UCommonTextBlock;
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
void SelectRealmAndProceed(const FString& RealmId);
|
||||
|
||||
UPROPERTY(BlueprintReadOnly, Category = "Zeus|ServerSelect")
|
||||
TArray<FZMMORealmEntry> Realms;
|
||||
TArray<FZeusRealmEntry> Realms;
|
||||
|
||||
UFUNCTION(BlueprintImplementableEvent, Category = "Zeus|ServerSelect")
|
||||
void OnRealmListReceived();
|
||||
|
||||
@@ -14,14 +14,14 @@
|
||||
#include "Engine/GameInstance.h"
|
||||
#include "UI/Widgets/UIButton_Base.h"
|
||||
|
||||
using ZMMOWire::ReadU8;
|
||||
using ZMMOWire::ReadU16;
|
||||
using ZMMOWire::ReadU32;
|
||||
using ZMMOWire::ReadU64;
|
||||
using ZMMOWire::ReadFloat;
|
||||
using ZMMOWire::ReadStringUtf8;
|
||||
using ZMMOWire::ReadUuid16;
|
||||
using ZMMOWire::WriteUuid16;
|
||||
using ZeusWire::ReadU8;
|
||||
using ZeusWire::ReadU16;
|
||||
using ZeusWire::ReadU32;
|
||||
using ZeusWire::ReadU64;
|
||||
using ZeusWire::ReadFloat;
|
||||
using ZeusWire::ReadStringUtf8;
|
||||
using ZeusWire::ReadUuid16;
|
||||
using ZeusWire::WriteUuid16;
|
||||
|
||||
void UUIUserLobbyScreen_Base::NativeOnActivated()
|
||||
{
|
||||
@@ -91,7 +91,7 @@ void UUIUserLobbyScreen_Base::RequestCharList()
|
||||
Payload.Add(0);
|
||||
}
|
||||
}
|
||||
Char->SendCharRequest(ZMMOCharOp::C_CHAR_LIST_REQUEST, Payload);
|
||||
Char->SendCharRequest(ZeusCharOp::C_CHAR_LIST_REQUEST, Payload);
|
||||
}
|
||||
|
||||
void UUIUserLobbyScreen_Base::ShowCharSelectPage()
|
||||
@@ -111,7 +111,7 @@ void UUIUserLobbyScreen_Base::BackToServerSelect()
|
||||
if (UUIFrontEndFlowSubsystem* Flow = GI->GetSubsystem<UUIFrontEndFlowSubsystem>())
|
||||
{
|
||||
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)
|
||||
{
|
||||
case ZMMOCharOp::S_CHAR_LIST: ParseCharList(Payload); break;
|
||||
case ZMMOCharOp::S_CHAR_SELECT_OK: HandleCharSelectOk(Payload); break;
|
||||
case ZMMOCharOp::S_CHAR_SELECT_REJECT: HandleCharSelectReject(Payload); break;
|
||||
case ZMMOCharOp::S_CHAR_CREATE_OK: HandleCharCreateOk(Payload); break;
|
||||
case ZMMOCharOp::S_CHAR_CREATE_REJECT: HandleCharCreateReject(Payload); break;
|
||||
case ZMMOCharOp::S_CHAR_DELETE_ACK: HandleCharDeleteAck(Payload); break;
|
||||
case ZMMOCharOp::S_CHAR_DELETE_ACCEPT_ACK: HandleCharDeleteAcceptAck(Payload); break;
|
||||
case ZMMOCharOp::S_CHAR_DELETE_CANCEL_ACK: HandleCharDeleteCancelAck(Payload); break;
|
||||
case ZeusCharOp::S_CHAR_LIST: ParseCharList(Payload); break;
|
||||
case ZeusCharOp::S_CHAR_SELECT_OK: HandleCharSelectOk(Payload); break;
|
||||
case ZeusCharOp::S_CHAR_SELECT_REJECT: HandleCharSelectReject(Payload); break;
|
||||
case ZeusCharOp::S_CHAR_CREATE_OK: HandleCharCreateOk(Payload); break;
|
||||
case ZeusCharOp::S_CHAR_CREATE_REJECT: HandleCharCreateReject(Payload); break;
|
||||
case ZeusCharOp::S_CHAR_DELETE_ACK: HandleCharDeleteAck(Payload); break;
|
||||
case ZeusCharOp::S_CHAR_DELETE_ACCEPT_ACK: HandleCharDeleteAcceptAck(Payload); break;
|
||||
case ZeusCharOp::S_CHAR_DELETE_CANCEL_ACK: HandleCharDeleteCancelAck(Payload); break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
@@ -141,12 +141,12 @@ void UUIUserLobbyScreen_Base::ParseCharList(const TArray<uint8>& Payload)
|
||||
return;
|
||||
}
|
||||
|
||||
TArray<FZMMOCharSummary> New;
|
||||
TArray<FZeusCharSummary> New;
|
||||
New.Reserve(Count);
|
||||
|
||||
for (uint16 i = 0; i < Count; ++i)
|
||||
{
|
||||
FZMMOCharSummary E;
|
||||
FZeusCharSummary E;
|
||||
uint64 charId64 = 0;
|
||||
uint8 slot = 0;
|
||||
uint16 classId = 0;
|
||||
@@ -222,7 +222,7 @@ void UUIUserLobbyScreen_Base::RebuildCards()
|
||||
SpawnedCards.Reset();
|
||||
CardContainer->ClearChildren();
|
||||
|
||||
for (const FZMMOCharSummary& C : Chars)
|
||||
for (const FZeusCharSummary& C : Chars)
|
||||
{
|
||||
UUICharCard_Base* Card = CreateWidget<UUICharCard_Base>(this, CharCardClass);
|
||||
if (!Card) continue;
|
||||
@@ -246,25 +246,25 @@ void UUIUserLobbyScreen_Base::HandleCardSelected(FString CharId)
|
||||
// Wire: uint64 charId
|
||||
TArray<uint8> Payload;
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
@@ -373,8 +373,8 @@ void UUIUserLobbyScreen_Base::HandleCharSelectOk(const TArray<uint8>& Payload)
|
||||
UUIFrontEndFlowSubsystem* Flow = GI->GetSubsystem<UUIFrontEndFlowSubsystem>();
|
||||
if (Flow)
|
||||
{
|
||||
Flow->SetState(EZMMOFrontEndState::EnteringWorld);
|
||||
// Memoriza pose pra `AZMMOPlayerCharacter::BeginPlay` reposicionar
|
||||
Flow->SetState(EZeusFrontEndState::EnteringWorld);
|
||||
// Memoriza pose pra `AZeusCharacter::BeginPlay` reposicionar
|
||||
// o pawn local na pos salva no DB (em vez do PlayerStart default).
|
||||
Flow->SetPendingSpawnPose(FVector(Px, Py, Pz), Yaw);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "UIActivatableScreen_Base.h"
|
||||
#include "ZMMOCharSummary.h"
|
||||
#include "ZeusCharSummary.h"
|
||||
#include "UIUserLobbyScreen_Base.generated.h"
|
||||
|
||||
class UCommonTextBlock;
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
void BackToServerSelect();
|
||||
|
||||
UPROPERTY(BlueprintReadOnly, Category = "Zeus|Lobby")
|
||||
TArray<FZMMOCharSummary> Chars;
|
||||
TArray<FZeusCharSummary> Chars;
|
||||
|
||||
UFUNCTION(BlueprintImplementableEvent, Category = "Zeus|Lobby")
|
||||
void OnCharListReceived();
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
|
||||
namespace ZMMOWire
|
||||
namespace ZeusWire
|
||||
{
|
||||
inline bool ReadU8(const TArray<uint8>& Buf, int32& Pos, uint8& Out)
|
||||
{
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
#include "ZMMOLoginSaveGame.h"
|
||||
|
||||
const FString UZMMOLoginSaveGame::SlotName = TEXT("LoginCache");
|
||||
@@ -1,11 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "ZMMOCharSummary.generated.h"
|
||||
#include "ZeusCharSummary.generated.h"
|
||||
|
||||
/** Stats primarios do personagem (espelha `CharStats` em char.types.ts). */
|
||||
USTRUCT(BlueprintType)
|
||||
struct FZMMOCharStats
|
||||
struct FZeusCharStats
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -19,7 +19,7 @@ struct FZMMOCharStats
|
||||
|
||||
/** Aparencia (espelha `CharAppearance` em char.types.ts). */
|
||||
USTRUCT(BlueprintType)
|
||||
struct FZMMOCharAppearance
|
||||
struct FZeusCharAppearance
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -34,7 +34,7 @@ struct FZMMOCharAppearance
|
||||
* Espelha `CharSummary` em `Server/ZeusCharServer/src/types/char.types.ts`.
|
||||
*/
|
||||
USTRUCT(BlueprintType)
|
||||
struct FZMMOCharSummary
|
||||
struct FZeusCharSummary
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -67,7 +67,7 @@ struct FZMMOCharSummary
|
||||
int32 JobExp = 0;
|
||||
|
||||
UPROPERTY(BlueprintReadOnly, Category = "Zeus|Char")
|
||||
FZMMOCharStats Stats;
|
||||
FZeusCharStats Stats;
|
||||
|
||||
UPROPERTY(BlueprintReadOnly, Category = "Zeus|Char")
|
||||
int32 Hp = 0;
|
||||
@@ -95,7 +95,7 @@ struct FZMMOCharSummary
|
||||
float YawDeg = 0.f;
|
||||
|
||||
UPROPERTY(BlueprintReadOnly, Category = "Zeus|Char")
|
||||
FZMMOCharAppearance Appearance;
|
||||
FZeusCharAppearance Appearance;
|
||||
|
||||
/** Epoch ms em que o delete vai efetivar. 0 = nao agendado. */
|
||||
UPROPERTY(BlueprintReadOnly, Category = "Zeus|Char")
|
||||
3
Source/ZMMO/Game/UI/FrontEnd/ZeusLoginSaveGame.cpp
Normal file
3
Source/ZMMO/Game/UI/FrontEnd/ZeusLoginSaveGame.cpp
Normal file
@@ -0,0 +1,3 @@
|
||||
#include "ZeusLoginSaveGame.h"
|
||||
|
||||
const FString UZeusLoginSaveGame::SlotName = TEXT("LoginCache");
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "CoreMinimal.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
|
||||
@@ -18,7 +18,7 @@
|
||||
* UPROPERTY não-Transient via UE serializer).
|
||||
*/
|
||||
UCLASS()
|
||||
class ZMMO_API UZMMOLoginSaveGame : public USaveGame
|
||||
class ZMMO_API UZeusLoginSaveGame : public USaveGame
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "ZMMORealmEntry.generated.h"
|
||||
#include "ZeusRealmEntry.generated.h"
|
||||
|
||||
/**
|
||||
* Entrada de Realm (cluster Gateway+Provinces) recebida do CharServer via
|
||||
@@ -13,10 +13,10 @@
|
||||
* anterior). Cliente faz split por `:` quando precisa abrir UDP.
|
||||
*
|
||||
* State usa o wire raw (0=Offline, 1=Online, 2=Maintenance — ver
|
||||
* ZMMOWireRealmState em CharServerOpcodes.h).
|
||||
* ZeusWireRealmState em CharServerOpcodes.h).
|
||||
*/
|
||||
USTRUCT(BlueprintType)
|
||||
struct FZMMORealmEntry
|
||||
struct FZeusRealmEntry
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -42,7 +42,7 @@ struct FZMMORealmEntry
|
||||
UPROPERTY(BlueprintReadOnly, Category = "Zeus|Realm")
|
||||
int32 QueueLen = 0;
|
||||
|
||||
/** 0=Offline, 1=Online, 2=Maintenance (vide ZMMOWireRealmState). */
|
||||
/** 0=Offline, 1=Online, 2=Maintenance (vide ZeusWireRealmState). */
|
||||
UPROPERTY(BlueprintReadOnly, Category = "Zeus|Realm")
|
||||
uint8 State = 0;
|
||||
};
|
||||
@@ -21,13 +21,13 @@ void UUIInGameFlowSubsystem::Initialize(FSubsystemCollectionBase& Collection)
|
||||
void UUIInGameFlowSubsystem::Deinitialize()
|
||||
{
|
||||
ScreenSet = nullptr;
|
||||
CurrentState = EZMMOInGameUIState::None;
|
||||
CurrentState = EZeusInGameUIState::None;
|
||||
Super::Deinitialize();
|
||||
}
|
||||
|
||||
void UUIInGameFlowSubsystem::StartInGame()
|
||||
{
|
||||
if (CurrentState != EZMMOInGameUIState::None)
|
||||
if (CurrentState != EZeusInGameUIState::None)
|
||||
{
|
||||
// Idempotente: chamadas extras (ex.: respawn) sao no-op se ja in-world.
|
||||
UE_LOG(LogZMMO, Verbose,
|
||||
@@ -55,22 +55,22 @@ void UUIInGameFlowSubsystem::StartInGame()
|
||||
// dialogs orfaos do handoff). Layer.Game vai receber o HUD novo.
|
||||
if (UUIManagerSubsystem* Mgr = GetUIManager())
|
||||
{
|
||||
Mgr->ClearLayer(ZMMOUITags::UI_Layer_Menu.GetTag());
|
||||
Mgr->ClearLayer(ZMMOUITags::UI_Layer_Modal.GetTag());
|
||||
Mgr->ClearLayer(ZMMOUITags::UI_Layer_GameMenu.GetTag());
|
||||
Mgr->ClearLayer(ZeusUITags::UI_Layer_Menu.GetTag());
|
||||
Mgr->ClearLayer(ZeusUITags::UI_Layer_Modal.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)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const EZMMOInGameUIState OldState = CurrentState;
|
||||
const EZeusInGameUIState OldState = CurrentState;
|
||||
CurrentState = NewState;
|
||||
|
||||
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
|
||||
// permanece. Para qualquer outro estado, mantemos HUD e empilhamos no
|
||||
// layer correspondente.
|
||||
const bool bGoingToPlaying = (NewState == EZMMOInGameUIState::Playing);
|
||||
const bool bGoingToPlaying = (NewState == EZeusInGameUIState::Playing);
|
||||
if (UUIManagerSubsystem* Mgr = GetUIManager())
|
||||
{
|
||||
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
|
||||
// — flicker em todos os textos (HP/SP/etc) por causa do Construct novo.
|
||||
const bool bSkipRepush = bGoingToPlaying
|
||||
&& OldState != EZMMOInGameUIState::None
|
||||
&& OldState != EZMMOInGameUIState::Playing;
|
||||
&& OldState != EZeusInGameUIState::None
|
||||
&& OldState != EZeusInGameUIState::Playing;
|
||||
if (!bSkipRepush)
|
||||
{
|
||||
ResolveAndPushScreen(NewState);
|
||||
@@ -104,16 +104,16 @@ void UUIInGameFlowSubsystem::SetState(EZMMOInGameUIState 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.
|
||||
return;
|
||||
}
|
||||
if (CurrentState == Screen)
|
||||
{
|
||||
SetState(EZMMOInGameUIState::Playing);
|
||||
SetState(EZeusInGameUIState::Playing);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -148,26 +148,26 @@ UUIManagerSubsystem* UUIInGameFlowSubsystem::GetUIManager() const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
FGameplayTag UUIInGameFlowSubsystem::LayerForState(EZMMOInGameUIState State) const
|
||||
FGameplayTag UUIInGameFlowSubsystem::LayerForState(EZeusInGameUIState State) const
|
||||
{
|
||||
switch (State)
|
||||
{
|
||||
case EZMMOInGameUIState::Playing:
|
||||
return ZMMOUITags::UI_Layer_Game.GetTag();
|
||||
case EZMMOInGameUIState::Loading:
|
||||
return ZMMOUITags::UI_Layer_Modal.GetTag();
|
||||
case EZMMOInGameUIState::StatusWindow:
|
||||
case EZMMOInGameUIState::Inventory:
|
||||
case EZMMOInGameUIState::SkillTree:
|
||||
case EZMMOInGameUIState::EscapeMenu:
|
||||
case EZeusInGameUIState::Playing:
|
||||
return ZeusUITags::UI_Layer_Game.GetTag();
|
||||
case EZeusInGameUIState::Loading:
|
||||
return ZeusUITags::UI_Layer_Modal.GetTag();
|
||||
case EZeusInGameUIState::StatusWindow:
|
||||
case EZeusInGameUIState::Inventory:
|
||||
case EZeusInGameUIState::SkillTree:
|
||||
case EZeusInGameUIState::EscapeMenu:
|
||||
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();
|
||||
if (!SS)
|
||||
|
||||
@@ -10,7 +10,7 @@ class UUIManagerSubsystem;
|
||||
class UCommonActivatableWidget;
|
||||
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
|
||||
@@ -20,7 +20,7 @@ DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnZMMOInGameStateChanged, EZMMOInGa
|
||||
*
|
||||
* UGameInstanceSubsystem pra persistir entre OpenLevel (futuro: trocar
|
||||
* 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`.
|
||||
*
|
||||
* Convencao de layer (resolvida internamente):
|
||||
@@ -30,7 +30,7 @@ DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnZMMOInGameStateChanged, EZMMOInGa
|
||||
* - Loading -> UI.Layer.Modal
|
||||
*
|
||||
* 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)
|
||||
* 3. (se for em layer custom) adicionar caso em `LayerForState`
|
||||
* Subsystem nao precisa de mudancas.
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
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
|
||||
* 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. */
|
||||
UFUNCTION(BlueprintCallable, Category = "InGame|UI")
|
||||
void SetState(EZMMOInGameUIState NewState);
|
||||
void SetState(EZeusInGameUIState NewState);
|
||||
|
||||
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
|
||||
@@ -65,11 +65,11 @@ public:
|
||||
* Se ja' estiver em `Screen`, volta pra Playing; senao vai pra `Screen`.
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category = "InGame|UI")
|
||||
void ToggleScreen(EZMMOInGameUIState Screen);
|
||||
void ToggleScreen(EZeusInGameUIState Screen);
|
||||
|
||||
/** Disparado a cada SetState bem-sucedido. */
|
||||
UPROPERTY(BlueprintAssignable, Category = "InGame|UI")
|
||||
FOnZMMOInGameStateChanged OnStateChanged;
|
||||
FOnZeusInGameStateChanged OnStateChanged;
|
||||
|
||||
protected:
|
||||
/** DA com o mapa estado->tela. Config em DefaultGame.ini:
|
||||
@@ -84,13 +84,13 @@ private:
|
||||
UUIManagerSubsystem* GetUIManager() const;
|
||||
|
||||
/** 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). */
|
||||
void ResolveAndPushScreen(EZMMOInGameUIState State);
|
||||
void ResolveAndPushScreen(EZeusInGameUIState State);
|
||||
|
||||
UPROPERTY(Transient)
|
||||
EZMMOInGameUIState CurrentState = EZMMOInGameUIState::None;
|
||||
EZeusInGameUIState CurrentState = EZeusInGameUIState::None;
|
||||
|
||||
UPROPERTY(Transient)
|
||||
TObjectPtr<UUIInGameScreenSet> ScreenSet;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "UIInGameScreenSet.h"
|
||||
|
||||
TSoftClassPtr<UCommonActivatableWidget> UUIInGameScreenSet::GetScreenForState(EZMMOInGameUIState State) const
|
||||
TSoftClassPtr<UCommonActivatableWidget> UUIInGameScreenSet::GetScreenForState(EZeusInGameUIState State) const
|
||||
{
|
||||
const TSoftClassPtr<UCommonActivatableWidget>* Found = StateScreens.Find(State);
|
||||
return Found ? *Found : TSoftClassPtr<UCommonActivatableWidget>();
|
||||
|
||||
@@ -16,7 +16,7 @@ class UCommonActivatableWidget;
|
||||
* Asset concreto: DA_InGameScreenSet em Content/ZMMO/UI/InGame/
|
||||
* (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.
|
||||
*/
|
||||
UCLASS(BlueprintType)
|
||||
@@ -27,9 +27,9 @@ class ZMMO_API UUIInGameScreenSet : public UDataAsset
|
||||
public:
|
||||
/** Tela por estado in-game. */
|
||||
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). */
|
||||
UFUNCTION(BlueprintCallable, Category = "InGame")
|
||||
TSoftClassPtr<UCommonActivatableWidget> GetScreenForState(EZMMOInGameUIState State) const;
|
||||
TSoftClassPtr<UCommonActivatableWidget> GetScreenForState(EZeusInGameUIState State) const;
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "ZMMOHudPlayerVitalsWidget.h"
|
||||
#include "ZeusHudPlayerVitalsWidget.h"
|
||||
|
||||
#include "Components/RichTextBlock.h"
|
||||
#include "Components/TextBlock.h"
|
||||
@@ -30,7 +30,7 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
void UZMMOHudPlayerVitalsWidget::ApplySnapshot(const FZMMOAttributesSnapshot& Snapshot)
|
||||
void UZeusHudPlayerVitalsWidget::ApplySnapshot(const FZeusAttributesSnapshot& Snapshot)
|
||||
{
|
||||
LastSnapshot = Snapshot;
|
||||
|
||||
@@ -67,7 +67,7 @@ void UZMMOHudPlayerVitalsWidget::ApplySnapshot(const FZMMOAttributesSnapshot& Sn
|
||||
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.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)
|
||||
{
|
||||
@@ -107,7 +107,7 @@ void UZMMOHudPlayerVitalsWidget::SetCharName(const FString& InName)
|
||||
}
|
||||
}
|
||||
|
||||
void UZMMOHudPlayerVitalsWidget::SetClassName(const FString& InClassName)
|
||||
void UZeusHudPlayerVitalsWidget::SetClassName(const FString& InClassName)
|
||||
{
|
||||
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.).
|
||||
}
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
#include "CommonUserWidget.h"
|
||||
#include "CoreMinimal.h"
|
||||
#include "ZMMOAttributeTypes.h"
|
||||
#include "ZMMOHudPlayerVitalsWidget.generated.h"
|
||||
#include "ZeusAttributeTypes.h"
|
||||
#include "ZeusHudPlayerVitalsWidget.generated.h"
|
||||
|
||||
class UUIProgressBar_Base;
|
||||
class UTextBlock;
|
||||
@@ -12,7 +12,7 @@ class URichTextBlock;
|
||||
/**
|
||||
* 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
|
||||
* 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
|
||||
* têm pool efetivo no snapshot → % real. BASE/JOB EXP só têm exp acumulado
|
||||
@@ -24,14 +24,14 @@ class URichTextBlock;
|
||||
* LvlText, HpReadout, SpReadout, ExpReadout, JobReadout (opcionais).
|
||||
*/
|
||||
UCLASS(Abstract, Blueprintable, BlueprintType)
|
||||
class ZMMO_API UZMMOHudPlayerVitalsWidget : public UCommonUserWidget
|
||||
class ZMMO_API UZeusHudPlayerVitalsWidget : public UCommonUserWidget
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
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")
|
||||
void ApplySnapshot(const FZMMOAttributesSnapshot& Snapshot);
|
||||
void ApplySnapshot(const FZeusAttributesSnapshot& Snapshot);
|
||||
|
||||
/** Atualiza apenas HP/SP (otimização do tick — sem mexer em level/exp). */
|
||||
UFUNCTION(BlueprintCallable, Category = "Zeus|HUD")
|
||||
@@ -48,8 +48,8 @@ public:
|
||||
protected:
|
||||
/** Hook BP pra skin reagir (cores low-HP, animações, etc.). */
|
||||
UFUNCTION(BlueprintNativeEvent, Category = "Zeus|HUD")
|
||||
void OnSnapshotApplied(const FZMMOAttributesSnapshot& Snapshot);
|
||||
virtual void OnSnapshotApplied_Implementation(const FZMMOAttributesSnapshot& Snapshot);
|
||||
void OnSnapshotApplied(const FZeusAttributesSnapshot& Snapshot);
|
||||
virtual void OnSnapshotApplied_Implementation(const FZeusAttributesSnapshot& Snapshot);
|
||||
|
||||
// === BindWidget — barras (HP/SP obrigatórias) ===
|
||||
UPROPERTY(BlueprintReadOnly, meta = (BindWidget), Category = "Zeus|HUD")
|
||||
@@ -89,5 +89,5 @@ protected:
|
||||
private:
|
||||
/** Último snapshot recebido (cache pra ApplyHpSp manter MaxHp/MaxSp). */
|
||||
UPROPERTY(Transient)
|
||||
FZMMOAttributesSnapshot LastSnapshot;
|
||||
FZeusAttributesSnapshot LastSnapshot;
|
||||
};
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "ZMMOHudWidget.h"
|
||||
#include "ZeusHudWidget.h"
|
||||
|
||||
#include "Components/TextBlock.h"
|
||||
#include "Components/Widget.h"
|
||||
@@ -8,13 +8,13 @@
|
||||
#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"
|
||||
#include "ZeusAttributeComponent.h"
|
||||
#include "ZeusHudHpSpWidget.h"
|
||||
#include "ZeusHudPlayerVitalsWidget.h"
|
||||
#include "ZeusJobsLibrary.h"
|
||||
#include "ZeusPlayerState.h"
|
||||
|
||||
UZMMOHudWidget::UZMMOHudWidget(const FObjectInitializer& ObjectInitializer)
|
||||
UZeusHudWidget::UZeusHudWidget(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer)
|
||||
{
|
||||
// HUD nao bloqueia "back" (Esc / B no controller). Menus reais (StatusWindow,
|
||||
@@ -25,14 +25,14 @@ UZMMOHudWidget::UZMMOHudWidget(const FObjectInitializer& ObjectInitializer)
|
||||
bAutoActivate = true;
|
||||
}
|
||||
|
||||
TOptional<FUIInputConfig> UZMMOHudWidget::GetDesiredInputConfig() const
|
||||
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 UZMMOHudWidget::NativeOnActivated()
|
||||
void UZeusHudWidget::NativeOnActivated()
|
||||
{
|
||||
Super::NativeOnActivated();
|
||||
// HUD nao intercepta cliques — mouse passa direto pro Pawn (camera, etc.).
|
||||
@@ -41,23 +41,23 @@ void UZMMOHudWidget::NativeOnActivated()
|
||||
// Toast comeca escondido — so' aparece em HandleLevelUp.
|
||||
HideLevelUpToast();
|
||||
BindToLocalPlayer();
|
||||
UE_LOG(LogZMMO, Log, TEXT("ZMMOHudWidget activated (HpSpBar=%s)"),
|
||||
UE_LOG(LogZMMO, Log, TEXT("ZeusHudWidget activated (HpSpBar=%s)"),
|
||||
HpSpBar ? *HpSpBar->GetName() : TEXT("none"));
|
||||
}
|
||||
|
||||
void UZMMOHudWidget::NativeOnDeactivated()
|
||||
void UZeusHudWidget::NativeOnDeactivated()
|
||||
{
|
||||
UnbindFromComponent();
|
||||
Super::NativeOnDeactivated();
|
||||
}
|
||||
|
||||
void UZMMOHudWidget::NativeDestruct()
|
||||
void UZeusHudWidget::NativeDestruct()
|
||||
{
|
||||
UnbindFromComponent();
|
||||
Super::NativeDestruct();
|
||||
}
|
||||
|
||||
void UZMMOHudWidget::BindToLocalPlayer()
|
||||
void UZeusHudWidget::BindToLocalPlayer()
|
||||
{
|
||||
UWorld* World = GetWorld();
|
||||
if (!World) { return; }
|
||||
@@ -68,38 +68,38 @@ void UZMMOHudWidget::BindToLocalPlayer()
|
||||
if (!PS)
|
||||
{
|
||||
// PlayerState pode nao existir ainda — race com GameMode setup.
|
||||
// AZMMOPlayerCharacter::HandleLocalSpawnReady chama BindToAttributeComponent
|
||||
// AZeusCharacter::HandleLocalSpawnReady chama BindToAttributeComponent
|
||||
// manualmente como fallback (seed do EntityId).
|
||||
UE_LOG(LogZMMO, Log, TEXT("ZMMOHudWidget: PlayerState ausente no activate (race fix via HandleLocalSpawnReady esperado)"));
|
||||
UE_LOG(LogZMMO, Log, TEXT("ZeusHudWidget: PlayerState ausente no activate (race fix via HandleLocalSpawnReady esperado)"));
|
||||
return;
|
||||
}
|
||||
UZMMOAttributeComponent* Comp = PS->FindComponentByClass<UZMMOAttributeComponent>();
|
||||
UZeusAttributeComponent* Comp = PS->FindComponentByClass<UZeusAttributeComponent>();
|
||||
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);
|
||||
Comp->OnAttributesChanged.AddDynamic(this, &UZeusHudWidget::HandleAttributesChanged);
|
||||
Comp->OnHpSpChanged.AddDynamic(this, &UZeusHudWidget::HandleHpSpChanged);
|
||||
Comp->OnLevelUp.AddDynamic(this, &UZeusHudWidget::HandleLevelUp);
|
||||
|
||||
// Refresh imediato — caso o snapshot ja' tenha chegado.
|
||||
HandleAttributesChanged(Comp->GetSnapshot());
|
||||
}
|
||||
|
||||
void UZMMOHudWidget::UnbindFromComponent()
|
||||
void UZeusHudWidget::UnbindFromComponent()
|
||||
{
|
||||
if (UZMMOAttributeComponent* Old = BoundComponent.Get())
|
||||
if (UZeusAttributeComponent* Old = BoundComponent.Get())
|
||||
{
|
||||
Old->OnAttributesChanged.RemoveDynamic(this, &UZMMOHudWidget::HandleAttributesChanged);
|
||||
Old->OnHpSpChanged.RemoveDynamic(this, &UZMMOHudWidget::HandleHpSpChanged);
|
||||
Old->OnLevelUp.RemoveDynamic(this, &UZMMOHudWidget::HandleLevelUp);
|
||||
Old->OnAttributesChanged.RemoveDynamic(this, &UZeusHudWidget::HandleAttributesChanged);
|
||||
Old->OnHpSpChanged.RemoveDynamic(this, &UZeusHudWidget::HandleHpSpChanged);
|
||||
Old->OnLevelUp.RemoveDynamic(this, &UZeusHudWidget::HandleLevelUp);
|
||||
}
|
||||
BoundComponent.Reset();
|
||||
}
|
||||
|
||||
void UZMMOHudWidget::HandleAttributesChanged(const FZMMOAttributesSnapshot& Snapshot)
|
||||
void UZeusHudWidget::HandleAttributesChanged(const FZeusAttributesSnapshot& Snapshot)
|
||||
{
|
||||
// Propaga snapshot aos sub-widgets que ja existem.
|
||||
if (HpSpBar)
|
||||
@@ -112,24 +112,24 @@ void UZMMOHudWidget::HandleAttributesChanged(const FZMMOAttributesSnapshot& Snap
|
||||
|
||||
// Identidade: nome vem do PlayerState (não está no snapshot); job vem
|
||||
// do JobsSubsystem resolvendo ClassId -> display name.
|
||||
if (UZMMOAttributeComponent* Comp = BoundComponent.Get())
|
||||
if (UZeusAttributeComponent* Comp = BoundComponent.Get())
|
||||
{
|
||||
if (const AZMMOPlayerState* PS = Cast<AZMMOPlayerState>(Comp->GetOwner()))
|
||||
if (const AZeusPlayerState* PS = Cast<AZeusPlayerState>(Comp->GetOwner()))
|
||||
{
|
||||
PlayerVitals->SetCharName(PS->CharName);
|
||||
}
|
||||
}
|
||||
PlayerVitals->SetClassName(
|
||||
UZMMOJobsLibrary::GetJobDisplayName(this, Snapshot.ClassId).ToString());
|
||||
UZeusJobsLibrary::GetJobDisplayName(this, Snapshot.ClassId).ToString());
|
||||
}
|
||||
// Futuros: Buffs->RefreshIcons, etc.
|
||||
}
|
||||
|
||||
void UZMMOHudWidget::HandleHpSpChanged(int32 Hp, int32 Sp)
|
||||
void UZeusHudWidget::HandleHpSpChanged(int32 Hp, int32 Sp)
|
||||
{
|
||||
if (UZMMOAttributeComponent* Comp = BoundComponent.Get())
|
||||
if (UZeusAttributeComponent* Comp = BoundComponent.Get())
|
||||
{
|
||||
const FZMMOAttributesSnapshot& Snap = Comp->GetSnapshot();
|
||||
const FZeusAttributesSnapshot& Snap = Comp->GetSnapshot();
|
||||
if (HpSpBar)
|
||||
{
|
||||
HpSpBar->ApplyHpSp(Hp, Snap.MaxHp, Sp, Snap.MaxSp);
|
||||
@@ -141,7 +141,7 @@ void UZMMOHudWidget::HandleHpSpChanged(int32 Hp, int32 Sp)
|
||||
}
|
||||
}
|
||||
|
||||
void UZMMOHudWidget::HandleLevelUp(int32 NewBaseLevel, int32 StatusPointDelta)
|
||||
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
|
||||
@@ -150,7 +150,7 @@ void UZMMOHudWidget::HandleLevelUp(int32 NewBaseLevel, int32 StatusPointDelta)
|
||||
ShowLevelUpToast(NewBaseLevel);
|
||||
}
|
||||
|
||||
void UZMMOHudWidget::ShowLevelUpToast(int32 NewBaseLevel)
|
||||
void UZeusHudWidget::ShowLevelUpToast(int32 NewBaseLevel)
|
||||
{
|
||||
if (LevelUpToastText)
|
||||
{
|
||||
@@ -167,12 +167,12 @@ void UZMMOHudWidget::ShowLevelUpToast(int32 NewBaseLevel)
|
||||
{
|
||||
World->GetTimerManager().ClearTimer(LevelUpToastHideTimer);
|
||||
World->GetTimerManager().SetTimer(LevelUpToastHideTimer,
|
||||
FTimerDelegate::CreateUObject(this, &UZMMOHudWidget::HideLevelUpToast),
|
||||
FTimerDelegate::CreateUObject(this, &UZeusHudWidget::HideLevelUpToast),
|
||||
LevelUpToastDurationSec, /*loop*/ false);
|
||||
}
|
||||
}
|
||||
|
||||
void UZMMOHudWidget::HideLevelUpToast()
|
||||
void UZeusHudWidget::HideLevelUpToast()
|
||||
{
|
||||
if (LevelUpToastContainer)
|
||||
{
|
||||
@@ -3,14 +3,14 @@
|
||||
#include "CommonActivatableWidget.h"
|
||||
#include "CoreMinimal.h"
|
||||
#include "Engine/TimerHandle.h"
|
||||
#include "ZMMOAttributeTypes.h"
|
||||
#include "ZMMOHudWidget.generated.h"
|
||||
#include "ZeusAttributeTypes.h"
|
||||
#include "ZeusHudWidget.generated.h"
|
||||
|
||||
class UTextBlock;
|
||||
class UWidget;
|
||||
class UZMMOAttributeComponent;
|
||||
class UZMMOHudHpSpWidget;
|
||||
class UZMMOHudPlayerVitalsWidget;
|
||||
class UZeusAttributeComponent;
|
||||
class UZeusHudHpSpWidget;
|
||||
class UZeusHudPlayerVitalsWidget;
|
||||
|
||||
/**
|
||||
* Root da HUD de gameplay. UCommonActivatableWidget pushed pelo
|
||||
@@ -18,12 +18,12 @@ class UZMMOHudPlayerVitalsWidget;
|
||||
*
|
||||
* **Vive em ZMMO core** (UI/InGame/) porque o HUD root e' generico pra
|
||||
* qualquer GameType — sub-widgets vem dos modulos especializados
|
||||
* (HpSpBar do sub-modulo ZMMOAttributes, Minimap de ZMMOMap futuro,
|
||||
* Chat de ZMMOChat futuro, etc.).
|
||||
* (HpSpBar do sub-modulo ZeusAttributes, Minimap de ZeusMap futuro,
|
||||
* Chat de ZeusChat futuro, etc.).
|
||||
*
|
||||
* Padrao **composite**: o WBP_HUD (filho) declara as PECAS visuais como
|
||||
* 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)
|
||||
* 2. Subscreve aos delegates do componente (OnAttributesChanged,
|
||||
* OnHpSpChanged, OnLevelUp)
|
||||
@@ -32,7 +32,7 @@ class UZMMOHudPlayerVitalsWidget;
|
||||
*
|
||||
* Composicao prevista (sub-widgets — todos `BindWidgetOptional` pra
|
||||
* permitir GameTypes sem modulos opcionais — ex.: Survival sem stats RO):
|
||||
* - HpSpBar (UZMMOHudHpSpWidget — sub-modulo ZMMOAttributes) — impl
|
||||
* - HpSpBar (UZeusHudHpSpWidget — sub-modulo ZeusAttributes) — impl
|
||||
* - PlayerInfo (futuro — nome/job/level/exp bar)
|
||||
* - Minimap (futuro)
|
||||
* - QuickBar (futuro — hotkeys de skills)
|
||||
@@ -47,12 +47,12 @@ class UZMMOHudPlayerVitalsWidget;
|
||||
* no Designer — sem tocar este C++.
|
||||
*/
|
||||
UCLASS(Abstract, Blueprintable, BlueprintType)
|
||||
class ZMMO_API UZMMOHudWidget : public UCommonActivatableWidget
|
||||
class ZMMO_API UZeusHudWidget : public UCommonActivatableWidget
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UZMMOHudWidget(const FObjectInitializer& ObjectInitializer);
|
||||
UZeusHudWidget(const FObjectInitializer& ObjectInitializer);
|
||||
|
||||
protected:
|
||||
virtual void NativeOnActivated() override;
|
||||
@@ -70,16 +70,16 @@ protected:
|
||||
*/
|
||||
virtual TOptional<FUIInputConfig> GetDesiredInputConfig() const override;
|
||||
|
||||
/// Sub-widget HP/SP/level (sub-modulo ZMMOAttributes). BindWidgetOptional
|
||||
/// Sub-widget HP/SP/level (sub-modulo ZeusAttributes). BindWidgetOptional
|
||||
/// — WBP_HUD pode omitir se o GameType nao usa Attributes (Survival, etc.).
|
||||
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).
|
||||
/// Substitui o HpSpBar legado. BindWidgetOptional — coexiste durante a
|
||||
/// migração; o WBP_HUD pode ter um ou outro.
|
||||
UPROPERTY(BlueprintReadOnly, meta = (BindWidgetOptional), Category = "Zeus|HUD")
|
||||
UZMMOHudPlayerVitalsWidget* PlayerVitals = nullptr;
|
||||
UZeusHudPlayerVitalsWidget* PlayerVitals = nullptr;
|
||||
|
||||
/// Container do toast "LEVEL UP!" (Fase 3). Hidden por default; em
|
||||
/// `HandleLevelUp` vira visivel por `LevelUpToastDurationSec` segundos
|
||||
@@ -98,24 +98,24 @@ protected:
|
||||
float LevelUpToastDurationSec = 2.5f;
|
||||
|
||||
// === Futuros sub-widgets ===
|
||||
// UPROPERTY(BlueprintReadOnly, meta = (BindWidgetOptional)) UZMMOHudPlayerInfoWidget* PlayerInfo = nullptr;
|
||||
// UPROPERTY(BlueprintReadOnly, meta = (BindWidgetOptional)) UZMMOHudMinimapWidget* Minimap = nullptr;
|
||||
// UPROPERTY(BlueprintReadOnly, meta = (BindWidgetOptional)) UZMMOHudQuickBarWidget* QuickBar = nullptr;
|
||||
// UPROPERTY(BlueprintReadOnly, meta = (BindWidgetOptional)) UZMMOHudBuffsWidget* Buffs = nullptr;
|
||||
// UPROPERTY(BlueprintReadOnly, meta = (BindWidgetOptional)) UZMMOHudChatWidget* Chat = nullptr;
|
||||
// UPROPERTY(BlueprintReadOnly, meta = (BindWidgetOptional)) UZMMOHudTargetInfoWidget* TargetInfo = nullptr;
|
||||
// UPROPERTY(BlueprintReadOnly, meta = (BindWidgetOptional)) UZeusHudPlayerInfoWidget* PlayerInfo = nullptr;
|
||||
// UPROPERTY(BlueprintReadOnly, meta = (BindWidgetOptional)) UZeusHudMinimapWidget* Minimap = nullptr;
|
||||
// UPROPERTY(BlueprintReadOnly, meta = (BindWidgetOptional)) UZeusHudQuickBarWidget* QuickBar = nullptr;
|
||||
// UPROPERTY(BlueprintReadOnly, meta = (BindWidgetOptional)) UZeusHudBuffsWidget* Buffs = nullptr;
|
||||
// UPROPERTY(BlueprintReadOnly, meta = (BindWidgetOptional)) UZeusHudChatWidget* Chat = nullptr;
|
||||
// UPROPERTY(BlueprintReadOnly, meta = (BindWidgetOptional)) UZeusHudTargetInfoWidget* TargetInfo = nullptr;
|
||||
|
||||
UFUNCTION(BlueprintPure, Category = "Zeus|HUD")
|
||||
UZMMOAttributeComponent* GetBoundComponent() const { return BoundComponent.Get(); }
|
||||
UZeusAttributeComponent* GetBoundComponent() const { return BoundComponent.Get(); }
|
||||
|
||||
private:
|
||||
/// Tenta achar o UZMMOAttributeComponent do player local + subscrever
|
||||
/// Tenta achar o UZeusAttributeComponent do player local + subscrever
|
||||
/// nos delegates. Idempotente.
|
||||
void BindToLocalPlayer();
|
||||
void UnbindFromComponent();
|
||||
|
||||
UFUNCTION()
|
||||
void HandleAttributesChanged(const FZMMOAttributesSnapshot& Snapshot);
|
||||
void HandleAttributesChanged(const FZeusAttributesSnapshot& Snapshot);
|
||||
|
||||
UFUNCTION()
|
||||
void HandleHpSpChanged(int32 Hp, int32 Sp);
|
||||
@@ -124,7 +124,7 @@ private:
|
||||
void HandleLevelUp(int32 NewBaseLevel, int32 StatusPointDelta);
|
||||
|
||||
UPROPERTY(Transient)
|
||||
TWeakObjectPtr<UZMMOAttributeComponent> BoundComponent;
|
||||
TWeakObjectPtr<UZeusAttributeComponent> BoundComponent;
|
||||
|
||||
void ShowLevelUpToast(int32 NewBaseLevel);
|
||||
void HideLevelUpToast();
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "UICheckBox_Base.h"
|
||||
|
||||
#include "ZMMOThemeSubsystem.h"
|
||||
#include "ZeusThemeSubsystem.h"
|
||||
#include "Engine/GameInstance.h"
|
||||
#include "Engine/DataTable.h"
|
||||
#include "Components/CheckBox.h"
|
||||
@@ -18,7 +18,7 @@ namespace
|
||||
{
|
||||
if (const UGameInstance* GI = Widget->GetGameInstance())
|
||||
{
|
||||
if (const UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>())
|
||||
if (const UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
|
||||
{
|
||||
return Theme->GetActiveUIStyle();
|
||||
}
|
||||
@@ -174,7 +174,7 @@ void UUICheckBox_Base::NativeConstruct()
|
||||
{
|
||||
if (const UGameInstance* GI = GetGameInstance())
|
||||
{
|
||||
if (UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>())
|
||||
if (UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
|
||||
{
|
||||
Theme->OnThemeChanged.AddDynamic(this, &UUICheckBox_Base::HandleThemeChanged);
|
||||
bThemeBound = true;
|
||||
@@ -195,7 +195,7 @@ void UUICheckBox_Base::NativeDestruct()
|
||||
{
|
||||
if (const UGameInstance* GI = GetGameInstance())
|
||||
{
|
||||
if (UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>())
|
||||
if (UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
|
||||
{
|
||||
Theme->OnThemeChanged.RemoveDynamic(this, &UUICheckBox_Base::HandleThemeChanged);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
* 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 WBP tinge os brushes do estilo do UCheckBox).
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "UICommonText_Base.h"
|
||||
|
||||
#include "ZMMOThemeSubsystem.h"
|
||||
#include "ZeusThemeSubsystem.h"
|
||||
#include "Engine/GameInstance.h"
|
||||
#include "Engine/DataTable.h"
|
||||
#include "Styling/CoreStyle.h"
|
||||
@@ -18,7 +18,7 @@ namespace
|
||||
{
|
||||
if (const UGameInstance* GI = Widget->GetGameInstance())
|
||||
{
|
||||
if (const UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>())
|
||||
if (const UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
|
||||
{
|
||||
return Theme->GetActiveUIStyle();
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* Texto compartilhado do ZMMO. Subclasse de UCommonTextBlock (leaf, usado
|
||||
* 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
|
||||
* 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).
|
||||
*
|
||||
* Fallback: se a chave não existir no mapa, cai nas categorias clássicas de
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "UIInput_Base.h"
|
||||
|
||||
#include "ZMMOThemeSubsystem.h"
|
||||
#include "ZeusThemeSubsystem.h"
|
||||
#include "Engine/GameInstance.h"
|
||||
#include "Engine/DataTable.h"
|
||||
#include "Components/EditableTextBox.h"
|
||||
@@ -20,7 +20,7 @@ namespace
|
||||
{
|
||||
if (const UGameInstance* GI = Widget->GetGameInstance())
|
||||
{
|
||||
if (const UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>())
|
||||
if (const UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
|
||||
{
|
||||
return Theme->GetActiveUIStyle();
|
||||
}
|
||||
@@ -277,7 +277,7 @@ void UUIInput_Base::NativeConstruct()
|
||||
{
|
||||
if (const UGameInstance* GI = GetGameInstance())
|
||||
{
|
||||
if (UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>())
|
||||
if (UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
|
||||
{
|
||||
Theme->OnThemeChanged.AddDynamic(this, &UUIInput_Base::HandleThemeChanged);
|
||||
bThemeBound = true;
|
||||
@@ -299,7 +299,7 @@ void UUIInput_Base::NativeDestruct()
|
||||
{
|
||||
if (const UGameInstance* GI = GetGameInstance())
|
||||
{
|
||||
if (UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>())
|
||||
if (UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
|
||||
{
|
||||
Theme->OnThemeChanged.RemoveDynamic(this, &UUIInput_Base::HandleThemeChanged);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "UIPanel_Base.h"
|
||||
|
||||
#include "ZMMOThemeSubsystem.h"
|
||||
#include "ZeusThemeSubsystem.h"
|
||||
#include "Engine/GameInstance.h"
|
||||
#include "Components/Border.h"
|
||||
#include "Styling/SlateBrush.h"
|
||||
@@ -15,7 +15,7 @@ namespace
|
||||
{
|
||||
if (const UGameInstance* GI = Widget->GetGameInstance())
|
||||
{
|
||||
if (const UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>())
|
||||
if (const UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
|
||||
{
|
||||
return Theme->GetActiveUIStyle();
|
||||
}
|
||||
@@ -106,7 +106,7 @@ void UUIPanel_Base::NativeConstruct()
|
||||
{
|
||||
if (const UGameInstance* GI = GetGameInstance())
|
||||
{
|
||||
if (UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>())
|
||||
if (UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
|
||||
{
|
||||
Theme->OnThemeChanged.AddDynamic(this, &UUIPanel_Base::HandleThemeChanged);
|
||||
bThemeBound = true;
|
||||
@@ -122,7 +122,7 @@ void UUIPanel_Base::NativeDestruct()
|
||||
{
|
||||
if (const UGameInstance* GI = GetGameInstance())
|
||||
{
|
||||
if (UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>())
|
||||
if (UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
|
||||
{
|
||||
Theme->OnThemeChanged.RemoveDynamic(this, &UUIPanel_Base::HandleThemeChanged);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ class UBorder;
|
||||
* (UI_Panel_Master) herda DIRETO desta classe C++ (UMG não encadeia árvores
|
||||
* 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".
|
||||
*/
|
||||
UCLASS(Abstract, Blueprintable)
|
||||
|
||||
@@ -8,7 +8,7 @@ class UButton;
|
||||
class UHorizontalBox;
|
||||
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.
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
|
||||
/** Disparado quando o usuário clica em "+". */
|
||||
UPROPERTY(BlueprintAssignable, Category = "Zeus|Status")
|
||||
FZMMOOnStatRowPlusClicked OnPlusClicked;
|
||||
FZeusOnStatRowPlusClicked OnPlusClicked;
|
||||
|
||||
protected:
|
||||
virtual void NativeOnInitialized() override;
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
#include "GameFramework/PlayerState.h"
|
||||
#include "Internationalization/Text.h"
|
||||
#include "ZMMO.h"
|
||||
#include "ZMMOAttributeComponent.h"
|
||||
#include "ZMMOJobDataAsset.h"
|
||||
#include "ZMMOJobsSubsystem.h"
|
||||
#include "ZMMOPlayerState.h"
|
||||
#include "ZeusAttributeComponent.h"
|
||||
#include "ZeusJobDataAsset.h"
|
||||
#include "ZeusJobsSubsystem.h"
|
||||
#include "ZeusPlayerState.h"
|
||||
#include "UI/InGame/UIInGameFlowSubsystem.h"
|
||||
#include "UI/InGameTypes.h"
|
||||
#include "UI/Widgets/UIPlayerStatus_BonusRow.h"
|
||||
@@ -107,23 +107,23 @@ void UUIPlayerStatus_Window::BindToLocalPlayer()
|
||||
APlayerController* PC = World->GetFirstPlayerController();
|
||||
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
|
||||
// se CharName ainda nao chegou (race com handler que dispara o widget).
|
||||
if (Text_CharName)
|
||||
{
|
||||
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));
|
||||
}
|
||||
|
||||
UZMMOAttributeComponent* Comp = PC->PlayerState->FindComponentByClass<UZMMOAttributeComponent>();
|
||||
UZeusAttributeComponent* Comp = PC->PlayerState->FindComponentByClass<UZeusAttributeComponent>();
|
||||
if (!Comp || Comp == BoundComponent.Get()) return;
|
||||
|
||||
UnbindFromComponent();
|
||||
@@ -135,7 +135,7 @@ void UUIPlayerStatus_Window::BindToLocalPlayer()
|
||||
|
||||
void UUIPlayerStatus_Window::UnbindFromComponent()
|
||||
{
|
||||
if (UZMMOAttributeComponent* Old = BoundComponent.Get())
|
||||
if (UZeusAttributeComponent* Old = BoundComponent.Get())
|
||||
{
|
||||
Old->OnAttributesChanged.RemoveDynamic(this, &UUIPlayerStatus_Window::HandleAttributesChanged);
|
||||
Old->OnStatAllocReply.RemoveDynamic(this, &UUIPlayerStatus_Window::HandleStatAllocReply);
|
||||
@@ -143,7 +143,7 @@ void UUIPlayerStatus_Window::UnbindFromComponent()
|
||||
BoundComponent.Reset();
|
||||
}
|
||||
|
||||
void UUIPlayerStatus_Window::HandleAttributesChanged(const FZMMOAttributesSnapshot& Snapshot)
|
||||
void UUIPlayerStatus_Window::HandleAttributesChanged(const FZeusAttributesSnapshot& Snapshot)
|
||||
{
|
||||
bPlusButtonsLocked = false;
|
||||
RefreshFromSnapshot(Snapshot);
|
||||
@@ -155,9 +155,9 @@ void UUIPlayerStatus_Window::HandleStatAllocReply(bool bAccepted, int32 Reason)
|
||||
bAccepted ? 1 : 0, Reason);
|
||||
|
||||
bPlusButtonsLocked = false;
|
||||
if (UZMMOAttributeComponent* Comp = BoundComponent.Get())
|
||||
if (UZeusAttributeComponent* Comp = BoundComponent.Get())
|
||||
{
|
||||
const FZMMOAttributesSnapshot& S = Comp->GetSnapshot();
|
||||
const FZeusAttributesSnapshot& S = Comp->GetSnapshot();
|
||||
SetAllPrimaryRowsPlusEnabled(S.StatusPoint > 0);
|
||||
}
|
||||
}
|
||||
@@ -165,7 +165,7 @@ void UUIPlayerStatus_Window::HandleStatAllocReply(bool bAccepted, int32 Reason)
|
||||
void UUIPlayerStatus_Window::HandleRowPlusClicked(int32 StatId)
|
||||
{
|
||||
if (bPlusButtonsLocked) return;
|
||||
UZMMOAttributeComponent* Comp = BoundComponent.Get();
|
||||
UZeusAttributeComponent* Comp = BoundComponent.Get();
|
||||
if (!Comp) return;
|
||||
|
||||
bPlusButtonsLocked = true;
|
||||
@@ -184,7 +184,7 @@ void UUIPlayerStatus_Window::SetAllPrimaryRowsPlusEnabled(bool bEnabled)
|
||||
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).
|
||||
if (Row_Str) Row_Str->SetValues(S.Str, 0);
|
||||
@@ -202,9 +202,9 @@ void UUIPlayerStatus_Window::RefreshFromSnapshot(const FZMMOAttributesSnapshot&
|
||||
FText JobName;
|
||||
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;
|
||||
}
|
||||
@@ -244,7 +244,7 @@ void UUIPlayerStatus_Window::HandleCloseClicked()
|
||||
{
|
||||
if (UUIInGameFlowSubsystem* Flow = GI->GetSubsystem<UUIInGameFlowSubsystem>())
|
||||
{
|
||||
Flow->SetState(EZMMOInGameUIState::Playing);
|
||||
Flow->SetState(EZeusInGameUIState::Playing);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -259,7 +259,7 @@ FReply UUIPlayerStatus_Window::NativeOnKeyDown(const FGeometry& Geom, const FKey
|
||||
{
|
||||
if (UUIInGameFlowSubsystem* Flow = GI->GetSubsystem<UUIInGameFlowSubsystem>())
|
||||
{
|
||||
Flow->SetState(EZMMOInGameUIState::Playing);
|
||||
Flow->SetState(EZeusInGameUIState::Playing);
|
||||
return FReply::Handled();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "UI/Common/UIDraggableWindow_Base.h"
|
||||
#include "ZMMOAttributeTypes.h"
|
||||
#include "ZeusAttributeTypes.h"
|
||||
#include "UIPlayerStatus_Window.generated.h"
|
||||
|
||||
class UButton;
|
||||
@@ -10,13 +10,13 @@ class UTextBlock;
|
||||
class UHorizontalBox;
|
||||
class UUIPlayerStatus_BonusRow;
|
||||
class UUIPlayerStatus_StatRow;
|
||||
class UZMMOAttributeComponent;
|
||||
class UZeusAttributeComponent;
|
||||
|
||||
/**
|
||||
* Janela de Status do player — composta por instâncias dos sub-widgets
|
||||
* 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).
|
||||
*
|
||||
* Pareada com o WBP UI_PlayerStatus_Window. Os 14 rows são BindWidgetOptional
|
||||
@@ -30,7 +30,7 @@ class ZMMO_API UUIPlayerStatus_Window : public UUIDraggableWindow_Base
|
||||
public:
|
||||
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"); }
|
||||
|
||||
protected:
|
||||
@@ -94,17 +94,17 @@ protected:
|
||||
private:
|
||||
void BindToLocalPlayer();
|
||||
void UnbindFromComponent();
|
||||
void RefreshFromSnapshot(const FZMMOAttributesSnapshot& Snap);
|
||||
void RefreshFromSnapshot(const FZeusAttributesSnapshot& Snap);
|
||||
void SetAllPrimaryRowsPlusEnabled(bool bEnabled);
|
||||
void BindRow(UUIPlayerStatus_StatRow* Row, int32 StatId, const TCHAR* IconLetter, const TCHAR* DisplayName);
|
||||
|
||||
UFUNCTION() void HandleAttributesChanged(const FZMMOAttributesSnapshot& Snapshot);
|
||||
UFUNCTION() void HandleAttributesChanged(const FZeusAttributesSnapshot& Snapshot);
|
||||
UFUNCTION() void HandleStatAllocReply(bool bAccepted, int32 Reason);
|
||||
UFUNCTION() void HandleRowPlusClicked(int32 StatId);
|
||||
UFUNCTION() void HandleCloseClicked();
|
||||
|
||||
UPROPERTY(Transient)
|
||||
TWeakObjectPtr<UZMMOAttributeComponent> BoundComponent;
|
||||
TWeakObjectPtr<UZeusAttributeComponent> BoundComponent;
|
||||
|
||||
/** Trava local pra evitar spam-click: vira true ao clicar, false ao
|
||||
* receber StatAllocReply (ou snapshot novo, o que vier primeiro). */
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "Styling/SlateTypes.h"
|
||||
#include "UI/UIStyleRow.h"
|
||||
#include "UI/UIStyleTokens.h"
|
||||
#include "ZMMOThemeSubsystem.h"
|
||||
#include "ZeusThemeSubsystem.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -59,7 +59,7 @@ namespace
|
||||
{
|
||||
if (const UGameInstance* GI = Widget->GetGameInstance())
|
||||
{
|
||||
if (const UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>())
|
||||
if (const UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
|
||||
{
|
||||
return Theme->GetActiveUIStyle();
|
||||
}
|
||||
@@ -135,7 +135,7 @@ void UUIProgressBar_Base::NativeConstruct()
|
||||
{
|
||||
if (const UGameInstance* GI = GetGameInstance())
|
||||
{
|
||||
if (UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>())
|
||||
if (UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
|
||||
{
|
||||
Theme->OnThemeChanged.AddDynamic(this, &UUIProgressBar_Base::HandleThemeChanged);
|
||||
bThemeBound = true;
|
||||
@@ -163,7 +163,7 @@ void UUIProgressBar_Base::NativeDestruct()
|
||||
{
|
||||
if (const UGameInstance* GI = GetGameInstance())
|
||||
{
|
||||
if (UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>())
|
||||
if (UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
|
||||
{
|
||||
Theme->OnThemeChanged.RemoveDynamic(this, &UUIProgressBar_Base::HandleThemeChanged);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "UISpinner_Base.h"
|
||||
|
||||
#include "ZMMOThemeSubsystem.h"
|
||||
#include "ZeusThemeSubsystem.h"
|
||||
#include "Engine/GameInstance.h"
|
||||
#include "Engine/DataTable.h"
|
||||
#include "Components/CircularThrobber.h"
|
||||
@@ -16,7 +16,7 @@ namespace
|
||||
{
|
||||
if (const UGameInstance* GI = Widget->GetGameInstance())
|
||||
{
|
||||
if (const UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>())
|
||||
if (const UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
|
||||
{
|
||||
return Theme->GetActiveUIStyle();
|
||||
}
|
||||
@@ -103,7 +103,7 @@ void UUISpinner_Base::NativeConstruct()
|
||||
{
|
||||
if (const UGameInstance* GI = GetGameInstance())
|
||||
{
|
||||
if (UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>())
|
||||
if (UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
|
||||
{
|
||||
Theme->OnThemeChanged.AddDynamic(this, &UUISpinner_Base::HandleThemeChanged);
|
||||
bThemeBound = true;
|
||||
@@ -119,7 +119,7 @@ void UUISpinner_Base::NativeDestruct()
|
||||
{
|
||||
if (const UGameInstance* GI = GetGameInstance())
|
||||
{
|
||||
if (UZMMOThemeSubsystem* Theme = GI->GetSubsystem<UZMMOThemeSubsystem>())
|
||||
if (UZeusThemeSubsystem* Theme = GI->GetSubsystem<UZeusThemeSubsystem>())
|
||||
{
|
||||
Theme->OnThemeChanged.RemoveDynamic(this, &UUISpinner_Base::HandleThemeChanged);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ class UCircularThrobber;
|
||||
* (UI_Spinner_Master) herda DIRETO desta classe C++ (UMG não encadeia
|
||||
* á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
|
||||
* BP_ApplySpinnerStyle (o WBP tinge a imagem do throbber).
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
11
Source/ZMMO/Game/UI/ZeusThemeDataAsset.cpp
Normal file
11
Source/ZMMO/Game/UI/ZeusThemeDataAsset.cpp
Normal 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);
|
||||
}
|
||||
@@ -4,10 +4,10 @@
|
||||
#include "Engine/DataAsset.h"
|
||||
#include "UI/ThemeKeys.h"
|
||||
#include "UI/ThemeRow.h"
|
||||
#include "ZMMOThemeDataAsset.generated.h"
|
||||
#include "ZeusThemeDataAsset.generated.h"
|
||||
|
||||
UCLASS(BlueprintType)
|
||||
class ZMMO_API UZMMOThemeDataAsset : public UPrimaryDataAsset
|
||||
class ZMMO_API UZeusThemeDataAsset : public UPrimaryDataAsset
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -19,8 +19,8 @@ public:
|
||||
FText DisplayName;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Theme", meta = (ToolTip = "Only fill the keys this theme overrides. Missing keys fall back to the Default theme."))
|
||||
TMap<EZMMOThemeKey, FThemeEntry> Entries;
|
||||
TMap<EZeusThemeKey, FThemeEntry> Entries;
|
||||
|
||||
bool HasKey(EZMMOThemeKey Key) const;
|
||||
const FThemeEntry* FindEntry(EZMMOThemeKey Key) const;
|
||||
bool HasKey(EZeusThemeKey Key) const;
|
||||
const FThemeEntry* FindEntry(EZeusThemeKey Key) const;
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "ZMMOThemeSubsystem.h"
|
||||
#include "ZeusThemeSubsystem.h"
|
||||
|
||||
#include "ZMMOThemeDataAsset.h"
|
||||
#include "ZeusThemeDataAsset.h"
|
||||
#include "Engine/DataTable.h"
|
||||
#include "Engine/Texture2D.h"
|
||||
#include "Sound/SoundBase.h"
|
||||
@@ -15,7 +15,7 @@ namespace
|
||||
const FName GUIStyleDefaultRow(TEXT("Default"));
|
||||
}
|
||||
|
||||
void UZMMOThemeSubsystem::Initialize(FSubsystemCollectionBase& Collection)
|
||||
void UZeusThemeSubsystem::Initialize(FSubsystemCollectionBase& Collection)
|
||||
{
|
||||
Super::Initialize(Collection);
|
||||
|
||||
@@ -23,7 +23,7 @@ void UZMMOThemeSubsystem::Initialize(FSubsystemCollectionBase& Collection)
|
||||
if (!DefaultTheme)
|
||||
{
|
||||
UE_LOG(LogTemp, Warning,
|
||||
TEXT("[ZMMOThemeSubsystem] DefaultThemeAsset is not set. UI will have no theme."));
|
||||
TEXT("[ZeusThemeSubsystem] DefaultThemeAsset is not set. UI will have no theme."));
|
||||
}
|
||||
|
||||
ResolveActiveTheme();
|
||||
@@ -36,32 +36,32 @@ void UZMMOThemeSubsystem::Initialize(FSubsystemCollectionBase& Collection)
|
||||
ResolveActiveUIStyle(ActiveThemeId);
|
||||
}
|
||||
|
||||
void UZMMOThemeSubsystem::Deinitialize()
|
||||
void UZeusThemeSubsystem::Deinitialize()
|
||||
{
|
||||
ActiveTheme = nullptr;
|
||||
DefaultTheme = nullptr;
|
||||
Super::Deinitialize();
|
||||
}
|
||||
|
||||
void UZMMOThemeSubsystem::ApplyServerTheme(FName ThemeId)
|
||||
void UZeusThemeSubsystem::ApplyServerTheme(FName ThemeId)
|
||||
{
|
||||
ServerThemeId = ThemeId;
|
||||
ResolveActiveTheme();
|
||||
}
|
||||
|
||||
void UZMMOThemeSubsystem::ForceTheme(FName ThemeId)
|
||||
void UZeusThemeSubsystem::ForceTheme(FName ThemeId)
|
||||
{
|
||||
ForcedThemeId = ThemeId;
|
||||
ResolveActiveTheme();
|
||||
}
|
||||
|
||||
void UZMMOThemeSubsystem::ClearForcedTheme()
|
||||
void UZeusThemeSubsystem::ClearForcedTheme()
|
||||
{
|
||||
ForcedThemeId = NAME_None;
|
||||
ResolveActiveTheme();
|
||||
}
|
||||
|
||||
void UZMMOThemeSubsystem::ResolveActiveTheme()
|
||||
void UZeusThemeSubsystem::ResolveActiveTheme()
|
||||
{
|
||||
FName Resolved = NAME_None;
|
||||
|
||||
@@ -84,7 +84,7 @@ void UZMMOThemeSubsystem::ResolveActiveTheme()
|
||||
Resolved = ResolveByCalendar();
|
||||
}
|
||||
|
||||
UZMMOThemeDataAsset* NewActive = !Resolved.IsNone() ? LoadThemeById(Resolved) : nullptr;
|
||||
UZeusThemeDataAsset* NewActive = !Resolved.IsNone() ? LoadThemeById(Resolved) : nullptr;
|
||||
if (!NewActive)
|
||||
{
|
||||
NewActive = DefaultTheme;
|
||||
@@ -100,7 +100,7 @@ void UZMMOThemeSubsystem::ResolveActiveTheme()
|
||||
}
|
||||
}
|
||||
|
||||
void UZMMOThemeSubsystem::ResolveActiveUIStyle(FName ThemeId)
|
||||
void UZeusThemeSubsystem::ResolveActiveUIStyle(FName ThemeId)
|
||||
{
|
||||
// Reset para os defaults do struct antes de aplicar a linha resolvida —
|
||||
// assim um tema sem linha cai num estado coerente (paleta Aurora Arcana).
|
||||
@@ -128,7 +128,7 @@ void UZMMOThemeSubsystem::ResolveActiveUIStyle(FName ThemeId)
|
||||
}
|
||||
}
|
||||
|
||||
FName UZMMOThemeSubsystem::ResolveByCalendar() const
|
||||
FName UZeusThemeSubsystem::ResolveByCalendar() const
|
||||
{
|
||||
UDataTable* Table = CalendarTable.LoadSynchronous();
|
||||
if (!Table)
|
||||
@@ -170,16 +170,16 @@ FName UZMMOThemeSubsystem::ResolveByCalendar() const
|
||||
return Best;
|
||||
}
|
||||
|
||||
UZMMOThemeDataAsset* UZMMOThemeSubsystem::LoadThemeById(FName ThemeId) const
|
||||
UZeusThemeDataAsset* UZeusThemeSubsystem::LoadThemeById(FName ThemeId) const
|
||||
{
|
||||
if (const TSoftObjectPtr<UZMMOThemeDataAsset>* Soft = ThemeRegistry.Find(ThemeId))
|
||||
if (const TSoftObjectPtr<UZeusThemeDataAsset>* Soft = ThemeRegistry.Find(ThemeId))
|
||||
{
|
||||
return Soft->LoadSynchronous();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const FThemeEntry* UZMMOThemeSubsystem::FindEntryWithFallback(EZMMOThemeKey Key) const
|
||||
const FThemeEntry* UZeusThemeSubsystem::FindEntryWithFallback(EZeusThemeKey Key) const
|
||||
{
|
||||
if (ActiveTheme)
|
||||
{
|
||||
@@ -198,25 +198,25 @@ const FThemeEntry* UZMMOThemeSubsystem::FindEntryWithFallback(EZMMOThemeKey Key)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
UTexture2D* UZMMOThemeSubsystem::GetTexture(EZMMOThemeKey Key) const
|
||||
UTexture2D* UZeusThemeSubsystem::GetTexture(EZeusThemeKey Key) const
|
||||
{
|
||||
const FThemeEntry* Entry = FindEntryWithFallback(Key);
|
||||
return Entry ? Entry->Texture.LoadSynchronous() : nullptr;
|
||||
}
|
||||
|
||||
USoundBase* UZMMOThemeSubsystem::GetSound(EZMMOThemeKey Key) const
|
||||
USoundBase* UZeusThemeSubsystem::GetSound(EZeusThemeKey Key) const
|
||||
{
|
||||
const FThemeEntry* Entry = FindEntryWithFallback(Key);
|
||||
return Entry ? Entry->Sound.LoadSynchronous() : nullptr;
|
||||
}
|
||||
|
||||
UNiagaraSystem* UZMMOThemeSubsystem::GetVFX(EZMMOThemeKey Key) const
|
||||
UNiagaraSystem* UZeusThemeSubsystem::GetVFX(EZeusThemeKey Key) const
|
||||
{
|
||||
const FThemeEntry* Entry = FindEntryWithFallback(Key);
|
||||
return Entry ? Entry->VFX.LoadSynchronous() : nullptr;
|
||||
}
|
||||
|
||||
UObject* UZMMOThemeSubsystem::GetGeneric(EZMMOThemeKey Key) const
|
||||
UObject* UZeusThemeSubsystem::GetGeneric(EZeusThemeKey Key) const
|
||||
{
|
||||
const FThemeEntry* Entry = FindEntryWithFallback(Key);
|
||||
return Entry ? Entry->Generic.LoadSynchronous() : nullptr;
|
||||
@@ -5,18 +5,18 @@
|
||||
#include "UI/ThemeKeys.h"
|
||||
#include "UI/ThemeRow.h"
|
||||
#include "UI/UIStyleRow.h"
|
||||
#include "ZMMOThemeSubsystem.generated.h"
|
||||
#include "ZeusThemeSubsystem.generated.h"
|
||||
|
||||
class UZMMOThemeDataAsset;
|
||||
class UZeusThemeDataAsset;
|
||||
class UDataTable;
|
||||
class UTexture2D;
|
||||
class USoundBase;
|
||||
class UNiagaraSystem;
|
||||
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnZMMOThemeChanged, FName, NewThemeId);
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnZeusThemeChanged, FName, NewThemeId);
|
||||
|
||||
/**
|
||||
* Resolves which UI theme is active and answers asset lookups by EZMMOThemeKey.
|
||||
* Resolves which UI theme is active and answers asset lookups by EZeusThemeKey.
|
||||
*
|
||||
* Resolution precedence (see ARQUITETURA.md §1.10):
|
||||
* 1. Dev override (.ini DevThemeOverride) — ignored in Shipping builds.
|
||||
@@ -28,7 +28,7 @@ DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnZMMOThemeChanged, FName, NewTheme
|
||||
* active theme through Get* methods on this subsystem.
|
||||
*/
|
||||
UCLASS(Config = Game)
|
||||
class ZMMO_API UZMMOThemeSubsystem : public UGameInstanceSubsystem
|
||||
class ZMMO_API UZeusThemeSubsystem : public UGameInstanceSubsystem
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -53,16 +53,16 @@ public:
|
||||
FName GetActiveThemeId() const { return ActiveThemeId; }
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "Theme")
|
||||
UTexture2D* GetTexture(EZMMOThemeKey Key) const;
|
||||
UTexture2D* GetTexture(EZeusThemeKey Key) const;
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "Theme")
|
||||
USoundBase* GetSound(EZMMOThemeKey Key) const;
|
||||
USoundBase* GetSound(EZeusThemeKey Key) const;
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "Theme")
|
||||
UNiagaraSystem* GetVFX(EZMMOThemeKey Key) const;
|
||||
UNiagaraSystem* GetVFX(EZeusThemeKey Key) const;
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "Theme")
|
||||
UObject* GetGeneric(EZMMOThemeKey Key) const;
|
||||
UObject* GetGeneric(EZeusThemeKey Key) const;
|
||||
|
||||
/**
|
||||
* Tokens de estilo (cores/fontes/dimensões) do tema ativo, resolvidos de
|
||||
@@ -74,16 +74,16 @@ public:
|
||||
|
||||
/** Fired whenever the active theme actually changes. */
|
||||
UPROPERTY(BlueprintAssignable, Category = "Theme")
|
||||
FOnZMMOThemeChanged OnThemeChanged;
|
||||
FOnZeusThemeChanged OnThemeChanged;
|
||||
|
||||
protected:
|
||||
/** Default theme. Must be filled with every key — it is the final fallback. */
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Theme")
|
||||
TSoftObjectPtr<UZMMOThemeDataAsset> DefaultThemeAsset;
|
||||
TSoftObjectPtr<UZeusThemeDataAsset> DefaultThemeAsset;
|
||||
|
||||
/** Registry of seasonal/event themes keyed by ThemeId. */
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Theme")
|
||||
TMap<FName, TSoftObjectPtr<UZMMOThemeDataAsset>> ThemeRegistry;
|
||||
TMap<FName, TSoftObjectPtr<UZeusThemeDataAsset>> ThemeRegistry;
|
||||
|
||||
/** Local calendar table (FThemeCalendarRow). Optional. */
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Theme")
|
||||
@@ -100,15 +100,15 @@ protected:
|
||||
private:
|
||||
void ResolveActiveTheme();
|
||||
FName ResolveByCalendar() const;
|
||||
UZMMOThemeDataAsset* LoadThemeById(FName ThemeId) const;
|
||||
const FThemeEntry* FindEntryWithFallback(EZMMOThemeKey Key) const;
|
||||
UZeusThemeDataAsset* LoadThemeById(FName ThemeId) const;
|
||||
const FThemeEntry* FindEntryWithFallback(EZeusThemeKey Key) const;
|
||||
void ResolveActiveUIStyle(FName ThemeId);
|
||||
|
||||
UPROPERTY(Transient)
|
||||
TObjectPtr<UZMMOThemeDataAsset> ActiveTheme;
|
||||
TObjectPtr<UZeusThemeDataAsset> ActiveTheme;
|
||||
|
||||
UPROPERTY(Transient)
|
||||
TObjectPtr<UZMMOThemeDataAsset> DefaultTheme;
|
||||
TObjectPtr<UZeusThemeDataAsset> DefaultTheme;
|
||||
|
||||
UPROPERTY(Transient)
|
||||
FName ActiveThemeId;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user