diff --git a/unreal/inkcpp/Source/inkcpp/Private/InkChoice.cpp b/unreal/inkcpp/Source/inkcpp/Private/InkChoice.cpp index 319ce7be..86dcfbfd 100644 --- a/unreal/inkcpp/Source/inkcpp/Private/InkChoice.cpp +++ b/unreal/inkcpp/Source/inkcpp/Private/InkChoice.cpp @@ -22,7 +22,7 @@ void UInkChoice::Initialize(const ink::runtime::choice* c) data = c; if (c->has_tags()) { TArray fstring_tags{}; - for(int i = 0; i < c->num_tags(); ++i) { + for(unsigned i = 0; i < c->num_tags(); ++i) { fstring_tags.Add(FString(c->get_tag(i))); } tags.Initialize(fstring_tags); diff --git a/unreal/inkcpp/Source/inkcpp_editor/Private/InkAssetFactory.cpp b/unreal/inkcpp/Source/inkcpp_editor/Private/InkAssetFactory.cpp index 00677c85..8b8f1bc4 100644 --- a/unreal/inkcpp/Source/inkcpp_editor/Private/InkAssetFactory.cpp +++ b/unreal/inkcpp/Source/inkcpp_editor/Private/InkAssetFactory.cpp @@ -18,7 +18,7 @@ DECLARE_LOG_CATEGORY_EXTERN(InkCpp, Log, All); DEFINE_LOG_CATEGORY(InkCpp); UInkAssetFactory::UInkAssetFactory(const FObjectInitializer& ObjectInitializer) - : UFactory(ObjectInitializer), FReimportHandler() + : UFactory(ObjectInitializer), FReimportHandler(), object_ptr(*this) { // Add ink format Formats.Add(FString(TEXT("json;")) + NSLOCTEXT("UInkAssetFactory", "FormatInkJSON", "Ink JSON File").ToString()); @@ -31,6 +31,7 @@ UInkAssetFactory::UInkAssetFactory(const FObjectInitializer& ObjectInitializer) // Fuck data tables TODO - some criteria? ImportPriority = 99999; + } UObject* UInkAssetFactory::FactoryCreateFile(UClass* InClass, UObject* InParent, FName InName, EObjectFlags Flags, const FString& Filename, const TCHAR* Parms, FFeedbackContext* Warn, bool& bOutOperationCanceled) @@ -141,9 +142,9 @@ int32 UInkAssetFactory::GetPriority() const return ImportPriority; } -const UObject* UInkAssetFactory::GetFactoryObject() const +TObjectPtr* UInkAssetFactory::GetFactoryObject() const { - return this; + return const_cast*>(&object_ptr); } EReimportResult::Type UInkAssetFactory::Reimport(UObject* Obj) diff --git a/unreal/inkcpp/Source/inkcpp_editor/Private/InkAssetFactory.h b/unreal/inkcpp/Source/inkcpp_editor/Private/InkAssetFactory.h index 97e04dab..6211d9dd 100644 --- a/unreal/inkcpp/Source/inkcpp_editor/Private/InkAssetFactory.h +++ b/unreal/inkcpp/Source/inkcpp_editor/Private/InkAssetFactory.h @@ -23,9 +23,11 @@ class UInkAssetFactory : public UFactory, public FReimportHandler // Begin FReimportHandler bool CanReimport(UObject* Obj, TArray& OutFilenames) override; - const UObject* GetFactoryObject() const override; + TObjectPtr* GetFactoryObject() const override; EReimportResult::Type Reimport(UObject* Obj) override; void SetReimportPaths(UObject* Obj, const TArray& NewReimportPaths) override; virtual int32 GetPriority() const override; - // End FReimportHandler + // End FReimportHandle +private: + TObjectPtr object_ptr; }; \ No newline at end of file