Add Settings, Account, Bug Reports, and Leaderboard

Server:
- New SOR.Support project: SubmitBugReport, GetLeaderboard, GetAccountProfile handlers
- New SOR.Database support schema: BugReport + BugReportResponse entities + SupportDbContext
- EF migration: Migrations/Support/AddSupport
- Admin panel: Bug Reports list + detail pages with reply-to-submitter flow
- Admin NavMenu: Support section with Bug Reports link
- Reply creates chat.Notification (type "admin_response") for in-game mailbox

Client:
- Settings autoload (Settings.gd): music/sfx volume+mute, persisted to user://settings.cfg
- SettingsScreen: sliders + mute CheckButtons wired to Settings autoload
- AccountScreen: profile (display name, OP, rank score) + mailbox (admin_response notifications)
- LeaderboardScreen: paginated ranked player list, caller highlighted in blue
- BugReportDialog: category/title/description/steps form, submits via support.submit_bug_report
- MainScreen: new Leaderboard, Account, Settings, Report a Bug navigation buttons

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
dingo
2026-03-06 20:14:12 -05:00
co-authored by Claude Happy
parent c4ef720570
commit a482cc5319
33 changed files with 2107 additions and 14 deletions
@@ -0,0 +1,118 @@
[gd_scene load_steps=2 format=3]
[ext_resource type="Script" path="res://scenes/bug_report/bug_report_dialog.gd" id="1_brd"]
[node name="BugReportDialog" type="Window"]
title = "Report a Bug"
initial_position = 2
size = Vector2i(560, 520)
script = ExtResource("1_brd")
[node name="Margin" type="MarginContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 16
theme_override_constants/margin_right = 16
theme_override_constants/margin_top = 12
theme_override_constants/margin_bottom = 12
[node name="VBox" type="VBoxContainer" parent="Margin"]
layout_mode = 2
theme_override_constants/separation = 10
[node name="CategoryRow" type="HBoxContainer" parent="Margin/VBox"]
layout_mode = 2
theme_override_constants/separation = 8
[node name="CategoryLabel" type="Label" parent="Margin/VBox/CategoryRow"]
layout_mode = 2
custom_minimum_size = Vector2(80, 0)
text = "Category"
vertical_alignment = 1
theme_override_font_sizes/font_size = 13
[node name="CategoryOption" type="OptionButton" parent="Margin/VBox/CategoryRow"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
custom_minimum_size = Vector2(0, 32)
theme_override_font_sizes/font_size = 13
[node name="TitleRow" type="HBoxContainer" parent="Margin/VBox"]
layout_mode = 2
theme_override_constants/separation = 8
[node name="TitleRowLabel" type="Label" parent="Margin/VBox/TitleRow"]
layout_mode = 2
custom_minimum_size = Vector2(80, 0)
text = "Title"
vertical_alignment = 1
theme_override_font_sizes/font_size = 13
[node name="TitleEdit" type="LineEdit" parent="Margin/VBox/TitleRow"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
custom_minimum_size = Vector2(0, 32)
placeholder_text = "Short summary of the issue"
theme_override_font_sizes/font_size = 13
[node name="DescLabel" type="Label" parent="Margin/VBox"]
layout_mode = 2
text = "Description"
theme_override_font_sizes/font_size = 13
[node name="DescEdit" type="TextEdit" parent="Margin/VBox"]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 3
custom_minimum_size = Vector2(0, 100)
placeholder_text = "Describe the bug in detail…"
theme_override_font_sizes/font_size = 13
[node name="StepsLabel" type="Label" parent="Margin/VBox"]
layout_mode = 2
text = "Steps to reproduce (optional)"
modulate = Color(0.7, 0.7, 0.75, 1.0)
theme_override_font_sizes/font_size = 12
[node name="StepsEdit" type="TextEdit" parent="Margin/VBox"]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 3
custom_minimum_size = Vector2(0, 80)
placeholder_text = "1. Open the bazaar\n2. Click Buy\n3. …"
theme_override_font_sizes/font_size = 12
[node name="StatusLabel" type="Label" parent="Margin/VBox"]
unique_name_in_owner = true
layout_mode = 2
text = ""
visible = false
theme_override_font_sizes/font_size = 13
[node name="ButtonRow" type="HBoxContainer" parent="Margin/VBox"]
layout_mode = 2
theme_override_constants/separation = 8
[node name="BtnSpacer" type="Control" parent="Margin/VBox/ButtonRow"]
layout_mode = 2
size_flags_horizontal = 3
[node name="CancelBtn" type="Button" parent="Margin/VBox/ButtonRow"]
unique_name_in_owner = true
layout_mode = 2
custom_minimum_size = Vector2(90, 36)
text = "Cancel"
theme_override_font_sizes/font_size = 13
[node name="SubmitBtn" type="Button" parent="Margin/VBox/ButtonRow"]
unique_name_in_owner = true
layout_mode = 2
custom_minimum_size = Vector2(120, 36)
text = "Submit Report"
theme_override_font_sizes/font_size = 13
@@ -0,0 +1,73 @@
extends Window
## Bug Report dialog — can be shown from any scene.
## Submits via support.submit_bug_report and shows success/error feedback.
@onready var category_option : OptionButton = %CategoryOption
@onready var title_edit : LineEdit = %TitleEdit
@onready var desc_edit : TextEdit = %DescEdit
@onready var steps_edit : TextEdit = %StepsEdit
@onready var submit_btn : Button = %SubmitBtn
@onready var cancel_btn : Button = %CancelBtn
@onready var status_label : Label = %StatusLabel
const CATEGORIES := ["gameplay", "ui", "account", "performance", "other"]
# ── Lifecycle ─────────────────────────────────────────────────────────────────
func _ready() -> void:
for cat in CATEGORIES:
category_option.add_item(cat.capitalize())
submit_btn.pressed.connect(_on_submit)
cancel_btn.pressed.connect(func(): hide())
close_requested.connect(func(): hide())
# ── Submit ────────────────────────────────────────────────────────────────────
func _on_submit() -> void:
var title := title_edit.text.strip_edges()
var desc := desc_edit.text.strip_edges()
if title.is_empty() or desc.is_empty():
_set_status("Title and description are required.", true)
return
submit_btn.disabled = true
_set_status("Submitting…", false)
var cat_idx := category_option.selected
var cat := CATEGORIES[cat_idx] if cat_idx >= 0 else "other"
Network.request(
"support.submit_bug_report",
{
"category": cat,
"title": title,
"description": desc,
"stepsToReproduce": steps_edit.text.strip_edges() if not steps_edit.text.is_empty() else null,
},
func(_type: String, _p: Variant): _on_success(),
func(code: String, msg: String): _on_error(code, msg)
)
func _on_success() -> void:
_set_status("Report submitted! Thank you.", false)
submit_btn.disabled = false
title_edit.text = ""
desc_edit.text = ""
steps_edit.text = ""
await get_tree().create_timer(2.0).timeout
hide()
func _on_error(code: String, msg: String) -> void:
_set_status("Error (%s): %s" % [code, msg], true)
submit_btn.disabled = false
func _set_status(text: String, is_error: bool) -> void:
status_label.text = text
status_label.modulate = Color(0.9, 0.3, 0.3) if is_error else Color(0.5, 0.9, 0.5)
status_label.visible = not text.is_empty()