Closed TheLonerD closed 8 months ago
Please compile assemblies by yourself and don't forget to update a documentation.
Wow! This is great @TheLonerD ! I'll test this, merge it and then release! Thank you very much!
Sure! If you found some bugs just post a message here so I can fix it.
There is one bug when saving the valuesInner to the save file using Scribe_Collections. The issue is the that scribe is expecting to write (list of) Values but instead it gets a collection (with lists of values).
File: WorkLink.cs
foreach (KeyValuePair<WorkGiverDef, List<int>> entryInner in settingsInner)
{
keysInner.Add(entryInner.Key);
valuesInner.Add(priorityPerHour);
}
Scribe_Collections.Look(ref settingsInner, "settingsInner", LookMode.Def, LookMode.Value, ref keysInner, ref valuesInner);
results in this in the SaveFile (which does not work):
<settingsInner>
<keys>
<li>FightFires</li>
</keys>
<values>
<li>System.Collections.Generic.List`1[System.Int32]</li>
</values>
It shoud instead something like:
<settingsInner>
<keys>
<li>FightFires</li>
<li>WorkGiver#2</li>
</keys>
<values>
<li>
<prioritiesPerHour>
<li>3</li>
<li>3</li>
....24 entries...
<li>3</li>
</prioritiesPerHour>
</li>
<li>
<prioritiesPerHour>
<li>3</li>
<li>3</li>
....24 entries...
<li>3</li>
</prioritiesPerHour>
</li>
</values>
I'm trying to find how to best pass the reference to the Scribe_Collections
I've found a solution based on how Flufly saves the priorities in WorkTab. It requires back and forth translations but it works!
Sounds good! Let me check how Fluffy did that, as I understand we need to create a some kind of translation layer to handle proper serialization<->deserializaton.
@TheLonerD I just pushed v2.5 with the integration and with the save/load fully working. I'd like to add you as contributer in steam. Can you share your steam_id so I can add you as contributor to the mod in steam?
Yup. My steam id is
On Sun, Oct 22, 2023, at 2:42 AM, Alexandre wrote:
@TheLonerD https://github.com/TheLonerD I just pushed v2.5 with the integration and with the save/load fully working. I'd like to add you as contributer in steam. Can you share your steam_id so I can add you as contributor to the mod in steam?
— Reply to this email directly, view it on GitHub https://github.com/voult2/BetterPawnControl/pull/40#issuecomment-1773938659, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBWN3AR5ACU32BWDWTGFLYARFWBAVCNFSM6AAAAAA6KAIXFOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZTHEZTQNRVHE. You are receiving this because you were mentioned.Message ID: @.***>
Extended priorities now can be saved/loaded correctly.