feat: modules moved and engine moved to submodule

This commit is contained in:
Jan van der Weide 2025-04-12 18:40:44 +02:00
parent dfb5e645cd
commit c33d2130cc
5136 changed files with 225275 additions and 64485 deletions

View file

@ -91,6 +91,8 @@ static Ref<ImageTexture> generate_icon(int p_index) {
Error err = ImageLoaderSVG::create_image_from_string(img, default_theme_icons_sources[p_index], scale, upsample, HashMap<Color, Color>());
ERR_FAIL_COND_V_MSG(err != OK, Ref<ImageTexture>(), "Failed generating icon, unsupported or invalid SVG data in default theme.");
img->fix_alpha_edges();
#else
// If the SVG module is disabled, we can't really display the UI well, but at least we won't crash.
// 16 pixels is used as it's the most common base size for Godot icons.
@ -326,6 +328,9 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_constant("check_v_offset", "CheckBox", 0);
theme->set_constant("outline_size", "CheckBox", 0);
theme->set_color("checkbox_checked_color", "CheckBox", Color(1, 1, 1));
theme->set_color("checkbox_unchecked_color", "CheckBox", Color(1, 1, 1));
// CheckButton
Ref<StyleBox> cb_empty = memnew(StyleBoxEmpty);
@ -363,6 +368,9 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_constant("check_v_offset", "CheckButton", 0);
theme->set_constant("outline_size", "CheckButton", 0);
theme->set_color("button_checked_color", "CheckButton", Color(1, 1, 1));
theme->set_color("button_unchecked_color", "CheckButton", Color(1, 1, 1));
// Button variations
theme->set_type_variation(SceneStringName(FlatButton), "Button");
@ -388,6 +396,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
// Label
theme->set_stylebox(CoreStringName(normal), "Label", memnew(StyleBoxEmpty));
theme->set_stylebox("focus", "Label", focus);
theme->set_font(SceneStringName(font), "Label", Ref<Font>());
theme->set_font_size(SceneStringName(font_size), "Label", -1);
@ -785,9 +794,11 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_stylebox(SceneStringName(panel), "GraphNode", graphnode_normal);
theme->set_stylebox("panel_selected", "GraphNode", graphnode_selected);
theme->set_stylebox("panel_focus", "GraphNode", focus);
theme->set_stylebox("titlebar", "GraphNode", graphn_sb_titlebar);
theme->set_stylebox("titlebar_selected", "GraphNode", graphn_sb_titlebar_selected);
theme->set_stylebox("slot", "GraphNode", graphnode_slot);
theme->set_stylebox("slot_selected", "GraphNode", focus);
theme->set_icon("port", "GraphNode", icons["graph_port"]);
theme->set_icon("resizer", "GraphNode", icons["resizer_se"]);
theme->set_color("resizer_color", "GraphNode", control_font_color);
@ -846,12 +857,15 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_stylebox("focus", "Tree", focus);
theme->set_stylebox("hovered", "Tree", make_flat_stylebox(Color(1, 1, 1, 0.07)));
theme->set_stylebox("hovered_dimmed", "Tree", make_flat_stylebox(Color(1, 1, 1, 0.03)));
theme->set_stylebox("hovered_selected", "Tree", make_flat_stylebox(style_hover_selected_color));
theme->set_stylebox("hovered_selected_focus", "Tree", make_flat_stylebox(style_hover_selected_color));
theme->set_stylebox("selected", "Tree", make_flat_stylebox(style_selected_color));
theme->set_stylebox("selected_focus", "Tree", make_flat_stylebox(style_selected_color));
theme->set_stylebox("cursor", "Tree", focus);
theme->set_stylebox("cursor_unfocused", "Tree", focus);
theme->set_stylebox("button_hover", "Tree", make_flat_stylebox(Color(1, 1, 1, 0.07)));
theme->set_stylebox("button_pressed", "Tree", button_pressed);
theme->set_stylebox("button_hover", "Tree", button_hover);
theme->set_stylebox("title_button_normal", "Tree", make_flat_stylebox(style_pressed_color, 4, 4, 4, 4));
theme->set_stylebox("title_button_pressed", "Tree", make_flat_stylebox(style_hover_color, 4, 4, 4, 4));
theme->set_stylebox("title_button_hover", "Tree", make_flat_stylebox(style_normal_color, 4, 4, 4, 4));
@ -880,6 +894,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_color(SceneStringName(font_color), "Tree", control_font_low_color);
theme->set_color("font_hovered_color", "Tree", control_font_hover_color);
theme->set_color("font_hovered_dimmed_color", "Tree", control_font_color);
theme->set_color("font_hovered_selected_color", "Tree", control_font_pressed_color);
theme->set_color("font_selected_color", "Tree", control_font_pressed_color);
theme->set_color("font_disabled_color", "Tree", control_font_disabled_color);
theme->set_color("font_outline_color", "Tree", Color(0, 0, 0));
@ -1032,6 +1047,9 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_constant("separation", "VSeparator", Math::round(4 * scale));
// ColorPicker
Ref<StyleBoxFlat> focus_circle = make_flat_stylebox(style_focus_color, default_margin, default_margin, default_margin, default_margin, default_corner_radius, false, 2);
focus_circle->set_corner_radius_all(Math::round(256 * scale));
focus_circle->set_corner_detail(Math::round(32 * scale));
theme->set_constant("margin", "ColorPicker", Math::round(4 * scale));
theme->set_constant("sv_width", "ColorPicker", Math::round(256 * scale));
@ -1040,6 +1058,11 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_constant("label_width", "ColorPicker", Math::round(10 * scale));
theme->set_constant("center_slider_grabbers", "ColorPicker", 1);
theme->set_stylebox("sample_focus", "ColorPicker", focus);
theme->set_stylebox("picker_focus_rectangle", "ColorPicker", focus);
theme->set_stylebox("picker_focus_circle", "ColorPicker", focus_circle);
theme->set_color("focused_not_editing_cursor_color", "ColorPicker", Color(1, 1, 1, 0.275f));
theme->set_icon("menu_option", "ColorPicker", icons["tabs_menu_hl"]);
theme->set_icon("folded_arrow", "ColorPicker", icons["arrow_right"]);
theme->set_icon("expanded_arrow", "ColorPicker", icons["arrow_down"]);
@ -1112,6 +1135,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
preset_sb->set_anti_aliased(false);
theme->set_stylebox("preset_fg", "ColorPresetButton", preset_sb);
theme->set_stylebox("preset_focus", "ColorPicker", focus);
theme->set_icon("preset_bg", "ColorPresetButton", icons["mini_checkerboard"]);
theme->set_icon("overbright_indicator", "ColorPresetButton", icons["color_picker_overbright"]);
@ -1220,6 +1244,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_icon("layout", "GraphEdit", icons["grid_layout"]);
theme->set_stylebox(SceneStringName(panel), "GraphEdit", make_flat_stylebox(style_normal_color, 4, 4, 4, 5));
theme->set_stylebox("panel_focus", "GraphEdit", focus);
Ref<StyleBoxFlat> graph_toolbar_style = make_flat_stylebox(Color(0.24, 0.24, 0.24, 0.6), 4, 2, 4, 2);
theme->set_stylebox("menu_panel", "GraphEdit", graph_toolbar_style);
@ -1234,6 +1259,40 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_color("connection_valid_target_tint_color", "GraphEdit", Color(1, 1, 1, 0.4));
theme->set_color("connection_rim_color", "GraphEdit", style_normal_color);
Ref<StyleBoxFlat> foldable_container_title = make_flat_stylebox(style_pressed_color);
foldable_container_title->set_corner_radius(CORNER_BOTTOM_LEFT, 0);
foldable_container_title->set_corner_radius(CORNER_BOTTOM_RIGHT, 0);
theme->set_stylebox("title_panel", "FoldableContainer", foldable_container_title);
Ref<StyleBoxFlat> foldable_container_hover = make_flat_stylebox(style_hover_color);
foldable_container_hover->set_corner_radius(CORNER_BOTTOM_LEFT, 0);
foldable_container_hover->set_corner_radius(CORNER_BOTTOM_RIGHT, 0);
theme->set_stylebox("title_hover_panel", "FoldableContainer", foldable_container_hover);
theme->set_stylebox("title_collapsed_panel", "FoldableContainer", make_flat_stylebox(style_pressed_color));
theme->set_stylebox("title_collapsed_hover_panel", "FoldableContainer", make_flat_stylebox(style_hover_color));
Ref<StyleBoxFlat> foldable_container_panel = make_flat_stylebox(style_normal_color);
foldable_container_panel->set_content_margin_all(default_margin);
foldable_container_panel->set_corner_radius(CORNER_TOP_LEFT, 0);
foldable_container_panel->set_corner_radius(CORNER_TOP_RIGHT, 0);
theme->set_stylebox(SceneStringName(panel), "FoldableContainer", foldable_container_panel);
Ref<StyleBoxFlat> foldable_focus_style = make_flat_stylebox(style_focus_color, default_margin, default_margin, default_margin, default_margin, default_corner_radius, false, 2);
theme->set_stylebox("focus", "FoldableContainer", foldable_focus_style);
theme->set_font(SceneStringName(font), "FoldableContainer", Ref<Font>());
theme->set_font_size(SceneStringName(font_size), "FoldableContainer", default_font_size);
theme->set_color(SceneStringName(font_color), "FoldableContainer", control_font_color);
theme->set_color("hover_font_color", "FoldableContainer", control_font_hover_color);
theme->set_color("collapsed_font_color", "FoldableContainer", control_font_pressed_color);
theme->set_color("font_outline_color", "FoldableContainer", Color(1, 1, 1));
theme->set_icon("expanded_arrow", "FoldableContainer", icons["arrow_down"]);
theme->set_icon("expanded_arrow_mirrored", "FoldableContainer", icons["arrow_up"]);
theme->set_icon("folded_arrow", "FoldableContainer", icons["arrow_right"]);
theme->set_icon("folded_arrow_mirrored", "FoldableContainer", icons["arrow_left"]);
theme->set_constant("outline_size", "FoldableContainer", 0);
theme->set_constant("h_separation", "FoldableContainer", Math::round(2 * scale));
// Visual Node Ports
theme->set_constant("port_hotzone_inner_extent", "GraphEdit", 22 * scale);