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); }
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); }
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); } }
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 = ""; }