(module (main-menu) ()
(import scheme
	(chicken base)
	(chicken module)
	(imugi core)
	(imugi input)
	(imugi scene)
	(imugi math)
	(bd ui)
	(bd music))

(export main-menu)
(define (main-menu play-callback)
  (scene
   push-actions
   draw-labels
   handle-buttons
   handle-music-players

   (entity
    (music-player
     "../res/music/Main Menu.wav"))
   
;;; Text
   ;; Title
   (entity
    (title
     (vec
      ;; 0 because automatically centered on x
      0
      (/ (cdr (*window-size*))
	 6))
     "Bitter Duel"
     centered: (cons #t #f)))
   ;; Subtitle
   (entity
    (subtitle
     (vec
      ;; 0 because automatically centered on x
      0
      (/ (cdr (*window-size*))
	 3))
     "Made for the Spring Lisp Game Jam 2026"
     centered: (cons #t #f)))
   ;; Acknowledgements footer
   (entity
    (footer
     (vec
      ;; 0 because automatically centered on x
      0
      (- (cdr (*window-size*))
	 30))
     "By Jakub Nowak with Imugi+Raylib"
     centered: (cons #t #f)))

   ;; Play button
   (entity
    (button
     ;; Roughly centered.
     ;; these are ugly, hardcoded values.
     (vec (- (/ (car (*window-size*))
		2)
	     50)
	  (- (/ (car (*window-size*))
		2)
	     100))
     ;; Nested footer text
     (footer
      (vec 0 0) ;; this vec doesn't matter, it's overwritten internally
      "Start Game!")
     play-callback))
   ))
)

