Fix warnings

This commit is contained in:
blinry 2020-11-10 22:37:10 +01:00
parent d57674acca
commit 4d97430d44
7 changed files with 15 additions and 18 deletions

View file

@ -102,7 +102,10 @@ func set_energy(new_energy):
func set_id(new_id): func set_id(new_id):
id = new_id id = new_id
var texture = load("res://cards/%s.svg" % new_id) var art_path = "res://cards/%s.svg" % new_id
var file = File.new()
if file.file_exists(art_path):
var texture = load(art_path)
if texture: if texture:
$Image.texture = texture $Image.texture = texture

View file

@ -1,4 +1,4 @@
extends Node2D extends Node2D
func _process(delta): func _process(_delta):
global_position = get_global_mouse_position() global_position = get_global_mouse_position()

View file

@ -100,8 +100,8 @@ func update():
# is_visible = true # is_visible = true
#visible = is_visible #visible = is_visible
func get_file_status(file_path, shell, idx): func get_file_status(file_path, the_shell, idx):
var file_status = shell.run("git status -s '%s'" % file_path) var file_status = the_shell.run("git status -s '%s'" % file_path)
if file_status.length()>0: if file_status.length()>0:
match file_status[idx]: match file_status[idx]:
"D": "D":

View file

@ -54,5 +54,5 @@ func _set_status(new_status):
func _popup_menu_pressed(id): func _popup_menu_pressed(_id):
emit_signal("deleted", self) emit_signal("deleted", self)

View file

@ -323,13 +323,3 @@ func _on_mouse_entered():
func _on_mouse_exited(): func _on_mouse_exited():
mouse_inside = false mouse_inside = false
func close_all_file_browsers():
var all = all_objects()
for o in objects.values():
if o.type == "commit":
o.file_browser.close()
o.file_browser.visible = false

View file

@ -8,3 +8,7 @@ var output
var exit_code var exit_code
var crash_on_fail = true var crash_on_fail = true
var thread var thread
func _unused():
# This is just to suppress a warning about the signal never being emitted.
emit_signal("done")

View file

@ -16,7 +16,7 @@ func _process(_delta):
if _server.is_connection_available(): if _server.is_connection_available():
_client_connection = _server.take_connection() _client_connection = _server.take_connection()
var length = _client_connection.get_u32() var length = _client_connection.get_u32()
var filename = _client_connection.get_string(length) var _filename = _client_connection.get_string(length)
length = _client_connection.get_u32() length = _client_connection.get_u32()
var content = _client_connection.get_string(length) var content = _client_connection.get_string(length)