diff --git a/scenes/game_key.tscn b/scenes/game_key.tscn index 397a066..82322b0 100644 --- a/scenes/game_key.tscn +++ b/scenes/game_key.tscn @@ -55,9 +55,6 @@ _center_label = NodePath("Labels/CenterLabel") _press_light = NodePath("Effects/PressLight") _adjacency_light = NodePath("Effects/AdjacencyLight") _sfx_player = NodePath("SFXPlayer") -_light_fade_duration = null -_starting_pop_offset = null -_rotation_damping = null _press_sfx = SubResource("AudioStreamRandomizer_agrko") _release_sfx = SubResource("AudioStreamRandomizer_ch32x") diff --git a/scripts/globals/layout_config.gd b/scripts/globals/layout_config.gd index be7ac29..862ae95 100644 --- a/scripts/globals/layout_config.gd +++ b/scripts/globals/layout_config.gd @@ -38,10 +38,10 @@ func _unhandled_input(event: InputEvent) -> void: func get_key_config_dict(keycode: Key) -> Dictionary: - var param_key := str(keycode) - if not _config.has_section_key(SECTION_KEYS, param_key): + var config_key := OS.get_keycode_string(keycode) + if not _config.has_section_key(SECTION_KEYS, config_key): return {} - return _config.get_value(SECTION_KEYS, param_key, {}) as Dictionary + return _config.get_value(SECTION_KEYS, config_key, {}) as Dictionary func change_layout(layout_name: String) -> void: @@ -88,17 +88,17 @@ func _load_config() -> Error: for key_props_row: Array[KeyProps] in layout_key_props_rows: for key_props in key_props_row: - var keycode := str(key_props.keycode) + var config_key := OS.get_keycode_string(key_props.keycode) if ( not key_props.is_unicode() - or not _config.has_section_key(SECTION_KEYS, keycode) + or not _config.has_section_key(SECTION_KEYS, config_key) ): continue - var chars_dict: Variant = _config.get_value(SECTION_KEYS, keycode) - if chars_dict is not Dictionary[String,String]: + var chars_dict: Variant = _config.get_value(SECTION_KEYS, config_key) + if chars_dict is not Dictionary: continue - key_props.chars_from_dict(chars_dict as Dictionary[String,String]) + key_props.chars_from_dict(chars_dict as Dictionary) print("layout config loaded!\n") @@ -114,7 +114,9 @@ func _save_config() -> Error: continue _config.set_value( - SECTION_KEYS, str(key_props.keycode), key_props.chars_to_dict() + SECTION_KEYS, + OS.get_keycode_string(key_props.keycode), + key_props.chars_to_dict() ) var err := _config.save(CONFIG_PATH) diff --git a/scripts/key_props.gd b/scripts/key_props.gd index a9a84fb..54200e7 100644 --- a/scripts/key_props.gd +++ b/scripts/key_props.gd @@ -127,8 +127,8 @@ func chars_from_dict(dict: Dictionary, override: bool = true) -> KeyProps: return self -func chars_to_dict() -> Dictionary[String, String]: - var dict: Dictionary[String, String] = {} +func chars_to_dict() -> Dictionary: + var dict: Dictionary = {} if main_char: dict[CHAR_MAIN] = main_char if shift_char: