Skip to content

Commit

Permalink
修复派生类列表问题、支持CookClassesMode
Browse files Browse the repository at this point in the history
  • Loading branch information
lipengzha committed Feb 23, 2022
1 parent bd6938f commit 925b2ba
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
1 change: 0 additions & 1 deletion HotPatcher/Source/HotPatcherCore/HotPatcherCore.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ public HotPatcherCore(ReadOnlyTargetRules Target) : base(Target)
PrivateDependencyModuleNames.AddRange(
new string[]
{
"Core",
"DesktopPlatform",
"InputCore",
"CoreUObject",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ TArray<FSingleCookerSettings> UMultiCookScheduler::MultiCookScheduler_Implementa
{
for(auto& ParentClass:MultiCookerSettings.CookClasses)
{
Classes.Add(ParentClass);
Classes.Append(UFlibHotPatcherCoreHelper::GetDerivedClasses(ParentClass,true,true));
Classes.Append(UFlibHotPatcherCoreHelper::GetDerivedClasses(ParentClass,MultiCookerSettings.bContainChildClasses,true));
}
}

Expand All @@ -43,8 +42,8 @@ TArray<FSingleCookerSettings> UMultiCookScheduler::MultiCookScheduler_Implementa
for(int32 index = 0;index < AllDetails.Num();)
{
bool bIsMatchedClass = IsMatchClass(AllDetails[index].AssetType);
if(MultiCookerSettings.bIgnoreCookClasses && bIsMatchedClass && !!Classes.Num() ||
!MultiCookerSettings.bIgnoreCookClasses && !bIsMatchedClass && !!Classes.Num()
if(MultiCookerSettings.CookClassesMode == ECookClassesMode::SKIP_CLASSES && bIsMatchedClass && !!Classes.Num() ||
(MultiCookerSettings.CookClassesMode == ECookClassesMode::COOK_CLASSES_ONLY) && !bIsMatchedClass && !!Classes.Num()
)
{
AllDetails.RemoveAt(index);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,7 @@ TArray<UClass*> UFlibHotPatcherCoreHelper::GetDerivedClasses(UClass* BaseClass,b
{
Classes.AddUnique(classIns);
}
return AllDerivedClass;
return Classes;
}

void UFlibHotPatcherCoreHelper::DeleteDirectory(const FString& Dir)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ struct HOTPATCHERCORE_API FCookerShaderOptions
bool bMergeShaderLibrary = false;
};

UENUM()
enum class ECookClassesMode
{
COOK_CLASSES_ONLY,
SKIP_CLASSES
};

/** Singleton wrapper to allow for using the setting structur e in SSettingsView */
USTRUCT(BlueprintType)
Expand Down Expand Up @@ -79,13 +85,13 @@ struct HOTPATCHERCORE_API FMultiCookerSettings: public FHotPatcherSettingBase

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cooker")
bool bSkipCook = false;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cooker")
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cooker",meta=(EditCondition="!bSkipCook"))
TArray<UClass*> CookClasses;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cooker")
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cooker",meta=(EditCondition="!bSkipCook"))
bool bContainChildClasses = true;
// is true, ignore classes for cook, if false, only cook clases
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cooker")
bool bIgnoreCookClasses = false;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cooker",meta=(EditCondition="!bSkipCook"))
ECookClassesMode CookClassesMode = ECookClassesMode::SKIP_CLASSES;

// UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cooker")
bool bAsyncLoad = false;
Expand Down

0 comments on commit 925b2ba

Please sign in to comment.