Esempio n. 1
0
        override public void ShowGUI()
        {
            speechMenuLimit = (SpeechMenuLimit)EditorGUILayout.EnumPopup("Speech to stop:", speechMenuLimit);
            forceMenus      = EditorGUILayout.Toggle("Force off subtitles?", forceMenus);

            AfterRunningOption();
        }
Esempio n. 2
0
        /**
         * <summary>Creates a new instance of the 'Dialogue: Stop speech' Action</summary>
         * <param name = "speechToStop">The type of speech to stop</param>
         * <param name = "charactersToStop">The type of speaking characters to Stop</param>
         * <param name = "specificCharacters">The specific characters, separated by colons</param>
         * <param name = "forceOffSubtitles">If True, then any subtitles associated with the speech will be turned off</param>
         * <returns>The generated Action</returns>
         */
        public static ActionSpeechStop CreateNew(SpeechMenuLimit speechToStop, SpeechMenuType charactersToStop, string specificCharacters = "", bool forceOffSubtitles = false)
        {
            ActionSpeechStop newAction = (ActionSpeechStop)CreateInstance <ActionSpeechStop>();

            newAction.speechMenuLimit   = speechToStop;
            newAction.speechMenuType    = charactersToStop;
            newAction.limitToCharacters = specificCharacters;
            newAction.forceMenus        = forceOffSubtitles;
            return(newAction);
        }
Esempio n. 3
0
        /**
         * <summary>Kills all active Speech lines.</summary>
         * <param name = "stopCharacter">If True, then all characters speaking will cease their talking animation</param>
         * <param name = "forceMenusOff">True if subtitles should be turned off immediately</param>
         * <param name = "speechMenuLimit">The type of speech to kill (All, BlockingOnly, BackgroundOnly)</param>
         */
        public void KillDialog(bool stopCharacter, bool forceMenusOff, SpeechMenuLimit speechMenuLimit = SpeechMenuLimit.All)
        {
            for (int i = 0; i < speechList.Count; i++)
            {
                if (speechMenuLimit == SpeechMenuLimit.All ||
                    (speechMenuLimit == SpeechMenuLimit.BackgroundOnly && speechList[i].isBackground) ||
                    (speechMenuLimit == SpeechMenuLimit.BlockingOnly && !speechList[i].isBackground))
                {
                    EndSpeech(i, stopCharacter);
                    i = 0;
                }
            }

            KickStarter.stateHandler.UpdateAllMaxVolumes();
            if (forceMenusOff)
            {
                KickStarter.playerMenus.ForceOffSubtitles();
            }
        }
Esempio n. 4
0
        override public void ShowGUI()
        {
            speechMenuLimit = (SpeechMenuLimit)EditorGUILayout.EnumPopup("Speech to stop:", speechMenuLimit);
            speechMenuType  = (SpeechMenuType)EditorGUILayout.EnumPopup("Characters to stop", speechMenuType);

            if (speechMenuType == SpeechMenuType.SpecificCharactersOnly)
            {
                limitToCharacters = EditorGUILayout.TextField("Character(s) to stop:", limitToCharacters);
                EditorGUILayout.HelpBox("Multiple character names should be separated by a colon ';'", MessageType.Info);
            }
            else if (speechMenuType == SpeechMenuType.AllExceptSpecificCharacters)
            {
                limitToCharacters = EditorGUILayout.TextField("Character(s) to not stop:", limitToCharacters);
                EditorGUILayout.HelpBox("Multiple character names should be separated by a colon ';'", MessageType.Info);
            }

            forceMenus = EditorGUILayout.Toggle("Force off subtitles?", forceMenus);

            AfterRunningOption();
        }
Esempio n. 5
0
        /**
         * <summary>Kills all active Speech lines.</summary>
         * <param name = "stopCharacter">If True, then all characters speaking will cease their talking animation</param>
         * <param name = "forceMenusOff">True if subtitles should be turned off immediately</param>
         * <param name = "speechMenuLimit">The type of speech to kill (All, BlockingOnly, BackgroundOnly)</param>
         */
        public void KillDialog(bool stopCharacter, bool forceMenusOff, SpeechMenuLimit speechMenuLimit = SpeechMenuLimit.All, SpeechMenuType speechMenuType = SpeechMenuType.All, string limitToCharacters = "")
        {
            bool hadEffect = false;

            for (int i = 0; i < speechList.Count; i++)
            {
                if (speechList[i].HasConditions(speechMenuLimit, speechMenuType, limitToCharacters))
                {
                    EndSpeech(i, stopCharacter);
                    hadEffect = true;
                    i         = 0;
                }
            }

            if (hadEffect)
            {
                KickStarter.stateHandler.UpdateAllMaxVolumes();
                if (forceMenusOff)
                {
                    KickStarter.playerMenus.ForceOffSubtitles();
                }
            }
        }