I am using the VN framework and attempting to make it more clear that the Auto Play button toggle is on or off. I want the normalColor of the button to be a darker color when autoplay is enabled and reset to the original value (white) when it is disabled.
I thought I could achieve this by modifying the ToggleAutoPlay method in the ConversationController script by changing the normalColor of the button inside the newMode if statement check since it is called every time the button is clicked. However, the behavior is a bit strange.
Code: Select all
public Button toggleAutoPlayButton;
public virtual void ToggleAutoPlay()
{
var mode = DialogueManager.displaySettings.subtitleSettings.continueButton;
var newMode = (mode == DisplaySettings.SubtitleSettings.ContinueButtonMode.Optional) ? DisplaySettings.SubtitleSettings.ContinueButtonMode.Always : DisplaySettings.SubtitleSettings.ContinueButtonMode.Optional;
DialogueManager.displaySettings.subtitleSettings.continueButton = newMode;
ColorBlock cb = toggleAutoPlayButton.colors;
if (newMode == DisplaySettings.SubtitleSettings.ContinueButtonMode.Optional){
cb.normalColor = new Color(0.5f, 0.5f, 0.5f, 1);
dialogueUI.OnContinueConversation();
}
else
{
cb.normalColor = Color.white;
}
toggleAutoPlayButton.colors = cb;
}
When clicking the button and enabling autoplay, I see that the "continue button" section for the Dialogue System Controller Subtitle Settings becomes "optional" as expected on click However, the color of the button doesn't change or update until I click continue on the screen or a menu option at least once. The button then correctly stays the new color and autoplay functions as normal. If I click the button to disable autoplay, the normalColor correctly resets back to white on click.
I am not sure why the button is not updating to the new color at the same time that the Dialogue System Controller Subtitle Setting is changed.
Another question I had was that if I disable autoplay in the middle of the dialogue typewriter animation still completing, it still autoplays that conversation node and loads up the next one. I am not sure if it is related to me changing the Default Sequence setting of the Camera and Cutscenes settings being set to Delay(1)@{{end}} (followed https://www.pixelcrushers.com/phpbb/viewtopic.php?t=925 as I wanted this timed behavior for the autoplay functionality) but I would like the autoplay on or off to be immediate.
Any help is appreciated!