Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata in map file overrides .meta.yaml/general need for refactoring in AreaData.Load() #438

Closed
Kalobi opened this issue Apr 19, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@Kalobi
Copy link
Member

Kalobi commented Apr 19, 2022

My mods and Everest install are up to date

Yes

I have recreated the bug with only Everest OR a minimum number of mods enabled

Yes

Describe the bug

When the same metadata option is defined in both the map file via Ahorn and in the .meta.yaml file, the one in the map file takes precedence.

Steps to reproduce

Example: set Title Text Color to 00ff00 in Ahorn, add TitleTextColor: ff0000 to the .meta.yaml. The map title will be green.

Expected behavior

The .meta.yaml should take precedence over the map file. Cruor confirmed this to be the expected behavior, and it makes more sense because default values set by a map editor can be hard to remove from the map file, while the .meta.yaml is trivial to edit.

Operating System

Windows 10

Everest Version

3324

Mods required to reproduce

No response

Additional context

The .meta.yaml is parsed in the big loop over the content map in AreaData.Load(). The parsing of the in-map file metadata happens later when the MapData(AreaKey) constructor is called, via MapData.Load()->MapData.orig_Load()->MapData._Process()->MapData.Process()->MapData.ProcessMeta().

While tracking this down, I also found several other things in AreaData.Load() that seem like they should be refactored:

  • The loop over the content map parses each map's .meta.yaml twice, apparently because of some kind of shadow structure assets that are not being ignored? Duplicates are eliminated afterwards, but this feels like an inelegant solution.
  • The comment // Remove AreaDatas which are now a mode of another AreaData. // This can happen late as the map data (.bin) can contain additional metadata.
    appears to suggest that the section after it should run after the map data has been parsed so that it knows about said additional metadata, but it happens before any .bins are parsed.
  • The first line of the area.OnLevelBegin callback at the end of the content map loop looks like a no-op to me. If if is not, it could use a comment explaining why it's necessary

Unfortunately, I do not understand the area loading process well enough yet to fix this without breaking everything, although I will probably continue to look into it. Help would be much appreciated.

@Kalobi Kalobi added the bug Something isn't working label Apr 19, 2022
rhelmot added a commit to rhelmot/Everest that referenced this issue Aug 21, 2022
maddie480 added a commit that referenced this issue Jul 28, 2024
This reverts commit e8b16ea.
Following reports of unforeseen impacts on maps such as Glyph and Etselec.
maddie480 added a commit that referenced this issue Aug 24, 2024
maddie480 added a commit that referenced this issue Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant