Files
mtgodot-poc/project/char_select_visual_test.gd
T
shenandshen c3a6fb973e fix(rendering): checkpoint main-character recovery and visual regression work
Handle late main-character data, guarded model construction, bounded retries and map correction. Validate player model sources and add lifecycle and real-asset visual regressions.

Include pending material and character-selection changes, updated A1 screenshot, and the detailed rendering repair plan. Hair occlusion, full UI parity and final macOS package acceptance remain unfinished.
2026-09-08 08:52:30 +08:00

47 lines
1.6 KiB
GDScript

# Render the selection screen with deterministic reference data; no login needed.
extends SceneTree
const Screen = preload("res://ui/char_select_screen.gd")
class Client extends Node:
func get_empire() -> int: return 3
func get_slot_count() -> int: return 4
func _initialize() -> void:
call_deferred("_run")
func _run() -> void:
root.size = Vector2i(1472, 854)
var client := Client.new()
root.add_child(client)
var screen := Screen.new()
root.add_child(screen)
screen.setup(client, AssetRoot.path(), [{
"index": 0, "name": "[SA]Admin", "job": 0, "level": 105,
"guild_name": "[GM-TEAM]", "play_minutes": 2180,
"ht": 90, "iq": 15, "st": 90, "dx": 90,
"main_part": 20009, "hair_part": 0,
}])
for i in 40:
await process_frame
if screen._pv == null:
printerr("FAIL: selection model did not load")
quit(1)
return
print("Selected armor: ", screen._pv.model.get("gr2_path"))
print("Hair skin: ", screen._pv.model.get("hair_skin"))
var ua = preload("res://ui/ui_assets.gd")
ua.load_dds_image(String(screen._pv.model.get("hair_skin"))).save_png("/tmp/metin2-hair.png")
for mi in screen._pv.find_children("*", "MeshInstance3D", true, false):
for surface in mi.mesh.get_surface_count():
print("SURFACE ", surface, " ", mi.mesh.surface_get_name(surface))
if not String(screen._pv.model.get("gr2_path")).to_lower().contains("warrior_5_1"):
printerr("FAIL: server armor was not applied")
quit(1)
return
if DisplayServer.get_name() != "headless":
await RenderingServer.frame_post_draw
root.get_texture().get_image().save_png("/tmp/metin2-char-select.png")
print("PASS: selection model, server armor and UI assembly")
quit()