44 lines
1.4 KiB
GDScript
44 lines
1.4 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"))
|
|
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()
|