public WeaponEditForm(Weapon chosenWeapon, IReadOnlyList <Weapon> ownedWeapons) { InitializeComponent(); Weapon = chosenWeapon; OwnedWeapons = ownedWeapons; weaponBox.SelectedIndex = WeaponDatabase.GetIndex(Weapon.Id); weaponBox.Enabled = false; turfInkedBox.Value = Convert.ToInt32(Weapon.TurfInked); newFlagBox.Checked = Weapon.IsNew; }
private void ChangeWeaponTo(Weapon target) { if (target == null) { return; } var idx = WeaponDatabase.GetIndex(target); m_photonView.RPC("ChangeWeaponRPC", RpcTarget.AllViaServer, idx, true); OnWeaponChanged?.Invoke(target.WeaponName); }
private void ReloadListBox() { weaponsList.Items.Clear(); foreach (var weapon in WeaponsHax.Weapons) { string name = ""; var index = WeaponDatabase.GetIndex(weapon.Id); if (index == 0) { name = weaponEditFormResources.GetString("weaponBox.Items"); } else { name = weaponEditFormResources.GetString("weaponBox.Items" + index); } if (weapon.Id.Equals(WeaponsHax.EquippedWeapon)) { name += " " + Strings.EQUIPPED; } weaponsList.Items.Add(name); } }