/////////////////////////////////////////// //END SPITFIRE1337 MODS /////////////////////////////////////////// public void ExportData(WillowTwoPlayerSaveGame saveGame, out Endian endian) { endian = this.Endian; saveGame.SaveGameId = this.SaveGameId; saveGame.PlayerClass = this.PlayerClass; saveGame.ExpLevel = this.ExpLevel; saveGame.ExpPoints = this.ExpPoints; saveGame.GeneralSkillPoints = this.GeneralSkillPoints; saveGame.SpecialistSkillPoints = this.SpecialistSkillPoints; saveGame.UIPreferences.CharacterName = Encoding.UTF8.GetBytes(this.CharacterName); saveGame.AppliedCustomizations[0] = this.SelectedHead; saveGame.AppliedCustomizations[4] = this.SelectedSkin; }
public void ExportData(WillowTwoPlayerSaveGame saveGame) { saveGame.PackedWeaponData.Clear(); saveGame.PackedItemData.Clear(); foreach (var viewModel in this.Slots) { var slot = viewModel.BackpackSlot; if (slot is BackpackWeapon) { var weapon = (BackpackWeapon)slot; var data = BackpackDataHelper.Encode(weapon); saveGame.PackedWeaponData.Add(new PackedWeaponData() { Data = data, QuickSlot = weapon.QuickSlot, Mark = weapon.Mark, }); } else if (slot is BackpackItem) { var item = (BackpackItem)slot; var data = BackpackDataHelper.Encode(item); saveGame.PackedItemData.Add(new PackedItemData() { Data = data, Quantity = item.Quantity, Equipped = item.Equipped, Mark = item.Mark, }); } else { throw new NotSupportedException(); } } }
/////////////////////////////////////////// //SPITFIRE1337 MODS /////////////////////////////////////////// public void ImportData(WillowTwoPlayerSaveGame saveGame, Endian endian, string myprofileid, string mydeviceid, string myconsoleid) { this.Endian = endian; this.SaveGameId = saveGame.SaveGameId; this.PlayerClass = saveGame.PlayerClass; var expLevel = saveGame.ExpLevel; var expPoints = saveGame.ExpPoints; if (expPoints < 0) { expPoints = 0; } if (expLevel <= 0) { expLevel = Math.Max(1, Experience.GetLevelForPoints(expPoints)); } this.ExpLevel = expLevel; this.ExpPoints = expPoints; this.GeneralSkillPoints = saveGame.GeneralSkillPoints; this.SpecialistSkillPoints = saveGame.SpecialistSkillPoints; this.CharacterName = Encoding.UTF8.GetString(saveGame.UIPreferences.CharacterName); this.SelectedHead = saveGame.AppliedCustomizations[0]; this.SelectedSkin = saveGame.AppliedCustomizations[4]; this.BuildCustomizationAssets(); string vOut = myprofileid.ToString(); this.Profileid = vOut; this.ProfileName = checkProfile(myprofileid); }
public void ImportData(WillowTwoPlayerSaveGame saveGame) { this.Slots.Clear(); foreach (var packedWeapon in saveGame.PackedWeaponData) { var weapon = (BackpackWeapon)BackpackDataHelper.Decode(packedWeapon.Data); var test = BackpackDataHelper.Encode(weapon); if (packedWeapon.Data.SequenceEqual(test) == false) { throw new FormatException("backpack weapon reencode mismatch"); } weapon.QuickSlot = packedWeapon.QuickSlot; weapon.Mark = packedWeapon.Mark; var viewModel = new BackpackWeaponViewModel(weapon); this.Slots.Add(viewModel); } foreach (var packedItem in saveGame.PackedItemData) { var item = (BackpackItem)BackpackDataHelper.Decode(packedItem.Data); var test = BackpackDataHelper.Encode(item); if (packedItem.Data.SequenceEqual(test) == false) { throw new FormatException("backpack item reencode mismatch"); } item.Quantity = packedItem.Quantity; item.Equipped = packedItem.Equipped; item.Mark = packedItem.Mark; var viewModel = new BackpackItemViewModel(item); this.Slots.Add(viewModel); } }
public void ExportData(WillowTwoPlayerSaveGame saveGame) { saveGame.BankSlots.Clear(); foreach (var viewModel in this.Slots) { var slot = viewModel.BaseSlot; if (slot is BaseWeapon) { var weapon = (BaseWeapon)slot; var data = BaseDataHelper.Encode(weapon); saveGame.BankSlots.Add(new BankSlot() { Data = data, }); } else if (slot is BaseItem) { var item = (BaseItem)slot; var data = BaseDataHelper.Encode(item); saveGame.BankSlots.Add(new BankSlot() { Data = data, }); } else { throw new NotSupportedException(); } } }
public void ImportData(WillowTwoPlayerSaveGame saveGame) { this.Slots.Clear(); foreach (var bankSlot in saveGame.BankSlots) { var slot = BaseDataHelper.Decode(bankSlot.Data); var test = BaseDataHelper.Encode(slot); if (bankSlot.Data.SequenceEqual(test) == false) { throw new FormatException("bank slot reencode mismatch"); } if (slot is BaseWeapon) { var viewModel = new BaseWeaponViewModel((BaseWeapon)slot); this.Slots.Add(viewModel); } else if (slot is BaseItem) { var viewModel = new BaseItemViewModel((BaseItem)slot); this.Slots.Add(viewModel); } } }
public void ExportData(WillowTwoPlayerSaveGame saveGame) { saveGame.CurrencyOnHand.Clear(); saveGame.CurrencyOnHand.Add(this.Credits); saveGame.CurrencyOnHand.Add(this.Eridium); saveGame.CurrencyOnHand.Add(this.SeraphCrystals); saveGame.CurrencyOnHand.Add(this.ReservedA); saveGame.CurrencyOnHand.Add(this.ReservedB); saveGame.CurrencyOnHand.Add(this.ReservedC); saveGame.CurrencyOnHand.Add(this.ReservedD); saveGame.CurrencyOnHand.Add(this.ReservedE); saveGame.CurrencyOnHand.Add(this.ReservedF); saveGame.CurrencyOnHand.Add(this.ReservedG); saveGame.CurrencyOnHand.Add(this.ReservedH); saveGame.CurrencyOnHand.Add(this.ReservedI); saveGame.CurrencyOnHand.Add(this.ReservedJ); }
public void ImportData(WillowTwoPlayerSaveGame saveGame) { this.Credits = saveGame.CurrencyOnHand != null && saveGame.CurrencyOnHand.Count > 0 ? saveGame.CurrencyOnHand[0] : 0; this.Eridium = saveGame.CurrencyOnHand != null && saveGame.CurrencyOnHand.Count > 1 ? saveGame.CurrencyOnHand[1] : 0; this.SeraphCrystals = saveGame.CurrencyOnHand != null && saveGame.CurrencyOnHand.Count > 2 ? saveGame.CurrencyOnHand[2] : 0; this.ReservedA = saveGame.CurrencyOnHand != null && saveGame.CurrencyOnHand.Count > 3 ? saveGame.CurrencyOnHand[3] : 0; this.ReservedB = saveGame.CurrencyOnHand != null && saveGame.CurrencyOnHand.Count > 4 ? saveGame.CurrencyOnHand[4] : 0; this.ReservedC = saveGame.CurrencyOnHand != null && saveGame.CurrencyOnHand.Count > 5 ? saveGame.CurrencyOnHand[5] : 0; this.ReservedD = saveGame.CurrencyOnHand != null && saveGame.CurrencyOnHand.Count > 6 ? saveGame.CurrencyOnHand[6] : 0; this.ReservedE = saveGame.CurrencyOnHand != null && saveGame.CurrencyOnHand.Count > 7 ? saveGame.CurrencyOnHand[7] : 0; this.ReservedF = saveGame.CurrencyOnHand != null && saveGame.CurrencyOnHand.Count > 8 ? saveGame.CurrencyOnHand[8] : 0; this.ReservedG = saveGame.CurrencyOnHand != null && saveGame.CurrencyOnHand.Count > 9 ? saveGame.CurrencyOnHand[9] : 0; this.ReservedH = saveGame.CurrencyOnHand != null && saveGame.CurrencyOnHand.Count > 10 ? saveGame.CurrencyOnHand[10] : 0; this.ReservedI = saveGame.CurrencyOnHand != null && saveGame.CurrencyOnHand.Count > 11 ? saveGame.CurrencyOnHand[11] : 0; this.ReservedJ = saveGame.CurrencyOnHand != null && saveGame.CurrencyOnHand.Count > 12 ? saveGame.CurrencyOnHand[12] : 0; }