A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
DlgSystemModule.h
Go to the documentation of this file.
1// Copyright Csaba Molnar, Daniel Butum. All Rights Reserved.
2#pragma once
3
4#include "IDlgSystemModule.h"
5
6class UDlgDialogue;
7class SWidget;
8struct FAssetData;
10class SDockTab;
11struct IConsoleCommand;
12class AActor;
13struct FTabSpawnerEntry;
14
16
17// Implementation of the DlgSystem Module
18class DLGSYSTEM_API FDlgSystemModule : public IDlgSystemModule
19{
21public:
22 // IModuleInterface implementation
23 void StartupModule() override;
24 void ShutdownModule() override;
25
26 // IDlgSystemModule implementation
27 void RegisterConsoleCommands(const TWeakObjectPtr<const UObject>& InWorldContextObjectPtr) override;
28 void UnregisterConsoleCommands() override;
29 TSharedRef<SWidget> GetDialogueDataDisplayWindow() override;
30 FTabSpawnerEntry* GetDialogueDataDisplaySpawnEntry() override;
31 void DisplayDialogueDataWindow() override;
32
33private:
34 // Refreshes the actor of the DlgDataDisplay if it is already opened. Return true if refresh was successful
35 bool RefreshDisplayDialogueDataWindow(bool bFocus = true);
36
37 // Handle the event from the asset registry when an asset was deleted.
38 void HandleOnInMemoryAssetDeleted(UObject* DeletedObject);
39
40 // Handle the event for when assets are removed from the asset registry.
41 void HandleOnAssetRemoved(const FAssetData& RemovedAsset);
42
43 // Handle the event for when assets are renamed in the registry
44 void HandleOnAssetRenamed(const FAssetData& AssetRenamed, const FString& OldObjectPath);
45
46 // Handle the event after the Dialogue was deleted. Deletes the text file(s).
47 void HandleDialogueDeleted(UDlgDialogue* DeletedDialogue);
48
49 // Handle the event after the Dialogue was renamed. Rename the text file(s).
50 void HandleDialogueRenamed(UDlgDialogue* RenamedDialogue, const FString& OldObjectPath);
51
52 // Handle event when a new map is loaded.
53 void HandleOnPreLoadMap(const FString& MapName);
54
55 // Handle event when a new map with world is loaded is loaded.
56 void HandleOnPostLoadMapWithWorld(UWorld* LoadedWorld);
57
58private:
59 // True if the tab spawners have been registered for this module
60 bool bHasRegisteredTabSpawners = false;
61
62 // Holds the widget reflector singleton.
63 TWeakPtr<SDlgDataDisplay> DialogueDataDisplayWidget;
64 FTabSpawnerEntry* DialogueDataDisplayTabSpawnEntry = nullptr;
65
66 // Holds the console commands for this Module
67 TArray<IConsoleCommand*> ConsoleCommands;
68
69 // Reference Object used to get the World
70 TWeakObjectPtr<const UObject> WorldContextObjectPtr = nullptr;
71
72 // NOTE: only in NON editor game
73 TWeakObjectPtr<UWorld> LastLoadedWorld = nullptr;
74
75 // Handlers
76 FDelegateHandle OnPreLoadMapHandle;
79 FDelegateHandle OnAssetRemovedHandle;
80 FDelegateHandle OnAssetRenamedHandle;
81};
DECLARE_LOG_CATEGORY_EXTERN(LogDlgSystem, All, All)
TWeakPtr< SDlgDataDisplay > DialogueDataDisplayWidget
FDelegateHandle OnPostLoadMapWithWorldHandle
FDelegateHandle OnAssetRenamedHandle
FDlgSystemModule Self
FDelegateHandle OnAssetRemovedHandle
FDelegateHandle OnInMemoryAssetDeletedHandle
TArray< IConsoleCommand * > ConsoleCommands
FDelegateHandle OnPreLoadMapHandle
virtual TSharedRef< SWidget > GetDialogueDataDisplayWindow()=0
virtual void RegisterConsoleCommands(const TWeakObjectPtr< const UObject > &WorldContextObjectPtr)=0
virtual void UnregisterConsoleCommands()=0
virtual void DisplayDialogueDataWindow()=0
virtual FTabSpawnerEntry * GetDialogueDataDisplaySpawnEntry()=0
UCLASS(BlueprintType, Meta = (DisplayThumbnail = "true"))
Definition DlgDialogue.h:85