Show the server's version history in the About popup
Build / test (push) Successful in 38s
Build / build (push) Successful in 1m13s

The About popup is twice as wide and shows the player's and the server's
version history side by side, each in its own scrolling column. The
server's comes from GET /api/v1/version/history every time the popup
opens. The description, which is about both, is centred above the
columns, and each history starts right under its version.
This commit is contained in:
Sansan committed 2026-10-07 14:32:31 +02:00
1 parent e1e05f3904
commit 13fdb3f68c
8 files changed
+749 -184

No files matched your search

+64 -22
View File
@@ -15,45 +15,87 @@ panel = NodePath("AboutPanel")
[node name="AboutPanel" type="Panel" parent="." unique_id=1907299275]
unique_name_in_owner = true
layout_mode = 0
offset_right = 600.0
offset_right = 1200.0
offset_bottom = 640.0
theme_type_variation = &"PopupBackground"
[node name="TitleLabel" type="Label" parent="AboutPanel" unique_id=200295721]
layout_mode = 0
offset_right = 600.0
offset_right = 1200.0
offset_bottom = 50.0
text = "About"
horizontal_alignment = 1
vertical_alignment = 1
[node name="ScrollContainer" type="ScrollContainer" parent="AboutPanel" unique_id=417677913]
[node name="DescriptionLabel" type="Label" parent="AboutPanel" unique_id=543094263]
layout_mode = 0
offset_left = 20.0
offset_top = 50.0
offset_right = 580.0
offset_bottom = 630.0
horizontal_scroll_mode = 0
[node name="ContentVBox" type="VBoxContainer" parent="AboutPanel/ScrollContainer" unique_id=1746337912]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="VersionLabel" type="Label" parent="AboutPanel/ScrollContainer/ContentVBox" unique_id=352884126]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
horizontal_alignment = 1
[node name="DescriptionLabel" type="Label" parent="AboutPanel/ScrollContainer/ContentVBox" unique_id=543094263]
layout_mode = 2
size_flags_horizontal = 3
offset_right = 1180.0
offset_bottom = 80.0
text = "Try your video game music knowledge with this VGM randomizer, invite your friends and see who is the best."
horizontal_alignment = 1
autowrap_mode = 2
[node name="WhatsNewLabel" type="Label" parent="AboutPanel/ScrollContainer/ContentVBox" unique_id=1363040291]
[node name="Columns" type="HBoxContainer" parent="AboutPanel" unique_id=200295722]
layout_mode = 0
offset_left = 20.0
offset_top = 96.0
offset_right = 1180.0
offset_bottom = 630.0
theme_override_constants/separation = 40
[node name="ScrollContainer" type="ScrollContainer" parent="AboutPanel/Columns" unique_id=417677913]
layout_mode = 2
size_flags_horizontal = 3
horizontal_scroll_mode = 0
[node name="ContentVBox" type="VBoxContainer" parent="AboutPanel/Columns/ScrollContainer" unique_id=1746337912]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="PlayerHeader" type="Label" parent="AboutPanel/Columns/ScrollContainer/ContentVBox" unique_id=1746337913]
layout_mode = 2
theme_type_variation = &"HighlightLarge"
text = "Music Player"
horizontal_alignment = 1
[node name="VersionLabel" type="Label" parent="AboutPanel/Columns/ScrollContainer/ContentVBox" unique_id=352884126]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
horizontal_alignment = 1
[node name="WhatsNewLabel" type="Label" parent="AboutPanel/Columns/ScrollContainer/ContentVBox" unique_id=1363040291]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
autowrap_mode = 2
[node name="ServerScrollContainer" type="ScrollContainer" parent="AboutPanel/Columns" unique_id=417677914]
layout_mode = 2
size_flags_horizontal = 3
horizontal_scroll_mode = 0
[node name="ServerContentVBox" type="VBoxContainer" parent="AboutPanel/Columns/ServerScrollContainer" unique_id=1746337914]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="ServerHeader" type="Label" parent="AboutPanel/Columns/ServerScrollContainer/ServerContentVBox" unique_id=1746337915]
layout_mode = 2
theme_type_variation = &"HighlightLarge"
text = "Music Server"
horizontal_alignment = 1
[node name="ServerVersionLabel" type="Label" parent="AboutPanel/Columns/ServerScrollContainer/ServerContentVBox" unique_id=352884127]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
horizontal_alignment = 1
[node name="ServerHistoryLabel" type="Label" parent="AboutPanel/Columns/ServerScrollContainer/ServerContentVBox" unique_id=1363040292]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
+34 -7
View File
@@ -1,6 +1,7 @@
class_name AboutPopup
extends BasePopup
## Shows the game version and what is new in each version.
## Shows the game's and the server's version, and what is new in each of their versions,
## side by side.
## What is new in each version, newest first.
const WHATS_NEW: Dictionary = {
@@ -57,16 +58,42 @@ const WHATS_NEW: Dictionary = {
@onready var about_panel: Panel = %AboutPanel
@onready var version_label: Label = %VersionLabel
@onready var whats_new_label: Label = %WhatsNewLabel
@onready var server_version_label: Label = %ServerVersionLabel
@onready var server_history_label: Label = %ServerHistoryLabel
func open() -> void:
super()
version_label.text = Settings.version
# Build changelog text with version headers
var changelog_text: String = ""
var entries: Array = []
for version: String in WHATS_NEW.keys():
changelog_text += "\n" + version + "\n"
changelog_text += WHATS_NEW[version] + "\n"
entries.append([version, [WHATS_NEW[version]]])
whats_new_label.text = changelog_text(entries)
whats_new_label.text = changelog_text
# Asked every time, as another server can be picked in the settings
server_version_label.text = "Loading…"
server_history_label.text = ""
MusicServerClient.fetch_version_history(_show_server_history, _show_server_history_failed)
## The changelog text for [param entries], each a [code][version, lines][/code] pair, newest
## first: every version on its own line, followed by its lines, with an empty line
## between versions.
static func changelog_text(entries: Array) -> String:
var versions: PackedStringArray = []
for entry: Array in entries:
versions.append(entry[0] + "\n" + "\n".join(entry[1]))
return "\n\n".join(versions)
func _show_server_history(history: Array[VersionData]) -> void:
server_version_label.text = history[0].version if !history.is_empty() else ""
var entries: Array = []
for version: VersionData in history:
entries.append([version.version, version.changelog])
server_history_label.text = changelog_text(entries)
func _show_server_history_failed() -> void:
server_version_label.text = "Could not reach the server"
server_history_label.text = ""