public void Load() { HCEX.CampaignSave saveData = _saveManager.SaveData; HCEX.BipedObject playerBiped = saveData.PlayerBiped; loadWeapon(playerBiped.PrimaryWeapon, gridPrimary, txtPrimaryAmmo, txtPrimaryClip); loadWeapon(playerBiped.SecondaryWeapon, gridSecondary, txtSecondaryAmmo, txtSecondaryClip); loadWeapon(playerBiped.TertiaryWeapon, gridTertiary, txtTertiaryAmmo, txtTertiaryClip); loadWeapon(playerBiped.QuaternaryWeapon, gridQuaternary, txtQuaternaryAmmo, txtQuaternaryClip); }
public void Load() { HCEX.CampaignSave saveData = _saveManager.SaveData; HCEX.BipedObject playerBiped = saveData.PlayerBiped; checkInvincible.IsChecked = playerBiped.Invincible; txtPlayerXCord.Text = playerBiped.Position.X.ToString(); txtPlayerYCord.Text = playerBiped.Position.Y.ToString(); txtPlayerZCord.Text = playerBiped.Position.Z.ToString(); }
public bool Save() { HCEX.CampaignSave saveData = _saveManager.SaveData; HCEX.BipedObject playerBiped = saveData.PlayerBiped; playerBiped.MakeInvincible((bool)checkInvincible.IsChecked); // TODO: Actually detect if this is a vehicle, and not some homosexual dragon (fixhax) // I think that should work AMD -Xerax GameObject playerCarrier = playerBiped.Carrier; if (playerCarrier != null && playerCarrier.TagGroup == TagGroup.Vehi) { playerBiped.Carrier.MakeInvincible((bool)checkInvincible.IsChecked); } float newX = Convert.ToSingle(txtPlayerXCord.Text); float newY = Convert.ToSingle(txtPlayerYCord.Text); float newZ = Convert.ToSingle(txtPlayerZCord.Text); playerBiped.Position = new MathUtil.Vector3(newX, newY, newZ); return(true); }
public bool Save() { HCEX.CampaignSave saveData = _saveManager.SaveData; HCEX.BipedObject playerBiped = saveData.PlayerBiped; try { int primAmmo = 0; int primClip = 0; int secAmmo = 0; int secClip = 0; int terAmmo = 0; int terClip = 0; int quadAmmo = 0; int quadClip = 0; if (txtPrimaryAmmo.IsEnabled) { primAmmo = int.Parse(txtPrimaryAmmo.Text); primClip = int.Parse(txtPrimaryClip.Text); } if (txtSecondaryAmmo.IsEnabled) { secAmmo = int.Parse(txtSecondaryAmmo.Text); secClip = int.Parse(txtSecondaryClip.Text); } if (txtTertiaryAmmo.IsEnabled) { terAmmo = int.Parse(txtTertiaryAmmo.Text); terClip = int.Parse(txtTertiaryClip.Text); } if (txtQuaternaryAmmo.IsEnabled) { quadAmmo = int.Parse(txtQuaternaryAmmo.Text); quadClip = int.Parse(txtQuaternaryClip.Text); } if (txtPrimaryAmmo.IsEnabled) { if (primAmmo > 32767 && primAmmo < 0) { txtPrimaryAmmo.Text = "32767"; } if (primClip > 32767 && primClip < 0) { txtPrimaryClip.Text = "32767"; } } if (txtSecondaryAmmo.IsEnabled) { if (secAmmo > 32767 && secAmmo < 0) { txtSecondaryAmmo.Text = "32767"; } if (secClip > 32767 && secClip < 0) { txtSecondaryClip.Text = "32767"; } } if (txtTertiaryAmmo.IsEnabled) { if (terAmmo > 32767 && terAmmo < 0) { txtTertiaryAmmo.Text = "32767"; } if (terClip > 32767 && terClip < 0) { txtTertiaryClip.Text = "32767"; } } if (txtQuaternaryAmmo.IsEnabled) { if (quadAmmo > 32767 && quadAmmo < 0) { txtQuaternaryAmmo.Text = "32767"; } if (quadAmmo > 32767 && quadAmmo < 0) { txtQuaternaryClip.Text = "32767"; } } saveWeapon(playerBiped.PrimaryWeapon, txtPrimaryAmmo, txtPrimaryClip); saveWeapon(playerBiped.SecondaryWeapon, txtSecondaryAmmo, txtSecondaryClip); saveWeapon(playerBiped.TertiaryWeapon, txtTertiaryAmmo, txtTertiaryClip); saveWeapon(playerBiped.QuaternaryWeapon, txtQuaternaryAmmo, txtQuaternaryClip); } catch { mainWindow.showMessage("Invalid weapon ammo count, you can only have a maximum of 32767, and a minimum of 0", "INVALID AMMO"); return(false); } return(true); }