Add clinical progression ranks and records
This commit is contained in:
@@ -25,6 +25,7 @@ var recent_list: VBoxContainer
|
||||
var weekly_summary: VBoxContainer
|
||||
var mission_content: VBoxContainer
|
||||
var weekly_goal_content: VBoxContainer
|
||||
var rank_content: VBoxContainer
|
||||
var metric_values: Dictionary = {}
|
||||
var metric_details: Dictionary = {}
|
||||
var metric_trends: Dictionary = {}
|
||||
@@ -165,6 +166,9 @@ func _build() -> void:
|
||||
right_column.add_theme_constant_override("separation", 12)
|
||||
right_column.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
analytics_grid.add_child(right_column)
|
||||
rank_content = VBoxContainer.new()
|
||||
rank_content.add_theme_constant_override("separation", 9)
|
||||
right_column.add_child(_card(rank_content, 16))
|
||||
focus_content = VBoxContainer.new()
|
||||
focus_content.add_theme_constant_override("separation", 10)
|
||||
right_column.add_child(_card(focus_content, 16))
|
||||
@@ -224,6 +228,7 @@ func _render() -> void:
|
||||
_render_systems(data.get("systems", []))
|
||||
_render_focus(data.get("systems", []))
|
||||
_render_review(data)
|
||||
_render_rank(data.get("progression", {}))
|
||||
var weekly: Array = data.get("weeklyActivity", [])
|
||||
activity_chart.set_days(weekly, UIThemeService.is_dark_mode())
|
||||
_render_weekly(data, weekly)
|
||||
@@ -232,6 +237,40 @@ func _render() -> void:
|
||||
_render_weekly_goal()
|
||||
|
||||
|
||||
func _render_rank(value: Variant) -> void:
|
||||
if rank_content == null:
|
||||
return
|
||||
_clear(rank_content)
|
||||
rank_content.add_child(_section_title("Clinical progression"))
|
||||
var progression: Dictionary = value if typeof(value) == TYPE_DICTIONARY else {}
|
||||
if progression.is_empty():
|
||||
rank_content.add_child(_label("Loading rank progress...", 13, Brand.muted_color(UIThemeService.is_dark_mode())))
|
||||
return
|
||||
var title := _label(str(progression.get("displayName", "Case Scout III")), 23, Brand.PURPLE, true)
|
||||
rank_content.add_child(title)
|
||||
var next_name = progression.get("nextRankName")
|
||||
if next_name == null:
|
||||
rank_content.add_child(_label("Highest division earned", 12, Brand.SUCCESS, true))
|
||||
else:
|
||||
rank_content.add_child(_label("Next: %s %s" % [str(next_name), str(progression.get("nextDivision", ""))], 12, Brand.muted_color(UIThemeService.is_dark_mode())))
|
||||
var requirements: Array = progression.get("nextRequirements", [])
|
||||
for requirement_value in requirements.slice(0, mini(3, requirements.size())):
|
||||
var requirement: Dictionary = requirement_value
|
||||
var row := HBoxContainer.new()
|
||||
var label := _label(str(requirement.get("label", "Progress")), 11, Brand.text_color(UIThemeService.is_dark_mode()))
|
||||
label.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
row.add_child(label)
|
||||
row.add_child(_label("%d / %d" % [int(requirement.get("current", 0)), int(requirement.get("required", 0))], 11,
|
||||
Brand.SUCCESS if bool(requirement.get("complete", false)) else Brand.ROYAL_BLUE, true))
|
||||
rank_content.add_child(row)
|
||||
var view := Button.new()
|
||||
view.text = "View ladder and records"
|
||||
view.flat = true
|
||||
view.alignment = HORIZONTAL_ALIGNMENT_LEFT
|
||||
view.pressed.connect(func(): main.show_screen("profile"))
|
||||
rank_content.add_child(view)
|
||||
|
||||
|
||||
func _render_missions() -> void:
|
||||
if mission_content == null:
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user