feat: updated engine version to 4.4-rc1

This commit is contained in:
Sara 2025-02-23 14:38:14 +01:00
parent ee00efde1f
commit 21ba8e33af
5459 changed files with 1128836 additions and 198305 deletions

View file

@ -296,7 +296,7 @@ void TextureRegionEditor::_set_grid_parameters_clamping(bool p_enabled) {
}
void TextureRegionEditor::_texture_overlay_input(const Ref<InputEvent> &p_input) {
if (panner->gui_input(p_input)) {
if (panner->gui_input(p_input, texture_overlay->get_global_rect())) {
return;
}
@ -824,10 +824,6 @@ void TextureRegionEditor::_notification(int p_what) {
[[fallthrough]];
}
case NOTIFICATION_READY: {
panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/sub_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EDITOR_GET("editors/panning/simple_panning")));
} break;
case NOTIFICATION_ENTER_TREE: {
get_tree()->connect("node_removed", callable_mp(this, &TextureRegionEditor::_node_removed));
@ -835,6 +831,9 @@ void TextureRegionEditor::_notification(int p_what) {
if (snap_mode == SNAP_AUTOSLICE && is_visible() && autoslice_is_dirty) {
_update_autoslice();
}
panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/sub_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EDITOR_GET("editors/panning/simple_panning")));
panner->setup_warped_panning(get_viewport(), EDITOR_GET("editors/panning/warped_mouse_panning"));
} break;
case NOTIFICATION_EXIT_TREE: {
@ -845,9 +844,9 @@ void TextureRegionEditor::_notification(int p_what) {
texture_preview->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("TextureRegionPreviewBG"), EditorStringName(EditorStyles)));
texture_overlay->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("TextureRegionPreviewFG"), EditorStringName(EditorStyles)));
zoom_out->set_icon(get_editor_theme_icon(SNAME("ZoomLess")));
zoom_reset->set_icon(get_editor_theme_icon(SNAME("ZoomReset")));
zoom_in->set_icon(get_editor_theme_icon(SNAME("ZoomMore")));
zoom_out->set_button_icon(get_editor_theme_icon(SNAME("ZoomLess")));
zoom_reset->set_button_icon(get_editor_theme_icon(SNAME("ZoomReset")));
zoom_in->set_button_icon(get_editor_theme_icon(SNAME("ZoomMore")));
} break;
case NOTIFICATION_VISIBILITY_CHANGED: {
@ -1107,12 +1106,34 @@ Vector2 TextureRegionEditor::snap_point(Vector2 p_target) const {
return p_target;
}
void TextureRegionEditor::shortcut_input(const Ref<InputEvent> &p_event) {
const Ref<InputEventKey> k = p_event;
if (k.is_valid() && k->is_pressed()) {
bool handled = false;
if (ED_IS_SHORTCUT("ui_undo", p_event)) {
EditorNode::get_singleton()->undo();
handled = true;
}
if (ED_IS_SHORTCUT("ui_redo", p_event)) {
EditorNode::get_singleton()->redo();
handled = true;
}
if (handled) {
set_input_as_handled();
}
}
}
void TextureRegionEditor::_bind_methods() {
ClassDB::bind_method(D_METHOD("_update_rect"), &TextureRegionEditor::_update_rect);
}
TextureRegionEditor::TextureRegionEditor() {
set_title(TTR("Region Editor"));
set_process_shortcut_input(true);
set_ok_button_text(TTR("Close"));
// A power-of-two value works better as a default grid size.
@ -1270,7 +1291,7 @@ bool EditorInspectorPluginTextureRegion::parse_property(Object *p_object, const
if ((p_type == Variant::RECT2 || p_type == Variant::RECT2I)) {
if (((Object::cast_to<Sprite2D>(p_object) || Object::cast_to<Sprite3D>(p_object) || Object::cast_to<NinePatchRect>(p_object) || Object::cast_to<StyleBoxTexture>(p_object)) && p_path == "region_rect") || (Object::cast_to<AtlasTexture>(p_object) && p_path == "region")) {
Button *button = EditorInspector::create_inspector_action_button(TTR("Edit Region"));
button->set_icon(texture_region_editor->get_editor_theme_icon(SNAME("RegionEdit")));
button->set_button_icon(texture_region_editor->get_editor_theme_icon(SNAME("RegionEdit")));
button->connect(SceneStringName(pressed), callable_mp(this, &EditorInspectorPluginTextureRegion::_region_edit).bind(p_object));
add_property_editor(p_path, button, true);
}