示例#1
0
        private void DescribeVehicle(string pvVehName)
        {
            //TODO: GetCargo();

            XPathNavigator nav        = cvVehicleXml.CreateNavigator();
            XPathNavigator vehicleNav = nav.SelectSingleNode("Vehicles/Vehicle[@Name = '" + pvVehName + "']");

            lblActiveVehicle.Text       = vehicleNav.SelectSingleNode("@Name").Value;
            VehicleDisplay.VehicleName  = vehicleNav.SelectSingleNode("@Name").Value;
            VehicleDisplay.Image        = vehicleNav.SelectSingleNode("Image").Value;
            VehicleDisplay.Cost         = vehicleNav.SelectSingleNode("Cost").ValueAsInt;
            VehicleDisplay.ItemSize     = vehicleNav.SelectSingleNode("Size").ValueAsInt;
            VehicleDisplay.Durability   = vehicleNav.SelectSingleNode("Durability").ValueAsInt;
            VehicleDisplay.Structure    = vehicleNav.SelectSingleNode("Structure").ValueAsInt;
            VehicleDisplay.Acceleration = vehicleNav.SelectSingleNode("Acceleration").ValueAsInt;
            VehicleDisplay.Speed        = vehicleNav.SelectSingleNode("Speed").ValueAsInt;
            VehicleDisplay.Safe_Speed   = vehicleNav.SelectSingleNode("Safe_Speed").ValueAsInt;
            VehicleDisplay.Handling     = vehicleNav.SelectSingleNode("Handling").ValueAsInt;
            VehicleDisplay.Occupancy    = vehicleNav.SelectSingleNode("Occupancy").ValueAsInt;
            VehicleDisplay.Capacity     = vehicleNav.SelectSingleNode("Capacity").ValueAsInt;
            VehicleDisplay.Description  = vehicleNav.SelectSingleNode("Description").Value;

            VehicleDisplay vDisplay = new VehicleDisplay();

            tabPageDescription.Controls.Clear();
            tabPageDescription.Controls.Add(vDisplay);
        }
示例#2
0
        private void DescribeVehicle(string display, TransactionType pvType)
        {
            XPathDocument  xDoc       = new XPathDocument(Global.VehicleXml);
            XPathNavigator nav        = xDoc.CreateNavigator();
            XPathNavigator vehicleNav = nav.SelectSingleNode("Vehicles/Vehicle[@Name = '" + display + "']");

            VehicleDisplay.VehicleName  = display;
            VehicleDisplay.Image        = vehicleNav.SelectSingleNode("Image").Value;
            VehicleDisplay.Cost         = vehicleNav.SelectSingleNode("Cost").ValueAsInt;
            VehicleDisplay.ItemSize     = vehicleNav.SelectSingleNode("Size").ValueAsInt;
            VehicleDisplay.Durability   = vehicleNav.SelectSingleNode("Durability").ValueAsInt;
            VehicleDisplay.Structure    = vehicleNav.SelectSingleNode("Structure").ValueAsInt;
            VehicleDisplay.Acceleration = vehicleNav.SelectSingleNode("Acceleration").ValueAsInt;
            VehicleDisplay.Speed        = vehicleNav.SelectSingleNode("Speed").ValueAsInt;
            VehicleDisplay.Safe_Speed   = vehicleNav.SelectSingleNode("Safe_Speed").ValueAsInt;
            VehicleDisplay.Handling     = vehicleNav.SelectSingleNode("Handling").ValueAsInt;
            VehicleDisplay.Occupancy    = vehicleNav.SelectSingleNode("Occupancy").ValueAsInt;
            VehicleDisplay.Capacity     = vehicleNav.SelectSingleNode("Capacity").ValueAsInt;
            VehicleDisplay.Description  = vehicleNav.SelectSingleNode("Description").Value;

            if (pvType == TransactionType.Buy)
            {
                _buySelectedItemName = ItemDisplay.ItemName;
                _buySelectedItemCost = ItemDisplay.Cost;
                _buyItemType         = "Vehicle";
            }
            else
            {
                _sellSelectedItemName = ItemDisplay.ItemName;
                _sellSelectedItemCost = ItemDisplay.Cost;
                _sellItemType         = "Vehicle";
                //TODO: _sellSelectedID
            }

            VehicleDisplay vDisplay = new VehicleDisplay();

            pnlItemDisplay.Controls.Clear();
            pnlItemDisplay.Controls.Add(vDisplay);
        }
