Files
wschod/game/res/scripts/u_debug.scm
T
2025-07-26 14:41:02 +02:00

26 lines
1.0 KiB
Scheme

;; The function is evaulated and returns a pointer, the game eats it
;; and adds it to the UI root. Boom.
(widget-new
'plain
(widget-new
'window
#:style style-window
#:text "Debug window"
#:w 350
#:layout-padding 8
#:vertical #f
#:horizontal #t
;; The rest is children.
(widget-new
'flowbox
#:style style-container
#:layout-padding 8
#:layout-spacing 8
#:horizontal #t
(widget-label-gvar 'float "Delta time: ~,2f" "global:delta_time" #:style style-default #:layout-weight 1 #:h 20 #:text-alignment 'center)
(widget-label-gvar 'int "~d chunks" "debug:frame_chunks" #:style style-default #:layout-weight 0.5 #:h 20)
(widget-label-gvar 'int "~d entities" "debug:frame_entities" #:style style-default #:layout-weight 0.5 #:h 20)
(widget-checkbox "Flight" "debug:flight_enabled" #:layout-weight 0.5 #:h 20)
(widget-checkbox "Wireframe" "debug:wireframe_enabled" #:layout-weight 0.5 #:h 20)
(widget-spinner 'int "Render distance: ~d" "global:render_distance" #:layout-weight 1 #:h 20))))