mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fix opacity on star icon, fix generated map mode icon states
This commit is contained in:
parent
0e10d31995
commit
53d3f70a22
Binary file not shown.
|
Before Width: | Height: | Size: 127 KiB After Width: | Height: | Size: 128 KiB |
@ -148,6 +148,7 @@ namespace NewHorizons.Builder.ShipLog
|
|||||||
|
|
||||||
astroObject._imageObj = CreateImage(gameObject, image, body.Config.name + " Revealed", layer);
|
astroObject._imageObj = CreateImage(gameObject, image, body.Config.name + " Revealed", layer);
|
||||||
astroObject._outlineObj = CreateImage(gameObject, outline, body.Config.name + " Outline", layer);
|
astroObject._outlineObj = CreateImage(gameObject, outline, body.Config.name + " Outline", layer);
|
||||||
|
|
||||||
if (ShipLogHandler.BodyHasEntries(body))
|
if (ShipLogHandler.BodyHasEntries(body))
|
||||||
{
|
{
|
||||||
Image revealedImage = astroObject._imageObj.GetComponent<Image>();
|
Image revealedImage = astroObject._imageObj.GetComponent<Image>();
|
||||||
@ -162,6 +163,12 @@ namespace NewHorizons.Builder.ShipLog
|
|||||||
|
|
||||||
Rect imageRect = astroObject._imageObj.GetComponent<RectTransform>().rect;
|
Rect imageRect = astroObject._imageObj.GetComponent<RectTransform>().rect;
|
||||||
astroObject._unviewedObj.transform.localPosition = new Vector3(imageRect.width / 2 + unviewedIconOffset, imageRect.height / 2 + unviewedIconOffset, 0);
|
astroObject._unviewedObj.transform.localPosition = new Vector3(imageRect.width / 2 + unviewedIconOffset, imageRect.height / 2 + unviewedIconOffset, 0);
|
||||||
|
|
||||||
|
// Set all icons inactive, they will be conditionally activated when the map mode is opened for the first time
|
||||||
|
astroObject._unviewedObj.SetActive(false);
|
||||||
|
astroObject._imageObj.SetActive(false);
|
||||||
|
astroObject._outlineObj.SetActive(false);
|
||||||
|
|
||||||
return astroObject;
|
return astroObject;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@ -25,9 +25,32 @@ namespace NewHorizons.Patches.ShipLogPatches
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HarmonyPrefix]
|
||||||
|
[HarmonyPatch(nameof(ShipLogAstroObject.UpdateState))]
|
||||||
|
public static bool ShipLogAstroObject_UpdateState_Pre(ShipLogAstroObject __instance)
|
||||||
|
{
|
||||||
|
// Custom astro objects might have no entries, in this case they will be permanently hidden
|
||||||
|
// Just treat it as if it were revealed
|
||||||
|
if (__instance._entries.Count == 0)
|
||||||
|
{
|
||||||
|
__instance._state = ShipLogEntry.State.Explored;
|
||||||
|
__instance._imageObj.SetActive(true);
|
||||||
|
__instance._outlineObj?.SetActive(false);
|
||||||
|
if (__instance._image != null)
|
||||||
|
{
|
||||||
|
__instance.SetMaterialGreyscale(false);
|
||||||
|
__instance._image.color = Color.white;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
[HarmonyPostfix]
|
[HarmonyPostfix]
|
||||||
[HarmonyPatch(nameof(ShipLogAstroObject.UpdateState))]
|
[HarmonyPatch(nameof(ShipLogAstroObject.UpdateState))]
|
||||||
public static void ShipLogAstroObject_UpdateState(ShipLogAstroObject __instance)
|
public static void ShipLogAstroObject_UpdateState_Post(ShipLogAstroObject __instance)
|
||||||
{
|
{
|
||||||
Transform detailsParent = __instance.transform.Find("Details");
|
Transform detailsParent = __instance.transform.Find("Details");
|
||||||
if (detailsParent != null)
|
if (detailsParent != null)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user