Ejemplo n.º 1
0
        private void LockerTree_SelectionChanged(object sender, EventArgs e)
        {
            PartsLocker.Items.Clear();

            if (LockerTree.SelectedNode == null || LockerTree.SelectedNode.Children.Count > 0)
            {
                return;
            }

            InventoryEntry entry = LockerTree.SelectedNode.GetEntry();

            if (LockerTree.SelectedNode.Children.Count == 0)
            {   // Tree nodes with no children are items or weapons.  Entries with children would be section headers.
                string SelectedItem = LockerTree.SelectedNode.Data().Text;

                LockerPartsGroup.Text  = entry.Name;
                RatingLocker.Text      = entry.Rating;
                DescriptionLocker.Text = entry.Description.Replace("$LINE$", "\r\n");


                int partcount = entry.GetPartCount();

                for (int Progress = 0; Progress < partcount; Progress++)
                {
                    PartsLocker.Items.Add(entry.Parts[Progress]);
                }

                WTSlideSelector.MinMaxAdvanced(entry.UsesBigLevel, ref LevelIndexLocker);

                Util.SetNumericUpDown(RemAmmoLocker, entry.Quantity);
                QualityLocker.Value    = entry.QualityIndex;
                LevelIndexLocker.Value = entry.LevelIndex;
            }
        }
        public static string LevelTranslator(object obj)
        {
            WTSlideSelector levelindex = (WTSlideSelector)obj;

            if (levelindex.InputMode == InputMode.Advanced)
            {
                if (GlobalSettings.UseHexInAdvancedMode == true)
                {
                    return("Level Index (hexadecimal)");
                }
                else
                {
                    return("Level Index (decimal)");
                }
            }

            if (levelindex.Value == 0)
            {
                return("Level: Default");
            }
            else
            {
                return("Level: " + (levelindex.Value - 2));
            }
        }
        public static string QualityTranslator(object obj)
        {
            WTSlideSelector qualityindex = (WTSlideSelector)obj;

            if (qualityindex.InputMode == InputMode.Advanced)
            {
                if (GlobalSettings.UseHexInAdvancedMode == true)
                {
                    return("Quality Index (hexadecimal)");
                }
                else
                {
                    return("Quality Index (decimal)");
                }
            }
            else
            {
                return("Quality: " + qualityindex.Value);
            }
        }
Ejemplo n.º 4
0
        private void GearTree_SelectionChanged(object sender, EventArgs e)
        {
            int OldPartIndex = PartsGear.SelectedIndex;

            PartsGear.Items.Clear();

            // If the node has children it not an item. It is a category label.
            if (GearTree.SelectedNode == null || GearTree.SelectedNode.Children.Count > 0)
            {
                GearPartsGroup.Text = "No " + gearTextName + " Selected";
                return;
            }

            InventoryEntry gear = GearTree.SelectedNode.GetEntry();

            GearPartsGroup.Text = gear.Name;

            Init();
            for (int i = 0; i < gear.Parts.Count; i++)
            {
                PartsGear.Items.Add(gear.Parts[i]);
            }

            WTSlideSelector.MinMaxAdvanced(gear.UsesBigLevel, ref LevelIndexGear);

            Util.SetNumericUpDown(QuantityGear, gear.Quantity);
            QualityGear.Value = gear.QualityIndex;
            EquippedSlotGear.SelectedIndex = gear.EquippedSlot;
            LevelIndexGear.Value           = gear.LevelIndex;
            JunkGear.Value   = gear.IsJunk;
            LockedGear.Value = gear.IsLocked;

            if (PartsGear.Items.Count > OldPartIndex)
            {
                PartsGear.SelectedIndex = OldPartIndex;
            }

            GearInformationUpdate();
        }