JavidPack / BossChecklist

Mod for tModLoader to help with Boss Progression
https://forums.terraria.org/index.php?threads/boss-checklist-in-game-progression-checklist.50668/
61 stars 23 forks source link

Boss Checklist is open on boot-up #2

Closed ZwipZwapZapony closed 6 years ago

ZwipZwapZapony commented 6 years ago

When launching Terraria (or reloading mods), the checklist will be open when entering a world. If it's the first time that it's open, it will even be blank (as the boss info list has not been updated yet at that time to include any bosses or such, since the checklist was never manually opened before that point).

This seems completely related to commit 9ad3455 (which fixed issue #1), as that commit made the checklist be considered visible if BossChecklist.bossChecklistInterface.CurrentState is the checklist UI, while the state defaults to being that UI instead of null.

I'm not exactly sure, but I think that before the above commit, the boss checklist also used to be automatically hidden when leaving and re-entering a world, while after that commit, the checklist "remembers" whether it's visible or not when leaving and re-entering a world. (In any case, the latter behaviour seems/feels wrong to me, and might possibly not even update the checkboxes when entering a different world.)

~

From my limited knowledge, simply having BossChecklist.bossChecklistInterface.CurrentState set to null when entering a world might fix this issue.

I would've suggested "maybe in the OnEnterWorld hook of ModPlayer overrides", but I don't know how that would act when someone else joins a multiplayer server. Though perhaps combining it with a check for Main.LocalPlayer in some way could overcome that? I'm not sure.