Added Ability For Child Entries

This commit is contained in:
Ben C 2022-02-08 16:59:56 -05:00
parent cfdf22d341
commit 14f0e4cf80
2 changed files with 46 additions and 0 deletions

View File

@ -66,6 +66,23 @@ namespace NewHorizons.Builder.ShipLog
{
_entryIdToRawName.Add(id.Value, curiosityName.Value);
}
foreach (XElement childEntryElement in entryElement.Elements("Entry"))
{
XElement childCuriosityName = childEntryElement.Element("Curiosity");
XElement childId = childEntryElement.Element("ID");
if (childId != null && _entryIdToRawName.ContainsKey(childId.Value))
{
if (childCuriosityName == null && curiosityName != null)
{
_entryIdToRawName.Add(childId.Value, curiosityName.Value);
}
else if (childCuriosityName != null)
{
_entryIdToRawName.Add(childId.Value, childCuriosityName.Value);
}
}
AddTranslation(childEntryElement);
}
AddTranslation(entryElement);
}
TextAsset newAsset = new TextAsset(astroBodyFile.ToString());

View File

@ -17,6 +17,7 @@
<xs:element name="ID" type="xs:string"/>
<xs:element name="SourceID" type="xs:string" minOccurs="0"/>
<xs:element name="RumorName" type="xs:string"/>
<xs:element name="RumorNamePriority" type="xs:int" minOccurs="0"/>
<xs:element name="Text" type="xs:string"/>
</xs:sequence>
</xs:complexType>
@ -29,6 +30,34 @@
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="Entry" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="Name" type="xs:string"/>
<xs:element name="Curiosity" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="RumorFact" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="SourceID" type="xs:string" minOccurs="0"/>
<xs:element name="RumorName" type="xs:string"/>
<xs:element name="RumorNamePriority" type="xs:int" minOccurs="0"/>
<xs:element name="Text" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ExploreFact" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:all>
<xs:element name="ID" type="xs:string"/>
<xs:element name="Text" type="xs:string"/>
</xs:all>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>