Exemplo n.º 1
0
        public void SetAvailableWeapons(IEnumerable <LogicalWeapon> weapons, LogicalWeapon selected)
        {
            this.SetAvailableWeapons(weapons, true);
            if (selected != null)
            {
                this._weaponInfo.SetWeapons(selected, (LogicalWeapon)null);
            }
            WeaponSelectorItem weaponSelectorItem = this._items.Values.FirstOrDefault <WeaponSelectorItem>((Func <WeaponSelectorItem, bool>)(x => x.Weapon == selected));

            if (weaponSelectorItem == null)
            {
                return;
            }
            this.SelectItem(weaponSelectorItem.ID, false, false);
        }
Exemplo n.º 2
0
        protected virtual void SelectItem(string panelID, bool eventCallback, bool rightClicked)
        {
            WeaponSelectorItem weaponSelectorItem;

            if (!this._items.TryGetValue(panelID, out weaponSelectorItem))
            {
                return;
            }
            this._selectedItem = weaponSelectorItem;
            if (!eventCallback)
            {
                return;
            }
            this.WeaponSelectionChanged((object)this, rightClicked);
        }