Create a theme handling system for UI #16

Open
opened 2022-02-13 12:20:05 +00:00 by yannk · 4 comments
yannk commented 2022-02-13 12:20:05 +00:00 (Migrated from port.numenaute.org)

Before developpings IG windows systems, we should have the possibility to switch UI themes.

The documentation is here : https://docs.godotengine.org/en/latest/tutorials/ui/gui_skinning.html and https://docs.godotengine.org/en/stable/classes/class_theme.html

I (YannK) could work on the themes themselves (studying the way to have a TODO list to create new ones), but I would need the selector in place beforehand.

There should be the choice between two themes : lakne & zbasu (which are the 2 energies of the Khanat)

Before developpings IG windows systems, we should have the possibility to switch UI themes. The documentation is here : https://docs.godotengine.org/en/latest/tutorials/ui/gui_skinning.html and https://docs.godotengine.org/en/stable/classes/class_theme.html I (YannK) could work on the themes themselves (studying the way to have a TODO list to create new ones), but I would need the selector in place beforehand. There should be the choice between two themes : lakne & zbasu (which are the 2 energies of the Khanat)
yannk commented 2022-02-13 12:21:44 +00:00 (Migrated from port.numenaute.org)

changed the description

changed the description
yannk commented 2022-02-13 15:52:00 +00:00 (Migrated from port.numenaute.org)

I have been looking through some documentation and I think I got an idea how to implement this properly. I am not sure of the proper way to implement it in Godot 4, but here are my thoughts.

We should have a user preference to define a global variable containing the theme to be used. And this variable will lead to a folder containing all the UI related stuff : proper Godot theme (for labels/fonts/buttons etc.), icons, background pictures etc. As any folder will contain the same filenames and folder hierarchy, the system would load the component using relative path from the root folder of the theme we have chosen. And if it doesn’t find the proper information from the themes configured, it will get the default value from the default one.

I have been looking through some documentation and I think I got an idea how to implement this properly. I am not sure of the proper way to implement it in Godot 4, but here are my thoughts. We should have a user preference to define a global variable containing the theme to be used. And this variable will lead to a folder containing all the UI related stuff : proper Godot theme (for labels/fonts/buttons etc.), icons, background pictures etc. As any folder will contain the same filenames and folder hierarchy, the system would load the component using relative path from the root folder of the theme we have chosen. And if it doesn’t find the proper information from the themes configured, it will get the default value from the default one.
yannk commented 2022-02-13 17:31:44 +00:00 (Migrated from port.numenaute.org)

mentioned in commit 7a0fa13bf7

mentioned in commit 7a0fa13bf714963b1045355bbff31ae5e326e9d3
yannk commented 2022-02-13 17:32:37 +00:00 (Migrated from port.numenaute.org)

I have just added two placeholder UI themes to be able to make tests. They differ mainly by colors only, khanat aiming at being the default one

I have just added two placeholder UI themes to be able to make tests. They differ mainly by colors only, `khanat` aiming at being the default one
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: YannK/godot-third-person-basic-scene#16
No description provided.