mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Add translator text to the API
This commit is contained in:
parent
c1f1859648
commit
9bbfb8d4d8
@ -546,7 +546,7 @@ namespace NewHorizons.Builder.Props.TranslatorText
|
||||
|
||||
// make an entry in the cache for all these spirals
|
||||
|
||||
if (nhBody.Cache != null)
|
||||
if (nhBody?.Cache != null)
|
||||
{
|
||||
var cacheData = arranger.spirals.Select(spiralManipulator => new ArcCacheData()
|
||||
{
|
||||
|
||||
@ -147,6 +147,15 @@ namespace NewHorizons
|
||||
/// <returns></returns>
|
||||
(CharacterDialogueTree, RemoteDialogueTrigger) CreateDialogueFromXML(string textAssetID, string xml, string dialogueInfo, GameObject planetGO);
|
||||
|
||||
/// <summary>
|
||||
/// Allows the creation of Nomai text by directly passing the xml and translatorTextInfo json contents as strings
|
||||
/// </summary>
|
||||
/// <param name="xml">The contents of the translator text file as a string</param>
|
||||
/// <param name="textInfo">The json translator text info as a string. See the documentation/schema for what this can contain.</param>
|
||||
/// <param name="planetGO">The root planet rigidbody that this text is attached to. Any paths in the translatorTextInfo are relative to this body.</param>
|
||||
/// <returns></returns>
|
||||
GameObject CreateNomaiText(string xml, string textInfo, GameObject planetGO);
|
||||
|
||||
/// <summary>
|
||||
/// Directly add ship logs from XML. Call this method right before ShipLogManager awake.
|
||||
/// </summary>
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using NewHorizons.Builder.Props;
|
||||
using NewHorizons.Builder.Props.Audio;
|
||||
using NewHorizons.Builder.Props.TranslatorText;
|
||||
using NewHorizons.Builder.ShipLog;
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.External.Configs;
|
||||
@ -7,6 +8,7 @@ using NewHorizons.External.Modules;
|
||||
using NewHorizons.External.Modules.Props;
|
||||
using NewHorizons.External.Modules.Props.Audio;
|
||||
using NewHorizons.External.Modules.Props.Dialogue;
|
||||
using NewHorizons.External.Modules.TranslatorText;
|
||||
using NewHorizons.External.SerializableData;
|
||||
using NewHorizons.Utility;
|
||||
using NewHorizons.Utility.OWML;
|
||||
@ -259,6 +261,12 @@ namespace NewHorizons
|
||||
return DialogueBuilder.Make(planetGO, null, info, xml, textAssetID);
|
||||
}
|
||||
|
||||
public GameObject CreateNomaiText(string xml, string textInfo, GameObject planetGO)
|
||||
{
|
||||
var info = JsonConvert.DeserializeObject<TranslatorTextInfo>(textInfo);
|
||||
return TranslatorTextBuilder.Make(planetGO, null, info, null, xml);
|
||||
}
|
||||
|
||||
public void AddShipLogXML(IModBehaviour mod, XElement xml, string planetName, string imageFolder, Dictionary<string, Vector2> entryPositions, Dictionary<string, (Color colour, Color highlight)> curiousityColours)
|
||||
{
|
||||
// This method has to be called each time the ship log manager is created, i.e. each time a system loads so it will only ever be relevant to the current one.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user