Add setting for moving selection with selection tool

Hide Element Fill Tool mode in 2D editor
This commit is contained in:
JannisX11 2023-11-23 13:52:33 +01:00
parent 7a6ed15caa
commit 7f79e0a89f
4 changed files with 7 additions and 4 deletions

View File

@ -502,6 +502,7 @@ const Settings = {
if (!value) scene.remove(Canvas.brush_outline);
}});
new Setting('outlines_in_paint_mode', {category: 'paint', value: true});
new Setting('move_with_selection_tool', {category: 'paint', value: true});
new Setting('pick_color_opacity', {category: 'paint', value: false});
new Setting('paint_through_transparency', {category: 'paint', value: true});
new Setting('paint_side_restrict', {category: 'paint', value: true});

View File

@ -2678,7 +2678,7 @@ BARS.defineActions(function() {
condition: () => Toolbox && Toolbox.selected.id === 'fill_tool',
options: {
face: true,
element: true,
element: {name: true, condition: () => !Format.image_editor},
color_connected: true,
color: true,
}

View File

@ -2227,7 +2227,7 @@ Interface.definePanels(function() {
this.mouse_coords.x = x;
this.mouse_coords.y = y;
let grab = Toolbox.selected.id == 'move_layer_tool' ||
(Toolbox.selected.id == 'selection_tool' && this.texture && this.texture.selection.get(this.mouse_coords.x, this.mouse_coords.y) && BarItems.selection_tool_operation_mode.value == 'create');
(Toolbox.selected.id == 'selection_tool' && settings.move_with_selection_tool.value && this.texture && this.texture.selection.get(this.mouse_coords.x, this.mouse_coords.y) && BarItems.selection_tool_operation_mode.value == 'create');
this.$refs.frame.style.cursor = grab ? 'move' : '';
},
onMouseWheel(event) {
@ -3263,7 +3263,7 @@ Interface.definePanels(function() {
let start_x, start_y, calcrect;
let layer = texture.selected_layer;
let create_selection = Toolbox.selected.id == 'selection_tool'
&& !(op_mode == 'create' && clicked_val)
&& !(op_mode == 'create' && settings.move_with_selection_tool.value && clicked_val)
&& !event.target.classList.contains('uv_layer_transform_handles');
let initial_offset = layer ? layer.offset.slice() : [0, 0];
@ -3539,7 +3539,7 @@ Interface.definePanels(function() {
isTransformingLayer() {
if (!this.texture || !this.texture.selected_layer) return false;
let tool = Toolbox.selected;
if (tool.id == 'move_layer_tool' || (tool.id == 'selection_tool' && TextureLayer.selected?.in_limbo)) {
if (tool.id == 'move_layer_tool' || (tool.id == 'selection_tool' && settings.move_with_selection_tool.value && TextureLayer.selected?.in_limbo)) {
return true;
}
return false;

View File

@ -961,6 +961,8 @@
"settings.brush_cursor_3d.desc": "Display an outline around the brush in the 3D workspace",
"settings.outlines_in_paint_mode": "Selection Outlines in Paint Mode",
"settings.outlines_in_paint_mode.desc": "Display element selection outlines while in paint mode",
"settings.move_with_selection_tool": "Use Selection Tool to Move Selections",
"settings.move_with_selection_tool.desc": "Allow the Selection Tool to directly move selections, without having to switch to the Move Layer tool",
"settings.paint_through_transparency": "Paint Through Transparency",
"settings.paint_through_transparency.desc": "Paint through transparent pixels when Lock Alpha Channel is enabled",
"settings.paint_side_restrict": "Restrict Brush to Side",