Recommended setup for multiple UIs (in-person + call)
Posted: Sat Sep 14, 2024 8:24 pm
TLDR: Trying to swap dialogue UI based on a conversation's custom field before it starts, regardless of how it starts. Is it possible? Is there a better way?
I'll explain why I'm trying to do that, and my current attempt.
I'm trying to set up two default modes of conversation, a regular in-person one and a call mode like the codec from the Metal Gear series. Another wrinkle is that I don't think the call mode UI should be done through a UI prefab - that UI will have multiple functions apart from the calling (think Fallout's Pip-Boy), so the plan is to keep it loaded additively in its own scene.
I started thinking it would be nice to only have to specify in the conversation editor whether it is a regular one or a call, instead of remembering to add an Override Dialogue UI somewhere every time a call conversation is being set up. I've already figured out how to add/read a custom bool to the conversations.
Then I looked for a way to call DialogueManager.UseDialogueUI() before any conversation was triggered (based on the conversation's custom bool), but I couldn't find any. I know of the OnConversationStart message, but at that point I think DialogueManager has already loaded the UI and started the conversation, so swapping the UI there didn't seem to work.
With my current attempt, I have a version of StandardDialogueUI that is a composite of two AbstractDialogueUIs (for in-person and for calling). I think with enough work I can figure it out, but so far it doesn't seem too straightforward, and it makes me wonder if my approach is wrong.
I'll explain why I'm trying to do that, and my current attempt.
I'm trying to set up two default modes of conversation, a regular in-person one and a call mode like the codec from the Metal Gear series. Another wrinkle is that I don't think the call mode UI should be done through a UI prefab - that UI will have multiple functions apart from the calling (think Fallout's Pip-Boy), so the plan is to keep it loaded additively in its own scene.
I started thinking it would be nice to only have to specify in the conversation editor whether it is a regular one or a call, instead of remembering to add an Override Dialogue UI somewhere every time a call conversation is being set up. I've already figured out how to add/read a custom bool to the conversations.
Then I looked for a way to call DialogueManager.UseDialogueUI() before any conversation was triggered (based on the conversation's custom bool), but I couldn't find any. I know of the OnConversationStart message, but at that point I think DialogueManager has already loaded the UI and started the conversation, so swapping the UI there didn't seem to work.
With my current attempt, I have a version of StandardDialogueUI that is a composite of two AbstractDialogueUIs (for in-person and for calling). I think with enough work I can figure it out, but so far it doesn't seem too straightforward, and it makes me wonder if my approach is wrong.