Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GD-522: Fix shortcuts can't be changed anymore in GdUnit4 settings #526

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions addons/gdUnit4/src/ui/settings/GdUnitInputCapture.gd
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ var _input_event: InputEventKey

func _ready() -> void:
reset()
self_modulate = Color.WHITE
_tween = create_tween()
_tween.set_loops(-1)
_tween.tween_property(self, "modulate", Color(0, 0, 0, .1), 1.0).from_current().set_trans(Tween.TRANS_QUAD).set_ease(Tween.EASE_IN)
_tween.set_loops()
_tween.tween_property(%Label, "self_modulate", Color(1, 1, 1, .8), 1.0).from_current().set_trans(Tween.TRANS_BACK).set_ease(Tween.EASE_IN_OUT)


func reset() -> void:
Expand Down
5 changes: 4 additions & 1 deletion addons/gdUnit4/src/ui/settings/GdUnitInputCapture.tscn
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[gd_scene load_steps=2 format=3]
[gd_scene load_steps=2 format=3 uid="uid://pmnkxrhglak5"]

[ext_resource type="Script" path="res://addons/gdUnit4/src/ui/settings/GdUnitInputCapture.gd" id="1_gki1u"]

[node name="GdUnitInputMapper" type="Control"]
modulate = Color(0.929099, 0.929099, 0.929099, 0.936189)
top_level = true
layout_mode = 3
anchors_preset = 15
Expand All @@ -16,6 +17,8 @@ script = ExtResource("1_gki1u")

[node name="Label" type="Label" parent="."]
unique_name_in_owner = true
self_modulate = Color(0.401913, 0.401913, 0.401913, 0.461723)
top_level = true
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
Expand Down
2 changes: 2 additions & 0 deletions addons/gdUnit4/src/ui/settings/GdUnitSettingsDialog.gd
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,13 @@ func _on_shortcut_change(input_button: Button, property: GdUnitProperty, reset_b
_input_capture.set_custom_minimum_size(_properties_shortcuts.get_size())
_input_capture.visible = true
_input_capture.show()
_properties_shortcuts.visible = false
set_process_input(false)
_input_capture.reset()
var input_event: InputEventKey = await _input_capture.input_completed
input_button.text = input_event.as_text()
_on_property_text_changed(to_keys(input_event), property, reset_btn)
_properties_shortcuts.visible = true
set_process_input(true)


Expand Down
264 changes: 21 additions & 243 deletions addons/gdUnit4/src/ui/settings/GdUnitSettingsDialog.tscn

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ config_version=5

config/name="gdUnit4"
config/tags=PackedStringArray("addon", "godot4", "testing")
config/features=PackedStringArray("4.3", "C#")
config/features=PackedStringArray("4.2")
config/icon="res://icon.png"

[audio]
Expand Down Expand Up @@ -40,7 +40,6 @@ ui/inspector/node_collapse=false
ui/toolbar/run_overall=true
ui/inspector/tree_sort_mode=1
report/godot/script_error=false
settings/test/test_discovery=true

[importer_defaults]

Expand Down