Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # v2.0
- def start_config_resetting
- button_data = Cirno::Persistence.default_key_mapping
- defined_key = get_defined_keys
- for i in 0 ... Cirno::Persistence.keys.size
- data = []
- key = Cirno::Persistence.keys[i]
- for op in 0 ... Mewgles_SystemOptionsEdit::KEY_COLUMNS
- if button_data[key][op] == defined_key[key][op]
- data << button_data[key][op]
- else
- data << defined_key[key][op]
- end
- end
- data = data.compact
- Input.set_keys_from_flag(Cirno::Persistence.keys[i], data)
- end
- Cirno::Persistence.write_keyboard_settings
- end
- def get_defined_keys
- button_data = {}
- for flag in Cirno::Persistence.keys
- key_data = []
- keys = Input.get_keys_from_flag(flag)
- for i in 0 ... Mewgles_SystemOptionsEdit::KEY_COLUMNS
- if keys[i]
- key_data << keys[i]
- end
- end
- button_data[flag] = key_data
- end
- return button_data
- end
- start_config_resetting
Add Comment
Please, Sign In to add comment