(module (win-screen) ()
(import scheme
	(chicken base)
	(chicken module)
	raylib
	(imugi core)
	(imugi input)
	(imugi scene)
	(imugi math)
	(bd ui))

(export win-screen)
(define (win-screen arena-scene menu-scene)
  (play-sound (load-sound "../res/music/Win.wav"))
  (scene

   push-actions
   draw-labels
   handle-buttons
   
   (entity
    (title
     (vec
      0
      (/ (cdr (*window-size*))
	 6))
     "You have won!"
     centered: (cons #t #f)))

   (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
      "Play Again?")
     (lambda ()
       ((arena-scene menu-scene)))))

   (entity
    (button
     ;; Roughly centered.
     ;; these are ugly, hardcoded values.
     (vec (- (/ (car (*window-size*))
		2)
	     50)
	  (- (/ (car (*window-size*))
		2)
	     170))
     ;; Nested footer text
     (footer
      (vec 0 0) ;; this vec doesn't matter, it's overwritten internally
      "Back to Menu")
     (lambda ()
       ((menu-scene
	 (lambda ()
	   ((arena-scene menu-scene))))))))))
)

