diff --git a/QuestValidator/Program.cs b/QuestValidator/Program.cs index ea88849..11c776c 100644 --- a/QuestValidator/Program.cs +++ b/QuestValidator/Program.cs @@ -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 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 questData, QuestRoot liveQuestData) { var missingQuests = new List(); @@ -435,7 +456,7 @@ namespace QuestValidator CheckValuesMatch(availableForFinishItem._props.parentId, liveFinishItem._props.parentId, "AvailableForFinish parentId mismatch", availableForFinishItem._props.id); // check AvailableForFinish resetOnSessionEnd - CheckValuesMatch(availableForFinishItem._props.resetOnSessionEnd.Value, liveFinishItem._props.resetOnSessionEnd.Value, "AvailableForFinish resetOnSessionEnd value mismatch", availableForFinishItem._props.id); + CheckValuesMatch(availableForFinishItem._props.resetOnSessionEnd.Value, liveFinishItem._props.resetOnSessionEnd.Value, "AvailableForFinish resetOnSessionEnd value mismatch", availableForFinishItem._props.id); // check AvailableForFinish target CheckValuesMatch(Convert.ToString(availableForFinishItem._props.target), Convert.ToString(liveFinishItem._props.target), "AvailableForFinish target value mismatch", availableForFinishItem._props.id);