You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-18 14:21:41 +00:00
Added ability to override built-in actions for the editor
This adds the ability to add overrides for built-in actions (i.e. ui_*) in the editor. Also added a number of additional built-in actions for various text-related actions, gui-generic actions (like copy and paste) and graph-related actions (duplicate nodes), etc. Moved the definition of input actions to input_map, rather than in project_settings so the editor can make use of these actions as well.
This commit is contained in:
@@ -604,21 +604,21 @@ void Input::_parse_input_event_impl(const Ref<InputEvent> &p_event, bool p_is_em
|
||||
}
|
||||
}
|
||||
|
||||
for (const Map<StringName, InputMap::Action>::Element *E = InputMap::get_singleton()->get_action_map().front(); E; E = E->next()) {
|
||||
if (InputMap::get_singleton()->event_is_action(p_event, E->key())) {
|
||||
for (OrderedHashMap<StringName, InputMap::Action>::ConstElement E = InputMap::get_singleton()->get_action_map().front(); E; E = E.next()) {
|
||||
if (InputMap::get_singleton()->event_is_action(p_event, E.key())) {
|
||||
// If not echo and action pressed state has changed
|
||||
if (!p_event->is_echo() && is_action_pressed(E->key(), false) != p_event->is_action_pressed(E->key())) {
|
||||
if (!p_event->is_echo() && is_action_pressed(E.key(), false) != p_event->is_action_pressed(E.key())) {
|
||||
Action action;
|
||||
action.physics_frame = Engine::get_singleton()->get_physics_frames();
|
||||
action.process_frame = Engine::get_singleton()->get_process_frames();
|
||||
action.pressed = p_event->is_action_pressed(E->key());
|
||||
action.pressed = p_event->is_action_pressed(E.key());
|
||||
action.strength = 0.0f;
|
||||
action.raw_strength = 0.0f;
|
||||
action.exact = InputMap::get_singleton()->event_is_action(p_event, E->key(), true);
|
||||
action_state[E->key()] = action;
|
||||
action.exact = InputMap::get_singleton()->event_is_action(p_event, E.key(), true);
|
||||
action_state[E.key()] = action;
|
||||
}
|
||||
action_state[E->key()].strength = p_event->get_action_strength(E->key());
|
||||
action_state[E->key()].raw_strength = p_event->get_action_raw_strength(E->key());
|
||||
action_state[E.key()].strength = p_event->get_action_strength(E.key());
|
||||
action_state[E.key()].raw_strength = p_event->get_action_raw_strength(E.key());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user