Create

Create

86M Downloads

Create Config Button disappears when switching language

getItemFromBlock opened this issue ยท 4 comments

commented

Describe the Bug

When switching language in the game (for example, form French to English) the Create config button will disappear on the main menu and the in-game menu
The button will only reappear either if you restart the game, or if the language is set back to what the game started with

Reproduction Steps

  1. Launch the game
  2. Change the language to another language (like French or Spanish)
  3. Go back to the main menu or the in-game pause menu

Expected Result

The button should stay when switching language

Screenshots and Videos

On startup
button
After switching to french
no button

Crash Report or Log

No response

Operating System

Windows 11

Mod Version

0.5.0i

Minecraft Version

1.18.2, 1.19, 1.20

Forge Version

40.2.9

Other Mods

No response

Additional Context

I discovered this Issue while implementing my own config button (seen on the right)
The problem is caused by the way the button adds itself to the current menu
Here you can see that the reference strings are initialized in a static way when the game starts
As the translated button names are used, this makes that the reference strings are no longer valid when compared to the actual content of the menu.
A potential fix would be to do like I did to avoid this problem here
This might not be the most optimal way to do it, but it does the job

commented

From what I see of the code, this should affect all versions of the mod that has the config button feature

commented

I can probably do a PR if that can help you

commented

Restart the game. This helped for me.

commented

I already wrote in the description that restarting the game fix the issue, since restarting the game will reinitialize the required variables