mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Added Alt Text And Images
This commit is contained in:
parent
14f0e4cf80
commit
87244e317c
@ -116,7 +116,8 @@ namespace NewHorizons.Builder.ShipLog
|
|||||||
{
|
{
|
||||||
id = entry._id,
|
id = entry._id,
|
||||||
cardPosition = entryPosition,
|
cardPosition = entryPosition,
|
||||||
sprite = body.Config.ShipLog.spriteFolder == null ? null : GetEntrySprite(entry._id, body)
|
sprite = body.Config.ShipLog.spriteFolder == null ? null : GetEntrySprite(entry._id, body),
|
||||||
|
altSprite = body.Config.ShipLog.spriteFolder == null ? null : GetEntrySprite(entry._id + "_ALT", body)
|
||||||
};
|
};
|
||||||
entry.SetSprite(newData.sprite == null ? manager._shipLogLibrary.defaultEntrySprite : newData.sprite);
|
entry.SetSprite(newData.sprite == null ? manager._shipLogLibrary.defaultEntrySprite : newData.sprite);
|
||||||
manager._entryDataDict.Add(entry._id, newData);
|
manager._entryDataDict.Add(entry._id, newData);
|
||||||
@ -150,23 +151,35 @@ namespace NewHorizons.Builder.ShipLog
|
|||||||
table[rumorName.Value] = rumorName.Value;
|
table[rumorName.Value] = rumorName.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
XElement rumorText = rumorFact.Element("Text");
|
AddTextTranslation(rumorFact, name, table);
|
||||||
if (rumorText != null)
|
AddAltTextTranslation(rumorFact, name, table);
|
||||||
{
|
|
||||||
table[name + rumorText.Value] = rumorText.Value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
foreach (XElement exploreFact in entry.Elements("ExploreFact"))
|
foreach (XElement exploreFact in entry.Elements("ExploreFact"))
|
||||||
{
|
{
|
||||||
XElement exploreText = exploreFact.Element("Text");
|
AddTextTranslation(exploreFact, name, table);
|
||||||
if (exploreText != null)
|
AddAltTextTranslation(exploreFact, name, table);
|
||||||
{
|
|
||||||
table[name + exploreText.Value] = exploreText.Value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void AddTextTranslation(XElement fact, string name, Dictionary<string, string> table)
|
||||||
|
{
|
||||||
|
XElement textElement = fact.Element("Text");
|
||||||
|
if (textElement != null)
|
||||||
|
{
|
||||||
|
table[name + textElement.Value] = textElement.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void AddAltTextTranslation(XElement fact, string name, Dictionary<string, string> table)
|
||||||
|
{
|
||||||
|
XElement altTextElement = fact.Element("AltText");
|
||||||
|
if (altTextElement != null)
|
||||||
|
{
|
||||||
|
AddTextTranslation(altTextElement, name, table);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void UpdateEntryCuriosity(ref ShipLogEntry entry)
|
public static void UpdateEntryCuriosity(ref ShipLogEntry entry)
|
||||||
{
|
{
|
||||||
if (_entryIdToRawName.ContainsKey(entry._id))
|
if (_entryIdToRawName.ContainsKey(entry._id))
|
||||||
|
|||||||
@ -1,67 +1,65 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||||
|
<!-- Astro Object Entry Info -->
|
||||||
<xs:element name="AstroObjectEntry">
|
<xs:element name="AstroObjectEntry">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element name="ID" type="xs:string"/>
|
<xs:element name="ID" type="xs:string"/>
|
||||||
<xs:element name="Entry" maxOccurs="unbounded">
|
<xs:element name="Entry" maxOccurs="unbounded" type="entryInfo">
|
||||||
<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="IsCuriosity" 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: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>
|
</xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
|
|
||||||
|
<!-- Entry Info -->
|
||||||
|
<xs:complexType name="entryInfo">
|
||||||
|
<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="IsCuriosity" minOccurs="0" maxOccurs="unbounded"/>
|
||||||
|
<xs:element name="IgnoreMoreToExplore" minOccurs="0"/>
|
||||||
|
<xs:element name="IgnoreMoreToExploreCondition" type="xs:string" minOccurs="0"/>
|
||||||
|
<xs:element name="AltPhotoCondition" type="xs:string" minOccurs="0"/>
|
||||||
|
<xs:element name="RumorFact" type="rumorFactInfo" minOccurs="0" maxOccurs="unbounded"/>
|
||||||
|
<xs:element name="ExploreFact" type="exploreFactInfo" minOccurs="0" maxOccurs="unbounded"/>
|
||||||
|
<xs:element name="Entry" type="entryInfo" minOccurs="0" maxOccurs="unbounded"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
|
||||||
|
<!-- Rumor Fact Info -->
|
||||||
|
<xs:complexType name="rumorFactInfo">
|
||||||
|
<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" minOccurs="0"/>
|
||||||
|
<xs:element name="RumorNamePriority" type="xs:int" minOccurs="0"/>
|
||||||
|
<xs:element name="IgnoreMoreToExplore" minOccurs="0"/>
|
||||||
|
<xs:group ref="textData"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
|
||||||
|
<!-- Explore Fact Info -->
|
||||||
|
<xs:complexType name="exploreFactInfo">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="ID" type="xs:string"/>
|
||||||
|
<xs:element name="IgnoreMoreToExplore" minOccurs="0"/>
|
||||||
|
<xs:group ref="textData"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
|
||||||
|
<!-- Text Data Group -->
|
||||||
|
<xs:group name="textData">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Text" type="xs:string"/>
|
||||||
|
<xs:element name="AltText" minOccurs="0">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Text" type="xs:string"/>
|
||||||
|
<xs:element name="Condition" type="xs:string"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:group>
|
||||||
</xs:schema>
|
</xs:schema>
|
||||||
Loading…
x
Reference in New Issue
Block a user