diff --git a/Main.tscn b/Main.tscn index 01e38ce..ded67fd 100644 --- a/Main.tscn +++ b/Main.tscn @@ -92,7 +92,7 @@ layout_mode = 0 offset_top = -128.0 offset_bottom = -32.0 input_code = "action_4" -label = "Y" +label = "[img]uid://dd8f8gmpc0era[/img]" [node name="Action3" parent="Actions" instance=ExtResource("2_uu6xs")] layout_mode = 0 @@ -101,7 +101,7 @@ offset_top = -32.0 offset_right = 0.0 offset_bottom = 64.0 input_code = "action_3" -label = "X" +label = "[img]uid://c3cwld6imdmxo[/img]" [node name="Action2" parent="Actions" instance=ExtResource("2_uu6xs")] layout_mode = 0 @@ -110,14 +110,14 @@ offset_top = -32.0 offset_right = 192.0 offset_bottom = 64.0 input_code = "action_2" -label = "B" +label = "[img]uid://dgmruo36vderr[/img]" [node name="Action1" parent="Actions" instance=ExtResource("2_uu6xs")] layout_mode = 0 offset_top = 64.0 offset_bottom = 160.0 input_code = "action_1" -label = "A" +label = "[img]uid://d23pu1ionxes1[/img]" [node name="MidButtons" type="Control" parent="."] layout_mode = 1 @@ -141,7 +141,7 @@ offset_right = -44.0 offset_bottom = 16.0 pivot_offset = Vector2(48, 24) input_code = "select" -label = "Select" +label = "[img width=48]uid://kq8unss5dfnf[/img]" [node name="Start" parent="MidButtons" instance=ExtResource("2_uu6xs")] layout_mode = 0 @@ -151,7 +151,7 @@ offset_right = 180.0 offset_bottom = 16.0 pivot_offset = Vector2(48, 24) input_code = "start" -label = "Start" +label = "[img width=48]uid://03m3ethxsomd[/img]" [node name="ShoulderButtons" type="Control" parent="."] layout_mode = 1 @@ -174,7 +174,7 @@ offset_top = -231.0 offset_right = 212.0 offset_bottom = -167.0 input_code = "r1" -label = "R1" +label = "[img]uid://wqltrinwradw[/img]" [node name="R2" parent="ShoulderButtons" instance=ExtResource("3_r0du0")] layout_mode = 0 @@ -183,7 +183,7 @@ offset_top = -261.0 offset_right = 340.0 offset_bottom = -133.0 input_axis = 5 -label = "R2" +label = "[img width=48]uid://wrst4mxi4mdc[/img]" [node name="L1" parent="ShoulderButtons" instance=ExtResource("2_uu6xs")] layout_mode = 0 @@ -192,7 +192,7 @@ offset_top = -233.0 offset_right = -44.0 offset_bottom = -169.0 input_code = "l1" -label = "L1" +label = "[img]uid://crjyakxa6idyd[/img]" [node name="L2" parent="ShoulderButtons" instance=ExtResource("3_r0du0")] layout_mode = 0 @@ -201,7 +201,7 @@ offset_top = -261.0 offset_right = -236.0 offset_bottom = -133.0 input_axis = 4 -label = "L2" +label = "[img width=48]uid://xl1fiv1qi2sx[/img]" [node name="LeftJoystick" parent="." instance=ExtResource("4_cm0pq")] layout_mode = 1 diff --git a/assets/ps/playstation4_button_options_outline.svg b/assets/ps/playstation4_button_options_outline.svg new file mode 100644 index 0000000..c06473a --- /dev/null +++ b/assets/ps/playstation4_button_options_outline.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/assets/ps/playstation4_button_options_outline.svg.import b/assets/ps/playstation4_button_options_outline.svg.import new file mode 100644 index 0000000..85958ee --- /dev/null +++ b/assets/ps/playstation4_button_options_outline.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://03m3ethxsomd" +path="res://.godot/imported/playstation4_button_options_outline.svg-77e6d0606bb5509eb2308c290b920f40.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ps/playstation4_button_options_outline.svg" +dest_files=["res://.godot/imported/playstation4_button_options_outline.svg-77e6d0606bb5509eb2308c290b920f40.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/ps/playstation4_button_share_outline.svg b/assets/ps/playstation4_button_share_outline.svg new file mode 100644 index 0000000..fbb06d2 --- /dev/null +++ b/assets/ps/playstation4_button_share_outline.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/assets/ps/playstation4_button_share_outline.svg.import b/assets/ps/playstation4_button_share_outline.svg.import new file mode 100644 index 0000000..252be8f --- /dev/null +++ b/assets/ps/playstation4_button_share_outline.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://kq8unss5dfnf" +path="res://.godot/imported/playstation4_button_share_outline.svg-4f4652eb7ab725d653f9667c098274d0.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ps/playstation4_button_share_outline.svg" +dest_files=["res://.godot/imported/playstation4_button_share_outline.svg-4f4652eb7ab725d653f9667c098274d0.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/ps/playstation_button_circle_outline.svg b/assets/ps/playstation_button_circle_outline.svg new file mode 100644 index 0000000..8fd7168 --- /dev/null +++ b/assets/ps/playstation_button_circle_outline.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/assets/ps/playstation_button_circle_outline.svg.import b/assets/ps/playstation_button_circle_outline.svg.import new file mode 100644 index 0000000..07b9020 --- /dev/null +++ b/assets/ps/playstation_button_circle_outline.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dgmruo36vderr" +path="res://.godot/imported/playstation_button_circle_outline.svg-705c9764db2abb57c1c4304936afa4ed.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ps/playstation_button_circle_outline.svg" +dest_files=["res://.godot/imported/playstation_button_circle_outline.svg-705c9764db2abb57c1c4304936afa4ed.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/ps/playstation_button_cross_outline.svg b/assets/ps/playstation_button_cross_outline.svg new file mode 100644 index 0000000..4bbc11f --- /dev/null +++ b/assets/ps/playstation_button_cross_outline.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/assets/ps/playstation_button_cross_outline.svg.import b/assets/ps/playstation_button_cross_outline.svg.import new file mode 100644 index 0000000..56fd229 --- /dev/null +++ b/assets/ps/playstation_button_cross_outline.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d23pu1ionxes1" +path="res://.godot/imported/playstation_button_cross_outline.svg-234fb69d320952d642ac672b91954046.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ps/playstation_button_cross_outline.svg" +dest_files=["res://.godot/imported/playstation_button_cross_outline.svg-234fb69d320952d642ac672b91954046.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/ps/playstation_button_square_outline.svg b/assets/ps/playstation_button_square_outline.svg new file mode 100644 index 0000000..29a87da --- /dev/null +++ b/assets/ps/playstation_button_square_outline.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/assets/ps/playstation_button_square_outline.svg.import b/assets/ps/playstation_button_square_outline.svg.import new file mode 100644 index 0000000..cb05e49 --- /dev/null +++ b/assets/ps/playstation_button_square_outline.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c3cwld6imdmxo" +path="res://.godot/imported/playstation_button_square_outline.svg-a1e129c0ead780502a9d3b757b710784.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ps/playstation_button_square_outline.svg" +dest_files=["res://.godot/imported/playstation_button_square_outline.svg-a1e129c0ead780502a9d3b757b710784.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/ps/playstation_button_triangle_outline.svg b/assets/ps/playstation_button_triangle_outline.svg new file mode 100644 index 0000000..de2de33 --- /dev/null +++ b/assets/ps/playstation_button_triangle_outline.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/assets/ps/playstation_button_triangle_outline.svg.import b/assets/ps/playstation_button_triangle_outline.svg.import new file mode 100644 index 0000000..6021fcb --- /dev/null +++ b/assets/ps/playstation_button_triangle_outline.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dd8f8gmpc0era" +path="res://.godot/imported/playstation_button_triangle_outline.svg-dd07a659f942de4953e7b2b2f334e409.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ps/playstation_button_triangle_outline.svg" +dest_files=["res://.godot/imported/playstation_button_triangle_outline.svg-dd07a659f942de4953e7b2b2f334e409.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/ps/playstation_trigger_l1_alternative_outline.svg b/assets/ps/playstation_trigger_l1_alternative_outline.svg new file mode 100644 index 0000000..04c1681 --- /dev/null +++ b/assets/ps/playstation_trigger_l1_alternative_outline.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/assets/ps/playstation_trigger_l1_alternative_outline.svg.import b/assets/ps/playstation_trigger_l1_alternative_outline.svg.import new file mode 100644 index 0000000..b0f7b21 --- /dev/null +++ b/assets/ps/playstation_trigger_l1_alternative_outline.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://crjyakxa6idyd" +path="res://.godot/imported/playstation_trigger_l1_alternative_outline.svg-f59ed484aa1e2dac880c7c6340c6f0e4.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ps/playstation_trigger_l1_alternative_outline.svg" +dest_files=["res://.godot/imported/playstation_trigger_l1_alternative_outline.svg-f59ed484aa1e2dac880c7c6340c6f0e4.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/ps/playstation_trigger_l2_alternative_outline.svg b/assets/ps/playstation_trigger_l2_alternative_outline.svg new file mode 100644 index 0000000..f7cb979 --- /dev/null +++ b/assets/ps/playstation_trigger_l2_alternative_outline.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/assets/ps/playstation_trigger_l2_alternative_outline.svg.import b/assets/ps/playstation_trigger_l2_alternative_outline.svg.import new file mode 100644 index 0000000..d2dde25 --- /dev/null +++ b/assets/ps/playstation_trigger_l2_alternative_outline.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://xl1fiv1qi2sx" +path="res://.godot/imported/playstation_trigger_l2_alternative_outline.svg-d8e56af6f252b46772b1b92585a1cef7.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ps/playstation_trigger_l2_alternative_outline.svg" +dest_files=["res://.godot/imported/playstation_trigger_l2_alternative_outline.svg-d8e56af6f252b46772b1b92585a1cef7.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/ps/playstation_trigger_r1_alternative_outline.svg b/assets/ps/playstation_trigger_r1_alternative_outline.svg new file mode 100644 index 0000000..cad5869 --- /dev/null +++ b/assets/ps/playstation_trigger_r1_alternative_outline.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/assets/ps/playstation_trigger_r1_alternative_outline.svg.import b/assets/ps/playstation_trigger_r1_alternative_outline.svg.import new file mode 100644 index 0000000..4751388 --- /dev/null +++ b/assets/ps/playstation_trigger_r1_alternative_outline.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://wqltrinwradw" +path="res://.godot/imported/playstation_trigger_r1_alternative_outline.svg-e911b00d42cf67467c04704d67180885.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ps/playstation_trigger_r1_alternative_outline.svg" +dest_files=["res://.godot/imported/playstation_trigger_r1_alternative_outline.svg-e911b00d42cf67467c04704d67180885.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/ps/playstation_trigger_r2_alternative_outline.svg b/assets/ps/playstation_trigger_r2_alternative_outline.svg new file mode 100644 index 0000000..c5da684 --- /dev/null +++ b/assets/ps/playstation_trigger_r2_alternative_outline.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/assets/ps/playstation_trigger_r2_alternative_outline.svg.import b/assets/ps/playstation_trigger_r2_alternative_outline.svg.import new file mode 100644 index 0000000..86162f5 --- /dev/null +++ b/assets/ps/playstation_trigger_r2_alternative_outline.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://wrst4mxi4mdc" +path="res://.godot/imported/playstation_trigger_r2_alternative_outline.svg-58c3c73fd759a6c651df39a9a49dd4e7.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ps/playstation_trigger_r2_alternative_outline.svg" +dest_files=["res://.godot/imported/playstation_trigger_r2_alternative_outline.svg-58c3c73fd759a6c651df39a9a49dd4e7.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/config.gd b/config.gd index 652df9d..1b5122a 100644 --- a/config.gd +++ b/config.gd @@ -11,16 +11,17 @@ const JOYSTICK_LABELS := "joystick_labels" const TRACK_JOYSTICK_MOVEMENT := "track_joystick_movement" const TRACK_JOYSTICK_DRIFT := "track_joystick_drift" const BUTTONS_LABELS := "buttons_labels" -const DEFAULT_COLOR := "default_color" +const DEFAULT_JOYSTICK_COLOR := "default_joystick_color" +const DEFAULT_BUTTON_COLOR := "default_button_color" const ACTIVE_COLOR := "active_color" const TEXT_COLOR := "text_color" +const COLOR_BUTTON_TEXT := "color_button_text" var _config: ConfigFile # Settings static var device_label := ConfigOption.new(SETTINGS_SECTION, DEVICE_LABEL, true) static var background_color := ConfigOption.new(SETTINGS_SECTION, BACKGROUND_COLOR, Color(0x4d4d4dff)) -static var default_color := ConfigOption.new(SETTINGS_SECTION, DEFAULT_COLOR, Color(0x2a2a2aff)) static var active_color := ConfigOption.new(SETTINGS_SECTION, ACTIVE_COLOR, Color(0x4a8e53ff)) static var text_color := ConfigOption.new(SETTINGS_SECTION, TEXT_COLOR, Color(0xffffffff)) @@ -28,9 +29,12 @@ static var text_color := ConfigOption.new(SETTINGS_SECTION, TEXT_COLOR, Color(0x static var joystick_labels := ConfigOption.new(JOYSTICK_SECTION, JOYSTICK_LABELS, true) static var track_joystick_movement := ConfigOption.new(JOYSTICK_SECTION, TRACK_JOYSTICK_MOVEMENT, true) static var track_joystick_drift := ConfigOption.new(JOYSTICK_SECTION, TRACK_JOYSTICK_DRIFT, true) +static var default_joystick_color := ConfigOption.new(JOYSTICK_SECTION, DEFAULT_JOYSTICK_COLOR, Color(0x2a2a2aff)) # Buttons static var buttons_labels := ConfigOption.new(BUTTONS_SECTION, BUTTONS_LABELS, true) +static var default_button_color := ConfigOption.new(BUTTONS_SECTION, DEFAULT_BUTTON_COLOR, Color(0x2a2a2aff)) +static var color_button_text := ConfigOption.new(BUTTONS_SECTION, COLOR_BUTTON_TEXT, false) func _ready() -> void: self._config = ConfigFile.new() diff --git a/controller/button/controller_button.gd b/controller/button/controller_button.gd index 2eb0af7..f333427 100644 --- a/controller/button/controller_button.gd +++ b/controller/button/controller_button.gd @@ -2,6 +2,8 @@ class_name ControllerButton extends ColorRect +const text_shader = preload("uid://crnhvx5xfqmj7") + @onready var label_node: RichTextLabel = $Label @export var input_code: String @@ -9,16 +11,37 @@ extends ColorRect set(val): label = val if Engine.is_editor_hint() && self.label_node != null: - self.label_node.text = label + if val.begins_with("uid://"): + self.label_node.text = "[img]%s[/img]" % label + else: + self.label_node.text = label + +var default_color: Color +var active_color: Color +var text_color: Color func _ready() -> void: + self.default_color = Config.default_button_color.value + self.active_color = Config.active_color.value + self.text_color = Config.text_color.value + if Config.buttons_labels.value: self.label_node.text = self.label else: self.label_node.text = "" - var text_color: Color = Config.text_color.value - self.label_node.add_theme_color_override("default_color", text_color) + self.label_node.add_theme_color_override("default_color", self.text_color) + self.color = default_color assert(self.input_code, "Missing input code for %s" % self.name) assert(InputMap.has_action(self.input_code), "Invalid input code for %s" % self.name) + +func _process(_delta: float) -> void: + if Engine.is_editor_hint(): + return + + var has_action_pressed := Input.is_action_pressed(self.input_code) + if Config.color_button_text.value: + self.label_node.set_instance_shader_parameter("TextColor", self.active_color if has_action_pressed else self.text_color) + else: + self.color = self.active_color if has_action_pressed else self.default_color diff --git a/controller/button/controller_button.tscn b/controller/button/controller_button.tscn index 7aa5c58..36902d0 100644 --- a/controller/button/controller_button.tscn +++ b/controller/button/controller_button.tscn @@ -1,5 +1,6 @@ -[gd_scene load_steps=2 format=3 uid="uid://bkw6xqubudrtw"] +[gd_scene load_steps=3 format=3 uid="uid://bkw6xqubudrtw"] +[ext_resource type="Material" uid="uid://crnhvx5xfqmj7" path="res://controller/text_shader.tres" id="2_dmmye"] [ext_resource type="Script" uid="uid://5ud76wl43q3w" path="res://controller/button/controller_button.gd" id="2_t8ak6"] [node name="Button" type="ColorRect" groups=["buttons"]] @@ -10,6 +11,7 @@ color = Color(0.164706, 0.164706, 0.164706, 1) script = ExtResource("2_t8ak6") [node name="Label" type="RichTextLabel" parent="."] +material = ExtResource("2_dmmye") layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -18,6 +20,7 @@ grow_horizontal = 2 grow_vertical = 2 theme_override_font_sizes/normal_font_size = 24 bbcode_enabled = true -text = "Up" +scroll_active = false +autowrap_mode = 0 horizontal_alignment = 1 vertical_alignment = 1 diff --git a/controller/controller.gd b/controller/controller.gd index c828a82..3c2eb07 100644 --- a/controller/controller.gd +++ b/controller/controller.gd @@ -3,12 +3,8 @@ extends Control @onready var device_name: RichTextLabel = $Device var _has_joy := false -var _buttons: Array[Node] -var _triggers: Array[Node] func _ready() -> void: - self._buttons = self.get_tree().get_nodes_in_group("buttons") - self._triggers = self.get_tree().get_nodes_in_group("triggers") if Input.get_connected_joypads().size() > 0: self.device_name.text = Input.get_joy_name(0) if Config.device_label.value else "" self._has_joy = true @@ -18,26 +14,7 @@ func _process(_delta: float) -> void: if Input.get_connected_joypads().size() > 0: self.device_name.text = Input.get_joy_name(0) self._has_joy = true - return - - if Input.get_connected_joypads().size() <= 0: - self._has_joy = false - self.device_name.text = WyHelper.NO_DEVICE - return - - for btn in self._buttons: - if not btn is ControllerButton: - continue - - var cbtn := btn as ControllerButton - cbtn.color = Config.default_color.value - - if cbtn.input_code && Input.is_action_pressed(cbtn.input_code): - cbtn.color = Config.active_color.value - - for btn in self._triggers: - if not btn is ControllerTrigger: - continue - - var cbtn := btn as ControllerTrigger - cbtn.value = Input.get_joy_axis(0, cbtn.input_axis) + else: + if Input.get_connected_joypads().size() <= 0: + self.device_name.text = WyHelper.NO_DEVICE + self._has_joy = false diff --git a/controller/joystick/joystick.gd b/controller/joystick/joystick.gd index ec6908a..59ddb4b 100644 --- a/controller/joystick/joystick.gd +++ b/controller/joystick/joystick.gd @@ -14,9 +14,9 @@ var _last_y := 0.0 func _ready() -> void: self._dot_style = box_theme.duplicate() self.pos.add_theme_stylebox_override("panel", self._dot_style) - self._dot_style.bg_color = Config.default_color.value + self._dot_style.bg_color = Config.default_joystick_color.value - var bg_color: Color = Config.default_color.value + var bg_color: Color = Config.default_joystick_color.value (self.get_theme_stylebox("panel") as StyleBoxFlat).border_color = bg_color func _process(_delta: float) -> void: @@ -39,7 +39,7 @@ func _process(_delta: float) -> void: elif Config.track_joystick_drift.value && (is_drifting || is_stuck): self._dot_style.bg_color = WyHelper.ERROR_COLOR else: - self._dot_style.bg_color = Config.default_color.value + self._dot_style.bg_color = Config.default_joystick_color.value if Config.joystick_labels.value: self.label_node.text = "x:%0.2f y:%0.2f" % [x, y] diff --git a/controller/text_shader.tres b/controller/text_shader.tres new file mode 100644 index 0000000..6e7c0a3 --- /dev/null +++ b/controller/text_shader.tres @@ -0,0 +1,34 @@ +[gd_resource type="ShaderMaterial" load_steps=3 format=3 uid="uid://crnhvx5xfqmj7"] + +[sub_resource type="VisualShaderNodeColorParameter" id="VisualShaderNodeColorParameter_i05ah"] +parameter_name = "TextColor" +qualifier = 2 +default_value_enabled = true + +[sub_resource type="VisualShader" id="VisualShader_6fe4d"] +code = "shader_type canvas_item; +render_mode blend_mix; + +instance uniform vec4 TextColor : source_color = vec4(1.000000, 1.000000, 1.000000, 1.000000); + + + +void vertex() { +// ColorParameter:2 + vec4 n_out2p0 = TextColor; + + +// Output:0 + COLOR.rgb = vec3(n_out2p0.xyz); + + +} +" +mode = 1 +flags/light_only = false +nodes/vertex/2/node = SubResource("VisualShaderNodeColorParameter_i05ah") +nodes/vertex/2/position = Vector2(-40, 140) +nodes/vertex/connections = PackedInt32Array(2, 0, 0, 2) + +[resource] +shader = SubResource("VisualShader_6fe4d") diff --git a/controller/trigger/trigger_button.gd b/controller/trigger/trigger_button.gd index 543315d..21deac4 100644 --- a/controller/trigger/trigger_button.gd +++ b/controller/trigger/trigger_button.gd @@ -19,15 +19,16 @@ func _ready() -> void: self.label_node.text = "" self.progress_label.text = "" - var bg_color: Color = Config.default_color.value + var bg_color: Color = Config.default_button_color.value var fill_color: Color = Config.active_color.value (self.get_theme_stylebox("background") as StyleBoxFlat).border_color = bg_color (self.get_theme_stylebox("fill") as StyleBoxFlat).bg_color = fill_color - var text_color: Color = Config.text_color.value - self.label_node.add_theme_color_override("default_color", text_color) - self.progress_label.add_theme_color_override("default_color", text_color) - func _process(_delta: float) -> void: - if !Engine.is_editor_hint() && Config.buttons_labels.value: + if Engine.is_editor_hint(): + return + + if Config.buttons_labels.value: self.progress_label.text = "%s%%" % str(self.value * 100.0) + + self.value = Input.get_joy_axis(0, self.input_axis) diff --git a/controller/trigger/trigger_button.tscn b/controller/trigger/trigger_button.tscn index 65d8389..ff210b6 100644 --- a/controller/trigger/trigger_button.tscn +++ b/controller/trigger/trigger_button.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=4 format=3 uid="uid://c1dixxyohl131"] +[gd_scene load_steps=5 format=3 uid="uid://c1dixxyohl131"] [ext_resource type="Script" uid="uid://dyjkb4jlrolof" path="res://controller/trigger/trigger_button.gd" id="1_w0n5r"] +[ext_resource type="Material" uid="uid://crnhvx5xfqmj7" path="res://controller/text_shader.tres" id="2_w7kec"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_lt7ru"] bg_color = Color(0.6, 0.6, 0.6, 0) @@ -41,6 +42,7 @@ show_percentage = false script = ExtResource("1_w0n5r") [node name="Label" type="RichTextLabel" parent="."] +material = ExtResource("2_w7kec") layout_mode = 1 anchors_preset = 10 anchor_right = 1.0 @@ -48,10 +50,13 @@ offset_bottom = 40.0 grow_horizontal = 2 theme_override_font_sizes/normal_font_size = 24 bbcode_enabled = true +scroll_active = false +autowrap_mode = 0 horizontal_alignment = 1 vertical_alignment = 1 [node name="ProgressLabel" type="RichTextLabel" parent="."] +material = ExtResource("2_w7kec") layout_mode = 1 anchors_preset = 12 anchor_top = 1.0 diff --git a/project.godot b/project.godot index 838d70d..3f4aa36 100644 --- a/project.godot +++ b/project.godot @@ -111,30 +111,11 @@ r1={ "events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":10,"pressure":0.0,"pressed":false,"script":null) ] } -r2={ -"deadzone": 0.0, -"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":5,"axis_value":1.0,"script":null) -] -} -r3={ -"deadzone": 0.5, -"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":8,"pressure":0.0,"pressed":false,"script":null) -] -} l1={ "deadzone": 0.5, "events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":9,"pressure":0.0,"pressed":false,"script":null) ] } -l2={ -"deadzone": 0.2, -"events": [] -} -l3={ -"deadzone": 0.5, -"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":7,"pressure":0.0,"pressed":false,"script":null) -] -} [rendering]