diff --git a/Translations/Translations.pot b/Translations/Translations.pot index 900674b1f..e7ceccf34 100644 --- a/Translations/Translations.pot +++ b/Translations/Translations.pot @@ -391,6 +391,10 @@ msgstr "" msgid "Show Mouse Guides" msgstr "" +#. Found under the View menu. +msgid "Show Reference Images" +msgstr "" + #. Found under the View menu. When enabled, non-destructive layer effects will be visible on the canvas. msgid "Display Layer Effects" msgstr "" diff --git a/project.godot b/project.godot index 3dda6c0cf..b63d4ac8e 100644 --- a/project.godot +++ b/project.godot @@ -980,6 +980,10 @@ right_crop_tool={ "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":true,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":86,"key_label":0,"unicode":118,"location":0,"echo":false,"script":null) ] } +show_reference_images={ +"deadzone": 0.5, +"events": [] +} [input_devices] diff --git a/src/Autoload/Global.gd b/src/Autoload/Global.gd index b1add62ba..ca015a1db 100644 --- a/src/Autoload/Global.gd +++ b/src/Autoload/Global.gd @@ -50,6 +50,7 @@ enum ViewMenu { SHOW_RULERS, SHOW_GUIDES, SHOW_MOUSE_GUIDES, + SHOW_REFERENCE_IMAGES, DISPLAY_LAYER_EFFECTS, SNAP_TO, } @@ -579,6 +580,11 @@ var show_pixel_indices := false: show_pixel_indices = value if is_instance_valid(canvas.color_index): canvas.color_index.enabled = value +var show_reference_images := true: + set(value): + show_reference_images = value + if is_instance_valid(canvas.reference_image_container): + canvas.reference_image_container.visible = show_reference_images var display_layer_effects := true: set(value): if value == display_layer_effects: @@ -835,6 +841,7 @@ func _initialize_keychain() -> void: &"show_pixel_grid": Keychain.InputAction.new("", "View menu", true), &"show_guides": Keychain.InputAction.new("", "View menu", true), &"show_rulers": Keychain.InputAction.new("", "View menu", true), + &"show_reference_images": Keychain.InputAction.new("", "View menu", true), &"display_layer_effects": Keychain.InputAction.new("", "View menu", true), &"moveable_panels": Keychain.InputAction.new("", "Window menu", true), &"zen_mode": Keychain.InputAction.new("", "Window menu", true), diff --git a/src/UI/TopMenuContainer/TopMenuContainer.gd b/src/UI/TopMenuContainer/TopMenuContainer.gd index 940b5344e..7db21e726 100644 --- a/src/UI/TopMenuContainer/TopMenuContainer.gd +++ b/src/UI/TopMenuContainer/TopMenuContainer.gd @@ -242,6 +242,7 @@ func _setup_view_menu() -> void: "Show Rulers": "show_rulers", "Show Guides": "show_guides", "Show Mouse Guides": "", + "Show Reference Images": "show_reference_images", "Display Layer Effects": &"display_layer_effects", "Snap To": "", } @@ -259,6 +260,7 @@ func _setup_view_menu() -> void: _set_menu_shortcut(view_menu_items[item], view_menu, i, item, true) view_menu.set_item_checked(Global.ViewMenu.SHOW_RULERS, true) view_menu.set_item_checked(Global.ViewMenu.SHOW_GUIDES, true) + view_menu.set_item_checked(Global.ViewMenu.SHOW_REFERENCE_IMAGES, true) view_menu.set_item_checked(Global.ViewMenu.DISPLAY_LAYER_EFFECTS, true) view_menu.hide_on_checkable_item_selection = false view_menu.id_pressed.connect(view_menu_id_pressed) @@ -715,6 +717,11 @@ func view_menu_id_pressed(id: int) -> void: _toggle_show_guides() Global.ViewMenu.SHOW_MOUSE_GUIDES: _toggle_show_mouse_guides() + Global.ViewMenu.SHOW_REFERENCE_IMAGES: + Global.show_reference_images = not Global.show_reference_images + view_menu.set_item_checked( + Global.ViewMenu.SHOW_REFERENCE_IMAGES, Global.show_reference_images + ) Global.ViewMenu.SHOW_PIXEL_INDICES: _toggle_show_pixel_indices() Global.ViewMenu.DISPLAY_LAYER_EFFECTS: