diff --git a/game/PaintCanvas.gd b/game/PaintCanvas.gd index 0c3b389..137b899 100644 --- a/game/PaintCanvas.gd +++ b/game/PaintCanvas.gd @@ -61,8 +61,10 @@ func handle_left_mouse_button_down(local_position : Vector2, event: InputEvent) var arr : Array = Array() arr.push_back(cell_mouse_position) arr.push_back(last_cell_mouse_position) - #STORE color here arr.push_back(get_current_color()) + + do_action(arr) + commit_action() elif current_tool == TOOL_COLORPICKER: var c : Color = get_pixel(cell_mouse_position.x, cell_mouse_position.y); @@ -104,16 +106,6 @@ func handle_right_mouse_button_down(local_position : Vector2, event: InputEvent) if current_tool == TOOL_CUT: if !event.is_pressed(): commit_action() - elif current_tool == TOOL_BUCKET: - if !_current_action: - _current_action = get_action() - - 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_COLORPICKER: current_tool = get_previous_tool() elif current_tool == TOOL_PASTECUT: @@ -331,8 +323,7 @@ func _on_tool_changed() -> void: _selection_cells.resize(0); _selection_colors.resize(0); - if get_previous_tool() != TOOL_BUCKET: - _current_action = get_action() + _current_action = get_action() func tool_process(local_position : Vector2, event: InputEvent) -> void: if current_tool == TOOL_COLORPICKER: diff --git a/game/Project.tscn b/game/Project.tscn index 533cba3..4cec6b6 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.960784, 0.376471, 0.0392157, 1 ) +current_color = Color( 0.0666667, 0.796078, 0.196078, 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 ) @@ -50,5 +50,4 @@ script = ExtResource( 3 ) size = Vector2i( 128, 128 ) brush_prefab = 1 brush_size = 3 -current_tool = 2 script = ExtResource( 1 )