From a0a7b778ca978689a9f2f2be282986f07a2d8dcf Mon Sep 17 00:00:00 2001 From: Relintai Date: Fri, 18 Nov 2022 14:05:57 +0100 Subject: [PATCH] Small improvements and fixed cut and paste tool. --- game/PaintCanvas.gd | 13 ++++++++++--- game/Project.tscn | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/game/PaintCanvas.gd b/game/PaintCanvas.gd index 09e44be..657587c 100644 --- a/game/PaintCanvas.gd +++ b/game/PaintCanvas.gd @@ -334,9 +334,7 @@ func tool_process(local_position : Vector2, event: InputEvent) -> void: if !_current_action: _current_action = get_action() - if current_tool == TOOL_PENCIL || current_tool == TOOL_LINE || \ - current_tool == TOOL_RECT || current_tool == TOOL_DARKEN || \ - current_tool == TOOL_BRIGHTEN || current_tool == TOOL_LINE: + if current_tool == TOOL_PENCIL || current_tool == TOOL_LINE || current_tool == TOOL_RECT: var arr : Array = Array() @@ -348,6 +346,15 @@ func tool_process(local_position : Vector2, event: InputEvent) -> void: elif _mouse_button_down == BUTTON_RIGHT: 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) elif current_tool == TOOL_BRUSH: var arr : Array = Array() diff --git a/game/Project.tscn b/game/Project.tscn index 8493f18..5f45ff9 100644 --- a/game/Project.tscn +++ b/game/Project.tscn @@ -28,7 +28,7 @@ size = Vector2( 32, 32 ) [node name="PaintProject" type="PaintProject"] 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 ) script = ExtResource( 2 )