diff --git a/addons/input-system/InputType.gd b/addons/input-system/InputType.gd index 63a658d..73758b6 100644 --- a/addons/input-system/InputType.gd +++ b/addons/input-system/InputType.gd @@ -84,11 +84,11 @@ static func to_text(type: int) -> String: var ev = to_event(type) as InputEventKey if ev: - if ev.unicode: - var char = String.chr(ev.unicode) - if char == " ": - return "Space" - return char +# if ev.unicode: +# var char = String.chr(ev.unicode) +# if char == " ": +# return "Space" +# return char return ev.as_text() return "" @@ -100,7 +100,11 @@ static func to_event(type: int) -> InputEvent: if code >= KEY_SPECIAL: key.keycode = code else: + if code >= 97 and code <= 122: # lower case a-z + code -= 32 # make it upper case to match keycode key.unicode = code + key.keycode = code + key.pressed = true return key if type >= Key.JOYSTICK_L_UP and type <= Key.JOYSTICK_R_LEFT: diff --git a/addons/menu-system/AudioSlider.gd b/addons/menu-system/AudioSlider.gd index aa7859b..3d7c5fc 100644 --- a/addons/menu-system/AudioSlider.gd +++ b/addons/menu-system/AudioSlider.gd @@ -5,12 +5,21 @@ extends HSlider @export var vol_range = 40 @export var vol_offset = 5 +@export var hover_sound: AudioStreamPlayer + var master_id func _ready(): + await owner.ready master_id = AudioServer.get_bus_index(bus_name) - connect("value_changed", self._volume_changed) + value_changed.connect(self._volume_changed) value = get_volume_percentage() + + mouse_entered.connect(_on_hover) + focus_entered.connect(_on_hover) + +func _on_hover(): + hover_sound.play() func _volume_changed(v: float): if v == 0: diff --git a/project.godot b/project.godot index f1cefdc..4a760f5 100644 --- a/project.godot +++ b/project.godot @@ -71,11 +71,6 @@ move_right={ "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"echo":false,"script":null) ] } -dev={ -"deadzone": 0.5, -"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194343,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) -] -} move_up={ "deadzone": 0.5, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"echo":false,"script":null) diff --git a/src/menu/InputSetting.gd b/src/menu/InputSetting.gd index 0dadf15..09f7980 100644 --- a/src/menu/InputSetting.gd +++ b/src/menu/InputSetting.gd @@ -53,7 +53,9 @@ func load_settings(config: ConfigFile): for action in config.get_section_keys(section): var type = config.get_value(section, action) var button = _action_button_map[action] - button.remap_input(InputType.to_event(type)) + var ev = InputType.to_event(type) + _logger.debug("Remapping %s to %s from type %s" % [action, ev, type]) + button.remap_input(ev) func save_settings(config: ConfigFile): diff --git a/src/menu/Options.tscn b/src/menu/Options.tscn index d078584..306e7b6 100644 --- a/src/menu/Options.tscn +++ b/src/menu/Options.tscn @@ -54,12 +54,13 @@ vertical_alignment = 1 script = ExtResource("5_htjkt") control = NodePath("../AudioSlider") -[node name="AudioSlider" type="HSlider" parent="CenterContainer/VBoxContainer/Options"] +[node name="AudioSlider" type="HSlider" parent="CenterContainer/VBoxContainer/Options" node_paths=PackedStringArray("hover_sound")] layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 4 script = ExtResource("1") vol_offset = 0 +hover_sound = NodePath("../../TitleBack/Hover") [node name="Control" type="Control" parent="CenterContainer/VBoxContainer/Options"] custom_minimum_size = Vector2(0, 10) @@ -93,3 +94,5 @@ layout_mode = 2 text = "Press any key..." [connection signal="pressed" from="CenterContainer/VBoxContainer/TitleBack" to="." method="_on_title_back_pressed"] + +[editable path="CenterContainer/VBoxContainer/TitleBack"] diff --git a/src/player/player.gd b/src/player/player.gd index b19cc23..bd8d6e3 100644 --- a/src/player/player.gd +++ b/src/player/player.gd @@ -39,7 +39,7 @@ var state = SPAWN var portal func _ready(): - # in the final build, the texture does not exit for some reason + # in the final build, the texture does not exist for some reason var mat = sprite.material as ShaderMaterial mat.set_shader_parameter("dissolve_texture", dissolve_texture)