Files
jak-project/goal_src/jak2/pc/progress/progress-draw-pc.gc
T
2023-08-16 17:53:38 +01:00

2483 lines
104 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
#|
Additional PC port specific file for overriding/expanding the progress menu
This gives us more freedom to write code how we want.
|#
(defun draw-previous-next ((arg0 menu-highscores-option) (arg1 font-context) (arg2 symbol))
(local-vars (sv-16 string) (sv-32 int))
(let ((s3-0 370))
(case (get-aspect-ratio)
(('aspect4x3)
(set! (-> arg1 origin x) 73.0)
(set! (-> arg1 origin y) 308.0)
(set! (-> arg1 width) 359.0)
(set! (-> arg1 height) 185.0)
)
(('aspect16x9)
(set! (-> arg1 origin x) 82.0)
(set! (-> arg1 origin y) 328.0)
(set! (-> arg1 width) 355.0)
(set! (-> arg1 height) 185.0)
(set! s3-0 350)
)
)
(when (not (-> *pc-settings* use-vis?))
(set! s3-0 (the int (* (-> *pc-settings* aspect-ratio-reciprocal) s3-0)))
(*! (-> arg1 width) (-> *pc-settings* aspect-ratio-reciprocal))
(set! (-> arg1 origin x) (the float (adjust-game-x (-> arg1 origin x))))
)
(set-flags! arg1 (font-flags kerning large))
(set-color! arg1 (progress-selected 200))
(set-scale! arg1 0.6)
(when (or (> (-> arg0 page-index) 0) arg2)
(print-game-text (string-format "~C~S" 163 (lookup-text! *common-text* (text-id progress-next) #f)) arg1 #f 44 (bucket-id progress))
)
(set! arg2 (or (!= (-> arg0 page-index) (+ (-> arg0 num-pages) -1)) arg2))
(when arg2
(set-flags! arg1 (font-flags kerning right large))
(+! (-> arg1 origin x) (the float s3-0))
(print-game-text (string-format "~S~C" (lookup-text! *common-text* (text-id progress-next) #f) 161) arg1 #f 44 (bucket-id progress))
)
)
0
(none)
)
(defun get-highscore-icon-xoffset ((arg0 int))
(cond
((not (-> *pc-settings* use-vis?))
(adjust-game-x 435.0)
)
((= (get-aspect-ratio) 'aspect4x3)
435)
(else
410)
)
)
(deftype highscore-cup-draw-params (structure)
((cup-scale float)
(cup-y int16)
(cup-x int16)
(font-scale float)
)
)
(define *highscore-cup-draw-params* (new 'static 'inline-array highscore-cup-draw-params 8
(new 'static 'highscore-cup-draw-params :cup-scale 0.25 :cup-y 174 :cup-x 112 :font-scale -1.0)
(new 'static 'highscore-cup-draw-params :cup-scale 0.22 :cup-y 197 :cup-x 111 :font-scale 0.5)
(new 'static 'highscore-cup-draw-params :cup-scale 0.20 :cup-y 217 :cup-x 110 :font-scale 0.4)
(new 'static 'highscore-cup-draw-params :cup-scale 0.15 :cup-y 232 :cup-x 109 :font-scale 0.3)
(new 'static 'highscore-cup-draw-params :cup-scale 0.15 :cup-y 244 :cup-x 109 :font-scale -1.0)
(new 'static 'highscore-cup-draw-params :cup-scale 0.15 :cup-y 256 :cup-x 109 :font-scale -1.0)
(new 'static 'highscore-cup-draw-params :cup-scale 0.15 :cup-y 268 :cup-x 109 :font-scale -1.0)
(new 'static 'highscore-cup-draw-params :cup-scale 0.15 :cup-y 280 :cup-x 109 :font-scale -1.0)
))
(defun print-highscore ((arg0 print-highscore-obj))
(local-vars (sv-16 font-context) (sv-20 float) (sv-24 int) (sv-32 int))
(set! sv-16 (-> arg0 context))
(set! sv-20 (-> arg0 interp))
(set! sv-24 50)
(set! sv-32 (if (= (get-aspect-ratio) 'aspect4x3)
320
300
)
)
(when (not (-> *pc-settings* use-vis?))
(set! sv-32 (the int (* (-> *pc-settings* aspect-ratio-reciprocal) sv-32)))
(set! sv-24 (the int (* (-> *pc-settings* aspect-ratio-reciprocal) sv-24)))
)
(set-flags! sv-16 (font-flags kerning large))
(+! (-> sv-16 origin x) (the float sv-24))
(let* ((draw-params (-> *highscore-cup-draw-params* (-> arg0 place)))
(cup-x (-> draw-params cup-x)))
;; correct cup x
(when (not (-> *pc-settings* use-vis?))
(set! cup-x (adjust-game-x (the float cup-x))))
;; set font scale
(if (> (-> draw-params font-scale) 0)
(set-scale! sv-16 (-> draw-params font-scale)))
;; move font down
(when (< 0 (-> arg0 place))
(+! (-> sv-16 origin y) (the float (- (-> draw-params cup-y) (-> *highscore-cup-draw-params* (1- (-> arg0 place)) cup-y)))))
;; print highscore text
(print-game-text (string-format "~S" (lookup-text! *common-text* (-> (new 'static 'boxed-array :type text-id (text-id progress-highscores-1st)
(text-id progress-highscores-2nd)
(text-id progress-highscores-3rd)
(text-id progress-highscores-4th)
(text-id progress-highscores-5th)
(text-id progress-highscores-6th)
(text-id progress-highscores-7th)
(text-id progress-highscores-8th))
(-> arg0 place)) #f)) sv-16 #f 44 (bucket-id progress))
;; draw cup icon if we're not the previous page
(if (not (-> arg0 previous))
(draw-highscore-cup (-> arg0 self) (eval-highscore arg0) (+ (the int sv-20) cup-x) (-> draw-params cup-y) (-> draw-params cup-scale) (-> arg0 local-scale)))
)
(+! (-> sv-16 origin x) (the float sv-32))
(set-flags! sv-16 (font-flags kerning right large))
(cond
((-> arg0 game-score)
(print-game-text (string-format "~D" (the int (-> arg0 score))) sv-16 #f 44 (bucket-id progress))
)
(else
(print-game-text (str-print-time (-> arg0 score)) sv-16 #f 44 (bucket-id progress))
)
)
(set-flags! sv-16 (font-flags kerning large))
(set! (-> sv-16 origin x) (- (-> sv-16 origin x) (the float (+ sv-24 sv-32))))
)
(defmethod draw-option menu-highscores-option ((obj menu-highscores-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars
(sv-96 float)
(sv-100 float)
(sv-104 float)
(sv-108 float)
(sv-112 hud-box)
(sv-116 print-highscore-obj)
(sv-120 float)
(sv-124 float)
)
(let ((padding 20.0))
(if (not (-> *pc-settings* use-vis?))
(*! padding (-> *pc-settings* aspect-ratio-reciprocal)))
(set! sv-96 (* 2.0 (- 0.5 (-> arg0 menu-transition))))
(set! sv-100 0.22)
(set! sv-104 395.0)
(if (not (-> *pc-settings* use-vis?))
(*! sv-104 (-> *pc-settings* aspect-ratio-reciprocal)))
(set! sv-108 (-> arg1 origin x))
(set! sv-112 (new 'stack-no-clear 'hud-box))
(set! sv-116 (new 'stack 'print-highscore-obj))
(set! sv-120 (* (-> arg0 sliding) sv-104))
(set! sv-124 (* (-> arg0 sliding-off) (-> obj slide-dir) sv-104))
(if (< sv-96 0.0)
(set! sv-96 0.0)
)
(cond
((not (-> *bigmap* progress-minimap))
(draw-busy-loading arg1)
)
(else
;; initial font parameters
(set! (-> arg1 alpha) sv-96)
(set-scale! arg1 1.0)
(set-flags! arg1 (font-flags kerning middle large))
(set-color! arg1 (font-color progress))
;; set up for decoration text
(set! (-> arg1 origin x) 59.0)
(if (not (-> *pc-settings* use-vis?))
(set! (-> arg1 origin x) (the float (adjust-game-x (-> arg1 origin x)))))
(set! (-> arg1 origin y) 78.0)
(set! (-> arg1 width) sv-104)
(set! (-> arg1 height) 215.0)
;; set the scissor region
(begin-scissor sv-112 arg0)
;; set up for highscore icon
(set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #xc93)))
(set! (-> obj sprites 0 flags) (the-as uint 4))
(set! (-> obj sprites 0 scale-x) sv-100)
(set! (-> obj sprites 0 scale-y) sv-100)
(let ((v1-33 (-> obj sprites 0 color2)))
(set! (-> v1-33 0) 128)
(set! (-> v1-33 1) 128)
(set! (-> v1-33 2) 128)
(set! (-> v1-33 3) (the int (* 128.0 sv-96)))
)
(set! (-> obj sprites 0 pos z) #xfffff0)
(set! (-> obj sprites 0 pos w) 0)
;; draw decoration text
(if (= (-> *setting-control* user-default language) (language-enum spanish))
(draw-decoration obj arg1 sv-96 (text-id progress-root-highscores) #t 0.8)
(draw-decoration obj arg1 sv-96 (text-id progress-root-highscores) #t 0.95)
)
;; draw highscore title (e.g 'Gun Course')
(set-scale! arg1 0.6)
(set! (-> arg1 height) 185.0)
(+! (-> arg1 origin y) 46.0)
(set! (-> arg1 origin x) 65.0)
(if (not (-> *pc-settings* use-vis?))
(set! (-> arg1 origin x) (the float (adjust-game-x (-> arg1 origin x)))))
(set-width! arg1 367)
(set-flags! arg1 (font-flags kerning large))
(set-color! arg1 (font-color progress-force-selected))
(set! (-> arg1 origin x) (+ padding sv-120 (-> arg1 origin x)))
(set-scale! arg1 0.75)
(when (= (-> *setting-control* user-default language) (language-enum german))
(set-scale! arg1 0.69)
)
(when (= (-> *setting-control* user-default language) (language-enum french))
(set-scale! arg1 0.72)
)
(when (= (-> *setting-control* user-default language) (language-enum spanish))
(set-scale! arg1 0.65)
)
(print-game-text (string-format "~S" (lookup-text! *common-text* (get-highscore-text (-> obj page-index)) #f)) arg1 #f 44 (bucket-id progress))
;; now draw highscore subtitle (e.g 'Scatter Gun')
(+! (-> arg1 origin y) 25.0)
(set-scale! arg1 0.6)
(when (or (= (-> *setting-control* user-default language) (language-enum french))
(= (-> *setting-control* user-default language) (language-enum spanish))
)
(set-scale! arg1 0.58)
)
(print-game-text (string-format "~S" (lookup-text! *common-text* (get-highscore-text-sub (-> obj page-index)) #f)) arg1 #f 44 (bucket-id progress))
;; draw highscore icon
(set! (-> arg1 origin x) (- (-> arg1 origin x) (+ padding sv-120)))
(+! (-> arg1 origin y) 25.0)
(draw-highscore-icon
obj
(get-highscore-icon (-> obj page-index))
(the int (+ (the float (get-highscore-icon-xoffset (-> obj page-index))) sv-120))
(get-highscore-icon-yoffset (-> obj page-index))
(get-highscore-icon-scale (-> obj page-index))
)
;; print the 8 scores now.
(set! sv-108 (-> arg1 origin x))
(set-color! arg1 (font-color progress))
(+! (-> arg1 origin x) sv-120)
(set-scale! arg1 0.6)
(let ((gp-5 (get-game-score-ref *game-info* (get-highscore-score (-> obj page-index)))))
(set! (-> sv-116 index) (-> obj page-index))
(set! (-> sv-116 previous) #f)
(set! (-> sv-116 self) obj)
(case (get-highscore-type (-> obj page-index))
(('game)
(set! (-> sv-116 game-score) #t)
)
(('race)
(set! (-> sv-116 game-score) #f)
)
)
(set! (-> sv-116 context) arg1)
(set! (-> sv-116 local-scale) sv-96)
(set! (-> sv-116 interp) sv-120)
(dotimes (s5-5 8)
(set! (-> sv-116 place) s5-5)
(set! (-> sv-116 score) (-> gp-5 s5-5))
(print-highscore sv-116)
)
)
(set! (-> arg1 origin x) sv-108)
;; draw the previous highscore that was seen
;; note that we only need to know what the last one was
;; since the screen only needs to draw 2 highscores at any given time anyway
;; reset font parameters
(set-scale! arg1 0.6)
(set! (-> arg1 origin x) 59.0)
(if (not (-> *pc-settings* use-vis?))
(set! (-> arg1 origin x) (the float (adjust-game-x (-> arg1 origin x)))))
(set! (-> arg1 origin y) 78.0)
(set! (-> arg1 width) sv-104)
(set! (-> arg1 height) 215.0)
(set-scale! arg1 0.5)
(set! (-> arg1 height) 185.0)
(+! (-> arg1 origin y) 46.0)
(set! (-> arg1 origin x) 80.0)
(if (not (-> *pc-settings* use-vis?))
(set! (-> arg1 origin x) (the float (adjust-game-x (-> arg1 origin x)))))
(set! (-> obj sprites 0 pos z) #xffffff)
(set! (-> arg1 width) sv-104)
(set-flags! arg1 (font-flags kerning large))
(set-color! arg1 (font-color progress-force-selected))
(set! (-> arg1 origin x) (+ padding sv-124 (-> arg1 origin x)))
(set-scale! arg1 0.75)
(when (= (-> *setting-control* user-default language) (language-enum german))
(set-scale! arg1 0.69)
)
(when (= (-> *setting-control* user-default language) (language-enum french))
(set-scale! arg1 0.72)
)
(when (= (-> *setting-control* user-default language) (language-enum spanish))
(set-scale! arg1 0.65)
)
(print-game-text (string-format "~S" (lookup-text! *common-text* (get-highscore-text (-> obj prev-page-index)) #f)) arg1 #f 44 (bucket-id progress))
(+! (-> arg1 origin y) 25.0)
(set-scale! arg1 0.6)
(when (or (= (-> *setting-control* user-default language) (language-enum french))
(= (-> *setting-control* user-default language) (language-enum spanish))
)
(set-scale! arg1 0.58)
)
(print-game-text (string-format "~S" (lookup-text! *common-text* (get-highscore-text-sub (-> obj prev-page-index)) #f)) arg1 #f 44 (bucket-id progress))
(set! (-> arg1 origin x) (- (-> arg1 origin x) (+ padding sv-124)))
(+! (-> arg1 origin y) 25.0)
(draw-highscore-icon
obj
(get-highscore-icon (-> obj prev-page-index))
(the int (+ (the float (get-highscore-icon-xoffset (-> obj page-index))) sv-124))
(get-highscore-icon-yoffset (-> obj page-index))
(get-highscore-icon-scale (-> obj page-index))
)
(set! sv-108 (-> arg1 origin x))
(set-color! arg1 (font-color progress))
(+! (-> arg1 origin x) sv-124)
(set-scale! arg1 0.6)
(when (< 1 (get-num-highscores))
(let ((gp-11 (get-game-score-ref *game-info* (get-highscore-score (-> obj prev-page-index)))))
(set! (-> sv-116 index) (-> obj prev-page-index))
(set! (-> sv-116 previous) #t)
(set! (-> sv-116 self) obj)
(case (get-highscore-type (-> obj prev-page-index))
(('game)
(set! (-> sv-116 game-score) #t)
)
(('race)
(set! (-> sv-116 game-score) #f)
)
)
(set! (-> sv-116 context) arg1)
(set! (-> sv-116 local-scale) sv-96)
(set! (-> sv-116 interp) sv-120)
(dotimes (s5-10 8)
(set! (-> sv-116 place) s5-10)
(set! (-> sv-116 score) (-> gp-11 s5-10))
(print-highscore sv-116)
)
)
(set! (-> arg1 origin x) sv-108)
(set-scale! arg1 0.6)
)
(if (< 1 (get-num-highscores))
(draw-previous-next obj arg1 #t)
)
(end-scissor sv-112 1.0)
)
))
0
(none)
)
(defmethod draw-option menu-slider-option ((obj menu-slider-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars
(sv-48 int)
(sv-64 int)
(sv-80 int)
(sv-96 int)
(sv-112 int)
(sv-128 pointer)
(sv-160 rgba)
(sv-176 dma-buffer)
(sv-208 pointer)
(sv-240 rgba)
(sv-256 dma-buffer)
)
(let ((s5-0 arg1)
(gp-0 arg2)
(bar-width 230.0)
(bar-width-max 240)
(icon-right-offset 242)
)
(let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))
(set! sv-48 128)
(let ((s1-0 sv-48)
(s0-0 9)
(s2-0 157)
(f28-0 2.0)
(s3-0 252)
)
(set! sv-64 20)
(set! sv-80 0)
(set! sv-96 112)
(set! sv-112 127)
(if (< f30-0 0.0)
(set! f30-0 0.0)
)
(set! (-> s5-0 alpha) f30-0)
(cond
((not (-> *bigmap* progress-minimap))
(draw-busy-loading s5-0)
(return 0)
)
(else
(set-scale! s5-0 0.6)
(+! (-> s5-0 origin y) 20.0)
(case (get-aspect-ratio)
(('aspect4x3)
(set! s2-0 157)
(let ((v1-17 gp-0))
(cond
((zero? v1-17)
(+! (-> s5-0 origin y) -24.0)
(+! s2-0 -9)
)
((= v1-17 1)
(+! (-> s5-0 origin y) -9.0)
(+! s2-0 43)
)
((= v1-17 2)
(+! (-> s5-0 origin y) 6.0)
(+! s2-0 96)
)
)
)
)
(('aspect16x9)
(set! s2-0 172)
(set! f28-0 2.62)
(set! s0-0 5)
(set! s3-0 250)
(let ((v1-28 gp-0))
(cond
((zero? v1-28)
(+! (-> s5-0 origin y) -20.0)
(+! s2-0 -20)
)
((= v1-28 1)
(+! (-> s5-0 origin y) 2.0)
(+! s2-0 40)
)
((= v1-28 2)
(+! (-> s5-0 origin y) 30.0)
(+! s2-0 105)
)
)
)
)
)
(when (not (-> *pc-settings* use-vis?))
(set! sv-48 (adjust-game-x (the float sv-48)))
(set! s1-0 (adjust-game-x (the float s1-0)))
(*! bar-width (-> *pc-settings* aspect-ratio-reciprocal))
(set! bar-width-max (the int (* (-> *pc-settings* aspect-ratio-reciprocal) bar-width-max)))
(set! icon-right-offset (the int (* (-> *pc-settings* aspect-ratio-reciprocal) icon-right-offset)))
(set! sv-64 (the int (* (-> *pc-settings* aspect-ratio-reciprocal) sv-64)))
(set! s0-0 (the int (* (-> *pc-settings* aspect-ratio-reciprocal) s0-0)))
(set! s3-0 (the int (* (-> *pc-settings* aspect-ratio-reciprocal) s3-0)))
)
(set-flags! s5-0 (font-flags kerning large))
(set! (-> s5-0 origin x) (the float sv-48))
(cond
(arg3
(set! sv-128 (-> obj value-to-modify))
(+! (-> s5-0 origin y) -8.0)
(set-color! s5-0 (font-color progress-force-selected))
(draw-highlight (the int (+ -2.0 (-> s5-0 origin y))) 52 f30-0)
(print-game-text (lookup-text! *common-text* (-> obj name) #f) s5-0 #f 44 (bucket-id progress))
(set! sv-160 (new 'static 'rgba :r (the int (* 0.0 f30-0 (-> (the-as (pointer float) sv-128))))
:g (the int (* 0.0 f30-0 (-> (the-as (pointer float) sv-128))))
:b (the int (* 0.0 f30-0 (-> (the-as (pointer float) sv-128))))
:a (the int (* 128.0 f30-0))))
(set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xb :page #xc93)))
(set! (-> obj sprites 0 scale-x) f28-0)
(set! (-> obj sprites 0 scale-y) 0.7)
(let ((v1-57 (-> obj sprites 0 color2)))
(set! (-> v1-57 0) 128)
(set! (-> v1-57 1) 128)
(set! (-> v1-57 2) 128)
(set! (-> v1-57 3) (the int (* 128.0 f30-0)))
)
(set! (-> obj sprites 0 pos z) #x3fffff)
(set! (-> obj sprites 0 pos w) 0)
(set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xc :page #xc93)))
(set! (-> obj sprites 1 scale-x) 0.2)
(set! (-> obj sprites 1 scale-y) 1.33)
(let ((v1-62 (-> obj sprites 1 color2)))
(set! (-> v1-62 0) 128)
(set! (-> v1-62 1) 128)
(set! (-> v1-62 2) 128)
(set! (-> v1-62 3) (the int (* 128.0 f30-0)))
)
(set! (-> obj sprites 1 pos z) #x3fffff)
(set! (-> obj sprites 1 pos w) 0)
(set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3e :page #xc93)))
(set! (-> obj sprites 2 scale-x) 1.0)
(set! (-> obj sprites 2 scale-y) 1.0)
(let ((v1-67 (-> obj sprites 2 color2)))
(set! (-> v1-67 0) sv-80)
(set! (-> v1-67 1) sv-96)
(set! (-> v1-67 2) sv-112)
(set! (-> v1-67 3) (the int (* 128.0 f30-0)))
)
(set! (-> obj sprites 2 pos z) #xffffff)
(set! (-> obj sprites 2 pos w) 0)
(set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3f :page #xc93)))
(set! (-> obj sprites 3 scale-x) 1.0)
(set! (-> obj sprites 3 scale-y) 1.0)
(let ((v1-72 (-> obj sprites 3 color2)))
(set! (-> v1-72 0) sv-80)
(set! (-> v1-72 1) sv-96)
(set! (-> v1-72 2) sv-112)
(set! (-> v1-72 3) (the int (* 128.0 f30-0)))
)
(set! (-> obj sprites 3 pos z) #xffffff)
(set! (-> obj sprites 3 pos w) 0)
(set-hud-piece-position! (-> obj sprites 0) s1-0 s2-0)
(set-hud-piece-position!
(-> obj sprites 1)
(+ s1-0 (the int (* bar-width (-> (the-as (pointer float) sv-128)))))
(+ s2-0 -4)
)
(set-hud-piece-position! (-> obj sprites 2) (- s1-0 sv-64) (+ s2-0 -4))
(set-hud-piece-position! (-> obj sprites 3) (+ sv-64 icon-right-offset s1-0) (+ s2-0 -4))
(with-dma-buffer-add-bucket ((sv-176 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id progress))
(draw (-> obj sprites 0) sv-176 (-> *level* default-level))
(draw-sprite2d-xy
sv-176
(+ s1-0 s0-0 (the int (* bar-width (-> (the-as (pointer float) sv-128)))))
(+ s2-0 7)
(- bar-width-max (the int (* bar-width (-> (the-as (pointer float) sv-128)))))
9
sv-160
)
(draw (-> obj sprites 1) sv-176 (-> *level* default-level))
(draw (-> obj sprites 2) sv-176 (-> *level* default-level))
(draw (-> obj sprites 3) sv-176 (-> *level* default-level))
)
(+! (-> s5-0 origin x) (the float s3-0))
(set-flags! s5-0 (font-flags kerning right large))
(print-game-text (string-format "~D%" (the int (* 100.0 (-> (the-as (pointer float) sv-128))))) s5-0 #f 44 (bucket-id progress))
(set-flags! s5-0 (font-flags kerning large))
)
(else
(set! sv-208 (-> obj value-to-modify))
(+! (-> s5-0 origin y) -8.0)
(when (or (= (-> *setting-control* user-default language) (language-enum german))
(= (-> *setting-control* user-default language) (language-enum french))
)
(set-scale! s5-0 0.56)
)
(if (= (-> arg0 option-index) gp-0)
(draw-highlight (the int (+ -2.0 (-> s5-0 origin y))) 24 f30-0)
)
(print-game-text (lookup-text! *common-text* (-> obj name) #f) s5-0 #f 44 (bucket-id progress))
(set! sv-240 (new 'static 'rgba :r (the int (* 0.0 f30-0 (-> (the-as (pointer float) sv-208))))
:g (the int (* 0.0 f30-0 (-> (the-as (pointer float) sv-208))))
:b (the int (* 0.0 f30-0 (-> (the-as (pointer float) sv-208))))
:a (the int (* 128.0 f30-0))))
(set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xb :page #xc93)))
(set! (-> obj sprites 0 scale-x) f28-0)
(set! (-> obj sprites 0 scale-y) 0.7)
(let ((v1-140 (-> obj sprites 0 color2)))
(set! (-> v1-140 0) 128)
(set! (-> v1-140 1) 128)
(set! (-> v1-140 2) 128)
(set! (-> v1-140 3) (the int (* 128.0 f30-0)))
)
(set! (-> obj sprites 0 pos z) #x3fffff)
(set! (-> obj sprites 0 pos w) 0)
(set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xc :page #xc93)))
(set! (-> obj sprites 1 scale-x) 0.2)
(set! (-> obj sprites 1 scale-y) 1.33)
(let ((v1-145 (-> obj sprites 1 color2)))
(set! (-> v1-145 0) 128)
(set! (-> v1-145 1) 128)
(set! (-> v1-145 2) 128)
(set! (-> v1-145 3) (the int (* 128.0 f30-0)))
)
(set! (-> obj sprites 1 pos z) #x3fffff)
(set! (-> obj sprites 1 pos w) 0)
(set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3e :page #xc93)))
(set! (-> obj sprites 2 scale-x) 1.0)
(set! (-> obj sprites 2 scale-y) 1.0)
(let ((v1-150 (-> obj sprites 2 color2)))
(set! (-> v1-150 0) sv-80)
(set! (-> v1-150 1) sv-96)
(set! (-> v1-150 2) sv-112)
(set! (-> v1-150 3) (the int (* 128.0 f30-0)))
)
(set! (-> obj sprites 2 pos z) #xffffff)
(set! (-> obj sprites 2 pos w) 0)
(set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3f :page #xc93)))
(set! (-> obj sprites 3 scale-x) 1.0)
(set! (-> obj sprites 3 scale-y) 1.0)
(let ((v1-155 (-> obj sprites 3 color2)))
(set! (-> v1-155 0) sv-80)
(set! (-> v1-155 1) sv-96)
(set! (-> v1-155 2) sv-112)
(set! (-> v1-155 3) (the int (* 128.0 f30-0)))
)
(set! (-> obj sprites 3 pos z) #xffffff)
(set! (-> obj sprites 3 pos w) 0)
(set-hud-piece-position! (-> obj sprites 0) s1-0 s2-0)
(set-hud-piece-position!
(-> obj sprites 1)
(+ s1-0 (the int (* bar-width (-> (the-as (pointer float) sv-208)))))
(+ s2-0 -4)
)
(set-hud-piece-position! (-> obj sprites 2) (- s1-0 sv-64) (+ s2-0 -4))
(set-hud-piece-position! (-> obj sprites 3) (+ sv-64 icon-right-offset s1-0) (+ s2-0 -4))
(with-dma-buffer-add-bucket ((sv-256 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id progress))
(draw (-> obj sprites 0) sv-256 (-> *level* default-level))
(draw-sprite2d-xy
sv-256
(+ s1-0 s0-0 (the int (* bar-width (-> (the-as (pointer float) sv-208)))))
(+ s2-0 7)
(- bar-width-max (the int (* bar-width (-> (the-as (pointer float) sv-208)))))
9
sv-240
)
(draw (-> obj sprites 1) sv-256 (-> *level* default-level))
(draw (-> obj sprites 2) sv-256 (-> *level* default-level))
(draw (-> obj sprites 3) sv-256 (-> *level* default-level))
)
(+! (-> s5-0 origin x) (the float s3-0))
(set-flags! s5-0 (font-flags kerning right large))
(print-game-text (string-format "~D%" (the int (* 100.0 (-> (the-as (pointer float) sv-208))))) s5-0 #f 44 (bucket-id progress))
(set-flags! s5-0 (font-flags kerning large))
)
)
(if (zero? gp-0)
(draw-sound-options-decoration obj s5-0 f30-0 (text-id progress-root-sound-options) #f)
)
)
)
)
)
)
0
(none)
)
(defmethod draw-option menu-missions-option ((obj menu-missions-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars
(f0-50 float)
(sv-16 float)
(sv-20 int)
(sv-24 int)
(sv-32 int)
(sv-40 int)
(sv-48 int)
(sv-56 int)
(sv-256 float)
(sv-260 float)
(sv-264 game-task-node-info)
(sv-268 game-task-node-info)
(sv-272 symbol)
(sv-276 hud-box)
(sv-280 float)
(sv-284 float)
)
(set! sv-16 (* 2.0 (- 0.5 (-> arg0 menu-transition))))
(set! sv-20 1)
(set! sv-24 0)
(set! sv-32 0)
(set! sv-40 0)
(set! sv-48 0)
(set! sv-56 95)
(set! sv-256 (* 395.0 (-> arg0 sliding)))
(set! sv-260 (* 44.0 (-> arg0 sliding-height)))
(set! sv-264 (new 'stack 'game-task-node-info))
(set! sv-268 (new 'stack 'game-task-node-info))
(set! sv-272 #t)
(set! sv-276 (new 'stack-no-clear 'hud-box))
(set! sv-280 (-> arg1 origin y))
(set! sv-284 (-> arg1 scale))
(set! (-> *progress-state* current-task-index) (length (-> *game-info* sub-task-list)))
(set! (-> *progress-state* current-line-index) -1)
(set! (-> *progress-state* current-task) (the-as uint -1))
(set! (-> *progress-state* first-closed-line-index) -1)
(set! (-> *progress-state* extra-text-state) -1)
(set! (-> *progress-state* num-open-tasks-found) 0)
(set! (-> *progress-state* num-closed-tasks-found) 0)
(if (< sv-16 0.0)
(set! sv-16 (the-as float 0.0))
)
(set! (-> arg1 alpha) sv-16)
(set! (-> *game-info* mission-list 0) sv-264)
(set! (-> sv-264 description) (text-id progress-missions-in-progress))
(set! (-> sv-268 description) (text-id progress-missions-completed))
(while (< sv-24 (length (-> *game-info* sub-task-list)))
(let ((v1-26 (find-mission-text-at-index sv-24))
(a0-15 (-> *game-info* mission-list))
)
(when (!= v1-26 #f)
(when (and (logtest? (-> v1-26 flags) (game-task-node-flag closed)) sv-272)
(set! sv-272 (the-as symbol #f))
(set! (-> a0-15 sv-20) sv-268)
(set! sv-20 (+ sv-20 1))
)
(set! (-> a0-15 sv-20) v1-26)
(set! sv-20 (+ sv-20 1))
)
)
(set! sv-24 (+ sv-24 1))
)
(set! sv-48 sv-20)
(set! (-> *progress-state* total-num-tasks) sv-20)
(sort-task-node-result sv-48)
(set! (-> arg1 width) 395.0)
(set! (-> arg1 origin x) 60.0)
(set! (-> arg1 origin y) 80.0)
(set-color! arg1 (font-color progress))
(when (not (-> *pc-settings* use-vis?))
;; added to fix widescreen
(*! (-> arg1 width) (-> *pc-settings* aspect-ratio-reciprocal))
(set! (-> arg1 origin x) (the float (adjust-game-x (-> arg1 origin x))))
)
(let ((v1-40 (-> obj page-index)))
(cond
((zero? v1-40)
(draw-missions-decoration obj arg1 sv-16 (text-id progress-root-missions))
)
((= v1-40 1)
(draw-missions-decoration obj arg1 sv-16 (text-id progress-root-missions))
)
)
)
(begin-scissor-missions sv-276)
(set-flags! arg1 (font-flags kerning large))
(if (-> *pc-settings* use-vis?)
(+! (-> arg1 origin x) 20.0)
(+! (-> arg1 origin x) (* (-> *pc-settings* aspect-ratio-reciprocal) 20.0)))
(case (get-aspect-ratio)
(('aspect16x9)
(set! (-> arg1 origin y) 80.0)
)
(('aspect4x3)
(set! (-> arg1 origin y) (the float sv-56))
)
)
(set-scale! arg1 sv-284)
(when (zero? (-> obj page-index))
(set! sv-24 (-> obj task-line-index))
(set! sv-20 0)
(let ((v1-57 (+ sv-56 44)))
(set! sv-56 v1-57)
(set! (-> arg1 origin y) (the float (+ v1-57 (the int sv-260))))
)
(set! (-> arg1 width) 340.0)
(set! (-> arg1 height) 44.0)
(when (!= sv-260 0.0)
(set! (-> *progress-state* missions-total-spacing) 0.0)
(dotimes (s4-1 sv-24)
(let* ((s3-1 (-> *game-info* mission-list s4-1))
(a1-19
(if (and (logtest? (-> s3-1 flags) (game-task-node-flag closed)) (task-complete? *game-info* (-> s3-1 task)))
(-> *game-info* play-list (-> s3-1 task) text-name)
(-> s3-1 description)
)
)
(s3-2 (lookup-text! *common-text* a1-19 #f))
(f30-0 3.0)
(s2-0 print-game-text)
)
(format (clear *temp-string*) "~S" s3-2)
(set! (-> *progress-state* missions-total-spacing)
(+ f30-0 (s2-0 *temp-string* arg1 #t 44 (bucket-id progress)) (-> *progress-state* missions-total-spacing))
)
)
)
)
(set! sv-56 (- sv-56 (the int (-> *progress-state* missions-total-spacing))))
(cond
((< (-> arg0 sliding-height) 0.0)
(let* ((s4-2 (-> *game-info* mission-list sv-24))
(a1-23
(if (and (logtest? (-> s4-2 flags) (game-task-node-flag closed)) (task-complete? *game-info* (-> s4-2 task)))
(-> *game-info* play-list (-> s4-2 task) text-name)
(-> s4-2 description)
)
)
(s4-3 (lookup-text! *common-text* a1-23 #f))
)
0.0
(let ((f30-1 3.0)
(s3-3 print-game-text)
)
(format (clear *temp-string*) "~S" s4-3)
(let ((f0-36 (+ f30-1 (s3-3 *temp-string* arg1 #t 44 (bucket-id progress)))))
(set! sv-260 (* (-> arg0 sliding-height) f0-36))
)
)
)
)
(else
(let* ((s4-4 (-> *game-info* mission-list (+ sv-24 -1)))
(a1-27
(if (and (logtest? (-> s4-4 flags) (game-task-node-flag closed)) (task-complete? *game-info* (-> s4-4 task)))
(-> *game-info* play-list (-> s4-4 task) text-name)
(-> s4-4 description)
)
)
(s4-5 (lookup-text! *common-text* a1-27 #f))
)
0.0
(let ((f30-2 3.0)
(s3-4 print-game-text)
)
(format (clear *temp-string*) "~S" s4-5)
(let ((f0-40 (+ f30-2 (s3-4 *temp-string* arg1 #t 44 (bucket-id progress)))))
(set! sv-260 (* (-> arg0 sliding-height) f0-40))
)
)
)
)
)
(set! (-> arg1 origin y) (the float (+ sv-56 (the int sv-260))))
(while (and (< sv-20 sv-48) (< sv-20 (+ sv-24 10)))
(let* ((s4-6 (-> *game-info* mission-list sv-20))
(s3-5
(if (and (logtest? (-> s4-6 flags) (game-task-node-flag closed)) (task-complete? *game-info* (-> s4-6 task)))
(-> *game-info* play-list (-> s4-6 task) text-name)
(-> s4-6 description)
)
)
(s5-1 (lookup-text! *common-text* s3-5 #f))
)
0.0
(set! f0-50
(cond
((>= sv-20 (+ sv-24 -1))
(when (and (!= s3-5 381) (!= s3-5 380))
(let ((s3-6 print-game-text))
(format (clear *temp-string*) "~S" (lookup-text!
*common-text*
(if (logtest? (-> s4-6 flags) (game-task-node-flag closed))
(text-id progress-missions-icon-completed)
(text-id progress-missions-icon-todo)
)
#f
)
)
(s3-6 *temp-string* arg1 #f 44 (bucket-id progress))
)
)
(if (-> *pc-settings* use-vis?)
(+! (-> arg1 origin x) 20.0)
(+! (-> arg1 origin x) (* (-> *pc-settings* aspect-ratio-reciprocal) 20.0)))
(let ((f30-3 3.0)
(s4-7 print-game-text)
)
(format (clear *temp-string*) "~S" s5-1)
(set! f0-50 (+ f30-3 (s4-7 *temp-string* arg1 #f 44 (bucket-id progress))))
)
(if (-> *pc-settings* use-vis?)
(+! (-> arg1 origin x) -20.0)
(+! (-> arg1 origin x) (* (-> *pc-settings* aspect-ratio-reciprocal) -20.0)))
f0-50
)
(else
(let ((f30-4 3.0)
(s4-8 print-game-text)
)
(format (clear *temp-string*) "~S" s5-1)
(+ f30-4 (s4-8 *temp-string* arg1 #t 44 (bucket-id progress)))
)
)
)
)
)
(let ((v1-142 (+ sv-56 (the int f0-50))))
(set! sv-56 v1-142)
(set! (-> arg1 origin y) (the float (+ v1-142 (the int sv-260))))
)
(set! sv-20 (+ sv-20 1))
)
(if (zero? (-> *progress-state* total-num-tasks))
(print-game-text
(lookup-text! *common-text* (text-id progress-missions-none) #f)
arg1
#f
44
(bucket-id progress)
)
)
)
(end-scissor-missions sv-276 1.0)
(draw-missions-up-down arg1)
0
(none)
)
(defun draw-secret-list ((arg0 secret-item-option) (arg1 progress) (arg2 font-context) (arg3 int) (arg4 symbol) (arg5 float))
(let ((s4-0 (and arg4 (= arg3 1))))
380.0
270.0
(set! (-> arg2 origin x) 100.0)
(if (not (-> *pc-settings* use-vis?))
(set! (-> arg2 origin x) (the float (adjust-game-x (-> arg2 origin x)))))
(cond
((= s4-0 #t)
(cond
((= (-> arg0 can-toggle) 'auto)
)
((not (-> arg0 can-toggle))
(case (get-aspect-ratio)
(('aspect4x3)
(if (not (-> *pc-settings* use-vis?))
(+! (-> arg2 origin x) (* (-> *pc-settings* aspect-ratio-reciprocal) -25.0))
(+! (-> arg2 origin x) -25.0))
)
(('aspect16x9)
(+! (-> arg2 origin x) -10.0)
)
)
(when (= (-> *setting-control* user-default language) (language-enum german))
(set-scale! arg2 0.43)
)
(print-game-text
(lookup-text! *common-text* (text-id progress-secrets-go-to-title-screen) #f)
arg2
#f
44
(bucket-id progress)
)
)
((and (= (-> arg0 can-toggle) #t) (logtest? (-> *game-info* secrets) (-> arg0 flag)))
(set! (-> arg1 selected-option) #f)
(logclear! (-> *game-info* secrets) (-> arg0 flag))
)
((and (= (-> arg0 can-toggle) #t) (not (logtest? (-> *game-info* secrets) (-> arg0 flag))))
(logior! (-> *game-info* secrets) (-> arg0 flag))
(set! (-> arg1 selected-option) #f)
)
)
)
(else
(set-color! arg2 (if (= arg3 1)
(progress-selected 0)
(font-color progress)))
(set! (-> arg2 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3)
75
90
)
)
)
(if (not (-> *pc-settings* use-vis?))
(set! (-> arg2 origin x) (the float (adjust-game-x (-> arg2 origin x)))))
(cond
((logtest? (-> *game-info* sub-task-list (-> arg0 avail-after) flags) (game-task-node-flag closed))
(print-game-text (string-format "~S" (lookup-text! *common-text* (-> arg0 name) #f)) arg2 #f 44 (bucket-id progress))
)
(else
(print-game-text (string-format "????????") arg2 #f 44 (bucket-id progress))
)
)
(set! (-> arg2 origin x) 360.0)
(if (not (-> *pc-settings* use-vis?))
(set! (-> arg2 origin x) (the float (adjust-game-x (-> arg2 origin x)))))
(set-color! arg2 (font-color progress))
)
)
(cond
((and (not s4-0) (not (logtest? (-> *game-info* purchase-secrets) (-> arg0 flag))))
(if (not (-> *pc-settings* use-vis?))
(+! (-> arg2 origin x) (* (-> *pc-settings* aspect-ratio-reciprocal) 50))
(+! (-> arg2 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3)
50
45
))))
(print-game-text (string-format "~D" (-> arg0 cost)) arg2 #f 44 (bucket-id progress))
)
((and (not s4-0) (= (-> arg0 can-toggle) #t) (logtest? (-> *game-info* secrets) (-> arg0 flag)))
(if (not (-> *pc-settings* use-vis?))
(+! (-> arg2 origin x) (* (-> *pc-settings* aspect-ratio-reciprocal) 50))
(+! (-> arg2 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3)
50
45
))))
(print-game-text (string-format "~S" (lookup-text! *common-text* (text-id progress-on) #f)) arg2 #f 44 (bucket-id progress))
)
((and (not s4-0) (= (-> arg0 can-toggle) #t) (not (logtest? (-> *game-info* secrets) (-> arg0 flag))))
(if (not (-> *pc-settings* use-vis?))
(+! (-> arg2 origin x) (* (-> *pc-settings* aspect-ratio-reciprocal) 50))
(+! (-> arg2 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3)
50
45
))))
(print-game-text (string-format "~S" (lookup-text! *common-text* (text-id progress-off) #f)) arg2 #f 44 (bucket-id progress))
)
((and (not s4-0) (!= (-> arg0 can-toggle) #t))
(if (not (-> *pc-settings* use-vis?))
(+! (-> arg2 origin x) (* (-> *pc-settings* aspect-ratio-reciprocal) 80))
(+! (-> arg2 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3)
80
70
))))
(set-flags! arg2 (font-flags kerning right large))
(print-game-text (string-format "~S" (lookup-text! *common-text* (text-id progress-secrets-unlocked) #f)) arg2 #f 44 (bucket-id progress))
(set-flags! arg2 (font-flags kerning large))
)
)
)
(none)
)
(defmacro adjust-x-if-needed (x)
"adjust an x screen coord if ps2 vis is disabled"
`(if (not (-> *pc-settings* use-vis?)) (adjust-game-x (the float ,x)) ,x))
(defmethod draw-option menu-memcard-slot-option ((obj menu-memcard-slot-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars
(sv-16 float)
(sv-20 int)
(sv-24 float)
(sv-28 float)
(sv-32 float)
(sv-36 float)
(sv-40 int)
(sv-48 int)
(sv-56 int)
(sv-64 int)
(sv-72 int)
(sv-80 int)
(sv-88 int)
(sv-96 string)
(sv-112 int)
)
(set! sv-16 (* 2.0 (- 0.5 (-> arg0 menu-transition))))
(set! sv-20 (-> arg0 option-index))
(set! sv-24 (-> arg1 origin x))
(set! sv-28 (-> arg1 origin y))
(set! sv-32 (-> arg1 width))
(set! sv-36 (-> arg1 height))
(set! sv-40 (if (= (get-aspect-ratio) 'aspect4x3)
300
305
)
)
(set! sv-48 (if (= (get-aspect-ratio) 'aspect4x3)
140
140
)
)
(set! sv-56 (if (= (get-aspect-ratio) 'aspect4x3)
64
48
)
)
(set! sv-64 69)
(set! sv-72 110)
(set! sv-80 176)
(set! sv-88 54)
(if (< sv-16 0.0)
(set! sv-16 (the-as float 0.0))
)
(set! (-> arg1 alpha) sv-16)
(cond
((not (-> *bigmap* progress-minimap))
(draw-busy-loading arg1)
(return 0)
)
(else
(when (not (-> *pc-settings* use-vis?))
(set! sv-40 (the int (adjust-game-x (the float sv-40))))
(set! sv-56 (the int (* (-> *pc-settings* aspect-ratio-reciprocal) sv-56)))
)
(let ((s2-3 arg1))
(set! (-> s2-3 color) (if (= arg2 sv-20)
(the-as font-color (the-as int (progress-selected 0)))
(font-color progress)
)
)
)
(cond
((= *save-options-title* (-> arg0 current-options))
(set! (-> arg1 origin y) 80.0)
(set! (-> arg1 height) 52.0)
(+! (-> arg1 origin y) (the float (* 42 (+ arg2 1))))
(if (not (-> *pc-settings* use-vis?))
(+! (-> arg1 origin x) (* (-> *pc-settings* aspect-ratio-reciprocal) -100.0))
(+! (-> arg1 origin x) -100.0))
)
(else
(case (get-aspect-ratio)
(('aspect16x9)
(set! (-> arg1 origin y) 74.0)
(set! (-> arg1 height) 42.0)
(+! (-> arg1 origin y) (the float (* 60 (+ arg2 1))))
(if (not (-> *pc-settings* use-vis?))
(+! (-> arg1 origin x) (* (-> *pc-settings* aspect-ratio-reciprocal) -90.0))
(+! (-> arg1 origin x) -90.0))
)
(('aspect4x3)
(set! (-> arg1 origin y) 74.0)
(set! (-> arg1 height) 42.0)
(+! (-> arg1 origin y) (the float (* 54 (+ arg2 1))))
(if (not (-> *pc-settings* use-vis?))
(+! (-> arg1 origin x) (* (-> *pc-settings* aspect-ratio-reciprocal) -90.0))
(+! (-> arg1 origin x) -90.0))
)
)
)
)
(set-vector! (-> obj box 0 color) 64 128 128 (the int (* 128.0 sv-16)))
(when (= arg2 sv-20)
(cond
((!= *save-options-title* (-> arg0 current-options))
(case (get-aspect-ratio)
(('aspect16x9)
(set! sv-64 79)
(set! sv-72 110)
(set! sv-80 166)
(set! sv-88 62)
)
)
(when (not (-> *pc-settings* use-vis?))
(set! sv-64 (the int (adjust-game-x (the float sv-64))))
(set! sv-80 (the int (* (-> *pc-settings* aspect-ratio-reciprocal) sv-80)))
)
(draw-savegame-box
obj
(the float sv-64)
(the float (+ sv-64 sv-80))
(the float (+ sv-72 (* sv-88 arg2)))
(the float (+ sv-72 (* sv-88 arg2)))
)
(when (!= arg2 3)
(draw-savegame-box
obj
(the float sv-64)
(the float (+ sv-64 sv-80))
(the float (+ sv-72 sv-88 (* sv-88 arg2)))
(the float (+ sv-72 sv-88 (* sv-88 arg2)))
)
(draw-savegame-box
obj
(the float (+ sv-64 sv-80))
(the float (+ sv-64 sv-80))
(the float (+ sv-72 sv-88 (* sv-88 arg2)))
(the float (+ (* sv-88 4) 2 sv-72))
)
)
(draw-savegame-box
obj
(the float (+ sv-64 sv-80))
(the float (+ sv-64 sv-80))
(the float sv-72)
(the float (+ sv-72 (* sv-88 arg2)))
)
(with-dma-buffer-add-bucket ((s1-0 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id particles)
)
(draw-sprite2d-xy
s1-0
sv-64
(+ sv-72 (* sv-88 arg2))
sv-80
sv-88
(new 'static 'rgba :r #x40 :g #x40 :b #x40 :a (the int (* 64.0 sv-16)))
)
)
)
((= *save-options-title* (-> arg0 current-options))
(set! sv-88 42)
(let ((v0-13 (get-aspect-ratio)))
(when (= v0-13 'aspect16x9)
(set! sv-64 79)
(set! sv-72 110)
(set! sv-80 166)
(set! sv-88 42)
(draw-savegame-box
obj
(the float (+ sv-64 sv-80))
(the float (+ sv-64 sv-80))
(the float (+ sv-72 sv-88 (* sv-88 arg2)))
(the float (+ sv-72 (* 6 sv-88)))
)
)
)
(when (not (-> *pc-settings* use-vis?))
(set! sv-64 (the int (adjust-game-x (the float sv-64))))
(set! sv-80 (the int (* (-> *pc-settings* aspect-ratio-reciprocal) sv-80)))
)
(draw-savegame-box
obj
(the float sv-64)
(the float (+ sv-64 sv-80))
(the float (+ sv-72 (* sv-88 arg2)))
(the float (+ sv-72 (* sv-88 arg2)))
)
(when (!= arg2 4)
(draw-savegame-box
obj
(the float sv-64)
(the float (+ sv-64 sv-80))
(the float (+ sv-72 sv-88 (* sv-88 arg2)))
(the float (+ sv-72 sv-88 (* sv-88 arg2)))
)
(draw-savegame-box
obj
(the float (+ sv-64 sv-80))
(the float (+ sv-64 sv-80))
(the float (+ sv-72 sv-88 (* sv-88 arg2)))
(the float (+ (* 5 sv-88) 2 sv-72))
)
)
(draw-savegame-box
obj
(the float (+ sv-64 sv-80))
(the float (+ sv-64 sv-80))
(the float sv-72)
(the float (+ sv-72 (* sv-88 arg2)))
)
(with-dma-buffer-add-bucket ((s1-1 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id particles)
)
(draw-sprite2d-xy
s1-1
sv-64
(+ sv-72 (* sv-88 arg2))
sv-80
sv-88
(new 'static 'rgba :r #x40 :g #x40 :b #x40 :a (the int (* 64.0 sv-16)))
)
)
)
)
)
(cond
((and *progress-save-info*
(= (-> *progress-save-info* formatted) 1)
(= (-> *progress-save-info* inited) 1)
(= (-> *progress-save-info* file arg2 present) 1)
)
(cond
((= arg2 sv-20)
(set-scale! arg1 0.8)
)
(else
(set-scale! arg1 0.6)
)
)
(set-flags! arg1 (font-flags kerning large))
(if (not (-> *pc-settings* use-vis?))
(+! (-> arg1 origin x) (* (-> *pc-settings* aspect-ratio-reciprocal) 100))
(+! (-> arg1 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3)
100
105
))))
(print-game-text (string-format "~S ~D" (lookup-text! *common-text* (text-id progress-unknown-game) #f) (+ arg2 1))
arg1 #f 44 (bucket-id progress))
(set-color! arg1 (font-color progress))
(set! (-> arg1 origin x) 250.0)
(set! (-> arg1 origin y) 110.0)
(set! (-> arg1 width) 170.0)
(set! (-> arg1 height) 190.0)
(when (not (-> *pc-settings* use-vis?))
(*! (-> arg1 width) (-> *pc-settings* aspect-ratio-reciprocal))
(set! (-> arg1 origin x) (the float (adjust-game-x (-> arg1 origin x)))))
(let ((s2-8 (-> *progress-save-info* file arg2 level-index)))
(when (= arg2 sv-20)
(let ((v1-199 (-> obj sprites 0 color2)))
(set! (-> v1-199 0) 128)
(set! (-> v1-199 1) 128)
(set! (-> v1-199 2) 128)
(set! (-> v1-199 3) (the int (* 128.0 sv-16)))
)
(let ((v1-200 (-> obj sprites 1 color2)))
(set! (-> v1-200 0) 128)
(set! (-> v1-200 1) 128)
(set! (-> v1-200 2) 128)
(set! (-> v1-200 3) (the int (* 128.0 sv-16)))
)
(set! (-> obj sprites 1 pos z) #xffffff)
(set! (-> obj sprites 1 pos w) 1)
(set! (-> obj sprites 1 tex) (lookup-texture-by-id (get-level-icon-id-01 s2-8)))
(set! (-> obj sprites 1 scale-x) 1.0)
(set! (-> obj sprites 1 scale-y) 1.0)
(set-hud-piece-position! (-> obj sprites 1) sv-40 sv-48)
(let ((v1-205 (-> obj sprites 2 color2)))
(set! (-> v1-205 0) 128)
(set! (-> v1-205 1) 128)
(set! (-> v1-205 2) 128)
(set! (-> v1-205 3) (the int (* 128.0 sv-16)))
)
(set! (-> obj sprites 2 pos z) #xffffff)
(set! (-> obj sprites 2 pos w) 1)
(set! (-> obj sprites 2 tex) (lookup-texture-by-id (get-level-icon-id-02 s2-8)))
(set! (-> obj sprites 2 scale-x) 1.0)
(set! (-> obj sprites 2 scale-y) 1.0)
(set-hud-piece-position! (-> obj sprites 2) (+ sv-40 sv-56) sv-48)
(let ((v1-211 (-> obj sprites 3 color2)))
(set! (-> v1-211 0) 128)
(set! (-> v1-211 1) 128)
(set! (-> v1-211 2) 128)
(set! (-> v1-211 3) (the int (* 128.0 sv-16)))
)
(set! (-> obj sprites 3 pos z) #xffffff)
(set! (-> obj sprites 3 pos w) 1)
(set! (-> obj sprites 3 tex) (lookup-texture-by-id (get-level-icon-id-03 s2-8)))
(set! (-> obj sprites 3 scale-x) 1.0)
(set! (-> obj sprites 3 scale-y) 1.0)
(set-hud-piece-position! (-> obj sprites 3) sv-40 (+ sv-48 64))
(let ((v1-217 (-> obj sprites 4 color2)))
(set! (-> v1-217 0) 128)
(set! (-> v1-217 1) 128)
(set! (-> v1-217 2) 128)
(set! (-> v1-217 3) (the int (* 128.0 sv-16)))
)
(set! (-> obj sprites 4 pos z) #xffffff)
(set! (-> obj sprites 4 pos w) 1)
(set! (-> obj sprites 4 tex) (lookup-texture-by-id (get-level-icon-id-04 s2-8)))
(set! (-> obj sprites 4 scale-x) 1.0)
(set! (-> obj sprites 4 scale-y) 1.0)
(set-hud-piece-position! (-> obj sprites 4) (+ sv-40 sv-56) (+ sv-48 64))
(with-dma-buffer-add-bucket ((s1-7 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id progress)
)
(draw (-> obj sprites 1) s1-7 (-> *level* default-level))
(draw (-> obj sprites 2) s1-7 (-> *level* default-level))
(draw (-> obj sprites 3) s1-7 (-> *level* default-level))
(draw (-> obj sprites 4) s1-7 (-> *level* default-level))
)
(set-scale! arg1 0.6)
(set! (-> arg1 origin x) 265.0)
(set! (-> arg1 origin y) 263.0)
(set! (-> arg1 width) 170.0)
(set! (-> arg1 height) 52.0)
(when (not (-> *pc-settings* use-vis?))
(*! (-> arg1 width) (-> *pc-settings* aspect-ratio-reciprocal))
(set! (-> arg1 origin x) (the float (adjust-game-x (-> arg1 origin x)))))
(set! (-> obj sprites 0 scale-x) 0.7)
(set! (-> obj sprites 0 scale-y) 0.7)
(set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #xc93)))
(set-hud-piece-position! (-> obj sprites 0) (adjust-x-if-needed 265) 263)
(with-dma-buffer-add-bucket ((s1-8 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id progress)
)
(draw (-> obj sprites 0) s1-8 (-> *level* default-level))
)
(+! (-> arg1 origin y) 1.0)
(if (not (-> *pc-settings* use-vis?))
(+! (-> arg1 origin x) (* (-> *pc-settings* aspect-ratio-reciprocal) 28))
(+! (-> arg1 origin x) 28.0))
(let* ((v1-272 (-> *progress-save-info* file arg2 game-time0))
(v1-273 (logior (shl (-> *progress-save-info* file arg2 game-time1) 32) v1-272))
(s2-11 (/ (the-as int v1-273) #x107ac0))
)
(set! sv-112 (/ (mod (the-as int v1-273) #x107ac0) #x4650))
(print-game-text (string-format "~2,'0D:~2,'0D" s2-11 sv-112) arg1 #f 44 (bucket-id progress))
)
(set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x6 :page #xc93)))
(set-hud-piece-position! (-> obj sprites 0) (adjust-x-if-needed 368) 263)
(with-dma-buffer-add-bucket ((s1-10 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id progress)
)
(draw (-> obj sprites 0) s1-10 (-> *level* default-level))
)
(if (not (-> *pc-settings* use-vis?))
(+! (-> arg1 origin x) (* (-> *pc-settings* aspect-ratio-reciprocal) 100))
(+! (-> arg1 origin x) 100.0))
(print-game-text (string-format "~D%" (the int (-> *progress-save-info* file arg2 completion-percentage))) arg1 #f 44 (bucket-id progress))
(set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x5 :page #xc93)))
(set-hud-piece-position! (-> obj sprites 0) (adjust-x-if-needed 368) 289)
(with-dma-buffer-add-bucket ((s1-12 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id progress)
)
(draw (-> obj sprites 0) s1-12 (-> *level* default-level))
)
(+! (-> arg1 origin y) 28.0)
(print-game-text (string-format "~D" (the int (-> *progress-save-info* file arg2 skill-count))) arg1 #f 44 (bucket-id progress))
(set! (-> obj sprites 0 scale-x) 0.6)
(set! (-> obj sprites 0 scale-y) 0.6)
(set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x82 :page #xc93)))
(set-hud-piece-position! (-> obj sprites 0) (adjust-x-if-needed 253) 290)
(with-dma-buffer-add-bucket ((s1-14 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id progress)
)
(draw (-> obj sprites 0) s1-14 (-> *level* default-level))
)
(if (not (-> *pc-settings* use-vis?))
(+! (-> arg1 origin x) (* (-> *pc-settings* aspect-ratio-reciprocal) -100))
(+! (-> arg1 origin x) -100.0))
(print-game-text (string-format "~D" (the int (-> *progress-save-info* file arg2 gem-count))) arg1 #f 44 (bucket-id progress))
)
)
)
((and *progress-save-info*
(= (-> *progress-save-info* formatted) 1)
(= (-> *progress-save-info* inited) 1)
(zero? (-> *progress-save-info* file arg2 present))
)
(cond
((= arg2 sv-20)
(set-scale! arg1 0.8)
)
(else
(set-scale! arg1 0.6)
)
)
(set-flags! arg1 (font-flags kerning large))
(if (not (-> *pc-settings* use-vis?))
(+! (-> arg1 origin x) (* (-> *pc-settings* aspect-ratio-reciprocal) 100))
(+! (-> arg1 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3)
100
105
))))
(print-game-text
(lookup-text! *common-text* (text-id progress-slot-empty) #f)
arg1
#f
44
(bucket-id progress)
)
)
)
(set! (-> arg1 origin x) sv-24)
(set! (-> arg1 origin y) sv-28)
(set! (-> arg1 width) sv-32)
(set! (-> arg1 height) sv-36)
(if (zero? arg2)
(draw-decoration-load-save obj arg1 sv-16 (if (= (-> arg0 current) 'select-load)
(text-id progress-select-file-to-load)
(text-id progress-select-file-to-save)
)
)
)
)
)
0
(none)
)
(defmethod draw-option menu-sub-menu-option ((obj menu-sub-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))
(s2-0 (the int (+ -1.0 (-> arg1 origin y))))
(s1-0 22)
)
(if (< f30-0 0.0)
(set! f30-0 0.0)
)
(set! (-> arg1 alpha) f30-0)
(set-scale! arg1 0.6)
(cond
((= *title* (-> arg0 current-options))
(set-scale! arg1 0.85)
(set! (-> arg1 height) 40.0)
(set! s1-0 36)
(+! s2-0 -8)
(when (memcard-unlocked-secrets? #f)
(+! (-> arg1 origin y) -35.0)
(set! s1-0 36)
(+! s2-0 -34)
)
)
((= *options* (-> arg0 current-options))
(+! (-> arg1 origin y) -20.0)
(set-scale! arg1 0.85)
(set! (-> arg1 height) 40.0)
(set! s1-0 37)
(+! s2-0 -28)
)
)
(when (nonzero? (-> obj name))
(let ((s0-0 arg1))
(set! (-> s0-0 color) (if (= arg2 (-> arg0 option-index))
(the-as font-color (the-as int (progress-selected 0)))
(font-color progress)
)
)
)
(cond
((= arg2 (-> arg0 option-index))
(set-color! arg1 (progress-selected 0))
)
(else
(set-color! arg1 (font-color progress))
)
)
(if (and (and (= arg2 (-> arg0 option-index)) (!= 298 (-> obj name)))
(not (and (= (-> obj name) (text-id progress-root-secrets))
(= *title* (-> arg0 current-options))
(not (memcard-unlocked-secrets? #f))
(= (-> arg0 option-index) 3)
)
)
)
(draw-highlight s2-0 s1-0 f30-0)
)
(cond
((= *save-options-title* (-> arg0 current-options))
(cond
((= (-> obj name) (text-id progress-continue-without-saving))
(cond
((= arg2 (-> arg0 option-index))
(set-scale! arg1 0.5)
)
(else
(set-scale! arg1 0.45)
)
)
(+! (-> arg1 origin y) -120.0)
(if (not (-> *pc-settings* use-vis?))
(-! (-> arg1 origin x) (* (-> *pc-settings* aspect-ratio-reciprocal) 10))
(-! (-> arg1 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3)
10
5
))))
(set! (-> arg1 width) (the float (if (= (get-aspect-ratio) 'aspect4x3)
180
170
)
)
)
(set! (-> arg1 height) 260.0)
(if (not (-> *pc-settings* use-vis?))
(*! (-> arg1 width) (-> *pc-settings* aspect-ratio-reciprocal)))
(print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress))
(when (= arg2 (-> arg0 option-index))
(let ((s4-1 69)
(s2-4 110)
(s3-1 176)
(s1-1 42)
)
(case (get-aspect-ratio)
(('aspect16x9)
(set! s4-1 79)
(set! s2-4 110)
(set! s3-1 166)
(set! s1-1 42)
(with-dma-buffer-add-bucket ((sv-16 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id progress)
)
(draw-sprite2d-xy
sv-16
s4-1
(+ (* s1-1 arg2) 8 s1-1 s2-4)
s3-1
(+ s1-1 -8)
(new 'static 'rgba :r #x40 :g #x40 :b #x40 :a (the int (* 64.0 f30-0)))
)
)
)
)
(when (not (-> *pc-settings* use-vis?))
(set! s4-1 (adjust-game-x (the float s4-1)))
(set! s3-1 (the int (* (-> *pc-settings* aspect-ratio-reciprocal) s3-1)))
)
(set-vector! (-> obj box 0 color) 64 128 128 (the int (* 128.0 f30-0)))
(draw-savegame-box
obj
(the float s4-1)
(the float (+ s4-1 s3-1))
(the float (+ s2-4 (* s1-1 arg2)))
(the float (+ s2-4 (* s1-1 arg2)))
)
(draw-savegame-box
obj
(the float (+ s4-1 s3-1))
(the float (+ s4-1 s3-1))
(the float s2-4)
(the float (+ s2-4 (* s1-1 arg2)))
)
(with-dma-buffer-add-bucket ((s0-3 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id particles)
)
(draw-sprite2d-xy
s0-3
s4-1
(+ s2-4 (* s1-1 arg2))
s3-1
(+ s1-1 8)
(new 'static 'rgba :r #x40 :g #x40 :b #x40 :a (the int (* 64.0 f30-0)))
)
)
)
)
)
(else
(if (not (-> *pc-settings* use-vis?))
(+! (-> arg1 origin x) (* (-> *pc-settings* aspect-ratio-reciprocal) -100.0))
(+! (-> arg1 origin x) -100.0))
(set! (-> arg1 origin y) (+ -35.0 (-> arg1 origin y)))
)
)
)
((= *load-save-options* (-> arg0 current-options))
(+! (-> arg1 origin x) -100.0)
(+! (-> arg1 origin y) -25.0)
(print-menu-text (lookup-text! *common-text* (-> obj name) #f) (-> obj scale) arg1 arg0)
)
((and (= *title* (-> arg0 current-options))
(= (text-id progress-root-secrets) (-> obj name))
(memcard-unlocked-secrets? #f)
)
(print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress))
)
((!= (-> obj name) (text-id progress-root-secrets))
(print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress))
)
)
)
)
0
(none)
)
(defmethod draw-option menu-icon-info-option ((obj menu-icon-info-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(set-color! arg1 (font-color progress))
(set-scale! arg1 0.5)
(set! (-> *bigmap* auto-save-icon-flag) #t)
(set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x48 :page #x67a)))
(set! (-> obj sprites 0 scale-x) 1.0)
(set! (-> obj sprites 0 scale-y) 1.0)
(let ((v1-6 (-> obj sprites 0 color2)))
(set! (-> v1-6 0) 128)
(set! (-> v1-6 1) 128)
(set! (-> v1-6 2) 128)
(set! (-> v1-6 3) (the int (* 128.0 (- 1.0 (-> arg0 menu-transition)))))
)
(set! (-> obj sprites 0 pos z) #xffffff)
(set! (-> obj sprites 0 pos w) 0)
(set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) (adjust-x-if-needed 240) 160)
(with-dma-buffer-add-bucket ((s3-0 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id progress)
)
(draw (-> obj sprites 0) s3-0 (-> *level* default-level))
)
(set-flags! arg1 (font-flags kerning middle left large))
(set! (-> arg1 origin x) 90.0)
(set! (-> arg1 origin y) 80.0)
(set-width! arg1 330)
(set-height! arg1 85)
(when (not (-> *pc-settings* use-vis?))
(set! (-> arg1 origin x) (the float (adjust-game-x (-> arg1 origin x))))
(*! (-> arg1 width) (-> *pc-settings* aspect-ratio-reciprocal))
)
(print-game-text
(lookup-text! *common-text* (text-id progress-autosave-explanation) #f)
arg1
#f
44
(bucket-id progress)
)
(+! (-> arg1 origin y) 115.0)
(set-height! arg1 95)
(print-game-text
(lookup-text! *common-text* (text-id progress-autosave-dont-remove) #f)
arg1
#f
44
(bucket-id progress)
)
(+! (-> arg1 origin y) 90.0)
(set-height! arg1 50)
(set-color! arg1 (progress-selected 0))
(draw-highlight (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha))
(print-game-text
(lookup-text! *common-text* (text-id progress-unknown-continue) #f)
arg1
#f
44
(bucket-id progress)
)
0
(none)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; CUSTOM MENU OPTIONS
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defmethod draw-option menu-aspect-ratio-pc-option ((obj menu-aspect-ratio-pc-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(let ((alpha (* 2.0 (- 0.5 (-> arg0 menu-transition)))))
(max! alpha 0.0)
(set! (-> arg1 alpha) alpha)
(set-flags! arg1 (font-flags kerning middle large))
(set-scale! arg1 0.65)
(+! (-> arg1 origin y) 15.0)
(+! (-> arg1 origin y) -8.0)
(let ((ar-names (new 'static 'boxed-array :type text-id
(text-id progress-aspect-ratio-4x3)
(text-id progress-aspect-ratio-16x9)
(text-id progress-aspect-ratio-auto)
(text-id progress-aspect-ratio-custom)
)))
(cond
(arg3
(set-color! arg1 (font-color progress-force-selected))
(draw-highlight (the int (+ -1.0 (-> arg1 origin y))) 41 alpha)
(print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress))
(+! (-> arg1 origin y) 23.0)
(set! *temp-string* (clear *temp-string*))
(dotimes (i (-> ar-names length))
(if (> i 0)
(format *temp-string* " "))
(if (= i (-> *progress-state-pc* aspect-ratio-choice-index))
(format *temp-string* "~33L~S" (lookup-text! *common-text* (-> ar-names i) #f))
(format *temp-string* "~35L~S" (lookup-text! *common-text* (-> ar-names i) #f)))
)
(format *temp-string* "~1L")
)
(else
(cond
((= arg2 (-> arg0 option-index))
(set-color! arg1 (progress-selected 0))
(draw-highlight (the int (+ -1.0 (-> arg1 origin y))) 22 alpha)
)
(else
(set-color! arg1 (font-color progress))
)
)
(print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress))
(+! (-> arg1 origin y) 23.0)
(set! *temp-string* (clear *temp-string*))
(dotimes (i (-> ar-names length))
(if (> i 0)
(format *temp-string* " "))
(if (= i (-> *progress-state-pc* aspect-ratio-choice-index))
(format *temp-string* "~1L~S" (lookup-text! *common-text* (-> ar-names i) #f))
(format *temp-string* "~35L~S" (lookup-text! *common-text* (-> ar-names i) #f)))
)
(format *temp-string* "~1L")
)
)
)
(set-scale! arg1 0.45)
(print-game-text *temp-string* arg1 #f 44 (bucket-id progress))
(when-not-drawn-decoration
(draw-decoration obj arg1 alpha (text-id progress-root-graphic-options) #f 0.95))
)
0
(none)
)
(defmethod draw-option menu-display-mode-option ((obj menu-display-mode-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(let ((alpha (* 2.0 (- 0.5 (-> arg0 menu-transition)))))
(max! alpha 0.0)
(set! (-> arg1 alpha) alpha)
(set-flags! arg1 (font-flags kerning middle large))
(set-scale! arg1 0.65)
(+! (-> arg1 origin y) 15.0)
(+! (-> arg1 origin y) -8.0)
(let ((names (new 'static 'boxed-array :type text-id
(text-id progress-windowed)
(text-id progress-fullscreen)
(text-id progress-borderless)
)))
(cond
(arg3
(set-color! arg1 (font-color progress-force-selected))
(draw-highlight (the int (+ -1.0 (-> arg1 origin y))) 41 alpha)
(print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress))
(+! (-> arg1 origin y) 23.0)
(set! *temp-string* (clear *temp-string*))
(dotimes (i (-> names length))
(if (> i 0)
(format *temp-string* " "))
(if (= i (-> *progress-state-pc* display-mode-choice-index))
(format *temp-string* "~33L~S" (lookup-text! *common-text* (-> names i) #f))
(format *temp-string* "~35L~S" (lookup-text! *common-text* (-> names i) #f)))
)
(format *temp-string* "~1L")
)
(else
(cond
((= arg2 (-> arg0 option-index))
(set-color! arg1 (progress-selected 0))
(draw-highlight (the int (+ -1.0 (-> arg1 origin y))) 22 alpha)
)
(else
(set-color! arg1 (font-color progress))
)
)
(print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress))
(+! (-> arg1 origin y) 23.0)
(set! *temp-string* (clear *temp-string*))
(dotimes (i (-> names length))
(if (> i 0)
(format *temp-string* " "))
(if (= i (-> *progress-state-pc* display-mode-choice-index))
(format *temp-string* "~1L~S" (lookup-text! *common-text* (-> names i) #f))
(format *temp-string* "~35L~S" (lookup-text! *common-text* (-> names i) #f)))
)
(format *temp-string* "~1L")
)
)
)
(set-scale! arg1 0.5)
(print-game-text *temp-string* arg1 #f 44 (bucket-id progress))
(when-not-drawn-decoration
(draw-decoration obj arg1 alpha (text-id progress-root-graphic-options) #f 0.95))
)
0
(none)
)
(defmethod draw-option menu-on-off-vsync-option ((obj menu-on-off-vsync-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(let ((alpha (* 2.0 (- 0.5 (-> arg0 menu-transition)))))
(max! alpha 0.0)
(set! (-> arg1 alpha) alpha)
(set-flags! arg1 (font-flags kerning middle large))
(set-scale! arg1 0.65)
(+! (-> arg1 origin y) 15.0)
(+! (-> arg1 origin y) -8.0)
(let ((names (new 'static 'boxed-array :type text-id
(text-id progress-windowed)
(text-id progress-fullscreen)
(text-id progress-borderless)
)))
(cond
(arg3
(set-color! arg1 (font-color progress-force-selected))
(draw-highlight (the int (+ -1.0 (-> arg1 origin y))) 41 alpha)
(print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress))
(+! (-> arg1 origin y) 23.0)
(set! *temp-string* (clear *temp-string*))
(if (-> *progress-state* on-off-choice)
(format *temp-string* "~33L~S~35L ~S" (lookup-text! *common-text* (text-id progress-on) #f) (lookup-text! *common-text* (text-id progress-off) #f))
(format *temp-string* "~35L~S ~33L~S~1L" (lookup-text! *common-text* (text-id progress-on) #f) (lookup-text! *common-text* (text-id progress-off) #f)))
)
(else
(cond
((= arg2 (-> arg0 option-index))
(set-color! arg1 (progress-selected 0))
(draw-highlight (the int (+ -1.0 (-> arg1 origin y))) 22 alpha)
)
(else
(set-color! arg1 (font-color progress))
)
)
(print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress))
(+! (-> arg1 origin y) 23.0)
(set! *temp-string* (clear *temp-string*))
(if (-> *progress-state* on-off-choice)
(format *temp-string* "~1L~S~35L ~S" (lookup-text! *common-text* (text-id progress-on) #f) (lookup-text! *common-text* (text-id progress-off) #f))
(format *temp-string* "~35L~S ~1L~S~1L" (lookup-text! *common-text* (text-id progress-on) #f) (lookup-text! *common-text* (text-id progress-off) #f)))
)
)
)
(set-scale! arg1 0.5)
(print-game-text *temp-string* arg1 #f 44 (bucket-id progress))
(when-not-drawn-decoration
(draw-decoration obj arg1 alpha (text-id progress-root-graphic-options) #f 0.95))
)
0
(none)
)
(defun draw-decoration-aspect-ratio-custom ((arg0 menu-option) (arg1 font-context) (arg2 float) (arg3 text-id) (arg5 float))
(let ((gp-0 70)
(s5-0 120)
(sv-48 87)
(s3-0 375)
(s2-0 210)
(sv-64 0)
)
(case (get-aspect-ratio)
(('aspect4x3)
(set! gp-0 69)
(set! s5-0 129)
(set! sv-48 80)
(set! s3-0 375)
(set! s2-0 210)
)
(('aspect16x9)
(set! gp-0 79)
(set! s5-0 129)
(set! sv-48 68)
(set! s3-0 356)
(set! s2-0 244)
)
)
(when (not (-> *pc-settings* use-vis?))
(set! gp-0 (the int (adjust-game-x (the float gp-0))))
(set! s3-0 (the int (* (-> *pc-settings* aspect-ratio-reciprocal) s3-0)))
)
(set-scale! arg1 arg5)
(set! (-> arg1 origin y) (the float sv-48))
(set! (-> arg1 height) 50.0)
(set-color! arg1 (font-color progress))
(set-flags! arg1 (font-flags kerning middle left large))
(print-game-text (lookup-text! *common-text* arg3 #f) arg1 #f 44 (bucket-id progress))
(set-vector! (-> arg0 box 0 color) 64 128 128 (the int (* 128.0 arg2)))
(draw-savegame-box arg0 (the float gp-0) (the float (+ gp-0 s3-0)) (the float s5-0) (the float s5-0))
(with-dma-buffer-add-bucket ((s0-1 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id particles)
)
(draw-sprite2d-xy
s0-1
gp-0
s5-0
s3-0
s2-0
(new 'static 'rgba :r #x40 :g #x40 :b #x40 :a (the int (* 64.0 arg2)))
)
)
)
)
(defun draw-highlight-aspect ((x int) (y int) (w int) (h int) (alpha float))
"draw the highlight for a number in the aspect ratio screen"
(with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id progress)
)
(when (not (-> *pc-settings* use-vis?))
(set! x (adjust-game-x (the float x)))
(set! w (the int (* (-> *pc-settings* aspect-ratio-reciprocal) w)))
)
(draw-sprite2d-xy buf x y w h (new 'static 'rgba :r #x40 :g #x80 :b #x80 :a (the int (* 64.0 alpha))))
)
)
(defun draw-highlight-music-player ((x int) (y int) (w int) (h int) (alpha float))
"draw the highlight for a number in the music player screen"
(with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id progress)
)
(draw-sprite2d-xy buf x y w h (new 'static 'rgba :r #x40 :g #x80 :b #x80 :a (the int (* 64.0 alpha))))
)
)
(defun draw-up-down-aspect ((font font-context) (y-up float) (y-down float))
(protect ((-> font origin x) (-> font origin y) (-> font scale))
(let ((start-y (-> font origin y)))
(set-scale! font 0.5)
(set! (-> font origin y) (- start-y y-up))
(print-game-text (string-format "~33L~C" 160) font #f 44 (bucket-id progress))
(set! (-> font origin y) (+ start-y y-down))
(print-game-text (string-format "~33L~C" 162) font #f 44 (bucket-id progress))
)
)
0)
(defmacro swap-confirm? ()
"is the confirm button swapped from X?"
`(and (language? japanese korean)
(case (scf-get-territory)
((GAME_TERRITORY_SCEI GAME_TERRITORY_SCEK) #t)
(else #f))))
(defmethod draw-option menu-aspect-ratio-custom-option ((obj menu-aspect-ratio-custom-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(let* ((alpha (* 2.0 (- 0.5 (-> arg0 menu-transition))))
(middle-pad 15.0)
(middle-pad-uncorrected middle-pad)
(numbers-y 206.0)
(numbers-text-y (- numbers-y 44.0))
(hilite-width 36)
(hilite-height 16)
(hilite-y-ofs 6)
(hilite-height-total (+ hilite-height (* 2 hilite-y-ofs)))
(font-w 100)
(font-w-corrected (if (not (-> *pc-settings* use-vis?)) (the int (* (-> *pc-settings* aspect-ratio-reciprocal) font-w))
font-w))
)
(max! alpha 0.0)
(set! (-> arg1 alpha) alpha)
(set-flags! arg1 (font-flags kerning middle large))
(set-scale! arg1 0.65)
(set-color! arg1 (font-color progress))
(set! (-> arg1 origin y) 80.0)
(if (not (-> *pc-settings* use-vis?))
(*! middle-pad (-> *pc-settings* aspect-ratio-reciprocal)))
(protect ((-> arg1 origin x) (-> arg1 width))
(set-scale! arg1 0.6)
(set-width! arg1 50)
(set! (-> arg1 origin y) numbers-y)
(set! (-> arg1 origin x) (- 256.0 25))
(print-game-text "x" arg1 #f 44 (bucket-id progress))
(set-width! arg1 font-w-corrected)
(set-scale! arg1 0.6)
(set! (-> arg1 origin y) numbers-y)
(set! (-> arg1 origin x) (- 256.0 middle-pad font-w-corrected))
(cond
((= 0 (-> *progress-state-pc* aspect-ratio-ratio-index))
(draw-highlight-aspect
(- (the int (+ (- 256.0 middle-pad-uncorrected font-w) (/ font-w 2))) (/ hilite-width 2))
(- (the int (-> arg1 origin y)) hilite-y-ofs)
hilite-width hilite-height-total
alpha)
(set-color! arg1 (progress-selected 0))
(draw-up-down-aspect arg1 21.0 25.0))
(else
(set-color! arg1 (font-color progress)))
)
(print-game-text (string-format "~D" (-> *pc-settings* aspect-custom-x)) arg1 #f 44 (bucket-id progress))
(set-scale! arg1 0.55)
(set-color! arg1 (font-color progress))
(set! (-> arg1 origin y) numbers-text-y)
(print-game-text (lookup-text! *common-text* (text-id progress-aspect-ratio-custom-width) #f) arg1 #f 44 (bucket-id progress))
(set-scale! arg1 0.6)
(set! (-> arg1 origin y) numbers-y)
(set! (-> arg1 origin x) (+ 256.0 middle-pad))
(cond
((= 1 (-> *progress-state-pc* aspect-ratio-ratio-index))
(draw-highlight-aspect
(- (the int (+ (+ 256.0 middle-pad-uncorrected) (/ font-w 2))) (/ hilite-width 2))
(- (the int (-> arg1 origin y)) hilite-y-ofs)
hilite-width hilite-height-total
alpha)
(set-color! arg1 (progress-selected 0))
(draw-up-down-aspect arg1 21.0 25.0))
(else
(set-color! arg1 (font-color progress)))
)
(print-game-text (string-format "~D" (-> *pc-settings* aspect-custom-y)) arg1 #f 44 (bucket-id progress))
(set-scale! arg1 0.55)
(set-color! arg1 (font-color progress))
(set! (-> arg1 origin y) numbers-text-y)
(print-game-text (lookup-text! *common-text* (text-id progress-aspect-ratio-custom-height) #f) arg1 #f 44 (bucket-id progress))
)
(set! (-> arg1 origin y) 289.0)
(cond
((< (/ (the float (-> *pc-settings* aspect-custom-x)) (the float (-> *pc-settings* aspect-custom-y))) (/ 4.0 3.0))
(set-scale! arg1 0.5)
(set-color! arg1 (font-color red))
(when (and (< (/ (the float (-> *pc-settings* aspect-custom-x)) (the float (-> *pc-settings* aspect-custom-y))) (/ 4.0 3.0))
(< (mod (-> *display* real-clock frame-counter) (seconds 1.2)) (seconds 1.0)))
(print-game-text (lookup-text! *common-text* (text-id progress-aspect-ratio-custom-warn) #f) arg1 #f 44 (bucket-id progress))
)
)
(else
(set-scale! arg1 0.55)
(set-color! arg1 (font-color progress))
(print-game-text (lookup-text! *common-text* (if (not (swap-confirm?))
(text-id progress-aspect-ratio-custom-pad-x)
(text-id progress-aspect-ratio-custom-pad-circle)) #f) arg1 #f 44 (bucket-id progress))
)
)
(when-not-drawn-decoration
(draw-decoration-aspect-ratio-custom obj arg1 alpha (text-id progress-aspect-ratio-custom-title) 0.55))
)
0
(none)
)
(defun begin-scissor-music-player ((box hud-box))
(cond
((= (get-aspect-ratio) 'aspect16x9)
(set! (-> box min x) 19.0)
(set! (-> box min y) 129.0)
(set! (-> box max x) 274.0)
(set! (-> box max y) 304.0)
)
(else
(set! (-> box min x) 70.0)
(set! (-> box min y) 129.0)
(set! (-> box max x) 268.0)
(set! (-> box max y) 270.0)
)
)
(#when PC_PORT
(set! (-> box min x) (the float (the int (adjust-game-x (-> box min x)))))
(set! (-> box max x) (the float (the int (adjust-game-x (-> box max x)))))
)
(with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id progress)
)
(setup-scissor box buf)
)
0
)
(defun end-scissor-music-player ((box hud-box))
(with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id progress)
)
(restore-scissor box buf)
)
0
)
(defun draw-decoration-music-player ((arg0 menu-option) (arg1 font-context) (arg2 float) (arg3 text-id) (arg5 float) (box hud-box))
(let ((list-x (the int (-> box min x)))
(list-y (the int (-> box min y)))
(title-x 70)
(title-y 80)
(list-w (the int (- (-> box max x) (-> box min x))))
(list-h (the int (- (-> box max y) (-> box min y))))
(full-w 375)
(full-h 199)
)
(case (get-aspect-ratio)
(('aspect16x9)
(set! title-y 69)
(set! full-w 355)
(set! full-h 233)
(*! arg5 1.25)
)
)
(when (not (-> *pc-settings* use-vis?))
(set! title-x (the int (adjust-game-x (the float title-x))))
(set! full-w (the int (* (-> *pc-settings* aspect-ratio-reciprocal) full-w)))
)
(set-scale! arg1 arg5)
(set-origin! arg1 title-x title-y)
(set! (-> arg1 width) 375.0)
(set! (-> arg1 height) 48.0)
(when (not (-> *pc-settings* use-vis?))
(*! (-> arg1 width) (-> *pc-settings* aspect-ratio-reciprocal))
)
(set-color! arg1 (font-color progress))
(set-flags! arg1 (font-flags kerning middle left large))
(print-game-text (lookup-text! *common-text* arg3 #f) arg1 #f 44 (bucket-id progress))
(set-vector! (-> arg0 box 0 color) 64 128 128 (the int (* 128.0 arg2)))
(draw-savegame-box arg0 (the float list-x) (the float (+ list-x full-w)) (the float list-y) (the float list-y))
(draw-savegame-box arg0 (the float list-x) (the float (+ list-x list-w)) (the float (+ list-y list-h)) (the float (+ list-y list-h)))
(draw-savegame-box arg0 (the float (+ list-x list-w)) (the float (+ list-x list-w)) (the float list-y) (the float (+ list-y full-h)))
(with-dma-buffer-add-bucket ((s0-1 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id particles)
)
(draw-sprite2d-xy
s0-1
list-x
list-y
list-w
list-h
(new 'static 'rgba :r #x40 :g #x40 :b #x40 :a (the int (* 64.0 arg2)))
)
)
)
)
(defun draw-up-down-music-player ((font font-context) (box hud-box))
(protect ((-> font origin x) (-> font origin y) (-> font scale) (-> font width) (-> font height))
(let ((start-y (-> font origin y)))
(set-scale! font 0.5)
(set! (-> font width) (- (-> box max x) (-> box min x)))
(set! (-> font height) 16.0)
(set-flags! font (font-flags kerning large middle))
(set! (-> font origin x) (-> box min x))
(set! (-> font origin y) (- (-> box min y) (-> font height)))
(print-game-text (string-format "~33L~C" 160) font #f 44 (bucket-id progress))
(set! (-> font origin y) (+ 3.0 (-> box max y)))
(print-game-text (string-format "~33L~C" 162) font #f 44 (bucket-id progress))
)
)
0)
(defmacro set-hud-sprite-attributes! (sprite
&key (r 128)
&key (g 128)
&key (b 128)
&key (a 1.0)
&key x
&key y
&key (z #xffffff)
&key (w 1)
&key tex
&key (scale-x 1.0)
&key (scale-y 1.0)
)
(with-gensyms (col)
`(begin
(let ((,col (-> ,sprite color2)))
(set! (-> ,col 0) ,r)
(set! (-> ,col 1) ,g)
(set! (-> ,col 2) ,b)
(set! (-> ,col 3) (the int (* 128.0 ,a)))
)
(set! (-> ,sprite pos z) ,z)
(set! (-> ,sprite pos w) ,w)
(set! (-> ,sprite tex) ,tex)
(set! (-> ,sprite scale-x) ,scale-x)
(set! (-> ,sprite scale-y) ,scale-y)
(set-hud-piece-position! ,sprite ,x ,y)
)))
(defmethod draw-option menu-music-player-option ((obj menu-music-player-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(let* ((alpha (* 2.0 (- 0.5 (-> arg0 menu-transition))))
(y-pad-top 11)
(text-height 23)
(old-y 0.0)
(list-text-y (+ (- (-> obj current-scroll)) y-pad-top))
(max-lines 8)
(tab-music 6.0)
(tab-flava 12.0)
(box (new 'stack 'hud-box))
(flava-text-list (new 'static 'boxed-array :type text-id
(text-id progress-music-player-flava-default)
(text-id progress-music-player-flava-gun)
(text-id progress-music-player-flava-board)
(text-id progress-music-player-flava-mech)
(text-id progress-music-player-flava-darkjak)
(text-id progress-music-player-flava-pilot)
)))
(max! alpha 0.0)
(set! (-> arg1 alpha) alpha)
(when (not (-> *pc-settings* use-vis?))
(*! tab-music (-> *pc-settings* aspect-ratio-reciprocal))
(*! tab-flava (-> *pc-settings* aspect-ratio-reciprocal))
;(set! danger-w (the int (* (-> *pc-settings* aspect-ratio-reciprocal) danger-w)))
)
(set-flags! arg1 (font-flags kerning large))
(set-scale! arg1 0.6)
(set-color! arg1 (font-color progress))
(begin-scissor-music-player box)
(+! list-text-y (-> box min y))
(set-scale! arg1 0.45)
(set! (-> arg1 origin x) (+ (-> box min x) tab-music))
;(format *stdcon* "m: ~D f: ~D scroll: ~f~%" (-> obj music-index) (-> obj flava-index) (-> obj current-scroll))
(dotimes (i (-> *music-player-tracks* length))
(set! (-> arg1 origin y) (set! old-y list-text-y))
(set! (-> arg1 width) (- (-> box max x) (-> box min x)))
(cond
((= i (-> obj music-index))
(+! list-text-y text-height)
(cond
((-> *progress-state-pc* music-player-selected)
;; restore these later
(let* ((flava-bits (the-as int (-> *music-player-tracks* i flava)))
(flava-count (count-bits flava-bits))
(flava-text-height (the int (* (/ 0.42 0.45) text-height))))
;; draw highlight first
(draw-highlight-music-player (the int (-> box min x)) (the int (+ -6.0 (-> arg1 origin y)))
(the int (- (-> box max x) (-> box min x))) (+ text-height (* flava-count flava-text-height))
alpha)
;; draw text for each flava!
(protect ((-> arg1 origin x) (-> arg1 origin y) (-> arg1 scale))
(set-scale! arg1 0.42)
(+! (-> arg1 origin x) tab-flava)
(set! (-> arg1 origin y) list-text-y)
(dotimes (f flava-count)
(if (= f (-> obj flava-index))
(set-color! arg1 (progress-selected 0))
(set-color! arg1 (font-color progress)))
(let ((flava (bit-on-offset flava-bits f)))
(if (flava-unlocked? flava)
(print-game-text (lookup-text! *common-text* (-> flava-text-list (bit-on-offset flava-bits f)) #f) arg1 #f 44 (bucket-id progress))
(print-game-text (lookup-text! *common-text* (text-id progress-music-player-locked) #f) arg1 #f 44 (bucket-id progress)))
)
(+! (-> arg1 origin y) flava-text-height)
)
)
;; advance list height
(+! list-text-y (* flava-count flava-text-height))
;; set color to selected
(set-color! arg1 (font-color progress-force-selected))
))
(else
(set-color! arg1 (progress-selected 0))
(draw-highlight-music-player (the int (-> box min x)) (the int (+ -6.0 (-> arg1 origin y)))
(the int (- (-> box max x) (-> box min x))) text-height
alpha)
))
(when (< (-> arg1 origin y) (+ (-> box min y) y-pad-top))
(set! (-> obj current-scroll) (seek-ease (-> obj current-scroll) (+ (-> obj current-scroll) (- (-> arg1 origin y) (+ (-> box min y) y-pad-top)))
(if (-> *progress-state-pc* music-player-selected) 999999.0 (* 0.1 text-height (-> arg0 clock time-adjust-ratio)))
(* 0.3 text-height)
(* 0.01 text-height (-> arg0 clock time-adjust-ratio)))))
(when (> list-text-y (-> box max y))
(set! (-> obj current-scroll) (seek-ease (-> obj current-scroll) (+ (-> obj current-scroll) (- list-text-y (-> box max y)))
(if (-> *progress-state-pc* music-player-selected) 999999.0 (* 0.1 text-height (-> arg0 clock time-adjust-ratio)))
(* 0.3 text-height)
(* 0.01 text-height (-> arg0 clock time-adjust-ratio)))))
)
(else
(+! list-text-y text-height)
(set-color! arg1 (font-color progress))
)
)
(if (get-bit (-> *pc-settings* music-unlocked) i)
(print-game-text (lookup-text! *common-text* (-> *music-player-tracks* i text) #f) arg1 #f 44 (bucket-id progress))
(print-game-text (lookup-text! *common-text* (text-id progress-music-player-locked) #f) arg1 #f 44 (bucket-id progress)))
)
(if (< (- list-text-y (-> box max y)) 0.0)
(+! (-> obj current-scroll) (- list-text-y (-> box max y))))
(unless (-> *progress-state-pc* music-player-selected)
(max! (-> obj max-scroll) (-> obj current-scroll)))
(end-scissor-music-player box)
;; draw right panel text
(let ((icon-x 0)
(icon-y 174)
(icon-w (if (= (get-aspect-ratio) 'aspect4x3)
64
48))
(icon-h 64)
(icon-scale 0.7)
(icon-id 0)
(danger-pad 8.0)
(danger-w 73)
(arrow-w 14)
(danger-text-list (new 'static 'boxed-array :type text-id
(text-id progress-music-player-danger-0)
(text-id progress-music-player-danger-1)
(text-id progress-music-player-danger-2)
(text-id progress-music-player-danger-3)
)))
(set-flags! arg1 (font-flags kerning middle large))
(case (get-aspect-ratio)
(('aspect16x9)
(set-origin! arg1 281 160)
(set-width! arg1 144)
(set! icon-y 190)
)
(else
(set-origin! arg1 278 144)
(set-width! arg1 158)
)
)
(when (not (-> *pc-settings* use-vis?))
(set! (-> arg1 origin x) (the float (adjust-game-x (-> arg1 origin x))))
(*! danger-pad (-> *pc-settings* aspect-ratio-reciprocal))
(*! (-> arg1 width) (-> *pc-settings* aspect-ratio-reciprocal))
(set! icon-w (the int (* (-> *pc-settings* aspect-ratio-reciprocal) icon-w)))
(set! danger-w (the int (* (-> *pc-settings* aspect-ratio-reciprocal) danger-w)))
(set! arrow-w (the int (* (-> *pc-settings* aspect-ratio-reciprocal) arrow-w)))
)
(set-height! arg1 40)
(set-scale! arg1 0.42)
(set-color! arg1 (font-color progress))
(when (-> *progress-state-pc* music-player-track)
(print-game-text (lookup-text! *common-text* (text-id progress-music-player-now-playing) #f) arg1 #f 44 (bucket-id progress)))
(set-flags! arg1 (font-flags kerning middle left large))
(+! (-> arg1 origin y) 110.0)
(set-scale! arg1 0.48)
(cond
((-> *progress-state-pc* music-player-track)
(set! icon-id (-> *progress-state-pc* music-player-track icon)) ;; use this icon ID
(print-game-text (lookup-text! *common-text* (-> *progress-state-pc* music-player-track text) #f) arg1 #f 44 (bucket-id progress))
;; print flava if needed too
(when (nonzero? (-> *progress-state-pc* music-player-track flava))
(+! (-> arg1 origin y) 36.0)
(set-scale! arg1 0.42)
(print-game-text (lookup-text! *common-text* (-> flava-text-list (-> *progress-state-pc* music-player-flava)) #f) arg1 #f 44 (bucket-id progress))
)
)
(else
(print-game-text (lookup-text! *common-text* (text-id progress-music-player-no-track) #f) arg1 #f 44 (bucket-id progress))
)
)
;; draw right panel icon
(set! icon-x (the int (+ (-> arg1 origin x) (/ (-> arg1 width) 2))))
(set! icon-w (the int (* icon-scale icon-w)))
(set! icon-h (the int (* icon-scale icon-h)))
;; center icon. the icon is 96x96 but each sprite is 64x64, hence 1.5
(-! icon-x (the int (/ (* 1.5 icon-w) 2)))
(set-hud-sprite-attributes! (-> obj sprites 0) :tex (lookup-texture-by-id (get-level-icon-id-01 icon-id)) :a alpha :scale-x icon-scale :scale-y icon-scale :x icon-x :y icon-y)
(set-hud-sprite-attributes! (-> obj sprites 1) :tex (lookup-texture-by-id (get-level-icon-id-02 icon-id)) :a alpha :scale-x icon-scale :scale-y icon-scale :x (+ icon-x icon-w) :y icon-y)
(set-hud-sprite-attributes! (-> obj sprites 2) :tex (lookup-texture-by-id (get-level-icon-id-03 icon-id)) :a alpha :scale-x icon-scale :scale-y icon-scale :x icon-x :y (+ icon-y icon-h))
(set-hud-sprite-attributes! (-> obj sprites 3) :tex (lookup-texture-by-id (get-level-icon-id-04 icon-id)) :a alpha :scale-x icon-scale :scale-y icon-scale :x (+ icon-x icon-w) :y (+ icon-y icon-h))
;; danger scroller
(set-scale! arg1 0.42)
(set! (-> arg1 origin y) (+ 26.0 (-> box max y)))
(set! (-> arg1 origin x) (+ danger-pad (-> box min x)))
(set-width! arg1 danger-w)
(set-flags! arg1 (font-flags kerning large))
(print-game-text (lookup-text! *common-text* (text-id progress-music-player-danger) #f) arg1 #f 44 (bucket-id progress))
(set-color! arg1 (progress-selected (seconds 0.5)))
(+! (-> arg1 origin x) (-> arg1 width))
(set-flags! arg1 (font-flags kerning large right))
(set-width! arg1 arrow-w)
(+! (-> arg1 origin x) (-> arg1 width))
(print-game-text (string-format "~33L~C" 163) arg1 #f 44 (bucket-id progress))
(set-flags! arg1 (font-flags kerning large middle))
(set-width! arg1 (the int (- (-> box max x) (-> box min x) danger-w (* arrow-w 2) (* danger-pad 2))))
(print-game-text (lookup-text! *common-text* (-> danger-text-list (-> obj excitement)) #f) arg1 #f 44 (bucket-id progress))
(+! (-> arg1 origin x) (-> arg1 width))
(set-flags! arg1 (font-flags kerning large))
(set-width! arg1 arrow-w)
(print-game-text (string-format "~33L~C" 161) arg1 #f 44 (bucket-id progress))
(with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id progress)
)
(draw (-> obj sprites 0) buf (-> *level* default-level))
(draw (-> obj sprites 1) buf (-> *level* default-level))
(draw (-> obj sprites 2) buf (-> *level* default-level))
(draw (-> obj sprites 3) buf (-> *level* default-level))
)
)
(when-not-drawn-decoration
(draw-up-down-music-player arg1 box)
(draw-decoration-music-player obj arg1 alpha (-> obj name) 0.7 box))
)
0
(none))
(#when PC_PORT
(defun-debug draw-mouse ()
"draw some extra mouse info"
(let ((mx (+ (the int (-> *mouse* posx)) 256))
(my (+ (the int (-> *mouse* posy)) 208)))
(format *stdcon* "mouse pos: (~D,~D)~%" mx my)
(with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id debug-no-zbuf2)
)
(draw-sprite2d-xy buf 0 my 512 1 (static-rgba #xff #xff #xff #x40))
(draw-sprite2d-xy buf mx 0 1 416 (static-rgba #xff #xff #xff #x40))
)
)
)
(defmacro spawn-draw-mouse-proc ()
`(process-spawn-function process :name "draw-mouse" :to *display-pool*
(lambda :behavior process ()
(loop
(suspend)
(draw-mouse))
)))
)