Skip to content

Commit

Permalink
Adapt for UE 5.3 (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
JBenda authored Oct 13, 2023
1 parent d40fe38 commit cf856ec
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion unreal/inkcpp/Source/inkcpp/Private/InkChoice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void UInkChoice::Initialize(const ink::runtime::choice* c)
data = c;
if (c->has_tags()) {
TArray<FString> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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)
Expand Down Expand Up @@ -141,9 +142,9 @@ int32 UInkAssetFactory::GetPriority() const
return ImportPriority;
}

const UObject* UInkAssetFactory::GetFactoryObject() const
TObjectPtr<UObject>* UInkAssetFactory::GetFactoryObject() const
{
return this;
return const_cast<TObjectPtr<UObject>*>(&object_ptr);
}

EReimportResult::Type UInkAssetFactory::Reimport(UObject* Obj)
Expand Down
6 changes: 4 additions & 2 deletions unreal/inkcpp/Source/inkcpp_editor/Private/InkAssetFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ class UInkAssetFactory : public UFactory, public FReimportHandler

// Begin FReimportHandler
bool CanReimport(UObject* Obj, TArray<FString>& OutFilenames) override;
const UObject* GetFactoryObject() const override;
TObjectPtr<UObject>* GetFactoryObject() const override;
EReimportResult::Type Reimport(UObject* Obj) override;
void SetReimportPaths(UObject* Obj, const TArray<FString>& NewReimportPaths) override;
virtual int32 GetPriority() const override;
// End FReimportHandler
// End FReimportHandle
private:
TObjectPtr<UObject> object_ptr;
};

0 comments on commit cf856ec

Please sign in to comment.