mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Merge branch 'dev' of https://github.com/xen-42/outer-wilds-new-horizons into dev
This commit is contained in:
commit
dffb767fc8
@ -1,7 +1,6 @@
|
|||||||
using NewHorizons.External.Configs;
|
using NewHorizons.External.Configs;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
using OWML.ModHelper;
|
using OWML.ModHelper;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
using NewHorizons.External.Modules;
|
using NewHorizons.External.Modules;
|
||||||
using NewHorizons.Handlers;
|
using NewHorizons.Handlers;
|
||||||
using OWML.Common;
|
using OWML.Common;
|
||||||
|
using System.IO;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
namespace NewHorizons.Builder.Props
|
namespace NewHorizons.Builder.Props
|
||||||
@ -76,8 +77,9 @@ namespace NewHorizons.Builder.Props
|
|||||||
|
|
||||||
var dialogueTree = conversationZone.AddComponent<CharacterDialogueTree>();
|
var dialogueTree = conversationZone.AddComponent<CharacterDialogueTree>();
|
||||||
|
|
||||||
var xml = System.IO.File.ReadAllText(mod.Manifest.ModFolderPath + info.xmlFile);
|
var xml = File.ReadAllText(mod.Manifest.ModFolderPath + info.xmlFile);
|
||||||
var text = new TextAsset(xml);
|
var text = new TextAsset(xml);
|
||||||
|
text.name = Path.GetFileNameWithoutExtension(info.xmlFile);
|
||||||
|
|
||||||
dialogueTree.SetTextXml(text);
|
dialogueTree.SetTextXml(text);
|
||||||
AddTranslation(xml);
|
AddTranslation(xml);
|
||||||
|
|||||||
@ -3,6 +3,7 @@ using NewHorizons.Handlers;
|
|||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
using OWML.Common;
|
using OWML.Common;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@ -195,6 +196,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
|
|
||||||
computer._dictNomaiTextData = MakeNomaiTextDict(xmlPath);
|
computer._dictNomaiTextData = MakeNomaiTextDict(xmlPath);
|
||||||
computer._nomaiTextAsset = new TextAsset(xmlPath);
|
computer._nomaiTextAsset = new TextAsset(xmlPath);
|
||||||
|
computer._nomaiTextAsset.name = Path.GetFileNameWithoutExtension(info.xmlFile);
|
||||||
AddTranslation(xmlPath);
|
AddTranslation(xmlPath);
|
||||||
|
|
||||||
// Make sure the computer model is loaded
|
// Make sure the computer model is loaded
|
||||||
@ -242,6 +244,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
|
|
||||||
nomaiWallText._dictNomaiTextData = MakeNomaiTextDict(xmlPath);
|
nomaiWallText._dictNomaiTextData = MakeNomaiTextDict(xmlPath);
|
||||||
nomaiWallText._nomaiTextAsset = new TextAsset(xmlPath);
|
nomaiWallText._nomaiTextAsset = new TextAsset(xmlPath);
|
||||||
|
nomaiWallText._nomaiTextAsset.name = Path.GetFileNameWithoutExtension(info.xmlFile);
|
||||||
AddTranslation(xmlPath);
|
AddTranslation(xmlPath);
|
||||||
|
|
||||||
// Make sure the computer model is loaded
|
// Make sure the computer model is loaded
|
||||||
@ -273,6 +276,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
|
|
||||||
nomaiText._dictNomaiTextData = MakeNomaiTextDict(xmlPath);
|
nomaiText._dictNomaiTextData = MakeNomaiTextDict(xmlPath);
|
||||||
nomaiText._nomaiTextAsset = new TextAsset(xmlPath);
|
nomaiText._nomaiTextAsset = new TextAsset(xmlPath);
|
||||||
|
nomaiText._nomaiTextAsset.name = Path.GetFileNameWithoutExtension(info.xmlFile);
|
||||||
AddTranslation(xmlPath);
|
AddTranslation(xmlPath);
|
||||||
|
|
||||||
// Make sure the recorder model is loaded
|
// Make sure the recorder model is loaded
|
||||||
@ -306,6 +310,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
var nomaiWallText = nomaiWallTextObj.AddComponent<NomaiWallText>();
|
var nomaiWallText = nomaiWallTextObj.AddComponent<NomaiWallText>();
|
||||||
|
|
||||||
var text = new TextAsset(xmlPath);
|
var text = new TextAsset(xmlPath);
|
||||||
|
text.name = Path.GetFileNameWithoutExtension(info.xmlFile);
|
||||||
|
|
||||||
BuildArcs(xmlPath, nomaiWallText, nomaiWallTextObj, info);
|
BuildArcs(xmlPath, nomaiWallText, nomaiWallTextObj, info);
|
||||||
AddTranslation(xmlPath);
|
AddTranslation(xmlPath);
|
||||||
|
|||||||
35
NewHorizons/INewHorizons.cs
Normal file
35
NewHorizons/INewHorizons.cs
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
using OWML.Common;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.Events;
|
||||||
|
|
||||||
|
namespace NewHorizons
|
||||||
|
{
|
||||||
|
public interface INewHorizons
|
||||||
|
{
|
||||||
|
[Obsolete("Create(Dictionary<string, object> config) is deprecated, please use LoadConfigs(IModBehaviour mod) instead")]
|
||||||
|
void Create(Dictionary<string, object> config);
|
||||||
|
|
||||||
|
[Obsolete("Create(Dictionary<string, object> config) is deprecated, please use LoadConfigs(IModBehaviour mod) instead")]
|
||||||
|
void Create(Dictionary<string, object> config, IModBehaviour mod);
|
||||||
|
|
||||||
|
void LoadConfigs(IModBehaviour mod);
|
||||||
|
|
||||||
|
GameObject GetPlanet(string name);
|
||||||
|
|
||||||
|
string GetCurrentStarSystem();
|
||||||
|
|
||||||
|
UnityEvent<string> GetChangeStarSystemEvent();
|
||||||
|
|
||||||
|
UnityEvent<string> GetStarSystemLoadedEvent();
|
||||||
|
|
||||||
|
bool SetDefaultSystem(string name);
|
||||||
|
|
||||||
|
bool ChangeCurrentStarSystem(string name);
|
||||||
|
|
||||||
|
string[] GetInstalledAddons();
|
||||||
|
|
||||||
|
GameObject SpawnObject(GameObject planet, Sector sector, string propToCopyPath, Vector3 position, Vector3 eulerAngles, float scale, bool alignWithNormal);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -8,6 +8,7 @@ using NewHorizons.Handlers;
|
|||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
using NewHorizons.Utility.DebugMenu;
|
using NewHorizons.Utility.DebugMenu;
|
||||||
using NewHorizons.Utility.DebugUtilities;
|
using NewHorizons.Utility.DebugUtilities;
|
||||||
|
using NewHorizons.VoiceActing;
|
||||||
using OWML.Common;
|
using OWML.Common;
|
||||||
using OWML.ModHelper;
|
using OWML.ModHelper;
|
||||||
using System;
|
using System;
|
||||||
@ -183,6 +184,7 @@ namespace NewHorizons
|
|||||||
Instance.ModHelper.Menus.PauseMenu.OnInit += DebugReload.InitializePauseMenu;
|
Instance.ModHelper.Menus.PauseMenu.OnInit += DebugReload.InitializePauseMenu;
|
||||||
|
|
||||||
AchievementHandler.Init();
|
AchievementHandler.Init();
|
||||||
|
VoiceHandler.Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnDestroy()
|
public void OnDestroy()
|
||||||
|
|||||||
@ -9,9 +9,10 @@ using System.Linq;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Events;
|
using UnityEngine.Events;
|
||||||
using Logger = NewHorizons.Utility.Logger;
|
using Logger = NewHorizons.Utility.Logger;
|
||||||
|
|
||||||
namespace NewHorizons
|
namespace NewHorizons
|
||||||
{
|
{
|
||||||
public class NewHorizonsApi
|
public class NewHorizonsApi : INewHorizons
|
||||||
{
|
{
|
||||||
[Obsolete("Create(Dictionary<string, object> config) is deprecated, please use LoadConfigs(IModBehaviour mod) instead")]
|
[Obsolete("Create(Dictionary<string, object> config) is deprecated, please use LoadConfigs(IModBehaviour mod) instead")]
|
||||||
public void Create(Dictionary<string, object> config)
|
public void Create(Dictionary<string, object> config)
|
||||||
|
|||||||
7
NewHorizons/VoiceActing/IVoiceMod.cs
Normal file
7
NewHorizons/VoiceActing/IVoiceMod.cs
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
namespace NewHorizons.VoiceActing
|
||||||
|
{
|
||||||
|
public interface IVoiceMod
|
||||||
|
{
|
||||||
|
void RegisterAssets(string assetsFolder);
|
||||||
|
}
|
||||||
|
}
|
||||||
41
NewHorizons/VoiceActing/VoiceHandler.cs
Normal file
41
NewHorizons/VoiceActing/VoiceHandler.cs
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
using NewHorizons.Utility;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace NewHorizons.VoiceActing
|
||||||
|
{
|
||||||
|
public static class VoiceHandler
|
||||||
|
{
|
||||||
|
public static bool Enabled { get; private set; }
|
||||||
|
|
||||||
|
private static IVoiceMod API;
|
||||||
|
|
||||||
|
public static void Init()
|
||||||
|
{
|
||||||
|
API = Main.Instance.ModHelper.Interaction.TryGetModApi<IVoiceMod>("Krevace.VoiceMod");
|
||||||
|
|
||||||
|
if (API == null)
|
||||||
|
{
|
||||||
|
Logger.Log("VoiceMod isn't installed");
|
||||||
|
Enabled = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Enabled = true;
|
||||||
|
|
||||||
|
foreach (var mod in Main.Instance.GetDependants().Append(Main.Instance))
|
||||||
|
{
|
||||||
|
var folder = $"{mod.ModHelper.Manifest.ModFolderPath}VoiceMod";
|
||||||
|
if (Directory.Exists(folder))
|
||||||
|
{
|
||||||
|
Logger.Log($"Registering VoiceMod audio for {mod.ModHelper.Manifest.Name} from {folder}");
|
||||||
|
API.RegisterAssets(folder);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Logger.Log($"Didn't find VoiceMod audio for {mod.ModHelper.Manifest.Name} at {folder}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user