Fix GDScript ternary and shadowed-identifier warnings in dashboard scripts

Godot's static checker can't unify a float branch with a null branch in
a ternary, so point_value() now uses explicit if/return; renaming the
local sign variable to sign_prefix avoids shadowing the builtin sign().
This commit is contained in:
hz
2026-07-26 18:28:55 -05:00
parent 548b519d44
commit 23d573e221
2 changed files with 10 additions and 6 deletions
+6 -2
View File
@@ -99,9 +99,13 @@ func _draw() -> void:
static func point_value(point: Dictionary, series_mode: String) -> Variant:
if series_mode == "accuracy":
return float(point.get("accuracy", 0)) if int(point.get("total", 0)) > 0 else null
if int(point.get("total", 0)) > 0:
return float(point.get("accuracy", 0))
return null
var value: Variant = point.get("questionBankRating", null)
return null if value == null else float(value)
if value == null:
return null
return float(value)
static func axis_bounds(series_points: Array, series_mode: String) -> Vector2: