diff --git a/Makefile b/Makefile index 6ac15efd0..031992d50 100644 --- a/Makefile +++ b/Makefile @@ -173,7 +173,7 @@ $(ALL_EXTENSIONS) &: $(ALL_EXTENSION_FILES) .PHONY: edit edit: $(IMPORT_DIR) ## Open the project in the Godot editor - $(GODOT) --editor . + $(GODOT) --display-driver x11 --editor . .PHONY: purge purge: clean ## Remove all build artifacts including engine extensions @@ -204,7 +204,7 @@ $(EXPORT_TEMPLATE): .PHONY: debug debug: $(IMPORT_DIR) ## Run the project in debug mode in gamescope - $(GAMESCOPE) -e --xwayland-count 2 --expose-wayland -- \ + $(GAMESCOPE) -e --xwayland-count 2 --expose-wayland -f -- \ $(GODOT) --path $(PWD) --remote-debug tcp://127.0.0.1:6007 \ --position 320,140 res://entrypoint.tscn diff --git a/assets/editor-icons/icon-park-twotone--figma-component.svg b/assets/editor-icons/icon-park-twotone--figma-component.svg new file mode 100644 index 000000000..f029e91e1 --- /dev/null +++ b/assets/editor-icons/icon-park-twotone--figma-component.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/editor-icons/icon-park-twotone--figma-component.svg.import b/assets/editor-icons/icon-park-twotone--figma-component.svg.import new file mode 100644 index 000000000..4a09833c0 --- /dev/null +++ b/assets/editor-icons/icon-park-twotone--figma-component.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://du58im7t0vtq1" +path="res://.godot/imported/icon-park-twotone--figma-component.svg-6ca90f6d93895e2573b0a97dd745302a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/editor-icons/icon-park-twotone--figma-component.svg" +dest_files=["res://.godot/imported/icon-park-twotone--figma-component.svg-6ca90f6d93895e2573b0a97dd745302a.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/assets/editor-icons/radix-icons--component-1.svg b/assets/editor-icons/radix-icons--component-1.svg new file mode 100644 index 000000000..ba65f1c6a --- /dev/null +++ b/assets/editor-icons/radix-icons--component-1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/editor-icons/radix-icons--component-1.svg.import b/assets/editor-icons/radix-icons--component-1.svg.import new file mode 100644 index 000000000..23a9bf4a7 --- /dev/null +++ b/assets/editor-icons/radix-icons--component-1.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bc58l5w8fhi8k" +path="res://.godot/imported/radix-icons--component-1.svg-1a7dd3e96ea74034ac7df732dc8cdae4.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/editor-icons/radix-icons--component-1.svg" +dest_files=["res://.godot/imported/radix-icons--component-1.svg-1a7dd3e96ea74034ac7df732dc8cdae4.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/assets/fonts/Inter-VariableFont_opsz,wght.ttf b/assets/fonts/Inter-VariableFont_opsz,wght.ttf new file mode 100644 index 000000000..e31b51e3e Binary files /dev/null and b/assets/fonts/Inter-VariableFont_opsz,wght.ttf differ diff --git a/assets/fonts/Inter-VariableFont_opsz,wght.ttf.import b/assets/fonts/Inter-VariableFont_opsz,wght.ttf.import new file mode 100644 index 000000000..0fb94a247 --- /dev/null +++ b/assets/fonts/Inter-VariableFont_opsz,wght.ttf.import @@ -0,0 +1,36 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://4j1gb8y6wfst" +path="res://.godot/imported/Inter-VariableFont_opsz,wght.ttf-9b713b67ae13dc7c217eeab2b94e38c1.fontdata" + +[deps] + +source_file="res://assets/fonts/Inter-VariableFont_opsz,wght.ttf" +dest_files=["res://.godot/imported/Inter-VariableFont_opsz,wght.ttf-9b713b67ae13dc7c217eeab2b94e38c1.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +disable_embedded_bitmaps=true +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +modulate_color_glyphs=false +hinting=1 +subpixel_positioning=4 +keep_rounding_remainders=true +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/assets/images/library-tile.png b/assets/images/library-tile.png new file mode 100644 index 000000000..799c37c90 Binary files /dev/null and b/assets/images/library-tile.png differ diff --git a/assets/images/library-tile.png.import b/assets/images/library-tile.png.import new file mode 100644 index 000000000..9f4b4e404 --- /dev/null +++ b/assets/images/library-tile.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bkow254h80eei" +path="res://.godot/imported/library-tile.png-5e8bcec895c90ce207c9ec32d7c58a8e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/images/library-tile.png" +dest_files=["res://.godot/imported/library-tile.png-5e8bcec895c90ce207c9ec32d7c58a8e.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/images/starfield.svg b/assets/images/starfield.svg new file mode 100644 index 000000000..d9bdc3cbc --- /dev/null +++ b/assets/images/starfield.svg @@ -0,0 +1,1044 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/starfield.svg.import b/assets/images/starfield.svg.import new file mode 100644 index 000000000..8c8a7765d --- /dev/null +++ b/assets/images/starfield.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://chuihqnx022ys" +path="res://.godot/imported/starfield.svg-497b62d977b643fb4af176e7fac4785d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/images/starfield.svg" +dest_files=["res://.godot/imported/starfield.svg-497b62d977b643fb4af176e7fac4785d.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/assets/shaders/frosted_glass.gdshader b/assets/shaders/frosted_glass.gdshader new file mode 100644 index 000000000..227ae6be9 --- /dev/null +++ b/assets/shaders/frosted_glass.gdshader @@ -0,0 +1,184 @@ +// Author: [Sweety](https://godotshaders.com/author/sweety/) +// License: MIT +// Source: https://godotshaders.com/shader/frosted-glass-shader-rounded-rect-outline-shadow/ +shader_type canvas_item; + +// Screen texture for frosted glass effect +uniform sampler2D screen_texture : hint_screen_texture, filter_linear_mipmap; + +// === Shape Settings (Pixel Units) === +// Shape type: 0=Circle, 1=Rounded Rectangle +uniform int shape_type : hint_range(0, 1) = 1; +// Rectangle size (pixels) +uniform vec2 rect_size = vec2(300.0, 200.0); +// Corner radii for each corner (pixels) +uniform float corner_radius_top_left = 20.0; +uniform float corner_radius_top_right = 20.0; +uniform float corner_radius_bottom_left = 20.0; +uniform float corner_radius_bottom_right = 20.0; +// Circle radius (pixels, used when shape_type=0) +uniform float circle_radius = 100.0; + +// === Outline Settings === +uniform bool outline_enabled = true; +uniform float outline_width = 2.0; // pixels +uniform vec4 outline_color : source_color = vec4(1.0, 1.0, 1.0, 0.8); + +// === Shadow Settings === +uniform bool shadow_enabled = true; +uniform vec4 shadow_color : source_color = vec4(0.0, 0.0, 0.0, 0.5); +uniform vec2 shadow_offset = vec2(10.0, 10.0); // pixel offset +uniform float shadow_blur = 15.0; // shadow blur radius + +// === Edge Settings === +uniform float edge_softness : hint_range(0.0, 5.0) = 1.0; // Edge antialiasing width (pixels) + +// === Color Settings === +uniform vec3 shape_color : source_color = vec3(0.3, 0.5, 0.9); +uniform float color_gradient_y : hint_range(0.0, 3.0) = 1.5; +uniform float color_gradient_x : hint_range(-2.0, 2.0) = -0.8; +uniform float color_multiplier : hint_range(0.1, 2.0) = 0.9; + +// === Screen Blur Settings (Frosted Glass) === +uniform bool enable_screen_blur = true; +uniform float blur_amount : hint_range(0.0, 10.0) = 3.0; +uniform int blur_samples : hint_range(1, 8) = 4; +// Glass opacity/tint strength (smaller value = more transparent/clear, larger value = more solid color) +uniform float glass_opacity : hint_range(0.0, 1.0) = 0.2; + +// Node size (used for correct UV calculation, set via script) +uniform vec2 node_size = vec2(400.0, 400.0); + +// Rounded Rectangle SDF +float rounded_rect_sdf(vec2 p, vec2 size, vec4 radii) { + // radii: x=top-left, y=top-right, z=bottom-right, w=bottom-left + vec2 r; + if (p.x > 0.0) { + r = (p.y > 0.0) ? radii.zw : radii.yz; + } else { + r = (p.y > 0.0) ? radii.xw : radii.xy; + } + float radius = (p.x > 0.0) ? r.x : r.y; + + vec2 q = abs(p) - size + radius; + return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - radius; +} + +// Circle SDF +float circle_sdf(vec2 p, float r) { + return length(p) - r; +} + +// Gaussian Blur Sampling +vec3 blur_screen(vec2 screen_uv, vec2 pixel_size) { + vec3 color = vec3(0.0); + float total_weight = 0.0; + + for (int x = -blur_samples; x <= blur_samples; x++) { + for (int y = -blur_samples; y <= blur_samples; y++) { + vec2 offset = vec2(float(x), float(y)) * pixel_size * blur_amount; + float weight = 1.0 / (1.0 + float(x * x + y * y)); + color += texture(screen_texture, screen_uv + offset).rgb * weight; + total_weight += weight; + } + } + + return color / total_weight; +} + +// Get SDF distance for the shape (Pixel Units) +float get_shape_sdf(vec2 p) { + float dist; + if (shape_type == 0) { + // Circle + dist = circle_sdf(p, circle_radius); + } else { + // Rounded Rectangle + vec2 half_size = rect_size * 0.5; + + // Limit corner radius to half the side length + float min_dim = min(half_size.x, half_size.y); + vec4 radii = vec4( + min(corner_radius_top_left, min_dim), + min(corner_radius_top_right, min_dim), + min(corner_radius_bottom_right, min_dim), + min(corner_radius_bottom_left, min_dim) + ); + + dist = rounded_rect_sdf(p, half_size, radii); + } + return dist; +} + +void fragment() { + // Convert UV to pixel coordinates, center at (0,0) + vec2 p = (UV - 0.5) * node_size; + + // 1. Draw Shadow (Behind Glass) + vec4 final_color = vec4(0.0); + + if (shadow_enabled) { + float s_dist = get_shape_sdf(p - shadow_offset); + // Shadow mask: 1 inside, fades out outwards + float s_mask = 1.0 - smoothstep(-shadow_blur, 0.0, s_dist); + // Mix shadow + final_color = mix(final_color, shadow_color, s_mask * shadow_color.a); + } + + // 2. Draw Main Glass Shape + float dist = get_shape_sdf(p); + // Shape mask (1px antialiasing) + float shape_alpha = 1.0 - smoothstep(0.0, edge_softness, dist); + + // Calculate gradient color (using normalized UV) + vec2 uv_norm = UV - 0.5; + // Correct UV aspect ratio for gradient calculation to keep visual consistency + float aspect = node_size.x / node_size.y; + uv_norm.x *= aspect; + + vec3 dynamic_color = vec3( + shape_color.r + uv_norm.y * color_gradient_y, + shape_color.g + uv_norm.x * color_gradient_x, + shape_color.b + ) * color_multiplier; + + vec3 glass_col = dynamic_color; + + // Apply Screen Blur (Frosted Glass Effect) + if (enable_screen_blur) { + vec2 screen_uv = SCREEN_UV; + vec2 pixel_size = SCREEN_PIXEL_SIZE; + vec3 blurred_bg = blur_screen(screen_uv, pixel_size); + + // Mix effect color with blurred background + glass_col = mix(blurred_bg, glass_col, glass_opacity); + } + + // Mix glass layer onto final color + final_color = mix(final_color, vec4(glass_col, 1.0), shape_alpha); + + // 3. Draw Outline (Above Glass) + if (outline_enabled) { + // Outline mask: generated at edge, width is outline_width + // abs(dist) < width/2 means outline centered on edge + float outline_mask = 1.0 - smoothstep(outline_width * 0.5 - 0.5, outline_width * 0.5 + 0.5, abs(dist)); + + // Use Alpha Compositing formula instead of simple mix to prevent gray edges + vec4 src_color = outline_color; + float src_alpha = outline_mask * outline_color.a; + vec4 dst_color = final_color; + + // Final Alpha = SrcAlpha + DstAlpha * (1 - SrcAlpha) + float out_alpha = src_alpha + dst_color.a * (1.0 - src_alpha); + + vec3 out_rgb = vec3(0.0); + if (out_alpha > 0.0) { + // Final RGB = (SrcRGB * SrcAlpha + DstRGB * DstAlpha * (1 - SrcAlpha)) / FinalAlpha + out_rgb = (src_color.rgb * src_alpha + dst_color.rgb * dst_color.a * (1.0 - src_alpha)) / out_alpha; + } + + final_color = vec4(out_rgb, out_alpha); + } + + COLOR = final_color; +} diff --git a/assets/shaders/frosted_glass.gdshader.uid b/assets/shaders/frosted_glass.gdshader.uid new file mode 100644 index 000000000..4b416bea7 --- /dev/null +++ b/assets/shaders/frosted_glass.gdshader.uid @@ -0,0 +1 @@ +uid://c0e8ae3ilo5e2 diff --git a/assets/state/state_machines/global_state_machine.tres b/assets/state/state_machines/global_state_machine.tres index 51de62ec3..013753b89 100644 --- a/assets/state/state_machines/global_state_machine.tres +++ b/assets/state/state_machines/global_state_machine.tres @@ -10,5 +10,4 @@ [resource] script = ExtResource("1_dw1uo") logger_name = "GlobalStateMachine" -minimum_states = 1 allowed_states = Array[ExtResource("1_ssupu")]([ExtResource("1_dtppc"), ExtResource("2_pg6ge"), ExtResource("3_4n6bo"), ExtResource("4_j3a4g")]) diff --git a/assets/state/state_machines/popup_state_machine.tres b/assets/state/state_machines/popup_state_machine.tres index 9be049b88..930ffb22d 100644 --- a/assets/state/state_machines/popup_state_machine.tres +++ b/assets/state/state_machines/popup_state_machine.tres @@ -1,4 +1,4 @@ -[gd_resource type="Resource" script_class="StateMachine" load_steps=8 format=3 uid="uid://cadriyl38ny5y"] +[gd_resource type="Resource" script_class="StateMachine" format=3 uid="uid://cadriyl38ny5y"] [ext_resource type="Resource" uid="uid://e7bbebwf7guj" path="res://assets/state/states/main_menu.tres" id="1_7fvmm"] [ext_resource type="Script" uid="uid://dxut26n2hvlp6" path="res://core/systems/state/state.gd" id="1_7s405"] @@ -7,9 +7,12 @@ [ext_resource type="Resource" uid="uid://dja3m1mevv6xw" path="res://assets/state/states/osk.tres" id="4_qu5fi"] [ext_resource type="Resource" uid="uid://db5gbdl3xgwlq" path="res://assets/state/states/help_menu.tres" id="5_5ytlq"] [ext_resource type="Script" uid="uid://5gt4rsvv8fxf" path="res://core/systems/state/state_machine.gd" id="6_82te1"] +[ext_resource type="Resource" uid="uid://d3gp85f35oiw6" path="res://assets/state/states/settings.tres" id="7_361fe"] +[ext_resource type="Resource" uid="uid://cx8u1y5j7vyss" path="res://assets/state/states/gamepad_settings.tres" id="8_os1u0"] +[ext_resource type="Resource" uid="uid://3vw3bk76d88w" path="res://assets/state/states/game_settings.tres" id="9_xh7p7"] [resource] script = ExtResource("6_82te1") logger_name = "PopupStateMachine" minimum_states = 0 -allowed_states = Array[ExtResource("1_7s405")]([ExtResource("1_7fvmm"), ExtResource("2_detpa"), ExtResource("3_0mhn6"), ExtResource("4_qu5fi"), ExtResource("5_5ytlq")]) +allowed_states = Array[ExtResource("1_7s405")]([ExtResource("1_7fvmm"), ExtResource("2_detpa"), ExtResource("3_0mhn6"), ExtResource("4_qu5fi"), ExtResource("5_5ytlq"), ExtResource("7_361fe"), ExtResource("8_os1u0"), ExtResource("9_xh7p7")]) diff --git a/assets/ui/icons/material-symbols--bluetooth-disabled.svg b/assets/ui/icons/material-symbols--bluetooth-disabled.svg new file mode 100644 index 000000000..35a8debaf --- /dev/null +++ b/assets/ui/icons/material-symbols--bluetooth-disabled.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/ui/icons/material-symbols--bluetooth-disabled.svg.import b/assets/ui/icons/material-symbols--bluetooth-disabled.svg.import new file mode 100644 index 000000000..ce5530812 --- /dev/null +++ b/assets/ui/icons/material-symbols--bluetooth-disabled.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://n53uqxpqrnid" +path="res://.godot/imported/material-symbols--bluetooth-disabled.svg-da6b593911465742925bb3b7d9748fe9.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/icons/material-symbols--bluetooth-disabled.svg" +dest_files=["res://.godot/imported/material-symbols--bluetooth-disabled.svg-da6b593911465742925bb3b7d9748fe9.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/assets/ui/icons/material-symbols--bluetooth.svg b/assets/ui/icons/material-symbols--bluetooth.svg new file mode 100644 index 000000000..d253d7456 --- /dev/null +++ b/assets/ui/icons/material-symbols--bluetooth.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/ui/icons/material-symbols--bluetooth.svg.import b/assets/ui/icons/material-symbols--bluetooth.svg.import new file mode 100644 index 000000000..48935bd04 --- /dev/null +++ b/assets/ui/icons/material-symbols--bluetooth.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bmp372vmsk41d" +path="res://.godot/imported/material-symbols--bluetooth.svg-40e360fa4a03f127290d9f00e6a1067f.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/icons/material-symbols--bluetooth.svg" +dest_files=["res://.godot/imported/material-symbols--bluetooth.svg-40e360fa4a03f127290d9f00e6a1067f.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/assets/ui/icons/material-symbols--chevron-right-rounded.svg b/assets/ui/icons/material-symbols--chevron-right-rounded.svg new file mode 100644 index 000000000..62fad634d --- /dev/null +++ b/assets/ui/icons/material-symbols--chevron-right-rounded.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/ui/icons/material-symbols--chevron-right-rounded.svg.import b/assets/ui/icons/material-symbols--chevron-right-rounded.svg.import new file mode 100644 index 000000000..d7b31cbdf --- /dev/null +++ b/assets/ui/icons/material-symbols--chevron-right-rounded.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dj7wg0qnevawx" +path="res://.godot/imported/material-symbols--chevron-right-rounded.svg-2e5d865d732831e70f20f427af445817.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/icons/material-symbols--chevron-right-rounded.svg" +dest_files=["res://.godot/imported/material-symbols--chevron-right-rounded.svg-2e5d865d732831e70f20f427af445817.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/assets/ui/icons/material-symbols--desktop-windows-outline-rounded.svg b/assets/ui/icons/material-symbols--desktop-windows-outline-rounded.svg new file mode 100644 index 000000000..996717ca7 --- /dev/null +++ b/assets/ui/icons/material-symbols--desktop-windows-outline-rounded.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/ui/icons/material-symbols--desktop-windows-outline-rounded.svg.import b/assets/ui/icons/material-symbols--desktop-windows-outline-rounded.svg.import new file mode 100644 index 000000000..ba662e8a0 --- /dev/null +++ b/assets/ui/icons/material-symbols--desktop-windows-outline-rounded.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b8i7dvjfeylpv" +path="res://.godot/imported/material-symbols--desktop-windows-outline-rounded.svg-20c03ff21711d7834b13dc01417ec0b2.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/icons/material-symbols--desktop-windows-outline-rounded.svg" +dest_files=["res://.godot/imported/material-symbols--desktop-windows-outline-rounded.svg-20c03ff21711d7834b13dc01417ec0b2.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/assets/ui/icons/material-symbols--developer-board-outline-rounded.svg b/assets/ui/icons/material-symbols--developer-board-outline-rounded.svg new file mode 100644 index 000000000..e92f4be9c --- /dev/null +++ b/assets/ui/icons/material-symbols--developer-board-outline-rounded.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/ui/icons/material-symbols--developer-board-outline-rounded.svg.import b/assets/ui/icons/material-symbols--developer-board-outline-rounded.svg.import new file mode 100644 index 000000000..214c1a7f7 --- /dev/null +++ b/assets/ui/icons/material-symbols--developer-board-outline-rounded.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://xlmr7ldbum6s" +path="res://.godot/imported/material-symbols--developer-board-outline-rounded.svg-3af8a1c55431a58dbb81dd5432ddb0e2.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/icons/material-symbols--developer-board-outline-rounded.svg" +dest_files=["res://.godot/imported/material-symbols--developer-board-outline-rounded.svg-3af8a1c55431a58dbb81dd5432ddb0e2.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/assets/ui/icons/material-symbols--exit-to-app-rounded.svg b/assets/ui/icons/material-symbols--exit-to-app-rounded.svg new file mode 100644 index 000000000..c5ec769bf --- /dev/null +++ b/assets/ui/icons/material-symbols--exit-to-app-rounded.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/ui/icons/material-symbols--exit-to-app-rounded.svg.import b/assets/ui/icons/material-symbols--exit-to-app-rounded.svg.import new file mode 100644 index 000000000..bd3293206 --- /dev/null +++ b/assets/ui/icons/material-symbols--exit-to-app-rounded.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dmcbtniaek0of" +path="res://.godot/imported/material-symbols--exit-to-app-rounded.svg-117a42f28a31d99aeae8d5b32ef7a51d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/icons/material-symbols--exit-to-app-rounded.svg" +dest_files=["res://.godot/imported/material-symbols--exit-to-app-rounded.svg-117a42f28a31d99aeae8d5b32ef7a51d.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/assets/ui/icons/material-symbols--gamepad-outline-rounded.svg b/assets/ui/icons/material-symbols--gamepad-outline-rounded.svg new file mode 100644 index 000000000..ea8012801 --- /dev/null +++ b/assets/ui/icons/material-symbols--gamepad-outline-rounded.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/ui/icons/material-symbols--gamepad-outline-rounded.svg.import b/assets/ui/icons/material-symbols--gamepad-outline-rounded.svg.import new file mode 100644 index 000000000..79655405e --- /dev/null +++ b/assets/ui/icons/material-symbols--gamepad-outline-rounded.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dx6rnad4lmct0" +path="res://.godot/imported/material-symbols--gamepad-outline-rounded.svg-450344a92d777fe0d6c69bcb0bbcfa01.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/icons/material-symbols--gamepad-outline-rounded.svg" +dest_files=["res://.godot/imported/material-symbols--gamepad-outline-rounded.svg-450344a92d777fe0d6c69bcb0bbcfa01.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/assets/ui/icons/material-symbols--keyboard-outline-rounded.svg b/assets/ui/icons/material-symbols--keyboard-outline-rounded.svg new file mode 100644 index 000000000..3e7e22c1e --- /dev/null +++ b/assets/ui/icons/material-symbols--keyboard-outline-rounded.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/ui/icons/material-symbols--keyboard-outline-rounded.svg.import b/assets/ui/icons/material-symbols--keyboard-outline-rounded.svg.import new file mode 100644 index 000000000..431c2af44 --- /dev/null +++ b/assets/ui/icons/material-symbols--keyboard-outline-rounded.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ciwqk2qmmp2cf" +path="res://.godot/imported/material-symbols--keyboard-outline-rounded.svg-eb47e7b72deb6bd9b5d8a0424cb773ef.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/icons/material-symbols--keyboard-outline-rounded.svg" +dest_files=["res://.godot/imported/material-symbols--keyboard-outline-rounded.svg-eb47e7b72deb6bd9b5d8a0424cb773ef.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/assets/ui/icons/material-symbols--language.svg b/assets/ui/icons/material-symbols--language.svg new file mode 100644 index 000000000..f607fe88f --- /dev/null +++ b/assets/ui/icons/material-symbols--language.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/ui/icons/material-symbols--language.svg.import b/assets/ui/icons/material-symbols--language.svg.import new file mode 100644 index 000000000..58cdcb49b --- /dev/null +++ b/assets/ui/icons/material-symbols--language.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bnonvn62pgwww" +path="res://.godot/imported/material-symbols--language.svg-5bd6b56edaf2ed350032ab0472bfca71.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/icons/material-symbols--language.svg" +dest_files=["res://.godot/imported/material-symbols--language.svg-5bd6b56edaf2ed350032ab0472bfca71.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/assets/ui/icons/material-symbols--notifications-outline-rounded.svg b/assets/ui/icons/material-symbols--notifications-outline-rounded.svg new file mode 100644 index 000000000..4ee77a77b --- /dev/null +++ b/assets/ui/icons/material-symbols--notifications-outline-rounded.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/ui/icons/material-symbols--notifications-outline-rounded.svg.import b/assets/ui/icons/material-symbols--notifications-outline-rounded.svg.import new file mode 100644 index 000000000..31c991ba0 --- /dev/null +++ b/assets/ui/icons/material-symbols--notifications-outline-rounded.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bjtfbt8wnillp" +path="res://.godot/imported/material-symbols--notifications-outline-rounded.svg-698bd80a5d5f8ecdb35c45ec80425f3d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/icons/material-symbols--notifications-outline-rounded.svg" +dest_files=["res://.godot/imported/material-symbols--notifications-outline-rounded.svg-698bd80a5d5f8ecdb35c45ec80425f3d.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/assets/ui/icons/material-symbols--notifications-unread-outline-rounded.svg b/assets/ui/icons/material-symbols--notifications-unread-outline-rounded.svg new file mode 100644 index 000000000..a2b2e5e5e --- /dev/null +++ b/assets/ui/icons/material-symbols--notifications-unread-outline-rounded.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/ui/icons/material-symbols--notifications-unread-outline-rounded.svg.import b/assets/ui/icons/material-symbols--notifications-unread-outline-rounded.svg.import new file mode 100644 index 000000000..ab6a37ca1 --- /dev/null +++ b/assets/ui/icons/material-symbols--notifications-unread-outline-rounded.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://crdfrofbcquva" +path="res://.godot/imported/material-symbols--notifications-unread-outline-rounded.svg-017d5df69766e4d09b2d000ff30c1fd7.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/icons/material-symbols--notifications-unread-outline-rounded.svg" +dest_files=["res://.godot/imported/material-symbols--notifications-unread-outline-rounded.svg-017d5df69766e4d09b2d000ff30c1fd7.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/assets/ui/icons/material-symbols--picture-in-picture-off-outline-rounded.svg b/assets/ui/icons/material-symbols--picture-in-picture-off-outline-rounded.svg new file mode 100644 index 000000000..cef64753c --- /dev/null +++ b/assets/ui/icons/material-symbols--picture-in-picture-off-outline-rounded.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/ui/icons/material-symbols--picture-in-picture-off-outline-rounded.svg.import b/assets/ui/icons/material-symbols--picture-in-picture-off-outline-rounded.svg.import new file mode 100644 index 000000000..f4bc4895c --- /dev/null +++ b/assets/ui/icons/material-symbols--picture-in-picture-off-outline-rounded.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://i0pjbpknwbi5" +path="res://.godot/imported/material-symbols--picture-in-picture-off-outline-rounded.svg-c00f63ad9e3a96b17f37b3dde92686d0.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/icons/material-symbols--picture-in-picture-off-outline-rounded.svg" +dest_files=["res://.godot/imported/material-symbols--picture-in-picture-off-outline-rounded.svg-c00f63ad9e3a96b17f37b3dde92686d0.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/assets/ui/icons/material-symbols--picture-in-picture-outline-rounded.svg b/assets/ui/icons/material-symbols--picture-in-picture-outline-rounded.svg new file mode 100644 index 000000000..a0ff96ba5 --- /dev/null +++ b/assets/ui/icons/material-symbols--picture-in-picture-outline-rounded.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/ui/icons/material-symbols--picture-in-picture-outline-rounded.svg.import b/assets/ui/icons/material-symbols--picture-in-picture-outline-rounded.svg.import new file mode 100644 index 000000000..24ca35e4e --- /dev/null +++ b/assets/ui/icons/material-symbols--picture-in-picture-outline-rounded.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bbqtqi6j68uwf" +path="res://.godot/imported/material-symbols--picture-in-picture-outline-rounded.svg-9109660bafb6333cf360068b96f65fd8.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/icons/material-symbols--picture-in-picture-outline-rounded.svg" +dest_files=["res://.godot/imported/material-symbols--picture-in-picture-outline-rounded.svg-9109660bafb6333cf360068b96f65fd8.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/assets/ui/icons/material-symbols--settings-outline-rounded.svg b/assets/ui/icons/material-symbols--settings-outline-rounded.svg new file mode 100644 index 000000000..3e667a928 --- /dev/null +++ b/assets/ui/icons/material-symbols--settings-outline-rounded.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/ui/icons/material-symbols--settings-outline-rounded.svg.import b/assets/ui/icons/material-symbols--settings-outline-rounded.svg.import new file mode 100644 index 000000000..30fa76635 --- /dev/null +++ b/assets/ui/icons/material-symbols--settings-outline-rounded.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bdjnwtumim20t" +path="res://.godot/imported/material-symbols--settings-outline-rounded.svg-795962d99968e79008acbe9ff2f9941f.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/icons/material-symbols--settings-outline-rounded.svg" +dest_files=["res://.godot/imported/material-symbols--settings-outline-rounded.svg-795962d99968e79008acbe9ff2f9941f.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/assets/ui/icons/material-symbols--speed-outline-rounded.svg b/assets/ui/icons/material-symbols--speed-outline-rounded.svg new file mode 100644 index 000000000..39873834d --- /dev/null +++ b/assets/ui/icons/material-symbols--speed-outline-rounded.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/ui/icons/material-symbols--speed-outline-rounded.svg.import b/assets/ui/icons/material-symbols--speed-outline-rounded.svg.import new file mode 100644 index 000000000..b91cc86bd --- /dev/null +++ b/assets/ui/icons/material-symbols--speed-outline-rounded.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://iuraatp10cjd" +path="res://.godot/imported/material-symbols--speed-outline-rounded.svg-7a97f219f1fd4a77c61a6c9abb9682be.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/icons/material-symbols--speed-outline-rounded.svg" +dest_files=["res://.godot/imported/material-symbols--speed-outline-rounded.svg-7a97f219f1fd4a77c61a6c9abb9682be.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/core/main.gd b/core/main.gd index f7742b560..6afe1a102 100644 --- a/core/main.gd +++ b/core/main.gd @@ -16,16 +16,16 @@ func _ready() -> void: return # Launch CardUI in overlay mode - if "--qam-only" in args or "--only-qam" in args: - print("[WARN] Deprecation Warning: --only-qam and --qam-only launch arguments are deprecated\ - and will be removed in a future update. Use --overlay-mode instead.") - _change_to_scene("res://core/ui/card_ui_overlay_mode/card_ui_overlay_mode.tscn") - return - elif "--overlay-mode" in args: + if feature_flags.is_enabled("overlay-mode"): _change_to_scene("res://core/ui/card_ui_overlay_mode/card_ui_overlay_mode.tscn") return - # Launch the main interface + # Launch the main interface selected by feature flags (CardUI is the default) + if feature_flags.is_enabled("etoile-ui"): + _change_to_scene("res://core/ui/etoile_ui/etoile_ui.tscn") + return + if not feature_flags.is_enabled("card-ui"): + print("[WARN] No UI feature enabled, loading the default CardUI") _change_to_scene("res://core/ui/card_ui/card_ui.tscn") @@ -47,21 +47,21 @@ func _show_help() -> void: print("Available Commands:") print(" help Display this help message") print("") - print("Flags:") - print(" --vapor-ui Load Vapor UI") - print(" --only-qam Launch in overlay mode (Deprecated)") - print(" --overlay-mode Launch in overlay mode") - print("") print("Environment Variables:") print(" LOG_LEVEL Set the global log level (debug,info,warn,error)") print(" LOG_LEVEL_ Set the log level for one logger (debug,info,warn,error)") print(" OGUI_FEATURES Comma-separated list of features to enable") print(" OGUI_DISABLED_FEATURES Comma-separated list of features to disable") print("") - print("Features (--feature- / --feature-no-):") + print("Features (--feature- / --feature-no-, or alias flags):") for feature in feature_flags.get_features(): var description := feature.description if description == "": description = "Feature flag" print(" ", feature.id, " ", description) + var alias_text := "" + for alias in feature.aliases: + alias_text += " --" + str(alias) + if alias_text != "": + print(" aliases:", alias_text) print("") diff --git a/core/systems/boxart/boxart_provider.gd b/core/systems/boxart/boxart_provider.gd index fb06e7d77..71d012e22 100644 --- a/core/systems/boxart/boxart_provider.gd +++ b/core/systems/boxart/boxart_provider.gd @@ -23,6 +23,8 @@ enum LAYOUT { GRID_LANDSCAPE, ## Game art in landscape aspect ratio BANNER, ## Game art banner displayed in the game launcher menu LOGO, ## Game art logo + GRID_SQUARE, ## Game art square tile + ICON, ## Square icon } var BoxArtManager := load("res://core/global/boxart_manager.tres") as BoxArtManager diff --git a/core/systems/features/feature.gd b/core/systems/features/feature.gd index 034b46cf2..6baf15859 100644 --- a/core/systems/features/feature.gd +++ b/core/systems/features/feature.gd @@ -3,8 +3,9 @@ class_name Feature ## Definition of a single feature flag ## -## A Feature describes one toggleable behavior: its id, description, and default -## state. Feature objects hold no logic and are registered with [FeatureFlags]. +## A Feature describes one toggleable behavior: its id, description, default +## state, and optional command-line aliases. Feature objects hold no logic and +## are registered with [FeatureFlags]. ## The normalized identifier of this feature (lowercase, hyphen-separated). @export var id: String = "" @@ -15,6 +16,10 @@ class_name Feature ## The state this feature has when no source overrides it. @export var default: bool = false +## Alternate command-line flags for this feature, usable as "--" +## instead of "--feature-", e.g. "overlay-mode" for "--overlay-mode". +@export var aliases: Array[String] = [] + ## Creates a new feature with a normalized id. static func create(feature_id: String, feature_default: bool = false, feature_description: String = "") -> Feature: diff --git a/core/systems/features/feature_flags.gd b/core/systems/features/feature_flags.gd index 2877f1a40..302d26b31 100644 --- a/core/systems/features/feature_flags.gd +++ b/core/systems/features/feature_flags.gd @@ -5,7 +5,9 @@ class_name FeatureFlags ## ## FeatureFlags parses command-line arguments and environment variables to turn ## features on or off, and allows features to be toggled at runtime by plugins and -## platform classes. Signals are emitted when a feature changes so the UI can react. +## platform classes. A feature can also declare aliases, so "--overlay-mode" works +## the same as "--feature-overlay-mode". Signals are emitted when a feature +## changes so the UI can react. signal feature_registered(feature: Feature) signal feature_changed(feature: Feature, enabled: bool) @@ -37,6 +39,7 @@ var _env: Dictionary = {} var _env_overrides: Dictionary[String, bool] = {} var _arg_overrides: Dictionary[String, bool] = {} var _runtime_overrides: Dictionary[String, bool] = {} +## Reports unknown features, invalid registrations, and unparseable values. var logger: CustomLogger = Log.get_logger("FeatureFlags") @@ -69,6 +72,18 @@ func get_feature(id: String) -> Feature: return null +## Returns the registered feature listing the given alias, or null if none match. +func get_feature_by_alias(alias: String) -> Feature: + var normalized := Feature.normalize(alias) + for feature in features: + if not feature: + continue + for other in feature.aliases: + if Feature.normalize(str(other)) == normalized: + return feature + return null + + ## Returns all registered features. func get_features() -> Array[Feature]: return features @@ -144,16 +159,21 @@ func clear_sources() -> void: ## Applies the given command-line arguments. Testable entrypoint. func parse_args(args: Array[String]) -> void: for arg in args: - if not arg.begins_with(ARG_PREFIX): - continue - var id := arg.trim_prefix(ARG_PREFIX) - var enabled := true - if id.begins_with("no-"): - enabled = false - id = id.trim_prefix("no-") - if id == "": + if arg.begins_with(ARG_PREFIX): + var id := arg.trim_prefix(ARG_PREFIX) + var enabled := true + if id.begins_with("no-"): + enabled = false + id = id.trim_prefix("no-") + if id == "": + continue + _apply(Feature.normalize(id), enabled, Source.ARG) continue - _apply(Feature.normalize(id), enabled, Source.ARG) + # Aliases are plain flags that enable their feature, e.g. "--overlay-mode". + if arg.begins_with("--"): + var feature := get_feature_by_alias(arg.trim_prefix("--")) + if feature: + _apply(feature.id, true, Source.ARG) ## Applies the given environment variables. Testable entrypoint. diff --git a/core/systems/features/feature_flags.tres b/core/systems/features/feature_flags.tres index 1ef6b9cc9..f9a693153 100644 --- a/core/systems/features/feature_flags.tres +++ b/core/systems/features/feature_flags.tres @@ -15,6 +15,27 @@ id = "tdp" description = "Allow managing TDP settings" default = true +[sub_resource type="Resource" id="Feature_overlay_mode"] +script = ExtResource("1_feature") +id = "overlay-mode" +description = "Launch CardUI in overlay mode" +default = false +aliases = Array[String](["overlay-mode", "only-qam", "qam-only"]) + +[sub_resource type="Resource" id="Feature_card_ui"] +script = ExtResource("1_feature") +id = "card-ui" +description = "Use the Card UI (default interface)" +default = true +aliases = Array[String](["card-ui"]) + +[sub_resource type="Resource" id="Feature_etoile_ui"] +script = ExtResource("1_feature") +id = "etoile-ui" +description = "Use the Etoile UI instead of the default Card UI" +default = false +aliases = Array[String](["etoile-ui"]) + [resource] script = ExtResource("2_feature_flags") -features = Array[ExtResource("1_feature")]([SubResource("Feature_updater"), SubResource("Feature_tdp")]) +features = Array[ExtResource("1_feature")]([SubResource("Feature_updater"), SubResource("Feature_tdp"), SubResource("Feature_card_ui"), SubResource("Feature_etoile_ui"), SubResource("Feature_overlay_mode")]) diff --git a/core/systems/input/focus_group.gd b/core/systems/input/focus_group.gd index 62d423222..b003c7fda 100644 --- a/core/systems/input/focus_group.gd +++ b/core/systems/input/focus_group.gd @@ -73,15 +73,19 @@ func recalculate_focus() -> void: var control_children: Array[Control] = [] for child in parent.get_children(): - if not child is Control: + var current := child + if not current is Control: continue - if not child.is_inside_tree(): + if not current.is_inside_tree(): continue - if child.focus_mode != Control.FOCUS_ALL: - continue - control_children.append(child) - if not child.focus_entered.is_connected(_on_child_focused): - child.focus_entered.connect(_on_child_focused.bind(child)) + if (current as Control).focus_mode != Control.FOCUS_ALL: + var focusable_grandchild := find_focusable([current]) + if not focusable_grandchild: + continue + current = focusable_grandchild + control_children.append(current) + if not current.focus_entered.is_connected(_on_child_focused): + current.focus_entered.connect(_on_child_focused.bind(current)) if control_children.size() == 0: logger.trace("No control children. Nothing to do.") @@ -105,6 +109,22 @@ func recalculate_focus() -> void: if parent is VBoxContainer: _vbox_set_focus_tree(control_children) return + + if parent is GridContainer: + var grid_container := parent as GridContainer + var children_per_row := grid_container.columns + # Build a 2d array of the children + var grid: Array[Array] = [[]] + var y := 0 + for child in control_children: + var row := grid[y] + if row.size() >= children_per_row: + y += 1 + grid.append([]) + row = grid[y] + row.append(child) + _grid_set_focus_tree(grid) + return # For all others, try to recursively search for focusable children and # treat it like a VBoxContainer diff --git a/core/systems/input/input_icon_manager.gd b/core/systems/input/input_icon_manager.gd index e0cb5c177..d4127f3d2 100644 --- a/core/systems/input/input_icon_manager.gd +++ b/core/systems/input/input_icon_manager.gd @@ -360,7 +360,7 @@ func _get_matching_event(path: String, input_type: InputType) -> Array[InputEven var matching_events: Array[InputEvent] = [] if _custom_input_actions.has(path): events = _custom_input_actions[path] - else: + elif path != "": events = InputMap.action_get_events(path) # Check if any of the events have key modifiers var mod_events: Array[InputEvent] = [] @@ -430,6 +430,8 @@ func _parse_input_actions(): func _is_path_action(path: String) -> bool: + if path == "": + return false return _custom_input_actions.has(path) or InputMap.has_action(path) diff --git a/core/systems/metadata/metadata_manager.gd b/core/systems/metadata/metadata_manager.gd new file mode 100644 index 000000000..5bcf454ed --- /dev/null +++ b/core/systems/metadata/metadata_manager.gd @@ -0,0 +1,110 @@ +extends Resource +class_name MetadataManager + +## Fetch and manage metadata from registered [MetadataProvider] nodes +## +## The MetadataManager is responsible for managing any number of [MetadataProvider] +## nodes and providing a unified way to fetch metadata from multiple sources to +## any systems that might need them. New metadata sources can be created in the +## core code base or in plugins by implementing/extending the [MetadataProvider] +## class and adding them to the scene.[br][br] + +const settings_manager := preload("res://core/global/settings_manager.tres") + +## Fields required to be set by [MetadataProvider] implementations +const REQUIRED_FIELDS: Array = ["provider_id"] + +## Emitted when a metadata provider is added to the scene tree and registers +signal provider_registered(provider: MetadataProvider) +## Emitted when a metadata provider is removed from the scene tree +signal provider_unregistered(provider_id: String) + +var logger := Log.get_logger("MetadataManager") + +# Dictionary of registered metadata providers +var _providers: Dictionary[String, MetadataProvider] = {} +var _providers_by_priority: Array[String] = [] + + +## Returns the boxart of the given kind for the given library item. +func get_summary(item: LibraryItem) -> String: + return await _get_summary_sync(item) + + +func _get_summary_sync(item: LibraryItem) -> String: + if not item: + return "" + + if _providers.is_empty(): + logger.error("No metadata providers were found!") + return "" + + # Check to see if the given library item has a provider set + var provider_id := settings_manager.get_library_value(item, "metadata_provider", "") as String + if provider_id != "" and provider_id in _providers: + var provider := _providers[provider_id] + @warning_ignore("redundant_await") + var summary := await provider.get_summary(item) + return summary + + # Try each provider in order of priority + for id in _providers_by_priority: + logger.debug("Trying to load summary for {0} using provider: {1}".format([item.name, id])) + var provider := _providers[id] + @warning_ignore("redundant_await") + var summary := await provider.get_summary(item) + if summary.is_empty(): + continue + return summary + + return "" + +## Returns the given metadata implementation by id +func get_provider_by_id(id: String) -> MetadataProvider: + return _providers[id] + + +## Returns a list of all registered metadata providers +func get_providers() -> Array[MetadataProvider]: + return _providers.values() + + +## Returns a list of all registered metadata provider ids +func get_provider_ids() -> Array[String]: + return _providers.keys() + + +## Registers the given metadata provider with the metadata manager. +func register_provider(provider: MetadataProvider) -> void: + if not _is_valid_provider(provider): + logger.error("Invalid metadata provider defined! Ensure you have all required properties set: " + ",".join(REQUIRED_FIELDS)) + return + if provider.provider_id in _providers: + logger.debug("Provider already registered: " + provider.provider_id) + return + _providers[provider.provider_id] = provider + _providers_by_priority.push_back(provider.provider_id) + logger.info("Registered metadata provider: " + provider.provider_id) + provider_registered.emit(provider) + + +## Unregisters the given metadata provider +func unregister_provider(provider: MetadataProvider) -> void: + if not provider.provider_id in _providers: + logger.warn("Metadata provider already unregistered") + return + _providers.erase(provider.provider_id) + _providers_by_priority.erase(provider.provider_id) + logger.info("Unregistered metadata provider: " + provider.provider_id) + provider_unregistered.emit(provider.provider_id) + + +# Validates the given provider and returns true if it has the required properties +# set. +func _is_valid_provider(provider: MetadataProvider) -> bool: + for field in REQUIRED_FIELDS: + @warning_ignore("unsafe_call_argument") + var data = provider.get(field) + if data == "": + return false + return true diff --git a/core/systems/metadata/metadata_manager.gd.uid b/core/systems/metadata/metadata_manager.gd.uid new file mode 100644 index 000000000..03e144458 --- /dev/null +++ b/core/systems/metadata/metadata_manager.gd.uid @@ -0,0 +1 @@ +uid://cp11hjo3owdbo diff --git a/core/systems/metadata/metadata_manager.tres b/core/systems/metadata/metadata_manager.tres new file mode 100644 index 000000000..c2873fb94 --- /dev/null +++ b/core/systems/metadata/metadata_manager.tres @@ -0,0 +1,7 @@ +[gd_resource type="Resource" script_class="MetadataManager" format=3 uid="uid://bc4phadw02hgp"] + +[ext_resource type="Script" uid="uid://cp11hjo3owdbo" path="res://core/systems/metadata/metadata_manager.gd" id="1_pm2fd"] + +[resource] +script = ExtResource("1_pm2fd") +metadata/_custom_type_script = "uid://cp11hjo3owdbo" diff --git a/core/systems/metadata/metadata_provider.gd b/core/systems/metadata/metadata_provider.gd new file mode 100644 index 000000000..291e2a9b5 --- /dev/null +++ b/core/systems/metadata/metadata_provider.gd @@ -0,0 +1,36 @@ +@abstract +extends Node +class_name MetadataProvider + +## Base class for Metadata implementations +## +## The MetadataProvider class provides an interface for providing sources of +## game metadata. To create a new MetadataProvider, simply extend this class and +## implement its methods. When a MetadataProvider node enters the scene tree, it +## will automatically register itself with the global [MetadataManager]. +## +## When a menu requires showing metadata for a particular game, it will request +## that metadata from the [MetadataManager]. The manager, in turn, will request +## metadata from all registered metadata providers until it finds one. + +var metadata_manager := preload("res://core/systems/metadata/metadata_manager.tres") as MetadataManager + +## Unique identifier for the boxart provider +@export var provider_id: String +## Icon for boxart provider +@export var provider_icon: Texture2D + + +func _init() -> void: + ready.connect(add_to_group.bind("metadata_provider")) + ready.connect(metadata_manager.register_provider.bind(self)) + + +## Returns a text summary of the given library item +@warning_ignore("unused_parameter") +func get_summary(item: LibraryItem) -> String: + return "" + + +func _exit_tree() -> void: + metadata_manager.unregister_provider(self) diff --git a/core/systems/metadata/metadata_provider.gd.uid b/core/systems/metadata/metadata_provider.gd.uid new file mode 100644 index 000000000..8d8521d5d --- /dev/null +++ b/core/systems/metadata/metadata_provider.gd.uid @@ -0,0 +1 @@ +uid://ff1twp4kysmv diff --git a/core/systems/user_interface/user_interface.gd b/core/systems/user_interface/user_interface.gd deleted file mode 100644 index a943a3eeb..000000000 --- a/core/systems/user_interface/user_interface.gd +++ /dev/null @@ -1,4 +0,0 @@ -extends Resource -class_name UserInterface - -@export var name: String diff --git a/core/systems/user_interface/user_interface.gd.uid b/core/systems/user_interface/user_interface.gd.uid deleted file mode 100644 index 7ec9e351d..000000000 --- a/core/systems/user_interface/user_interface.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://ccwe02abuca5u diff --git a/core/ui/base/component.gd b/core/ui/base/component.gd new file mode 100644 index 000000000..d9afc2142 --- /dev/null +++ b/core/ui/base/component.gd @@ -0,0 +1,62 @@ +@abstract +@icon("res://assets/editor-icons/icon-park-twotone--figma-component.svg") +extends MarginContainer +class_name Component + +## User interface component +## +## Base building block of user interface elements. Plugins should use these components +## in any scenes they provide to ensure consistent look across different user interfaces. + +## Child implementation of the component. This should be an instantiated scene defined +## by a specific user interface. +var implementation: Control + + +func _init() -> void: + focus_mode = Control.FOCUS_ALL + mouse_filter = Control.MOUSE_FILTER_PASS + var on_ready := func() -> void: + if not implementation: + return + focus_mode = implementation.focus_mode + focus_entered.connect(_on_focus_entered) + ready.connect(on_ready) + + +func _on_focus_entered() -> void: + implementation.focus_neighbor_bottom = focus_neighbor_bottom + implementation.focus_neighbor_left = focus_neighbor_left + implementation.focus_neighbor_right = focus_neighbor_right + implementation.focus_neighbor_top = focus_neighbor_top + implementation.grab_focus() + + +## Connect the given signal function on the child implementation +func _connect_implementation_signal(signal_name: StringName, callable: Callable, flags: int = 0) -> void: + if not implementation.has_signal(signal_name): + return + implementation.connect(signal_name, callable, flags) + + +## Set the given property value on the child implementation +func _set_implementation_property(property: StringName, value: Variant) -> void: + if not implementation: + return + if not property in implementation: + return + @warning_ignore("unsafe_property_access") + implementation.set(property, value) + + +## Returns the detected user interface +func get_component_map() -> ComponentsMap: + var nodes := get_tree().get_nodes_in_group("main") + var main: Control + for node in nodes: + if not "components_map" in node: + continue + main = node + if not main: + return ComponentsMap.default() + return main.get("components_map") diff --git a/core/ui/base/component.gd.uid b/core/ui/base/component.gd.uid new file mode 100644 index 000000000..670375d1a --- /dev/null +++ b/core/ui/base/component.gd.uid @@ -0,0 +1 @@ +uid://brynwdlbvvgkx diff --git a/core/ui/base/component_button.gd b/core/ui/base/component_button.gd new file mode 100644 index 000000000..26290d8da --- /dev/null +++ b/core/ui/base/component_button.gd @@ -0,0 +1,66 @@ +@icon("res://assets/editor-icons/button.svg") +@tool +extends Component +class_name ComponentButton + +signal pressed +signal button_up +signal player_button_up(metaname: String, dbus_path: String) +signal button_down +signal player_button_down(metaname: String, dbus_path: String) + +@export var text: String: + set(v): + text = v + _set_implementation_property("text", v) +@export var disabled := false: + set(v): + disabled = v + _set_implementation_property("disabled", v) +@export var click_focuses := false: + set(v): + click_focuses = v + _set_implementation_property("click_focuses", v) +@export var icon_texture: Texture2D: + set(v): + icon_texture = v + _set_implementation_property("icon_texture", v) + + +func _ready() -> void: + var components := get_component_map() + if Engine.is_editor_hint(): + components = load("res://core/ui/etoile_ui/etoile_components.tres") + else: + assert(components != null, "Unable to detect user interface to build component") + implementation = components.build(ComponentsMap.Type.Button) + _connect_implementation_signal("pressed", _on_pressed) + _connect_implementation_signal("button_up", _on_button_up) + _connect_implementation_signal("player_button_up", _on_player_button_up) + _connect_implementation_signal("button_down", _on_button_down) + _connect_implementation_signal("player_button_down", _on_player_button_down) + disabled = disabled + click_focuses = click_focuses + icon_texture = icon_texture + text = text + add_child(implementation) + + +func _on_pressed() -> void: + pressed.emit() + + +func _on_button_up() -> void: + button_up.emit() + + +func _on_player_button_up(metaname: String, dbus_path: String) -> void: + player_button_up.emit(metaname, dbus_path) + + +func _on_button_down() -> void: + button_down.emit() + + +func _on_player_button_down(metaname: String, dbus_path: String) -> void: + player_button_down.emit(metaname, dbus_path) diff --git a/core/ui/base/component_button.gd.uid b/core/ui/base/component_button.gd.uid new file mode 100644 index 000000000..7e50d7492 --- /dev/null +++ b/core/ui/base/component_button.gd.uid @@ -0,0 +1 @@ +uid://ogqbbfs88xnr diff --git a/core/ui/base/component_slider.gd b/core/ui/base/component_slider.gd new file mode 100644 index 000000000..79678f500 --- /dev/null +++ b/core/ui/base/component_slider.gd @@ -0,0 +1,100 @@ +@icon("res://assets/editor-icons/slider.svg") +@tool +extends Component +class_name ComponentSlider + +signal drag_ended(value_changed: bool) +signal drag_started() +signal changed() +signal value_changed(value: float) + +@export var text: String: + set(v): + text = v + _set_implementation_property("text", v) +@export var description: String: + set(v): + description = v + _set_implementation_property("description", v) +@export var value: float = 0: + set(v): + value = v + _set_implementation_property("value", v) +@export var value_unit: String: + set(v): + value_unit = v + _set_implementation_property("value_unit", v) +@export var max_value: float = 100: + set(v): + max_value = v + _set_implementation_property("max_value", v) +@export var min_value: float = 0: + set(v): + min_value = v + _set_implementation_property("min_value", v) +@export var step: float = 1: + set(v): + step = v + _set_implementation_property("step", v) +@export var editable: bool = true: + set(v): + editable = v + _set_implementation_property("editable", v) +@export var show_label: bool = true: + set(v): + show_label = v + _set_implementation_property("show_label", v) +@export var show_decimal: bool = false: + set(v): + show_decimal = v + _set_implementation_property("show_decimal", v) +@export var icon_texture: Texture2D: + set(v): + icon_texture = v + _set_implementation_property("icon_texture", v) +@export var tick_count := 0: + set(v): + tick_count = v + _set_implementation_property("tick_count", v) + + +func _ready() -> void: + var components := get_component_map() + if Engine.is_editor_hint(): + components = load("res://core/ui/etoile_ui/etoile_components.tres") + else: + assert(components != null, "Unable to detect user interface to build component") + implementation = components.build(ComponentsMap.Type.Slider) + _connect_implementation_signal("drag_ended", _on_drag_ended) + _connect_implementation_signal("drag_started", _on_drag_started) + _connect_implementation_signal("changed", _on_changed) + _connect_implementation_signal("value_changed", _on_value_changed) + text = text + description = description + value = value + value_unit = value_unit + max_value = max_value + min_value = min_value + step = step + editable = editable + show_label = show_label + show_decimal = show_decimal + icon_texture = icon_texture + tick_count = tick_count + add_child(implementation) + + +func _on_drag_ended(v: bool) -> void: + drag_ended.emit(v) + + +func _on_drag_started() -> void: + drag_started.emit() + + +func _on_changed() -> void: + changed.emit() + + +func _on_value_changed(v: float) -> void: + value_changed.emit(v) diff --git a/core/ui/base/component_slider.gd.uid b/core/ui/base/component_slider.gd.uid new file mode 100644 index 000000000..273aaee4a --- /dev/null +++ b/core/ui/base/component_slider.gd.uid @@ -0,0 +1 @@ +uid://bldssymap3bh2 diff --git a/core/ui/base/components_map.gd b/core/ui/base/components_map.gd new file mode 100644 index 000000000..42ade5d0a --- /dev/null +++ b/core/ui/base/components_map.gd @@ -0,0 +1,30 @@ +@icon("res://assets/editor-icons/radix-icons--component-1.svg") +@tool +extends Resource +class_name ComponentsMap + + +enum Type { + Button, + Slider, +} + +@export_category("Components") +@export var button: PackedScene +@export var slider: PackedScene + + +## Build a UI component of the given type +func build(component_type: Type) -> Control: + match component_type: + Type.Button: + return button.instantiate() + Type.Slider: + return slider.instantiate() + return null + + +## Returns the default user interface +static func default() -> ComponentsMap: + var components := load("res://core/ui/etoile_ui/etoile_components.tres") as ComponentsMap + return components diff --git a/core/ui/base/components_map.gd.uid b/core/ui/base/components_map.gd.uid new file mode 100644 index 000000000..4ea8653da --- /dev/null +++ b/core/ui/base/components_map.gd.uid @@ -0,0 +1 @@ +uid://rbk4rsah3pud diff --git a/core/ui/base/user_interface.gd b/core/ui/base/user_interface.gd new file mode 100644 index 000000000..919fb9fa4 --- /dev/null +++ b/core/ui/base/user_interface.gd @@ -0,0 +1,5 @@ +extends Control +class_name UserInterface + +## List of UI components that this interface uses +@export var components_map: ComponentsMap diff --git a/core/ui/base/user_interface.gd.uid b/core/ui/base/user_interface.gd.uid new file mode 100644 index 000000000..04547e48b --- /dev/null +++ b/core/ui/base/user_interface.gd.uid @@ -0,0 +1 @@ +uid://dbueviwsjliyh diff --git a/core/ui/card_ui/card_ui.gd b/core/ui/card_ui/card_ui.gd index a3f68c255..e3722b9bc 100644 --- a/core/ui/card_ui/card_ui.gd +++ b/core/ui/card_ui/card_ui.gd @@ -1,4 +1,4 @@ -extends Control +extends UserInterface var platform := load("res://core/global/platform.tres") as Platform var gamescope := load("res://core/systems/gamescope/gamescope.tres") as GamescopeInstance diff --git a/core/ui/card_ui/card_ui.tscn b/core/ui/card_ui/card_ui.tscn index 82343e2cb..56388d625 100644 --- a/core/ui/card_ui/card_ui.tscn +++ b/core/ui/card_ui/card_ui.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=48 format=3 uid="uid://fhriwlhm0lcj"] +[gd_scene format=3 uid="uid://fhriwlhm0lcj"] [ext_resource type="PackedScene" uid="uid://n83wlhmmsu3j" path="res://core/systems/input/input_manager.tscn" id="1_34t85"] [ext_resource type="Script" uid="uid://dcv2u3sn10dg5" path="res://core/ui/card_ui/card_ui.gd" id="1_f8851"] [ext_resource type="PackedScene" uid="uid://dlegwm7jqfe2i" path="res://core/systems/boxart/boxart_local.tscn" id="2_600i0"] +[ext_resource type="Resource" uid="uid://dl25ybpnt5v11" path="res://core/ui/card_ui/card_ui_components.tres" id="2_qo5oe"] [ext_resource type="PackedScene" uid="uid://ch6qw6obetalo" path="res://core/systems/library/library_desktop.tscn" id="3_68bes"] [ext_resource type="Script" uid="uid://dbad1aoty3n0n" path="res://core/systems/input/input_icon_processor.gd" id="3_y116l"] [ext_resource type="Script" uid="uid://yhfpudolgixq" path="res://core/systems/gamescope/gamescope.gd" id="4_ksi1t"] @@ -85,7 +86,7 @@ _data = { &"fade": SubResource("Animation_vgwwd") } -[node name="CardUI" type="Control" groups=["main"]] +[node name="CardUI" type="Control" unique_id=811992148 groups=["main"]] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -93,52 +94,53 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 script = ExtResource("1_f8851") +components_map = ExtResource("2_qo5oe") -[node name="InputIconProcessor" type="Node" parent="."] +[node name="InputIconProcessor" type="Node" parent="." unique_id=1933465584] script = ExtResource("3_y116l") -[node name="Gamescope" type="Node" parent="."] +[node name="Gamescope" type="Node" parent="." unique_id=2001325950] script = ExtResource("4_ksi1t") instance = ExtResource("5_wmkau") -[node name="BoxArtLocal" parent="." instance=ExtResource("2_600i0")] +[node name="BoxArtLocal" parent="." unique_id=458366452 instance=ExtResource("2_600i0")] -[node name="DesktopLibrary" parent="." instance=ExtResource("3_68bes")] +[node name="DesktopLibrary" parent="." unique_id=676519754 instance=ExtResource("3_68bes")] -[node name="PluginManager" parent="." instance=ExtResource("5_dv70s")] +[node name="PluginManager" parent="." unique_id=697860319 instance=ExtResource("5_dv70s")] -[node name="PowerManager" type="Node" parent="."] +[node name="PowerManager" type="Node" parent="." unique_id=169891906] script = ExtResource("10_opsp8") instance = ExtResource("11_nk5v7") -[node name="Launcher" type="Node" parent="."] +[node name="Launcher" type="Node" parent="." unique_id=1910771547] script = ExtResource("14_fs00k") -[node name="PowerStation" type="Node" parent="."] +[node name="PowerStation" type="Node" parent="." unique_id=399368815] script = ExtResource("13_tag7s") instance = ExtResource("14_a5vk3") -[node name="NetworkManager" type="Node" parent="."] +[node name="NetworkManager" type="Node" parent="." unique_id=241556545] script = ExtResource("14_rqu7s") instance = ExtResource("15_k47ua") -[node name="ResourceProcessor" type="ResourceProcessor" parent="."] +[node name="ResourceProcessor" type="ResourceProcessor" parent="." unique_id=1042386721] registry = ExtResource("15_ne50o") -[node name="PipeManager" type="Node" parent="."] +[node name="PipeManager" type="Node" parent="." unique_id=656934327] script = ExtResource("17_s6ods") metadata/_custom_type_script = "uid://ompm0veql0ng" -[node name="PowerTimer" type="Timer" parent="."] +[node name="PowerTimer" type="Timer" parent="." unique_id=1812183011] unique_name_in_owner = true wait_time = 1.5 one_shot = true -[node name="GameLoading" parent="." instance=ExtResource("22_morxu")] +[node name="GameLoading" parent="." unique_id=2038583326 instance=ExtResource("22_morxu")] visible = false layout_mode = 1 -[node name="Panel" type="Panel" parent="."] +[node name="Panel" type="Panel" parent="." unique_id=362828251] unique_name_in_owner = true layout_mode = 1 anchors_preset = 15 @@ -148,7 +150,7 @@ grow_horizontal = 2 grow_vertical = 2 theme_type_variation = &"LightPanel" -[node name="MenuContent" type="MarginContainer" parent="."] +[node name="MenuContent" type="MarginContainer" parent="." unique_id=1814587239] unique_name_in_owner = true layout_mode = 1 anchors_preset = 15 @@ -158,102 +160,102 @@ grow_horizontal = 2 grow_vertical = 2 mouse_filter = 2 -[node name="AboveContextBarContainer" type="VBoxContainer" parent="MenuContent"] +[node name="AboveContextBarContainer" type="VBoxContainer" parent="MenuContent" unique_id=891510188] layout_mode = 2 alignment = 1 -[node name="AboveContextBarMargin" type="MarginContainer" parent="MenuContent/AboveContextBarContainer"] +[node name="AboveContextBarMargin" type="MarginContainer" parent="MenuContent/AboveContextBarContainer" unique_id=1332588375] layout_mode = 2 size_flags_vertical = 3 mouse_filter = 2 theme_override_constants/margin_bottom = 40 -[node name="CardUIHome" parent="MenuContent/AboveContextBarContainer/AboveContextBarMargin" instance=ExtResource("6_12lhu")] +[node name="CardUIHome" parent="MenuContent/AboveContextBarContainer/AboveContextBarMargin" unique_id=205943357 instance=ExtResource("6_12lhu")] visible = false layout_mode = 2 -[node name="GameLaunchMenu" parent="MenuContent/AboveContextBarContainer/AboveContextBarMargin" instance=ExtResource("9_m34in")] +[node name="GameLaunchMenu" parent="MenuContent/AboveContextBarContainer/AboveContextBarMargin" unique_id=898128038 instance=ExtResource("9_m34in")] visible = false layout_mode = 2 -[node name="GameSettingsMenu" parent="MenuContent/AboveContextBarContainer/AboveContextBarMargin" instance=ExtResource("10_7cj6o")] +[node name="GameSettingsMenu" parent="MenuContent/AboveContextBarContainer/AboveContextBarMargin" unique_id=1547612089 instance=ExtResource("10_7cj6o")] visible = false layout_mode = 2 -[node name="SettingsMenu" parent="MenuContent/AboveContextBarContainer/AboveContextBarMargin" instance=ExtResource("10_1ruvi")] +[node name="SettingsMenu" parent="MenuContent/AboveContextBarContainer/AboveContextBarMargin" unique_id=1442465609 instance=ExtResource("10_1ruvi")] unique_name_in_owner = true visible = false layout_mode = 2 -[node name="GamepadSettings" parent="MenuContent/AboveContextBarContainer/AboveContextBarMargin" instance=ExtResource("13_n64ve")] +[node name="GamepadSettings" parent="MenuContent/AboveContextBarContainer/AboveContextBarMargin" unique_id=1356120206 instance=ExtResource("13_n64ve")] visible = false layout_mode = 2 -[node name="FirstBootMenu" parent="MenuContent/AboveContextBarContainer/AboveContextBarMargin" instance=ExtResource("14_dpfu1")] +[node name="FirstBootMenu" parent="MenuContent/AboveContextBarContainer/AboveContextBarMargin" unique_id=488581403 instance=ExtResource("14_dpfu1")] visible = false layout_mode = 2 -[node name="HelpMenu" parent="MenuContent/AboveContextBarContainer/AboveContextBarMargin" instance=ExtResource("15_m1wp2")] +[node name="HelpMenu" parent="MenuContent/AboveContextBarContainer/AboveContextBarMargin" unique_id=1258033113 instance=ExtResource("15_m1wp2")] visible = false layout_mode = 2 -[node name="KeyboardSpacer" type="Control" parent="MenuContent/AboveContextBarContainer"] +[node name="KeyboardSpacer" type="Control" parent="MenuContent/AboveContextBarContainer" unique_id=185155738] layout_mode = 2 -[node name="FullscreenMenus" type="MarginContainer" parent="MenuContent"] +[node name="FullscreenMenus" type="MarginContainer" parent="MenuContent" unique_id=1510567858] layout_mode = 2 mouse_filter = 2 -[node name="LibraryMenu" parent="MenuContent/FullscreenMenus" instance=ExtResource("10_uqodp")] +[node name="LibraryMenu" parent="MenuContent/FullscreenMenus" unique_id=1781373293 instance=ExtResource("10_uqodp")] visible = false layout_mode = 2 -[node name="TopMargin" type="MarginContainer" parent="MenuContent"] +[node name="TopMargin" type="MarginContainer" parent="MenuContent" unique_id=1987577814] layout_mode = 2 mouse_filter = 2 theme_override_constants/margin_left = 30 theme_override_constants/margin_top = 10 theme_override_constants/margin_right = 30 -[node name="SearchBarMenu" parent="MenuContent/TopMargin" instance=ExtResource("10_7bl6b")] +[node name="SearchBarMenu" parent="MenuContent/TopMargin" unique_id=51508260 instance=ExtResource("10_7bl6b")] visible = false layout_mode = 2 -[node name="ButtonMenu" parent="MenuContent/TopMargin" instance=ExtResource("11_x7ns7")] +[node name="ButtonMenu" parent="MenuContent/TopMargin" unique_id=568664172 instance=ExtResource("11_x7ns7")] visible = false layout_mode = 2 -[node name="BottomMargin" type="MarginContainer" parent="MenuContent"] +[node name="BottomMargin" type="MarginContainer" parent="MenuContent" unique_id=928775708] layout_mode = 2 mouse_filter = 2 theme_override_constants/margin_left = 30 theme_override_constants/margin_right = 30 theme_override_constants/margin_bottom = 10 -[node name="VBoxContainer" type="VBoxContainer" parent="MenuContent/BottomMargin"] +[node name="VBoxContainer" type="VBoxContainer" parent="MenuContent/BottomMargin" unique_id=1364475698] layout_mode = 2 size_flags_vertical = 8 -[node name="LibraryLoadingNotification" parent="MenuContent/BottomMargin/VBoxContainer" instance=ExtResource("20_7tnsn")] +[node name="LibraryLoadingNotification" parent="MenuContent/BottomMargin/VBoxContainer" unique_id=1532919802 instance=ExtResource("20_7tnsn")] layout_mode = 2 -[node name="ContextBar" parent="MenuContent/BottomMargin/VBoxContainer" instance=ExtResource("12_bstc8")] +[node name="ContextBar" parent="MenuContent/BottomMargin/VBoxContainer" unique_id=1602282403 instance=ExtResource("12_bstc8")] layout_mode = 2 -[node name="MenuContainer" type="MarginContainer" parent="MenuContent"] +[node name="MenuContainer" type="MarginContainer" parent="MenuContent" unique_id=261992601] layout_mode = 2 mouse_filter = 2 theme_override_constants/margin_bottom = 70 -[node name="MainMenu" parent="MenuContent/MenuContainer" instance=ExtResource("13_46tck")] +[node name="MainMenu" parent="MenuContent/MenuContainer" unique_id=1434540106 instance=ExtResource("13_46tck")] visible = false layout_mode = 2 -[node name="QuickBarMenu" parent="MenuContent/MenuContainer" instance=ExtResource("14_lsaok")] +[node name="QuickBarMenu" parent="MenuContent/MenuContainer" unique_id=864417962 instance=ExtResource("14_lsaok")] visible = false layout_mode = 2 -[node name="AlwaysVisibleContent" type="MarginContainer" parent="."] +[node name="AlwaysVisibleContent" type="MarginContainer" parent="." unique_id=121747756] editor_description = "Anything in this container will always be visible, even during in-game states. " z_index = 20 @@ -265,48 +267,48 @@ grow_horizontal = 2 grow_vertical = 2 mouse_filter = 2 -[node name="OverlayContainer" parent="AlwaysVisibleContent" instance=ExtResource("23_h8glb")] +[node name="OverlayContainer" parent="AlwaysVisibleContent" unique_id=2144983291 instance=ExtResource("23_h8glb")] layout_mode = 2 -[node name="PowerMenu" parent="AlwaysVisibleContent" instance=ExtResource("20_noim3")] +[node name="PowerMenu" parent="AlwaysVisibleContent" unique_id=1130660400 instance=ExtResource("20_noim3")] visible = false layout_mode = 2 -[node name="VolumeIndicator" parent="AlwaysVisibleContent" instance=ExtResource("18_g4maw")] +[node name="VolumeIndicator" parent="AlwaysVisibleContent" unique_id=1986884545 instance=ExtResource("18_g4maw")] layout_mode = 2 -[node name="TopMargin" type="MarginContainer" parent="AlwaysVisibleContent"] +[node name="TopMargin" type="MarginContainer" parent="AlwaysVisibleContent" unique_id=436769158] layout_mode = 2 mouse_filter = 2 theme_override_constants/margin_left = 30 theme_override_constants/margin_top = 10 theme_override_constants/margin_right = 30 -[node name="InGameNotification" parent="AlwaysVisibleContent/TopMargin" instance=ExtResource("16_bcudw")] +[node name="InGameNotification" parent="AlwaysVisibleContent/TopMargin" unique_id=814566302 instance=ExtResource("16_bcudw")] visible = false layout_mode = 2 size_flags_horizontal = 8 size_flags_vertical = 0 -[node name="Dialog" parent="AlwaysVisibleContent" instance=ExtResource("34_m8t53")] +[node name="Dialog" parent="AlwaysVisibleContent" unique_id=548325582 instance=ExtResource("34_m8t53")] unique_name_in_owner = true visible = false layout_mode = 2 size_flags_horizontal = 4 size_flags_vertical = 4 -[node name="OnScreenKeyboard" parent="AlwaysVisibleContent" instance=ExtResource("18_462u5")] +[node name="OnScreenKeyboard" parent="AlwaysVisibleContent" unique_id=854312758 instance=ExtResource("18_462u5")] visible = false layout_mode = 2 -[node name="FadeEffect" parent="AlwaysVisibleContent/OnScreenKeyboard" node_paths=PackedStringArray("target") instance=ExtResource("27_jq430")] +[node name="FadeEffect" parent="AlwaysVisibleContent/OnScreenKeyboard" unique_id=750376048 node_paths=PackedStringArray("target") instance=ExtResource("27_jq430")] target = NodePath("..") fade_speed = 0.2 on_signal = "opened" fade_out_signal = "closed" on_signal = "opened" -[node name="SlideEffect" parent="AlwaysVisibleContent/OnScreenKeyboard" node_paths=PackedStringArray("target") instance=ExtResource("28_ex7w4")] +[node name="SlideEffect" parent="AlwaysVisibleContent/OnScreenKeyboard" unique_id=372394162 node_paths=PackedStringArray("target") instance=ExtResource("28_ex7w4")] target = NodePath("../MarginContainer/PanelContainer") slide_speed = 0.15 margin = 60 @@ -315,14 +317,14 @@ on_signal = "opened" slide_out_signal = "closed" on_signal = "opened" -[node name="SpacerGrowerEffect" parent="AlwaysVisibleContent/OnScreenKeyboard" node_paths=PackedStringArray("target", "content_container") instance=ExtResource("32_1lhvy")] +[node name="SpacerGrowerEffect" parent="AlwaysVisibleContent/OnScreenKeyboard" unique_id=1936368762 node_paths=PackedStringArray("target", "content_container") instance=ExtResource("32_1lhvy")] target = NodePath("../../../MenuContent/AboveContextBarContainer/KeyboardSpacer") content_container = NodePath("../../../OnScreenKeyboardDisplacement") on_signal = "opened" shrink_signal = "closed" on_signal = "opened" -[node name="OnScreenKeyboardDisplacement" type="Control" parent="."] +[node name="OnScreenKeyboardDisplacement" type="Control" parent="." unique_id=1047019174] editor_description = "This is a dummy node with a custom minimum size used for the \"SpacerGrowerEffect\" when the OSK is opened." custom_minimum_size = Vector2(0, 225) layout_mode = 1 @@ -334,7 +336,7 @@ grow_horizontal = 2 grow_vertical = 0 mouse_filter = 2 -[node name="FadeTexture" type="TextureRect" parent="."] +[node name="FadeTexture" type="TextureRect" parent="." unique_id=1008194969] unique_name_in_owner = true z_index = 21 layout_mode = 1 @@ -345,13 +347,11 @@ grow_horizontal = 2 grow_vertical = 2 texture = SubResource("GradientTexture1D_y4ncd") -[node name="FadeTransitionPlayer" type="AnimationPlayer" parent="FadeTexture"] +[node name="FadeTransitionPlayer" type="AnimationPlayer" parent="FadeTexture" unique_id=1946344549] unique_name_in_owner = true -libraries = { -&"": SubResource("AnimationLibrary_06k1n") -} +libraries/ = SubResource("AnimationLibrary_06k1n") -[node name="BootVideoPlayer" type="VideoStreamPlayer" parent="."] +[node name="BootVideoPlayer" type="VideoStreamPlayer" parent="." unique_id=1215857779] unique_name_in_owner = true z_index = 21 layout_mode = 1 @@ -369,8 +369,8 @@ grow_vertical = 2 stream = ExtResource("21_s3peg") autoplay = true -[node name="PowerSaver" parent="." instance=ExtResource("8_hyc1j")] +[node name="PowerSaver" parent="." unique_id=481268207 instance=ExtResource("8_hyc1j")] -[node name="InputManager" parent="." instance=ExtResource("1_34t85")] +[node name="InputManager" parent="." unique_id=561294061 instance=ExtResource("1_34t85")] [editable path="AlwaysVisibleContent/OnScreenKeyboard"] diff --git a/core/ui/card_ui/card_ui_components.tres b/core/ui/card_ui/card_ui_components.tres new file mode 100644 index 000000000..2a440acb4 --- /dev/null +++ b/core/ui/card_ui/card_ui_components.tres @@ -0,0 +1,11 @@ +[gd_resource type="Resource" script_class="ComponentsMap" format=3 uid="uid://dl25ybpnt5v11"] + +[ext_resource type="PackedScene" uid="uid://c71ayw7pcw6u6" path="res://core/ui/components/card_button.tscn" id="1_15ui8"] +[ext_resource type="Script" uid="uid://rbk4rsah3pud" path="res://core/ui/base/components_map.gd" id="1_k2qbg"] +[ext_resource type="PackedScene" uid="uid://cemxrvvjgm4g" path="res://core/ui/components/slider.tscn" id="3_m08la"] + +[resource] +script = ExtResource("1_k2qbg") +button = ExtResource("1_15ui8") +slider = ExtResource("3_m08la") +metadata/_custom_type_script = "uid://rbk4rsah3pud" diff --git a/core/ui/card_ui/home/cardui_home.tscn b/core/ui/card_ui/home/cardui_home.tscn index d723b8de7..6db3a6cc2 100644 --- a/core/ui/card_ui/home/cardui_home.tscn +++ b/core/ui/card_ui/home/cardui_home.tscn @@ -187,5 +187,5 @@ layout_mode = 2 [node name="AnimationPlayer" type="AnimationPlayer" parent="."] unique_name_in_owner = true libraries = { -"": SubResource("AnimationLibrary_srvn2") +&"": SubResource("AnimationLibrary_srvn2") } diff --git a/core/ui/card_ui/launch/game_settings.tscn b/core/ui/card_ui/launch/game_settings.tscn index 38d9e43e3..9d000ff53 100644 --- a/core/ui/card_ui/launch/game_settings.tscn +++ b/core/ui/card_ui/launch/game_settings.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=24 format=3 uid="uid://58qlqqbh58im"] +[gd_scene format=3 uid="uid://58qlqqbh58im"] [ext_resource type="Script" uid="uid://dlcsn1qwaj373" path="res://core/ui/card_ui/launch/game_settings.gd" id="1_vrr6s"] [ext_resource type="PackedScene" uid="uid://c6fg6uvng0ovi" path="res://core/systems/input/input_watcher.tscn" id="2_1eqgx"] @@ -24,7 +24,7 @@ [ext_resource type="PackedScene" uid="uid://bo077a5mwi7xl" path="res://core/ui/components/transition_fade_in.tscn" id="29_voua8"] [ext_resource type="Script" uid="uid://5vbrx221i2hm" path="res://core/ui/components/transition_container.gd" id="34_j5cnx"] -[node name="GameSettingsMenu" type="Control"] +[node name="GameSettingsMenu" type="Control" unique_id=1783107922] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -33,25 +33,25 @@ grow_horizontal = 2 grow_vertical = 2 script = ExtResource("1_vrr6s") -[node name="InputWatcher" parent="." instance=ExtResource("2_1eqgx")] +[node name="InputWatcher" parent="." unique_id=1253672787 instance=ExtResource("2_1eqgx")] stop_propagation = true action = "ogui_east" -[node name="StateUpdater" parent="InputWatcher" instance=ExtResource("15_lmmqq")] +[node name="StateUpdater" parent="InputWatcher" unique_id=1643016462 instance=ExtResource("15_lmmqq")] state_machine = ExtResource("4_5bv80") action = 2 on_signal = "input_released" -[node name="StateWatcher" parent="." instance=ExtResource("5_0v30m")] +[node name="StateWatcher" parent="." unique_id=1200165712 instance=ExtResource("5_0v30m")] state = ExtResource("3_s80bx") -[node name="FadeEffect" parent="StateWatcher" node_paths=PackedStringArray("target") instance=ExtResource("7_5qmye")] +[node name="FadeEffect" parent="StateWatcher" unique_id=2059529857 node_paths=PackedStringArray("target") instance=ExtResource("7_5qmye")] target = NodePath("../..") on_signal = "state_entered" fade_out_signal = "state_exited" on_signal = "state_entered" -[node name="MarginContainer" type="MarginContainer" parent="."] +[node name="MarginContainer" type="MarginContainer" parent="." unique_id=601485217] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -63,33 +63,33 @@ theme_override_constants/margin_top = 10 theme_override_constants/margin_right = 20 theme_override_constants/margin_bottom = 30 -[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer"] +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer" unique_id=506859448] layout_mode = 2 theme_override_constants/separation = 20 -[node name="MenuContainer" type="MarginContainer" parent="MarginContainer/HBoxContainer"] +[node name="MenuContainer" type="MarginContainer" parent="MarginContainer/HBoxContainer" unique_id=2043441828] layout_mode = 2 size_flags_horizontal = 3 -[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/HBoxContainer/MenuContainer"] +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/HBoxContainer/MenuContainer" unique_id=1845308065] layout_mode = 2 theme_override_constants/separation = 20 -[node name="VersionContainer" type="PanelContainer" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer"] +[node name="VersionContainer" type="PanelContainer" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer" unique_id=1097816782] layout_mode = 2 theme_type_variation = &"SettingsMenu" -[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/VersionContainer"] +[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/VersionContainer" unique_id=1253844301] layout_mode = 2 theme_override_constants/margin_left = 20 theme_override_constants/margin_top = 5 theme_override_constants/margin_right = 20 theme_override_constants/margin_bottom = 5 -[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/VersionContainer/MarginContainer"] +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/VersionContainer/MarginContainer" unique_id=1876077992] layout_mode = 2 -[node name="GameNameLabel" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/VersionContainer/MarginContainer/HBoxContainer" instance=ExtResource("11_u6frn")] +[node name="GameNameLabel" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/VersionContainer/MarginContainer/HBoxContainer" unique_id=2136834988 instance=ExtResource("11_u6frn")] unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 @@ -98,22 +98,22 @@ horizontal_alignment = 1 autowrap_mode = 3 uppercase = true -[node name="ButtonContainer" type="PanelContainer" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer"] +[node name="ButtonContainer" type="PanelContainer" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer" unique_id=114948766] layout_mode = 2 size_flags_vertical = 3 theme_type_variation = &"SettingsMenu" -[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/ButtonContainer"] +[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/ButtonContainer" unique_id=1729955098] layout_mode = 2 theme_override_constants/margin_left = 50 theme_override_constants/margin_top = 20 theme_override_constants/margin_right = 50 theme_override_constants/margin_bottom = 20 -[node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/ButtonContainer/MarginContainer"] +[node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/ButtonContainer/MarginContainer" unique_id=1544564401] layout_mode = 2 -[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/ButtonContainer/MarginContainer/ScrollContainer"] +[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/ButtonContainer/MarginContainer/ScrollContainer" unique_id=597014430] layout_mode = 2 size_flags_horizontal = 3 theme_override_constants/margin_left = 5 @@ -121,127 +121,127 @@ theme_override_constants/margin_top = 5 theme_override_constants/margin_right = 5 theme_override_constants/margin_bottom = 5 -[node name="ButtonsContainer" type="VBoxContainer" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/ButtonContainer/MarginContainer/ScrollContainer/MarginContainer"] +[node name="ButtonsContainer" type="VBoxContainer" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/ButtonContainer/MarginContainer/ScrollContainer/MarginContainer" unique_id=292344913] unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 theme_override_constants/separation = 10 -[node name="FocusGroup" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/ButtonContainer/MarginContainer/ScrollContainer/MarginContainer/ButtonsContainer" node_paths=PackedStringArray("current_focus") instance=ExtResource("12_86g2h")] +[node name="FocusGroup" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/ButtonContainer/MarginContainer/ScrollContainer/MarginContainer/ButtonsContainer" unique_id=189520279 node_paths=PackedStringArray("current_focus") instance=ExtResource("12_86g2h")] unique_name_in_owner = true current_focus = NodePath("../LaunchButton") focus_stack = ExtResource("12_e0uun") -[node name="LaunchButton" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/ButtonContainer/MarginContainer/ScrollContainer/MarginContainer/ButtonsContainer" instance=ExtResource("19_1erbu")] +[node name="LaunchButton" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/ButtonContainer/MarginContainer/ScrollContainer/MarginContainer/ButtonsContainer" unique_id=1585990563 instance=ExtResource("19_1erbu")] layout_mode = 2 text = "Launch" -[node name="StateUpdater" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/ButtonContainer/MarginContainer/ScrollContainer/MarginContainer/ButtonsContainer/LaunchButton" instance=ExtResource("15_lmmqq")] +[node name="StateUpdater" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/ButtonContainer/MarginContainer/ScrollContainer/MarginContainer/ButtonsContainer/LaunchButton" unique_id=249626868 instance=ExtResource("15_lmmqq")] state_machine = ExtResource("20_cokg3") state = ExtResource("21_tdepl") action = 3 on_signal = "focus_entered" -[node name="FocusGroupSetter" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/ButtonContainer/MarginContainer/ScrollContainer/MarginContainer/ButtonsContainer/LaunchButton" node_paths=PackedStringArray("target") instance=ExtResource("18_qwki4")] +[node name="FocusGroupSetter" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/ButtonContainer/MarginContainer/ScrollContainer/MarginContainer/ButtonsContainer/LaunchButton" unique_id=1168274991 node_paths=PackedStringArray("target") instance=ExtResource("18_qwki4")] target = NodePath("../../../../../../../../../ContentContainer/VBoxContainer/ContentContainer/MarginContainer/LaunchSettings/MarginContainer/VBoxContainer/FocusGroup") on_signal = "pressed" -[node name="BoxartButton" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/ButtonContainer/MarginContainer/ScrollContainer/MarginContainer/ButtonsContainer" instance=ExtResource("19_1erbu")] +[node name="BoxartButton" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/ButtonContainer/MarginContainer/ScrollContainer/MarginContainer/ButtonsContainer" unique_id=1407072 instance=ExtResource("19_1erbu")] layout_mode = 2 text = "Boxart" -[node name="StateUpdater" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/ButtonContainer/MarginContainer/ScrollContainer/MarginContainer/ButtonsContainer/BoxartButton" instance=ExtResource("15_lmmqq")] +[node name="StateUpdater" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/ButtonContainer/MarginContainer/ScrollContainer/MarginContainer/ButtonsContainer/BoxartButton" unique_id=2078063805 instance=ExtResource("15_lmmqq")] state_machine = ExtResource("20_cokg3") state = ExtResource("25_3xebk") action = 3 on_signal = "focus_entered" -[node name="FocusGroupSetter" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/ButtonContainer/MarginContainer/ScrollContainer/MarginContainer/ButtonsContainer/BoxartButton" node_paths=PackedStringArray("target") instance=ExtResource("18_qwki4")] +[node name="FocusGroupSetter" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/ButtonContainer/MarginContainer/ScrollContainer/MarginContainer/ButtonsContainer/BoxartButton" unique_id=442759564 node_paths=PackedStringArray("target") instance=ExtResource("18_qwki4")] target = NodePath("../../../../../../../../../ContentContainer/VBoxContainer/ContentContainer/MarginContainer/BoxArtSettings/MarginContainer/VBoxContainer/FocusGroup") on_signal = "pressed" -[node name="LibraryButton" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/ButtonContainer/MarginContainer/ScrollContainer/MarginContainer/ButtonsContainer" instance=ExtResource("19_1erbu")] +[node name="LibraryButton" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/ButtonContainer/MarginContainer/ScrollContainer/MarginContainer/ButtonsContainer" unique_id=857678607 instance=ExtResource("19_1erbu")] layout_mode = 2 text = "Library" -[node name="StateUpdater" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/ButtonContainer/MarginContainer/ScrollContainer/MarginContainer/ButtonsContainer/LibraryButton" instance=ExtResource("15_lmmqq")] +[node name="StateUpdater" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/ButtonContainer/MarginContainer/ScrollContainer/MarginContainer/ButtonsContainer/LibraryButton" unique_id=2036560525 instance=ExtResource("15_lmmqq")] state_machine = ExtResource("20_cokg3") state = ExtResource("24_um3vy") action = 3 on_signal = "focus_entered" -[node name="FocusGroupSetter" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/ButtonContainer/MarginContainer/ScrollContainer/MarginContainer/ButtonsContainer/LibraryButton" node_paths=PackedStringArray("target") instance=ExtResource("18_qwki4")] +[node name="FocusGroupSetter" parent="MarginContainer/HBoxContainer/MenuContainer/VBoxContainer/ButtonContainer/MarginContainer/ScrollContainer/MarginContainer/ButtonsContainer/LibraryButton" unique_id=1177771120 node_paths=PackedStringArray("target") instance=ExtResource("18_qwki4")] target = NodePath("../../../../../../../../../ContentContainer/VBoxContainer/ContentContainer/MarginContainer/LibrarySettings/MarginContainer/VBoxContainer/FocusGroup") on_signal = "pressed" -[node name="ContentContainer" type="MarginContainer" parent="MarginContainer/HBoxContainer"] +[node name="ContentContainer" type="MarginContainer" parent="MarginContainer/HBoxContainer" unique_id=1248971628] layout_mode = 2 size_flags_horizontal = 3 size_flags_stretch_ratio = 2.75 -[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/HBoxContainer/ContentContainer"] +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/HBoxContainer/ContentContainer" unique_id=477078787] layout_mode = 2 theme_override_constants/separation = 20 -[node name="TitleContainer" type="PanelContainer" parent="MarginContainer/HBoxContainer/ContentContainer/VBoxContainer"] +[node name="TitleContainer" type="PanelContainer" parent="MarginContainer/HBoxContainer/ContentContainer/VBoxContainer" unique_id=1626409989] layout_mode = 2 size_flags_horizontal = 4 theme_type_variation = &"SettingsMenu" -[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/HBoxContainer/ContentContainer/VBoxContainer/TitleContainer"] +[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/HBoxContainer/ContentContainer/VBoxContainer/TitleContainer" unique_id=1432099587] layout_mode = 2 theme_override_constants/margin_left = 20 theme_override_constants/margin_top = 5 theme_override_constants/margin_right = 20 theme_override_constants/margin_bottom = 5 -[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/HBoxContainer/ContentContainer/VBoxContainer/TitleContainer/MarginContainer"] +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/HBoxContainer/ContentContainer/VBoxContainer/TitleContainer/MarginContainer" unique_id=1437489251] layout_mode = 2 -[node name="SectionLabel" parent="MarginContainer/HBoxContainer/ContentContainer/VBoxContainer/TitleContainer/MarginContainer/HBoxContainer" instance=ExtResource("27_06vpr")] +[node name="SectionLabel" parent="MarginContainer/HBoxContainer/ContentContainer/VBoxContainer/TitleContainer/MarginContainer/HBoxContainer" unique_id=1909099767 instance=ExtResource("27_06vpr")] unique_name_in_owner = true layout_mode = 2 uppercase = true -[node name="ContentContainer" type="PanelContainer" parent="MarginContainer/HBoxContainer/ContentContainer/VBoxContainer"] +[node name="ContentContainer" type="PanelContainer" parent="MarginContainer/HBoxContainer/ContentContainer/VBoxContainer" unique_id=896143660] layout_mode = 2 size_flags_vertical = 3 theme_type_variation = &"SettingsMenu" -[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/HBoxContainer/ContentContainer/VBoxContainer/ContentContainer"] +[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/HBoxContainer/ContentContainer/VBoxContainer/ContentContainer" unique_id=411885156] layout_mode = 2 theme_override_constants/margin_left = 20 theme_override_constants/margin_top = 5 theme_override_constants/margin_right = 20 theme_override_constants/margin_bottom = 5 -[node name="LaunchSettings" parent="MarginContainer/HBoxContainer/ContentContainer/VBoxContainer/ContentContainer/MarginContainer" instance=ExtResource("19_06mfy")] +[node name="LaunchSettings" parent="MarginContainer/HBoxContainer/ContentContainer/VBoxContainer/ContentContainer/MarginContainer" unique_id=62306361 instance=ExtResource("19_06mfy")] layout_mode = 2 -[node name="VisibilityManager" parent="MarginContainer/HBoxContainer/ContentContainer/VBoxContainer/ContentContainer/MarginContainer/LaunchSettings" instance=ExtResource("2_pga6u")] +[node name="VisibilityManager" parent="MarginContainer/HBoxContainer/ContentContainer/VBoxContainer/ContentContainer/MarginContainer/LaunchSettings" unique_id=846108569 instance=ExtResource("2_pga6u")] state_machine = ExtResource("20_cokg3") state = ExtResource("21_tdepl") -[node name="TransitionContainer" type="Node" parent="MarginContainer/HBoxContainer/ContentContainer/VBoxContainer/ContentContainer/MarginContainer/LaunchSettings"] +[node name="TransitionContainer" type="Node" parent="MarginContainer/HBoxContainer/ContentContainer/VBoxContainer/ContentContainer/MarginContainer/LaunchSettings" unique_id=1511998625] script = ExtResource("34_j5cnx") -[node name="TransitionFadeIn" parent="MarginContainer/HBoxContainer/ContentContainer/VBoxContainer/ContentContainer/MarginContainer/LaunchSettings/TransitionContainer" instance=ExtResource("29_voua8")] +[node name="TransitionFadeIn" parent="MarginContainer/HBoxContainer/ContentContainer/VBoxContainer/ContentContainer/MarginContainer/LaunchSettings/TransitionContainer" unique_id=1279061554 instance=ExtResource("29_voua8")] -[node name="BoxArtSettings" parent="MarginContainer/HBoxContainer/ContentContainer/VBoxContainer/ContentContainer/MarginContainer" instance=ExtResource("24_4afdc")] +[node name="BoxArtSettings" parent="MarginContainer/HBoxContainer/ContentContainer/VBoxContainer/ContentContainer/MarginContainer" unique_id=1254828018 instance=ExtResource("24_4afdc")] visible = false layout_mode = 2 -[node name="VisibilityManager" parent="MarginContainer/HBoxContainer/ContentContainer/VBoxContainer/ContentContainer/MarginContainer/BoxArtSettings" instance=ExtResource("2_pga6u")] +[node name="VisibilityManager" parent="MarginContainer/HBoxContainer/ContentContainer/VBoxContainer/ContentContainer/MarginContainer/BoxArtSettings" unique_id=1418996418 instance=ExtResource("2_pga6u")] state_machine = ExtResource("20_cokg3") state = ExtResource("25_3xebk") -[node name="TransitionContainer" type="Node" parent="MarginContainer/HBoxContainer/ContentContainer/VBoxContainer/ContentContainer/MarginContainer/BoxArtSettings"] +[node name="TransitionContainer" type="Node" parent="MarginContainer/HBoxContainer/ContentContainer/VBoxContainer/ContentContainer/MarginContainer/BoxArtSettings" unique_id=998214610] script = ExtResource("34_j5cnx") -[node name="TransitionFadeIn" parent="MarginContainer/HBoxContainer/ContentContainer/VBoxContainer/ContentContainer/MarginContainer/BoxArtSettings/TransitionContainer" instance=ExtResource("29_voua8")] +[node name="TransitionFadeIn" parent="MarginContainer/HBoxContainer/ContentContainer/VBoxContainer/ContentContainer/MarginContainer/BoxArtSettings/TransitionContainer" unique_id=1812164454 instance=ExtResource("29_voua8")] -[node name="LibrarySettings" parent="MarginContainer/HBoxContainer/ContentContainer/VBoxContainer/ContentContainer/MarginContainer" instance=ExtResource("25_c26mp")] +[node name="LibrarySettings" parent="MarginContainer/HBoxContainer/ContentContainer/VBoxContainer/ContentContainer/MarginContainer" unique_id=235021104 instance=ExtResource("25_c26mp")] visible = false layout_mode = 2 diff --git a/core/ui/card_ui/power/power_menu.tscn b/core/ui/card_ui/power/power_menu.tscn index a2bcb3a4b..e6b4cc289 100644 --- a/core/ui/card_ui/power/power_menu.tscn +++ b/core/ui/card_ui/power/power_menu.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=15 format=3 uid="uid://lfm3ps837gy5"] +[gd_scene format=3 uid="uid://lfm3ps837gy5"] [ext_resource type="Script" uid="uid://cdp5711ctg61e" path="res://core/ui/card_ui/power/power_menu.gd" id="2_0vc46"] [ext_resource type="Shader" uid="uid://ce5e0818nvi68" path="res://assets/shaders/simple_blur.gdshader" id="2_hkifr"] @@ -22,7 +22,7 @@ shader_parameter/color_over = Color(0, 0, 0, 0) [sub_resource type="Resource" id="Resource_fafkw"] script = ExtResource("10_6ywv6") -[node name="PowerMenu" type="Control" groups=["power_menu"]] +[node name="PowerMenu" type="Control" unique_id=1824508021 groups=["power_menu"]] z_index = 20 layout_mode = 3 anchors_preset = 15 @@ -32,10 +32,10 @@ grow_horizontal = 2 grow_vertical = 2 script = ExtResource("2_0vc46") -[node name="BackBufferCopy" type="BackBufferCopy" parent="."] +[node name="BackBufferCopy" type="BackBufferCopy" parent="." unique_id=660223367] copy_mode = 2 -[node name="ColorRect" type="ColorRect" parent="."] +[node name="ColorRect" type="ColorRect" parent="." unique_id=712586513] material = SubResource("ShaderMaterial_v0ws8") layout_mode = 1 anchors_preset = 15 @@ -45,7 +45,7 @@ grow_horizontal = 2 grow_vertical = 2 color = Color(0, 0, 0, 1) -[node name="ColorRect2" type="ColorRect" parent="."] +[node name="ColorRect2" type="ColorRect" parent="." unique_id=2047072239] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -54,25 +54,25 @@ grow_horizontal = 2 grow_vertical = 2 color = Color(0, 0, 0, 0.666667) -[node name="InputWatcher" parent="." instance=ExtResource("3_1whtm")] +[node name="InputWatcher" parent="." unique_id=1464874353 instance=ExtResource("3_1whtm")] stop_propagation = true action = "ogui_east" -[node name="StateUpdater" parent="InputWatcher" instance=ExtResource("4_4rhfl")] +[node name="StateUpdater" parent="InputWatcher" unique_id=1773199426 instance=ExtResource("4_4rhfl")] state_machine = ExtResource("5_kxixy") action = 2 on_signal = "input_released" -[node name="StateWatcher" parent="." instance=ExtResource("6_34b1q")] +[node name="StateWatcher" parent="." unique_id=1664472281 instance=ExtResource("6_34b1q")] state = ExtResource("5_u1rly") -[node name="FadeEffect" parent="StateWatcher" node_paths=PackedStringArray("target") instance=ExtResource("8_xohsw")] +[node name="FadeEffect" parent="StateWatcher" unique_id=1086466367 node_paths=PackedStringArray("target") instance=ExtResource("8_xohsw")] target = NodePath("../..") on_signal = "state_entered" fade_out_signal = "state_exited" on_signal = "state_entered" -[node name="PanelContainer" type="PanelContainer" parent="."] +[node name="PanelContainer" type="PanelContainer" parent="." unique_id=1376297494] custom_minimum_size = Vector2(200, 150) layout_mode = 1 anchors_preset = 8 @@ -88,58 +88,53 @@ grow_horizontal = 2 grow_vertical = 2 theme_type_variation = &"PowerMenu" -[node name="MarginContainer" type="MarginContainer" parent="PanelContainer"] +[node name="MarginContainer" type="MarginContainer" parent="PanelContainer" unique_id=729023065] layout_mode = 2 theme_override_constants/margin_left = 20 theme_override_constants/margin_top = 20 theme_override_constants/margin_right = 20 theme_override_constants/margin_bottom = 20 -[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/MarginContainer"] +[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/MarginContainer" unique_id=53160114] layout_mode = 2 alignment = 1 -[node name="FocusGroup" parent="PanelContainer/MarginContainer/VBoxContainer" instance=ExtResource("9_vlbso")] +[node name="FocusGroup" parent="PanelContainer/MarginContainer/VBoxContainer" unique_id=1032088283 instance=ExtResource("9_vlbso")] unique_name_in_owner = true focus_stack = SubResource("Resource_fafkw") -[node name="SectionLabel" parent="PanelContainer/MarginContainer/VBoxContainer" instance=ExtResource("10_y3iyf")] +[node name="SectionLabel" parent="PanelContainer/MarginContainer/VBoxContainer" unique_id=913851179 instance=ExtResource("10_y3iyf")] layout_mode = 2 text = "Power" horizontal_alignment = 1 -[node name="SuspendButton" parent="PanelContainer/MarginContainer/VBoxContainer" instance=ExtResource("12_2pwjc")] +[node name="SuspendButton" parent="PanelContainer/MarginContainer/VBoxContainer" unique_id=1834925006 instance=ExtResource("12_2pwjc")] unique_name_in_owner = true layout_mode = 2 text = "Suspend" -click_focuses = false -[node name="RebootButton" parent="PanelContainer/MarginContainer/VBoxContainer" instance=ExtResource("12_2pwjc")] +[node name="RebootButton" parent="PanelContainer/MarginContainer/VBoxContainer" unique_id=948698921 instance=ExtResource("12_2pwjc")] unique_name_in_owner = true layout_mode = 2 text = "Reboot" -click_focuses = false -[node name="ShutdownButton" parent="PanelContainer/MarginContainer/VBoxContainer" instance=ExtResource("12_2pwjc")] +[node name="ShutdownButton" parent="PanelContainer/MarginContainer/VBoxContainer" unique_id=2009375519 instance=ExtResource("12_2pwjc")] unique_name_in_owner = true layout_mode = 2 text = "Shutdown" -click_focuses = false -[node name="HSeparator" type="HSeparator" parent="PanelContainer/MarginContainer/VBoxContainer"] +[node name="HSeparator" type="HSeparator" parent="PanelContainer/MarginContainer/VBoxContainer" unique_id=1371326918] layout_mode = 2 -[node name="ExitButton" parent="PanelContainer/MarginContainer/VBoxContainer" instance=ExtResource("12_2pwjc")] +[node name="ExitButton" parent="PanelContainer/MarginContainer/VBoxContainer" unique_id=1883281400 instance=ExtResource("12_2pwjc")] unique_name_in_owner = true layout_mode = 2 text = "Exit" -click_focuses = false -[node name="HSeparator2" type="HSeparator" parent="PanelContainer/MarginContainer/VBoxContainer"] +[node name="HSeparator2" type="HSeparator" parent="PanelContainer/MarginContainer/VBoxContainer" unique_id=1088747106] layout_mode = 2 -[node name="CancelButton" parent="PanelContainer/MarginContainer/VBoxContainer" instance=ExtResource("12_2pwjc")] +[node name="CancelButton" parent="PanelContainer/MarginContainer/VBoxContainer" unique_id=1853018388 instance=ExtResource("12_2pwjc")] unique_name_in_owner = true layout_mode = 2 text = "Cancel" -click_focuses = false diff --git a/core/ui/card_ui/settings/bluetooth_settings_menu.gd b/core/ui/card_ui/settings/bluetooth_settings_menu.gd index d4a6d829c..12460e773 100644 --- a/core/ui/card_ui/settings/bluetooth_settings_menu.gd +++ b/core/ui/card_ui/settings/bluetooth_settings_menu.gd @@ -202,7 +202,8 @@ func _on_device_added(device: BluetoothDevice) -> void: var item := root.create_child() item.set_metadata(0, device) _on_device_updated(item) - device.updated.connect(_on_device_updated.bind(item)) + if not device.updated.is_connected(_on_device_updated.bind(item)): + device.updated.connect(_on_device_updated.bind(item)) # Add the item tree_items[dbus_path] = item diff --git a/core/ui/card_ui/settings/settings_menu.tscn b/core/ui/card_ui/settings/settings_menu.tscn index 7e0e58d08..5b966efb0 100644 --- a/core/ui/card_ui/settings/settings_menu.tscn +++ b/core/ui/card_ui/settings/settings_menu.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=47 format=3 uid="uid://d2jiecrd5sw4s"] +[gd_scene format=3 uid="uid://d2jiecrd5sw4s"] [ext_resource type="Script" uid="uid://dd3h5igghfxua" path="res://core/ui/card_ui/settings/settings_menu.gd" id="1_x5bjx"] [ext_resource type="PackedScene" uid="uid://shvyhrv5sx3v" path="res://core/systems/state/state_watcher.tscn" id="2_xfs0b"] @@ -34,7 +34,7 @@ [ext_resource type="Resource" uid="uid://bcekyu20uvkxv" path="res://assets/state/states/settings_general_controller.tres" id="28_nmfnj"] [ext_resource type="PackedScene" uid="uid://dsgrw1grwef4m" path="res://core/ui/card_ui/settings/general_settings_menu.tscn" id="29_8hwjo"] [ext_resource type="PackedScene" uid="uid://521da7e2cdxd" path="res://core/ui/common/settings/display_settings_menu.tscn" id="30_22tgj"] -[ext_resource type="PackedScene" uid="uid://cpss2bhdwm8t7" path="res://core/ui/common/settings/network_settings_menu.tscn" id="31_35x2h"] +[ext_resource type="PackedScene" path="res://core/ui/common/settings/network_settings_menu.tscn" id="31_35x2h"] [ext_resource type="PackedScene" uid="uid://b4uvvjgnbxj25" path="res://core/ui/common/settings/audio_settings_menu.tscn" id="32_dqi6v"] [ext_resource type="PackedScene" uid="uid://6ygxdkvh1hib" path="res://core/ui/card_ui/settings/bluetooth_settings_menu.tscn" id="33_a7xb2"] [ext_resource type="PackedScene" uid="uid://drbp6ec8646v3" path="res://core/ui/card_ui/settings/library_settings_menu.tscn" id="34_lrrl0"] diff --git a/core/ui/card_ui_overlay_mode/card_ui_overlay_mode.gd b/core/ui/card_ui_overlay_mode/card_ui_overlay_mode.gd index 816512126..214ff94ee 100644 --- a/core/ui/card_ui_overlay_mode/card_ui_overlay_mode.gd +++ b/core/ui/card_ui_overlay_mode/card_ui_overlay_mode.gd @@ -36,6 +36,7 @@ var underlay_process: int var underlay_window_id: int # UI References +var components_map := load("res://core/ui/card_ui/card_ui_components.tres") as ComponentsMap @onready var quick_bar_menu := $%QuickBarMenu @onready var settings_menu := $%SettingsMenu @onready var plugin_manager := $%PluginManager diff --git a/core/ui/common/notification/notification_menu.gd b/core/ui/common/notification/notification_menu.gd new file mode 100644 index 000000000..3313b9a92 --- /dev/null +++ b/core/ui/common/notification/notification_menu.gd @@ -0,0 +1,12 @@ +extends MarginContainer + +var notification_manager := preload("res://core/global/notification_manager.tres") as NotificationManager + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + notification_manager.notification_sent.connect(_on_notification_sent) + + +func _on_notification_sent(notify: Notification) -> void: + pass diff --git a/core/ui/common/notification/notification_menu.gd.uid b/core/ui/common/notification/notification_menu.gd.uid new file mode 100644 index 000000000..af18dcf7c --- /dev/null +++ b/core/ui/common/notification/notification_menu.gd.uid @@ -0,0 +1 @@ +uid://dig2vjy2f8h4h diff --git a/core/ui/common/notification/notification_menu.tscn b/core/ui/common/notification/notification_menu.tscn new file mode 100644 index 000000000..0dd1425db --- /dev/null +++ b/core/ui/common/notification/notification_menu.tscn @@ -0,0 +1,52 @@ +[gd_scene format=3 uid="uid://bn1j2yde6jp73"] + +[ext_resource type="Script" uid="uid://dig2vjy2f8h4h" path="res://core/ui/common/notification/notification_menu.gd" id="1_sa8rh"] +[ext_resource type="Script" uid="uid://b6useuxusuw4w" path="res://core/ui/components/containers/enhanced_scroll_container.gd" id="2_ldsxl"] +[ext_resource type="Script" uid="uid://ogqbbfs88xnr" path="res://core/ui/base/component_button.gd" id="2_x5xd2"] +[ext_resource type="PackedScene" uid="uid://duhgqixnyaweh" path="res://core/ui/components/notification_container.tscn" id="4_dm4gl"] + +[node name="NotificationMenu" type="MarginContainer" unique_id=353444083] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_sa8rh") + +[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=2031039034] +layout_mode = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer" unique_id=69052300] +layout_mode = 2 + +[node name="ComponentButton" type="MarginContainer" parent="VBoxContainer/HBoxContainer" unique_id=1453163742] +layout_mode = 2 +focus_mode = 2 +script = ExtResource("2_x5xd2") +text = "Clear" +metadata/_custom_type_script = "uid://ogqbbfs88xnr" + +[node name="EnhancedScrollContainer" type="ScrollContainer" parent="VBoxContainer" unique_id=1155866024] +layout_mode = 2 +script = ExtResource("2_ldsxl") +metadata/_custom_type_script = "uid://b6useuxusuw4w" + +[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/EnhancedScrollContainer" unique_id=1673222298] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="ContentContainer" type="VBoxContainer" parent="VBoxContainer/EnhancedScrollContainer/MarginContainer" unique_id=1098724161] +unique_name_in_owner = true +layout_mode = 2 + +[node name="NotificationContainer" parent="VBoxContainer/EnhancedScrollContainer/MarginContainer/ContentContainer" unique_id=603816229 instance=ExtResource("4_dm4gl")] +layout_mode = 2 + +[node name="NoNotificationsContainer" type="CenterContainer" parent="." unique_id=1295360671] +unique_name_in_owner = true +layout_mode = 2 + +[node name="Label" type="Label" parent="NoNotificationsContainer" unique_id=926808382] +layout_mode = 2 +text = "No notifications" diff --git a/core/ui/common/power/power_menu.gd b/core/ui/common/power/power_menu.gd new file mode 100644 index 000000000..7d51a6407 --- /dev/null +++ b/core/ui/common/power/power_menu.gd @@ -0,0 +1,46 @@ +extends Control + +var state_machine := ( + preload("res://assets/state/state_machines/popup_state_machine.tres") as StateMachine +) +var power_state := load("res://assets/state/states/power_menu.tres") as State +var logger := Log.get_logger("PowerMenu") + +@onready var focus_group := $%FocusGroup +@onready var suspend_button := $%SuspendButton +@onready var reboot_button := $%RebootButton +@onready var shutdown_button := $%ShutdownButton +@onready var exit_button := $%ExitButton +@onready var cancel_button := $%CancelButton + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + power_state.state_entered.connect(_on_state_entered) + suspend_button.button_down.connect(_on_systemctl_cmd.bind("suspend")) + shutdown_button.button_down.connect(_on_systemctl_cmd.bind("poweroff")) + reboot_button.button_down.connect(_on_systemctl_cmd.bind("reboot")) + exit_button.button_down.connect(_on_exit) + cancel_button.button_up.connect(_on_cancel) + + +func _on_state_entered(_from: State) -> void: + if focus_group: + focus_group.grab_focus() + + +func _on_systemctl_cmd(command: String) -> void: + state_machine.clear_states() + var exec := func(): + var output: Array = [] + if OS.execute("systemctl", [command], output) != OK: + logger.warn("Failed to " + command + ": '" + output[0] + "'") + exec.call_deferred() + + +func _on_exit() -> void: + get_tree().quit() + + +func _on_cancel() -> void: + state_machine.pop_state() diff --git a/core/ui/common/power/power_menu.gd.uid b/core/ui/common/power/power_menu.gd.uid new file mode 100644 index 000000000..0126759a0 --- /dev/null +++ b/core/ui/common/power/power_menu.gd.uid @@ -0,0 +1 @@ +uid://bhrcvw0qwwkda diff --git a/core/ui/common/power/power_menu.tscn b/core/ui/common/power/power_menu.tscn new file mode 100644 index 000000000..1c1712464 --- /dev/null +++ b/core/ui/common/power/power_menu.tscn @@ -0,0 +1,151 @@ +[gd_scene format=3 uid="uid://d0wg7axkc5inq"] + +[ext_resource type="Script" uid="uid://bhrcvw0qwwkda" path="res://core/ui/common/power/power_menu.gd" id="1_lvm44"] +[ext_resource type="Shader" uid="uid://ce5e0818nvi68" path="res://assets/shaders/simple_blur.gdshader" id="2_cid3o"] +[ext_resource type="PackedScene" uid="uid://c6fg6uvng0ovi" path="res://core/systems/input/input_watcher.tscn" id="3_p35yl"] +[ext_resource type="PackedScene" uid="uid://b76dvfuouhlwd" path="res://core/systems/state/state_updater.tscn" id="4_y3wsc"] +[ext_resource type="Resource" uid="uid://cadriyl38ny5y" path="res://assets/state/state_machines/popup_state_machine.tres" id="5_bmcfv"] +[ext_resource type="PackedScene" uid="uid://shvyhrv5sx3v" path="res://core/systems/state/state_watcher.tscn" id="6_coaws"] +[ext_resource type="Resource" uid="uid://bw0mtk7sso8m2" path="res://assets/state/states/power_menu.tres" id="7_6wm3v"] +[ext_resource type="PackedScene" uid="uid://bw8113ocotx2r" path="res://core/systems/effects/fade_effect.tscn" id="8_x0r6i"] +[ext_resource type="PackedScene" uid="uid://8m20p2s0v5gb" path="res://core/systems/input/focus_group.tscn" id="9_ycyo3"] +[ext_resource type="PackedScene" uid="uid://dithv38oqgy58" path="res://core/ui/components/section_label.tscn" id="11_tk01c"] +[ext_resource type="Script" uid="uid://ogqbbfs88xnr" path="res://core/ui/base/component_button.gd" id="12_cid3o"] + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_v0ws8"] +shader = ExtResource("2_cid3o") +shader_parameter/blur_amount = 1.578 +shader_parameter/mix_amount = 0.0 +shader_parameter/color_over = Color(0, 0, 0, 0) + +[node name="PowerMenu" type="Control" unique_id=1824508021 groups=["power_menu"]] +z_index = 20 +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_lvm44") + +[node name="BackBufferCopy" type="BackBufferCopy" parent="." unique_id=660223367] +copy_mode = 2 + +[node name="ColorRect" type="ColorRect" parent="." unique_id=712586513] +material = SubResource("ShaderMaterial_v0ws8") +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +color = Color(0, 0, 0, 1) + +[node name="ColorRect2" type="ColorRect" parent="." unique_id=2047072239] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +color = Color(0, 0, 0, 0.666667) + +[node name="InputWatcher" parent="." unique_id=1464874353 instance=ExtResource("3_p35yl")] +stop_propagation = true +action = "ogui_east" + +[node name="StateUpdater" parent="InputWatcher" unique_id=1773199426 instance=ExtResource("4_y3wsc")] +state_machine = ExtResource("5_bmcfv") +action = 2 +on_signal = "input_released" + +[node name="StateWatcher" parent="." unique_id=1664472281 instance=ExtResource("6_coaws")] +state = ExtResource("7_6wm3v") + +[node name="FadeEffect" parent="StateWatcher" unique_id=1086466367 node_paths=PackedStringArray("target") instance=ExtResource("8_x0r6i")] +target = NodePath("../..") +on_signal = "state_entered" +fade_out_signal = "state_exited" +on_signal = "state_entered" + +[node name="PanelContainer" type="PanelContainer" parent="." unique_id=1376297494] +custom_minimum_size = Vector2(200, 150) +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -75.0 +offset_top = -75.0 +offset_right = 75.0 +offset_bottom = 75.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_type_variation = &"PowerMenu" + +[node name="MarginContainer" type="MarginContainer" parent="PanelContainer" unique_id=729023065] +layout_mode = 2 +theme_override_constants/margin_left = 20 +theme_override_constants/margin_top = 20 +theme_override_constants/margin_right = 20 +theme_override_constants/margin_bottom = 20 + +[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/MarginContainer" unique_id=53160114] +layout_mode = 2 +alignment = 1 + +[node name="FocusGroup" parent="PanelContainer/MarginContainer/VBoxContainer" unique_id=1032088283 node_paths=PackedStringArray("current_focus") instance=ExtResource("9_ycyo3")] +unique_name_in_owner = true +current_focus = NodePath("../SuspendButton") + +[node name="SectionLabel" parent="PanelContainer/MarginContainer/VBoxContainer" unique_id=913851179 instance=ExtResource("11_tk01c")] +layout_mode = 2 +text = "Power" +horizontal_alignment = 1 + +[node name="SuspendButton" type="MarginContainer" parent="PanelContainer/MarginContainer/VBoxContainer" unique_id=1768653434] +unique_name_in_owner = true +layout_mode = 2 +focus_mode = 2 +script = ExtResource("12_cid3o") +text = "Suspend" +metadata/_custom_type_script = "uid://ogqbbfs88xnr" + +[node name="RebootButton" type="MarginContainer" parent="PanelContainer/MarginContainer/VBoxContainer" unique_id=1328398716] +unique_name_in_owner = true +layout_mode = 2 +focus_mode = 2 +script = ExtResource("12_cid3o") +text = "Reboot" +metadata/_custom_type_script = "uid://ogqbbfs88xnr" + +[node name="ShutdownButton" type="MarginContainer" parent="PanelContainer/MarginContainer/VBoxContainer" unique_id=1924877005] +unique_name_in_owner = true +layout_mode = 2 +focus_mode = 2 +script = ExtResource("12_cid3o") +text = "Shutdown" +metadata/_custom_type_script = "uid://ogqbbfs88xnr" + +[node name="HSeparator" type="HSeparator" parent="PanelContainer/MarginContainer/VBoxContainer" unique_id=1371326918] +layout_mode = 2 + +[node name="ExitButton" type="MarginContainer" parent="PanelContainer/MarginContainer/VBoxContainer" unique_id=286049570] +unique_name_in_owner = true +layout_mode = 2 +focus_mode = 2 +script = ExtResource("12_cid3o") +text = "Exit" +metadata/_custom_type_script = "uid://ogqbbfs88xnr" + +[node name="HSeparator2" type="HSeparator" parent="PanelContainer/MarginContainer/VBoxContainer" unique_id=1088747106] +layout_mode = 2 + +[node name="CancelButton" type="MarginContainer" parent="PanelContainer/MarginContainer/VBoxContainer" unique_id=1960525316] +unique_name_in_owner = true +layout_mode = 2 +focus_mode = 2 +script = ExtResource("12_cid3o") +text = "Cancel" +metadata/_custom_type_script = "uid://ogqbbfs88xnr" diff --git a/core/ui/common/quick_bar/performance_menu.tscn b/core/ui/common/quick_bar/performance_menu.tscn index 06a49d33e..0acd97703 100644 --- a/core/ui/common/quick_bar/performance_menu.tscn +++ b/core/ui/common/quick_bar/performance_menu.tscn @@ -7,6 +7,7 @@ [ext_resource type="PackedScene" uid="uid://d0u3rsa5qpj57" path="res://core/ui/components/subsection_label.tscn" id="5_hil7p"] [ext_resource type="PackedScene" uid="uid://dithv38oqgy58" path="res://core/ui/components/section_label.tscn" id="6_ycrnf"] [ext_resource type="PackedScene" uid="uid://d1qb7euwlu7bh" path="res://core/ui/components/toggle.tscn" id="7_j02ci"] +[ext_resource type="Texture2D" uid="uid://xlmr7ldbum6s" path="res://assets/ui/icons/material-symbols--developer-board-outline-rounded.svg" id="8_dbtoy"] [ext_resource type="PackedScene" uid="uid://xei5afwefxud" path="res://core/ui/components/dropdown.tscn" id="8_j2331"] [node name="Performance" type="VBoxContainer" unique_id=132711214] @@ -101,6 +102,7 @@ text = "CPU Cores" value = 1.0 max_value = 1.0 min_value = 1.0 +icon_texture = ExtResource("8_dbtoy") [node name="GPUSectionLabel" parent="." unique_id=1365545015 instance=ExtResource("6_ycrnf")] visible = false diff --git a/core/ui/components/input_icon.gd b/core/ui/components/input_icon.gd index 1a6d56d1a..9ed4728a6 100644 --- a/core/ui/components/input_icon.gd +++ b/core/ui/components/input_icon.gd @@ -3,7 +3,7 @@ extends HBoxContainer class_name InputIcon -var input_icons := load("res://core/systems/input/input_icon_manager.tres") as InputIconManager +var input_icons := preload("res://core/systems/input/input_icon_manager.tres") as InputIconManager var label := Label.new() var textures: Array[Texture] = [] diff --git a/core/ui/components/slider.gd b/core/ui/components/slider.gd index 0bb90b9a1..f200a0721 100644 --- a/core/ui/components/slider.gd +++ b/core/ui/components/slider.gd @@ -8,7 +8,12 @@ signal drag_started() signal changed() signal value_changed(value: float) -@export var text: String = "Setting" +@export var text: String = "Setting": + set(v): + text = v + if not label: + return + label.text = text @export var show_label := true: set(v): show_label = v @@ -57,41 +62,72 @@ signal value_changed(value: float) @export var show_decimal: bool = false: set(v): show_decimal = v + value = value notify_property_list_changed() -@export var tick_count := 0 -@export var separator_visible: bool = false +@export var icon_texture: Texture2D: + set(v): + icon_texture = v + if not icon: + return + icon.texture = v + slider_icon.texture = v + icon.visible = icon_texture != null + slider_icon.visible = not show_label and icon_texture != null + +@export var slider_icon_texture: Texture2D: + set(v): + slider_icon_texture = v + if not slider_icon: + return + slider_icon.texture = slider_icon_texture + slider_icon.visible = slider_icon_texture != null + +@export var tick_count := 0: + set(v): + tick_count = v + if not slider: + return + slider.tick_count = v +@export var separator_visible: bool = false: + set(v): + separator_visible = v + if not hsep: + return + hsep.visible = v @onready var label := $%Label as Label @onready var label_value := $%LabelValue as Label @onready var slider := $%HSlider as HSlider @onready var hbox := $HBoxContainer as HBoxContainer @onready var hsep := $HSeparator as HSeparator +@onready var icon := %Icon as TextureRect +@onready var slider_icon := %SliderIcon as TextureRect # Called when the node enters the scene tree for the first time. func _ready() -> void: focus_entered.connect(_grab_focus) - label.text = text - label_value.text = _get_value_str() - hsep.visible = separator_visible - slider.value_changed.connect(_on_value_changed) - slider.value = value - slider.min_value = min_value - slider.max_value = max_value - slider.step = step - slider.tick_count = tick_count - slider.editable = editable + text = text + show_label = show_label + separator_visible = separator_visible + value = value + min_value = min_value + max_value = max_value + step = step + tick_count = tick_count + editable = editable slider.focus_neighbor_bottom = focus_neighbor_bottom slider.focus_neighbor_left = focus_neighbor_left slider.focus_neighbor_right = focus_neighbor_right slider.focus_neighbor_top = focus_neighbor_top slider.focus_previous = focus_previous slider.focus_next = focus_next + slider.value_changed.connect(_on_value_changed) # Wire up all slider signals - var on_drag_ended := func(changed: bool): - drag_ended.emit(changed) + var on_drag_ended := func(changed_value: bool): + drag_ended.emit(changed_value) slider.drag_ended.connect(on_drag_ended) var on_drag_started := func(): drag_started.emit() @@ -132,10 +168,10 @@ func _get_value_str() -> String: # Override certain properties and pass them to child objects -func _set(property: StringName, value: Variant) -> bool: +func _set(property: StringName, prop_value: Variant) -> bool: if not slider: return false if property.begins_with("focus"): - slider.set(property, value) + slider.set(property, prop_value) return false return false diff --git a/core/ui/components/slider.tscn b/core/ui/components/slider.tscn index 378b47384..3d7943442 100644 --- a/core/ui/components/slider.tscn +++ b/core/ui/components/slider.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=4 format=3 uid="uid://cemxrvvjgm4g"] +[gd_scene format=3 uid="uid://cemxrvvjgm4g"] [ext_resource type="Script" uid="uid://ddjagemlv4ghd" path="res://core/ui/components/slider.gd" id="1_khsna"] +[ext_resource type="Texture2D" uid="uid://rqiqx2ceehnb" path="res://assets/ui/icons/gear-fill.svg" id="2_0hayk"] [ext_resource type="LabelSettings" uid="uid://bdx3xgfcaqhse" path="res://assets/label/title_label.tres" id="2_otvhp"] [ext_resource type="LabelSettings" uid="uid://bv56n31s84bfn" path="res://assets/label/subheading_label.tres" id="3_q0iwk"] -[node name="Slider" type="VBoxContainer"] +[node name="Slider" type="VBoxContainer" unique_id=440064129] anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 @@ -14,35 +15,58 @@ size_flags_horizontal = 3 focus_mode = 2 script = ExtResource("1_khsna") -[node name="HBoxContainer" type="HBoxContainer" parent="."] +[node name="HBoxContainer" type="HBoxContainer" parent="." unique_id=1946830489] layout_mode = 2 -[node name="Label" type="Label" parent="HBoxContainer"] +[node name="Icon" type="TextureRect" parent="HBoxContainer" unique_id=2135982660] +unique_name_in_owner = true +visible = false +custom_minimum_size = Vector2(16, 16) +layout_mode = 2 +texture = ExtResource("2_0hayk") +expand_mode = 1 +stretch_mode = 5 + +[node name="Label" type="Label" parent="HBoxContainer" unique_id=1091202880] unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 text = "Setting" label_settings = ExtResource("2_otvhp") -[node name="LabelValue" type="Label" parent="HBoxContainer"] +[node name="LabelValue" type="Label" parent="HBoxContainer" unique_id=409117999] unique_name_in_owner = true layout_mode = 2 text = "0" label_settings = ExtResource("2_otvhp") horizontal_alignment = 2 -[node name="DescriptionLabel" type="Label" parent="."] +[node name="DescriptionLabel" type="Label" parent="." unique_id=950894359] unique_name_in_owner = true visible = false layout_mode = 2 text = "Description" label_settings = ExtResource("3_q0iwk") -[node name="HSlider" type="HSlider" parent="."] +[node name="HBoxContainer2" type="HBoxContainer" parent="." unique_id=927959516] +layout_mode = 2 +theme_override_constants/separation = 10 + +[node name="SliderIcon" type="TextureRect" parent="HBoxContainer2" unique_id=650112807] +unique_name_in_owner = true +visible = false +custom_minimum_size = Vector2(16, 16) +layout_mode = 2 +texture = ExtResource("2_0hayk") +expand_mode = 1 +stretch_mode = 5 + +[node name="HSlider" type="HSlider" parent="HBoxContainer2" unique_id=757877655] unique_name_in_owner = true modulate = Color(0, 0, 0, 1) layout_mode = 2 +size_flags_horizontal = 3 -[node name="HSeparator" type="HSeparator" parent="."] +[node name="HSeparator" type="HSeparator" parent="." unique_id=679032607] visible = false layout_mode = 2 diff --git a/core/ui/components/toggle.tscn b/core/ui/components/toggle.tscn index 6bf8460ef..19ef1bcbe 100644 --- a/core/ui/components/toggle.tscn +++ b/core/ui/components/toggle.tscn @@ -1,10 +1,10 @@ -[gd_scene load_steps=4 format=3 uid="uid://d1qb7euwlu7bh"] +[gd_scene format=3 uid="uid://d1qb7euwlu7bh"] [ext_resource type="Script" uid="uid://5vhtohjydvs6" path="res://core/ui/components/toggle.gd" id="1_pn5mg"] [ext_resource type="LabelSettings" uid="uid://bdx3xgfcaqhse" path="res://assets/label/title_label.tres" id="2_msehc"] [ext_resource type="LabelSettings" uid="uid://bv56n31s84bfn" path="res://assets/label/subheading_label.tres" id="3_l7kb7"] -[node name="Toggle" type="VBoxContainer"] +[node name="Toggle" type="VBoxContainer" unique_id=486761597] anchors_preset = 10 anchor_right = 1.0 offset_bottom = 31.0 @@ -15,40 +15,40 @@ mouse_filter = 0 script = ExtResource("1_pn5mg") separator_visible = true -[node name="VBoxContainer" type="VBoxContainer" parent="."] +[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=389362838] layout_mode = 2 -[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer"] +[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer" unique_id=985440214] unique_name_in_owner = true layout_mode = 2 -[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/PanelContainer"] +[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/PanelContainer" unique_id=488141993] layout_mode = 2 theme_override_constants/margin_left = 4 theme_override_constants/margin_top = 4 theme_override_constants/margin_right = 4 theme_override_constants/margin_bottom = 4 -[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/PanelContainer/MarginContainer"] +[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/PanelContainer/MarginContainer" unique_id=1253190351] layout_mode = 2 -[node name="ToggleContainer" type="HBoxContainer" parent="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer"] +[node name="ToggleContainer" type="HBoxContainer" parent="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer" unique_id=445244490] layout_mode = 2 -[node name="Label" type="Label" parent="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer/ToggleContainer"] +[node name="Label" type="Label" parent="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer/ToggleContainer" unique_id=663262071] unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 text = "Setting" label_settings = ExtResource("2_msehc") -[node name="CheckButton" type="CheckButton" parent="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer/ToggleContainer"] +[node name="CheckButton" type="CheckButton" parent="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer/ToggleContainer" unique_id=1399393342] unique_name_in_owner = true modulate = Color(0, 0, 0, 1) layout_mode = 2 mouse_filter = 2 -[node name="DescriptionLabel" type="Label" parent="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer"] +[node name="DescriptionLabel" type="Label" parent="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer" unique_id=1423894066] unique_name_in_owner = true visible = false custom_minimum_size = Vector2(100, 0) @@ -56,6 +56,6 @@ layout_mode = 2 label_settings = ExtResource("3_l7kb7") autowrap_mode = 3 -[node name="HSeparator" type="HSeparator" parent="VBoxContainer"] +[node name="HSeparator" type="HSeparator" parent="VBoxContainer" unique_id=1799536094] unique_name_in_owner = true layout_mode = 2 diff --git a/core/ui/etoile_ui/components/carousel.gd b/core/ui/etoile_ui/components/carousel.gd new file mode 100644 index 000000000..2f248754a --- /dev/null +++ b/core/ui/etoile_ui/components/carousel.gd @@ -0,0 +1,179 @@ +@tool +extends Container +class_name CarouselContainer + +signal child_selected(node: Node) + +## Text to display next to selected node +@export var text: String: + set(v): + text = v + if not label: + return + label.text = v +@export var text_settings: LabelSettings +@export var text_modulate := Color(1, 1, 1, 1): + set(v): + text_modulate = v + if not label: + return + label.modulate = v +## Spacing between nodes +@export var spacing: int = 10: + set(v): + spacing = v + if self.get_child_count() > 0: + _on_sort_children() +## Currently selected node +@export var selected_child: int = 0: + set(v): + selected_child = v + if self.get_child_count() > 0: + _on_child_selected() + _on_sort_children() +## Size of the selected node +@export var selected_size: Vector2 = Vector2(234, 234): + set(v): + selected_size = v + if self.get_child_count() > 0: + _on_sort_children() +## Size of unselected nodes +@export var unselected_size: Vector2 = Vector2(166, 166): + set(v): + unselected_size = v + if self.get_child_count() > 0: + _on_sort_children() +## Animation duration +@export var duration: float = 0.5 + +@onready var label := Label.new() + +var _grow_tween: Tween +var logger := Log.get_logger("Carousel", Log.LEVEL.DEBUG) + +# NOTE: When the user is at the beginning of the list and goes left, the last item +# in the list should be inserted in the front and popped from the back + +func _ready() -> void: + label.text = text + label.label_settings = text_settings + add_child(label, false, Node.INTERNAL_MODE_BACK) + sort_children.connect(_on_sort_children) + child_entered_tree.connect(_on_child_entered_tree) + if self.get_child_count() == 1: + return + _on_sort_children() + + +func _on_sort_children() -> void: + # Position the label node + self.label.position = Vector2(selected_size.x + spacing, unselected_size.y + spacing) + + # Find the selected child node + var selected := get_child(selected_child) + if not selected: + return + + # Increase the size and move the selected child + self._grow_tween = selected.create_tween() + self._grow_tween.set_ease(Tween.EASE_IN_OUT) + self._grow_tween.tween_property(selected, "position", Vector2.ZERO, duration) + self._grow_tween.tween_property(selected, "size", selected_size, duration / 3.0) + + # Calculate child positions BEHIND selected node + var target_position := 0.0 + var i := self.selected_child - 1 + while i >= 0: + var child := self.get_child(i) + if child == label: + i -= 1 + continue + if not child is Control: + continue + target_position -= spacing + unselected_size.x + #(child as Control).position.x = target_position + var tween := child.create_tween() + tween.set_ease(Tween.EASE_IN_OUT) + tween.tween_property(child, "position", Vector2(target_position, 0), duration) + var size_tween := child.create_tween() + size_tween.tween_property(child, "size", unselected_size, duration) + i -= 1 + + # Calculate child positions AHEAD of selected node + target_position = (spacing + selected_size.x) + i = self.selected_child + 1 + while i < self.get_child_count(): + var child := self.get_child(i) + if child == label: + i += 1 + continue + #(child as Control).position.x = target_position + var tween := child.create_tween() + tween.set_ease(Tween.EASE_IN_OUT) + tween.tween_property(child, "position", Vector2(target_position, 0), duration) + var size_tween := child.create_tween() + size_tween.tween_property(child, "size", unselected_size, duration) + target_position += spacing + unselected_size.x + i += 1 + + +func _on_child_entered_tree(child: Node) -> void: + if not child is Control: + return + var control := child as Control + var tween := control.create_tween() + control.modulate = Color(1, 1, 1, 0) + tween.set_ease(Tween.EASE_IN_OUT) + tween.tween_property(control, "modulate", Color(1, 1, 1, 1), duration) + var size_tween := control.create_tween() + size_tween.tween_property(control, "size", unselected_size, duration) + + +func _on_child_selected() -> void: + var child := get_child(self.selected_child) + if not child: + return + if not child is Control: + return + var node := child as Control + node.grab_focus() + child_selected.emit(child) + if not child is GameTile: + return + var tile := child as GameTile + if tile.is_library_tile: + self.text = tile.text + return + if not tile.library_item: + return + self.text = tile.library_item.name + + +func _input(event: InputEvent) -> void: + var focused_node := get_viewport().gui_get_focus_owner() + if not focused_node or focused_node.get_parent() != self: + return + if event.is_action_released("ui_right"): + # If the user is at the end of the list, pop the first element and + # push it to the end + if self.selected_child == self.get_child_count() - 1: + var first := self.get_child(0) + if not first: + return + self.move_child(first, -1) + _on_child_selected() + else: + self.selected_child += 1 + get_viewport().set_input_as_handled() + elif event.is_action_released("ui_left"): + # If the user is at the beginning of the list, pop the last element + # and push it to the front + if self.selected_child == 0: + var last := self.get_child(-1) + if not last: + return + self.move_child(last, 0) + _on_child_selected() + else: + self.selected_child -= 1 + get_viewport().set_input_as_handled() diff --git a/core/ui/etoile_ui/components/carousel.gd.uid b/core/ui/etoile_ui/components/carousel.gd.uid new file mode 100644 index 000000000..b46eed331 --- /dev/null +++ b/core/ui/etoile_ui/components/carousel.gd.uid @@ -0,0 +1 @@ +uid://dnstdemqvqcji diff --git a/core/ui/etoile_ui/components/carousel_test.gd b/core/ui/etoile_ui/components/carousel_test.gd new file mode 100644 index 000000000..808ad735f --- /dev/null +++ b/core/ui/etoile_ui/components/carousel_test.gd @@ -0,0 +1,6 @@ +extends Control + +@onready var container := %CarouselContainer as CarouselContainer + +func _ready() -> void: + pass diff --git a/core/ui/etoile_ui/components/carousel_test.gd.uid b/core/ui/etoile_ui/components/carousel_test.gd.uid new file mode 100644 index 000000000..19e2e4081 --- /dev/null +++ b/core/ui/etoile_ui/components/carousel_test.gd.uid @@ -0,0 +1 @@ +uid://c1n71g7m7yi8c diff --git a/core/ui/etoile_ui/components/carousel_test.tscn b/core/ui/etoile_ui/components/carousel_test.tscn new file mode 100644 index 000000000..8de02a093 --- /dev/null +++ b/core/ui/etoile_ui/components/carousel_test.tscn @@ -0,0 +1,69 @@ +[gd_scene load_steps=4 format=3 uid="uid://g6n83wt60uww"] + +[ext_resource type="Script" uid="uid://c1n71g7m7yi8c" path="res://core/ui/etoile_ui/components/carousel_test.gd" id="1_mst72"] +[ext_resource type="Script" uid="uid://dnstdemqvqcji" path="res://core/ui/etoile_ui/components/carousel.gd" id="1_sdtql"] +[ext_resource type="PackedScene" uid="uid://c8pvsi1u00sol" path="res://core/ui/etoile_ui/components/game_tile.tscn" id="3_w5uit"] + +[node name="CarouselTest" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_mst72") + +[node name="MarginContainer" type="MarginContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 100 +theme_override_constants/margin_top = 100 +theme_override_constants/margin_right = 100 +theme_override_constants/margin_bottom = 100 + +[node name="CarouselContainer" type="Container" parent="MarginContainer"] +unique_name_in_owner = true +layout_mode = 2 +script = ExtResource("1_sdtql") +text = "Empty Title" +spacing = 30 +metadata/_custom_type_script = "uid://dnstdemqvqcji" + +[node name="GameTile10" parent="MarginContainer/CarouselContainer" instance=ExtResource("3_w5uit")] +modulate = Color(1, 1, 1, 0.06944445) +layout_mode = 2 + +[node name="GameTile11" parent="MarginContainer/CarouselContainer" instance=ExtResource("3_w5uit")] +modulate = Color(1, 1, 1, 0.06944445) +layout_mode = 2 + +[node name="GameTile12" parent="MarginContainer/CarouselContainer" instance=ExtResource("3_w5uit")] +modulate = Color(1, 1, 1, 0.06944445) +layout_mode = 2 + +[node name="GameTile13" parent="MarginContainer/CarouselContainer" instance=ExtResource("3_w5uit")] +modulate = Color(1, 1, 1, 0.06944445) +layout_mode = 2 + +[node name="GameTile14" parent="MarginContainer/CarouselContainer" instance=ExtResource("3_w5uit")] +modulate = Color(1, 1, 1, 0.06944445) +layout_mode = 2 + +[node name="GameTile15" parent="MarginContainer/CarouselContainer" instance=ExtResource("3_w5uit")] +modulate = Color(1, 1, 1, 0.06944445) +layout_mode = 2 + +[node name="GameTile16" parent="MarginContainer/CarouselContainer" instance=ExtResource("3_w5uit")] +modulate = Color(1, 1, 1, 0.06944445) +layout_mode = 2 + +[node name="GameTile17" parent="MarginContainer/CarouselContainer" instance=ExtResource("3_w5uit")] +modulate = Color(1, 1, 1, 0.06944445) +layout_mode = 2 + +[node name="Label" type="Label" parent="MarginContainer/CarouselContainer"] +layout_mode = 2 diff --git a/core/ui/etoile_ui/components/collapsible_button.gd b/core/ui/etoile_ui/components/collapsible_button.gd new file mode 100644 index 000000000..f7cb0fab9 --- /dev/null +++ b/core/ui/etoile_ui/components/collapsible_button.gd @@ -0,0 +1,136 @@ +@icon("res://assets/editor-icons/button.svg") +@tool +extends MarginContainer +class_name CollapsibleButton + +signal pressed +signal button_up +signal player_button_up(metaname: String, dbus_path: String) +signal button_down +signal player_button_down(metaname: String, dbus_path: String) + +@export var disabled := false +@export var click_focuses := false +@export var icon_texture: Texture2D: + set(v): + icon_texture = v + if not icon: + return + icon.texture = icon_texture + icon.visible = icon_texture != null +@export var text: String: + set(v): + text = v + if not label: + return + label.text = text + label.visible = not text.is_empty() +@export var split_panel: bool: + set(v): + split_panel = v + if not split_panel_container: + return + split_panel_container.visible = expandable and split_panel + var style := panel_container.get_theme_stylebox("panel").duplicate() as StyleBoxFlat + if expandable and split_panel: + style.corner_radius_bottom_right = 0 + style.corner_radius_top_right = 0 + else: + style.corner_radius_bottom_right = 12 + style.corner_radius_top_right = 12 + panel_container.add_theme_stylebox_override("panel", style) +@export var expandable: bool: + set(v): + expandable = v + if not expand_icon: + return + expand_icon.visible = expandable and not split_panel + spacer.visible = expandable and not split_panel +@export var color: Color: + set(v): + color = v + if not panel_container: + return + if not color: + return + var style := panel_container.get_theme_stylebox("panel").duplicate() as StyleBoxFlat + style.bg_color = color + panel_container.add_theme_stylebox_override("panel", style) +@export_category("AudioSteamPlayer") +@export_file("*.ogg") var focus_audio := "res://assets/audio/interface/536764__egomassive__toss.ogg" +@export_file("*.ogg") var select_audio := "res://assets/audio/interface/96127__bmaczero__contact1.ogg" + +var tween: Tween +var original_color: Color +var focus_audio_stream := load(focus_audio) as AudioStream +var select_audio_stream := load(select_audio) as AudioStream + +@onready var icon := %Icon as TextureRect +@onready var label := %Label as Label +@onready var expand_icon := %ExpandIcon as TextureRect +@onready var spacer := %Spacer as Control +@onready var panel_container := %PrimaryPanelContainer as PanelContainer +@onready var split_panel_container := %SplitPanelContainer as PanelContainer +@onready var split_expand_icon := %SplitExpandIcon as TextureRect + + +func _ready() -> void: + icon_texture = icon_texture + text = text + split_panel = split_panel + expandable = expandable + color = color + original_color = color + + if Engine.is_editor_hint(): + return + + # Connect signals + pressed.connect(_play_sound.bind(select_audio_stream)) + focus_entered.connect(_on_focus) + focus_exited.connect(_on_unfocus) + mouse_entered.connect(_on_focus) + mouse_exited.connect(_on_unfocus) + +func _on_focus() -> void: + if tween: + tween.kill() + tween = create_tween() + tween.tween_property(self, "color", Color(1, 1, 1, 0.5), 0.5) + _play_sound(focus_audio_stream) + + +func _on_unfocus() -> void: + if tween: + tween.kill() + tween = create_tween() + tween.tween_property(self, "color", original_color, 0.5) + + +func _play_sound(stream: AudioStream) -> void: + var audio_player: AudioStreamPlayer = $AudioStreamPlayer + audio_player.stream = stream + audio_player.play() + + +func _gui_input(event: InputEvent) -> void: + if disabled: + return + var dbus_path := event.get_meta("dbus_path", "") as String + if event is InputEventMouseButton and not click_focuses: + if (event as InputEventMouseButton).button_index != MOUSE_BUTTON_LEFT: + return + if event.is_pressed(): + button_down.emit() + pressed.emit() + else: + button_up.emit() + if not event.is_action("ui_accept"): + return + if event.is_pressed(): + button_down.emit() + player_button_down.emit("dbus_path", dbus_path) + pressed.emit() + else: + button_up.emit() + player_button_up.emit("dbus_path", dbus_path) diff --git a/core/ui/etoile_ui/components/collapsible_button.gd.uid b/core/ui/etoile_ui/components/collapsible_button.gd.uid new file mode 100644 index 000000000..2b2aab567 --- /dev/null +++ b/core/ui/etoile_ui/components/collapsible_button.gd.uid @@ -0,0 +1 @@ +uid://be50jkycjisyd diff --git a/core/ui/etoile_ui/components/collapsible_button.tscn b/core/ui/etoile_ui/components/collapsible_button.tscn new file mode 100644 index 000000000..90d41ae23 --- /dev/null +++ b/core/ui/etoile_ui/components/collapsible_button.tscn @@ -0,0 +1,99 @@ +[gd_scene format=3 uid="uid://btrem65c8687w"] + +[ext_resource type="Script" uid="uid://be50jkycjisyd" path="res://core/ui/etoile_ui/components/collapsible_button.gd" id="1_2pvnu"] +[ext_resource type="Texture2D" uid="uid://dj7wg0qnevawx" path="res://assets/ui/icons/material-symbols--chevron-right-rounded.svg" id="2_2ggfo"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_4eh4g"] +bg_color = Color(0, 0, 0, 0.5) +corner_radius_top_left = 12 +corner_radius_top_right = 12 +corner_radius_bottom_right = 12 +corner_radius_bottom_left = 12 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_2ggfo"] +bg_color = Color(0, 0, 0, 0.5) +corner_radius_top_right = 12 +corner_radius_bottom_right = 12 + +[node name="CollapsibleButton" type="MarginContainer" unique_id=1879316149] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +focus_mode = 2 +script = ExtResource("1_2pvnu") + +[node name="HBoxContainer" type="HBoxContainer" parent="." unique_id=359309382] +layout_mode = 2 + +[node name="PrimaryPanelContainer" type="PanelContainer" parent="HBoxContainer" unique_id=1999954818] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +mouse_filter = 1 +theme_override_styles/panel = SubResource("StyleBoxFlat_4eh4g") + +[node name="MarginContainer" type="MarginContainer" parent="HBoxContainer/PrimaryPanelContainer" unique_id=1292746312] +layout_mode = 2 +theme_override_constants/margin_left = 8 +theme_override_constants/margin_top = 8 +theme_override_constants/margin_right = 8 +theme_override_constants/margin_bottom = 8 + +[node name="HBoxContainer" type="HBoxContainer" parent="HBoxContainer/PrimaryPanelContainer/MarginContainer" unique_id=2118490674] +layout_mode = 2 + +[node name="Icon" type="TextureRect" parent="HBoxContainer/PrimaryPanelContainer/MarginContainer/HBoxContainer" unique_id=77369522] +unique_name_in_owner = true +visible = false +custom_minimum_size = Vector2(18, 18) +layout_mode = 2 +expand_mode = 1 +stretch_mode = 5 + +[node name="Label" type="Label" parent="HBoxContainer/PrimaryPanelContainer/MarginContainer/HBoxContainer" unique_id=1790736291] +unique_name_in_owner = true +visible = false +layout_mode = 2 + +[node name="Spacer" type="Control" parent="HBoxContainer/PrimaryPanelContainer/MarginContainer/HBoxContainer" unique_id=178998921] +unique_name_in_owner = true +visible = false +layout_mode = 2 +size_flags_horizontal = 3 +mouse_filter = 1 + +[node name="ExpandIcon" type="TextureRect" parent="HBoxContainer/PrimaryPanelContainer/MarginContainer/HBoxContainer" unique_id=153943390] +unique_name_in_owner = true +visible = false +custom_minimum_size = Vector2(18, 18) +layout_mode = 2 +texture = ExtResource("2_2ggfo") +expand_mode = 1 +stretch_mode = 5 + +[node name="SplitPanelContainer" type="PanelContainer" parent="HBoxContainer" unique_id=1552412160] +unique_name_in_owner = true +visible = false +layout_mode = 2 +mouse_filter = 1 +theme_override_styles/panel = SubResource("StyleBoxFlat_2ggfo") + +[node name="MarginContainer" type="MarginContainer" parent="HBoxContainer/SplitPanelContainer" unique_id=1969255740] +layout_mode = 2 +theme_override_constants/margin_left = 6 +theme_override_constants/margin_top = 4 +theme_override_constants/margin_right = 6 +theme_override_constants/margin_bottom = 4 + +[node name="SplitExpandIcon" type="TextureRect" parent="HBoxContainer/SplitPanelContainer/MarginContainer" unique_id=169981073] +unique_name_in_owner = true +custom_minimum_size = Vector2(18, 18) +layout_mode = 2 +texture = ExtResource("2_2ggfo") +expand_mode = 1 +stretch_mode = 5 + +[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="." unique_id=1745103198] +unique_name_in_owner = true diff --git a/core/ui/etoile_ui/components/game_card.tscn b/core/ui/etoile_ui/components/game_card.tscn new file mode 100644 index 000000000..0ef26f22c --- /dev/null +++ b/core/ui/etoile_ui/components/game_card.tscn @@ -0,0 +1,71 @@ +[gd_scene load_steps=7 format=3 uid="uid://bv6wbkv8i1ary"] + +[ext_resource type="PackedScene" uid="uid://bkhrcemal7uxo" path="res://core/ui/components/card.tscn" id="1_6tx83"] +[ext_resource type="Shader" uid="uid://dw8by7ras0c8n" path="res://assets/shaders/highlight_shine.gdshader" id="2_i6on3"] +[ext_resource type="Shader" uid="uid://dmrh6bodc1vy7" path="res://assets/shaders/god_rays.gdshader" id="3_14db6"] + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_yfw66"] +resource_local_to_scene = true +shader = ExtResource("2_i6on3") +shader_parameter/Line_Smoothness = 0.045 +shader_parameter/Line_Width = 0.075 +shader_parameter/Brightness = 0.81 +shader_parameter/Rotation_deg = 35.0 +shader_parameter/Distortion = 1.67 +shader_parameter/Speed = 0.31 +shader_parameter/Position = 0.0 +shader_parameter/Position_Min = 0.25 +shader_parameter/Position_Max = 0.5 +shader_parameter/Alpha = 0.02 + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_pobwp"] +resource_local_to_scene = true +shader = ExtResource("3_14db6") +shader_parameter/angle = 0.0 +shader_parameter/position = 0.0 +shader_parameter/spread = 1.0 +shader_parameter/cutoff = -1.0 +shader_parameter/falloff = 1.0 +shader_parameter/edge_fade = 0.904 +shader_parameter/speed = 20.0 +shader_parameter/ray1_density = 8.0 +shader_parameter/ray2_density = 30.0 +shader_parameter/ray2_intensity = 0.3 +shader_parameter/color = Color(0.960784, 0.937255, 1, 0.117647) +shader_parameter/hdr = false +shader_parameter/seed = 5.96 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_8rfnv"] +resource_local_to_scene = true +bg_color = Color(0, 0, 0, 0) +corner_radius_top_left = 26 +corner_radius_top_right = 26 +corner_radius_bottom_right = 26 +corner_radius_bottom_left = 26 +shadow_color = Color(0, 0, 0, 0.486275) +shadow_size = 20 +shadow_offset = Vector2(0, 5) + +[node name="GameCard" instance=ExtResource("1_6tx83")] +custom_minimum_size = Vector2(200, 200) +offset_bottom = 200.0 + +[node name="PanelContainer" parent="." index="3"] +offset_top = 1.0 +offset_bottom = 201.0 + +[node name="TextureRect" parent="PanelContainer" index="0"] +custom_minimum_size = Vector2(200, 200) +stretch_mode = 0 + +[node name="ShineShader" parent="PanelContainer" index="1"] +material = SubResource("ShaderMaterial_yfw66") + +[node name="GodRaysShader" parent="PanelContainer" index="2"] +material = SubResource("ShaderMaterial_pobwp") + +[node name="MarginContainer" parent="." index="4"] +custom_minimum_size = Vector2(200, 200) + +[node name="Shadow" parent="MarginContainer" index="0"] +theme_override_styles/panel = SubResource("StyleBoxFlat_8rfnv") diff --git a/core/ui/etoile_ui/components/game_tile.gd b/core/ui/etoile_ui/components/game_tile.gd new file mode 100644 index 000000000..36667c6b6 --- /dev/null +++ b/core/ui/etoile_ui/components/game_tile.gd @@ -0,0 +1,213 @@ +@tool +@icon("res://assets/editor-icons/card-clubs.svg") +extends MarginContainer +class_name GameTile + +var boxart_manager := preload("res://core/global/boxart_manager.tres") as BoxArtManager + +signal button_up +signal button_down +signal pressed +signal highlighted +signal unhighlighted + +@export var is_library_tile := false +@export_category("Label") +@export var show_label := false: + set(v): + show_label = v + if name_container: + name_container.visible = v +@export var text := "Game Name": + set(v): + text = v + if name_label: + name_label.text = v +@export_category("ProgressBar") +@export var show_progress := false: + set(v): + show_progress = v + if progress: + progress.visible = v +@export var value: float = 50: + set(v): + value = v + if progress: + progress.value = v + +var library_item: LibraryItem +var tapped_count := 0 +var logger := Log.get_logger("GameTile") + +@onready var texture := $%TextureRect as TextureRect +@onready var name_container := $%NameMargin as MarginContainer +@onready var name_label := $%NameLabel as Label +@onready var progress := $%ProgressBar as ProgressBar +@onready var tap_timer := $%TapTimer as Timer +@onready var shine_rect := $%ShineShader as ColorRect +@onready var god_rays_rect := $%GodRaysShader as ColorRect +@onready var outline := $%OutlineContainer as Control +@onready var glow := $%GlowPanel as Panel + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + name_container.visible = show_label + name_label.text = text + progress.visible = show_progress + progress.value = value + focus_entered.connect(_on_focus) + focus_exited.connect(_on_unfocus) + texture.mouse_entered.connect(_on_focus) + texture.mouse_exited.connect(_on_unfocus) + + # Setup a timer callback to clear number of taps on the card + var on_timeout := func(): + tapped_count = 0 + tap_timer.timeout.connect(on_timeout) + + var parent := get_parent() + if parent and parent is Container: + (parent as Container).queue_sort() + + +## Sets the texture on the given card and sets the shader params +func set_texture(new_texture: Texture2D, new_logo_texture: Texture2D = null) -> void: + var texture_rect := get_node("%TextureRect") as TextureRect + texture_rect.texture = new_texture + var logo_rect := get_node("%LogoTextureRect") as TextureRect + logo_rect.visible = new_logo_texture != null + if new_logo_texture: + logo_rect.texture = new_logo_texture + + +## Configures the card with the given library item. +func set_library_item(item: LibraryItem, free_on_remove: bool = true) -> void: + # Set the name based on the library item + name = item.name + library_item = item + + # Get the boxart for the item + var layout := BoxArtProvider.LAYOUT.GRID_SQUARE + var logo_texture: Texture2D + var card_texture: Texture2D = await boxart_manager.get_boxart(item, layout) + + # If no square asset is available, try to composite one with banner + logo + if not card_texture: + var banner := await boxart_manager.get_boxart(item, BoxArtProvider.LAYOUT.BANNER) + var logo := await boxart_manager.get_boxart(item, BoxArtProvider.LAYOUT.LOGO) + if banner and logo: + card_texture = banner + logo_texture = logo + + # Otherwise use the placeholder texture + if not card_texture: + card_texture = boxart_manager.get_placeholder(BoxArtProvider.LAYOUT.GRID_PORTRAIT) + show_label = true + text = item.name + set_texture(card_texture, logo_texture) + + # Listen for library removal signals and free the card if removed + if free_on_remove: + var on_removed := func() -> void: + logger.debug("Removing card: " + name) + queue_free() + item.removed_from_library.connect(on_removed, CONNECT_ONE_SHOT) + item.hidden.connect(on_removed, CONNECT_ONE_SHOT) + + +func _on_focus() -> void: + highlighted.emit() + _outline_fade_in() + _shader_godrays_fade_in() + _shader_shine_fade_in() + + +func _outline_fade_in() -> void: + outline.modulate = Color(1, 1, 1, 0) + outline.visible = true + var tween := create_tween() + tween.tween_property(outline, "modulate", Color(1, 1, 1, 1), 0.5) + + +func _shader_godrays_fade_in() -> void: + var tween := create_tween() + var shader := god_rays_rect.material as ShaderMaterial + var final_color := Color(0.961, 0.937, 1.0, 0.2) + var start_color := Color(0.961, 0.937, 1.0, 0.0) + shader.set_shader_parameter("color", start_color) + god_rays_rect.visible = true + var on_tween := func(value: Color): + shader.set_shader_parameter("color", value) + tween.tween_method(on_tween, start_color, final_color, 0.5) + + +func _shader_shine_fade_in() -> void: + var tween := create_tween() + var shader := shine_rect.material as ShaderMaterial + var final_alpha := 0.02 + var start_alpha := 0.0 + shader.set_shader_parameter("Alpha", start_alpha) + shine_rect.visible = true + var on_tween := func(value: float): + shader.set_shader_parameter("Alpha", value) + tween.tween_method(on_tween, start_alpha, final_alpha, 0.8) + + +func _on_unfocus() -> void: + unhighlighted.emit() + _outline_fade_out() + _shader_godrays_fade_out() + _shader_shine_fade_out() + + +func _outline_fade_out() -> void: + outline.modulate = Color(1, 1, 1, 1) + outline.visible = true + var tween := create_tween() + tween.tween_property(outline, "modulate", Color(1, 1, 1, 0), 0.5) + tween.tween_property(outline, "visible", false, 0.0) + + +func _shader_godrays_fade_out() -> void: + var tween := create_tween() + var shader := god_rays_rect.material as ShaderMaterial + var start_color := Color(0.961, 0.937, 1.0, 0.2) + var final_color := Color(0.961, 0.937, 1.0, 0.0) + shader.set_shader_parameter("color", start_color) + var on_tween := func(value: Color): + shader.set_shader_parameter("color", value) + tween.tween_method(on_tween, start_color, final_color, 0.5) + tween.tween_property(god_rays_rect, "visible", false, 0.0) + + +func _shader_shine_fade_out() -> void: + var tween := create_tween() + var shader := shine_rect.material as ShaderMaterial + var start_alpha := 0.02 + var final_alpha := 0.0 + shader.set_shader_parameter("Alpha", start_alpha) + var on_tween := func(value: float): + shader.set_shader_parameter("Alpha", value) + tween.tween_method(on_tween, start_alpha, final_alpha, 0.1) + tween.tween_property(shine_rect, "visible", false, 0.0) + + +func _gui_input(event: InputEvent) -> void: + if event is InputEventMouseButton: + if event.is_pressed() and event.double_click: + button_up.emit() + if event is InputEventScreenTouch: + if event.is_pressed(): + tapped_count += 1 + if tapped_count > 1: + tapped_count = 0 + button_up.emit() + else: + tap_timer.start() + if event.is_action("ui_accept"): + if event.is_pressed(): + button_down.emit() + pressed.emit() + else: + button_up.emit() diff --git a/core/ui/etoile_ui/components/game_tile.gd.uid b/core/ui/etoile_ui/components/game_tile.gd.uid new file mode 100644 index 000000000..db4b8ebab --- /dev/null +++ b/core/ui/etoile_ui/components/game_tile.gd.uid @@ -0,0 +1 @@ +uid://djwjhfgjrcstn diff --git a/core/ui/etoile_ui/components/game_tile.tscn b/core/ui/etoile_ui/components/game_tile.tscn new file mode 100644 index 000000000..cd04172b0 --- /dev/null +++ b/core/ui/etoile_ui/components/game_tile.tscn @@ -0,0 +1,205 @@ +[gd_scene load_steps=13 format=3 uid="uid://c8pvsi1u00sol"] + +[ext_resource type="Script" uid="uid://djwjhfgjrcstn" path="res://core/ui/etoile_ui/components/game_tile.gd" id="1_eakx5"] +[ext_resource type="PackedScene" uid="uid://c5sfkhrfbao71" path="res://core/systems/effects/play_audio_effect.tscn" id="2_njc4j"] +[ext_resource type="LabelSettings" uid="uid://b1jl2mkmbimnx" path="res://assets/label/section_label.tres" id="4_njc4j"] +[ext_resource type="Texture2D" uid="uid://blc0qyvt1qhci" path="res://assets/images/placeholder-grid-portrait.png" id="4_wn75x"] +[ext_resource type="Shader" uid="uid://dw8by7ras0c8n" path="res://assets/shaders/highlight_shine.gdshader" id="5_ripyo"] +[ext_resource type="Shader" uid="uid://dmrh6bodc1vy7" path="res://assets/shaders/god_rays.gdshader" id="6_b0i0x"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_njc4j"] +bg_color = Color(0.6, 0.6, 0.6, 0) +draw_center = false +border_width_left = 4 +border_width_top = 4 +border_width_right = 4 +border_width_bottom = 4 +border_color = Color(1, 1, 1, 1) +corner_radius_top_left = 26 +corner_radius_top_right = 26 +corner_radius_bottom_right = 26 +corner_radius_bottom_left = 26 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_306if"] +bg_color = Color(0.6, 0.6, 0.6, 0) +border_width_left = 6 +border_width_top = 6 +border_width_right = 6 +border_width_bottom = 6 +border_blend = true +corner_radius_top_left = 18 +corner_radius_top_right = 18 +corner_radius_bottom_right = 18 +corner_radius_bottom_left = 18 +anti_aliasing_size = 10.0 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_cu3r7"] +corner_radius_top_left = 26 +corner_radius_top_right = 26 +corner_radius_bottom_right = 26 +corner_radius_bottom_left = 26 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_2ap7s"] +bg_color = Color(1, 0.47451, 0.776471, 1) +corner_radius_top_left = 5 +corner_radius_top_right = 5 +corner_radius_bottom_right = 5 +corner_radius_bottom_left = 5 + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_h5v0h"] +resource_local_to_scene = true +shader = ExtResource("5_ripyo") +shader_parameter/Line_Smoothness = 0.045 +shader_parameter/Line_Width = 0.075 +shader_parameter/Brightness = 0.81 +shader_parameter/Rotation_deg = 35.0 +shader_parameter/Distortion = 1.67 +shader_parameter/Speed = 0.31 +shader_parameter/Position = 0.0 +shader_parameter/Position_Min = 0.25 +shader_parameter/Position_Max = 0.5 +shader_parameter/Alpha = 0.02 + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_8kxiv"] +resource_local_to_scene = true +shader = ExtResource("6_b0i0x") +shader_parameter/angle = 0.0 +shader_parameter/position = 0.0 +shader_parameter/spread = 1.0 +shader_parameter/cutoff = -1.0 +shader_parameter/falloff = 1.0 +shader_parameter/edge_fade = 0.904 +shader_parameter/speed = 20.0 +shader_parameter/ray1_density = 8.0 +shader_parameter/ray2_density = 30.0 +shader_parameter/ray2_intensity = 0.3 +shader_parameter/color = Color(0.960784, 0.937255, 1, 0.117647) +shader_parameter/hdr = false +shader_parameter/seed = 5.96 + +[node name="GameTile" type="MarginContainer"] +offset_right = 208.0 +offset_bottom = 208.0 +focus_mode = 2 +script = ExtResource("1_eakx5") + +[node name="PlayFocusAudioEffect" parent="." instance=ExtResource("2_njc4j")] +on_signal = "focus_entered" + +[node name="PlaySelectedAudioEffect" parent="." instance=ExtResource("2_njc4j")] +audio = "res://assets/audio/interface/96127__bmaczero__contact1.ogg" +on_signal = "pressed" + +[node name="OutlineContainer" type="MarginContainer" parent="."] +unique_name_in_owner = true +visible = false +layout_mode = 2 +mouse_filter = 2 +theme_override_constants/margin_left = 2 +theme_override_constants/margin_top = 2 +theme_override_constants/margin_right = 2 +theme_override_constants/margin_bottom = 2 + +[node name="OutlinePanel" type="Panel" parent="OutlineContainer"] +layout_mode = 2 +theme_override_styles/panel = SubResource("StyleBoxFlat_njc4j") + +[node name="GlowPanel" type="Panel" parent="OutlineContainer"] +unique_name_in_owner = true +layout_mode = 2 +theme_override_styles/panel = SubResource("StyleBoxFlat_306if") + +[node name="MarginContainer" type="MarginContainer" parent="."] +layout_mode = 2 +theme_override_constants/margin_left = 4 +theme_override_constants/margin_top = 4 +theme_override_constants/margin_right = 4 +theme_override_constants/margin_bottom = 4 + +[node name="PanelContainer" type="PanelContainer" parent="MarginContainer"] +clip_children = 1 +layout_mode = 2 +mouse_filter = 1 +theme_override_styles/panel = SubResource("StyleBoxFlat_cu3r7") + +[node name="TextureRect" type="TextureRect" parent="MarginContainer/PanelContainer"] +unique_name_in_owner = true +custom_minimum_size = Vector2(50, 50) +layout_mode = 2 +texture = ExtResource("4_wn75x") +expand_mode = 1 +stretch_mode = 6 + +[node name="NameMargin" type="MarginContainer" parent="MarginContainer/PanelContainer/TextureRect"] +unique_name_in_owner = true +visible = false +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -25.0 +offset_top = -26.5 +offset_right = 25.0 +offset_bottom = 26.5 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="NameLabel" type="Label" parent="MarginContainer/PanelContainer/TextureRect/NameMargin"] +unique_name_in_owner = true +custom_minimum_size = Vector2(160, 0) +layout_mode = 2 +text = "Game Name" +label_settings = ExtResource("4_njc4j") +horizontal_alignment = 1 +autowrap_mode = 3 + +[node name="ProgressBar" type="ProgressBar" parent="MarginContainer/PanelContainer/TextureRect"] +unique_name_in_owner = true +visible = false +layout_mode = 1 +anchors_preset = 12 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_top = -27.0 +grow_horizontal = 2 +grow_vertical = 0 +theme_override_styles/fill = SubResource("StyleBoxFlat_2ap7s") +value = 50.0 +rounded = true + +[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/PanelContainer"] +layout_mode = 2 +mouse_filter = 2 +theme_override_constants/margin_left = 10 +theme_override_constants/margin_top = 10 +theme_override_constants/margin_right = 10 +theme_override_constants/margin_bottom = 10 + +[node name="LogoTextureRect" type="TextureRect" parent="MarginContainer/PanelContainer/MarginContainer"] +unique_name_in_owner = true +visible = false +layout_mode = 2 +expand_mode = 1 +stretch_mode = 5 + +[node name="ShineShader" type="ColorRect" parent="MarginContainer/PanelContainer"] +unique_name_in_owner = true +visible = false +material = SubResource("ShaderMaterial_h5v0h") +layout_mode = 2 +mouse_filter = 2 + +[node name="GodRaysShader" type="ColorRect" parent="MarginContainer/PanelContainer"] +unique_name_in_owner = true +visible = false +material = SubResource("ShaderMaterial_8kxiv") +layout_mode = 2 +mouse_filter = 2 + +[node name="TapTimer" type="Timer" parent="."] +unique_name_in_owner = true +wait_time = 0.5 +one_shot = true diff --git a/core/ui/etoile_ui/components/glass_panel.gd b/core/ui/etoile_ui/components/glass_panel.gd new file mode 100644 index 000000000..b99e9d22c --- /dev/null +++ b/core/ui/etoile_ui/components/glass_panel.gd @@ -0,0 +1,118 @@ +@tool +extends MarginContainer + +@export_category("Shape") +@export_enum("Circle", "Rectangle") var shape_type := "Rectangle": + set(v): + shape_type = v + if not shader: + return + var kind := 0 + if shape_type == "Rectangle": + kind = 1 + shader.set_shader_parameter("shape_type", kind) +@export_category("Corners") +@export var corner_radius_top_left := 10.0: + set(v): + corner_radius_top_left = v + _set_shader_parameter("corner_radius_top_left", v) +@export var corner_radius_top_right := 10.0: + set(v): + corner_radius_top_right = v + _set_shader_parameter("corner_radius_top_right", v) +@export var corner_radius_bottom_left := 10.0: + set(v): + corner_radius_bottom_left = v + _set_shader_parameter("corner_radius_bottom_left", v) +@export var corner_radius_bottom_right := 10.0: + set(v): + corner_radius_bottom_right = v + _set_shader_parameter("corner_radius_bottom_right", v) +@export var circle_radius := 100.0: + set(v): + circle_radius = v + _set_shader_parameter("circle_radius", v) +@export_category("Outline") +@export var outline_enabled := false: + set(v): + outline_enabled = v + _set_shader_parameter("outline_enabled", v) +@export var outline_width := 2.0: + set(v): + outline_width = v + _set_shader_parameter("outline_width", v) +@export var outline_color := Color(1, 1, 1, 0.8): + set(v): + outline_color = v + _set_shader_parameter("outline_color", v) +@export_category("Shadow") +@export var shadow_enabled := true: + set(v): + shadow_enabled = v + _set_shader_parameter("shadow_enabled", v) +@export var shadow_color := Color(0, 0, 0, 0.5): + set(v): + shadow_color = v + _set_shader_parameter("shadow_color", v) +@export var shadow_offset := Vector2(10.0, 10.0): + set(v): + shadow_offset = v + _set_shader_parameter("shadow_offset", v) +@export_category("Edge") +@export var edge_softness := 1.0: + set(v): + edge_softness = v + _set_shader_parameter("edge_softness", v) +@export_category("Color") +@export var shape_color := Color(0.0, 0.0, 0.0): + set(v): + shape_color = v + _set_shader_parameter("shape_color", v) +@export var color_gradient_x := 0.0: + set(v): + color_gradient_x = v + _set_shader_parameter("color_gradient_x", v) +@export var color_gradient_y := 0.0: + set(v): + color_gradient_y = v + _set_shader_parameter("color_gradient_y", v) +@export var color_multiplier := 0.9: + set(v): + color_multiplier = v + _set_shader_parameter("color_multiplier", v) +@export_category("Blur") +@export var enable_screen_blur := true: + set(v): + enable_screen_blur = v + _set_shader_parameter("enable_screen_blur", v) +@export var blur_amount := 3.0: + set(v): + blur_amount = v + _set_shader_parameter("blur_amount", v) +@export var blur_samples := 4: + set(v): + blur_samples = v + _set_shader_parameter("blur_samples", v) +@export var glass_opacity := 0.2: + set(v): + glass_opacity = v + _set_shader_parameter("glass_opacity", v) + +@onready var glass_rect := %GlassRect as ColorRect +@onready var shader := glass_rect.material as ShaderMaterial + + +func _ready() -> void: + sort_children.connect(_on_sort_children) + + +func _on_sort_children() -> void: + shader.set_shader_parameter("node_size", self.size) + shader.set_shader_parameter("rect_size", self.size) + glass_rect.size = self.size + + +func _set_shader_parameter(param: String, value: Variant) -> void: + if not shader: + return + shader.set_shader_parameter(param, value) diff --git a/core/ui/etoile_ui/components/glass_panel.gd.uid b/core/ui/etoile_ui/components/glass_panel.gd.uid new file mode 100644 index 000000000..40ec8666b --- /dev/null +++ b/core/ui/etoile_ui/components/glass_panel.gd.uid @@ -0,0 +1 @@ +uid://87kwwf6b27by diff --git a/core/ui/etoile_ui/components/glass_panel.tscn b/core/ui/etoile_ui/components/glass_panel.tscn new file mode 100644 index 000000000..2fddee21f --- /dev/null +++ b/core/ui/etoile_ui/components/glass_panel.tscn @@ -0,0 +1,66 @@ +[gd_scene load_steps=4 format=3 uid="uid://c7mcv58e8gto4"] + +[ext_resource type="Script" uid="uid://87kwwf6b27by" path="res://core/ui/etoile_ui/components/glass_panel.gd" id="1_1hxmj"] +[ext_resource type="Shader" uid="uid://c0e8ae3ilo5e2" path="res://assets/shaders/frosted_glass.gdshader" id="2_j86fq"] + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_j86fq"] +shader = ExtResource("2_j86fq") +shader_parameter/shape_type = 1 +shader_parameter/rect_size = Vector2(1280, 800) +shader_parameter/corner_radius_top_left = 20.0 +shader_parameter/corner_radius_top_right = 20.0 +shader_parameter/corner_radius_bottom_left = 20.0 +shader_parameter/corner_radius_bottom_right = 20.0 +shader_parameter/circle_radius = 100.0 +shader_parameter/outline_enabled = false +shader_parameter/outline_width = 2.0 +shader_parameter/outline_color = Color(1, 1, 1, 0.8) +shader_parameter/shadow_enabled = true +shader_parameter/shadow_color = Color(0, 0, 0, 0.5019608) +shader_parameter/shadow_offset = Vector2(10, 10) +shader_parameter/shadow_blur = 15.0 +shader_parameter/edge_softness = 1.0 +shader_parameter/shape_color = Color(0, 0, 0, 1) +shader_parameter/color_gradient_y = 0.0 +shader_parameter/color_gradient_x = 9.49999998667295e-08 +shader_parameter/color_multiplier = 0.9 +shader_parameter/enable_screen_blur = true +shader_parameter/blur_amount = 3.0 +shader_parameter/blur_samples = 4 +shader_parameter/glass_opacity = 0.2 +shader_parameter/node_size = Vector2(1280, 800) + +[node name="GlassPanel" type="MarginContainer"] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_1hxmj") +shape_type = null +corner_radius_top_left = null +corner_radius_top_right = null +corner_radius_bottom_left = null +corner_radius_bottom_right = null +circle_radius = null +outline_enabled = null +outline_width = null +outline_color = null +shadow_enabled = null +shadow_color = null +shadow_offset = null +edge_softness = null +shape_color = null +color_gradient_x = null +color_gradient_y = null +color_multiplier = null + +[node name="CanvasGroup" type="CanvasGroup" parent="."] +unique_name_in_owner = true + +[node name="GlassRect" type="ColorRect" parent="CanvasGroup"] +unique_name_in_owner = true +material = SubResource("ShaderMaterial_j86fq") +custom_minimum_size = Vector2(434, 200) +offset_right = 1280.0 +offset_bottom = 800.0 diff --git a/core/ui/etoile_ui/components/network_icon.gd b/core/ui/etoile_ui/components/network_icon.gd new file mode 100644 index 000000000..869e753fe --- /dev/null +++ b/core/ui/etoile_ui/components/network_icon.gd @@ -0,0 +1,56 @@ +extends TextureRect + +var network_manager := preload("res://core/systems/network/network_manager.tres") as NetworkManagerInstance +var current_access_point: NetworkAccessPoint + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + # Set the visibility of the network icon depending on if networking is available + network_manager.started.connect(_on_networking_available) + network_manager.stopped.connect(_on_networking_available) + _on_networking_available() + + # Listen for active connection changes to determine what icon to display + network_manager.primary_connection_changed.connect(_on_primary_change) + _on_primary_change(network_manager.primary_connection) + + +func _on_networking_available() -> void: + self.visible = network_manager.is_running() + + +func _on_primary_change(conn: NetworkActiveConnection) -> void: + if current_access_point: + current_access_point.strength_changed.disconnect(_on_wifi_strength_changed) + current_access_point = null + if not conn: + # No active connection + self.texture = NetworkManager.no_network + return + + var devices := conn.devices + if devices.is_empty(): + # No devices associated with connection + self.texture = NetworkManager.no_network + return + + # Set the icon based on the type of device + var device := devices[0] + if not device.wireless: + self.texture = NetworkManager.ethernet + return + + # Set the texture based on wifi state + current_access_point = device.wireless.active_access_point + if not current_access_point: + self.texture = NetworkManager.bar_0 + return + self.texture = NetworkManager.get_strength_texture(current_access_point.strength) + + # Update the wifi strength + current_access_point.strength_changed.connect(_on_wifi_strength_changed) + + +func _on_wifi_strength_changed(strength: int) -> void: + self.texture = NetworkManager.get_strength_texture(strength) diff --git a/core/ui/etoile_ui/components/network_icon.gd.uid b/core/ui/etoile_ui/components/network_icon.gd.uid new file mode 100644 index 000000000..c1ee236d4 --- /dev/null +++ b/core/ui/etoile_ui/components/network_icon.gd.uid @@ -0,0 +1 @@ +uid://0utn6qg0q21w diff --git a/core/ui/etoile_ui/components/network_icon.tscn b/core/ui/etoile_ui/components/network_icon.tscn new file mode 100644 index 000000000..9c77dc985 --- /dev/null +++ b/core/ui/etoile_ui/components/network_icon.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=3 uid="uid://cmrmkiugq0sgo"] + +[ext_resource type="Script" uid="uid://0utn6qg0q21w" path="res://core/ui/etoile_ui/components/network_icon.gd" id="1_l722o"] + +[node name="NetworkIcon" type="TextureRect"] +script = ExtResource("1_l722o") diff --git a/core/ui/etoile_ui/etoile_components.tres b/core/ui/etoile_ui/etoile_components.tres new file mode 100644 index 000000000..76834ec90 --- /dev/null +++ b/core/ui/etoile_ui/etoile_components.tres @@ -0,0 +1,11 @@ +[gd_resource type="Resource" script_class="ComponentsMap" format=3 uid="uid://b4sii01haxco6"] + +[ext_resource type="PackedScene" uid="uid://btrem65c8687w" path="res://core/ui/etoile_ui/components/collapsible_button.tscn" id="1_25no1"] +[ext_resource type="Script" uid="uid://rbk4rsah3pud" path="res://core/ui/base/components_map.gd" id="1_77n3c"] +[ext_resource type="PackedScene" uid="uid://cemxrvvjgm4g" path="res://core/ui/components/slider.tscn" id="3_04xva"] + +[resource] +script = ExtResource("1_77n3c") +button = ExtResource("1_25no1") +slider = ExtResource("3_04xva") +metadata/_custom_type_script = "uid://rbk4rsah3pud" diff --git a/core/ui/etoile_ui/etoile_ui.gd b/core/ui/etoile_ui/etoile_ui.gd new file mode 100644 index 000000000..71157eb91 --- /dev/null +++ b/core/ui/etoile_ui/etoile_ui.gd @@ -0,0 +1,269 @@ +extends UserInterface + +var platform := preload("res://core/global/platform.tres") as Platform +var gamescope := load("res://core/systems/gamescope/gamescope.tres") as GamescopeInstance +var input_plumber := load("res://core/systems/input/input_plumber.tres") as InputPlumberInstance +var boxart_manager := preload("res://core/global/boxart_manager.tres") as BoxArtManager +var settings_manager := preload("res://core/global/settings_manager.tres") as SettingsManager +var launch_manager := preload("res://core/global/launch_manager.tres") as LaunchManager +var library_manager := preload("res://core/global/library_manager.tres") as LibraryManager + +var state_machine := preload("res://assets/state/state_machines/global_state_machine.tres") as StateMachine +var menu_state_machine := preload("res://assets/state/state_machines/menu_state_machine.tres") as StateMachine +var popup_state_machine := preload("res://assets/state/state_machines/popup_state_machine.tres") as StateMachine +var menu_state := preload("res://assets/state/states/menu.tres") as State +var popup_state := preload("res://assets/state/states/popup.tres") as State +var home_state := preload("res://assets/state/states/home.tres") as State +var in_game_state := preload("res://assets/state/states/in_game.tres") as State +var osk_state := preload("res://assets/state/states/osk.tres") as State +var default_banner := preload("res://assets/images/starfield.svg") as Texture2D + +var PID: int = OS.get_process_id() +var _tween: Tween +var _xwayland_primary := gamescope.get_xwayland(gamescope.XWAYLAND_TYPE_PRIMARY) +var _xwayland_ogui := gamescope.get_xwayland(gamescope.XWAYLAND_TYPE_OGUI) +var _xwayland_game := gamescope.get_xwayland(gamescope.XWAYLAND_TYPE_GAME) +var overlay_window_id := 0 +var logger := Log.get_logger("Home", Log.LEVEL.INFO) + +@onready var home_menu := %Home +@onready var banner := %BannerTexture as TextureRect +@onready var panel := %Panel as Panel +@onready var ui_container := $%MenuContent as Control + + +func _init() -> void: + # Discover the window id of OpenGamepadUI + if _xwayland_ogui: + var ogui_windows := _xwayland_ogui.get_windows_for_pid(PID) + if not ogui_windows.is_empty(): + overlay_window_id = ogui_windows[0] + + # Tell gamescope that we're an overlay + if overlay_window_id <= 0: + logger.error("Unable to detect Window ID. Overlay is not going to work!") + logger.debug("Found primary window id: {0}".format([overlay_window_id])) + + if overlay_window_id <= 0: + logger.error("Unable to configure gamescope atoms") + return + # Pretend to be Steam + # Gamescope is hard-coded to look for appId 769 + if _xwayland_primary.set_main_app(overlay_window_id) != OK: + logger.error("Unable to set STEAM_GAME atom!") + # Sets ourselves to the input focus + if _xwayland_primary.set_input_focus(overlay_window_id, 1) != OK: + logger.error("Unable to set STEAM_INPUT_FOCUS atom!") + + # As of Gamescope v3.16.3+, the baselayer atom needs to be set at the start + _xwayland_primary.baselayer_window = 0 + _xwayland_primary.baselayer_apps = PackedInt64Array([GamescopeInstance.EXTRA_UNKNOWN_GAME_ID, GamescopeInstance.OVERLAY_GAME_ID]) + + # Override reserved app ids for any newly created windows + # Listen for window created/destroyed events + var on_window_created := func(window_id: int): + logger.debug("Window created:", window_id) + var try := 0 + while try < 10: + if _xwayland_game.has_app_id(window_id): + break + try += 1 + await get_tree().create_timer(0.2).timeout # wait a beat + var app_id := _xwayland_game.get_app_id(window_id) + if app_id == GamescopeInstance.OVERLAY_GAME_ID: + # Find the current running app and use that app id + var running := launch_manager.get_running() + running.reverse() + for app in running: + _xwayland_game.set_app_id(window_id, app.app_id) + return + logger.warn("Unable to find a running app to tie Steam to") + _xwayland_game.set_app_id(window_id, 7769) + _xwayland_game.window_created.connect(on_window_created) + + +func _ready() -> void: + # Configure the locale + var locale := settings_manager.get_value("general", "locale", "en_US") as String + TranslationServer.set_locale(locale) + + # Load any platform-specific logic + platform.load(get_tree().get_root()) + + # Set the FPS limit + Engine.max_fps = settings_manager.get_value("general", "max_fps", 60) as int + + # Always push the menu state if we end up with an empty stack. + var on_states_emptied := func(): + state_machine.push_state.call_deferred(menu_state) + state_machine.emptied.connect(on_states_emptied) + + # Initialize the state machine with its initial state + menu_state_machine.push_state(home_state) + + # Listen for changes to the selected game tile on the home menu to update the + # banner texture + var game_carousel := home_menu.get_node("%CarouselContainer") as CarouselContainer + game_carousel.child_selected.connect(_on_tile_selected) + + # Whenever the menu state is refreshed, refresh the menu state machine to + # re-grab focus. + var on_menu_refreshed := func(): + menu_state_machine.refresh() + menu_state.refreshed.connect(on_menu_refreshed) + + # Whenever the menu state is entered, refresh the menu state machine to + # re-grab focus + var on_menu_state_entered := func(_from: State): + menu_state_machine.refresh() + menu_state.state_entered.connect(on_menu_state_entered) + var on_menu_state_removed := func(): + menu_state_machine.clear_states() + menu_state.state_removed.connect(on_menu_state_removed) + var on_menu_states_empty := func(): + state_machine.remove_state(menu_state) + menu_state_machine.emptied.connect(on_menu_states_empty) + + # Whenever an popup state is pushed, update the global state + var on_popup_state_changed := func(_from: State, to: State): + if to: + state_machine.push_state(popup_state) + else: + state_machine.remove_state(popup_state) + popup_state_machine.state_changed.connect(on_popup_state_changed) + + # Show/hide the overlay when we enter/exit the in-game state + in_game_state.state_entered.connect(_on_game_state_entered) + in_game_state.state_exited.connect(_on_game_state_exited) + in_game_state.state_removed.connect(_on_game_state_removed) + library_manager.reload_library() + + # Enable InputPlumber management of all supported input devices + input_plumber.manage_all_devices = true + + # Setup inputplumber to receive guide presses. + input_plumber.set_intercept_mode(InputPlumberInstance.INTERCEPT_MODE_ALL) + input_plumber.set_intercept_activation(PackedStringArray(["Gamepad:Button:Guide"]), "Gamepad:Button:Guide") + + # Set the theme if one was set + var theme_path := settings_manager.get_value("general", "theme", "res://assets/themes/card_ui-darksoul.tres") as String + logger.debug("Setting theme to: " + theme_path) + var loaded_theme = load(theme_path) + if loaded_theme != null: + @warning_ignore("unsafe_call_argument") + set_theme(loaded_theme) + else: + logger.debug("Unable to load theme") + + +# Set the background based on selected game +func _on_tile_selected(node: Node) -> void: + if not node is GameTile: + return + var tile := node as GameTile + var texture: Texture2D + if tile.is_library_tile: + texture = default_banner + elif tile.library_item: + texture = await boxart_manager.get_boxart(tile.library_item, BoxArtProvider.LAYOUT.BANNER) + + if not texture: + texture = default_banner + + if _tween: + _tween.kill() + _tween = create_tween() + banner.modulate = Color(1, 1, 1, 0) + banner.texture = texture + _tween.tween_property(banner, "modulate", Color(1, 1, 1, 0.5), 1.2) + + +## Invoked when the in-game state was entered +func _on_game_state_entered(_from: State) -> void: + # Pass all gamepad input to the game + input_plumber.set_intercept_mode(InputPlumberInstance.INTERCEPT_MODE_PASS) + + # Turn off gamescope blur effect + _set_blur(GamescopeXWayland.BLUR_MODE_OFF) + + # Set gamescope input focus to off so the user can interact with the game + if _xwayland_ogui and _xwayland_ogui.set_input_focus(overlay_window_id, 0) != OK: + logger.error("Unable to set STEAM_INPUT_FOCUS atom!") + + # Ensure panel is invisible + panel.visible = false + banner.visible = false + for child in ui_container.get_children(): + if not child is Control: + continue + (child as Control).visible = false + + # Clear all menu states + menu_state_machine.clear_states() + + +## Invoked when the in-game state is exited +func _on_game_state_exited(to: State) -> void: + # Intercept all gamepad input when not in-game + input_plumber.set_intercept_mode(InputPlumberInstance.INTERCEPT_MODE_ALL) + + # Revert back to the default gamepad profile + #gamepad_manager.set_gamepads_profile(null) + + # Set gamescope input focus to on so the user can interact with the UI + if to == popup_state: + var current_popup := popup_state_machine.current_state() + if current_popup == osk_state: + return + + if _xwayland_primary: + if _xwayland_primary.set_input_focus(overlay_window_id, 1) != OK: + logger.error("Unable to set STEAM_INPUT_FOCUS atom!") + + # If the in-game state still exists in the stack, set the blur state. + if state_machine.has_state(in_game_state): + panel.visible = false + # Only blur if the focused GFX app is set + if _xwayland_primary: + var should_blur := settings_manager.get_value("display", "enable_overlay_blur", false) as bool + if should_blur and _xwayland_primary.get_focused_app_gfx() != gamescope.OVERLAY_GAME_ID: + _set_blur(GamescopeXWayland.BLUR_MODE_ALWAYS) + else: + _on_game_state_removed() + + # Un-hide all UI elements + for child in ui_container.get_children(): + if not child is Control: + continue + (child as Control).visible = true + + +## Invoked when the in-game state is removed +func _on_game_state_removed() -> void: + # Turn off gamescope blur + _set_blur(GamescopeXWayland.BLUR_MODE_OFF) + + # Un-hide the background panel + panel.visible = true + banner.visible = true + + # Reset the state stack if no menu state exists + if not state_machine.has_state(menu_state): + state_machine.set_state([menu_state]) + if not menu_state_machine.has_state(home_state): + menu_state_machine.set_state([home_state]) + + +# Sets the blur mode in gamescope +func _set_blur(mode: int) -> void: + if not _xwayland_primary: + return + # Sometimes setting this may fail when Steam closes. Retry several times. + for try in range(10): + if _xwayland_primary: + _xwayland_primary.set_blur_mode(mode) + var current := _xwayland_primary.get_blur_mode() + if mode == current: + break + logger.warn("Retrying in " + str(try) + "ms") + OS.delay_msec(try) diff --git a/core/ui/etoile_ui/etoile_ui.gd.uid b/core/ui/etoile_ui/etoile_ui.gd.uid new file mode 100644 index 000000000..07f6d9bd3 --- /dev/null +++ b/core/ui/etoile_ui/etoile_ui.gd.uid @@ -0,0 +1 @@ +uid://3drf8xp6swaa diff --git a/core/ui/etoile_ui/etoile_ui.tscn b/core/ui/etoile_ui/etoile_ui.tscn new file mode 100644 index 000000000..6aa508c34 --- /dev/null +++ b/core/ui/etoile_ui/etoile_ui.tscn @@ -0,0 +1,347 @@ +[gd_scene format=3 uid="uid://drs3b6nijk5uq"] + +[ext_resource type="Script" uid="uid://dbad1aoty3n0n" path="res://core/systems/input/input_icon_processor.gd" id="1_gx5g1"] +[ext_resource type="Script" uid="uid://3drf8xp6swaa" path="res://core/ui/etoile_ui/etoile_ui.gd" id="1_qmhmk"] +[ext_resource type="Resource" uid="uid://b4sii01haxco6" path="res://core/ui/etoile_ui/etoile_components.tres" id="2_4ytgp"] +[ext_resource type="Script" uid="uid://yhfpudolgixq" path="res://core/systems/gamescope/gamescope.gd" id="2_44qct"] +[ext_resource type="GamescopeInstance" uid="uid://chd0nc6gbfnw0" path="res://core/systems/gamescope/gamescope.tres" id="3_fsrla"] +[ext_resource type="PackedScene" uid="uid://dlegwm7jqfe2i" path="res://core/systems/boxart/boxart_local.tscn" id="4_5wgdm"] +[ext_resource type="PackedScene" uid="uid://ch6qw6obetalo" path="res://core/systems/library/library_desktop.tscn" id="5_wlsgd"] +[ext_resource type="PackedScene" uid="uid://uam46dtvo2yh" path="res://core/systems/plugin/plugin_manager.tscn" id="6_kj4c4"] +[ext_resource type="Script" uid="uid://cbjiip4mn0xuh" path="res://core/systems/power/power_manager.gd" id="7_mndwy"] +[ext_resource type="UPowerInstance" uid="uid://pgiv8yxro3n8" path="res://core/systems/power/power_manager.tres" id="8_qessb"] +[ext_resource type="Script" uid="uid://d1el4od5x5et0" path="res://core/systems/launcher/launcher.gd" id="9_div7i"] +[ext_resource type="Script" uid="uid://b2kun21dodmfw" path="res://core/systems/performance/power_station.gd" id="10_sqbwv"] +[ext_resource type="PowerStationInstance" uid="uid://c2mmrnh3rcs58" path="res://core/systems/performance/power_station.tres" id="11_s56r7"] +[ext_resource type="Script" uid="uid://c8sid1jrpjqlx" path="res://core/systems/network/network_manager.gd" id="12_6pv5o"] +[ext_resource type="NetworkManagerInstance" uid="uid://cmwavccnjwpr0" path="res://core/systems/network/network_manager.tres" id="13_qmhmk"] +[ext_resource type="ResourceRegistry" uid="uid://bsr58xihnpn1j" path="res://core/systems/resource/resource_registry.tres" id="14_8sw3x"] +[ext_resource type="Script" uid="uid://ompm0veql0ng" path="res://core/systems/ipc/pipe_manager.gd" id="15_130qf"] +[ext_resource type="PackedScene" uid="uid://lo32disyoypu" path="res://core/ui/etoile_ui/home/home.tscn" id="16_44qct"] +[ext_resource type="PackedScene" uid="uid://b5l4udy1v8ua3" path="res://core/ui/etoile_ui/launch/game_details.tscn" id="17_6pv5o"] +[ext_resource type="PackedScene" uid="uid://b1kist0rarpcy" path="res://core/ui/common/game/game_loading.tscn" id="17_cumyy"] +[ext_resource type="PackedScene" uid="uid://ccwn4n40imfg8" path="res://core/ui/components/containers/overlay_container.tscn" id="17_s56r7"] +[ext_resource type="Texture2D" uid="uid://chuihqnx022ys" path="res://assets/images/starfield.svg" id="18_1wv80"] +[ext_resource type="PackedScene" uid="uid://rosd00fxjrs8" path="res://core/ui/components/library_banner.tscn" id="18_q2s5f"] +[ext_resource type="Shader" uid="uid://dmrh6bodc1vy7" path="res://assets/shaders/god_rays.gdshader" id="19_3ygo4"] +[ext_resource type="PackedScene" uid="uid://doft5r1y37j1" path="res://core/ui/components/volume_indicator.tscn" id="19_qmhmk"] +[ext_resource type="PackedScene" uid="uid://cu4l0d1joc37w" path="res://core/ui/card_ui/navigation/in-game_notification.tscn" id="20_8sw3x"] +[ext_resource type="PackedScene" uid="uid://eqqk1uve143x" path="res://core/ui/components/dialog.tscn" id="21_130qf"] +[ext_resource type="PackedScene" uid="uid://vf4sij64f82b" path="res://core/ui/common/osk/on_screen_keyboard.tscn" id="22_mh67p"] +[ext_resource type="PackedScene" uid="uid://bbcd5tclmp2ux" path="res://core/ui/card_ui/navigation/library_loading_notification.tscn" id="23_1wv80"] +[ext_resource type="PackedScene" uid="uid://bw8113ocotx2r" path="res://core/systems/effects/fade_effect.tscn" id="23_q2s5f"] +[ext_resource type="PackedScene" uid="uid://ekhjpmat02f8" path="res://core/systems/effects/slide_effect.tscn" id="24_3ygo4"] +[ext_resource type="PackedScene" uid="uid://b7uwwwrbvdu4g" path="res://core/ui/etoile_ui/navigation/status_bar.tscn" id="25_6xvrb"] +[ext_resource type="PackedScene" uid="uid://hbgypx7p3gyw" path="res://core/systems/effects/grower_effect.tscn" id="25_cumyy"] +[ext_resource type="PackedScene" uid="uid://cdhh45htxfxnt" path="res://core/ui/etoile_ui/navigation/context_bar.tscn" id="25_k08on"] +[ext_resource type="PackedScene" uid="uid://djwhelsduv5cm" path="res://core/ui/etoile_ui/quick_bar/quick_bar_menu.tscn" id="26_6xvrb"] +[ext_resource type="PackedScene" uid="uid://cwarv58ju0sow" path="res://core/ui/card_ui/gamepad/gamepad_settings.tscn" id="28_44olc"] +[ext_resource type="PackedScene" uid="uid://d2jiecrd5sw4s" path="res://core/ui/card_ui/settings/settings_menu.tscn" id="29_44olc"] +[ext_resource type="Resource" uid="uid://cadriyl38ny5y" path="res://assets/state/state_machines/popup_state_machine.tres" id="29_kg3uc"] +[ext_resource type="PackedScene" uid="uid://58qlqqbh58im" path="res://core/ui/card_ui/launch/game_settings.tscn" id="30_kg3uc"] +[ext_resource type="PackedScene" uid="uid://d0wg7axkc5inq" path="res://core/ui/common/power/power_menu.tscn" id="30_y47hw"] +[ext_resource type="PackedScene" uid="uid://dnq5j20fbcrwx" path="res://core/systems/power/power_saver.tscn" id="31_3ygo4"] +[ext_resource type="PackedScene" uid="uid://n83wlhmmsu3j" path="res://core/systems/input/input_manager.tscn" id="32_cumyy"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_k08on"] +bg_color = Color(0, 0, 0, 1) + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_cumyy"] +shader = ExtResource("19_3ygo4") +shader_parameter/angle = 0.06 +shader_parameter/position = -0.1 +shader_parameter/spread = 0.674 +shader_parameter/cutoff = 0.1 +shader_parameter/falloff = 0.896 +shader_parameter/edge_fade = 0.15 +shader_parameter/speed = 6.995 +shader_parameter/ray1_density = 8.0 +shader_parameter/ray2_density = 30.0 +shader_parameter/ray2_intensity = 0.184 +shader_parameter/color = Color(0.888, 0.885, 1, 0.173) +shader_parameter/hdr = true +shader_parameter/seed = 1.505 + +[node name="EtoileUI" type="Control" unique_id=293046182 groups=["main"]] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_qmhmk") +components_map = ExtResource("2_4ytgp") + +[node name="InputIconProcessor" type="Node" parent="." unique_id=133203829] +script = ExtResource("1_gx5g1") + +[node name="Gamescope" type="Node" parent="." unique_id=331773454] +script = ExtResource("2_44qct") +instance = ExtResource("3_fsrla") + +[node name="BoxArtLocal" parent="." unique_id=728192973 instance=ExtResource("4_5wgdm")] + +[node name="DesktopLibrary" parent="." unique_id=273422834 instance=ExtResource("5_wlsgd")] + +[node name="PluginManager" parent="." unique_id=1337807622 instance=ExtResource("6_kj4c4")] + +[node name="PowerManager" type="Node" parent="." unique_id=376901165] +script = ExtResource("7_mndwy") +instance = ExtResource("8_qessb") + +[node name="Launcher" type="Node" parent="." unique_id=197769698] +script = ExtResource("9_div7i") + +[node name="PowerStation" type="Node" parent="." unique_id=1609184252] +script = ExtResource("10_sqbwv") +instance = ExtResource("11_s56r7") + +[node name="NetworkManager" type="Node" parent="." unique_id=1114541985] +script = ExtResource("12_6pv5o") +instance = ExtResource("13_qmhmk") + +[node name="ResourceProcessor" type="ResourceProcessor" parent="." unique_id=1656845806] +registry = ExtResource("14_8sw3x") + +[node name="PipeManager" type="Node" parent="." unique_id=149021728] +script = ExtResource("15_130qf") +metadata/_custom_type_script = "uid://ompm0veql0ng" + +[node name="PowerTimer" type="Timer" parent="." unique_id=1873967818] +unique_name_in_owner = true +wait_time = 1.5 +one_shot = true + +[node name="Panel" type="Panel" parent="." unique_id=269054140] +unique_name_in_owner = true +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_type_variation = &"LightPanel" +theme_override_styles/panel = SubResource("StyleBoxFlat_k08on") + +[node name="BannerTexture" type="TextureRect" parent="." unique_id=995560088] +unique_name_in_owner = true +modulate = Color(1, 1, 1, 0.49803922) +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +size_flags_vertical = 3 +size_flags_stretch_ratio = 1.1 +texture = ExtResource("18_1wv80") +expand_mode = 1 +stretch_mode = 6 + +[node name="LibraryBanner" parent="BannerTexture" unique_id=1333957306 instance=ExtResource("18_q2s5f")] +unique_name_in_owner = true +visible = false +layout_mode = 1 + +[node name="GodRaysShader" type="ColorRect" parent="BannerTexture" unique_id=297556648] +material = SubResource("ShaderMaterial_cumyy") +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="GameLoading" parent="." unique_id=978843536 instance=ExtResource("17_cumyy")] +visible = false +layout_mode = 1 + +[node name="MenuContent" type="MarginContainer" parent="." unique_id=1807362236] +unique_name_in_owner = true +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="MenuContent" unique_id=1224323819] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +theme_override_constants/separation = 0 + +[node name="TopMarginSpacer" type="Control" parent="MenuContent/VBoxContainer" unique_id=208984787] +unique_name_in_owner = true +layout_mode = 2 + +[node name="Home" parent="MenuContent/VBoxContainer" unique_id=182065460 instance=ExtResource("16_44qct")] +unique_name_in_owner = true +layout_mode = 2 + +[node name="GameDetails" parent="MenuContent/VBoxContainer" unique_id=223569532 instance=ExtResource("17_6pv5o")] +unique_name_in_owner = true +layout_mode = 2 +size_flags_stretch_ratio = 0.0 + +[node name="BottomMargin" type="MarginContainer" parent="MenuContent" unique_id=398431728] +layout_mode = 2 +mouse_filter = 2 +theme_override_constants/margin_left = 30 +theme_override_constants/margin_right = 30 +theme_override_constants/margin_bottom = 10 + +[node name="VBoxContainer" type="VBoxContainer" parent="MenuContent/BottomMargin" unique_id=534960923] +layout_mode = 2 +size_flags_vertical = 8 + +[node name="LibraryLoadingNotification" parent="MenuContent/BottomMargin/VBoxContainer" unique_id=869689725 instance=ExtResource("23_1wv80")] +layout_mode = 2 + +[node name="ContextBar" parent="MenuContent/BottomMargin/VBoxContainer" unique_id=269524939 instance=ExtResource("25_k08on")] +layout_mode = 2 +size_flags_vertical = 8 + +[node name="TopMargin" type="MarginContainer" parent="MenuContent" unique_id=1554864697] +layout_mode = 2 +mouse_filter = 2 +theme_override_constants/margin_left = 30 +theme_override_constants/margin_top = 30 +theme_override_constants/margin_right = 30 +theme_override_constants/margin_bottom = 10 + +[node name="VBoxContainer" type="VBoxContainer" parent="MenuContent/TopMargin" unique_id=1172636582] +layout_mode = 2 +size_flags_vertical = 0 + +[node name="StatusBar" parent="MenuContent/TopMargin/VBoxContainer" unique_id=1365181316 instance=ExtResource("25_6xvrb")] +layout_mode = 2 + +[node name="SettingsMenuMargin" type="MarginContainer" parent="MenuContent" unique_id=1940228840] +layout_mode = 2 +theme_override_constants/margin_left = 20 +theme_override_constants/margin_top = 90 +theme_override_constants/margin_right = 20 +theme_override_constants/margin_bottom = 90 + +[node name="GamepadSettings" parent="MenuContent/SettingsMenuMargin" unique_id=2089050966 instance=ExtResource("28_44olc")] +unique_name_in_owner = true +visible = false +layout_mode = 2 + +[node name="StateUpdater" parent="MenuContent/SettingsMenuMargin/GamepadSettings/InputWatcher" parent_id_path=PackedInt32Array(2089050966, 314413761) index="0" unique_id=862878861] +state_machine = ExtResource("29_kg3uc") + +[node name="SettingsMenu" parent="MenuContent/SettingsMenuMargin" unique_id=1262154375 instance=ExtResource("29_44olc")] +visible = false +layout_mode = 2 + +[node name="StateUpdater" parent="MenuContent/SettingsMenuMargin/SettingsMenu/InputWatcher" index="0"] +state_machine = ExtResource("29_kg3uc") + +[node name="GameSettingsMenu" parent="MenuContent/SettingsMenuMargin" unique_id=752091180 instance=ExtResource("30_kg3uc")] +visible = false +layout_mode = 2 + +[node name="StateUpdater" parent="MenuContent/SettingsMenuMargin/GameSettingsMenu/InputWatcher" parent_id_path=PackedInt32Array(752091180, 1253672787) index="0" unique_id=1643016462] +state_machine = ExtResource("29_kg3uc") + +[node name="MenuContainer" type="MarginContainer" parent="." unique_id=736550273] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="MarginContainer" type="MarginContainer" parent="MenuContainer" unique_id=648733195] +layout_mode = 2 +size_flags_horizontal = 8 +theme_override_constants/margin_top = 80 +theme_override_constants/margin_right = 40 + +[node name="QuickBarMenu" parent="MenuContainer/MarginContainer" unique_id=1126842285 instance=ExtResource("26_6xvrb")] +visible = false +custom_minimum_size = Vector2(434, 500) +layout_mode = 2 +size_flags_horizontal = 0 +size_flags_vertical = 0 + +[node name="AlwaysVisibleContent" type="MarginContainer" parent="." unique_id=695588287] +editor_description = "Anything in this container will always be visible, even during in-game states. +" +z_index = 20 +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 + +[node name="OverlayContainer" parent="AlwaysVisibleContent" unique_id=1382084774 instance=ExtResource("17_s56r7")] +layout_mode = 2 + +[node name="PowerMenu" parent="AlwaysVisibleContent" unique_id=1824508021 instance=ExtResource("30_y47hw")] +visible = false +layout_mode = 2 + +[node name="VolumeIndicator" parent="AlwaysVisibleContent" unique_id=1082324374 instance=ExtResource("19_qmhmk")] +layout_mode = 2 + +[node name="TopMargin" type="MarginContainer" parent="AlwaysVisibleContent" unique_id=1524137883] +layout_mode = 2 +mouse_filter = 2 +theme_override_constants/margin_left = 30 +theme_override_constants/margin_top = 10 +theme_override_constants/margin_right = 30 + +[node name="InGameNotification" parent="AlwaysVisibleContent/TopMargin" unique_id=1268549374 instance=ExtResource("20_8sw3x")] +visible = false +layout_mode = 2 +size_flags_horizontal = 8 +size_flags_vertical = 0 + +[node name="Dialog" parent="AlwaysVisibleContent" unique_id=1807519512 instance=ExtResource("21_130qf")] +unique_name_in_owner = true +visible = false +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 + +[node name="OnScreenKeyboard" parent="AlwaysVisibleContent" unique_id=882285584 instance=ExtResource("22_mh67p")] +visible = false +layout_mode = 2 + +[node name="FadeEffect" parent="AlwaysVisibleContent/OnScreenKeyboard" unique_id=2038199356 node_paths=PackedStringArray("target") instance=ExtResource("23_q2s5f")] +target = NodePath("..") +fade_speed = 0.2 +on_signal = "opened" +fade_out_signal = "closed" +on_signal = "opened" + +[node name="SlideEffect" parent="AlwaysVisibleContent/OnScreenKeyboard" unique_id=703642664 node_paths=PackedStringArray("target") instance=ExtResource("24_3ygo4")] +target = NodePath("../MarginContainer/PanelContainer") +slide_speed = 0.15 +margin = 60 +direction = "down" +on_signal = "opened" +slide_out_signal = "closed" +on_signal = "opened" + +[node name="SpacerGrowerEffect" parent="AlwaysVisibleContent/OnScreenKeyboard" unique_id=283353661 instance=ExtResource("25_cumyy")] +on_signal = "opened" +shrink_signal = "closed" +on_signal = "opened" + +[node name="PowerSaver" parent="." unique_id=1353382911 instance=ExtResource("31_3ygo4")] + +[node name="InputManager" parent="." unique_id=1030765624 instance=ExtResource("32_cumyy")] + +[editable path="MenuContent/SettingsMenuMargin/GamepadSettings"] +[editable path="MenuContent/SettingsMenuMargin/SettingsMenu"] +[editable path="MenuContent/SettingsMenuMargin/GameSettingsMenu"] +[editable path="MenuContent/SettingsMenuMargin/GameSettingsMenu/MarginContainer/HBoxContainer/ContentContainer/VBoxContainer/ContentContainer/MarginContainer/LaunchSettings"] +[editable path="MenuContent/SettingsMenuMargin/GameSettingsMenu/MarginContainer/HBoxContainer/ContentContainer/VBoxContainer/ContentContainer/MarginContainer/BoxArtSettings"] +[editable path="MenuContent/SettingsMenuMargin/GameSettingsMenu/MarginContainer/HBoxContainer/ContentContainer/VBoxContainer/ContentContainer/MarginContainer/LibrarySettings"] +[editable path="AlwaysVisibleContent/OnScreenKeyboard"] diff --git a/core/ui/etoile_ui/home/home.gd b/core/ui/etoile_ui/home/home.gd new file mode 100644 index 000000000..bdcdbdced --- /dev/null +++ b/core/ui/etoile_ui/home/home.gd @@ -0,0 +1,222 @@ +extends Control + +var launch_manager := preload("res://core/global/launch_manager.tres") as LaunchManager +var library_manager := preload("res://core/global/library_manager.tres") as LibraryManager +var settings_manager := preload("res://core/global/settings_manager.tres") as SettingsManager + +var game_tile_scene := load("res://core/ui/etoile_ui/components/game_tile.tscn") as PackedScene +var global_state_machine := preload("res://assets/state/state_machines/global_state_machine.tres") as StateMachine +var state_machine := preload("res://assets/state/state_machines/menu_state_machine.tres") as StateMachine +var state := preload("res://assets/state/states/home.tres") as State +var menu_state := preload("res://assets/state/states/menu.tres") as State +var game_details_state := preload("res://assets/state/states/game_launcher.tres") as State +var in_game_state := preload("res://assets/state/states/in_game.tres") as State +var library_tile_texture := preload("res://assets/images/library-tile.png") as Texture2D + +var tween: Tween +var recent_apps: Array[String] = [] +var original_tile_size: Vector2 +var original_tile_unselected_size: Vector2 +var transition_duration := 0.5 + +@onready var container := %CarouselContainer as CarouselContainer +@onready var collections := %CollectionsContainer as Control +@onready var details := %DetailsContainer as Control +@onready var library_tile := %LibraryTile as GameTile + + +func _ready() -> void: + self.original_tile_size = container.selected_size + self.original_tile_unselected_size = container.unselected_size + container.child_selected.connect(_on_child_selected) + library_tile.set_texture(library_tile_texture) + state.state_entered.connect(_on_state_entered) + state.state_exited.connect(_on_state_exited) + state.refreshed.connect(_on_state_refreshed) + await library_manager.library_loaded + _update_recent_apps() + var first_tile := container.get_child(0) + if first_tile and first_tile is Control: + (first_tile as Control).grab_focus.call_deferred() + + # Listen for library changes + library_manager.library_item_added.connect(_on_library_item_changed) + library_manager.library_item_removed.connect(_on_library_item_changed) + + +func _on_state_entered(_from: State) -> void: + var selected_node := container.get_child(container.selected_child) + if selected_node and selected_node is Control: + (selected_node as Control).grab_focus.call_deferred() + if tween: + tween.kill() + var top_margin_spacer := get_parent().get_node("TopMarginSpacer") + collections.modulate = Color(1, 1, 1, 0) + collections.visible = true + details.modulate = Color(1, 1, 1, 0) + details.visible = true + tween = create_tween() + tween.set_ease(Tween.EASE_IN_OUT) + tween.parallel().tween_property(collections, "modulate", Color(1, 1, 1, 1), transition_duration) + tween.parallel().tween_property(details, "modulate", Color(1, 1, 1, 1), transition_duration) + tween.parallel().tween_property(container, "selected_size", original_tile_size, transition_duration) + tween.parallel().tween_property(container, "unselected_size", original_tile_unselected_size, transition_duration) + tween.parallel().tween_property(container, "text_modulate", Color(1, 1, 1, 1), transition_duration) + tween.parallel().tween_property(top_margin_spacer, "custom_minimum_size", Vector2.ZERO, transition_duration) + + +func _on_state_exited(to: State) -> void: + if to == game_details_state: + _on_game_details_state_entered(to) + + +func _on_game_details_state_entered(_state: State) -> void: + if tween: + tween.kill() + var top_margin_spacer := get_parent().get_node("TopMarginSpacer") + var game_details_size := container.unselected_size / 2.0 + tween = create_tween() + tween.set_ease(Tween.EASE_IN_OUT) + tween.parallel().tween_property(collections, "modulate", Color(1, 1, 1, 0), transition_duration) + tween.parallel().tween_property(details, "modulate", Color(1, 1, 1, 0), transition_duration) + tween.parallel().tween_property(container, "selected_size", game_details_size, transition_duration) + tween.parallel().tween_property(container, "unselected_size", game_details_size, transition_duration) + tween.parallel().tween_property(container, "text_modulate", Color(1, 1, 1, 0), transition_duration / 4.0) + tween.parallel().tween_property(top_margin_spacer, "custom_minimum_size", Vector2(0, 80), transition_duration) + tween.tween_property(collections, "visible", false, 0.0) + tween.tween_property(details, "visible", false, 0.0) + + +func _on_state_refreshed() -> void: + var selected_node := container.get_child(container.selected_child) + if selected_node and selected_node is Control: + (selected_node as Control).grab_focus.call_deferred() + + +func _on_library_item_changed(_item: LibraryItem) -> void: + _update_recent_apps() + + +func _update_recent_apps() -> void: + recent_apps.assign(launch_manager.get_recent_apps()) + var items: Array[LibraryItem] = [] + for app_name in recent_apps: + var library_item := library_manager.get_app_by_name(app_name) + if library_item == null: + continue + items.append(library_item) + _repopulate_strip(items) + + +func _repopulate_strip(apps: Array[LibraryItem]) -> void: + # Find any existing library items + var existing_apps := {} + for child in container.get_children(): + if not child is GameTile: + continue + var tile := child as GameTile + if not tile.library_item: + continue + existing_apps[tile.library_item.name] = tile.library_item + + # Add any new items + for item in apps: + if item.name in existing_apps: + continue + var tile := await _build_tile(item) + container.add_child(tile) + + +func _build_tile(item: LibraryItem) -> GameTile: + var tile := game_tile_scene.instantiate() as GameTile + await tile.set_library_item(item) + + return tile + + +func _on_child_selected(node: Node) -> void: + if not node: + return + if not node is GameTile: + return + var tile := node as GameTile + if tile.is_library_tile: + var details_tween := create_tween() + details_tween.tween_property(details, "modulate", Color(1, 1, 1, 0), transition_duration / 2.0) + return + if not tile.library_item: + return + game_details_state.set_meta("library_item", tile.library_item) + game_details_state.refreshed.emit() + if details.modulate != Color(1, 1, 1, 1): + var details_tween := create_tween() + details_tween.tween_property(details, "modulate", Color(1, 1, 1, 1), transition_duration / 2.0) + + + +func _launch_game(launch_item: LibraryLaunchItem) -> void: + # Resume if the game is running already + if launch_manager.is_running(launch_item.name): + state_machine.set_state([in_game_state]) + return + + # If the app isn't installed, install it. + if not launch_item.installed: + #_on_install() + return + + # Launch the game using launch manager + launch_manager.launch(launch_item) + + +# Lookup the current launch provider for the library item +func _get_launch_item(library_item: LibraryItem) -> LibraryLaunchItem: + var launch_item := library_item.launch_items[0] as LibraryLaunchItem + var section := "game.{0}".format([library_item.name.to_lower()]) + var provider_id := settings_manager.get_value(section, "provider", "") as String + if provider_id != "": + var possible_launch_item := library_item.get_launch_item(provider_id) + if possible_launch_item != null: + launch_item = possible_launch_item + + return launch_item + + +func _input(event: InputEvent) -> void: + if event is InputEventMouse: + return + var focused_node := get_viewport().gui_get_focus_owner() + if focused_node and not self.is_ancestor_of(focused_node): + return + if event.is_action_pressed("ui_down") or event.is_action_pressed("ogui_north"): + if state_machine.current_state() != state: + return + var selected_node := container.get_child(container.selected_child) + if not selected_node: + return + if not selected_node is GameTile: + return + var selected_tile := selected_node as GameTile + if selected_tile.is_library_tile: + return + state_machine.push_state(game_details_state) + get_viewport().set_input_as_handled() + return + if event.is_action_pressed("ui_up"): + if state_machine.current_state() != game_details_state: + return + state_machine.pop_state() + get_viewport().set_input_as_handled() + return + if event.is_action_released("ui_accept"): + var selected_node := container.get_child(container.selected_child) + if not selected_node: + return + if not selected_node is GameTile: + return + var selected_tile := selected_node as GameTile + var library_item := selected_tile.library_item + if not library_item: + return + var launch_item := _get_launch_item(library_item) + _launch_game(launch_item) diff --git a/core/ui/etoile_ui/home/home.gd.uid b/core/ui/etoile_ui/home/home.gd.uid new file mode 100644 index 000000000..892f561c2 --- /dev/null +++ b/core/ui/etoile_ui/home/home.gd.uid @@ -0,0 +1 @@ +uid://cyy6rp03jd65n diff --git a/core/ui/etoile_ui/home/home.tscn b/core/ui/etoile_ui/home/home.tscn new file mode 100644 index 000000000..24425f350 --- /dev/null +++ b/core/ui/etoile_ui/home/home.tscn @@ -0,0 +1,99 @@ +[gd_scene format=3 uid="uid://lo32disyoypu"] + +[ext_resource type="Script" uid="uid://cyy6rp03jd65n" path="res://core/ui/etoile_ui/home/home.gd" id="1_el760"] +[ext_resource type="Script" uid="uid://3xnmxp8tvamy" path="res://core/systems/state/state_watcher.gd" id="2_w07hl"] +[ext_resource type="Resource" uid="uid://oaavalv0wcoa" path="res://assets/state/states/home.tres" id="3_3d0ep"] +[ext_resource type="Script" uid="uid://boeu2ttk342x8" path="res://core/ui/components/input_icon.gd" id="4_olk2v"] +[ext_resource type="LabelSettings" uid="uid://b1jl2mkmbimnx" path="res://assets/label/section_label.tres" id="6_8p0du"] +[ext_resource type="Script" uid="uid://dnstdemqvqcji" path="res://core/ui/etoile_ui/components/carousel.gd" id="9_03p2x"] +[ext_resource type="PackedScene" uid="uid://c8pvsi1u00sol" path="res://core/ui/etoile_ui/components/game_tile.tscn" id="10_o3mca"] + +[node name="Home" type="Control" unique_id=1510548768] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +script = ExtResource("1_el760") + +[node name="StateWatcher" type="Node" parent="." unique_id=1880982139] +script = ExtResource("2_w07hl") +state = ExtResource("3_3d0ep") +metadata/_custom_type_script = "uid://3xnmxp8tvamy" + +[node name="Control" type="Control" parent="." unique_id=589891841] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="Control" unique_id=1747353238] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +alignment = 1 + +[node name="CollectionsContainer" type="MarginContainer" parent="Control/VBoxContainer" unique_id=1528396398] +unique_name_in_owner = true +layout_mode = 2 +theme_override_constants/margin_left = 20 + +[node name="HBoxContainer" type="HBoxContainer" parent="Control/VBoxContainer/CollectionsContainer" unique_id=1966168950] +layout_mode = 2 + +[node name="InputIcon" type="HBoxContainer" parent="Control/VBoxContainer/CollectionsContainer/HBoxContainer" unique_id=306286979] +layout_mode = 2 +script = ExtResource("4_olk2v") +path = "ui_up" +metadata/_custom_type_script = "uid://boeu2ttk342x8" + +[node name="Label" type="Label" parent="Control/VBoxContainer/CollectionsContainer/HBoxContainer" unique_id=1641804779] +layout_mode = 2 +text = "Collections" + +[node name="CarouselMarginContainer" type="MarginContainer" parent="Control/VBoxContainer" unique_id=1301663203] +layout_mode = 2 +theme_override_constants/margin_left = 20 +theme_override_constants/margin_right = 20 + +[node name="CarouselContainer" type="Container" parent="Control/VBoxContainer/CarouselMarginContainer" unique_id=436709997] +unique_name_in_owner = true +custom_minimum_size = Vector2(0, 234) +layout_mode = 2 +script = ExtResource("9_03p2x") +text_settings = ExtResource("6_8p0du") +duration = 0.1 +metadata/_custom_type_script = "uid://dnstdemqvqcji" + +[node name="LibraryTile" parent="Control/VBoxContainer/CarouselMarginContainer/CarouselContainer" unique_id=1852366416 instance=ExtResource("10_o3mca")] +unique_name_in_owner = true +layout_mode = 2 +is_library_tile = true +show_label = true +text = "Library" + +[node name="DetailsContainer" type="MarginContainer" parent="Control/VBoxContainer" unique_id=219220333] +unique_name_in_owner = true +layout_mode = 2 +theme_override_constants/margin_left = 20 + +[node name="HBoxContainer" type="HBoxContainer" parent="Control/VBoxContainer/DetailsContainer" unique_id=1023029768] +layout_mode = 2 + +[node name="InputIcon" type="HBoxContainer" parent="Control/VBoxContainer/DetailsContainer/HBoxContainer" unique_id=1629357606] +layout_mode = 2 +script = ExtResource("4_olk2v") +path = "ui_down" +metadata/_custom_type_script = "uid://boeu2ttk342x8" + +[node name="Label" type="Label" parent="Control/VBoxContainer/DetailsContainer/HBoxContainer" unique_id=599672810] +layout_mode = 2 +text = "More Details" diff --git a/core/ui/etoile_ui/launch/game_details.gd b/core/ui/etoile_ui/launch/game_details.gd new file mode 100644 index 000000000..d278a0fa3 --- /dev/null +++ b/core/ui/etoile_ui/launch/game_details.gd @@ -0,0 +1,145 @@ +extends Control + +var boxart_manager := preload("res://core/global/boxart_manager.tres") as BoxArtManager +var metadata_manager := preload("res://core/systems/metadata/metadata_manager.tres") as MetadataManager +var launch_manager := preload("res://core/global/launch_manager.tres") as LaunchManager +var install_manager := preload("res://core/global/install_manager.tres") as InstallManager +var settings_manager := preload("res://core/global/settings_manager.tres") as SettingsManager + +var tween: Tween +var state_machine := preload("res://assets/state/state_machines/menu_state_machine.tres") as StateMachine +var popup_state_machine := preload("res://assets/state/state_machines/popup_state_machine.tres") as StateMachine +var state := preload("res://assets/state/states/game_launcher.tres") as State +var game_settings_state := preload("res://assets/state/states/game_settings.tres") as State +var in_game_state := preload("res://assets/state/states/in_game.tres") as State + + +@onready var logo := %Logo as TextureRect +@onready var launch_button := %LaunchButton as ComponentButton +@onready var manage_button := %ManageButton as ComponentButton +@onready var links_button := %LinksButton as ComponentButton +@onready var uninstall_button := %UninstallButton as ComponentButton +@onready var description_label := %Description as Label + + +func _ready() -> void: + state.state_entered.connect(_on_state_entered) + state.state_exited.connect(_on_state_exited) + state.refreshed.connect(_on_state_refreshed) + launch_button.button_up.connect(_on_launch_pressed) + manage_button.button_up.connect(_on_manage_pressed) + + +# Show the game details on state entered +func _on_state_entered(_from: State) -> void: + self.visible = true + var tree := get_tree() + if not tree: + return + if tween: + tween.kill() + tween = tree.create_tween() + tween.set_ease(Tween.EASE_IN_OUT) + tween.tween_property(self, "size_flags_stretch_ratio", 2.0, 0.5) + launch_button.grab_focus.call_deferred() + + +# Hide the game details on state exit +func _on_state_exited(_to: State) -> void: + var tree := get_tree() + if not tree: + return + if tween: + tween.kill() + tween = tree.create_tween() + tween.set_ease(Tween.EASE_IN_OUT) + tween.tween_property(self, "size_flags_stretch_ratio", 0.0, 0.5) + var on_finished := func() -> void: + self.visible = false + tween.finished.connect(on_finished, CONNECT_ONE_SHOT) + + +# Update the details page if the state is refreshed +func _on_state_refreshed() -> void: + if not state.has_meta("library_item"): + return + var library_item := state.get_meta("library_item") as LibraryItem + var texture := await boxart_manager.get_boxart_or_placeholder(library_item, BoxArtProvider.LAYOUT.LOGO) + logo.texture = texture + var summary := await metadata_manager.get_summary(library_item) + description_label.text = summary + _update_menu_with_library_item(library_item) + + +# Lookup the current launch provider for the library item +func _get_launch_item(library_item: LibraryItem) -> LibraryLaunchItem: + var launch_item := library_item.launch_items[0] as LibraryLaunchItem + var section := "game.{0}".format([library_item.name.to_lower()]) + var provider_id := settings_manager.get_value(section, "provider", "") as String + if provider_id != "": + var possible_launch_item := library_item.get_launch_item(provider_id) + if possible_launch_item != null: + launch_item = possible_launch_item + + return launch_item + + +# Update the launch button and other elements based on the state +func _update_menu_with_library_item(library_item: LibraryItem) -> void: + var launch_item := _get_launch_item(library_item) + if not launch_item: + return + uninstall_button.visible = launch_item.installed + if launch_item.installed: + launch_button.text = tr("Play Now") + else: + launch_button.text = tr("Install") + if launch_manager.is_running(launch_item.name): + launch_button.text = tr("Resume") + if install_manager.is_queued(launch_item): + launch_button.text = tr("Queued") + if install_manager.is_installing(launch_item): + launch_button.text = tr("Installing") + + +func _on_launch_pressed() -> void: + if not state.has_meta("library_item"): + return + var library_item := state.get_meta("library_item") as LibraryItem + var launch_item := _get_launch_item(library_item) + if launch_item.installed: + _launch_game(launch_item) + return + + +func _on_manage_pressed() -> void: + var library_item := state.get_meta("library_item") as LibraryItem + game_settings_state.set_meta("item", library_item) + popup_state_machine.push_state(game_settings_state) + + +func _launch_game(launch_item: LibraryLaunchItem) -> void: + # Resume if the game is running already + if launch_manager.is_running(launch_item.name): + state_machine.set_state([in_game_state]) + return + + # If the app isn't installed, install it. + if not launch_item.installed: + #_on_install() + return + + # Launch the game using launch manager + launch_manager.launch(launch_item) + + +func _input(event: InputEvent) -> void: + var focused_node := get_viewport().gui_get_focus_owner() + if focused_node and not self.is_ancestor_of(focused_node): + return + if state_machine.current_state() != state: + return + if event.is_action_pressed("ui_up") or event.is_action_released("ogui_back") or event.is_action_pressed("ui_cancel") or event.is_action_released("ogui_east"): + state_machine.pop_state() + get_viewport().set_input_as_handled() + return diff --git a/core/ui/etoile_ui/launch/game_details.gd.uid b/core/ui/etoile_ui/launch/game_details.gd.uid new file mode 100644 index 000000000..82424886c --- /dev/null +++ b/core/ui/etoile_ui/launch/game_details.gd.uid @@ -0,0 +1 @@ +uid://druyqash5wm0a diff --git a/core/ui/etoile_ui/launch/game_details.tscn b/core/ui/etoile_ui/launch/game_details.tscn new file mode 100644 index 000000000..a00f67f3e --- /dev/null +++ b/core/ui/etoile_ui/launch/game_details.tscn @@ -0,0 +1,94 @@ +[gd_scene format=3 uid="uid://b5l4udy1v8ua3"] + +[ext_resource type="Script" uid="uid://druyqash5wm0a" path="res://core/ui/etoile_ui/launch/game_details.gd" id="1_qddhj"] +[ext_resource type="Texture2D" uid="uid://djy4rejy21s6g" path="res://icon.svg" id="1_suqfk"] +[ext_resource type="PackedScene" uid="uid://8m20p2s0v5gb" path="res://core/systems/input/focus_group.tscn" id="3_8uro1"] +[ext_resource type="Script" uid="uid://ogqbbfs88xnr" path="res://core/ui/base/component_button.gd" id="4_on6i0"] + +[node name="GameDetails" type="Control" unique_id=91513726] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +script = ExtResource("1_qddhj") + +[node name="MarginContainer" type="MarginContainer" parent="." unique_id=635141094] +layout_mode = 1 +anchors_preset = 10 +anchor_right = 1.0 +offset_bottom = 366.0 +grow_horizontal = 2 +theme_override_constants/margin_left = 30 +theme_override_constants/margin_right = 30 + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer" unique_id=806158956] +layout_mode = 2 +size_flags_vertical = 8 +theme_override_constants/separation = 30 +alignment = 2 + +[node name="LogoContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer" unique_id=412753625] +layout_mode = 2 + +[node name="Logo" type="TextureRect" parent="MarginContainer/VBoxContainer/LogoContainer" unique_id=811295811] +unique_name_in_owner = true +custom_minimum_size = Vector2(0, 200) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 8 +texture = ExtResource("1_suqfk") +expand_mode = 1 +stretch_mode = 4 + +[node name="Spacer" type="Control" parent="MarginContainer/VBoxContainer/LogoContainer" unique_id=451632056] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="Description" type="Label" parent="MarginContainer/VBoxContainer" unique_id=806698345] +unique_name_in_owner = true +custom_minimum_size = Vector2(200, 0) +layout_mode = 2 +text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." +autowrap_mode = 3 + +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer" unique_id=1103534997] +layout_mode = 2 + +[node name="FocusGroup" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=1424842000 instance=ExtResource("3_8uro1")] + +[node name="LaunchButton" type="MarginContainer" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=796458150] +unique_name_in_owner = true +layout_mode = 2 +focus_mode = 2 +script = ExtResource("4_on6i0") +text = "Play" +metadata/_custom_type_script = "uid://ogqbbfs88xnr" + +[node name="ManageButton" type="MarginContainer" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=508423808] +unique_name_in_owner = true +layout_mode = 2 +focus_mode = 2 +script = ExtResource("4_on6i0") +text = "Manage" +metadata/_custom_type_script = "uid://ogqbbfs88xnr" + +[node name="LinksButton" type="MarginContainer" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=665443050] +unique_name_in_owner = true +visible = false +layout_mode = 2 +focus_mode = 2 +script = ExtResource("4_on6i0") +text = "Links" +metadata/_custom_type_script = "uid://ogqbbfs88xnr" + +[node name="UninstallButton" type="MarginContainer" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=837855716] +unique_name_in_owner = true +layout_mode = 2 +focus_mode = 2 +script = ExtResource("4_on6i0") +text = "Uninstall" +metadata/_custom_type_script = "uid://ogqbbfs88xnr" diff --git a/core/ui/etoile_ui/navigation/context_bar.gd b/core/ui/etoile_ui/navigation/context_bar.gd new file mode 100644 index 000000000..8c9441afe --- /dev/null +++ b/core/ui/etoile_ui/navigation/context_bar.gd @@ -0,0 +1,37 @@ +extends MarginContainer + +var launch_manager := preload("res://core/global/launch_manager.tres") as LaunchManager +var state_machine := preload("res://assets/state/state_machines/menu_state_machine.tres") as StateMachine +var game_details_state := preload("res://assets/state/states/game_launcher.tres") as State + +@onready var accept := %AcceptIcon as InputIcon +@onready var details := %DetailsIcon as InputIcon +@onready var back := %BackIcon as InputIcon +@onready var options := %OptionsIcon as InputIcon + + +func _ready() -> void: + get_viewport().gui_focus_changed.connect(_on_focus_changed) + + +func _on_focus_changed(node: Control) -> void: + if node is GameTile: + _on_game_tile_focused(node as GameTile) + return + if node is CardButton: + pass + + +func _on_game_tile_focused(tile: GameTile) -> void: + if tile.is_library_tile: + return + var library_item := tile.library_item + if not library_item: + accept.text = tr("Play Now") + details.text = tr("Details") + back.visible = state_machine.current_state() in [game_details_state] + options.visible = state_machine.current_state() in [] + return + + if launch_manager.is_running(library_item.name): + accept.text = tr("Resume") diff --git a/core/ui/etoile_ui/navigation/context_bar.gd.uid b/core/ui/etoile_ui/navigation/context_bar.gd.uid new file mode 100644 index 000000000..b3950d816 --- /dev/null +++ b/core/ui/etoile_ui/navigation/context_bar.gd.uid @@ -0,0 +1 @@ +uid://u7irxsllnduw diff --git a/core/ui/etoile_ui/navigation/context_bar.tscn b/core/ui/etoile_ui/navigation/context_bar.tscn new file mode 100644 index 000000000..f40cdd699 --- /dev/null +++ b/core/ui/etoile_ui/navigation/context_bar.tscn @@ -0,0 +1,55 @@ +[gd_scene load_steps=3 format=3 uid="uid://cdhh45htxfxnt"] + +[ext_resource type="Script" uid="uid://boeu2ttk342x8" path="res://core/ui/components/input_icon.gd" id="1_ifgqm"] +[ext_resource type="Script" uid="uid://u7irxsllnduw" path="res://core/ui/etoile_ui/navigation/context_bar.gd" id="1_tyqjr"] + +[node name="ContextBar" type="MarginContainer"] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_tyqjr") + +[node name="HBoxContainer" type="HBoxContainer" parent="."] +layout_mode = 2 +size_flags_horizontal = 0 + +[node name="InputIcon" type="HBoxContainer" parent="HBoxContainer"] +layout_mode = 2 +script = ExtResource("1_ifgqm") +text = "Quick Bar Menu" +path = "ogui_qb" + +[node name="HBoxContainer2" type="HBoxContainer" parent="."] +layout_mode = 2 +size_flags_horizontal = 8 + +[node name="AcceptIcon" type="HBoxContainer" parent="HBoxContainer2"] +unique_name_in_owner = true +layout_mode = 2 +script = ExtResource("1_ifgqm") +text = "Accept" +path = "ui_accept" + +[node name="DetailsIcon" type="HBoxContainer" parent="HBoxContainer2"] +unique_name_in_owner = true +layout_mode = 2 +script = ExtResource("1_ifgqm") +text = "Details" +path = "ogui_north" + +[node name="BackIcon" type="HBoxContainer" parent="HBoxContainer2"] +unique_name_in_owner = true +layout_mode = 2 +script = ExtResource("1_ifgqm") +text = "Back" +path = "ogui_east" + +[node name="OptionsIcon" type="HBoxContainer" parent="HBoxContainer2"] +unique_name_in_owner = true +visible = false +layout_mode = 2 +script = ExtResource("1_ifgqm") +text = "Options" +path = "ogui_options" diff --git a/core/ui/etoile_ui/navigation/status_bar.gd b/core/ui/etoile_ui/navigation/status_bar.gd new file mode 100644 index 000000000..acac5ab2b --- /dev/null +++ b/core/ui/etoile_ui/navigation/status_bar.gd @@ -0,0 +1,34 @@ +extends MarginContainer + +@onready var time_label: Label = $%TimeLabel + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + # Create a timer to update the time + var time_timer: Timer = Timer.new() + time_timer.timeout.connect(_on_update_time) + time_timer.autostart = true + add_child(time_timer) + _on_update_time() + + +# Updates the current time on timer timeout +func _on_update_time(): + # year, month, day, weekday, hour, minute, second + var time = Time.get_datetime_dict_from_system() + time_label.text = _format_time(time) + + +func _format_time(time: Dictionary) -> String: + time["meridium"] = "am" + if time["hour"] > 11: + time["meridium"] = "pm" + if time["hour"] > 12: + time["hour"] -= 12 + + # Pad our minutes and hours + time["minute"] = "%02d" % time["minute"] + time["hour"] = "%02d" % time["hour"] + + return "{hour}:{minute}{meridium}".format(time) diff --git a/core/ui/etoile_ui/navigation/status_bar.gd.uid b/core/ui/etoile_ui/navigation/status_bar.gd.uid new file mode 100644 index 000000000..b2e069b1c --- /dev/null +++ b/core/ui/etoile_ui/navigation/status_bar.gd.uid @@ -0,0 +1 @@ +uid://cf85qv0dtmpee diff --git a/core/ui/etoile_ui/navigation/status_bar.tscn b/core/ui/etoile_ui/navigation/status_bar.tscn new file mode 100644 index 000000000..11d81d1bb --- /dev/null +++ b/core/ui/etoile_ui/navigation/status_bar.tscn @@ -0,0 +1,51 @@ +[gd_scene format=3 uid="uid://b7uwwwrbvdu4g"] + +[ext_resource type="PackedScene" uid="uid://dcrx6jkhn0o7u" path="res://core/ui/components/battery_container.tscn" id="1_accj2"] +[ext_resource type="Script" uid="uid://cf85qv0dtmpee" path="res://core/ui/etoile_ui/navigation/status_bar.gd" id="1_ql0kp"] +[ext_resource type="LabelSettings" uid="uid://b1jl2mkmbimnx" path="res://assets/label/section_label.tres" id="2_vnx3e"] +[ext_resource type="PackedScene" uid="uid://cmrmkiugq0sgo" path="res://core/ui/etoile_ui/components/network_icon.tscn" id="3_3f1rh"] + +[node name="StatusBar" type="MarginContainer" unique_id=1202541875] +anchors_preset = 10 +anchor_right = 1.0 +offset_bottom = 34.0 +grow_horizontal = 2 +script = ExtResource("1_ql0kp") + +[node name="WorkspacesContainer" type="HBoxContainer" parent="." unique_id=1063399654] +layout_mode = 2 +size_flags_horizontal = 0 +alignment = 1 + +[node name="MenuNameLabel" type="Label" parent="WorkspacesContainer" unique_id=1906710864] +unique_name_in_owner = true +layout_mode = 2 +text = "Games" +label_settings = ExtResource("2_vnx3e") + +[node name="TimeContainer" type="HBoxContainer" parent="." unique_id=433578928] +layout_mode = 2 +alignment = 1 + +[node name="TimeLabel" type="Label" parent="TimeContainer" unique_id=797097163] +unique_name_in_owner = true +layout_mode = 2 +text = "12:00AM" +label_settings = ExtResource("2_vnx3e") +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="IconContainer" type="HBoxContainer" parent="." unique_id=1738230975] +layout_mode = 2 +size_flags_horizontal = 8 +alignment = 2 + +[node name="NetworkIcon" parent="IconContainer" unique_id=249467718 instance=ExtResource("3_3f1rh")] +custom_minimum_size = Vector2(24, 24) +layout_mode = 2 +expand_mode = 1 +stretch_mode = 5 + +[node name="BatteryContainer" parent="IconContainer" unique_id=407721435 instance=ExtResource("1_accj2")] +unique_name_in_owner = true +layout_mode = 2 diff --git a/core/ui/etoile_ui/quick_bar/quick_bar_menu.gd b/core/ui/etoile_ui/quick_bar/quick_bar_menu.gd new file mode 100644 index 000000000..3941bda49 --- /dev/null +++ b/core/ui/etoile_ui/quick_bar/quick_bar_menu.gd @@ -0,0 +1,160 @@ +extends Control + +var launch_manager := preload("res://core/global/launch_manager.tres") as LaunchManager +var state_machine := preload("res://assets/state/state_machines/global_state_machine.tres") as StateMachine +var popup_state_machine := preload("res://assets/state/state_machines/popup_state_machine.tres") as StateMachine +var quick_bar_state_machine := preload("res://assets/state/state_machines/quick_bar_state_machine.tres") as StateMachine +var quick_bar_menu_state := preload("res://assets/state/states/quick_bar_menu.tres") as State +var gamepad_settings_state := preload("res://assets/state/states/gamepad_settings.tres") as State + +var audio_manager := preload("res://core/global/audio_manager.tres") as AudioManager +var display_manager := preload("res://core/global/display_manager.tres") as DisplayManager + +@onready var glass_rect := %GlassPanel +@onready var focus_group := %FocusGroup as FocusGroup +@onready var notifications_button := %NotificationsButton as CollapsibleButton +@onready var exit_button := %ExitGameButton as CollapsibleButton +@onready var network_button := %NetworkButton as CollapsibleButton +@onready var bluetooth_button := %BluetoothButton as CollapsibleButton +@onready var performance_button := %PerformanceButton as CollapsibleButton +@onready var overlay_button := %OverlayButton as CollapsibleButton +@onready var controllers_button := %ControllersButton as CollapsibleButton +@onready var back_button := %BackButton as CollapsibleButton + +@onready var menu := %MainContainer as Control +@onready var menu_label := %MenuLabel as Label +@onready var sub_menu := %SubMenuContainer as Control +@onready var sub_menu_content := %SubMenuContentContainer as Control +@onready var performance_menu := %Performance as Control +@onready var network_menu := %NetworkSettings as Control +@onready var bluetooth_menu := %BluetoothSettingsMenu as Control +@onready var notifications_menu := %NotificationMenu as Control + +@onready var volume_slider := %VolumeSlider as ComponentSlider +@onready var brightness_slider := %BrightnessSlider as ComponentSlider + +func _ready() -> void: + quick_bar_menu_state.state_entered.connect(_on_state_entered) + quick_bar_menu_state.state_exited.connect(_on_state_exited) + launch_manager.app_launched.connect(_on_app_launched) + launch_manager.app_stopped.connect(_on_app_stopped) + notifications_button.button_up.connect(_on_submenu_switch.bind(notifications_menu)) + network_button.button_up.connect(_on_submenu_switch.bind(network_menu)) + bluetooth_button.button_up.connect(_on_submenu_switch.bind(bluetooth_menu)) + performance_button.button_up.connect(_on_submenu_switch.bind(performance_menu)) + controllers_button.player_button_up.connect(_on_controllers_button_pressed) + back_button.button_up.connect(_on_back_button_pressed) + + # Flip back button texture + var back_texture := back_button.get_node("%Icon") as TextureRect + back_texture.flip_h = true + + # Connect volume slider + volume_slider.value_changed.connect(_on_volume_changed) + audio_manager.volume_changed.connect(_on_volume_changed_from_manager) + + # Connect brightness slider + brightness_slider.value_changed.connect(_on_brightness_changed) + if display_manager.supports_brightness(): + var backlights := display_manager.get_backlight_paths() + if backlights.size() > 0: + brightness_slider.value = display_manager.get_brightness(backlights[0]) * 100 + else: + brightness_slider.visible = false + else: + brightness_slider.visible = false + + +func _on_state_entered(_from: State) -> void: + if focus_group: + focus_group.grab_focus() + + +func _on_state_exited(_to: State) -> void: + sub_menu.visible = false + menu.visible = true + + +func _on_app_launched(_app: RunningApp) -> void: + exit_button.visible = true + + +func _on_app_stopped(_app: RunningApp) -> void: + if launch_manager.get_running().is_empty(): + exit_button.visible = false + + +func _on_submenu_switch(menu_to_switch_to: Control) -> void: + for child in sub_menu_content.get_children(): + child.visible = false + sub_menu.visible = true + menu_to_switch_to.visible = true + menu.visible = false + menu_label.text = "" + + # Update the label based on the submenu + # TODO: Derive the name from the node name instead + var menu_name := menu_to_switch_to.name + match menu_name: + "Performance": + menu_label.text = tr("Performance") + "NetworkSettings": + menu_label.text = tr("Network") + "BluetoothSettingsMenu": + menu_label.text = tr("Bluetooth") + "NotificationsMenu": + menu_label.text = tr("Notifications") + + var focusable := FocusGroup.find_focusable([menu_to_switch_to]) + if focusable: + focusable.grab_focus.call_deferred() + + +func _on_controllers_button_pressed() -> void: + popup_state_machine.push_state(gamepad_settings_state) + + +func _on_volume_changed(value: float) -> void: + if not audio_manager.supports_audio(): + return + # Convert slider value (0-100) to volume (0.0-1.0) and set + var volume := value * 0.01 + audio_manager.set_volume(volume) + + +func _on_brightness_changed(value: float) -> void: + if not display_manager.supports_brightness(): + return + # Convert slider value (0-100) to brightness (0.0-1.0) and set + var brightness := value * 0.01 + # Get the first backlight path + var backlights := display_manager.get_backlight_paths() + if backlights.size() > 0: + display_manager.set_brightness(brightness, DisplayManager.VALUE.ABSOLUTE, backlights[0]) + + +func _on_volume_changed_from_manager(value: float) -> void: + if not audio_manager.supports_audio(): + return + volume_slider.value = value * 100 + + +func _on_back_button_pressed() -> void: + sub_menu.visible = false + menu.visible = true + var focusable := FocusGroup.find_focusable([menu]) + if focusable: + focusable.grab_focus.call_deferred() + + +func _input(event: InputEvent) -> void: + if state_machine.current_state() != quick_bar_menu_state: + return + if event.is_action_released("ogui_back") or event.is_action_released("ogui_east"): + _on_back_button_pressed() + get_viewport().set_input_as_handled() + return + if event.is_action_released("ogui_back") or event.is_action_released("ogui_east"): + _on_back_button_pressed() + get_viewport().set_input_as_handled() + return diff --git a/core/ui/etoile_ui/quick_bar/quick_bar_menu.gd.uid b/core/ui/etoile_ui/quick_bar/quick_bar_menu.gd.uid new file mode 100644 index 000000000..ecbe874dc --- /dev/null +++ b/core/ui/etoile_ui/quick_bar/quick_bar_menu.gd.uid @@ -0,0 +1 @@ +uid://bf2icpo61p57r diff --git a/core/ui/etoile_ui/quick_bar/quick_bar_menu.tscn b/core/ui/etoile_ui/quick_bar/quick_bar_menu.tscn new file mode 100644 index 000000000..c87453026 --- /dev/null +++ b/core/ui/etoile_ui/quick_bar/quick_bar_menu.tscn @@ -0,0 +1,377 @@ +[gd_scene format=3 uid="uid://djwhelsduv5cm"] + +[ext_resource type="Script" uid="uid://bf2icpo61p57r" path="res://core/ui/etoile_ui/quick_bar/quick_bar_menu.gd" id="1_bf2t0"] +[ext_resource type="PackedScene" uid="uid://shvyhrv5sx3v" path="res://core/systems/state/state_watcher.tscn" id="2_7nyoc"] +[ext_resource type="PackedScene" uid="uid://c7mcv58e8gto4" path="res://core/ui/etoile_ui/components/glass_panel.tscn" id="2_nejlc"] +[ext_resource type="PackedScene" uid="uid://8m20p2s0v5gb" path="res://core/systems/input/focus_group.tscn" id="3_5qs52"] +[ext_resource type="Resource" uid="uid://bp807nlks8eq1" path="res://assets/state/states/quick_bar_menu.tres" id="3_eeplw"] +[ext_resource type="PackedScene" uid="uid://bw8113ocotx2r" path="res://core/systems/effects/fade_effect.tscn" id="4_imsdn"] +[ext_resource type="PackedScene" uid="uid://c6fg6uvng0ovi" path="res://core/systems/input/input_watcher.tscn" id="6_eeplw"] +[ext_resource type="Script" uid="uid://c538myb3wjkad" path="res://core/systems/input/keyboard_opener.gd" id="7_aq7ju"] +[ext_resource type="Texture2D" uid="uid://dq32os2qn6atc" path="res://assets/ui/icons/help.svg" id="8_g8ygh"] +[ext_resource type="PackedScene" uid="uid://b76dvfuouhlwd" path="res://core/systems/state/state_updater.tscn" id="9_7nyoc"] +[ext_resource type="Resource" uid="uid://cadriyl38ny5y" path="res://assets/state/state_machines/popup_state_machine.tres" id="10_eeplw"] +[ext_resource type="Resource" uid="uid://db5gbdl3xgwlq" path="res://assets/state/states/help_menu.tres" id="11_imsdn"] +[ext_resource type="Texture2D" uid="uid://bdjnwtumim20t" path="res://assets/ui/icons/material-symbols--settings-outline-rounded.svg" id="11_tyc72"] +[ext_resource type="Texture2D" uid="uid://ciwqk2qmmp2cf" path="res://assets/ui/icons/material-symbols--keyboard-outline-rounded.svg" id="13_tyc72"] +[ext_resource type="Resource" uid="uid://d3gp85f35oiw6" path="res://assets/state/states/settings.tres" id="17_tyc72"] +[ext_resource type="Resource" uid="uid://dpc1o781f43ef" path="res://core/ui/card_ui/quick_bar/quick_bar_menu_focus.tres" id="18_0b7mq"] +[ext_resource type="Texture2D" uid="uid://bgx8rpwfi1re4" path="res://assets/ui/icons/round-power-settings-new.svg" id="20_rpfsb"] +[ext_resource type="Texture2D" uid="uid://dmcbtniaek0of" path="res://assets/ui/icons/material-symbols--exit-to-app-rounded.svg" id="20_tyc72"] +[ext_resource type="Resource" uid="uid://bw0mtk7sso8m2" path="res://assets/state/states/power_menu.tres" id="21_ghcyy"] +[ext_resource type="Texture2D" uid="uid://bjtfbt8wnillp" path="res://assets/ui/icons/material-symbols--notifications-outline-rounded.svg" id="21_tyc72"] +[ext_resource type="Script" uid="uid://bldssymap3bh2" path="res://core/ui/base/component_slider.gd" id="22_lrbss"] +[ext_resource type="PackedScene" uid="uid://btrem65c8687w" path="res://core/ui/etoile_ui/components/collapsible_button.tscn" id="23_ya0sn"] +[ext_resource type="Texture2D" uid="uid://bmp372vmsk41d" path="res://assets/ui/icons/material-symbols--bluetooth.svg" id="26_tyc72"] +[ext_resource type="Texture2D" uid="uid://dty1fb5nkj3ni" path="res://assets/ui/icons/wifi-high.svg" id="26_ya0sn"] +[ext_resource type="Texture2D" uid="uid://iuraatp10cjd" path="res://assets/ui/icons/material-symbols--speed-outline-rounded.svg" id="27_tyc72"] +[ext_resource type="Texture2D" uid="uid://bbqtqi6j68uwf" path="res://assets/ui/icons/material-symbols--picture-in-picture-outline-rounded.svg" id="28_tyc72"] +[ext_resource type="Texture2D" uid="uid://dx6rnad4lmct0" path="res://assets/ui/icons/material-symbols--gamepad-outline-rounded.svg" id="29_tyc72"] +[ext_resource type="Texture2D" uid="uid://dj7wg0qnevawx" path="res://assets/ui/icons/material-symbols--chevron-right-rounded.svg" id="30_ghcyy"] +[ext_resource type="PackedScene" uid="uid://cpss2bhdwm8t7" path="res://core/ui/common/settings/network_settings_menu.tscn" id="32_ghcyy"] +[ext_resource type="PackedScene" uid="uid://bn1j2yde6jp73" path="res://core/ui/common/notification/notification_menu.tscn" id="32_j86gm"] +[ext_resource type="PackedScene" uid="uid://dv3dt0j3jketh" path="res://core/ui/common/quick_bar/performance_menu.tscn" id="32_lrbss"] +[ext_resource type="PackedScene" uid="uid://6ygxdkvh1hib" path="res://core/ui/card_ui/settings/bluetooth_settings_menu.tscn" id="33_ghcyy"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_rpfsb"] +bg_color = Color(0, 0, 0, 0.5) +corner_radius_top_left = 12 +corner_radius_top_right = 12 +corner_radius_bottom_right = 12 +corner_radius_bottom_left = 12 + +[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_ghcyy"] +load_path = "res://.godot/imported/volume-high.svg-65e6e6c3f52ba0fd57f3db189e15ee74.ctex" + +[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_j86gm"] +load_path = "res://.godot/imported/status-active.svg-750c0b790b84fd0e45c3ac19af5465ff.ctex" + +[node name="QuickBarMenu" type="MarginContainer" unique_id=144390319] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_bf2t0") + +[node name="StateWatcher" parent="." unique_id=84377206 instance=ExtResource("2_7nyoc")] +state = ExtResource("3_eeplw") + +[node name="FadeEffect" parent="StateWatcher" unique_id=294868628 node_paths=PackedStringArray("target") instance=ExtResource("4_imsdn")] +target = NodePath("../..") +fade_speed = 0.15 +on_signal = "state_entered" +fade_out_signal = "state_exited" +on_signal = "state_entered" + +[node name="InputWatcher" parent="." unique_id=869951880 instance=ExtResource("6_eeplw")] +stop_propagation = true +action = "ogui_east" + +[node name="StateUpdater" parent="InputWatcher" unique_id=145718381 instance=ExtResource("9_7nyoc")] +state_machine = ExtResource("10_eeplw") +action = 2 +on_signal = "input_released" + +[node name="GlassPanel" parent="." unique_id=2005112249 instance=ExtResource("2_nejlc")] +unique_name_in_owner = true +layout_mode = 2 +shape_type = "Rectangle" +corner_radius_top_left = 20.0 +corner_radius_top_right = 20.0 +corner_radius_bottom_left = 20.0 +corner_radius_bottom_right = 20.0 +circle_radius = 100.0 +outline_enabled = false +outline_width = 2.0 +outline_color = Color(1, 1, 1, 0.8) +shadow_enabled = true +shadow_color = Color(0, 0, 0, 0.5) +shadow_offset = Vector2(10, 10) +edge_softness = 1.0 +shape_color = Color(0, 0, 0, 1) +color_gradient_x = 0.0 +color_gradient_y = 0.0 +color_multiplier = 0.9 +glass_opacity = 0.4 + +[node name="MainContainer" type="MarginContainer" parent="." unique_id=661645641] +unique_name_in_owner = true +layout_mode = 2 +theme_override_constants/margin_left = 24 +theme_override_constants/margin_top = 24 +theme_override_constants/margin_right = 24 +theme_override_constants/margin_bottom = 24 + +[node name="VBoxContainer" type="VBoxContainer" parent="MainContainer" unique_id=269576084] +layout_mode = 2 + +[node name="ButtonContainer" type="HBoxContainer" parent="MainContainer/VBoxContainer" unique_id=927619013] +layout_mode = 2 + +[node name="FocusGroup" parent="MainContainer/VBoxContainer/ButtonContainer" unique_id=1355389031 node_paths=PackedStringArray("focus_neighbor_bottom") instance=ExtResource("3_5qs52")] +back_action = "" +focus_neighbor_bottom = NodePath("../../QuickVBoxContainer/VBoxContainer/FocusGroup") + +[node name="SettingsButton" parent="MainContainer/VBoxContainer/ButtonContainer" unique_id=1913875459 instance=ExtResource("23_ya0sn")] +layout_mode = 2 +icon_texture = ExtResource("11_tyc72") +color = Color(0, 0, 0, 0.5) + +[node name="StateUpdater" parent="MainContainer/VBoxContainer/ButtonContainer/SettingsButton" unique_id=2032943857 instance=ExtResource("9_7nyoc")] +state_machine = ExtResource("10_eeplw") +state = ExtResource("17_tyc72") +on_signal = "button_up" + +[node name="KeyboardButton" parent="MainContainer/VBoxContainer/ButtonContainer" unique_id=1774688916 instance=ExtResource("23_ya0sn")] +layout_mode = 2 +icon_texture = ExtResource("13_tyc72") + +[node name="KeyboardOpener" type="Node" parent="MainContainer/VBoxContainer/ButtonContainer/KeyboardButton" unique_id=2061925767] +script = ExtResource("7_aq7ju") +on_signal = "button_up" + +[node name="HelpButton" parent="MainContainer/VBoxContainer/ButtonContainer" unique_id=1191674271 instance=ExtResource("23_ya0sn")] +visible = false +layout_mode = 2 +icon_texture = ExtResource("8_g8ygh") + +[node name="StateUpdater" parent="MainContainer/VBoxContainer/ButtonContainer/HelpButton" unique_id=925844422 instance=ExtResource("9_7nyoc")] +state_machine = ExtResource("10_eeplw") +state = ExtResource("11_imsdn") +on_signal = "button_up" + +[node name="Spacer" type="Control" parent="MainContainer/VBoxContainer/ButtonContainer" unique_id=1093384134] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="PowerButton" parent="MainContainer/VBoxContainer/ButtonContainer" unique_id=1133527970 instance=ExtResource("23_ya0sn")] +layout_mode = 2 +icon_texture = ExtResource("20_rpfsb") +color = Color(0.8001019, 0, 0, 0.5) + +[node name="StateUpdater" parent="MainContainer/VBoxContainer/ButtonContainer/PowerButton" unique_id=1864328193 instance=ExtResource("9_7nyoc")] +state_machine = ExtResource("10_eeplw") +state = ExtResource("21_ghcyy") +on_signal = "button_up" + +[node name="Spacer" type="Control" parent="MainContainer/VBoxContainer" unique_id=2796884] +custom_minimum_size = Vector2(0, 20) +layout_mode = 2 + +[node name="QuickVBoxContainer" type="VBoxContainer" parent="MainContainer/VBoxContainer" unique_id=1864352043] +layout_mode = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="MainContainer/VBoxContainer/QuickVBoxContainer" unique_id=2090268693] +layout_mode = 2 + +[node name="FocusGroup" parent="MainContainer/VBoxContainer/QuickVBoxContainer/VBoxContainer" unique_id=1416614521 node_paths=PackedStringArray("focus_neighbor_bottom", "focus_neighbor_top") instance=ExtResource("3_5qs52")] +unique_name_in_owner = true +focus_stack = ExtResource("18_0b7mq") +back_action = "" +wrap_focus = false +focus_neighbor_bottom = NodePath("../../GridContainer/FocusGroup") +focus_neighbor_top = NodePath("../../../ButtonContainer/FocusGroup") + +[node name="ExitGameButton" parent="MainContainer/VBoxContainer/QuickVBoxContainer/VBoxContainer" unique_id=1015749496 instance=ExtResource("23_ya0sn")] +unique_name_in_owner = true +visible = false +layout_mode = 2 +icon_texture = ExtResource("20_tyc72") +text = "Exit Game" +color = Color(0.8, 0, 0, 0.5019608) + +[node name="NotificationsButton" parent="MainContainer/VBoxContainer/QuickVBoxContainer/VBoxContainer" unique_id=1977129288 instance=ExtResource("23_ya0sn")] +unique_name_in_owner = true +layout_mode = 2 +icon_texture = ExtResource("21_tyc72") +text = "Notifications" +expandable = true +color = Color(0, 0, 0, 0.5) + +[node name="VolumeContainer" type="PanelContainer" parent="MainContainer/VBoxContainer/QuickVBoxContainer/VBoxContainer" unique_id=140792188] +layout_mode = 2 +theme_override_styles/panel = SubResource("StyleBoxFlat_rpfsb") + +[node name="MarginContainer" type="MarginContainer" parent="MainContainer/VBoxContainer/QuickVBoxContainer/VBoxContainer/VolumeContainer" unique_id=1357008629] +layout_mode = 2 +theme_override_constants/margin_left = 10 +theme_override_constants/margin_top = 10 +theme_override_constants/margin_right = 10 +theme_override_constants/margin_bottom = 10 + +[node name="HBoxContainer" type="HBoxContainer" parent="MainContainer/VBoxContainer/QuickVBoxContainer/VBoxContainer/VolumeContainer/MarginContainer" unique_id=1354865390] +layout_mode = 2 + +[node name="TextureRect" type="TextureRect" parent="MainContainer/VBoxContainer/QuickVBoxContainer/VBoxContainer/VolumeContainer/MarginContainer/HBoxContainer" unique_id=1259434566] +custom_minimum_size = Vector2(24, 0) +layout_mode = 2 +texture = SubResource("CompressedTexture2D_ghcyy") +expand_mode = 1 +stretch_mode = 3 + +[node name="VolumeSlider" type="MarginContainer" parent="MainContainer/VBoxContainer/QuickVBoxContainer/VBoxContainer/VolumeContainer/MarginContainer/HBoxContainer" unique_id=576088553] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +focus_mode = 2 +script = ExtResource("22_lrbss") +step = 3.0 +show_label = false +metadata/_custom_type_script = "uid://bldssymap3bh2" + +[node name="BrightnessContainer" type="PanelContainer" parent="MainContainer/VBoxContainer/QuickVBoxContainer/VBoxContainer" unique_id=1453662974] +layout_mode = 2 +theme_override_styles/panel = SubResource("StyleBoxFlat_rpfsb") + +[node name="MarginContainer" type="MarginContainer" parent="MainContainer/VBoxContainer/QuickVBoxContainer/VBoxContainer/BrightnessContainer" unique_id=315476820] +layout_mode = 2 +theme_override_constants/margin_left = 10 +theme_override_constants/margin_top = 10 +theme_override_constants/margin_right = 10 +theme_override_constants/margin_bottom = 10 + +[node name="HBoxContainer" type="HBoxContainer" parent="MainContainer/VBoxContainer/QuickVBoxContainer/VBoxContainer/BrightnessContainer/MarginContainer" unique_id=168137224] +layout_mode = 2 + +[node name="TextureRect" type="TextureRect" parent="MainContainer/VBoxContainer/QuickVBoxContainer/VBoxContainer/BrightnessContainer/MarginContainer/HBoxContainer" unique_id=2125542627] +custom_minimum_size = Vector2(24, 0) +layout_mode = 2 +texture = SubResource("CompressedTexture2D_j86gm") +expand_mode = 1 +stretch_mode = 5 + +[node name="BrightnessSlider" type="MarginContainer" parent="MainContainer/VBoxContainer/QuickVBoxContainer/VBoxContainer/BrightnessContainer/MarginContainer/HBoxContainer" unique_id=1671685859] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +focus_mode = 2 +script = ExtResource("22_lrbss") +step = 3.0 +show_label = false +metadata/_custom_type_script = "uid://bldssymap3bh2" + +[node name="GridContainer" type="GridContainer" parent="MainContainer/VBoxContainer/QuickVBoxContainer" unique_id=1511935686] +layout_mode = 2 +columns = 2 + +[node name="FocusGroup" parent="MainContainer/VBoxContainer/QuickVBoxContainer/GridContainer" unique_id=34181148 node_paths=PackedStringArray("focus_neighbor_top") instance=ExtResource("3_5qs52")] +focus_stack = ExtResource("18_0b7mq") +back_action = "" +wrap_focus = false +focus_neighbor_top = NodePath("../../VBoxContainer/FocusGroup") + +[node name="NetworkButton" parent="MainContainer/VBoxContainer/QuickVBoxContainer/GridContainer" unique_id=124915966 instance=ExtResource("23_ya0sn")] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +icon_texture = ExtResource("26_ya0sn") +text = "Network" +expandable = true +color = Color(0, 0, 0, 0.5) + +[node name="BluetoothButton" parent="MainContainer/VBoxContainer/QuickVBoxContainer/GridContainer" unique_id=2145148437 instance=ExtResource("23_ya0sn")] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +icon_texture = ExtResource("26_tyc72") +text = "Bluetooth" +expandable = true +color = Color(0, 0, 0, 0.5) + +[node name="PerformanceButton" parent="MainContainer/VBoxContainer/QuickVBoxContainer/GridContainer" unique_id=695134273 instance=ExtResource("23_ya0sn")] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +icon_texture = ExtResource("27_tyc72") +text = "Performance" +expandable = true +color = Color(0, 0, 0, 0.5) + +[node name="OverlayButton" parent="MainContainer/VBoxContainer/QuickVBoxContainer/GridContainer" unique_id=638110440 instance=ExtResource("23_ya0sn")] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +icon_texture = ExtResource("28_tyc72") +text = "Overlay" +expandable = true +color = Color(0, 0, 0, 0.5) + +[node name="ControllersButton" parent="MainContainer/VBoxContainer/QuickVBoxContainer/GridContainer" unique_id=1125671800 instance=ExtResource("23_ya0sn")] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +icon_texture = ExtResource("29_tyc72") +text = "Controllers" +expandable = true +color = Color(0, 0, 0, 0.5) + +[node name="SubMenuContainer" type="MarginContainer" parent="." unique_id=2044422490] +unique_name_in_owner = true +visible = false +layout_mode = 2 +theme_override_constants/margin_top = 24 +theme_override_constants/margin_bottom = 24 + +[node name="VBoxContainer" type="VBoxContainer" parent="SubMenuContainer" unique_id=873123810] +layout_mode = 2 + +[node name="MarginContainer" type="MarginContainer" parent="SubMenuContainer/VBoxContainer" unique_id=738895895] +layout_mode = 2 +theme_override_constants/margin_left = 24 +theme_override_constants/margin_right = 24 + +[node name="HBoxContainer" type="HBoxContainer" parent="SubMenuContainer/VBoxContainer/MarginContainer" unique_id=1439968106] +layout_mode = 2 + +[node name="FocusGroup" parent="SubMenuContainer/VBoxContainer/MarginContainer/HBoxContainer" unique_id=1248419227 instance=ExtResource("3_5qs52")] + +[node name="BackButton" parent="SubMenuContainer/VBoxContainer/MarginContainer/HBoxContainer" unique_id=910146816 instance=ExtResource("23_ya0sn")] +unique_name_in_owner = true +layout_mode = 2 +icon_texture = ExtResource("30_ghcyy") +color = Color(0, 0, 0, 0.5) + +[node name="MenuLabel" type="Label" parent="SubMenuContainer/VBoxContainer/MarginContainer/HBoxContainer" unique_id=1926166771] +unique_name_in_owner = true +layout_mode = 2 +text = "Performance Settings" + +[node name="ScrollContainer" type="ScrollContainer" parent="SubMenuContainer/VBoxContainer" unique_id=1383367833] +layout_mode = 2 +size_flags_vertical = 3 +follow_focus = true +draw_focus_border = true + +[node name="SubMenuContentContainer" type="MarginContainer" parent="SubMenuContainer/VBoxContainer/ScrollContainer" unique_id=1834791853] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +theme_override_constants/margin_left = 24 +theme_override_constants/margin_right = 24 + +[node name="Performance" parent="SubMenuContainer/VBoxContainer/ScrollContainer/SubMenuContentContainer" unique_id=984999276 instance=ExtResource("32_lrbss")] +unique_name_in_owner = true +visible = false +layout_mode = 2 + +[node name="FocusGroup" parent="SubMenuContainer/VBoxContainer/ScrollContainer/SubMenuContentContainer/Performance" index="0" unique_id=549046002 node_paths=PackedStringArray("focus_neighbor_top")] +focus_neighbor_top = NodePath("../../../../MarginContainer/HBoxContainer/FocusGroup") + +[node name="NetworkSettings" parent="SubMenuContainer/VBoxContainer/ScrollContainer/SubMenuContentContainer" unique_id=2050539442 instance=ExtResource("32_ghcyy")] +unique_name_in_owner = true +visible = false +layout_mode = 2 + +[node name="BluetoothSettingsMenu" parent="SubMenuContainer/VBoxContainer/ScrollContainer/SubMenuContentContainer" unique_id=1368248529 instance=ExtResource("33_ghcyy")] +unique_name_in_owner = true +visible = false +layout_mode = 2 + +[node name="NotificationMenu" parent="SubMenuContainer/VBoxContainer/ScrollContainer/SubMenuContentContainer" unique_id=353444083 instance=ExtResource("32_j86gm")] +unique_name_in_owner = true +visible = false +layout_mode = 2 + +[editable path="SubMenuContainer/VBoxContainer/ScrollContainer/SubMenuContentContainer/Performance"] diff --git a/core/ui/etoile_ui/settings/settings_menu.gd b/core/ui/etoile_ui/settings/settings_menu.gd new file mode 100644 index 000000000..2bea686f8 --- /dev/null +++ b/core/ui/etoile_ui/settings/settings_menu.gd @@ -0,0 +1,11 @@ +extends MarginContainer + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass diff --git a/core/ui/etoile_ui/settings/settings_menu.gd.uid b/core/ui/etoile_ui/settings/settings_menu.gd.uid new file mode 100644 index 000000000..b04125c87 --- /dev/null +++ b/core/ui/etoile_ui/settings/settings_menu.gd.uid @@ -0,0 +1 @@ +uid://boll57a03c0ic diff --git a/core/ui/etoile_ui/settings/settings_menu.tscn b/core/ui/etoile_ui/settings/settings_menu.tscn new file mode 100644 index 000000000..4e636480d --- /dev/null +++ b/core/ui/etoile_ui/settings/settings_menu.tscn @@ -0,0 +1,164 @@ +[gd_scene format=3 uid="uid://hvgh6cfm18jx"] + +[ext_resource type="Script" uid="uid://boll57a03c0ic" path="res://core/ui/etoile_ui/settings/settings_menu.gd" id="1_w0mdm"] +[ext_resource type="PackedScene" uid="uid://c6fg6uvng0ovi" path="res://core/systems/input/input_watcher.tscn" id="2_cefgi"] +[ext_resource type="Script" uid="uid://b6useuxusuw4w" path="res://core/ui/components/containers/enhanced_scroll_container.gd" id="2_wgjuq"] +[ext_resource type="Script" uid="uid://ogqbbfs88xnr" path="res://core/ui/base/component_button.gd" id="3_t1amb"] +[ext_resource type="PackedScene" uid="uid://b76dvfuouhlwd" path="res://core/systems/state/state_updater.tscn" id="3_xjq4q"] +[ext_resource type="Resource" uid="uid://bcr6c0281lb5b" path="res://assets/state/state_machines/menu_state_machine.tres" id="4_4r7yb"] +[ext_resource type="Texture2D" uid="uid://bdjnwtumim20t" path="res://assets/ui/icons/material-symbols--settings-outline-rounded.svg" id="4_g3a85"] +[ext_resource type="PackedScene" uid="uid://shvyhrv5sx3v" path="res://core/systems/state/state_watcher.tscn" id="5_7m03e"] +[ext_resource type="Texture2D" uid="uid://dty1fb5nkj3ni" path="res://assets/ui/icons/wifi-high.svg" id="5_g3a85"] +[ext_resource type="Texture2D" uid="uid://bmp372vmsk41d" path="res://assets/ui/icons/material-symbols--bluetooth.svg" id="6_3ov0g"] +[ext_resource type="Resource" uid="uid://d3gp85f35oiw6" path="res://assets/state/states/settings.tres" id="6_i4c1g"] +[ext_resource type="PackedScene" uid="uid://bw8113ocotx2r" path="res://core/systems/effects/fade_effect.tscn" id="7_k7suh"] +[ext_resource type="Texture2D" uid="uid://b8i7dvjfeylpv" path="res://assets/ui/icons/material-symbols--desktop-windows-outline-rounded.svg" id="7_wavho"] +[ext_resource type="PackedScene" uid="uid://uljtdvmuol3l" path="res://core/systems/input/focus_group_setter.tscn" id="8_0dy05"] +[ext_resource type="Script" uid="uid://yn3ulqw1kr2t" path="res://core/systems/state/state_updater.gd" id="9_joyxo"] +[ext_resource type="Resource" uid="uid://iqrotrmq62i6" path="res://assets/state/state_machines/settings_state_machine.tres" id="10_55ud7"] +[ext_resource type="Script" uid="uid://c801uoopgvud5" path="res://core/systems/state/state_machine_watcher.gd" id="11_1fwku"] + +[node name="SettingsMenu" type="MarginContainer" unique_id=1747485030] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_w0mdm") + +[node name="InputWatcher" parent="." unique_id=830536949 instance=ExtResource("2_cefgi")] +stop_propagation = true +action = "ogui_east" + +[node name="StateUpdater" parent="InputWatcher" unique_id=162154636 instance=ExtResource("3_xjq4q")] +state_machine = ExtResource("4_4r7yb") +action = 2 +on_signal = "input_released" + +[node name="StateWatcher" parent="." unique_id=760096209 instance=ExtResource("5_7m03e")] +state = ExtResource("6_i4c1g") + +[node name="FadeEffect" parent="StateWatcher" unique_id=278651893 node_paths=PackedStringArray("target") instance=ExtResource("7_k7suh")] +target = NodePath("../..") +on_signal = "state_entered" +fade_out_signal = "state_exited" +on_signal = "state_entered" + +[node name="FocusGroupSetter" parent="StateWatcher" unique_id=1545096030 instance=ExtResource("8_0dy05")] +on_signal = "state_entered" + +[node name="RefreshFocusGroupSetter" parent="StateWatcher" unique_id=888165680 instance=ExtResource("8_0dy05")] +on_signal = "state_refreshed" + +[node name="StateUpdater" type="Node" parent="StateWatcher" unique_id=1590883668] +script = ExtResource("9_joyxo") +state_machine = ExtResource("10_55ud7") +action = 6 +on_signal = "state_removed" + +[node name="StateMachineWatcher" type="Node" parent="." unique_id=1990334576] +script = ExtResource("11_1fwku") +state_machine = ExtResource("10_55ud7") + +[node name="FocusGroupSetter" parent="StateMachineWatcher" unique_id=236229167 instance=ExtResource("8_0dy05")] +on_signal = "emptied" + +[node name="HBoxContainer" type="HBoxContainer" parent="." unique_id=1126929786] +layout_mode = 2 +theme_override_constants/separation = 40 + +[node name="SideMarginContainer" type="MarginContainer" parent="HBoxContainer" unique_id=1200462709] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="Panel" type="Panel" parent="HBoxContainer/SideMarginContainer" unique_id=344497246] +layout_mode = 2 + +[node name="MarginContainer" type="MarginContainer" parent="HBoxContainer/SideMarginContainer" unique_id=2036987887] +layout_mode = 2 +theme_override_constants/margin_left = 20 +theme_override_constants/margin_right = 20 + +[node name="EnhancedScrollContainer" type="ScrollContainer" parent="HBoxContainer/SideMarginContainer/MarginContainer" unique_id=1643880278] +layout_mode = 2 +script = ExtResource("2_wgjuq") +metadata/_custom_type_script = "uid://b6useuxusuw4w" + +[node name="MarginContainer" type="MarginContainer" parent="HBoxContainer/SideMarginContainer/MarginContainer/EnhancedScrollContainer" unique_id=1011182433] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +theme_override_constants/margin_left = 4 +theme_override_constants/margin_right = 4 + +[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer/SideMarginContainer/MarginContainer/EnhancedScrollContainer/MarginContainer" unique_id=652224125] +layout_mode = 2 + +[node name="Spacer" type="Control" parent="HBoxContainer/SideMarginContainer/MarginContainer/EnhancedScrollContainer/MarginContainer/VBoxContainer" unique_id=408402739] +custom_minimum_size = Vector2(0, 20) +layout_mode = 2 + +[node name="SystemButton" type="MarginContainer" parent="HBoxContainer/SideMarginContainer/MarginContainer/EnhancedScrollContainer/MarginContainer/VBoxContainer" unique_id=332441200] +unique_name_in_owner = true +layout_mode = 2 +focus_mode = 2 +script = ExtResource("3_t1amb") +text = "System" +icon_texture = ExtResource("4_g3a85") +metadata/_custom_type_script = "uid://ogqbbfs88xnr" + +[node name="HSeparator" type="HSeparator" parent="HBoxContainer/SideMarginContainer/MarginContainer/EnhancedScrollContainer/MarginContainer/VBoxContainer" unique_id=2044839762] +layout_mode = 2 + +[node name="NetworkButton" type="MarginContainer" parent="HBoxContainer/SideMarginContainer/MarginContainer/EnhancedScrollContainer/MarginContainer/VBoxContainer" unique_id=628118391] +unique_name_in_owner = true +layout_mode = 2 +focus_mode = 2 +script = ExtResource("3_t1amb") +text = "Network" +icon_texture = ExtResource("5_g3a85") +metadata/_custom_type_script = "uid://ogqbbfs88xnr" + +[node name="BluetoothButton" type="MarginContainer" parent="HBoxContainer/SideMarginContainer/MarginContainer/EnhancedScrollContainer/MarginContainer/VBoxContainer" unique_id=538164236] +unique_name_in_owner = true +layout_mode = 2 +focus_mode = 2 +script = ExtResource("3_t1amb") +text = "Bluetooth" +icon_texture = ExtResource("6_3ov0g") +metadata/_custom_type_script = "uid://ogqbbfs88xnr" + +[node name="HSeparator2" type="HSeparator" parent="HBoxContainer/SideMarginContainer/MarginContainer/EnhancedScrollContainer/MarginContainer/VBoxContainer" unique_id=1021480209] +layout_mode = 2 + +[node name="DisplayButton" type="MarginContainer" parent="HBoxContainer/SideMarginContainer/MarginContainer/EnhancedScrollContainer/MarginContainer/VBoxContainer" unique_id=1032396099] +unique_name_in_owner = true +layout_mode = 2 +focus_mode = 2 +script = ExtResource("3_t1amb") +text = "Display" +icon_texture = ExtResource("7_wavho") +metadata/_custom_type_script = "uid://ogqbbfs88xnr" + +[node name="ContentMarginContainer" type="MarginContainer" parent="HBoxContainer" unique_id=1794249661] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 3.0 + +[node name="Panel" type="Panel" parent="HBoxContainer/ContentMarginContainer" unique_id=1747644658] +layout_mode = 2 + +[node name="MarginContainer" type="MarginContainer" parent="HBoxContainer/ContentMarginContainer" unique_id=628692243] +layout_mode = 2 +theme_override_constants/margin_left = 20 +theme_override_constants/margin_right = 20 + +[node name="EnhancedScrollContainer" type="ScrollContainer" parent="HBoxContainer/ContentMarginContainer/MarginContainer" unique_id=1850793714] +layout_mode = 2 +script = ExtResource("2_wgjuq") +metadata/_custom_type_script = "uid://b6useuxusuw4w" + +[node name="MarginContainer" type="MarginContainer" parent="HBoxContainer/ContentMarginContainer/MarginContainer/EnhancedScrollContainer" unique_id=18168744] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 diff --git a/docs/class-reference/Feature.md b/docs/class-reference/Feature.md index da735f559..e0cb52b0b 100644 --- a/docs/class-reference/Feature.md +++ b/docs/class-reference/Feature.md @@ -5,7 +5,7 @@ Definition of a single feature flag ## Description -A Feature describes one toggleable behavior: its id, description, and default state. Feature objects hold no logic and are registered with [FeatureFlags](../FeatureFlags). +A Feature describes one toggleable behavior: its id, description, default state, and optional command-line aliases. Feature objects hold no logic and are registered with [FeatureFlags](../FeatureFlags). ## Properties | Type | Name | Default | @@ -13,6 +13,7 @@ A Feature describes one toggleable behavior: its id, description, and default st | [String](https://docs.godotengine.org/en/stable/classes/class_string.html) | [id](./#id) | "" | | [String](https://docs.godotengine.org/en/stable/classes/class_string.html) | [description](./#description) | "" | | [bool](https://docs.godotengine.org/en/stable/classes/class_bool.html) | [default](./#default) | false | +| [String[]](https://docs.godotengine.org/en/stable/classes/class_string.html) | [aliases](./#aliases) | [] | ## Methods @@ -47,6 +48,13 @@ Human-readable description, used by help output and settings UI. The state this feature has when no source overrides it. +### `aliases` + + +[String[]](https://docs.godotengine.org/en/stable/classes/class_string.html) aliases = [] + + +Alternate command-line flags for this feature, usable as "--" instead of "--feature-", e.g. "overlay-mode" for "--overlay-mode". diff --git a/docs/class-reference/FeatureFlags.md b/docs/class-reference/FeatureFlags.md index e286b7908..1ff82673e 100644 --- a/docs/class-reference/FeatureFlags.md +++ b/docs/class-reference/FeatureFlags.md @@ -5,7 +5,7 @@ Registry of feature flags ## Description -FeatureFlags parses command-line arguments and environment variables to turn features on or off, and allows features to be toggled at runtime by plugins and platform classes. Signals are emitted when a feature changes so the UI can react. +FeatureFlags parses command-line arguments and environment variables to turn features on or off, and allows features to be toggled at runtime by plugins and platform classes. A feature can also declare aliases, so "--overlay-mode" works the same as "--feature-overlay-mode". Signals are emitted when a feature changes so the UI can react. ## Properties | Type | Name | Default | @@ -19,6 +19,7 @@ FeatureFlags parses command-line arguments and environment variables to turn fea | ------- | --------- | | [int](https://docs.godotengine.org/en/stable/classes/class_int.html) | [register_feature](./#register_feature)(feature: [Feature](../Feature)) | | [Feature](../Feature) | [get_feature](./#get_feature)(id: [String](https://docs.godotengine.org/en/stable/classes/class_string.html)) | +| [Feature](../Feature) | [get_feature_by_alias](./#get_feature_by_alias)(alias: [String](https://docs.godotengine.org/en/stable/classes/class_string.html)) | | [Feature[]](../Feature) | [get_features](./#get_features)() | | [bool](https://docs.godotengine.org/en/stable/classes/class_bool.html) | [is_enabled](./#is_enabled)(id: [String](https://docs.godotengine.org/en/stable/classes/class_string.html)) | | void | [set_feature](./#set_feature)(id: [String](https://docs.godotengine.org/en/stable/classes/class_string.html), enabled: [bool](https://docs.godotengine.org/en/stable/classes/class_bool.html)) | @@ -54,6 +55,7 @@ Reports unknown features, invalid registrations, and unparseable values. + ------------------ ## Method Descriptions @@ -72,6 +74,13 @@ Registers a feature. Returns OK if the feature was newly registered. Returns the registered feature with the given id, or null if it is not registered. +### `get_feature_by_alias()` + + +[Feature](../Feature) **get_feature_by_alias**(alias: [String](https://docs.godotengine.org/en/stable/classes/class_string.html)) + + +Returns the registered feature listing the given alias, or null if none match. ### `get_features()` diff --git a/docs/documentation/plugins/feature_flags.md b/docs/documentation/plugins/feature_flags.md index b2c5cc157..1e4f5882e 100644 --- a/docs/documentation/plugins/feature_flags.md +++ b/docs/documentation/plugins/feature_flags.md @@ -9,7 +9,7 @@ Flags are managed by the [FeatureFlags](../../class-reference/FeatureFlags.md) resource, which is shared across the whole application. A single feature is described by a [Feature](../../class-reference/Feature.md) resource containing its `id`, -`description`, and `default` state. +`description`, `default` state, and optional command-line `aliases`. ## Resolving a flag @@ -32,6 +32,9 @@ opengamepad-ui --feature-updater # Disable a feature opengamepad-ui --feature-no-updater +# Aliases are plain flags: --overlay-mode enables the "overlay-mode" feature +opengamepad-ui --overlay-mode + # Per-feature environment variable OGUI_FEATURE_UPDATER=0 opengamepad-ui @@ -44,6 +47,11 @@ Values are read as booleans: `1`, `true`, `yes`, and `on` enable a feature, and `0`, `false`, `no`, and `off` disable it. The environment key for a feature is derived from its id, so `steam-deck-mode` becomes `OGUI_FEATURE_STEAM_DECK_MODE`. +A feature can declare `aliases`: plain flags accepted as `--` instead of +`--feature-`. An alias always enables its feature; use `--feature-no-` +to disable one. Aliases resolve from the same command-line source as +`--feature-` arguments. + Bulk lists are applied before per-feature variables, so a per-feature variable wins when both name the same feature. Values that are not boolean strings are ignored and the feature keeps its default. @@ -133,3 +141,6 @@ everything: | --- | --- | --- | | `updater` | `true` | Allows checking for and installing app updates. The settings menu hides its update section when it is off. | | `tdp` | `true` | Allows managing TDP settings. | +| `card-ui` | `true` | Loads the Card UI, the default interface. Alias: `--card-ui`. | +| `etoile-ui` | `false` | Loads the Etoile UI instead of the Card UI. Alias: `--etoile-ui`. | +| `overlay-mode` | `false` | Loads CardUI in overlay mode. Aliases: `--overlay-mode`, `--only-qam`, `--qam-only`. |