2 questions regarding Quest Log Window
Posted: Mon Dec 02, 2019 2:19 pm
Good day!
I have 2 small questions for you:
I was able to independently add an image to the description of the quest. Did this by overriding the method: RepaintSelectedQuest
below code:
Now I need to add an image to the group button and the buttons of the quest itself. so that it would be attached directly to the group or quest. I define it in the database. How can I do it? already rummaged the entire forum.
and the second question: I really need to list not only active, but also completed and failed quests, how to do this without buttons?
Thanks in advance for your reply.
I have 2 small questions for you:
I was able to independently add an image to the description of the quest. Did this by overriding the method: RepaintSelectedQuest
below code:
Code: Select all
// Image:
var ImageTransform = questDetailsContentContainer.transform.Find("QuestImage");
var questImage = (ImageTransform != null) ? ImageTransform.GetComponent<UnityEngine.UI.Image>() : null;
if (questImage != null)
{
var spriteName = DialogueLua.GetQuestField(quest.Title, "Pictures").AsString;
var isSpriteNameSet = !string.IsNullOrEmpty(spriteName) && !string.Equals(spriteName, "nil");
var sprite = isSpriteNameSet ? DialogueManager.LoadAsset(spriteName, typeof(Sprite)) as Sprite : null;
if (isSpriteNameSet && sprite == null)
{
Debug.LogWarning("Dialogue System: " + name + " couldn't load image '" + spriteName + "' for quest '" + quest.Title + "'.", this);
}
questImage.gameObject.SetActive(sprite != null);
questImage.sprite = sprite;
}
and the second question: I really need to list not only active, but also completed and failed quests, how to do this without buttons?
Thanks in advance for your reply.