完善追踪任务UI
This commit is contained in:
parent
1ccc1d8796
commit
111f68fa10
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -257,6 +257,19 @@ TArray<UQuestAsset*> UQuestManager::GetActiveQuests() const
|
|||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TArray<UQuestAsset*> UQuestManager::GetFollowingQuests() const
|
||||||
|
{
|
||||||
|
TArray<UQuestAsset*> Result;
|
||||||
|
for (const TPair<int32, FQuestRuntimeData>& Pair : ActiveQuestsMap)
|
||||||
|
{
|
||||||
|
if (FollowingQuestIDs.Contains(Pair.Key))
|
||||||
|
{
|
||||||
|
Result.Add(Pair.Value.QuestAsset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Result;
|
||||||
|
}
|
||||||
|
|
||||||
TArray<UQuestAsset*> UQuestManager::GetCompletedQuests() const
|
TArray<UQuestAsset*> UQuestManager::GetCompletedQuests() const
|
||||||
{
|
{
|
||||||
TArray<UQuestAsset*> Result;
|
TArray<UQuestAsset*> Result;
|
||||||
@ -281,6 +294,17 @@ bool UQuestManager::GetQuestProgress(int32 QuestID, TArray<FQuestProgress>& OutP
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool UQuestManager::GetQuestRuntimeData(int32 QuestID, FQuestRuntimeData& OutData) const
|
||||||
|
{
|
||||||
|
const FQuestRuntimeData* RuntimeData = ActiveQuestsMap.Find(QuestID);
|
||||||
|
if (RuntimeData)
|
||||||
|
{
|
||||||
|
OutData = *RuntimeData;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool UQuestManager::CanAcceptQuest(UQuestAsset* QuestAsset) const
|
bool UQuestManager::CanAcceptQuest(UQuestAsset* QuestAsset) const
|
||||||
{
|
{
|
||||||
if (!QuestAsset)
|
if (!QuestAsset)
|
||||||
@ -353,7 +377,7 @@ void UQuestManager::LoadFromSaveData(const TArray<FQuestSaveData>& SaveData)
|
|||||||
if (questAsset->QuestID == Data.QuestID)
|
if (questAsset->QuestID == Data.QuestID)
|
||||||
{
|
{
|
||||||
FQuestRuntimeData RuntimeData = CreateRuntimeData(questAsset);
|
FQuestRuntimeData RuntimeData = CreateRuntimeData(questAsset);
|
||||||
for (int i =0; i < RuntimeData.ObjectiveProgress.Num(); i++)
|
for (int i =0; i < Data.ObjectiveProgress.Num(); i++)
|
||||||
{
|
{
|
||||||
RuntimeData.ObjectiveProgress[i].CurrentProgress = Data.ObjectiveProgress[i];
|
RuntimeData.ObjectiveProgress[i].CurrentProgress = Data.ObjectiveProgress[i];
|
||||||
RuntimeData.ObjectiveProgress[i].bCompleted = Data.ObjectiveCompleted[i];
|
RuntimeData.ObjectiveProgress[i].bCompleted = Data.ObjectiveCompleted[i];
|
||||||
|
|||||||
@ -95,6 +95,10 @@ public:
|
|||||||
UFUNCTION(BlueprintPure, Category = "Quest")
|
UFUNCTION(BlueprintPure, Category = "Quest")
|
||||||
TArray<UQuestAsset*> GetActiveQuests() const;
|
TArray<UQuestAsset*> GetActiveQuests() const;
|
||||||
|
|
||||||
|
/** 获取所有追踪的任务 */
|
||||||
|
UFUNCTION(BlueprintPure, Category = "Quest")
|
||||||
|
TArray<UQuestAsset*> GetFollowingQuests() const;
|
||||||
|
|
||||||
/** 获取所有已完成的任务 */
|
/** 获取所有已完成的任务 */
|
||||||
UFUNCTION(BlueprintPure, Category = "Quest")
|
UFUNCTION(BlueprintPure, Category = "Quest")
|
||||||
TArray<UQuestAsset*> GetCompletedQuests() const;
|
TArray<UQuestAsset*> GetCompletedQuests() const;
|
||||||
@ -103,6 +107,10 @@ public:
|
|||||||
UFUNCTION(BlueprintPure, Category = "Quest")
|
UFUNCTION(BlueprintPure, Category = "Quest")
|
||||||
bool GetQuestProgress(int32 QuestID, TArray<FQuestProgress>& OutProgress) const;
|
bool GetQuestProgress(int32 QuestID, TArray<FQuestProgress>& OutProgress) const;
|
||||||
|
|
||||||
|
/** 获取任务进度 */
|
||||||
|
UFUNCTION(BlueprintPure, Category = "Quest")
|
||||||
|
bool GetQuestRuntimeData(int32 QuestID, FQuestRuntimeData& OutData) const;
|
||||||
|
|
||||||
/** 检查是否可以接受任务(前置任务检查) */
|
/** 检查是否可以接受任务(前置任务检查) */
|
||||||
UFUNCTION(BlueprintPure, Category = "Quest")
|
UFUNCTION(BlueprintPure, Category = "Quest")
|
||||||
bool CanAcceptQuest(UQuestAsset* QuestAsset) const;
|
bool CanAcceptQuest(UQuestAsset* QuestAsset) const;
|
||||||
@ -140,7 +148,7 @@ private:
|
|||||||
TMap<int32, FQuestRuntimeData> ActiveQuestsMap;
|
TMap<int32, FQuestRuntimeData> ActiveQuestsMap;
|
||||||
|
|
||||||
/** 正在追踪的任务列表 */
|
/** 正在追踪的任务列表 */
|
||||||
UPROPERTY()
|
UPROPERTY(BlueprintReadOnly, meta = (AllowPrivateAccess = true))
|
||||||
TSet<int32> FollowingQuestIDs;
|
TSet<int32> FollowingQuestIDs;
|
||||||
|
|
||||||
/** 已完成的任务ID列表 */
|
/** 已完成的任务ID列表 */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user