make chars_to_dict omit empty chars

This commit is contained in:
Teatov 2025-07-31 10:10:48 +10:00
parent b1a8a41da3
commit 73b0f54093

View File

@ -94,9 +94,14 @@ func chars_from_dict(dict: Dictionary[Char, String], override: bool = true) -> K
func chars_to_dict() -> Dictionary[Char, String]:
return {
Char.MAIN: main_char,
Char.SHIFT: shift_char,
Char.ALT: alt_char,
Char.ALT_SHIFT: alt_shift_char,
}
var dict: Dictionary[Char, String] = {}
if main_char:
dict[Char.MAIN] = main_char
if shift_char:
dict[Char.SHIFT] = shift_char
if alt_char:
dict[Char.ALT] = alt_char
if alt_shift_char:
dict[Char.ALT_SHIFT] = alt_shift_char
return dict