Example #1
0
        private void _lvGossip_menu_SelectedIndexChanged(object sender, EventArgs e)
        {
            _tbCreatureGossip.Clear();
            if (_lvGossip_menu.SelectedIndices.Count > 0)
            {
                GossipMenu GossipCreature = MySQLConnenct.GossipMenu[_lvGossip_menu.SelectedIndices[0]];
                MySQLConnenct.SelectGossipCrearture(GossipCreature.Entry, 0);

                if (MySQLConnenct.GossipMenuCreature.Count > 0)
                {
                    _lvGossip_Creature.Visible         = true;
                    _lblnpctext.Visible                = false;
                    _lvGossip_Creature.VirtualListSize = MySQLConnenct.GossipMenuCreature.Count;
                    _lvGossip_Creature.Refresh();
                    StringBuilder sb = new StringBuilder();

                    for (int i = 0; i < _lvGossip_Creature.VirtualListSize; i++)
                    {
                        if (i > -1)
                        {
                            if (i != (_lvGossip_Creature.VirtualListSize))
                            {
                                sb.Append(",");
                                sb.Append(_lvGossip_Creature.Items[i].Text);
                            }
                            else
                            {
                                sb.Append(_lvGossip_Creature.Items[i].Text);
                            }
                        }
                    }
                    sb.Remove(0, 1);
                    _tbCreatureGossip.Text = sb.ToString();
                }
                else
                {
                    _lvGossip_Creature.Visible = false;
                    _lblnpctext.Visible        = true;
                }


                _tbGossipEntry.Text = GossipCreature.Entry.ToString();
                _GossipTextID.Text  = GossipCreature.TextID.ToString();
                _cbGossipCondtion_1.SelectedValue = GossipCreature.cond_1;
                _cbCondtion1Value_1.SetValue(GossipCreature.cond_1_val_1);
                _cbCondtion1Value_2.SetValue(GossipCreature.cond_1_val_2);
                _cbGossipCondtion_2.SelectedValue = GossipCreature.cond_2;
                _cbCondtion2Value_1.SetValue(GossipCreature.cond_2_val_1);
                _cbCondtion2Value_2.SetValue(GossipCreature.cond_2_val_2);

                MySQLConnenct.SelectNpcText(GossipCreature.TextID);
                _lvNpc_text.VirtualListSize = MySQLConnenct.npc_text.Count;
                _lvNpc_text.Refresh();
            }
        }
Example #2
0
 private void _bGossipSearch_Click(object sender, EventArgs e)
 {
     if (_rbTextID.Checked)
     {
         if (_tbFilterGossip.Text.Length > 0)
         {
             MySQLConnenct.SelectNpcText(_tbFilterGossip.Text.ToInt32());
         }
         else
         {
             MySQLConnenct.SelectNpcText(0);
         }
         _lvNpc_text.VirtualListSize = MySQLConnenct.npc_text.Count;
         _lvNpc_text.Refresh();
     }
     else if (_rbGossip.Checked)
     {
         if (_tbFilterGossip.Text.Length > 0)
         {
             MySQLConnenct.SelectGossip(_tbFilterGossip.Text.ToInt32());
         }
         else
         {
             MySQLConnenct.SelectGossip(0);
         }
         _lvGossip_menu.VirtualListSize = MySQLConnenct.GossipMenu.Count;
         _lvGossip_menu.Refresh();
     }
     else
     {
         if (_tbFilterGossip.Text.Length > 0)
         {
             MySQLConnenct.SelectGossipCrearture(0, _tbFilterGossip.Text.ToInt32());
         }
         else
         {
             MySQLConnenct.SelectGossipCrearture(0, 0);
         }
         _lvGossip_Creature.VirtualListSize = MySQLConnenct.GossipMenuCreature.Count;
         _lvGossip_Creature.Refresh();
     }
 }