fix LBP1 slot serialization

This commit is contained in:
jvyden 2021-10-06 02:40:25 -04:00
commit cf37aa308b
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
2 changed files with 8 additions and 6 deletions

View file

@ -1,3 +1,4 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> <wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/UserDictionary/Words/=ezoiar/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/UserDictionary/Words/=ezoiar/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=lbpme/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=lolcatftw/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> <s:Boolean x:Key="/Default/UserDictionary/Words/=lolcatftw/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

View file

@ -33,7 +33,7 @@ namespace ProjectLighthouse.Types {
public int FreeSlots => EntitledSlots - this.UsedSlots; public int FreeSlots => EntitledSlots - this.UsedSlots;
private static string[] slotTypes = { private static string[] slotTypes = {
"lbp1", // "lbp1",
"lbp2", "lbp2",
"lbp3", "lbp3",
"crossControl" "crossControl"
@ -42,11 +42,12 @@ namespace ProjectLighthouse.Types {
private string SerializeSlots() { private string SerializeSlots() {
string slots = string.Empty; string slots = string.Empty;
foreach(string s in slotTypes) { slots += LbpSerializer.StringElement("lbp1UsedSlots", this.UsedSlots);
string slotType = s; // vars in foreach are immutable, define helper var slots += LbpSerializer.StringElement("entitledSlots", EntitledSlots);
slots += LbpSerializer.StringElement("freeSlots", this.FreeSlots);
foreach(string slotType in slotTypes) {
slots += LbpSerializer.StringElement(slotType + "UsedSlots", this.UsedSlots); slots += LbpSerializer.StringElement(slotType + "UsedSlots", this.UsedSlots);
if(slotType == "lbp1") slotType = "";
slots += LbpSerializer.StringElement(slotType + "EntitledSlots", EntitledSlots); slots += LbpSerializer.StringElement(slotType + "EntitledSlots", EntitledSlots);
// ReSharper disable once StringLiteralTypo // ReSharper disable once StringLiteralTypo
slots += LbpSerializer.StringElement(slotType + slotType == "crossControl" ? "PurchsedSlots" : "PurchasedSlots", 0); slots += LbpSerializer.StringElement(slotType + slotType == "crossControl" ? "PurchsedSlots" : "PurchasedSlots", 0);