PunchablePlushie / godot-game-settings

Create and manage game settings in Godot Engine.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Settings Panel does not work properly at first in Godot 4.1

PunchablePlushie opened this issue · comments

When first starting the project in Godot 4.1, the settings list might not work properly.
Trying to select a category gives the following error:

res://addons/ggs/editor/setting_panel/setting_list.gd:28 - Invalid get index 'item_order' (on base: 'Nil').

And from there on, the setting list seems to "lag" behind. For example, if you select category_1 the plugin doesn't show anything and gives the aforementioned error. Selecting category_2 shows the settings of category_1. Selecting another category after that shows the settings of category_2 and so on.


More Details

The settings list uses the global variable active_category located in ggs_globals.gd to populate the list. When a category is selected, a global signal (category_selected) is fired off. ggs_globals.gd listens for this signal and assigns the category that was just selected to active_category. Finally, the settings list will use the (now valid) active_category to populate the list.

In Godot 4.1, and at least until the plugin is restarted, it seems like the setting list code is executed before active_category is set properly, which leads to the mentioned issue.


I'm not quite sure why this is happening but it happens when upgrading from 4.0.x to 4.1. And I'm not sure if it's an issue only on my side or something that happens for everyone.
Restarting the plugin (Project Settings → Disable the plugin, then enable it again) seem to temporarily fix it until the project is opened again.

I can confirm, it happens to me too.

Resolved in #36 for GGS 3.0.x.
Not an issue for GGS 3.1 either.