public DialogueLineParsed LoadNextDialogueLine() { _index++; _currentDialogueLineParsed = DialogueParser.GetDialogueLineParsed(_dialogueLines [_index]); checkCmd(); return(_currentDialogueLineParsed); }
public void Populate() { _events.RemoveAll(e => e.getIsEnded()); //remove all events that has ended if (_events.Count < 1) //check if event is over(empty) { _dialogueCanvas.gameObject.SetActive(false); // displayDialoguePane (false, _currPane); GameController.GC.SetIsControlAllowed(true); AIController.AIC.SetIsAIMovementAllowed(true); return; } //load & populate GUI DialogueLineParsed dlp = _events [0].LoadNextDialogueLine(); // _normalDialogueGroup.loadPortrait (dlp.Name, dlp.SpeakerPosition); // _normalDialogueGroup.loadDialogue (dlp); if (isEventPopup()) //Pop-up dialogue, don't pause gameplay { dialogueTime = 2.0f; //reset timer until next line _popupDialogueGroup.loadPortrait(dlp.Name, dlp.SpeakerPosition); _popupDialogueGroup.loadDialogue(dlp); //TO DO: Load separate canvas group for Normal vs. Pop-up } else //Normal dialogue, pause gameplay { GameController.GC.SetIsControlAllowed(false); AIController.AIC.SetIsAIMovementAllowed(false); _normalDialogueGroup.loadPortrait(dlp.Name, dlp.SpeakerPosition); _normalDialogueGroup.loadDialogue(dlp); } // _currPane.loadPortrait (dlp.Name, dlp.SpeakerPosition); // _currPane.loadDialogue (dlp); // displayDialoguePane (true, _currPane); // _dialogueTextLeft.text = dlp.Dialogue; // loadPortrait (dlp.Name, dlp.SpeakerPosition); // loadDialogue (dlp); _dialogueCanvas.gameObject.SetActive(true); }
public void loadDialogue(DialogueLineParsed dlp) { if (dlp.SpeakerPosition == DIALOGUE_SPEAKER_POSITION.LEFT) { _nameTextLeft.text = dlp.Name; _dialogueTextLeft.text = dlp.Dialogue; //set left side _nameTextRight.text = ""; _dialogueTextRight.text = ""; _speakerLeft.enabled = true; // _speakerRight.enabled = false; _backgroundLeft.enabled = true; _backgroundRight.enabled = false; _speakerLeft.color = new Color32(255, 255, 255, 255); greyImage(_speakerRight); // _speakerRight.color = new Color32 (100, 100, 100, 255); } else if (dlp.SpeakerPosition == DIALOGUE_SPEAKER_POSITION.RIGHT) { _nameTextLeft.text = ""; _dialogueTextLeft.text = ""; _nameTextRight.text = dlp.Name; _dialogueTextRight.text = dlp.Dialogue; //set right side _speakerRight.enabled = true; // _speakerLeft.enabled = false; _backgroundRight.enabled = true; _backgroundLeft.enabled = false; greyImage(_speakerLeft); // _speakerLeft.color = new Color32(100,100,100,255); _speakerRight.color = new Color32(255, 255, 255, 255); } else { _speakerLeft.enabled = false; _speakerRight.enabled = false; } }