Skip to content

Commit

Permalink
Merge pull request #55484 from pycbouh/theme-load-and-order-3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
akien-mga authored Dec 2, 2021
2 parents 8956c27 + 33fb442 commit d5b22e6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1487,6 +1487,9 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
register_platform_apis();
register_module_types();

// Theme needs modules to be initialized so that sub-resources can be loaded.
initialize_theme();

GLOBAL_DEF("display/mouse_cursor/custom_image", String());
GLOBAL_DEF("display/mouse_cursor/custom_image_hotspot", Vector2());
GLOBAL_DEF("display/mouse_cursor/tooltip_position_offset", Point2(10, 10));
Expand Down
2 changes: 2 additions & 0 deletions scene/register_scene_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,9 @@ void register_scene_types() {
GLOBAL_DEF("layer_names/2d_physics/layer_" + itos(i + 1), "");
GLOBAL_DEF("layer_names/3d_physics/layer_" + itos(i + 1), "");
}
}

void initialize_theme() {
bool default_theme_hidpi = GLOBAL_DEF("gui/theme/use_hidpi", false);
ProjectSettings::get_singleton()->set_custom_property_info("gui/theme/use_hidpi", PropertyInfo(Variant::BOOL, "gui/theme/use_hidpi", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED));
String theme_path = GLOBAL_DEF_RST("gui/theme/custom", "");
Expand Down
2 changes: 2 additions & 0 deletions scene/register_scene_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@
void register_scene_types();
void unregister_scene_types();

void initialize_theme();

#endif

0 comments on commit d5b22e6

Please sign in to comment.