fix LBP1 slot serialization

This commit is contained in:
jvyden 2021-10-06 02:40:25 -04:00
parent bb0473e463
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">
<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>

View file

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