コード例 #1
0
        /// <summary>
        /// Create a jump dialog, which is an "invisible" dialog that is used to start a new sequence from a subdialog. Can be used to jump between different NPC dialogue branches.
        /// </summary>
        /// <param name="targetSequence">The name of the sequence that will start when this JumpDialog is "shown" to the player.</param>
        /// <param name="callbackExpression">A lua expression that will run when this dialog is shown to the player.</param>
        /// <returns>The constructed dialog</returns>
        public HybrasylDialog NewJumpDialog(string targetSequence, string callbackExpression = null)
        {
            var dialog = new JumpDialog(targetSequence);

            if (!string.IsNullOrEmpty(callbackExpression))
            {
                dialog.SetCallbackHandler(callbackExpression);
            }
            return(new HybrasylDialog(dialog));
        }
コード例 #2
0
ファイル: HybrasylWorld.cs プロジェクト: moseleyc/server
        /// <summary>
        /// Create a jump dialog, which is an "invisible" dialog that is used to start a new sequence from a subdialog. Can be used to jump between different NPC dialogue branches.
        /// </summary>
        /// <param name="targetSequence">The name of the sequence that will start when this JumpDialog is "shown" to the player.</param>
        /// <param name="callbackExpression">A lua expression that will run when this dialog is shown to the player.</param>
        /// <returns>The constructed dialog</returns>
        public HybrasylDialog NewJumpDialog(string targetSequence, string callbackExpression = null)
        {
            if (string.IsNullOrEmpty(targetSequence))
            {
                GameLog.ScriptingError("NewJumpDialog: target sequence (first argument) cannot be null or empty");
                return(null);
            }
            var dialog = new JumpDialog(targetSequence);

            if (!string.IsNullOrEmpty(callbackExpression))
            {
                dialog.SetCallbackHandler(callbackExpression);
            }
            return(new HybrasylDialog(dialog));
        }
コード例 #3
0
ファイル: Dialogs.cs プロジェクト: Jinori/server
 public void AddDialogOption(string option, JumpDialog jumpTo)
 {
     Options.Add(new DialogOption(option, jumpTo));
 }
コード例 #4
0
ファイル: Dialogs.cs プロジェクト: Jinori/server
 public DialogOption(string option, JumpDialog jumpTo, Dialog parentdialog = null)
 {
     OptionText   = option;
     JumpDialog   = jumpTo;
     ParentDialog = parentdialog;
 }