Esempio n. 1
0
        public HybrasylDialog NewTextDialog(string displayText, string topCaption, string bottomCaption, int inputLength = 254, dynamic handler = null, dynamic callback = null)
        {
            var dialog = new TextDialog(displayText, topCaption, bottomCaption, inputLength);

            dialog.setInputHandler(handler);
            dialog.SetCallbackHandler(callback);
            return(new HybrasylDialog(dialog));
        }
Esempio n. 2
0
        /// <summary>
        /// Create a new text dialog (a dialog that asks a player a question; the player can type in a response).
        /// </summary>
        /// <param name="displayText">The text to be displayed in the dialog</param>
        /// <param name="topCaption">The top caption of the text box input</param>
        /// <param name="bottomCaption">The bottom caption of the text box input</param>
        /// <param name="inputLength">The maximum length (up to 254 characters) of the text that can be typed into the dialog by the player</param>
        /// <param name="callback">The callback function or lua expression that will fire when this dialog is shown to a player.</param>
        /// <param name="handler">The function or lua expression that will handle the response once the player hits enter / hits next.</param>
        /// <returns>The constructed dialog</returns>
        public HybrasylDialog NewTextDialog(string displayText, string topCaption, string bottomCaption, int inputLength = 254, string callback = "", string handler = "")
        {
            if (string.IsNullOrEmpty(displayText))
            {
                GameLog.Error("NewTextDialog: display text (first argument) was null");
                return(null);
            }
            var dialog = new TextDialog(displayText, topCaption, bottomCaption, inputLength);

            dialog.SetInputHandler(handler);
            dialog.SetCallbackHandler(callback);
            return(new HybrasylDialog(dialog));
        }
Esempio n. 3
0
 public HybrasylDialog NewTextDialog(String displayText, String topCaption, string bottomCaption, int inputLength = 254, dynamic handler = null, dynamic callback = null)
 {
     var dialog = new TextDialog(displayText, topCaption, bottomCaption, inputLength);
     dialog.setInputHandler(handler);
     dialog.SetCallbackHandler(callback);
     return new HybrasylDialog(dialog);
 }