public void StartDialogue(string fn = "", int atIndex = -3) { if (fn != string.Empty) { FileName = fn; } if (FileName == string.Empty) { State = DlgState.Inactive; event_data[1].defined.Clear(); event_data[1].Set("message", "No filename specified"); _OnDialogueStartFailed(new DlgEvent(event_data), this); return; } if (!parent) { parent = gameObject; } if (OpenFile(atIndex)) { State = DlgState.Active; _OnDialogueStarted(new DlgEvent(event_data), this); } else { _OnDialogueStartFailed(new DlgEvent(event_data), this); } }
//hard code the dialogue to point to a turn with id -1 public virtual void EndDialogue() { currentlySpeakingLine = -1; m_typewriterText = string.Empty; m_fileIsLoaded = false; State = DlgState.Inactive; destroy(); event_data[1].defined.Clear(); _OnDialogueEnded(new DlgEvent(event_data), this); }
string m_typewriterText; // text to build towards during typewriter mode //initialize the class //since nothing can be done until a file is loaded, //all that needs to be done is for the static array to be created //according to the specified value for maxLinesToShow public DlgManager() { if (GameKeys == null) { GameKeys = new JosscriptGameKeys(); } State = DlgState.Inactive; linesToShow = new string[maxLinesToShow]; lines = new List <JossData> (); actors = new List <JossData> (); event_data = new Josscript(); event_data.AddNode("DlgEvent", "DlgManager Version=" + DlgManager_version); event_data.AddNode("EventDetails"); }
int startAtIncrement = -1; // if continuing a dialogue turn, skip the previous text #endregion Fields #region Constructors //initialize the class //since nothing can be done until a file is loaded, //all that needs to be done is for the static array to be created //according to the specified value for maxLinesToShow public DlgManager() { if (GameKeys == null) GameKeys = new JosscriptGameKeys(); State = DlgState.Inactive; linesToShow = new string[maxLinesToShow]; lines = new List<JossData> (); actors = new List<JossData> (); event_data = new Josscript(); event_data.AddNode("DlgEvent", "DlgManager Version="+DlgManager_version); event_data.AddNode("EventDetails"); }
//hard code the dialogue to point to a turn with id -1 protected void EndDialogue() { currentlySpeakingLine = -1; m_typewriterText = string.Empty; m_fileIsLoaded = false; State = DlgState.Inactive ; destroy (); event_data[1].defined.Clear(); _OnDialogueEnded(new DlgEvent(event_data), this); }
public void StartDialogue(string fn = "", int atIndex = -3) { if (fn != string.Empty) FileName = fn; if (FileName == string.Empty) { State = DlgState.Inactive ; event_data[1].defined.Clear(); event_data[1].Set("message","No filename specified"); _OnDialogueStartFailed(new DlgEvent(event_data), this); return; } if (!parent) parent = gameObject; if ( OpenFile (atIndex) ) { State = DlgState.Active ; _OnDialogueStarted(new DlgEvent(event_data), this); } else { _OnDialogueStartFailed(new DlgEvent(event_data), this); } }