Add legal consent and reliable external redirects

This commit is contained in:
hz
2026-07-20 02:16:20 -05:00
parent 2615ab4773
commit dae3a31b71
25 changed files with 756 additions and 14 deletions
+44
View File
@@ -0,0 +1,44 @@
class_name LegalDocumentBuilder
extends RefCounted
const Brand := preload("res://scripts/ui/medmind_style.gd")
static func populate(container: VBoxContainer, document: Dictionary) -> void:
for child in container.get_children():
child.queue_free()
var title := Label.new()
title.text = str(document.get("title", "Legal document"))
title.add_theme_font_override("font", Brand.font)
title.add_theme_font_size_override("font_size", 30)
container.add_child(title)
var metadata := Label.new()
metadata.text = "Effective %s | Version %s" % [document.get("effectiveDate", ""), document.get("version", "")]
metadata.add_theme_font_override("font", Brand.font)
metadata.add_theme_font_size_override("font_size", 14)
metadata.add_theme_color_override("font_color", Brand.muted_color(UIThemeService.is_dark_mode()))
container.add_child(metadata)
var summary := _paragraph(str(document.get("summary", "")))
container.add_child(summary)
for section_value in document.get("sections", []):
if typeof(section_value) != TYPE_DICTIONARY:
continue
var section: Dictionary = section_value
var heading := Label.new()
heading.text = str(section.get("heading", ""))
heading.add_theme_font_override("font", Brand.font)
heading.add_theme_font_size_override("font_size", 20)
container.add_child(heading)
for paragraph_value in section.get("paragraphs", []):
container.add_child(_paragraph(str(paragraph_value)))
static func _paragraph(value: String) -> Label:
var label := Label.new()
label.text = value
label.add_theme_font_override("font", Brand.font)
label.add_theme_font_size_override("font_size", 16)
label.add_theme_color_override("font_color", Brand.muted_color(UIThemeService.is_dark_mode()))
label.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
label.size_flags_horizontal = Control.SIZE_EXPAND_FILL
return label