Merge branch 'dev' into bramble-scaling

This commit is contained in:
FreezeDriedMangoes 2022-07-08 17:37:34 -04:00
commit 886af98f4c
4 changed files with 35 additions and 11 deletions

View File

@ -69,6 +69,7 @@ namespace NewHorizons.Builder.Orbital
*/ */
orbitLine._color = color; orbitLine._color = color;
orbitLine._lineRenderer.endColor = new Color(color.r, color.g, color.b, 0f);
orbitLine._astroObject = astroObject; orbitLine._astroObject = astroObject;
orbitLine._fade = fade; orbitLine._fade = fade;

View File

@ -213,8 +213,8 @@ namespace NewHorizons.Builder.Props
// change the colors // change the colors
// //
if (config.isSeed) SetSeedColors(brambleNode, config.fogTint.ToColor(), config.lightTint.ToColor()); if (config.isSeed) SetSeedColors(brambleNode, config.fogTint?.ToColor(), config.lightTint?.ToColor());
else SetNodeColors(brambleNode, config.fogTint.ToColor(), config.lightTint.ToColor()); else SetNodeColors(brambleNode, config.fogTint?.ToColor(), config.lightTint?.ToColor());
// //
// set up warps // set up warps
@ -254,13 +254,13 @@ namespace NewHorizons.Builder.Props
return brambleNode; return brambleNode;
} }
public static void SetNodeColors(GameObject brambleNode, Color fogTint, Color lightTint) public static void SetNodeColors(GameObject brambleNode, Color? fogTint, Color? lightTint)
{ {
if (fogTint != null) if (fogTint != null)
{ {
var fogRenderer = brambleNode.GetComponent<InnerFogWarpVolume>(); var fogRenderer = brambleNode.GetComponent<InnerFogWarpVolume>();
fogRenderer._fogColor = fogTint; fogRenderer._fogColor = fogTint.Value;
fogRenderer._useFarFogColor = false; fogRenderer._useFarFogColor = false;
var fogBackdrop = brambleNode.FindChild("Terrain_DB_BrambleSphere_Inner_v2")?.FindChild("fogbackdrop_v2"); var fogBackdrop = brambleNode.FindChild("Terrain_DB_BrambleSphere_Inner_v2")?.FindChild("fogbackdrop_v2");
@ -273,7 +273,7 @@ namespace NewHorizons.Builder.Props
var lightShaft1 = lightShafts.FindChild("BrambleLightShaft1"); var lightShaft1 = lightShafts.FindChild("BrambleLightShaft1");
var mat = lightShaft1.GetComponent<MeshRenderer>().material; var mat = lightShaft1.GetComponent<MeshRenderer>().material;
mat.color = lightTint; mat.color = lightTint.Value;
for (int i = 1; i <= 6; i++) for (int i = 1; i <= 6; i++)
{ {
@ -283,7 +283,7 @@ namespace NewHorizons.Builder.Props
} }
} }
public static void SetSeedColors(GameObject brambleSeed, Color fogTint, Color lightTint) public static void SetSeedColors(GameObject brambleSeed, Color? fogTint, Color? lightTint)
{ {
if (fogTint != null) if (fogTint != null)
{ {
@ -291,7 +291,7 @@ namespace NewHorizons.Builder.Props
var fogMeshRenderer = fogRenderer.GetComponent<MeshRenderer>(); var fogMeshRenderer = fogRenderer.GetComponent<MeshRenderer>();
var mat = fogMeshRenderer.material; var mat = fogMeshRenderer.material;
mat.color = fogTint; mat.color = fogTint.Value;
fogMeshRenderer.sharedMaterial = mat; fogMeshRenderer.sharedMaterial = mat;
} }
@ -301,7 +301,7 @@ namespace NewHorizons.Builder.Props
var lightShaft1 = lightShafts.FindChild("DB_SeedLightShafts1"); var lightShaft1 = lightShafts.FindChild("DB_SeedLightShafts1");
var mat = lightShaft1.GetComponent<MeshRenderer>().material; var mat = lightShaft1.GetComponent<MeshRenderer>().material;
mat.color = lightTint; mat.color = lightTint.Value;
for (int i = 1; i <= 6; i++) for (int i = 1; i <= 6; i++)
{ {

View File

@ -30,7 +30,7 @@ namespace NewHorizons.External.Configs
/// <summary> /// <summary>
/// Translation table for achievements. The key is the unique ID of the achievement /// Translation table for achievements. The key is the unique ID of the achievement
/// </summary> /// </summary>
private readonly Dictionary<string, AchievementTranslationInfo> AchievementTranslations; public Dictionary<string, AchievementTranslationInfo> AchievementTranslations;
[JsonObject] [JsonObject]
public class AchievementTranslationInfo public class AchievementTranslationInfo
@ -38,12 +38,12 @@ namespace NewHorizons.External.Configs
/// <summary> /// <summary>
/// The name of the achievement. /// The name of the achievement.
/// </summary> /// </summary>
private string Name; public string Name;
/// <summary> /// <summary>
/// The short description for this achievement. /// The short description for this achievement.
/// </summary> /// </summary>
private readonly string Description; public string Description;
} }
#pragma warning restore 0169 #pragma warning restore 0169
#endregion #endregion

View File

@ -25,11 +25,34 @@
"type": "string" "type": "string"
} }
}, },
"AchievementTranslations": {
"type": "object",
"description": "Translation table for achievements. The key is the unique ID of the achievement",
"additionalProperties": {
"$ref": "#/definitions/AchievementTranslationInfo"
}
},
"$schema": { "$schema": {
"type": "string", "type": "string",
"description": "The schema to validate with" "description": "The schema to validate with"
} }
}, },
"definitions": {
"AchievementTranslationInfo": {
"type": "object",
"additionalProperties": false,
"properties": {
"Name": {
"type": "string",
"description": "The name of the achievement."
},
"Description": {
"type": "string",
"description": "The short description for this achievement."
}
}
}
},
"$docs": { "$docs": {
"title": "Translation Schema", "title": "Translation Schema",
"description": "Schema for a translation file in New Horizons" "description": "Schema for a translation file in New Horizons"