示例#3
0
        private void treeCompendium_AfterSelect(object sender, TreeViewEventArgs e)
        {
            if (e.Node.Text == "Cash")
            {
                CashControl cControl = new CashControl();
                GMForm.setPanelSelectedCash(cControl);
            }
            else if (e.Node.Parent != null)
            {
                switch (e.Node.Parent.Text)
                {
                case "Item":
                    XPathNavigator itemNav = cvItemXml.CreateNavigator().SelectSingleNode("Items/Item[@Name = '" + e.Node.Text + "']");

                    ItemDisplay.ItemName      = e.Node.Text;
                    ItemDisplay.Image         = itemNav.SelectSingleNode("Image").Value;
                    ItemDisplay.Cost          = itemNav.SelectSingleNode("Cost").ValueAsInt;
                    ItemDisplay.ItemSize      = itemNav.SelectSingleNode("Size").ValueAsInt;
                    ItemDisplay.Durability    = itemNav.SelectSingleNode("Durability").ValueAsInt;
                    ItemDisplay.Structure     = itemNav.SelectSingleNode("Structure").ValueAsInt;
                    ItemDisplay.Description   = itemNav.SelectSingleNode("Description").Value;
                    ItemDisplay.Scope         = null;
                    ItemDisplay.Damage_Prim   = null;
                    ItemDisplay.Damage_Sec    = null;
                    ItemDisplay.Capacity      = null;
                    ItemDisplay.Def_General   = 0;
                    ItemDisplay.Def_Ballistic = 0;
                    ItemDisplay.Range         = null;

                    ItemDisplay iDisplay = new ItemDisplay();
                    GMForm.setPanelSelectedItem(iDisplay);
                    break;

                case "Weapon":
                    XPathNavigator weaponNav = cvItemXml.CreateNavigator().SelectSingleNode("Items/Item[@Name = '" + e.Node.Text + "']");

                    ItemDisplay.ItemName    = e.Node.Text;
                    ItemDisplay.Scope       = weaponNav.SelectSingleNode("Scope").Value;
                    ItemDisplay.Image       = weaponNav.SelectSingleNode("Image").Value;
                    ItemDisplay.Cost        = weaponNav.SelectSingleNode("Cost").ValueAsInt;
                    ItemDisplay.ItemSize    = weaponNav.SelectSingleNode("Size").ValueAsInt;
                    ItemDisplay.Damage_Prim = weaponNav.SelectSingleNode("Primary/Damage").Value + "(" + weaponNav.SelectSingleNode("Primary/Threat").Value + ")";;

                    XPathNavigator secNav = weaponNav.SelectSingleNode("Secondary/Damage");
                    if (secNav != null)
                    {
                        ItemDisplay.Damage_Sec = weaponNav.SelectSingleNode("Secondary/Damage").Value + "(" + weaponNav.SelectSingleNode("Secondary/Threat").Value + ")";
                    }
                    else
                    {
                        ItemDisplay.Damage_Sec = null;
                    }

                    XPathNavigator mediumNav = weaponNav.SelectSingleNode("Range/Medium");
                    XPathNavigator longNav   = weaponNav.SelectSingleNode("Range/Long");

                    ItemDisplay.Range = weaponNav.SelectSingleNode("Range/Short").Value;
                    if (mediumNav != null)
                    {
                        ItemDisplay.Range += @"/" + mediumNav.Value;
                    }
                    if (longNav != null)
                    {
                        ItemDisplay.Range += @"/" + longNav.Value;
                    }

                    ItemDisplay.Durability    = 0;
                    ItemDisplay.Structure     = 0;
                    ItemDisplay.Def_General   = 0;
                    ItemDisplay.Def_Ballistic = 0;

                    ItemDisplay.Description = weaponNav.SelectSingleNode("Description").Value;

                    ItemDisplay wDisplay = new ItemDisplay();
                    GMForm.setPanelSelectedItem(wDisplay);
                    break;

                case "Armor":
                    XPathNavigator armorNav = cvItemXml.CreateNavigator().SelectSingleNode("Items/Item[@Name = '" + e.Node.Text + "']");

                    ItemDisplay.ItemName      = e.Node.Text;
                    ItemDisplay.Image         = armorNav.SelectSingleNode("Image").Value;
                    ItemDisplay.Cost          = armorNav.SelectSingleNode("Cost").ValueAsInt;
                    ItemDisplay.Def_General   = armorNav.SelectSingleNode("General").ValueAsInt;
                    ItemDisplay.Def_Ballistic = armorNav.SelectSingleNode("Ballistic").ValueAsInt;
                    ItemDisplay.Description   = armorNav.SelectSingleNode("Description").Value;
                    ItemDisplay.Durability    = 0;
                    ItemDisplay.Structure     = 0;
                    ItemDisplay.Scope         = null;
                    ItemDisplay.Damage_Prim   = null;
                    ItemDisplay.Damage_Sec    = null;
                    ItemDisplay.Capacity      = null;
                    ItemDisplay.Range         = null;

                    ItemDisplay aDisplay = new ItemDisplay();
                    GMForm.setPanelSelectedItem(aDisplay);
                    break;

                case "Vehicle":
                    XPathNavigator vehicleNav = cvVehicleXml.CreateNavigator().SelectSingleNode("Vehicles/Vehicle[@Name = '" + e.Node.Text + "']");

                    VehicleDisplay.VehicleName  = e.Node.Text;
                    VehicleDisplay.Image        = vehicleNav.SelectSingleNode("Image").Value;
                    VehicleDisplay.Cost         = vehicleNav.SelectSingleNode("Cost").ValueAsInt;
                    VehicleDisplay.ItemSize     = vehicleNav.SelectSingleNode("Size").ValueAsInt;
                    VehicleDisplay.Durability   = vehicleNav.SelectSingleNode("Durability").ValueAsInt;
                    VehicleDisplay.Structure    = vehicleNav.SelectSingleNode("Structure").ValueAsInt;
                    VehicleDisplay.Acceleration = vehicleNav.SelectSingleNode("Acceleration").ValueAsInt;
                    VehicleDisplay.Speed        = vehicleNav.SelectSingleNode("Speed").ValueAsInt;
                    VehicleDisplay.Safe_Speed   = vehicleNav.SelectSingleNode("Safe_Speed").ValueAsInt;
                    VehicleDisplay.Handling     = vehicleNav.SelectSingleNode("Handling").ValueAsInt;
                    VehicleDisplay.Occupancy    = vehicleNav.SelectSingleNode("Occupancy").ValueAsInt;
                    VehicleDisplay.Capacity     = vehicleNav.SelectSingleNode("Capacity").ValueAsInt;
                    VehicleDisplay.Description  = vehicleNav.SelectSingleNode("Description").Value;

                    VehicleDisplay vDisplay = new VehicleDisplay();
                    GMForm.setPanelSelectedVehicle(vDisplay);
                    break;

                case "NPC":
                    XPathDocument  lvNPCxml = new XPathDocument(Properties.Settings.Default.DataLocation + @"NPC/" + e.Node.Text + ".xml");
                    XPathNavigator npcNav   = lvNPCxml.CreateNavigator();

                    CharDisplay.CharName         = npcNav.SelectSingleNode("Character/Background/Name").Value;
                    CharDisplay.Type             = npcNav.SelectSingleNode("Character/Background/Type").Value;
                    CharDisplay.Health           = npcNav.SelectSingleNode("Character/Attributes/Health/Max").ValueAsInt;
                    CharDisplay.Bash             = npcNav.SelectSingleNode("Character/Attributes/Health/Bash").ValueAsInt;
                    CharDisplay.Lethal           = npcNav.SelectSingleNode("Character/Attributes/Health/Lethal").ValueAsInt;
                    CharDisplay.Aggravated       = npcNav.SelectSingleNode("Character/Attributes/Health/Aggravated").ValueAsInt;
                    CharDisplay.WillpowerMax     = npcNav.SelectSingleNode("Character/Attributes/Willpower/Max").ValueAsInt;
                    CharDisplay.WillpowerCurrent = npcNav.SelectSingleNode("Character/Attributes/Willpower/Current").ValueAsInt;
                    CharDisplay.Image            = npcNav.SelectSingleNode("Character/Image").Value;
                    CharDisplay.DisplayType      = Global.CharType.NPC;
                    CharDisplay lvChar = new CharDisplay();

                    CharDisplay cDisplay = new CharDisplay();
                    GMForm.setPanelSelectedChar(cDisplay);
                    break;

                default:
                    break;
                }
            }
        }