I was wondering if there was a way to attach an image to a Quest and have it displayed on the Standard Quest Log UI, the way you can define its Name, Description and Entries. I want to have unique splash art for each quests, similar to how Dragon Age Inquisition does it for theirs. I did try creating a custom field using the dialogue system to maybe slot images in, but I had no way of actually calling it in the Standard Quest Log UI.
In version 3, this will be built in. Until then, you can put an image in a Resources folder and add the image's filename to a custom field in your quest. Then make a subclass of StandardUIQuestLogWindow and override the RepaintSelectedQuest() method. Also add a variable for the splash art UI Image that you can assign in the inspector. In the RepaintSelectedQuest() method, set the UI Image. Something like:
using UnityEngine;
using UnityEngine.UI;
using PixelCrushers.DialogueSystem;
public class SplashArtQuestLogWindow : StandardUIQuestLogWindow
{
public Image splashImage;
protected override void RepaintSelectedQuest(QuestInfo quest)
{
// Get the quest's image name from the custom field "SplashImage":
var imageName = DialogueLua.GetQuestField(quest.Title, "SplashImage").asString;
// Load the image from Resources and set the UI Image:
splashImage.sprite = Resources.Load<Sprite>(imageName);
base.RepaintSelectedQuest(quest);
}
}
Thanks for getting back! Once I've made this subclass, do I use this new component instead of the StandardUIQuestLogWindow? Or do I use both in tandem, simply using the new one for the Image field?