Example #1
0
        private void ddlCharacters_SelectedIndexChanged(object sender, EventArgs e)
        {
            Player.ShortName = ddlCharacters.SelectedItem.ToString();
            new Character_Init(ddlCharacters.SelectedItem.ToString());
            Global._UserState = Global.UserState.Player;
            Global.AddCombatActor(Player.ShortName, "Character");

            Global.PlayerForm = new frmVisualator();
            Global.PlayerForm.Show();
            this.Hide();
        }
Example #2
0
        private void treeCompendium_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (treeCompendium.SelectedNode != null)
            {
                string lvName = treeCompendium.SelectedNode.Text;

                string lvParentNode = "";
                foreach (Control lvControl in this.Controls)
                {
                    if (lvControl is TreeView)
                    {
                        foreach (TreeNode tNode in ((TreeView)lvControl).Nodes)
                        {
                            foreach (TreeNode cNode in tNode.Nodes)
                            {
                                if (cNode.Text == lvName)
                                {
                                    lvParentNode = tNode.Text;
                                }
                            }
                        }
                    }
                }

                switch (lvParentNode)
                {
                case "NPC":
                    Global.AddCombatActor(lvName, "NPC");
                    break;

                case "Item":
                    XPathNavigator itemNav = cvItemXml.CreateNavigator().SelectSingleNode("Items/Item[@Name = '" + lvName + "']");
                    Global.AddLootItem(lvName, itemNav.SelectSingleNode("Size").ValueAsInt, itemNav.SelectSingleNode("Cost").ValueAsInt,
                                       itemNav.SelectSingleNode("Image").Value, itemNav.SelectSingleNode("@Type").Value);
                    break;

                default:
                    break;
                }
            }
        }