klikli-dev / modonomicon

Data-driven minecraft in-game documentation with progress visualization.
25 stars 9 forks source link

Book link tooltips not fetching the actual linked entries name #191

Closed DaFuqs closed 6 months ago

DaFuqs commented 6 months ago

Describe the bug The tooltips seem to be hardcoded to use the translation string book.<mod_id>.<book_id>.<category_id>.<entry_id>.name, instead of fetching the actual translation string set in that entries json.

To reproduce When moving an entry from one folder to the other, I noticed the tooltips to that entry breaking. I moved the entry magical_blocks/midnight_solution from the category magical_blocks to the general category, but did not update the category and translation strings to match the new location yet. (Since translations and location should not be connected).

This broke the tooltips in every entry that linked to it.

For reference the entry content of general/midnight_solution:

{
  "name": "book.spectrum.guidebook.magical_blocks.midnight_solution.name",
  "category": "spectrum:magical_blocks",
  "icon": "spectrum:midnight_solution_bucket",
  [...]
}

Expected behavior The tooltip fetching the name of the corresponding entry

Screenshots A link to the entry with id general/midnight_solution. The tooltip wants to resolve that tooltip translation as book.<mod_id>.<book_id>.<category_id>.<entry_id>.name, instead of using the actual entry translation string set in the targets entry json. image

System (please complete the following information):

klikli-dev commented 6 months ago

Related to https://github.com/klikli-dev/modonomicon/issues/183. And I suspect the same underlying reason, I have to check that

klikli-dev commented 6 months ago

Ok after a quick look I think that can be worked around. Initially when the feature was added there was no guarantee that the entry would already be available in data, but now with multi phase loading it should be safe to query the entry and get its component