Compare commits

..

No commits in common. "c07849c95b41f5a8ff812fa69910b4296e9957b5" and "0f942b0b7734f7f78755138ef493f171048f74dd" have entirely different histories.

25 changed files with 8 additions and 51 deletions

View File

@ -2,7 +2,7 @@
"BuildId": "37670630", "BuildId": "37670630",
"Modules": "Modules":
{ {
"ProjectFish": "UnrealEditor-ProjectFish-0001.dll", "ProjectFish": "UnrealEditor-ProjectFish.dll",
"ProjectFishEditor": "UnrealEditor-ProjectFishEditor-0001.dll" "ProjectFishEditor": "UnrealEditor-ProjectFishEditor.dll"
} }
} }

Binary file not shown.

View File

@ -2,6 +2,6 @@
"BuildId": "37670630", "BuildId": "37670630",
"Modules": "Modules":
{ {
"DeskMode": "UnrealEditor-DeskMode-0001.dll" "DeskMode": "UnrealEditor-DeskMode.dll"
} }
} }

View File

@ -54,35 +54,5 @@ void UQuestAsset::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedE
} }
} }
} }
void UQuestAsset::PostDuplicate(bool bDuplicateForPIE)
{
Super::PostDuplicate(bDuplicateForPIE);
if (!bDuplicateForPIE)
{
int32 MaxQuestID = 0;
// 获取资产注册表模块
FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked<FAssetRegistryModule>("AssetRegistry");
IAssetRegistry& AssetRegistry = AssetRegistryModule.Get();
// 查找所有 QuestAsset 资产
TArray<FAssetData> AssetDataList;
AssetRegistry.GetAssetsByClass(UQuestAsset::StaticClass()->GetClassPathName(), AssetDataList, true);
// 遍历所有已存在的任务资产,找到最大的 QuestID
for (const FAssetData& AssetData : AssetDataList)
{
if (UQuestAsset* QuestAsset = Cast<UQuestAsset>(AssetData.GetAsset()))
{
if (QuestAsset->QuestID > MaxQuestID)
{
MaxQuestID = QuestAsset->QuestID;
}
}
}
QuestID += 1;
}
}
#endif #endif

View File

@ -20,8 +20,6 @@ public:
#if WITH_EDITOR #if WITH_EDITOR
// 编辑器中属性修改后的回调 // 编辑器中属性修改后的回调
virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override; virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
virtual void PostDuplicate(bool bDuplicateForPIE) override;
#endif #endif
/** 任务编号ID */ /** 任务编号ID */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Quest|Basic") UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Quest|Basic")

View File

@ -17,11 +17,6 @@ void UGameInfoManager::Initialize(FSubsystemCollectionBase& Collection)
} }
} }
void UGameInfoManager::NewSaveGame()
{
UGameplayStatics::DeleteGameInSlot(SaveGameSlotName, 0);
}
void UGameInfoManager::SaveGameInfo() void UGameInfoManager::SaveGameInfo()
{ {
if (!IsValid(PlayerInfo.Get())) if (!IsValid(PlayerInfo.Get()))

View File

@ -18,8 +18,6 @@ public:
virtual void Initialize(FSubsystemCollectionBase& Collection) override; virtual void Initialize(FSubsystemCollectionBase& Collection) override;
public: public:
UFUNCTION(BlueprintCallable)
void NewSaveGame();
UFUNCTION(BlueprintCallable) UFUNCTION(BlueprintCallable)
void SaveGameInfo(); void SaveGameInfo();
UFUNCTION(BlueprintCallable) UFUNCTION(BlueprintCallable)
@ -32,6 +30,5 @@ public:
protected: protected:
UPROPERTY(BlueprintReadOnly) UPROPERTY(BlueprintReadOnly)
TObjectPtr<class UPlayerInfoSaveGame> PlayerInfo; TObjectPtr<class UPlayerInfoSaveGame> PlayerInfo;
static FString SaveGameSlotName; static FString SaveGameSlotName;
}; };

View File

@ -140,12 +140,13 @@ bool UQuestManager::CompleteQuest(int32 QuestID)
// 触发事件 // 触发事件
OnQuestStateChanged.Broadcast(QuestID); OnQuestStateChanged.Broadcast(QuestID);
UE_LOG(LogTemp, Warning, TEXT("Quest id = %d Complete"), QuestID); UE_LOG(LogTemp, Warning, TEXT("Quest id = %d Complete"), QuestID);
// // 从活动任务中移除 // 从活动任务中移除
// ActiveQuestsMap.Remove(QuestID); ActiveQuestsMap.Remove(QuestID);
//更新存档数据 //更新存档数据
GetGameInstance()->GetSubsystem<UGameInfoManager>()->SaveGameInfo(); GetGameInstance()->GetSubsystem<UGameInfoManager>()->SaveGameInfo();
//检测是否有其他可接受的任务
CheckAcceptableQuests();
return true; return true;
} }
@ -220,9 +221,6 @@ void UQuestManager::UpdateObjectiveByTargetID(FGameplayTag TargetTag, int32 Prog
} }
} }
} }
//检测是否有其他可接受的任务
CheckAcceptableQuests();
} }
EQuestState UQuestManager::GetQuestState(int32 QuestID) const EQuestState UQuestManager::GetQuestState(int32 QuestID) const
@ -354,7 +352,6 @@ TArray<FQuestSaveData> UQuestManager::GetQuestSaveData() const
SaveDataArray.Add(SaveData); SaveDataArray.Add(SaveData);
} }
return SaveDataArray; return SaveDataArray;
} }