From cb4c54617ac2fb0bac090420798b7d3297251444 Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas Date: Fri, 8 Jul 2022 02:49:40 +0300 Subject: [PATCH] Make the right tool indicator enabled by default and orange, closes #691 --- src/Autoload/Global.gd | 4 +++- src/Autoload/Tools.gd | 6 +++--- src/Tools/BaseTool.gd | 5 +++-- src/Tools/Draw.gd | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/Autoload/Global.gd b/src/Autoload/Global.gd index 167819ea7..0f13ffee7 100644 --- a/src/Autoload/Global.gd +++ b/src/Autoload/Global.gd @@ -80,6 +80,8 @@ var modulate_icon_color := Color.gray var icon_color_from: int = IconColorFrom.THEME var custom_icon_color := Color.gray var tool_button_size: int = ButtonSize.SMALL +var left_tool_color := Color("0086cf") +var right_tool_color := Color("fd6d14") var default_width := 64 var default_height := 64 @@ -117,7 +119,7 @@ var enable_autosave := true var show_left_tool_icon := true var show_right_tool_icon := true var left_square_indicator_visible := true -var right_square_indicator_visible := false +var right_square_indicator_visible := true var native_cursors := false var cross_cursor := true diff --git a/src/Autoload/Tools.gd b/src/Autoload/Tools.gd index cf6e597c7..789e8dda6 100644 --- a/src/Autoload/Tools.gd +++ b/src/Autoload/Tools.gd @@ -361,10 +361,10 @@ func update_tool_cursors() -> void: func draw_indicator() -> void: - if Global.left_square_indicator_visible: - _slots[BUTTON_LEFT].tool_node.draw_indicator() if Global.right_square_indicator_visible: - _slots[BUTTON_RIGHT].tool_node.draw_indicator() + _slots[BUTTON_RIGHT].tool_node.draw_indicator(false) + if Global.left_square_indicator_visible: + _slots[BUTTON_LEFT].tool_node.draw_indicator(true) func draw_preview() -> void: diff --git a/src/Tools/BaseTool.gd b/src/Tools/BaseTool.gd index 387fc41f9..f834d4b80 100644 --- a/src/Tools/BaseTool.gd +++ b/src/Tools/BaseTool.gd @@ -63,9 +63,10 @@ func cursor_move(position: Vector2) -> void: _cursor = position -func draw_indicator() -> void: +func draw_indicator(left: bool) -> void: var rect := Rect2(_cursor, Vector2.ONE) - Global.canvas.indicators.draw_rect(rect, Color.blue, false) + var color := Global.left_tool_color if left else Global.right_tool_color + Global.canvas.indicators.draw_rect(rect, color, false) func draw_preview() -> void: diff --git a/src/Tools/Draw.gd b/src/Tools/Draw.gd index 2dfd004cf..452ed0340 100644 --- a/src/Tools/Draw.gd +++ b/src/Tools/Draw.gd @@ -403,8 +403,9 @@ func remove_unselected_parts_of_brush(brush: Image, dst: Vector2) -> Image: return new_brush -func draw_indicator() -> void: - draw_indicator_at(_cursor, Vector2.ZERO, Color.blue) +func draw_indicator(left: bool) -> void: + var color := Global.left_tool_color if left else Global.right_tool_color + draw_indicator_at(_cursor, Vector2.ZERO, color) if Global.current_project.tiles.mode and Global.current_project.tiles.has_point(_cursor): var position := _line_start if _draw_line else _cursor var nearest_tile := Global.current_project.tiles.get_nearest_tile(position)