From 16322ebbd6f18a1270d36b05a575a8fcde0704da Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Mon, 23 May 2022 17:00:10 -0700 Subject: [PATCH 1/5] do da stanky leg --- NewHorizons/Builder/Atmosphere/FogBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Atmosphere/FogBuilder.cs b/NewHorizons/Builder/Atmosphere/FogBuilder.cs index 1dbf2ffd..06a83f14 100644 --- a/NewHorizons/Builder/Atmosphere/FogBuilder.cs +++ b/NewHorizons/Builder/Atmosphere/FogBuilder.cs @@ -33,7 +33,7 @@ namespace NewHorizons.Builder.Atmosphere PFC.fogRadius = atmo.fogSize; PFC.fogDensity = atmo.fogDensity; PFC.fogExponent = 1f; - PFC.fogColorRampTexture = atmo.FogTint == null ? _ramp : ImageUtilities.TintImage(_ramp, atmo.FogTint.ToColor()); + PFC.fogColorRampTexture = atmo.fogTint == null ? _ramp : ImageUtilities.TintImage(_ramp, atmo.fogTint); PFC.fogColorRampIntensity = 1f; PFC.fogTint = atmo.fogTint; From baba1b7307e18b63ccf002063acbe0ad7a1655a1 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Mon, 23 May 2022 17:00:10 -0700 Subject: [PATCH 2/5] FogBuilder: fix atom.FogTint and remove ToColor cuz hee haw --- NewHorizons/Builder/Atmosphere/FogBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Atmosphere/FogBuilder.cs b/NewHorizons/Builder/Atmosphere/FogBuilder.cs index 1dbf2ffd..06a83f14 100644 --- a/NewHorizons/Builder/Atmosphere/FogBuilder.cs +++ b/NewHorizons/Builder/Atmosphere/FogBuilder.cs @@ -33,7 +33,7 @@ namespace NewHorizons.Builder.Atmosphere PFC.fogRadius = atmo.fogSize; PFC.fogDensity = atmo.fogDensity; PFC.fogExponent = 1f; - PFC.fogColorRampTexture = atmo.FogTint == null ? _ramp : ImageUtilities.TintImage(_ramp, atmo.FogTint.ToColor()); + PFC.fogColorRampTexture = atmo.fogTint == null ? _ramp : ImageUtilities.TintImage(_ramp, atmo.fogTint); PFC.fogColorRampIntensity = 1f; PFC.fogTint = atmo.fogTint; From e1eb581a38fa7ec962946780d010163c8f3f0e0f Mon Sep 17 00:00:00 2001 From: Ben C Date: Mon, 23 May 2022 20:16:04 -0400 Subject: [PATCH 3/5] Delete the StarStreamerController things --- NewHorizons/Builder/Body/StarBuilder.cs | 26 ++++++++++++------- .../StarEvolutionController.cs | 1 + 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/NewHorizons/Builder/Body/StarBuilder.cs b/NewHorizons/Builder/Body/StarBuilder.cs index a9458c16..1ecdef2e 100644 --- a/NewHorizons/Builder/Body/StarBuilder.cs +++ b/NewHorizons/Builder/Body/StarBuilder.cs @@ -4,6 +4,7 @@ using NewHorizons.Utility; using OWML.Utils; using UnityEngine; using NewHorizons.External.Modules.VariableSize; +using Logger = NewHorizons.Utility.Logger; namespace NewHorizons.Builder.Body { @@ -22,7 +23,7 @@ namespace NewHorizons.Builder.Body { var starGO = MakeStarGraphics(planetGO, sector, starModule); - var sunAudio = GameObject.Instantiate(GameObject.Find("Sun_Body/Sector_SUN/Audio_SUN"), starGO.transform); + var sunAudio = Object.Instantiate(GameObject.Find("Sun_Body/Sector_SUN/Audio_SUN"), starGO.transform); sunAudio.transform.localPosition = Vector3.zero; sunAudio.transform.localScale = Vector3.one; sunAudio.transform.Find("SurfaceAudio_Sun").GetComponent().maxDistance = starModule.size * 2f; @@ -35,11 +36,11 @@ namespace NewHorizons.Builder.Body GameObject sunAtmosphere = null; if (starModule.hasAtmosphere) { - sunAtmosphere = GameObject.Instantiate(GameObject.Find("Sun_Body/Atmosphere_SUN"), starGO.transform); + sunAtmosphere = Object.Instantiate(GameObject.Find("Sun_Body/Atmosphere_SUN"), starGO.transform); sunAtmosphere.transform.position = planetGO.transform.position; sunAtmosphere.transform.localScale = Vector3.one * OuterRadiusRatio; sunAtmosphere.name = "Atmosphere_Star"; - PlanetaryFogController fog = sunAtmosphere.transform.Find("FogSphere").GetComponent(); + var fog = sunAtmosphere.transform.Find("FogSphere").GetComponent(); if (starModule.tint != null) { fog.fogTint = starModule.tint; @@ -58,17 +59,17 @@ namespace NewHorizons.Builder.Body fog.lodFadeDistance = fog.fogRadius * (StarBuilder.OuterRadiusRatio - 1f); } - var ambientLightGO = GameObject.Instantiate(GameObject.Find("Sun_Body/AmbientLight_SUN"), starGO.transform); + var ambientLightGO = Object.Instantiate(GameObject.Find("Sun_Body/AmbientLight_SUN"), starGO.transform); ambientLightGO.transform.localPosition = Vector3.zero; ambientLightGO.name = "AmbientLight_Star"; - var heatVolume = GameObject.Instantiate(GameObject.Find("Sun_Body/Sector_SUN/Volumes_SUN/HeatVolume"), starGO.transform); + var heatVolume = Object.Instantiate(GameObject.Find("Sun_Body/Sector_SUN/Volumes_SUN/HeatVolume"), starGO.transform); heatVolume.transform.localPosition = Vector3.zero; heatVolume.transform.localScale = Vector3.one; heatVolume.GetComponent().radius = 1f; heatVolume.name = "HeatVolume"; - var deathVolume = GameObject.Instantiate(GameObject.Find("Sun_Body/Sector_SUN/Volumes_SUN/ScaledVolumesRoot/DestructionFluidVolume"), starGO.transform); + var deathVolume = Object.Instantiate(GameObject.Find("Sun_Body/Sector_SUN/Volumes_SUN/ScaledVolumesRoot/DestructionFluidVolume"), starGO.transform); deathVolume.transform.localPosition = Vector3.zero; deathVolume.transform.localScale = Vector3.one; deathVolume.GetComponent().radius = 1f; @@ -165,12 +166,12 @@ namespace NewHorizons.Builder.Body var starGO = new GameObject("Star"); starGO.transform.parent = sector?.transform ?? rootObject.transform; - var sunSurface = GameObject.Instantiate(GameObject.Find("Sun_Body/Sector_SUN/Geometry_SUN/Surface"), starGO.transform); + var sunSurface = Object.Instantiate(GameObject.Find("Sun_Body/Sector_SUN/Geometry_SUN/Surface"), starGO.transform); sunSurface.transform.position = rootObject.transform.position; sunSurface.transform.localScale = Vector3.one; sunSurface.name = "Surface"; - var solarFlareEmitter = GameObject.Instantiate(GameObject.Find("Sun_Body/Sector_SUN/Effects_SUN/SolarFlareEmitter"), starGO.transform); + var solarFlareEmitter = Object.Instantiate(GameObject.Find("Sun_Body/Sector_SUN/Effects_SUN/SolarFlareEmitter"), starGO.transform); solarFlareEmitter.transform.localPosition = Vector3.zero; solarFlareEmitter.transform.localScale = Vector3.one; solarFlareEmitter.name = "SolarFlareEmitter"; @@ -206,8 +207,8 @@ namespace NewHorizons.Builder.Body var adjustedColour = new Color(colour.r * mod, colour.g * mod, colour.b * mod); surface.sharedMaterial.color = adjustedColour; - Color.RGBToHSV(adjustedColour, out float H, out float S, out float V); - var darkenedColor = Color.HSVToRGB(H, S * 1.2f, V * 0.05f); + Color.RGBToHSV(adjustedColour, out var h, out var s, out var v); + var darkenedColor = Color.HSVToRGB(h, s * 1.2f, v * 0.05f); if (starModule.endTint != null) { @@ -245,6 +246,11 @@ namespace NewHorizons.Builder.Body moteMaterial.color = new Color(colour.r * 3f, colour.g * 3f, colour.b * 3f, moteMaterial.color.a); } + foreach (var controller in supernova.GetComponentsInChildren()) + { + Object.DestroyImmediate(controller); + } + supernovaGO.SetActive(true); return supernova; diff --git a/NewHorizons/Components/SizeControllers/StarEvolutionController.cs b/NewHorizons/Components/SizeControllers/StarEvolutionController.cs index 40da8bdb..6a7605f2 100644 --- a/NewHorizons/Components/SizeControllers/StarEvolutionController.cs +++ b/NewHorizons/Components/SizeControllers/StarEvolutionController.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using UnityEngine; +using Logger = NewHorizons.Utility.Logger; namespace NewHorizons.Components.SizeControllers { From 3e885983a1ec3947ec742241bc9bdaa4422a0638 Mon Sep 17 00:00:00 2001 From: Ben C Date: Mon, 23 May 2022 20:53:15 -0400 Subject: [PATCH 4/5] Fixed translation configs --- .../External/Configs/TranslationConfig.cs | 24 +++++++++---------- NewHorizons/Handlers/TranslationHandler.cs | 24 +++++++++---------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/NewHorizons/External/Configs/TranslationConfig.cs b/NewHorizons/External/Configs/TranslationConfig.cs index 3e890762..d6506c7a 100644 --- a/NewHorizons/External/Configs/TranslationConfig.cs +++ b/NewHorizons/External/Configs/TranslationConfig.cs @@ -9,33 +9,33 @@ namespace NewHorizons.External.Configs /// /// Translation table for dialogue /// - public Dictionary dialogueDictionary; + public Dictionary DialogueDictionary; /// /// Translation table for Ship Log (entries, facts, etc) /// - public Dictionary shipLogDictionary; + public Dictionary ShipLogDictionary; /// /// Translation table for UI elements /// - public Dictionary uiDictionary; + public Dictionary UIDictionary; public TranslationConfig(string filename) { var dict = JObject.Parse(File.ReadAllText(filename)).ToObject>(); - if (dict.ContainsKey(nameof(dialogueDictionary))) - dialogueDictionary = - (Dictionary) (dict[nameof(dialogueDictionary)] as JObject).ToObject( + if (dict.ContainsKey(nameof(DialogueDictionary))) + DialogueDictionary = + (Dictionary) (dict[nameof(DialogueDictionary)] as JObject).ToObject( typeof(Dictionary)); - if (dict.ContainsKey(nameof(shipLogDictionary))) - shipLogDictionary = - (Dictionary) (dict[nameof(shipLogDictionary)] as JObject).ToObject( + if (dict.ContainsKey(nameof(ShipLogDictionary))) + ShipLogDictionary = + (Dictionary) (dict[nameof(ShipLogDictionary)] as JObject).ToObject( typeof(Dictionary)); - if (dict.ContainsKey(nameof(uiDictionary))) - uiDictionary = - (Dictionary) (dict[nameof(uiDictionary)] as JObject).ToObject( + if (dict.ContainsKey(nameof(UIDictionary))) + UIDictionary = + (Dictionary) (dict[nameof(UIDictionary)] as JObject).ToObject( typeof(Dictionary)); } } diff --git a/NewHorizons/Handlers/TranslationHandler.cs b/NewHorizons/Handlers/TranslationHandler.cs index b313726e..9987fb96 100644 --- a/NewHorizons/Handlers/TranslationHandler.cs +++ b/NewHorizons/Handlers/TranslationHandler.cs @@ -61,39 +61,39 @@ namespace NewHorizons.Handlers public static void RegisterTranslation(TextTranslation.Language language, TranslationConfig config) { - if (config.shipLogDictionary != null && config.shipLogDictionary.Count() > 0) + if (config.ShipLogDictionary != null && config.ShipLogDictionary.Count > 0) { if (!_shipLogTranslationDictionary.ContainsKey(language)) _shipLogTranslationDictionary.Add(language, new Dictionary()); - foreach (var originalKey in config.shipLogDictionary.Keys) + foreach (var originalKey in config.ShipLogDictionary.Keys) { var key = originalKey.Replace("<", "<").Replace(">", ">").Replace("", ""); - if (!_shipLogTranslationDictionary[language].ContainsKey(key)) _shipLogTranslationDictionary[language].Add(key, config.shipLogDictionary[originalKey]); - else _shipLogTranslationDictionary[language][key] = config.shipLogDictionary[originalKey]; + if (!_shipLogTranslationDictionary[language].ContainsKey(key)) _shipLogTranslationDictionary[language].Add(key, config.ShipLogDictionary[originalKey]); + else _shipLogTranslationDictionary[language][key] = config.ShipLogDictionary[originalKey]; } } - if (config.dialogueDictionary != null && config.dialogueDictionary.Count() > 0) + if (config.DialogueDictionary != null && config.DialogueDictionary.Count > 0) { if (!_dialogueTranslationDictionary.ContainsKey(language)) _dialogueTranslationDictionary.Add(language, new Dictionary()); - foreach (var originalKey in config.dialogueDictionary.Keys) + foreach (var originalKey in config.DialogueDictionary.Keys) { var key = originalKey.Replace("<", "<").Replace(">", ">").Replace("", ""); - if (!_dialogueTranslationDictionary[language].ContainsKey(key)) _dialogueTranslationDictionary[language].Add(key, config.dialogueDictionary[originalKey]); - else _dialogueTranslationDictionary[language][key] = config.dialogueDictionary[originalKey]; + if (!_dialogueTranslationDictionary[language].ContainsKey(key)) _dialogueTranslationDictionary[language].Add(key, config.DialogueDictionary[originalKey]); + else _dialogueTranslationDictionary[language][key] = config.DialogueDictionary[originalKey]; } } - if (config.uiDictionary != null && config.uiDictionary.Count() > 0) + if (config.UIDictionary != null && config.UIDictionary.Count() > 0) { if (!_uiTranslationDictionary.ContainsKey(language)) _uiTranslationDictionary.Add(language, new Dictionary()); - foreach (var originalKey in config.uiDictionary.Keys) + foreach (var originalKey in config.UIDictionary.Keys) { var key = originalKey.Replace("<", "<").Replace(">", ">").Replace("", ""); - if (!_uiTranslationDictionary[language].ContainsKey(key)) _uiTranslationDictionary[language].Add(key, config.uiDictionary[originalKey]); - else _uiTranslationDictionary[language][key] = config.uiDictionary[originalKey]; + if (!_uiTranslationDictionary[language].ContainsKey(key)) _uiTranslationDictionary[language].Add(key, config.UIDictionary[originalKey]); + else _uiTranslationDictionary[language][key] = config.UIDictionary[originalKey]; } } } From 08f7bca26c3624d42553640f839f8f2588bd5e1c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 24 May 2022 00:54:55 +0000 Subject: [PATCH 5/5] Updated Schemas --- NewHorizons/Schemas/translation_schema.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/NewHorizons/Schemas/translation_schema.json b/NewHorizons/Schemas/translation_schema.json index e4e278ed..11d6f2f5 100644 --- a/NewHorizons/Schemas/translation_schema.json +++ b/NewHorizons/Schemas/translation_schema.json @@ -4,21 +4,21 @@ "type": "object", "additionalProperties": false, "properties": { - "dialogueDictionary": { + "DialogueDictionary": { "type": "object", "description": "Translation table for dialogue", "additionalProperties": { "type": "string" } }, - "shipLogDictionary": { + "ShipLogDictionary": { "type": "object", "description": "Translation table for Ship Log (entries, facts, etc)", "additionalProperties": { "type": "string" } }, - "uiDictionary": { + "UIDictionary": { "type": "object", "description": "Translation table for UI elements", "additionalProperties": {