You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Use EditorUndoRedoManager to track the property changes of the
configured `InputEvent` in the plugin This allows undo and redo, and can mark in time whether the handled `InputEvent` resource is edited. `command_or_control_autoremap` needs to be handled separately, as its value will change the usage of other properties.
This commit is contained in:
@@ -153,6 +153,9 @@ int64_t InputEventFromWindow::get_window_id() const {
|
||||
///////////////////////////////////
|
||||
|
||||
void InputEventWithModifiers::set_command_or_control_autoremap(bool p_enabled) {
|
||||
if (command_or_control_autoremap == p_enabled) {
|
||||
return;
|
||||
}
|
||||
command_or_control_autoremap = p_enabled;
|
||||
if (command_or_control_autoremap) {
|
||||
if (OS::get_singleton()->has_feature("macos") || OS::get_singleton()->has_feature("web_macos") || OS::get_singleton()->has_feature("web_ios")) {
|
||||
@@ -166,6 +169,7 @@ void InputEventWithModifiers::set_command_or_control_autoremap(bool p_enabled) {
|
||||
ctrl_pressed = false;
|
||||
meta_pressed = false;
|
||||
}
|
||||
notify_property_list_changed();
|
||||
emit_changed();
|
||||
}
|
||||
|
||||
@@ -309,9 +313,11 @@ void InputEventWithModifiers::_validate_property(PropertyInfo &p_property) const
|
||||
// Cannot be used with Meta/Command or Control!
|
||||
if (p_property.name == "meta_pressed") {
|
||||
p_property.usage ^= PROPERTY_USAGE_STORAGE;
|
||||
p_property.usage ^= PROPERTY_USAGE_EDITOR;
|
||||
}
|
||||
if (p_property.name == "ctrl_pressed") {
|
||||
p_property.usage ^= PROPERTY_USAGE_STORAGE;
|
||||
p_property.usage ^= PROPERTY_USAGE_EDITOR;
|
||||
}
|
||||
} else {
|
||||
if (p_property.name == "command_or_control_autoremap") {
|
||||
|
||||
Reference in New Issue
Block a user