更新任务列表UI
This commit is contained in:
parent
8917abed28
commit
3c084a8795
Binary file not shown.
Binary file not shown.
BIN
ProjectFish/Content/UI/Quest/Widget/UMG_Quest_Switcher.uasset
Normal file
BIN
ProjectFish/Content/UI/Quest/Widget/UMG_Quest_Switcher.uasset
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -10,6 +10,7 @@ FString UGameInfoManager::SaveGameSlotName = TEXT("GameInfo");
|
|||||||
void UGameInfoManager::Initialize(FSubsystemCollectionBase& Collection)
|
void UGameInfoManager::Initialize(FSubsystemCollectionBase& Collection)
|
||||||
{
|
{
|
||||||
Super::Initialize(Collection);
|
Super::Initialize(Collection);
|
||||||
|
Collection.InitializeDependency<UQuestManager>();
|
||||||
if (!LoadGameInfo())
|
if (!LoadGameInfo())
|
||||||
{
|
{
|
||||||
UE_LOG(LogTemp, Warning, TEXT("本地存档不存在加载失败"));
|
UE_LOG(LogTemp, Warning, TEXT("本地存档不存在加载失败"));
|
||||||
@ -54,16 +55,18 @@ bool UGameInfoManager::LoadGameInfo()
|
|||||||
{
|
{
|
||||||
QuestManager->LoadFromSaveData(PlayerInfo->QuestSaveData);
|
QuestManager->LoadFromSaveData(PlayerInfo->QuestSaveData);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
TArray<FQuestSaveData> SaveData;
|
|
||||||
QuestManager->LoadFromSaveData(SaveData);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 加载任务数据
|
||||||
|
if (UQuestManager* QuestManager = GetGameInstance()->GetSubsystem<UQuestManager>())
|
||||||
|
{
|
||||||
|
TArray<FQuestSaveData> SaveData;
|
||||||
|
QuestManager->LoadFromSaveData(SaveData);
|
||||||
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -48,7 +48,7 @@ void UQuestManager::CheckAcceptableQuests()
|
|||||||
{
|
{
|
||||||
for (auto QuestAsset : QuestAssets)
|
for (auto QuestAsset : QuestAssets)
|
||||||
{
|
{
|
||||||
if (!ActiveQuestsMap.Find(QuestAsset->QuestID) && CompletedQuestIDs.Contains(QuestAsset->QuestID))
|
if (!ActiveQuestsMap.Find(QuestAsset->QuestID) && !CompletedQuestIDs.Contains(QuestAsset->QuestID))
|
||||||
{
|
{
|
||||||
//任务不在当前已激活的任务 和 已完成的任务列表中
|
//任务不在当前已激活的任务 和 已完成的任务列表中
|
||||||
AcceptQuest(QuestAsset);
|
AcceptQuest(QuestAsset);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user