Hi,
Have searched around on the forum and looked through source code, but haven't found any really useful solution, so going to ask here:
Is there a reasonably simple/clean way to include mini portraits for individual response buttons when responses from more than one player character are available?
My concrete use case is a game where the player controls a party consisting of several different characters (all marked as players in the dialogue database) and I would like to make it visible to the player which character is going to speak if that button is clicked.
Hope that makes sense - if not, I can throw together a quick visual mock-up of the thing I have in mind.
/Snebjørn
Portraits with response buttons when using multiple player characters
Re: Portraits with response buttons when using multiple player characters
Hi,
Here's an example: MenuButtonPortraitsExample_2018-11-04.unitypackage
Assuming you're using the Standard Dialogue UI, replace your StandardUIResponseButton with this custom subclass:
CustomResponseButton.cs
Here's an example: MenuButtonPortraitsExample_2018-11-04.unitypackage
Assuming you're using the Standard Dialogue UI, replace your StandardUIResponseButton with this custom subclass:
CustomResponseButton.cs
Code: Select all
using PixelCrushers.DialogueSystem;
public class CustomResponseButton : StandardUIResponseButton
{
public UnityEngine.UI.Image image;
private void OnEnable()
{
if (response != null)
{
var actor = DialogueManager.masterDatabase.GetActor(response.destinationEntry.ActorID);
image.sprite = UITools.CreateSprite(actor.portrait);
}
}
}
Re: Portraits with response buttons when using multiple player characters
Wow, that was absurdly fast - and exactly what I was looking for - you're the best!
/Snebjørn
/Snebjørn