From 386473845ea079a540d6b933a8364f828583d499 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 27 Dec 2019 16:14:01 +0100 Subject: [PATCH] Fix GDScript warnings pertaining to unused arguments Those warnings can be ignored by prefixing the argument with an underscore. --- Scripts/Canvas.gd | 2 +- Scripts/LayerContainer.gd | 2 +- Scripts/Palette/EditPalettePopup.gd | 2 +- Scripts/Palette/PaletteButton.gd | 6 +++--- Scripts/Palette/PaletteContainer.gd | 1 - 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Scripts/Canvas.gd b/Scripts/Canvas.gd index eb6ebab48..d108cd723 100644 --- a/Scripts/Canvas.gd +++ b/Scripts/Canvas.gd @@ -885,4 +885,4 @@ func blend_rect(bg : Image, brush : Image, src_rect : Rect2, dst : Vector2) -> v out_color.r = (brush_color.r * brush_color.a + bg_color.r * bg_color.a * (1 - brush_color.a)) / out_color.a out_color.g = (brush_color.g * brush_color.a + bg_color.g * bg_color.a * (1 - brush_color.a)) / out_color.a out_color.b = (brush_color.b * brush_color.a + bg_color.b * bg_color.a * (1 - brush_color.a)) / out_color.a - bg.set_pixel(dst_x, dst_y, out_color) \ No newline at end of file + bg.set_pixel(dst_x, dst_y, out_color) diff --git a/Scripts/LayerContainer.gd b/Scripts/LayerContainer.gd index fead16178..27a37a761 100644 --- a/Scripts/LayerContainer.gd +++ b/Scripts/LayerContainer.gd @@ -82,4 +82,4 @@ func _on_VisibilityButton_pressed() -> void: func _on_LineEdit_text_changed(new_text : String) -> void: Global.canvas.layers[i][2] = new_text - label.text = new_text \ No newline at end of file + label.text = new_text diff --git a/Scripts/Palette/EditPalettePopup.gd b/Scripts/Palette/EditPalettePopup.gd index c1fc3f1a2..2603a970d 100644 --- a/Scripts/Palette/EditPalettePopup.gd +++ b/Scripts/Palette/EditPalettePopup.gd @@ -115,5 +115,5 @@ func _on_EditPaletteColorPicker_color_changed(color : Color) -> void: working_palette.set_color(current_swatch, color) _refresh_hint_tooltip(current_swatch) -func _refresh_hint_tooltip(index : int): +func _refresh_hint_tooltip(_index : int): palette_grid.get_child(current_swatch).hint_tooltip = "#" + working_palette.get_color_data(current_swatch).to_upper() + " " + working_palette.get_color_name(current_swatch) diff --git a/Scripts/Palette/PaletteButton.gd b/Scripts/Palette/PaletteButton.gd index eaf176dab..5d90bfb8e 100644 --- a/Scripts/Palette/PaletteButton.gd +++ b/Scripts/Palette/PaletteButton.gd @@ -7,7 +7,7 @@ export var draggable := false var drag_preview_texture = preload("res://Assets/Graphics/Palette/swatch_drag_preview.png") -func get_drag_data(position): +func get_drag_data(_position): var data = null; if(draggable): #print(String(get_instance_id()) + ": Drag Start"); @@ -18,8 +18,8 @@ func get_drag_data(position): set_drag_preview(drag_icon); return data; -func can_drop_data(position, data): +func can_drop_data(_position, _data): return true; -func drop_data(position, data): +func drop_data(_position, data): emit_signal("on_drop_data", data.source_index, index); diff --git a/Scripts/Palette/PaletteContainer.gd b/Scripts/Palette/PaletteContainer.gd index 5b7ac2d39..a7bb1fbfe 100644 --- a/Scripts/Palette/PaletteContainer.gd +++ b/Scripts/Palette/PaletteContainer.gd @@ -43,7 +43,6 @@ func on_import_palette() -> void: Global.palette_import_file_dialog.popup_centered() func on_palette_import_file_selected(path) -> void: - var file := File.new() var palette : Palette = null if path.to_lower().ends_with("json"): palette = Palette.new().load_from_file(path)