Add quest icon checking

This commit is contained in:
Chomp 2021-09-18 22:30:16 +01:00
parent ce14ef879c
commit 70f5907630

View File

@ -30,6 +30,8 @@ namespace QuestValidator
CheckForMissingQuestsInAkiFile(liveQuestData, questData);
CheckForMissingQuestIcons(questData);
foreach (var item in questData)
{
var quest = item.Value;
@ -58,6 +60,25 @@ namespace QuestValidator
}
}
private static void CheckForMissingQuestIcons(Dictionary<string, Quest> questData)
{
string iconPath = "TODO add path here Server\\project\\assets\\images\\quests";
if (iconPath.Contains("TODO add path here"))
{
throw new Exception("Add the correct icon path to Program.cs");
}
foreach (var quest in questData)
{
var imageId = quest.Value.image.Split("/")[4].Split(".")[0];
if (!QuestHelper.DoesIconExist(iconPath, imageId))
{
LoggingHelpers.LogError($"ERROR - Quest {quest.Value.QuestName} is missing an icon file, add {imageId}.png");
}
}
}
private static void ListMissingQuestsInLive(Dictionary<string, Quest> questData, QuestRoot liveQuestData)
{
var missingQuests = new List<Quest>();