38 lines
1.3 KiB
GDScript
38 lines
1.3 KiB
GDScript
extends SceneTree
|
|
## Eine Probe: Button-Rects messen UND Beweisbild mit genau diesem Zustand
|
|
## (Spinboxes auf 256 → lange Vorschau, wie Sly).
|
|
|
|
func _initialize() -> void:
|
|
_run.call_deferred()
|
|
|
|
func _rect_chain(n: Node) -> String:
|
|
var parts: Array[String] = []
|
|
var cur: Node = n
|
|
while cur != null:
|
|
if cur is Control:
|
|
parts.append("%s pos=%s size=%s" % [cur.get_class(), cur.get_position(), cur.size])
|
|
elif cur is Window:
|
|
parts.append("%s pos=%s size=%s" % [cur.get_class(), cur.position, cur.size])
|
|
cur = cur.get_parent()
|
|
return " <- ".join(parts)
|
|
|
|
func _run() -> void:
|
|
var scene: PackedScene = load("res://core/scenes/main.tscn")
|
|
var main: Control = scene.instantiate()
|
|
root.add_child(main)
|
|
await process_frame
|
|
await process_frame
|
|
main._start_with_new_map()
|
|
main._open_resize_dialog()
|
|
main.resize_dialog.size_x_edit.value = 256.0
|
|
main.resize_dialog.size_z_edit.value = 256.0
|
|
await process_frame
|
|
await process_frame
|
|
await RenderingServer.frame_post_draw
|
|
var dlg: ConfirmationDialog = main.resize_dialog
|
|
print("PROBE dlg pos=", dlg.position, " size=", dlg.size)
|
|
print("PROBE OK-chain: ", _rect_chain(dlg.get_ok_button()))
|
|
print("PROBE vbox: ", _rect_chain(dlg.get_child(0)))
|
|
var img := root.get_viewport().get_texture().get_image()
|
|
img.save_png("/opt/data/scopedvr/work/dialog_beweis/resize_256_state.png")
|
|
quit(0)
|