Outer-Wilds-New-Horizons / new-horizons

A tool for modifying or creating new planets, dialogue, ship logs, and more for Outer Wilds.
https://nh.outerwildsmods.com/
MIT License
42 stars 15 forks source link

Allow editing the map mode sprite of a planet that's already been loaded #875

Closed GameWyrm closed 3 weeks ago

GameWyrm commented 1 month ago

What Happened?

Changing another NH config's ShipLog.mapMode fields does not properly get applied. Currently tested with revealedSprite and invisibleWhenHidden. I have a mod that is patching another mod and adds these fields, and those additions were ignored.

What was supposed to happen?

These fields should be merged/added to the base config at runtime.

Platform

Steam

Mods

xen.NewHorizons
CrypticBird.Jam3

Logs

No response

JohnCorby commented 1 month ago

this doesnt happen because nh does not merge planet configs at all

contrasting to systems, with are merged into one config and then applied, planet configs are just applied sequentially with no regards to overwrites (because most properties are additive in nature ("add this detail") and not updating a value)

xen-42 commented 1 month ago

We could instead generally allow updating the map mode icons of existing planets. This would include modded and stock.

In UpdateBody we'd need to find the ShipLogAstroObject that corresponds to the existing planet. Then take its _unviewedObj, _imageObj, and _outlineObj game objects and replace their Image component's textures.

Better yet we just delete those objects entirely and call some of the code from MapModeBuilder.AddShipLogAstroObject and replace them. Or something!

JohnCorby commented 1 month ago

actually it appears to just Instantiate a new thing for _unviewedObj and just uhhhh forget about (but not delete) whatever existed there before. so if multiple planets go make then i think it would just overwrite but keep the one ones disabled(?) but existing forever