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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user