Skip to content

Commit 2ec7d1f

Browse files
authored
Cleanup warnings (#350)
1 parent 2dc1ae6 commit 2ec7d1f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+86
-100
lines changed

addons/gaea/editor/create_node_popup.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func _input(event: InputEvent) -> void:
2525

2626
func _on_tool_button_pressed() -> void:
2727
tool_popup.position = Vector2(position) + tool_button.get_global_rect().end
28-
tool_popup.position.x -= tool_button.size.x
28+
tool_popup.position.x -= roundi(tool_button.size.x)
2929
tool_popup.popup()
3030

3131

addons/gaea/editor/create_node_tree.gd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func _on_search_bar_text_changed(new_text: String) -> void:
132132
get_root().set_collapsed_recursive(false)
133133

134134
var item: TreeItem = get_root()
135-
var first_item_found: TreeItem
135+
var first_item_found: TreeItem = null
136136

137137
while item.get_next_in_tree() != null:
138138
item = item.get_next_in_tree()
@@ -141,7 +141,7 @@ func _on_search_bar_text_changed(new_text: String) -> void:
141141
else:
142142
var item_matched = new_text.is_subsequence_ofn(item.get_text(0))
143143
if item_matched and item.is_selectable(0):
144-
if not first_item_found:
144+
if first_item_found == null:
145145
first_item_found = item
146146
item.visible = true
147147
_show_parents_recursive(item)
@@ -182,6 +182,6 @@ func _show_parents_recursive(item: TreeItem) -> void:
182182
parent_item = parent_item.get_parent()
183183

184184

185-
func _on_search_bar_text_submitted(new_text: String) -> void:
185+
func _on_search_bar_text_submitted(_new_text: String) -> void:
186186
if get_selected() != null:
187187
_on_item_activated()

addons/gaea/editor/gradient_visualizer.gd

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@tool
12
extends TextureRect
23

34

@@ -17,8 +18,8 @@ func _ready() -> void:
1718

1819
func update() -> void:
1920
var image: Image = Image.create_empty(SIZE.x, SIZE.y, false, Image.FORMAT_RGB8)
20-
for x in SIZE.x / CHECKERBOARD_SIZE.x:
21-
for y in SIZE.y / CHECKERBOARD_SIZE.y:
21+
for x in roundi(float(SIZE.x) / CHECKERBOARD_SIZE.x):
22+
for y in roundi(float(SIZE.y) / CHECKERBOARD_SIZE.y):
2223
image.fill_rect(Rect2i(
2324
Vector2i(x, y) * CHECKERBOARD_SIZE,
2425
CHECKERBOARD_SIZE
@@ -39,8 +40,8 @@ func update() -> void:
3940
var color: Color = Color.TRANSPARENT if not is_instance_valid(gaea_material) else gaea_material.preview_color
4041

4142
image.fill_rect(Rect2(
42-
Vector2i(start_offset * SIZE.x, 0.0),
43-
Vector2i(((end_offset + 0.005) - start_offset) * SIZE.x, SIZE.y)
43+
Vector2(start_offset * SIZE.x, 0.0).round(),
44+
Vector2(((end_offset + 0.005) - start_offset) * SIZE.x, SIZE.y).round()
4445
),
4546
color)
4647

addons/gaea/editor/graph_edit.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ func remove_invalid_connections() -> void:
107107
disconnect_node(connection.from_node, connection.from_port, connection.to_node, connection.to_port)
108108
continue
109109

110-
var from_type: GaeaValue.Type = from_node.get_output_port_type(connection.from_port)
111-
var to_type: GaeaValue.Type = to_node.get_input_port_type(connection.to_port)
110+
var from_type: GaeaValue.Type = from_node.get_output_port_type(connection.from_port) as GaeaValue.Type
111+
var to_type: GaeaValue.Type = to_node.get_input_port_type(connection.to_port) as GaeaValue.Type
112112
if not is_valid_connection_type(from_type, to_type) and from_type != to_type:
113113
disconnect_node(connection.from_node, connection.from_port, connection.to_node, connection.to_port)
114114
to_node.notify_connections_updated.call_deferred()

addons/gaea/editor/panel.gd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ var _zooms: Dictionary[GaeaData, float]
3131
@onready var _window_popout_separator: VSeparator = %WindowPopoutSeparator
3232
@onready var _window_popout_button: Button = %WindowPopoutButton
3333
@onready var _bottom_note_label: RichTextLabel = %BottomNote
34-
@onready var _generate_button: Button = %GenerateButton
3534
@onready var _about_button: Button = %AboutButton
3635
@onready var _about_window: AcceptDialog = $AboutWindow
3736

addons/gaea/gaea.gd

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ var _panel: Control
1010
var _panel_button: Button
1111
var _editor_selection: EditorSelection
1212
var _inspector_plugin: EditorInspectorPlugin
13-
var _custom_editor_settings: GaeaEditorSettings
1413
var _custom_project_settings: GaeaProjectSettings
1514

1615

1716
func _enter_tree() -> void:
18-
_editor_selection = get_editor_interface().get_selection()
17+
_editor_selection = EditorInterface.get_selection()
1918
_editor_selection.selection_changed.connect(_on_selection_changed)
2019

2120
_container = MarginContainer.new()

addons/gaea/graph/components/argument_editors/argument_editor.gd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ extends Control
88
## This class can be extended to create editors for the different value types in Gaea.
99

1010
## Emitted when the value is changed using the editor.
11+
@warning_ignore("unused_signal")
1112
signal argument_value_changed(new_value: Variant)
1213

1314
var type: GaeaValue.Type

addons/gaea/graph/components/argument_editors/number_argument_editor.gd

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ func _configure() -> void:
2929
func get_arg_value() -> Variant:
3030
if super() != null:
3131
return super()
32-
return float(spin_box.value) if type == GaeaValue.Type.FLOAT else int(spin_box.value)
32+
if type == GaeaValue.Type.FLOAT:
33+
return float(spin_box.value)
34+
return int(spin_box.value)
3335

3436

3537
func set_arg_value(new_value: Variant) -> void:

addons/gaea/graph/graph_nodes/generic_classes/constant.gd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ func _get_arguments_list() -> Array[StringName]:
1010
return [&"value"]
1111

1212

13-
func _get_argument_type(arg_name: StringName) -> GaeaValue.Type:
13+
func _get_argument_type(_arg_name: StringName) -> GaeaValue.Type:
1414
return get_type()
1515

16-
func _get_argument_display_name(arg_name: StringName) -> String:
16+
func _get_argument_display_name(_arg_name: StringName) -> String:
1717
return ""
1818

1919

@@ -29,7 +29,7 @@ func _get_output_ports_list() -> Array[StringName]:
2929
return [&"constant"]
3030

3131

32-
func _get_overridden_output_port_idx(output_name: StringName) -> int:
32+
func _get_overridden_output_port_idx(_output_name: StringName) -> int:
3333
return 0
3434

3535

addons/gaea/graph/graph_nodes/generic_classes/number_operation.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,14 @@ func _get_output_ports_list() -> Array[StringName]:
124124
return [&"result"]
125125

126126

127-
func _get_output_port_display_name(output_name: StringName) -> String:
127+
func _get_output_port_display_name(_output_name: StringName) -> String:
128128
return OPERATION_DEFINITIONS[get_enum_selection(0)].output
129129

130130

131131

132132
func _get_data(output_port: StringName, _area: AABB, generator_data: GaeaData) -> Variant:
133133
_log_data(output_port, generator_data)
134-
var operation: Operation = get_enum_selection(0)
134+
var operation: Operation = get_enum_selection(0) as Operation
135135
var args: Array
136136
for arg_name: StringName in OPERATION_DEFINITIONS[operation].args:
137137
args.append(_get_arg(arg_name, _area, generator_data))

0 commit comments

Comments
 (0)