private void onDialogueTextPhaseHandler(DialoguerTextData data) { _currentChoice = 0; if (data.choices != null) { _choices = new string[6]; for (int i = 0; i < 6; i += 1) { if (data.choices.Length > i && data.choices[i] != null) { _choices[i] = data.choices[i]; _currentChoice = i; } } } else { _choices = null; } _text = data.text; if (data.name != null && data.name != string.Empty) { _text = data.name + ": " + _text; } _showWindow = true; }
private void onTextPhaseHandler(DialoguerTextData data){ _guiColor = GUI.contentColor; _windowText = data.text; if(data.windowType == DialoguerTextPhaseType.Text){ _choices = new string[1] {"Continue"}; }else{ _choices = data.choices; } // Set the color switch(data.theme){ case "bad": _guiColor = Color.red; break; case "good": _guiColor = Color.green; break; default: _guiColor = GUI.contentColor; break; } _windowShowing = true; _selectionClicked = false; }
private void onTextPhaseHandler(DialoguerTextData data) { _guiColor = GUI.contentColor; _windowText = data.text; if (data.windowType == DialoguerTextPhaseType.Text) { _choices = new string[1] { "Continue" }; } else { _choices = data.choices; } // Set the color switch (data.theme) { case "bad": _guiColor = Color.red; break; case "good": _guiColor = Color.green; break; default: _guiColor = GUI.contentColor; break; } _windowShowing = true; _selectionClicked = false; }
/// <summary>DO NOT USE, USED FOR DIALOGUER INTERNAL</summary> public void handler_TextPhase(DialoguerTextData data) { if (onTextPhase != null) { onTextPhase(data); } }
public static void dispatchOnTextPhase(DialoguerTextData data) { if (onTextPhase != null) { onTextPhase(data); } }
private void onDialogueTextPhaseHandler(DialoguerTextData data) { _usingPositionRect = data.usingPositionRect; _positionRect = data.rect; _windowCurrentText = string.Empty; _windowTargetText = data.text; _nameText = data.name; _showDialogueBox = true; _isBranchedText = data.windowType == DialoguerTextPhaseType.BranchedText; _branchedTextChoices = data.choices; _currentChoice = 0; if (data.theme != _theme) { resetWindowSize(); } _theme = data.theme; startWindowTweenIn(); }
private void onTextPhase(DialoguerTextData data) { foreach (Button button in options) { button.gameObject.SetActive(false); button.onClick.RemoveAllListeners(); } if(!string.IsNullOrEmpty(data.name)) name = data.name; message = data.text; choices = data.choices; // We want to resize the choices box depending on how many we have - we're only using the last 2 buttons, so that we don't have to rescale them if (data.windowType == DialoguerTextPhaseType.Text) choices = new string[1] { "Continue" }; if(choices.Length == 1) { // We already have the ui set out for this } else if (choices.Length == 2) { options[2].GetComponentInChildren<Text>().text = choices[0]; options[2].gameObject.SetActive(true); options[2].onClick.AddListener(Option1Click); options[3].GetComponentInChildren<Text>().text = choices[1]; options[3].gameObject.SetActive(true); options[3].onClick.AddListener(Option2Click); } else if (choices.Length == 3) { options[1].GetComponentInChildren<Text>().text = choices[0]; options[1].gameObject.SetActive(true); options[1].onClick.AddListener(Option1Click); options[2].GetComponentInChildren<Text>().text = choices[1]; options[2].gameObject.SetActive(true); options[2].onClick.AddListener(Option2Click); options[3].GetComponentInChildren<Text>().text = choices[2]; options[3].gameObject.SetActive(true); options[3].onClick.AddListener(Option3Click); } else { for (int i = 0; i < choices.Length; i++) { options[i].GetComponentInChildren<Text>().text = choices[i]; options[i].gameObject.SetActive(true); } options[0].onClick.AddListener(Option1Click); options[1].onClick.AddListener(Option2Click); options[2].onClick.AddListener(Option3Click); options[3].onClick.AddListener(Option4Click); } dialogueText.text = message; dialogueTitle.text = name; windowVisible = true; }
private void onTextPhaseHandler(DialoguerTextData data){ //Debug.Log ("[GUI Manager] Text Phase"); _windowText = data.text; if(data.windowType == DialoguerTextPhaseType.Text){ _choices = new string[1] {"Continue"}; }else{ _choices = data.choices; } _windowShowing = true; _selectionClicked = false; }
public void OnTextPhase(DialoguerTextData data) { gameObject.SetActive(true); isTextNode = true; // Init dialogue data characterName.text = data.name; targetText = data.text; // Loading any new dialogue options isBranchedText = (data.windowType == DialoguerTextPhaseType.BranchedText); if (isBranchedText) { optionsPanel.gameObject.SetActive(false); branchedTextChoices = data.choices; for (int i = 0; i < branchedTextChoices.Length; ++i) { // Setup button GameObject option = GameObject.Instantiate(dialogueOptionPrefab) as GameObject; option.GetComponent <Text>().text = branchedTextChoices[i]; option.transform.SetParent(optionsPanel); option.name = i.ToString(); optionGameObjects.Add(option); option.GetComponent <Button>().onClick.AddListener(delegate { OnOptionSelect(option); }); // Set up event on hover callback EventTrigger trigger = option.GetComponent <EventTrigger>(); EventTrigger.Entry entry = new EventTrigger.Entry(); entry.eventID = EventTriggerType.PointerEnter; entry.callback = new EventTrigger.TriggerEvent(); entry.callback.AddListener(delegate { OnOptionEnter(option); }); trigger.triggers.Add(entry); } float buttonY = optionGameObjects[0].transform.position.y; optionPointer.position = new Vector3(optionPointer.position.x, buttonY, optionPointer.position.z); currentBranchChoice = 0; //optionPointer.gameObject.SetActive(false); } else { Vector3 vec = continuePrompt.transform.position; vec.x = origContinuePosX; continuePrompt.transform.position = vec; continuePrompt.gameObject.SetActive(false); } // Set portrait if any SetPortrait(data.portrait); showDialogueBox = true; }
private void OnTextPhase(DialoguerTextData data) { // Debug.Log (data.choices); choices = data.choices; text = data.text; // endButton.SetActive (true); if (choices == null) { // continueButton.SetActive(true); } obsTextC.text = text; // obsText.GetComponentInChildren<Text> ().text = text; }
private void onTextPhaseHandler(DialoguerTextData data) { //Debug.Log ("[GUI Manager] Text Phase"); _windowText = data.text; if (data.windowType == DialoguerTextPhaseType.Text) { _choices = new string[1] { "Continue" }; } else { _choices = data.choices; } _windowShowing = true; _selectionClicked = false; }
private void onDialogueTextPhaseHandler(DialoguerTextData data){ _currentChoice = 0; if(data.choices != null){ _choices = new string[6]; for(int i = 0; i<6; i+=1){ if(data.choices.Length > i && data.choices[i] != null){ _choices[i] = data.choices[i]; _currentChoice = i; } } }else{ _choices = null; } _text = data.text; if(data.name != null && data.name != string.Empty) _text = data.name + ": "+_text; _showWindow = true; }
private void onDialogueTextPhaseHandler(DialoguerTextData data) { _windowCurrentText = string.Empty; _windowTargetText = data.text; _nameText = data.name; _showDialogueBox = true; _isBranchedText = data.windowType == DialoguerTextPhaseType.BranchedText; _branchedTextChoices = data.choices; // Parse the metadata _metadata = data.metadata; _parsedmetadata = parseString(data.metadata.Split(' ')); if (uiroot != null) { uiroot.scalingStyle = UIRoot.Scaling.FixedSize; uiroot.manualHeight = 600; uiroot.transform.Find("Conversation Bubble").transform.localScale = new Vector3(0.6f, 0.6f, 1f); } }
private void onTextPhase(DialoguerTextData data) { _text = data.text; _dialogueText.GetComponent <Text> ().text = data.text; _choices = data.choices; _theme = data.theme; _portrait = data.portrait; //Debug.Log (data.portrait); if (_theme == "Good") { isGood = true; } else if (_theme == "Bad") { isGood = false; } else { Debug.Log("Theme is neither 'Good' or 'Bad'. Check Dialogue Tree"); } }
/// <summary>DO NOT USE, USED FOR DIALOGUER INTERNAL</summary> public void handler_TextPhase(DialoguerTextData data){ if(onTextPhase != null) onTextPhase(data); }
private void onTextPhase(DialoguerTextData data) { _text = data.text; _dialogueText.GetComponent<Text> ().text = data.text; _choices = data.choices; _theme = data.theme; _portrait = data.portrait; if (_theme == "Good") { isGood = true; } else if (_theme == "Bad") { isGood = false; } else { Debug.Log("Theme is neither 'Good' or 'Bad'. Check Dialogue Tree"); } if (isGood) { _goodBackgroundAndPortrait.SetActive (true); _badBackgroundAndPortrait.SetActive (false); } else { _goodBackgroundAndPortrait.SetActive (false); _badBackgroundAndPortrait.SetActive (true); } SetPortrait (); if (_choices == null || _choices.Length < 1) { for(int i = 0; i < _choiceButtons.Length; i++) { _choiceButtons[i].SetActive (false); } ShowContinueButton(); } else { for(int i = 0; i < _choices.Length; i++) { //Debug.Log (_choices[i]); _choiceButtons[i].SetActive (true); _choiceButtons[i].transform.FindChild ("Text").GetComponent<Text>().text = _choices[i]; } HideContinueButton(); } }
// Called when dialoguer is serving new text data private void onTextPhase(DialoguerTextData data) { // Store text data from current phase _text = data.text; _choices = data.choices; }
private void onTextPhase(DialoguerTextData data){ text = data.text; }
private void onDialogueTextPhaseHandler(DialoguerTextData data){ _windowCurrentText = string.Empty; _windowTargetText = data.text; _nameText = data.name; _showDialogueBox = true; _isBranchedText = data.windowType == DialoguerTextPhaseType.BranchedText; _branchedTextChoices = data.choices; // Parse the metadata _metadata = data.metadata; _parsedmetadata = parseString(data.metadata.Split(' ')); if (uiroot != null) { uiroot.scalingStyle = UIRoot.Scaling.FixedSize; uiroot.manualHeight = 600; uiroot.transform.Find("Conversation Bubble").transform.localScale = new Vector3(0.6f, 0.6f, 1f); } }
/// <summary> /// Method called when text is to be displayed. /// /// </summary> /// <param name="data">The actual text data that needs to be displayed on screen.</param> private void OnTextPhase(DialoguerTextData data) { dialogueText = data.text; }
public static void dispatchOnTextPhase(DialoguerTextData data){ if(onTextPhase != null) onTextPhase(data); }
public TextPhase(string text, string themeName, bool newWindow, string name, string portrait, string metadata, string audio, float audioDelay, Rect rect, List <int?> outs, List <string> choices = null) : base(outs) { data = new DialoguerTextData(text, themeName, newWindow, name, portrait, metadata, audio, audioDelay, rect, choices); }
private void EventsOnOnTextPhase(DialoguerTextData data) { text.text = data.text; }
void onTextPhase(DialoguerTextData data) { dialoguePanelContents.text = data.text; dialogueSpeakerName.text = data.name; }
public TextPhase(string text, string themeName, bool newWindow, string name, string portrait, string metadata, string audio, float audioDelay, Rect rect, List<int> outs, List<string> choices, int dialogueID, int nodeID) : base(outs){ data = new DialoguerTextData(text, themeName, newWindow, name, portrait, metadata, audio, audioDelay, rect, choices, dialogueID, nodeID); }
private void onTextPhase(DialoguerTextData data) { _text = data.text; _choices = data.choices; }
void onTextPhase(DialoguerTextData data) { _text = data.text; }
private void onTextPhase(DialoguerTextData data) { state = "dialog"; _text = data.text; _choices = data.choices; }
private void onDialogueTextPhaseHandler(DialoguerTextData data) { _usingPositionRect = data.usingPositionRect; _positionRect = data.rect; _windowCurrentText = string.Empty; _windowTargetText = data.text; _nameText = data.name; _showDialogueBox = true; _isBranchedText = data.windowType == DialoguerTextPhaseType.BranchedText; _branchedTextChoices = data.choices; _currentChoice = 0; if(data.theme != _theme){ resetWindowSize(); } _theme = data.theme; startWindowTweenIn(); }
void onTextPhase(DialoguerTextData data) { portrait = data.portrait; }