Small improvements and fixed cut and paste tool.

This commit is contained in:
Relintai 2022-11-18 14:05:57 +01:00
parent 0474e50c53
commit a0a7b778ca
2 changed files with 11 additions and 4 deletions

View File

@ -334,9 +334,7 @@ func tool_process(local_position : Vector2, event: InputEvent) -> void:
if !_current_action: if !_current_action:
_current_action = get_action() _current_action = get_action()
if current_tool == TOOL_PENCIL || current_tool == TOOL_LINE || \ if current_tool == TOOL_PENCIL || current_tool == TOOL_LINE || current_tool == TOOL_RECT:
current_tool == TOOL_RECT || current_tool == TOOL_DARKEN || \
current_tool == TOOL_BRIGHTEN || current_tool == TOOL_LINE:
var arr : Array = Array() var arr : Array = Array()
@ -348,6 +346,15 @@ func tool_process(local_position : Vector2, event: InputEvent) -> void:
elif _mouse_button_down == BUTTON_RIGHT: elif _mouse_button_down == BUTTON_RIGHT:
arr.push_back(Color(1, 1, 1, 0)) arr.push_back(Color(1, 1, 1, 0))
do_action(arr)
elif current_tool == TOOL_DARKEN || current_tool == TOOL_BRIGHTEN || current_tool == TOOL_CUT:
var arr : Array = Array()
arr.push_back(cell_mouse_position)
arr.push_back(last_cell_mouse_position)
arr.push_back(get_current_color())
do_action(arr) do_action(arr)
elif current_tool == TOOL_BRUSH: elif current_tool == TOOL_BRUSH:
var arr : Array = Array() var arr : Array = Array()

View File

@ -28,7 +28,7 @@ size = Vector2( 32, 32 )
[node name="PaintProject" type="PaintProject"] [node name="PaintProject" type="PaintProject"]
size = Vector2i( 128, 128 ) size = Vector2i( 128, 128 )
current_color = Color( 0.658824, 0.313726, 0.207843, 1 ) current_color = Color( 0.678431, 0.113725, 0.0823529, 1 )
color_presets = PoolColorArray( 0.67914, 0.117493, 0.0852439, 1, 0.129412, 0.113725, 0.384314, 1, 0.0666667, 0.796078, 0.196078, 1, 0.0666667, 0.796078, 0.196078, 1, 0.964706, 0.992157, 0.121569, 1, 0.00784314, 0.835294, 0.564706, 1, 0.0666667, 0.796078, 0.196078, 1, 0.658824, 0.313726, 0.207843, 1 ) color_presets = PoolColorArray( 0.67914, 0.117493, 0.0852439, 1, 0.129412, 0.113725, 0.384314, 1, 0.0666667, 0.796078, 0.196078, 1, 0.0666667, 0.796078, 0.196078, 1, 0.964706, 0.992157, 0.121569, 1, 0.00784314, 0.835294, 0.564706, 1, 0.0666667, 0.796078, 0.196078, 1, 0.658824, 0.313726, 0.207843, 1 )
script = ExtResource( 2 ) script = ExtResource( 2 )