コード例 #1
0
    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);
        }
    }
コード例 #2
0
    //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);
    }
コード例 #3
0
    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");
    }
コード例 #4
0
    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");
    }
コード例 #5
0
    //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);
    }
コード例 #6
0
    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);
        }
    }