From 9cc7ef22d034f5983bc2ba4258ef9cdb7c82912a Mon Sep 17 00:00:00 2001 From: wusumac <736139669@qq.com> Date: Sat, 12 Sep 2026 12:30:00 +0800 Subject: [PATCH] feat(m53): add guild visual matrix probe --- runtime/entry/views/guild_page_view.gd | 6 ++- runtime/tools/m53_guild_visual_probe.gd | 50 +++++++++++++++++++------ 2 files changed, 43 insertions(+), 13 deletions(-) diff --git a/runtime/entry/views/guild_page_view.gd b/runtime/entry/views/guild_page_view.gd index c8cfd1a9..0d13ddba 100644 --- a/runtime/entry/views/guild_page_view.gd +++ b/runtime/entry/views/guild_page_view.gd @@ -276,6 +276,7 @@ func _build_overlay(data: Dictionary) -> void: ]) navigation.name = "GuildNavigation" _set_normalized_rect(navigation, Rect2(0.035, 0.855, 0.48, 0.12)) + navigation.z_index = 20 navigation.mouse_filter = Control.MOUSE_FILTER_IGNORE overlay.add_child(navigation) @@ -422,7 +423,10 @@ func _status_slot(parent: Control, node_name: String, rect: Rect2, value: String # Keep the existing semantic slot/chrome for compatibility, but let the # shared M52 resource module own the icon/value geometry. badge.visible = false - label.visible = true + # The accepted guild background already carries the compact nav captions; + # keep the hit-area label available for accessibility without painting a + # second caption over the authored medallion. + label.visible = false label.z_index = 8 label.add_theme_font_size_override("font_size", _guild_text_size(9)) label.clip_text = true diff --git a/runtime/tools/m53_guild_visual_probe.gd b/runtime/tools/m53_guild_visual_probe.gd index 769dee4f..3b214d4f 100644 --- a/runtime/tools/m53_guild_visual_probe.gd +++ b/runtime/tools/m53_guild_visual_probe.gd @@ -1,6 +1,8 @@ extends SceneTree const GuildView = preload("res://entry/views/guild_page_view.gd") +const FIXTURES := [Vector2i(760, 360), Vector2i(844, 390), Vector2i(1280, 720)] +const LOCALES := ["zh_CN", "en"] func _initialize() -> void: call_deferred("_run") @@ -12,21 +14,45 @@ func _run() -> void: quit(1) return DirAccess.make_dir_recursive_absolute(out) - root.size = Vector2(844, 390) + for fixture in FIXTURES: + for locale in LOCALES: + await _capture_fixture(fixture, locale, out) + print("ABG_M53_GUILD_VISUAL_PROBE_OK fixtures=3 locales=2 views=static,dynamic,final") + quit(0) + +func _capture_fixture(fixture: Vector2i, locale: String, out: String) -> void: + root.size = Vector2(fixture) var view := GuildView.new() view.name = "GuildVisualProbeView" view.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT) - view.configure_presentation({"safe_area": 24, "text_scale": 1.0, "locale": "zh_CN"}) + view.configure_presentation({"safe_area": 24, "text_scale": 1.0, "locale": locale}) root.add_child(view) - view.render({"ok": true, "locale": "zh_CN", "company": {"owned_count": 2, "coin": 38, "display_recruits": []}, "destinations": {}, "recruits": [], "notice": ""}) - # Guild has animated world layers; use a bounded frame settle instead of waiting - # on frame_post_draw, which can remain unresolved in headless compatibility mode. + view.render({"ok": true, "locale": locale, "company": {"owned_count": 2, "coin": 38, "display_recruits": []}, "destinations": {}, "recruits": [], "notice": ""}) + await _settle() + _save(view, out, locale, fixture, "final") + var overlay := view.find_child("GuildAnchorRoot", true, false) as Control + if overlay != null: + overlay.visible = false + await _settle() + _save(view, out, locale, fixture, "static") + if overlay != null: + overlay.visible = true + var world := view.find_child("GuildMasterWorldExtension", true, false) as Control + if world != null: + world.visible = false + await _settle() + _save(view, out, locale, fixture, "dynamic") + view.queue_free() + await process_frame + +func _settle() -> void: for _i in range(3): await process_frame - var viewport_texture := root.get_viewport().get_texture() - if viewport_texture != null: - var image := viewport_texture.get_image() - if image != null: - image.save_png(out.path_join("guild-844x390-zh_CN-final.png")) - print("ABG_M53_GUILD_VISUAL_PROBE_OK") - quit(0) + +func _save(view: Control, out: String, locale: String, fixture: Vector2i, kind: String) -> void: + var viewport_texture := view.get_viewport().get_texture() + if viewport_texture == null: + return + var image := viewport_texture.get_image() + if image != null: + image.save_png(out.path_join("guild-%dx%d-%s-%s.png" % [fixture.x, fixture.y, locale, kind]))