コード例 #1
0
        protected override void DoShowEvent()
        {
            base.DoShowEvent();

            fServices.Items.BeginUpdate();
            fServices.Items.Clear();

            SentientBrain colBrain = (SentientBrain)fCollocutor.Brain;
            Services      avail    = colBrain.AvailableServices;

            for (var si = Service.ds_First; si <= Service.ds_Last; si++)
            {
                Service srv = (Service)(si);
                if (avail.Contains(srv))
                {
                    fServices.Items.Add(BaseLocale.GetStr(StaticData.dbDialogServices[(int)srv].NameRes), srv);
                }
            }

            fServices.Items.EndUpdate();

            UpdateConversations();

            GlobalVars.nwrWin.SetScriptVar("NPC", fCollocutor);
            GlobalVars.nwrWin.SetScriptVar("dialog", this);

            GlobalVars.nwrWin.DoEvent(EventID.event_DialogBegin, GlobalVars.nwrGame.Player, fCollocutor, null);
        }
コード例 #2
0
        private void OnConversationSelect(object sender, MouseButton button, LBItem item)
        {
            fTextBox.Lines.Clear();

            int idx = fConversations.SelIndex;

            SentientBrain colBrain = (SentientBrain)fCollocutor.Brain;

            fCurTopic = colBrain.GetTopic(GlobalVars.nwrGame.Player, idx, null, "");
            ShowTopic(fCurTopic, true);
        }
コード例 #3
0
        private void OnLinkClick(object sender, string linkValue)
        {
            int idx = fConversations.SelIndex;

            if (idx != -1)
            {
                SentientBrain b = (SentientBrain)fCollocutor.Brain;
                fCurTopic = b.GetTopic(GlobalVars.nwrGame.Player, idx, fCurTopic, linkValue);
                ShowTopic(fCurTopic, false);
            }
        }
コード例 #4
0
        private void UpdateConversations()
        {
            fConversations.Items.BeginUpdate();
            fConversations.Items.Clear();

            SentientBrain b   = (SentientBrain)fCollocutor.Brain;
            DialogEntry   dlg = b.Dialog;

            int num = dlg.ConversationsCount;

            for (int i = 0; i < num; i++)
            {
                fConversations.Items.Add(dlg.GetConversation(i).Name, null);
            }

            fConversations.Items.EndUpdate();

            fTextBox.Lines.Text = "";
        }