mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
1.6.1 (#399)
## Minor features - Added new `stretch` option to scatter and details, allowing setting the local scale on the x, y, and z axes. - Added `volume` option to AudioVolumes for setting how loud the audio is. ## Bug fixes - Reimplemented group builder that was accidentally disabled. - Fix components flagged to be removed throwing errors on Awake - Hardcoded backwards compat for mods broken by keepLoaded = false like WARIO - Fixed two debug raycast prompts appearing - Sorted Nomai text prefabs to (hopefully) stop future updates breaking them again (you have to re-orient them still since patch 13, sorry) - Fixed some more paths that might be broken on Linux
This commit is contained in:
commit
2c23db7ef3
@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"$schema": "https://raw.githubusercontent.com/Outer-Wilds-New-Horizons/new-horizons/main/NewHorizons/Schemas/addon_manifest_schema.json",
|
||||||
"credits": [
|
"credits": [
|
||||||
"xen#Mod Director\n#Programmer",
|
"xen#Mod Director\n#Programmer",
|
||||||
"Bwc9876#Mod Manager\n#Programmer\n#Dev Ops",
|
"Bwc9876#Mod Manager\n#Programmer\n#Dev Ops",
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
using NewHorizons.Builder.General;
|
||||||
using NewHorizons.External.Configs;
|
using NewHorizons.External.Configs;
|
||||||
using NewHorizons.External.Modules;
|
using NewHorizons.External.Modules;
|
||||||
using NewHorizons.Handlers;
|
using NewHorizons.Handlers;
|
||||||
@ -98,11 +99,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
prop.transform.rotation = go.transform.TransformRotation(rot);
|
prop.transform.rotation = go.transform.TransformRotation(rot);
|
||||||
}
|
}
|
||||||
|
|
||||||
prop.transform.localScale = detail.scale != 0 ? Vector3.one * detail.scale : prefab.transform.localScale;
|
prop.transform.localScale = detail.stretch ?? (detail.scale != 0 ? Vector3.one * detail.scale : prefab.transform.localScale);
|
||||||
|
|
||||||
prop.SetActive(true);
|
|
||||||
|
|
||||||
if (prop == null) return null;
|
|
||||||
|
|
||||||
if (detail.removeChildren != null)
|
if (detail.removeChildren != null)
|
||||||
{
|
{
|
||||||
@ -159,6 +156,9 @@ namespace NewHorizons.Builder.Props
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!detail.keepLoaded) GroupsBuilder.Make(prop, sector);
|
||||||
|
prop.SetActive(true);
|
||||||
|
|
||||||
return prop;
|
return prop;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -48,7 +48,11 @@ namespace NewHorizons.Builder.Props
|
|||||||
private static void InitPrefabs()
|
private static void InitPrefabs()
|
||||||
{
|
{
|
||||||
// Just take every scroll and get the first arc
|
// Just take every scroll and get the first arc
|
||||||
var existingArcs = GameObject.FindObjectsOfType<ScrollItem>().Select(x => x?._nomaiWallText?.gameObject?.transform?.Find("Arc 1")?.gameObject).Where(x => x != null).ToArray();
|
var existingArcs = GameObject.FindObjectsOfType<ScrollItem>()
|
||||||
|
.Select(x => x?._nomaiWallText?.gameObject?.transform?.Find("Arc 1")?.gameObject)
|
||||||
|
.Where(x => x != null)
|
||||||
|
.OrderBy(x => x.transform.GetPath()) // order by path so game updates dont break things
|
||||||
|
.ToArray();
|
||||||
_arcPrefabs = new List<GameObject>();
|
_arcPrefabs = new List<GameObject>();
|
||||||
_childArcPrefabs = new List<GameObject>();
|
_childArcPrefabs = new List<GameObject>();
|
||||||
foreach (var existingArc in existingArcs)
|
foreach (var existingArc in existingArcs)
|
||||||
@ -67,7 +71,11 @@ namespace NewHorizons.Builder.Props
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var existingGhostArcs = GameObject.FindObjectsOfType<GhostWallText>().Select(x => x?._textLine?.gameObject).Where(x => x != null).ToArray();
|
var existingGhostArcs = GameObject.FindObjectsOfType<GhostWallText>()
|
||||||
|
.Select(x => x?._textLine?.gameObject)
|
||||||
|
.Where(x => x != null)
|
||||||
|
.OrderBy(x => x.transform.GetPath()) // order by path so game updates dont break things
|
||||||
|
.ToArray();
|
||||||
_ghostArcPrefabs = new List<GameObject>();
|
_ghostArcPrefabs = new List<GameObject>();
|
||||||
foreach (var existingArc in existingGhostArcs)
|
foreach (var existingArc in existingGhostArcs)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -106,7 +106,9 @@ namespace NewHorizons.Builder.Props
|
|||||||
|
|
||||||
var id = RemoteHandler.GetPlatformID(info.id);
|
var id = RemoteHandler.GetPlatformID(info.id);
|
||||||
|
|
||||||
var decal = ImageUtilities.GetTexture(mod, info.decalPath, false, false);
|
Texture2D decal = Texture2D.whiteTexture;
|
||||||
|
if (!string.IsNullOrWhiteSpace(info.decalPath)) decal = ImageUtilities.GetTexture(mod, info.decalPath, false, false);
|
||||||
|
else Logger.LogError($"Missing decal path on [{info.id}] for [{go.name}]");
|
||||||
|
|
||||||
if (info.platform != null)
|
if (info.platform != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -69,6 +69,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
var detailInfo = new PropModule.DetailInfo()
|
var detailInfo = new PropModule.DetailInfo()
|
||||||
{
|
{
|
||||||
scale = propInfo.scale,
|
scale = propInfo.scale,
|
||||||
|
stretch = propInfo.stretch,
|
||||||
keepLoaded = propInfo.keepLoaded
|
keepLoaded = propInfo.keepLoaded
|
||||||
};
|
};
|
||||||
var scatterPrefab = DetailBuilder.Make(go, sector, prefab, detailInfo);
|
var scatterPrefab = DetailBuilder.Make(go, sector, prefab, detailInfo);
|
||||||
|
|||||||
@ -206,7 +206,7 @@ namespace NewHorizons.Builder.ShipLog
|
|||||||
|
|
||||||
private static Sprite GetEntrySprite(string entryId, NewHorizonsBody body, bool logError)
|
private static Sprite GetEntrySprite(string entryId, NewHorizonsBody body, bool logError)
|
||||||
{
|
{
|
||||||
string relativePath = body.Config.ShipLog.spriteFolder + "/" + entryId + ".png";
|
string relativePath = Path.Combine(body.Config.ShipLog.spriteFolder, entryId + ".png");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Texture2D newTexture = ImageUtilities.GetTexture(body.Mod, relativePath);
|
Texture2D newTexture = ImageUtilities.GetTexture(body.Mod, relativePath);
|
||||||
|
|||||||
@ -46,6 +46,7 @@ namespace NewHorizons.Builder.Volumes
|
|||||||
var owAudioSource = go.AddComponent<OWAudioSource>();
|
var owAudioSource = go.AddComponent<OWAudioSource>();
|
||||||
owAudioSource._audioSource = audioSource;
|
owAudioSource._audioSource = audioSource;
|
||||||
owAudioSource.loop = info.loop;
|
owAudioSource.loop = info.loop;
|
||||||
|
owAudioSource.SetMaxVolume(info.volume);
|
||||||
owAudioSource.SetTrack((OWAudioMixer.TrackName)Enum.Parse(typeof(OWAudioMixer.TrackName), Enum.GetName(typeof(AudioMixerTrackName), info.track)));
|
owAudioSource.SetTrack((OWAudioMixer.TrackName)Enum.Parse(typeof(OWAudioMixer.TrackName), Enum.GetName(typeof(AudioMixerTrackName), info.track)));
|
||||||
AudioUtilities.SetAudioClip(owAudioSource, info.audio, mod);
|
AudioUtilities.SetAudioClip(owAudioSource, info.audio, mod);
|
||||||
|
|
||||||
|
|||||||
12
NewHorizons/External/Modules/PropModule.cs
vendored
12
NewHorizons/External/Modules/PropModule.cs
vendored
@ -123,7 +123,12 @@ namespace NewHorizons.External.Modules
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Scale this prop once it is placed
|
/// Scale this prop once it is placed
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public float scale = 1f;
|
[DefaultValue(1f)] public float scale = 1f;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Scale each axis of the prop. Overrides `scale`.
|
||||||
|
/// </summary>
|
||||||
|
public MVector3 stretch;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The number used as entropy for scattering the props
|
/// The number used as entropy for scattering the props
|
||||||
@ -200,6 +205,11 @@ namespace NewHorizons.External.Modules
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[DefaultValue(1f)] public float scale = 1f;
|
[DefaultValue(1f)] public float scale = 1f;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Scale each axis of the prop. Overrides `scale`.
|
||||||
|
/// </summary>
|
||||||
|
public MVector3 stretch;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// If this value is not null, this prop will be quantum. Assign this field to the id of the quantum group it should be a part of. The group it is assigned to determines what kind of quantum object it is
|
/// If this value is not null, this prop will be quantum. Assign this field to the id of the quantum group it should be a part of. The group it is assigned to determines what kind of quantum object it is
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -4,6 +4,7 @@ using Newtonsoft.Json.Converters;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Runtime.Serialization;
|
using System.Runtime.Serialization;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@ -134,6 +135,13 @@ namespace NewHorizons.External.Modules
|
|||||||
/// Whether to loop this audio while in this audio volume or just play it once
|
/// Whether to loop this audio while in this audio volume or just play it once
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DefaultValue(true)] public bool loop = true;
|
[DefaultValue(true)] public bool loop = true;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The loudness of the audio
|
||||||
|
/// </summary>
|
||||||
|
[Range(0f, 1f)]
|
||||||
|
[DefaultValue(1f)]
|
||||||
|
public float volume = 1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
|
|||||||
@ -571,11 +571,11 @@ namespace NewHorizons
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Has to go before translations for achievements
|
// Has to go before translations for achievements
|
||||||
if (File.Exists(folder + "addon-manifest.json"))
|
if (File.Exists(Path.Combine(folder, "addon-manifest.json")))
|
||||||
{
|
{
|
||||||
LoadAddonManifest("addon-manifest.json", mod);
|
LoadAddonManifest("addon-manifest.json", mod);
|
||||||
}
|
}
|
||||||
if (Directory.Exists(folder + @"translations\"))
|
if (Directory.Exists(Path.Combine(folder, "translations")))
|
||||||
{
|
{
|
||||||
LoadTranslations(folder, mod);
|
LoadTranslations(folder, mod);
|
||||||
}
|
}
|
||||||
@ -603,15 +603,15 @@ namespace NewHorizons
|
|||||||
var foundFile = false;
|
var foundFile = false;
|
||||||
foreach (TextTranslation.Language language in Enum.GetValues(typeof(TextTranslation.Language)))
|
foreach (TextTranslation.Language language in Enum.GetValues(typeof(TextTranslation.Language)))
|
||||||
{
|
{
|
||||||
if (language == TextTranslation.Language.UNKNOWN || language == TextTranslation.Language.TOTAL) continue;
|
if (language is TextTranslation.Language.UNKNOWN or TextTranslation.Language.TOTAL) continue;
|
||||||
|
|
||||||
var relativeFile = $"translations/{language.ToString().ToLower()}.json";
|
var relativeFile = Path.Combine("translations", language.ToString().ToLower() + ".json");
|
||||||
|
|
||||||
if (File.Exists($"{folder}{relativeFile}"))
|
if (File.Exists(Path.Combine(folder, relativeFile)))
|
||||||
{
|
{
|
||||||
Logger.LogVerbose($"Registering {language} translation from {mod.ModHelper.Manifest.Name} from {relativeFile}");
|
Logger.LogVerbose($"Registering {language} translation from {mod.ModHelper.Manifest.Name} from {relativeFile}");
|
||||||
|
|
||||||
var config = new TranslationConfig($"{folder}{relativeFile}");
|
var config = new TranslationConfig(Path.Combine(folder, relativeFile));
|
||||||
|
|
||||||
foundFile = true;
|
foundFile = true;
|
||||||
|
|
||||||
|
|||||||
@ -1049,6 +1049,10 @@
|
|||||||
"format": "float",
|
"format": "float",
|
||||||
"default": 1.0
|
"default": 1.0
|
||||||
},
|
},
|
||||||
|
"stretch": {
|
||||||
|
"description": "Scale each axis of the prop. Overrides `scale`.",
|
||||||
|
"$ref": "#/definitions/MVector3"
|
||||||
|
},
|
||||||
"quantumGroupID": {
|
"quantumGroupID": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "If this value is not null, this prop will be quantum. Assign this field to the id of the quantum group it should be a part of. The group it is assigned to determines what kind of quantum object it is"
|
"description": "If this value is not null, this prop will be quantum. Assign this field to the id of the quantum group it should be a part of. The group it is assigned to determines what kind of quantum object it is"
|
||||||
@ -1372,7 +1376,12 @@
|
|||||||
"scale": {
|
"scale": {
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"description": "Scale this prop once it is placed",
|
"description": "Scale this prop once it is placed",
|
||||||
"format": "float"
|
"format": "float",
|
||||||
|
"default": 1.0
|
||||||
|
},
|
||||||
|
"stretch": {
|
||||||
|
"description": "Scale each axis of the prop. Overrides `scale`.",
|
||||||
|
"$ref": "#/definitions/MVector3"
|
||||||
},
|
},
|
||||||
"seed": {
|
"seed": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
@ -2501,6 +2510,14 @@
|
|||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Whether to loop this audio while in this audio volume or just play it once",
|
"description": "Whether to loop this audio while in this audio volume or just play it once",
|
||||||
"default": true
|
"default": true
|
||||||
|
},
|
||||||
|
"volume": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "The loudness of the audio",
|
||||||
|
"format": "float",
|
||||||
|
"default": 1.0,
|
||||||
|
"maximum": 1.0,
|
||||||
|
"minimum": 0.0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -19,24 +19,31 @@ namespace NewHorizons.Utility.DebugUtilities
|
|||||||
|
|
||||||
private ScreenPrompt _raycastPrompt;
|
private ScreenPrompt _raycastPrompt;
|
||||||
|
|
||||||
private void Awake()
|
private void Start()
|
||||||
{
|
{
|
||||||
_rb = this.GetRequiredComponent<OWRigidbody>();
|
_rb = this.GetRequiredComponent<OWRigidbody>();
|
||||||
|
|
||||||
_raycastPrompt = new ScreenPrompt(TranslationHandler.GetTranslation("DEBUG_RAYCAST", TranslationHandler.TextType.UI) + " <CMD>", ImageUtilities.GetButtonSprite(KeyCode.P));
|
if (_raycastPrompt == null)
|
||||||
|
{
|
||||||
Locator.GetPromptManager().AddScreenPrompt(_raycastPrompt, PromptPosition.UpperRight, false);
|
_raycastPrompt = new ScreenPrompt(TranslationHandler.GetTranslation("DEBUG_RAYCAST", TranslationHandler.TextType.UI) + " <CMD>", ImageUtilities.GetButtonSprite(KeyCode.P));
|
||||||
|
Locator.GetPromptManager().AddScreenPrompt(_raycastPrompt, PromptPosition.UpperRight, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnDestroy()
|
private void OnDestroy()
|
||||||
{
|
{
|
||||||
Locator.GetPromptManager()?.RemoveScreenPrompt(_raycastPrompt, PromptPosition.UpperRight);
|
if (_raycastPrompt != null)
|
||||||
|
{
|
||||||
|
Locator.GetPromptManager()?.RemoveScreenPrompt(_raycastPrompt, PromptPosition.UpperRight);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
UpdatePromptVisibility();
|
UpdatePromptVisibility();
|
||||||
|
|
||||||
if (!Main.Debug) return;
|
if (!Main.Debug) return;
|
||||||
|
|
||||||
if (Keyboard.current == null) return;
|
if (Keyboard.current == null) return;
|
||||||
|
|
||||||
if (Keyboard.current[Key.P].wasReleasedThisFrame)
|
if (Keyboard.current[Key.P].wasReleasedThisFrame)
|
||||||
@ -48,7 +55,10 @@ namespace NewHorizons.Utility.DebugUtilities
|
|||||||
|
|
||||||
public void UpdatePromptVisibility()
|
public void UpdatePromptVisibility()
|
||||||
{
|
{
|
||||||
_raycastPrompt.SetVisibility(!OWTime.IsPaused() && Main.Debug);
|
if (_raycastPrompt != null)
|
||||||
|
{
|
||||||
|
_raycastPrompt.SetVisibility(!OWTime.IsPaused() && Main.Debug);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
using NewHorizons.External.Configs;
|
using NewHorizons.External.Configs;
|
||||||
using OWML.Common;
|
using OWML.Common;
|
||||||
|
using System.Linq;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
namespace NewHorizons.Utility
|
namespace NewHorizons.Utility
|
||||||
{
|
{
|
||||||
@ -10,6 +11,8 @@ namespace NewHorizons.Utility
|
|||||||
Config = config;
|
Config = config;
|
||||||
Mod = mod;
|
Mod = mod;
|
||||||
RelativePath = relativePath;
|
RelativePath = relativePath;
|
||||||
|
|
||||||
|
Migrate();
|
||||||
}
|
}
|
||||||
|
|
||||||
public PlanetConfig Config;
|
public PlanetConfig Config;
|
||||||
@ -17,5 +20,31 @@ namespace NewHorizons.Utility
|
|||||||
public string RelativePath;
|
public string RelativePath;
|
||||||
|
|
||||||
public GameObject Object;
|
public GameObject Object;
|
||||||
|
|
||||||
|
#region Migration
|
||||||
|
private static readonly string[] _keepLoadedModsList = new string[]
|
||||||
|
{
|
||||||
|
"CreativeNameTxt.theirhomeworld",
|
||||||
|
"Roggsy.enterthewarioverse",
|
||||||
|
"Jammer.jammerlore",
|
||||||
|
"ErroneousCreationist.solarneighbourhood",
|
||||||
|
"ErroneousCreationist.incursionfinaldawn"
|
||||||
|
};
|
||||||
|
|
||||||
|
private void Migrate()
|
||||||
|
{
|
||||||
|
// Some old mods get really broken by this change in 1.6.1
|
||||||
|
if (_keepLoadedModsList.Contains(Mod.ModHelper.Manifest.UniqueName))
|
||||||
|
{
|
||||||
|
if (Config?.Props?.details != null)
|
||||||
|
{
|
||||||
|
foreach (var detail in Config.Props.details)
|
||||||
|
{
|
||||||
|
detail.keepLoaded = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -119,7 +119,7 @@ namespace NewHorizons.Utility
|
|||||||
|
|
||||||
var name = names.Last();
|
var name = names.Last();
|
||||||
if (warn) Logger.LogWarning($"Couldn't find object in path {path}, will look for potential matches for name {name}");
|
if (warn) Logger.LogWarning($"Couldn't find object in path {path}, will look for potential matches for name {name}");
|
||||||
// 3: find resource to include inactive objects (but skip prefabs
|
// 3: find resource to include inactive objects (but skip prefabs)
|
||||||
go = Resources.FindObjectsOfTypeAll<GameObject>()
|
go = Resources.FindObjectsOfTypeAll<GameObject>()
|
||||||
.FirstOrDefault(x => x.name == name && x.scene.name != null);
|
.FirstOrDefault(x => x.name == name && x.scene.name != null);
|
||||||
if (go)
|
if (go)
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
"author": "xen, Bwc9876, clay, MegaPiggy, John, Hawkbar, Trifid, Book",
|
"author": "xen, Bwc9876, clay, MegaPiggy, John, Hawkbar, Trifid, Book",
|
||||||
"name": "New Horizons",
|
"name": "New Horizons",
|
||||||
"uniqueName": "xen.NewHorizons",
|
"uniqueName": "xen.NewHorizons",
|
||||||
"version": "1.6.0",
|
"version": "1.6.1",
|
||||||
"owmlVersion": "2.6.0",
|
"owmlVersion": "2.6.0",
|
||||||
"dependencies": [ "JohnCorby.VanillaFix", "_nebula.MenuFramework", "xen.CommonCameraUtility" ],
|
"dependencies": [ "JohnCorby.VanillaFix", "_nebula.MenuFramework", "xen.CommonCameraUtility" ],
|
||||||
"conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_Randomizer" ],
|
"conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_Randomizer" ],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user