rename props dict methods
This commit is contained in:
parent
8b66187fc1
commit
774570e1ed
@ -151,7 +151,7 @@ func load_props(_props: KeyProps, default_position: Vector3) -> void:
|
||||
_default_position = default_position
|
||||
|
||||
if props:
|
||||
_props.from_dictionary(props.to_dictionary())
|
||||
_props.chars_from_dict(props.chars_to_dict())
|
||||
props = _props
|
||||
|
||||
if (
|
||||
@ -219,7 +219,7 @@ func _set_labels_text() -> void:
|
||||
),
|
||||
}
|
||||
|
||||
props.from_dictionary(props_dict)
|
||||
props.chars_from_dict(props_dict)
|
||||
|
||||
if props.main_char and not props.shift_char:
|
||||
_upper_left_label.text = props.main_char
|
||||
|
||||
@ -216,7 +216,7 @@ func _regenerate_row(
|
||||
key_props.physical_keycode, config
|
||||
)
|
||||
if props_dict:
|
||||
key_props.from_dictionary(props_dict)
|
||||
key_props.chars_from_dict(props_dict)
|
||||
|
||||
var game_key := GameKey.instantiate_with_props(
|
||||
key_props, key_default_pos, self
|
||||
|
||||
@ -89,7 +89,7 @@ func _load_config() -> Error:
|
||||
continue
|
||||
|
||||
var dictionary := config.get_value(SECTION_KEYS, param_key, {}) as Dictionary
|
||||
key_props.from_dictionary(dictionary)
|
||||
key_props.chars_from_dict(dictionary)
|
||||
|
||||
layout_rows = rows
|
||||
|
||||
@ -109,7 +109,7 @@ func _save_config() -> Error:
|
||||
continue
|
||||
|
||||
config.set_value(
|
||||
SECTION_KEYS, str(key_props.physical_keycode), key_props.to_dictionary()
|
||||
SECTION_KEYS, str(key_props.physical_keycode), key_props.chars_to_dict()
|
||||
)
|
||||
|
||||
var err := config.save(CONFIG_PATH)
|
||||
|
||||
@ -33,7 +33,7 @@ func is_char() -> bool:
|
||||
return physical_keycode >= KEY_EXCLAM and physical_keycode <= KEY_SECTION
|
||||
|
||||
|
||||
func to_dictionary() -> Dictionary:
|
||||
func chars_to_dict() -> Dictionary:
|
||||
return {
|
||||
MAIN_CHAR: main_char,
|
||||
SHIFT_CHAR: shift_char,
|
||||
@ -42,7 +42,7 @@ func to_dictionary() -> Dictionary:
|
||||
}
|
||||
|
||||
|
||||
func from_dictionary(dictionary: Dictionary) -> void:
|
||||
func chars_from_dict(dictionary: Dictionary) -> void:
|
||||
if dictionary.has(MAIN_CHAR):
|
||||
main_char = dictionary[MAIN_CHAR]
|
||||
if dictionary.has(SHIFT_CHAR):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user