addon for remapping inputs
fixup for 4.1
| -rw-r--r-- | addons/remap/ActionLabel.gd | 6 | ||||
| -rw-r--r-- | addons/remap/RemapButton.gd | 1 | ||||
| -rw-r--r-- | addons/remap/package.json | 4 | ||||
| -rw-r--r-- | addons/remap/private/ActionIcon.gd | 5 | ||||
| -rw-r--r-- | addons/remap/private/ActionIcons.gd | 4 | ||||
| -rw-r--r-- | addons/remap/private/IconMap.gd | 1 | ||||
| -rw-r--r-- | project.godot | 28 |
7 files changed, 15 insertions, 34 deletions
diff --git a/addons/remap/ActionLabel.gd b/addons/remap/ActionLabel.gd index ce04d71..573ea32 100644 --- a/addons/remap/ActionLabel.gd +++ b/addons/remap/ActionLabel.gd @@ -4,8 +4,6 @@ extends HBoxContainer class_name ActionLabel -const IconMap := preload("./private/IconMap.gd") -const ActionIcons := preload("./private/ActionIcons.gd") const SaveLoadUtils := preload("./private/SaveLoadUtils.gd") ## The label text. @@ -45,8 +43,8 @@ func _ready() -> void: name_label_bg.add_child(name_label) name_label.text = _name name_label.custom_minimum_size = icon_size - name_label.vertical_alignment = ALIGNMENT_CENTER - name_label.horizontal_alignment = ALIGNMENT_CENTER + name_label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER + name_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER var spacer := Control.new() spacer.size_flags_horizontal = Control.SIZE_EXPAND_FILL icons = ActionIcons.new(action, icon_size, font, font_size, continuous_updating) diff --git a/addons/remap/RemapButton.gd b/addons/remap/RemapButton.gd index a84bf4c..f80df47 100644 --- a/addons/remap/RemapButton.gd +++ b/addons/remap/RemapButton.gd @@ -4,7 +4,6 @@ extends HBoxContainer class_name RemapButton -const ActionIcons := preload("./private/ActionIcons.gd") const RemapUtilities := preload("./private/RemapUtilities.gd") const SaveLoadUtils := preload("./private/SaveLoadUtils.gd") diff --git a/addons/remap/package.json b/addons/remap/package.json index bd84ab5..0fd52a6 100644 --- a/addons/remap/package.json +++ b/addons/remap/package.json @@ -1,6 +1,6 @@ { "name": "@bendn/remap", - "version": "5.0.8", + "version": "5.0.9", "description": "godot input remapping", "main": "InteractiveActionLabel.gd", "scripts": { @@ -20,4 +20,4 @@ "url": "https://github.com/bend-n/remap/issues" }, "homepage": "https://github.com/bend-n/remap#readme" -} +}
\ No newline at end of file diff --git a/addons/remap/private/ActionIcon.gd b/addons/remap/private/ActionIcon.gd index 1e9853b..1af6654 100644 --- a/addons/remap/private/ActionIcon.gd +++ b/addons/remap/private/ActionIcon.gd @@ -2,14 +2,15 @@ @icon("../icons/action_icon.svg") extends PanelContainer +class_name ActionIcon ## The inner label. var label := Label.new() func _init(min_size: Vector2, font: Font, font_size: int) -> void: - label.horizontal_alignment = BoxContainer.ALIGNMENT_CENTER - label.vertical_alignment = BoxContainer.ALIGNMENT_CENTER + label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER + label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER add_child(label) label.custom_minimum_size = min_size label.add_theme_font_override("font", font) diff --git a/addons/remap/private/ActionIcons.gd b/addons/remap/private/ActionIcons.gd index eed0c38..7d2b61c 100644 --- a/addons/remap/private/ActionIcons.gd +++ b/addons/remap/private/ActionIcons.gd @@ -2,9 +2,7 @@ @icon("../icons/action_icons.svg") extends HBoxContainer - -const ActionIcon := preload("./ActionIcon.gd") -const IconMap := preload("./IconMap.gd") +class_name ActionIcons ## The action to follow. var action: String diff --git a/addons/remap/private/IconMap.gd b/addons/remap/private/IconMap.gd index ab82388..6bb6310 100644 --- a/addons/remap/private/IconMap.gd +++ b/addons/remap/private/IconMap.gd @@ -1,6 +1,7 @@ ## Maps inputevents to a [url=https://shinmera.github.io/promptfont/]prompt font[/url] icon. extends RefCounted +class_name IconMap ## The map for keys. const KEY_MAP := { diff --git a/project.godot b/project.godot index 6e6c7b3..6f24e8d 100644 --- a/project.godot +++ b/project.godot @@ -8,29 +8,13 @@ config_version=5 -_global_script_classes=[{ -"base": "HBoxContainer", -"class": &"ActionLabel", -"language": &"GDScript", -"path": "res://addons/remap/ActionLabel.gd" -}, { -"base": "HBoxContainer", -"class": &"RemapButton", -"language": &"GDScript", -"path": "res://addons/remap/RemapButton.gd" -}] -_global_script_class_icons={ -"ActionLabel": "res://addons/remap/icons/action_label.svg", -"RemapButton": "res://addons/remap/icons/remap_button.svg" -} - [application] config/name="test" run/main_scene="res://Test.tscn" config/use_custom_user_dir=true config/custom_user_dir_name="remap" -config/features=PackedStringArray("4.0") +config/features=PackedStringArray("4.1") [debug] @@ -49,11 +33,11 @@ window/size/test_height=720 input={ "deadzone": 0.5, -"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":65,"physical_keycode":0,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":true,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":65,"physical_keycode":0,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":65,"physical_keycode":0,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194317,"physical_keycode":0,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194319,"physical_keycode":0,"unicode":0,"echo":false,"script":null) +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":65,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":true,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":65,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":65,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194317,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194319,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) , Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":1.0,"script":null) , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":7,"pressure":0.0,"pressed":false,"script":null) , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":1,"pressure":0.0,"pressed":false,"script":null) |