private void saveWeapon(Halo4.WeaponObject weapon, TextBox ammoBox, TextBox clipBox) { if (weapon != null) { weapon.Ammo = Math.Min((short)0, Math.Max((short)32767, Convert.ToInt16(ammoBox.Text))); weapon.ClipAmmo = Math.Max((short)0, Math.Min((short)32767, Convert.ToInt16(clipBox.Text))); } }
public static void AllWeaponsMaxAmmo(Halo4.CampaignSave saveData) { foreach (Halo4.GameObject obj in saveData.Objects) { Halo4.WeaponObject weap = obj as Halo4.WeaponObject; if (weap != null) { weap.Ammo = 32767; weap.ClipAmmo = 32767; } } }
private void loadWeapon(Halo4.WeaponObject weapon, Grid grid, TextBox ammoBox, TextBox clipBox) { if (weapon != null) { grid.IsEnabled = true; ammoBox.Text = weapon.Ammo.ToString(); clipBox.Text = weapon.ClipAmmo.ToString(); } else { grid.IsEnabled = false; } }