Norbyte / lslib

Tools for manipulating Divinity Original Sin and Baldur's Gate 3 files
MIT License
762 stars 141 forks source link

[BG3] Converting config.lsx back to config.lsf fails #152

Open misantronic opened 1 year ago

misantronic commented 1 year ago

Creating a config.lsx from the config.lsf works just fine. But when trying to convert it back to config.lsf, it fails with an exception:

System.Exception: Parsing error at or near line 6, column 5:
Der angegebene Schlüssel war nicht im Wörterbuch angegeben. ---> System.Collections.Generic.KeyNotFoundException: Der angegebene Schlüssel war nicht im Wörterbuch angegeben.
   bei System.ThrowHelper.ThrowKeyNotFoundException()
   bei System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   bei LSLib.LS.LSXReader.ReadElement()
   bei LSLib.LS.LSXReader.ReadInternal()
   bei LSLib.LS.LSXReader.Read()
   --- Ende der internen Ausnahmestapelüberwachung ---
   bei LSLib.LS.LSXReader.Read()
   bei LSLib.LS.ResourceUtils.LoadResource(Stream stream, ResourceFormat format)
   bei LSLib.LS.ResourceUtils.LoadResource(String inputPath, ResourceFormat format)
   bei ConverterApp.ResourcePane.resourceConvertBtn_Click(Object sender, EventArgs e)
   bei System.Windows.Forms.Control.OnClick(EventArgs e)
   bei System.Windows.Forms.Button.OnClick(EventArgs e)
   bei System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   bei System.Windows.Forms.Control.WndProc(Message& m)
   bei System.Windows.Forms.ButtonBase.WndProc(Message& m)
   bei System.Windows.Forms.Button.WndProc(Message& m)
   bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

The config.lsx looks like this:

<?xml version="1.0" encoding="utf-8"?>
<save>
    <version major="4" minor="0" revision="10" build="400" />
    <region id="Config">
        <node id="Config">
            <attribute id="Version64" type="32" value="36169534507319298" />
            <children>
                <node id="ConfigEntry">
                    <attribute id="MapKey" type="22" value="CameraShakeEnabled" />
                    <attribute id="Type" type="4" value="0" />
                    <attribute id="Value" type="4" value="0" />
                </node>
                <node id="ConfigEntry">
                    <attribute id="MapKey" type="22" value="AutoFillHotbarCategories" />
                    <attribute id="Type" type="4" value="0" />
                    <attribute id="Value" type="4" value="64" />
                </node>
                <node id="ConfigEntry">
                    <attribute id="MapKey" type="22" value="ShowFirstTimeSetup" />
                    <attribute id="Type" type="4" value="0" />
                    <attribute id="Value" type="4" value="0" />
                </node>
                <node id="ConfigEntry">
                    <attribute id="MapKey" type="22" value="FxVolume" />
                    <attribute id="Type" type="4" value="2" />
                    <attribute id="Value" type="6" value="80.26927" />
                </node>
                <node id="ConfigEntry">
                    <attribute id="MapKey" type="22" value="VoiceVolume" />
                    <attribute id="Type" type="4" value="2" />
                    <attribute id="Value" type="6" value="90.44083" />
                </node>
                <node id="ConfigEntry">
                    <attribute id="MapKey" type="22" value="VoiceVolumeOverhead" />
                    <attribute id="Type" type="4" value="2" />
                    <attribute id="Value" type="6" value="25.12204" />
                </node>
                <node id="ConfigEntry">
                    <attribute id="MapKey" type="22" value="OverheadFontSizeModifier" />
                    <attribute id="Type" type="4" value="0" />
                    <attribute id="Value" type="4" value="0" />
                </node>
                <node id="ConfigEntry">
                    <attribute id="MapKey" type="22" value="FirstTimeWithCrossSave" />
                    <attribute id="Type" type="4" value="0" />
                    <attribute id="Value" type="4" value="0" />
                </node>
                <node id="ConfigEntry">
                    <attribute id="MapKey" type="22" value="DisableEdgePanning" />
                    <attribute id="Type" type="4" value="0" />
                    <attribute id="Value" type="4" value="0" />
                </node>
                <node id="ConfigEntry">
                    <attribute id="MapKey" type="22" value="MasterVolume" />
                    <attribute id="Type" type="4" value="2" />
                    <attribute id="Value" type="6" value="90.4411" />
                </node>
                <node id="ConfigEntry">
                    <attribute id="MapKey" type="22" value="ShowTutorials" />
                    <attribute id="Type" type="4" value="0" />
                    <attribute id="Value" type="4" value="0" />
                </node>
                <node id="ConfigEntry">
                    <attribute id="MapKey" type="22" value="AmbientVolume" />
                    <attribute id="Type" type="4" value="2" />
                    <attribute id="Value" type="6" value="40.56355" />
                </node>
                <node id="ConfigEntry">
                    <attribute id="MapKey" type="22" value="HideCompletedQuests" />
                    <attribute id="Type" type="4" value="0" />
                    <attribute id="Value" type="4" value="1" />
                </node>
                <node id="ConfigEntry">
                    <attribute id="MapKey" type="22" value="UIVolume" />
                    <attribute id="Type" type="4" value="2" />
                    <attribute id="Value" type="6" value="50.73495" />
                </node>
                <node id="ConfigEntry">
                    <attribute id="MapKey" type="22" value="MouseLock" />
                    <attribute id="Type" type="4" value="0" />
                    <attribute id="Value" type="4" value="1" />
                </node>
                <node id="ConfigEntry">
                    <attribute id="MapKey" type="22" value="MusicVolume" />
                    <attribute id="Type" type="4" value="2" />
                    <attribute id="Value" type="6" value="70.22029" />
                </node>
            </children>
        </node>
    </region>
</save>
AndrianiP commented 1 year ago

Could you please upload then send your compiled file?