mirror of
				https://github.com/godotengine/godot.git
				synced 2025-11-03 07:01:06 +00:00 
			
		
		
		
	use ED_IS_SHORTCUT macro instead of matches_event
This commit is contained in:
		
							parent
							
								
									0246230e2b
								
							
						
					
					
						commit
						47dba6bc56
					
				
					 3 changed files with 21 additions and 21 deletions
				
			
		| 
						 | 
					@ -834,20 +834,20 @@ void AnimationBezierTrackEdit::gui_input(const Ref<InputEvent> &p_event) {
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (p_event->is_pressed()) {
 | 
						if (p_event->is_pressed()) {
 | 
				
			||||||
		if (ED_GET_SHORTCUT("animation_editor/duplicate_selected_keys")->matches_event(p_event)) {
 | 
							if (ED_IS_SHORTCUT("animation_editor/duplicate_selected_keys", p_event)) {
 | 
				
			||||||
			if (!read_only) {
 | 
								if (!read_only) {
 | 
				
			||||||
				duplicate_selected_keys(-1.0);
 | 
									duplicate_selected_keys(-1.0);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			accept_event();
 | 
								accept_event();
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if (ED_GET_SHORTCUT("animation_editor/copy_selected_keys")->matches_event(p_event)) {
 | 
							if (ED_IS_SHORTCUT("animation_editor/copy_selected_keys", p_event)) {
 | 
				
			||||||
			if (!read_only) {
 | 
								if (!read_only) {
 | 
				
			||||||
				copy_selected_keys(false);
 | 
									copy_selected_keys(false);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			accept_event();
 | 
								accept_event();
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (ED_GET_SHORTCUT("animation_editor/paste_keys")->matches_event(p_event)) {
 | 
							if (ED_IS_SHORTCUT("animation_editor/paste_keys", p_event)) {
 | 
				
			||||||
			if (!read_only) {
 | 
								if (!read_only) {
 | 
				
			||||||
				paste_keys(-1.0);
 | 
									paste_keys(-1.0);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
| 
						 | 
					@ -858,7 +858,7 @@ void AnimationBezierTrackEdit::gui_input(const Ref<InputEvent> &p_event) {
 | 
				
			||||||
	Ref<InputEventKey> key_press = p_event;
 | 
						Ref<InputEventKey> key_press = p_event;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (key_press.is_valid() && key_press->is_pressed()) {
 | 
						if (key_press.is_valid() && key_press->is_pressed()) {
 | 
				
			||||||
		if (ED_GET_SHORTCUT("animation_bezier_editor/focus")->matches_event(p_event)) {
 | 
							if (ED_IS_SHORTCUT("animation_bezier_editor/focus", p_event)) {
 | 
				
			||||||
			SelectionSet focused_keys;
 | 
								SelectionSet focused_keys;
 | 
				
			||||||
			if (selection.is_empty()) {
 | 
								if (selection.is_empty()) {
 | 
				
			||||||
				for (int i = 0; i < edit_points.size(); ++i) {
 | 
									for (int i = 0; i < edit_points.size(); ++i) {
 | 
				
			||||||
| 
						 | 
					@ -927,7 +927,7 @@ void AnimationBezierTrackEdit::gui_input(const Ref<InputEvent> &p_event) {
 | 
				
			||||||
			queue_redraw();
 | 
								queue_redraw();
 | 
				
			||||||
			accept_event();
 | 
								accept_event();
 | 
				
			||||||
			return;
 | 
								return;
 | 
				
			||||||
		} else if (ED_GET_SHORTCUT("animation_bezier_editor/select_all_keys")->matches_event(p_event)) {
 | 
							} else if (ED_IS_SHORTCUT("animation_bezier_editor/select_all_keys", p_event)) {
 | 
				
			||||||
			for (int i = 0; i < edit_points.size(); ++i) {
 | 
								for (int i = 0; i < edit_points.size(); ++i) {
 | 
				
			||||||
				selection.insert(IntPair(edit_points[i].track, edit_points[i].key));
 | 
									selection.insert(IntPair(edit_points[i].track, edit_points[i].key));
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
| 
						 | 
					@ -935,7 +935,7 @@ void AnimationBezierTrackEdit::gui_input(const Ref<InputEvent> &p_event) {
 | 
				
			||||||
			queue_redraw();
 | 
								queue_redraw();
 | 
				
			||||||
			accept_event();
 | 
								accept_event();
 | 
				
			||||||
			return;
 | 
								return;
 | 
				
			||||||
		} else if (ED_GET_SHORTCUT("animation_bezier_editor/deselect_all_keys")->matches_event(p_event)) {
 | 
							} else if (ED_IS_SHORTCUT("animation_bezier_editor/deselect_all_keys", p_event)) {
 | 
				
			||||||
			selection.clear();
 | 
								selection.clear();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			queue_redraw();
 | 
								queue_redraw();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2685,33 +2685,33 @@ void AnimationTrackEdit::gui_input(const Ref<InputEvent> &p_event) {
 | 
				
			||||||
	ERR_FAIL_COND(p_event.is_null());
 | 
						ERR_FAIL_COND(p_event.is_null());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (p_event->is_pressed()) {
 | 
						if (p_event->is_pressed()) {
 | 
				
			||||||
		if (ED_GET_SHORTCUT("animation_editor/duplicate_selected_keys")->matches_event(p_event)) {
 | 
							if (ED_IS_SHORTCUT("animation_editor/duplicate_selected_keys", p_event)) {
 | 
				
			||||||
			if (!read_only) {
 | 
								if (!read_only) {
 | 
				
			||||||
				emit_signal(SNAME("duplicate_request"), -1.0);
 | 
									emit_signal(SNAME("duplicate_request"), -1.0);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			accept_event();
 | 
								accept_event();
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if (ED_GET_SHORTCUT("animation_editor/cut_selected_keys")->matches_event(p_event)) {
 | 
							if (ED_IS_SHORTCUT("animation_editor/cut_selected_keys", p_event)) {
 | 
				
			||||||
			if (!read_only) {
 | 
								if (!read_only) {
 | 
				
			||||||
				emit_signal(SNAME("cut_request"));
 | 
									emit_signal(SNAME("cut_request"));
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			accept_event();
 | 
								accept_event();
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if (ED_GET_SHORTCUT("animation_editor/copy_selected_keys")->matches_event(p_event)) {
 | 
							if (ED_IS_SHORTCUT("animation_editor/copy_selected_keys", p_event)) {
 | 
				
			||||||
			if (!read_only) {
 | 
								if (!read_only) {
 | 
				
			||||||
				emit_signal(SNAME("copy_request"));
 | 
									emit_signal(SNAME("copy_request"));
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			accept_event();
 | 
								accept_event();
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (ED_GET_SHORTCUT("animation_editor/paste_keys")->matches_event(p_event)) {
 | 
							if (ED_IS_SHORTCUT("animation_editor/paste_keys", p_event)) {
 | 
				
			||||||
			if (!read_only) {
 | 
								if (!read_only) {
 | 
				
			||||||
				emit_signal(SNAME("paste_request"), -1.0);
 | 
									emit_signal(SNAME("paste_request"), -1.0);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			accept_event();
 | 
								accept_event();
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (ED_GET_SHORTCUT("animation_editor/delete_selection")->matches_event(p_event)) {
 | 
							if (ED_IS_SHORTCUT("animation_editor/delete_selection", p_event)) {
 | 
				
			||||||
			if (!read_only) {
 | 
								if (!read_only) {
 | 
				
			||||||
				emit_signal(SNAME("delete_request"));
 | 
									emit_signal(SNAME("delete_request"));
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1285,25 +1285,25 @@ bool CanvasItemEditor::_gui_input_zoom_or_pan(const Ref<InputEvent> &p_event, bo
 | 
				
			||||||
	Ref<InputEventKey> k = p_event;
 | 
						Ref<InputEventKey> k = p_event;
 | 
				
			||||||
	if (k.is_valid()) {
 | 
						if (k.is_valid()) {
 | 
				
			||||||
		if (k->is_pressed()) {
 | 
							if (k->is_pressed()) {
 | 
				
			||||||
			if (ED_GET_SHORTCUT("canvas_item_editor/zoom_3.125_percent")->matches_event(p_event)) {
 | 
								if (ED_IS_SHORTCUT("canvas_item_editor/zoom_3.125_percent", p_event)) {
 | 
				
			||||||
				_shortcut_zoom_set(1.0 / 32.0);
 | 
									_shortcut_zoom_set(1.0 / 32.0);
 | 
				
			||||||
			} else if (ED_GET_SHORTCUT("canvas_item_editor/zoom_6.25_percent")->matches_event(p_event)) {
 | 
								} else if (ED_IS_SHORTCUT("canvas_item_editor/zoom_6.25_percent", p_event)) {
 | 
				
			||||||
				_shortcut_zoom_set(1.0 / 16.0);
 | 
									_shortcut_zoom_set(1.0 / 16.0);
 | 
				
			||||||
			} else if (ED_GET_SHORTCUT("canvas_item_editor/zoom_12.5_percent")->matches_event(p_event)) {
 | 
								} else if (ED_IS_SHORTCUT("canvas_item_editor/zoom_12.5_percent", p_event)) {
 | 
				
			||||||
				_shortcut_zoom_set(1.0 / 8.0);
 | 
									_shortcut_zoom_set(1.0 / 8.0);
 | 
				
			||||||
			} else if (ED_GET_SHORTCUT("canvas_item_editor/zoom_25_percent")->matches_event(p_event)) {
 | 
								} else if (ED_IS_SHORTCUT("canvas_item_editor/zoom_25_percent", p_event)) {
 | 
				
			||||||
				_shortcut_zoom_set(1.0 / 4.0);
 | 
									_shortcut_zoom_set(1.0 / 4.0);
 | 
				
			||||||
			} else if (ED_GET_SHORTCUT("canvas_item_editor/zoom_50_percent")->matches_event(p_event)) {
 | 
								} else if (ED_IS_SHORTCUT("canvas_item_editor/zoom_50_percent", p_event)) {
 | 
				
			||||||
				_shortcut_zoom_set(1.0 / 2.0);
 | 
									_shortcut_zoom_set(1.0 / 2.0);
 | 
				
			||||||
			} else if (ED_GET_SHORTCUT("canvas_item_editor/zoom_100_percent")->matches_event(p_event)) {
 | 
								} else if (ED_IS_SHORTCUT("canvas_item_editor/zoom_100_percent", p_event)) {
 | 
				
			||||||
				_shortcut_zoom_set(1.0);
 | 
									_shortcut_zoom_set(1.0);
 | 
				
			||||||
			} else if (ED_GET_SHORTCUT("canvas_item_editor/zoom_200_percent")->matches_event(p_event)) {
 | 
								} else if (ED_IS_SHORTCUT("canvas_item_editor/zoom_200_percent", p_event)) {
 | 
				
			||||||
				_shortcut_zoom_set(2.0);
 | 
									_shortcut_zoom_set(2.0);
 | 
				
			||||||
			} else if (ED_GET_SHORTCUT("canvas_item_editor/zoom_400_percent")->matches_event(p_event)) {
 | 
								} else if (ED_IS_SHORTCUT("canvas_item_editor/zoom_400_percent", p_event)) {
 | 
				
			||||||
				_shortcut_zoom_set(4.0);
 | 
									_shortcut_zoom_set(4.0);
 | 
				
			||||||
			} else if (ED_GET_SHORTCUT("canvas_item_editor/zoom_800_percent")->matches_event(p_event)) {
 | 
								} else if (ED_IS_SHORTCUT("canvas_item_editor/zoom_800_percent", p_event)) {
 | 
				
			||||||
				_shortcut_zoom_set(8.0);
 | 
									_shortcut_zoom_set(8.0);
 | 
				
			||||||
			} else if (ED_GET_SHORTCUT("canvas_item_editor/zoom_1600_percent")->matches_event(p_event)) {
 | 
								} else if (ED_IS_SHORTCUT("canvas_item_editor/zoom_1600_percent", p_event)) {
 | 
				
			||||||
				_shortcut_zoom_set(16.0);
 | 
									_shortcut_zoom_set(16.0);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue