;;-*-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 setup-scissor ((this hud-box) (buf dma-buffer)) (dma-buffer-add-gs-set buf (scissor-1 (new 'static 'gs-scissor :scax0 (the int (-> this min x)) :scay0 (the int (-> this min y)) :scax1 (the int (-> this max x)) :scay1 (the int (-> this max y)) ) ) ) ) (defun restore-scissor ((this hud-box) (buf dma-buffer)) (dma-buffer-add-gs-set buf (scissor-1 (new 'static 'gs-scissor :scax1 #x1ff :scay1 #x19f))) ) (defmacro adjust-x-if-needed (x) "adjust an x screen coord if ps2 vis is disabled" `(if (not (-> *pc-settings* use-vis?)) (the float (adjust-game-x (the float ,x))) ,x)) (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)))) (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)))) (defun draw-savegame-box ((arg0 menu-option) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) (set! (-> arg0 box 0 min x) arg1) (set! (-> arg0 box 0 max x) arg2) (set! (-> arg0 box 0 min y) arg3) (set! (-> arg0 box 0 max y) arg4) (with-dma-buffer-add-bucket ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id hud-draw-hud-alpha)) (draw-box-prim-only (the-as hud-box (-> arg0 box)) s5-0))) (defun draw-highlight ((y-pos int) (height int) (alpha float)) (let ((x-pos (if (= (get-aspect-ratio) 'aspect4x3) 70 79)) (width (if (= (get-aspect-ratio) 'aspect4x3) 374 355))) ;; og:preserve-this (#when PC_PORT ;; added for better widescreen handling (when (not (-> *pc-settings* use-vis?)) (set! x-pos (the int (adjust-game-x (the float x-pos)))) (set! width (the int (* (-> *pc-settings* aspect-ratio-reciprocal) width))))) (with-dma-buffer-add-bucket ((buffer (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id hud-draw-hud-alpha)) (draw-sprite2d-xy buffer x-pos y-pos width height (new 'static 'rgba :r #x80 :g #x80 :b #x40 :a (the int (* 64.0 alpha))) #x3fffff)))) (defmethod set-selected-color ((this progress)) (with-pp ;; og:preserve-this high fps fix (if (< (seconds 0.027) (logand (the int (* DISPLAY_FPS_RATIO (-> pp clock integral-frame-counter))) 15)) (set-font-color (font-color font-color-33) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) (set-font-color (font-color font-color-33) (new 'static 'rgba :r #x60 :g #x60 :b #x60 :a #x80) (new 'static 'rgba :r #x60 :g #x60 :b #x60 :a #x80) (new 'static 'rgba :r #x60 :g #x60 :b #x60 :a #x80) (new 'static 'rgba :r #x60 :g #x60 :b #x60 :a #x80))) (none))) (defmethod draw-highlight-bar ((this progress) (arg0 font-context) (arg1 int) (arg2 int) (arg3 float)) (let* ((v1-1 (get-scissor-stack-top this)) (a1-1 (the int (-> v1-1 x))) (a3-1 (the int (- (-> v1-1 z) (-> v1-1 x)))) (f0-6 (- 1.0 (-> this menu-transition)))) (with-dma-buffer-add-bucket ((s3-0 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id hud-draw-hud-alpha)) (when (not (-> *pc-settings* use-vis?)) (set! a1-1 (the int (adjust-game-x (the float a1-1)))) (set! a3-1 (the int (* (-> *pc-settings* aspect-ratio-reciprocal) a3-1)))) (draw-sprite2d-xy s3-0 a1-1 arg1 a3-1 arg2 (new 'static 'rgba :r #x80 :g #x80 :b #x40 :a (the int (* 64.0 f0-6))) #x3fffff))) 0) (defmethod draw-bg-box-outline ((this progress) (arg0 progress-box) (arg1 float)) (with-dma-buffer-add-bucket ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) ;; og:preserve-this changed from particles bucket (bucket-id hud-draw-hud-alpha)) (let* ((box (case (get-aspect-ratio) (('aspect4x3) (-> arg0 aspect4x3)) (('aspect16x9) (-> arg0 aspect16x9)))) (box1 (new 'stack 'hud-box))) (mem-copy! (the pointer box1) (the pointer box) (size-of hud-box)) (set! (-> box1 color w) (the int arg1)) (#when PC_PORT (when (not (-> *pc-settings* use-vis?)) (set! (-> box1 min x) (the float (the int (adjust-game-x (-> box min x))))) (set! (-> box1 max x) (the float (the int (adjust-game-x (-> box max x))))))) (draw-box-prim-only box1 s4-0))) 0) (defmethod draw-bg-box-alpha-2 ((this progress) (arg0 progress-box) (arg1 float)) (with-dma-buffer-add-bucket ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id particles)) (let* ((box (case (get-aspect-ratio) (('aspect4x3) (-> arg0 aspect4x3)) (('aspect16x9) (-> arg0 aspect16x9)))) (box1 (new 'stack 'hud-box))) (mem-copy! (the pointer box1) (the pointer box) (size-of hud-box)) (set! (-> box1 color w) (the int arg1)) (#when PC_PORT (when (not (-> *pc-settings* use-vis?)) (set! (-> box1 min x) (the float (the int (adjust-game-x (-> box min x))))) (set! (-> box1 max x) (the float (the int (adjust-game-x (-> box max x))))))) (draw-box-alpha-2 box1 s4-0))) 0) (defmethod draw-bg-box-alpha-1 ((this progress) (arg0 progress-box) (arg1 float)) (with-dma-buffer-add-bucket ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) ;; og:preserve-this changed from bucket6 (bucket-id bucket7)) (let* ((box (case (get-aspect-ratio) (('aspect4x3) (-> arg0 aspect4x3)) (('aspect16x9) (-> arg0 aspect16x9)))) (box1 (new 'stack 'hud-box))) (mem-copy! (the pointer box1) (the pointer box) (size-of hud-box)) (set! (-> box1 color w) (the int arg1)) (#when PC_PORT (when (not (-> *pc-settings* use-vis?)) (set! (-> box1 min x) (the float (the int (adjust-game-x (-> box min x))))) (set! (-> box1 max x) (the float (the int (adjust-game-x (-> box max x))))))) (draw-box-alpha-1 box1 s4-0))) 0) (defmethod draw-slider-option ((this progress) (arg0 font-context) (arg1 string) (arg2 float) (arg3 float) (arg4 float) (arg5 float) (arg6 float)) (local-vars (sv-80 float) (sv-96 float) (sv-112 vector) (sv-128 int) (sv-144 rgba)) (set! sv-80 arg3) (let ((s1-0 arg4) (s5-0 arg5)) (set! sv-96 arg6) (set! sv-112 (get-scissor-stack-top this)) (let ((slider (new 'stack 'hud-sprite)) (f30-0 (* (- (-> sv-112 z) (-> sv-112 x)) s1-0))) (let ((s1-1 (- (- 256 (if sv-96 10 0)) (the int (/ f30-0 2))))) (#when PC_PORT (when (not (-> *pc-settings* use-vis?)) (set! s1-1 (the int (adjust-game-x (the float s1-1)))) (set! f30-0 (* (-> *pc-settings* aspect-ratio-reciprocal) f30-0)))) (set! sv-128 (the int (+ (-> sv-112 y) (* (- (-> sv-112 w) (-> sv-112 y)) sv-80)))) (let ((f28-0 f30-0)) (let ((f24-0 (-> *video-params* relative-x-scale-reciprical)) (f26-0 (-> *video-params* relative-x-scale))) (with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id hud-draw-hud-alpha)) (set! (-> slider tid) (the-as texture-id (get-texture hud-sliderbackground progress-minimap))) (if (-> slider tid) (set! (-> slider scale-x) (/ (* f30-0 f24-0) (the float (-> (the-as texture (-> slider tid)) w))))) (set! (-> slider scale-y) 0.7) (let ((v1-28 (-> slider color-ptr))) (set! (-> v1-28 0) 128) (set! (-> v1-28 1) 128) (set! (-> v1-28 2) 128) (set! (-> v1-28 3) (the int (* 128.0 arg2)))) (set-vector! (-> slider pos) s1-1 sv-128 #x3fffff 0) (draw slider buf (-> *level* level-default) #t) (let ((f24-1 0.2)) (set! (-> slider tid) (the-as texture-id (get-texture hud-sliderframe progress-minimap))) (set! (-> slider scale-x) f24-1) (set! (-> slider scale-y) 1.33) (if (-> slider tid) (set! f28-0 (- f30-0 (* f24-1 f26-0 (the float (-> (the-as texture (-> slider tid)) w))))))) (let* ((v1-39 (the int (* f28-0 s5-0))) (a1-3 (+ s1-1 (the int (* 18.0 f26-0)) v1-39)) (a3-2 (the int (- f28-0 (the float v1-39)))) (t1-1 (shr (shl (the int (* 128.0 arg2)) 56) 32))) (draw-sprite2d-xy buf a1-3 (+ sv-128 7) a3-2 9 (the-as rgba t1-1) #x3fffff)) (set-vector! (-> slider pos) (+ s1-1 (the int (* f28-0 s5-0))) (+ sv-128 -4) #x3fffff 0) (draw slider buf (-> *level* level-default) #t) (when sv-96 (set! sv-144 (-> *font-work* color-table 32 color 0)) (set! (-> slider tid) (the-as texture-id (get-texture hud-speaker-empty progress-minimap))) (set! (-> slider scale-x) 1.0) (set! (-> slider scale-y) 1.0) (let ((v1-55 (-> slider color-ptr))) (set! (-> v1-55 0) (the-as int (-> sv-144 r))) (set! (-> v1-55 1) (the-as int (-> sv-144 g))) (set! (-> v1-55 2) (the-as int (-> sv-144 b))) (set! (-> v1-55 3) (the int (* 128.0 arg2)))) (set-vector! (-> slider pos) (+ s1-1 -20) (+ sv-128 -5) #x3fffff 0) (draw slider buf (-> *level* level-default) #t) (set! (-> slider tid) (the-as texture-id (get-texture hud-speaker-full progress-minimap))) (set! (-> slider scale-x) 1.0) (set! (-> slider scale-y) 1.0) (set-vector! (-> slider pos) (+ (the int f30-0) 8 s1-1) (+ sv-128 -5) #x3fffff 0) (draw slider buf (-> *level* level-default) #t))) (set-scale! arg0 0.5) (set-flags! arg0 (font-flags kerning large)) (let ((f1-14 (the float s1-1)) (f2-3 (+ -20.0 (the float sv-128)))) (set! (-> arg0 origin x) f1-14) (set! (-> arg0 origin y) f2-3)) (let ((f0-44 (progress-method-45 this arg0 f30-0 (* 32.0 0.5) arg1 0.5 0.75 32))) (if (= (-> this option-index) (-> this current-index)) (draw-highlight-bar this arg0 (the int (+ -2.0 (-> arg0 origin y))) (the int (+ 4.0 f0-44)) arg2)))) (+! (-> arg0 origin x) f30-0)) (set-flags! arg0 (font-flags kerning right large)) (string-format "~D%" (the int (* 100.0 s5-0))) (print-game-text *temp-string* arg0 #f 44 (bucket-id hud-draw-hud-alpha))) (set-flags! arg0 (font-flags kerning large)) 0))) (defmethod draw-option ((this menu-unlocked-sub-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((s2-0 (memcard-unlocked-secrets? arg0 #t)) (f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))) (adjust-font-origin-y arg0 arg1 (-> this offset-y)) (set-scale! arg1 0.5) (if (= arg2 (-> arg0 option-index)) 33 32) (let ((f0-3 (if (logtest? s2-0 (-> this mask)) (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) (print-game-text "?????????" arg1 #f 44 (bucket-id hud-draw-hud-alpha))))) (if (= arg2 (-> arg0 option-index)) (draw-highlight-bar arg0 arg1 (the int (+ 2.0 (-> arg1 origin y))) (the int (+ -1.0 f0-3)) f30-0)))) (none)) (defmethod draw-option ((this menu-secret-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (sv-16 float) (sv-24 int) (sv-96 int) (sv-112 int) (sv-128 int) (sv-192 string) (sv-208 text-id) (sv-240 string) (sv-288 int) (sv-352 string) (sv-368 string) ) (set! sv-16 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (set! (-> arg1 alpha) sv-16) (cond ((not (loaded? *bigmap*)) (progress-method-51 arg0 arg1) ) (else (let ((s2-0 (get-texture hud-orb progress-minimap))) (when (and s2-0 (not (-> this available-title))) (progress-method-33 arg0 (-> *progress-work* sub-header)) (let ((s3-0 (get-scissor-stack-top arg0))) (let* ((f0-5 0.64) (f30-0 (+ 10.0 (* (the float (-> s2-0 w)) f0-5 (-> *video-params* relative-x-scale)))) ) (let ((f1-5 (* (the float (-> s2-0 h)) f0-5))) (draw-icon-array! (-> *progress-icon-arrays* 68) (the int (+ 10.0 (adjust-x-if-needed (-> s3-0 x)))) (the int (+ (-> s3-0 y) (* 0.5 (- 28.0 f1-5)))) f0-5 f0-5 (the rgba (logior #x808080 (shr (shl (the int (* 128.0 sv-16)) 56) 32))) sv-16 ) ) (set! (-> arg1 height) 28.0) (set-flags! arg1 (font-flags kerning large)) (let ((f28-0 0.45)) (set-color! arg1 (font-color font-color-34)) (cond ((-> this buy-menu) (string-format "x~D ~S" (-> *menu-secrets-array* (-> this selected-index) cost) (lookup-text! *common-text* (text-id progress-secrets-price) #f)) ) (else (string-format "x~D ~S" (the int (-> *game-info* skill)) (lookup-text! *common-text* (text-id progress-secrets-orbs-available) #f)) ) ) (set-scale! arg1 f28-0) (set! (-> arg1 origin x) (+ (adjust-x-if-needed (-> s3-0 x)) f30-0)) (set! (-> arg1 origin y) (+ (-> s3-0 y) (* 0.5 (- 28.0 (* 32.0 f28-0))))) ) ) (print-game-text *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) (set-flags! arg1 (font-flags kerning right large)) (set! (-> arg1 origin x) (+ -10.0 (adjust-x-if-needed (-> s3-0 z)))) ) (string-format "~D/600 ~S" (the int (-> *game-info* skill-total)) (lookup-text! *common-text* (text-id progress-secrets-orbs-collected) #f)) (print-game-text *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) (progress-method-34 arg0) ) ) (set-scale! arg1 0.42) (cond ((-> this available-title) (progress-method-33 arg0 (-> *progress-work* body-footer)) (progress-method-53 arg0 arg1) (set-color! arg1 (font-color font-color-32)) (set-flags! arg1 (font-flags kerning middle middle-vert large)) (string-format (lookup-text! *common-text* (text-id text-0080) #f)) (print-game-text *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) (progress-method-34 arg0) (progress-method-33 arg0 (-> *progress-work* footer)) (set-flags! arg1 (font-flags kerning middle large)) (adjust-font-origin-y arg0 arg1 0.1) (set-color! arg1 (font-color font-color-33)) (let ((f0-16 (print-game-text (lookup-text! *common-text* (text-id progress-continue) #f) arg1 #f 32 (bucket-id hud-draw-hud-alpha) ) ) ) (draw-highlight-bar arg0 arg1 (the int (+ -2.0 (-> arg1 origin y))) (the int (+ 4.0 f0-16)) (-> arg1 alpha)) ) (progress-method-34 arg0) ) ((-> this buy-menu) (progress-method-33 arg0 (-> *progress-work* body)) (adjust-font-origin-y arg0 arg1 0.45) (progress-method-50 arg0 arg1 (-> *menu-secrets-array* (-> this selected-index) name) (text-id progress-secrets-buy) (text-id progress-secrets-cancel) #t #t 0.65 ) (draw-header arg0 arg1 sv-16 (text-id progress-secrets)) (draw-bg-box-outline arg0 (-> *progress-work* sub-header) (* 128.0 sv-16)) (progress-method-34 arg0) ) (else (progress-method-33 arg0 (-> *progress-work* sub-body-footer)) (let* ((s3-3 (get-scissor-stack-top arg0)) (f22-0 (- (-> s3-3 w) (-> s3-3 y))) (f30-1 (+ 10.0 (* 24.0 (-> *video-params* relative-x-scale) (-> arg1 scale)))) (f28-1 (+ (- -10.0 (-> s3-3 x)) (-> s3-3 z))) ) (string-format "~32L~S~44L ~S" (lookup-text! *common-text* (text-id progress-on) #f) (lookup-text! *common-text* (text-id progress-off) #f)) (let* ((f0-27 (-> (get-string-length *temp-string* arg1) length)) (f26-0 (- (- (- f28-1 f30-1) f0-27) f30-1)) ) (set-flags! arg1 (font-flags kerning large)) (set! (-> arg1 width) f26-0) (let ((s1-5 (max 0 (the int (-> this current-index))))) (let* ((a0-61 (-> *menu-secrets-array* s1-5)) (s0-4 (-> a0-61 name)) ) (case (secret-item-option-method-12 a0-61) ((4) (set! sv-192 "?????????") ) (else (set! sv-192 (lookup-text! *common-text* s0-4 #f)) ) ) ) (string-format "~S" sv-192) (let ((f24-0 (print-game-text *temp-string* arg1 #t 40 (bucket-id hud-draw-hud-alpha)))) (let ((f0-33 4.0) (f1-25 (-> this current-index)) ) (set! (-> arg1 origin y) (+ (- f0-33 (* f24-0 (- f1-25 (* (the float (the int (/ f1-25 1.0))) 1.0)))) (-> s3-3 y)) ) ) (set! (-> arg1 height) f22-0) (while (and (< (-> arg1 origin y) (-> s3-3 w)) (< s1-5 (-> *menu-secrets-array* length))) (let ((s0-6 (-> *menu-secrets-array* s1-5))) (set! sv-208 (-> *menu-secrets-array* s1-5 name)) (set! sv-288 (secret-item-option-method-12 s0-6)) (case sv-288 ((4) (set! sv-240 "?????????") ) (else (set! sv-240 (lookup-text! *common-text* sv-208 #f)) ) ) (cond ((logtest? (-> *menu-secrets-array* s1-5 flags) (secret-item-option-flags sf0)) (set! (-> arg1 origin x) (+ 10.0 (adjust-x-if-needed (-> s3-3 x)))) (set! (-> arg1 width) f28-1) (set-color! arg1 (font-color font-color-34)) (set-flags! arg1 (font-flags kerning large)) (let ((f22-1 (-> arg1 origin y))) (string-format "~S" sv-240) (set! (-> arg1 origin y) (+ f22-1 (print-game-text *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)))) ) ) ((not (and (logtest? (-> *menu-secrets-array* s1-5 flags) (secret-item-option-flags sf4)) (or (nonzero? (-> *setting-control* user-current subtitle-language)) (nonzero? (-> *setting-control* user-current language)) (nonzero? (-> *setting-control* user-current audio-language)) ) ) ) (set! (-> arg1 origin x) (adjust-x-if-needed (+ (-> s3-3 x) f30-1))) (set! (-> arg1 width) f26-0) (let ((v1-148 sv-288)) (cond ((or (= v1-148 4) (= v1-148 3)) (set-flags! arg1 (font-flags kerning large ff7)) (set-color! arg1 (font-color font-color-44)) ) ((zero? v1-148) (set-flags! arg1 (font-flags kerning large)) (set-color! arg1 (font-color font-color-34)) ) (else (set-flags! arg1 (font-flags kerning large)) (set-color! arg1 (font-color font-color-32)) ) ) ) (let ((f22-2 (-> arg1 origin y))) (string-format "~S" sv-240) (let ((f20-0 (print-game-text *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)))) (when (not (logtest? (-> *menu-secrets-array* s1-5 flags) (secret-item-option-flags sf0))) (set! (-> arg1 origin x) (adjust-x-if-needed (+ (-> s3-3 x) f28-1))) (set-flags! arg1 (font-flags kerning right large)) (set! sv-352 (lookup-text! *common-text* (text-id progress-on) #f)) (set! sv-368 (lookup-text! *common-text* (text-id progress-off) #f)) (cond ((or (zero? sv-288) (= sv-288 3)) (string-format "~d" (-> s0-6 cost)) (print-game-text *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)) ) ((= sv-288 1) (cond ((logtest? (-> *menu-secrets-array* s1-5 flags) (secret-item-option-flags sf1)) (string-format "~32L~S~44L ~S" sv-352 sv-368) (print-game-text *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)) ) (else (string-format "~S" sv-352) (print-game-text *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)) ) ) ) ((= sv-288 2) (cond ((logtest? (-> *menu-secrets-array* s1-5 flags) (secret-item-option-flags sf1)) (string-format "~44L~S ~32L~S~1L" sv-352 sv-368) (print-game-text *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)) ) (else (string-format "~S" sv-368) (print-game-text *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)) ) ) ) ) ) (+! (-> arg1 origin y) f20-0) (if (= s1-5 (-> this selected-index)) (draw-highlight-bar arg0 arg1 (the int (+ -2.0 f22-2)) (the int (+ 3.0 f20-0)) sv-16) ) ) ) ) ) ) (+! s1-5 1) ) (seek! (-> this current-index) (-> this target-index) (* (/ 600.0 f24-0) (seconds-per-frame))) ) ) ) ) (progress-method-34 arg0) (draw-header arg0 arg1 sv-16 (text-id progress-secrets)) (draw-bg-box-outline arg0 (-> *progress-work* sub-header) (* 128.0 sv-16)) (draw-bg-box-alpha-2 arg0 (-> *progress-work* footer) (* 64.0 sv-16)) (draw-bg-box-outline arg0 (-> *progress-work* footer) (* 128.0 sv-16)) (progress-method-47 arg0 arg1 (!= (-> this current-index) 0.0) (!= (-> this current-index) (the float (+ (-> *menu-secrets-array* length) -1))) ) ) ) ) ) 0 (none) ) (defmethod draw-option ((this menu-missions-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (sv-176 float) (sv-180 game-task-node-info) (sv-184 game-task-node-info) (sv-188 float) (sv-192 int) (sv-200 symbol) (sv-208 int) (sv-216 (array game-task-node-info)) (sv-256 string) (sv-272 game-task-node-info) (sv-288 text-id) ) (set! sv-176 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (set! sv-180 (new 'stack 'game-task-node-info)) (set! sv-184 (new 'stack 'game-task-node-info)) (set! (-> arg0 current-task-index) (length (-> *game-info* sub-task-list))) (set! (-> arg0 current-line-index) -1) (set! (-> arg0 current-task) (game-task unknown)) (set! (-> arg0 first-closed-line-index) -1) (set! (-> arg0 extra-text-state) -1) (set! (-> arg0 num-open-tasks-found) 0) (set! (-> arg0 num-closed-tasks-found) 0) (set! (-> arg1 alpha) sv-176) (set! (-> *game-info* mission-list 0) sv-180) (set! (-> sv-180 description) (text-id progress-missions-todo)) (set! (-> sv-184 description) (text-id progress-missions-completed)) (progress-method-33 arg0 (-> *progress-work* body-footer)) (let ((s3-0 (get-scissor-stack-top arg0))) (set! sv-188 (- (-> s3-0 w) (-> s3-0 y))) (set! sv-192 1) (set! sv-200 #t) (set! sv-216 (-> *game-info* mission-list)) (dotimes (s2-0 (length (-> *game-info* sub-task-list))) (let ((v0-6 (find-mission-text-at-index arg0 s2-0))) (when v0-6 (when (and (logtest? (-> v0-6 flags) (game-task-node-flag closed)) sv-200) (set! sv-200 #f) (set! (-> sv-216 sv-192) sv-184) (1+! sv-192) ) (set! (-> sv-216 sv-192) v0-6) (1+! sv-192) ) ) ) (set! (-> arg0 total-num-tasks) sv-192) (sort-task-node-result (-> arg0 total-num-tasks)) (set-flags! arg1 (font-flags kerning large)) (set-scale! arg1 0.5) (string-format "~S" (lookup-text! *common-text* (text-id progress-missions-complete-icon) #f)) (let ((f30-1 (+ 14.0 (-> (get-string-length *temp-string* arg1) length)))) (set! (-> arg1 width) (+ (- (- -10.0 f30-1) (-> s3-0 x)) (-> s3-0 z))) (let ((s2-2 (-> *game-info* mission-list)) (s1-2 (max 0 (the int (-> this current-index)))) ) (let* ((s0-1 (-> s2-2 s1-2)) (a1-10 (if (and (logtest? (-> s0-1 flags) (game-task-node-flag closed)) (task-complete? *game-info* (-> s0-1 task))) (-> *game-info* play-list (-> s0-1 task) text-name) (-> s0-1 description) ) ) ) (set! sv-256 (lookup-text! *common-text* a1-10 #f)) ) (string-format "~S" sv-256) (let ((f28-0 (print-game-text *temp-string* arg1 #t 44 (bucket-id hud-draw-hud-alpha)))) (let* ((v1-60 arg1) (f0-14 (+ 10.0 (-> s3-0 x))) (f1-6 4.0) (f2-2 (-> this current-index)) (f1-8 (+ (- f1-6 (* f28-0 (- f2-2 (* (the float (the int (/ f2-2 1.0))) 1.0)))) (-> s3-0 y))) ) (set! (-> v1-60 origin x) f0-14) (set! (-> v1-60 origin y) f1-8) ) (set! (-> arg1 height) sv-188) (while (and (< (-> arg1 origin y) (-> s3-0 w)) (< s1-2 (-> arg0 total-num-tasks))) (set! sv-272 (-> s2-2 s1-2)) (if (and (logtest? (-> sv-272 flags) (game-task-node-flag closed)) (task-complete? *game-info* (-> sv-272 task))) (set! sv-288 (-> *game-info* play-list (-> sv-272 task) text-name)) (set! sv-288 (-> sv-272 description)) ) (set! (-> arg1 origin x) (+ 10.0 (adjust-x-if-needed (-> s3-0 x)))) (cond ((or (= sv-288 (text-id progress-missions-todo)) (= sv-288 (text-id progress-missions-completed))) (let ((a0-41 arg1)) (set! (-> a0-41 color) (font-color font-color-34)) ) ) (else (string-format "~S" (lookup-text! *common-text* (if (logtest? (-> sv-272 flags) (game-task-node-flag closed)) (text-id progress-missions-complete-icon) (text-id progress-missions-todo-icon) ) #f)) (print-game-text *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) (set-color! arg1 (font-color font-color-32)) (set! (-> arg1 origin x) (+ (adjust-x-if-needed (-> s3-0 x)) f30-1)) ) ) (let ((f26-0 (-> arg1 origin y))) (string-format "~S" (lookup-text! *common-text* sv-288 #f)) (set! (-> arg1 origin y) (+ f26-0 (print-game-text *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)))) ) (1+! s1-2) ) (set! (-> this on-screen) (< (-> arg1 origin y) (-> s3-0 w))) (seek! (-> this current-index) (-> this target-index) (* (/ (-> this scroll-speed) f28-0) (seconds-per-frame)) ) ) ) ) ) (progress-method-34 arg0) (draw-header arg0 arg1 sv-176 (text-id progress-missions)) (draw-bg-box-alpha-2 arg0 (-> *progress-work* footer) (* 64.0 sv-176)) (draw-bg-box-outline arg0 (-> *progress-work* footer) (* 128.0 sv-176)) (progress-method-47 arg0 arg1 (!= (-> this current-index) 0.0) (and (not (-> this on-screen)) (!= (-> this current-index) (the float (+ (-> arg0 total-num-tasks) -1))))) (none) ) (defmethod draw-option ((this menu-highscores-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (s4-0 *progress-work*) ) (set! (-> arg1 alpha) f30-0) (set-flags! arg1 (font-flags kerning middle large)) (progress-method-33 arg0 (-> s4-0 body-footer)) (progress-method-53 arg0 arg1) (let ((f28-0 (the float (menu-highscores-option-method-12 this)))) (let* ((f0-2 (-> this current-index)) (f26-0 (- f0-2 (* (the float (the int (/ f0-2 f28-0))) f28-0))) (f0-4 (+ 1.0 f26-0)) (f0-5 (- f0-4 (* (the float (the int (/ f0-4 f28-0))) f28-0))) (s2-0 (-> this pages (the int f26-0))) (s3-1 (-> this pages (the int f0-5))) (s1-0 (get-scissor-stack-top arg0)) (f0-8 (- (-> s1-0 z) (-> s1-0 x))) ) (when (!= f28-0 0.0) (let ((f26-1 (* (- 1.0 (- f26-0 (* (the float (the int (/ f26-0 1.0))) 1.0))) f0-8))) (set! (-> arg1 origin x) (+ (- f26-1 f0-8) (-> s1-0 x))) (highscore-page-info-method-9 (the highscore-page-info s2-0) arg0 arg1 (- f26-1 f0-8) f30-0 ) (when (< 1.0 f28-0) (set! (-> arg1 origin x) (+ f26-1 (-> s1-0 x))) (highscore-page-info-method-9 (the highscore-page-info s3-1) arg0 arg1 f26-1 f30-0 ) ) ) ) ) (progress-method-34 arg0) (draw-header arg0 arg1 f30-0 (text-id progress-highscores)) (cond ((< 1.0 f28-0) (draw-prev-next-footer arg0 arg1 f30-0) ) (else (draw-bg-box-alpha-2 arg0 (-> s4-0 footer) (* 64.0 f30-0)) (draw-bg-box-outline arg0 (-> s4-0 footer) (* 128.0 f30-0)) ) ) ) ) (none) ) (defmethod highscore-page-info-method-9 ((this highscore-page-info) (arg0 progress) (arg1 font-context) (arg2 float) (arg3 float)) (local-vars (sv-16 highscore-info) (sv-96 int) (sv-112 int) ) (let ((s3-0 (get-scissor-stack-top arg0))) (let ((f28-0 (-> *video-params* relative-x-scale))) (set! sv-16 (-> *highscore-info-array* (-> this game-score))) (let ((f30-0 (- (-> s3-0 z) (-> s3-0 x))) (s0-0 *progress-work*) ) (set-flags! arg1 (font-flags kerning large)) (set-scale! arg1 0.675) (set-color! arg1 (font-color font-color-32)) (set! (-> arg1 origin x) (+ 10.0 arg2 (adjust-x-if-needed (-> s3-0 x)))) (adjust-font-origin-y arg0 arg1 0.01) (if (not (-> *pc-settings* use-vis?)) (set! (-> arg1 width) (* 0.75 (-> *pc-settings* aspect-ratio-reciprocal) f30-0)) (set! (-> arg1 width) (* 0.75 f30-0)) ) ;; hack to scissor top part of highscore display ;; top right icon (with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id hud-draw-pris2)) (let ((hiscore0-box (case (get-aspect-ratio) (('aspect4x3) (-> s0-0 highscore-0 aspect4x3 box)) (('aspect16x9) (-> s0-0 highscore-0 aspect16x9 box))))) (dma-buffer-add-gs-set buf (scissor-1 (new 'static 'gs-scissor :scax0 (the int (adjust-x-if-needed (-> hiscore0-box min x))) :scay0 (the int (-> hiscore0-box min y)) :scax1 (the int (adjust-x-if-needed (-> hiscore0-box max x))) :scay1 (the int (-> hiscore0-box max y))))))) ;; text (with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id hud-draw-hud-alpha)) (let ((hiscore0-box (case (get-aspect-ratio) (('aspect4x3) (-> s0-0 highscore-0 aspect4x3 box)) (('aspect16x9) (-> s0-0 highscore-0 aspect16x9 box)))) (hiscore1-box (case (get-aspect-ratio) (('aspect4x3) (-> s0-0 highscore-1 aspect4x3 box)) (('aspect16x9) (-> s0-0 highscore-1 aspect16x9 box))))) (dma-buffer-add-gs-set buf (scissor-1 (new 'static 'gs-scissor :scax0 (the int (adjust-x-if-needed (-> hiscore0-box min x))) :scay0 (the int (-> hiscore0-box min y)) :scax1 (the int (adjust-x-if-needed (-> hiscore0-box max x))) :scay1 (the int (-> hiscore1-box max y))))))) (string-format "~S" (lookup-text! *common-text* (-> this text) #f)) (print-game-text *temp-string* arg1 #f 32 (bucket-id hud-draw-hud-alpha)) (draw-icon-array! (-> *progress-icon-arrays* (-> this icon)) (the int (+ (- (adjust-x-if-needed (-> s3-0 z)) (* (-> this icon-offsetx) f28-0)) arg2)) (the int (+ (-> s3-0 y) (-> this icon-offsety))) (-> this icon-scalex) (-> this icon-scaley) (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a (the int (* 128.0 arg3))) arg3 ) (when (not (logtest? (-> sv-16 flags) (highscore-flags hf1))) (let ((f28-1 (* 20.0 f28-0)) (f26-0 (+ 50.0 (-> s3-0 y))) ) (set! sv-96 (the int (+ 48.0 (-> s3-0 y)))) (set! sv-112 (logior #x808080 (shr (shl (the int (* 128.0 arg3)) 56) 32))) (let ((f24-0 0.25) (f22-0 (+ 10.0 arg2 (-> s3-0 x))) ) (set-scale! arg1 0.45) (let ((f20-0 f22-0)) (draw-icon-array! (-> *progress-icon-arrays* 63) (the int (adjust-x-if-needed f20-0)) sv-96 0.25 0.25 (the-as rgba sv-112) arg3) (highscore-page-info-method-10 this arg1 (-> sv-16 gold-score) (+ (adjust-x-if-needed f20-0) f28-1) f26-0) ) (let ((f20-1 (+ f22-0 (* 0.333 f30-0)))) (draw-icon-array! (-> *progress-icon-arrays* 64) (the int (adjust-x-if-needed f20-1)) sv-96 0.25 0.25 (the-as rgba sv-112) arg3) (highscore-page-info-method-10 this arg1 (-> sv-16 silver-score) (+ (adjust-x-if-needed f20-1) f28-1) f26-0) ) (let ((f30-1 (+ f22-0 (* 0.667 f30-0)))) (draw-icon-array! (-> *progress-icon-arrays* 65) (the int (adjust-x-if-needed f30-1)) sv-96 f24-0 f24-0 (the-as rgba sv-112) arg3) (highscore-page-info-method-10 this arg1 (-> sv-16 bronze-score) (+ (adjust-x-if-needed f30-1) f28-1) f26-0) ) ) ) ) (draw-bg-box-alpha-2 arg0 (-> s0-0 highscore-1) (* 16.0 arg3)) (draw-bg-box-outline arg0 (-> s0-0 highscore-1) (* 128.0 arg3)) (draw-bg-box-outline arg0 (-> s0-0 highscore-0) (* 128.0 arg3)) (progress-method-33 arg0 (-> s0-0 highscore-body)) ) ) (let ((f30-2 (+ 10.0 arg2 (adjust-x-if-needed (-> s3-0 x)))) (f28-2 (+ -10.0 arg2 (adjust-x-if-needed (-> s3-0 z)))) (s3-1 (get-game-score-ref *game-info* (the-as int (-> this game-score)))) ) (set-scale! arg1 0.6) (adjust-font-origin-y arg0 arg1 0.03) (highscore-page-info-method-11 this arg1 56 (-> s3-1 0) f30-2 f28-2) (set-scale! arg1 0.5) (adjust-font-origin-y arg0 arg1 0.18) (highscore-page-info-method-11 this arg1 57 (-> s3-1 1) f30-2 f28-2) (set-scale! arg1 0.45) (adjust-font-origin-y arg0 arg1 0.31) (highscore-page-info-method-11 this arg1 58 (-> s3-1 2) f30-2 f28-2) (set-scale! arg1 0.425) (adjust-font-origin-y arg0 arg1 0.43) (highscore-page-info-method-11 this arg1 59 (-> s3-1 3) f30-2 f28-2) (adjust-font-origin-y arg0 arg1 0.545) (highscore-page-info-method-11 this arg1 60 (-> s3-1 4) f30-2 f28-2) (adjust-font-origin-y arg0 arg1 0.66) (highscore-page-info-method-11 this arg1 61 (-> s3-1 5) f30-2 f28-2) (adjust-font-origin-y arg0 arg1 0.775) (highscore-page-info-method-11 this arg1 62 (-> s3-1 6) f30-2 f28-2) (adjust-font-origin-y arg0 arg1 0.89) (highscore-page-info-method-11 this arg1 63 (-> s3-1 7) f30-2 f28-2) ) ) (progress-method-34 arg0) 0 (none) ) (defmethod draw-option ((this menu-inventory) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))) (set! (-> arg1 alpha) f30-0) (set-flags! arg1 (font-flags kerning middle large)) (progress-method-33 arg0 (-> *progress-work* body-footer)) (progress-method-53 arg0 arg1) (let* ((f0-2 (the float (-> this screens length))) (f28-0 (-> this current-index)) (f1-3 (+ 1.0 f28-0)) (f0-4 (- f1-3 (* (the float (the int (/ f1-3 f0-2))) f0-2))) (s3-0 (-> this screens (the int f28-0))) (s4-1 (-> this screens (the int f0-4))) (s2-0 (get-scissor-stack-top arg0)) (f0-7 (- (-> s2-0 z) (-> s2-0 x))) (f28-1 (* (- 1.0 (- f28-0 (* (the float (the int (/ f28-0 1.0))) 1.0))) f0-7)) ) (set! (-> arg1 origin x) (+ (- f28-1 f0-7) (-> s2-0 x))) (inventory-screen-method-9 s3-0 arg0 arg1 (- f28-1 f0-7) f30-0) (set! (-> arg1 origin x) (+ f28-1 (-> s2-0 x))) (inventory-screen-method-9 s4-1 arg0 arg1 f28-1 f30-0) ) (progress-method-34 arg0) (draw-header arg0 arg1 f30-0 (text-id progress-inventory)) (draw-prev-next-footer arg0 arg1 f30-0) ) (none) ) (defmethod inventory-screen-method-9 ((this inventory-screen) (arg0 progress) (arg1 font-context) (arg2 float) (arg3 float)) (set-scale! arg1 0.45) (set-color! arg1 (font-color font-color-32)) (adjust-font-origin-y arg0 arg1 0.01) (string-format "~S" (lookup-text! *common-text* (-> this name) #f)) (print-game-text *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) (dotimes (s1-1 (-> this groups length)) (inventory-item-group-method-10 (-> this groups s1-1) arg0 arg1 arg2 arg3 (the-as int (= s1-1 (-> this current-index))) ) ) (none) ) (defmethod inventory-item-group-method-10 ((this inventory-item-group) (arg0 progress) (arg1 font-context) (arg2 float) (arg3 float) (arg4 int)) (dotimes (i (-> this items length)) (when (and arg4 (have-items? this)) (set-scale! arg1 0.45) (adjust-font-origin-y arg0 arg1 0.9) (string-format "~S" (lookup-text! *common-text* (-> this name) #f)) (print-game-text *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) ) (inventory-item-method-10 (-> this items i) arg0 arg1 arg2 arg3 (the symbol arg4)) ) (none) ) (defmethod inventory-item-method-10 ((this inventory-item) (arg0 progress) (arg1 font-context) (arg2 float) (arg3 float) (arg4 symbol)) (let ((clr #x20000000)) (when (item-obtained? this) (if arg4 (set! clr #x80ffffff) (set! clr #x80808080) ) ) (let ((s3-1 (new 'stack 'vector2)) (v1-9 (get-scissor-stack-top arg0)) (f0-0 (-> this icon-scale)) ) (set! (-> s3-1 x) (+ (-> v1-9 x) (* (- (-> v1-9 z) (-> v1-9 x)) (-> this offset x)) arg2)) (set! (-> s3-1 y) (+ (-> v1-9 y) (* (- (-> v1-9 w) (-> v1-9 y)) (-> this offset y)))) (draw-icon-array! (-> *progress-icon-arrays* (-> this icon)) (the int (adjust-x-if-needed (-> s3-1 x))) (the int (-> s3-1 y)) f0-0 f0-0 (the rgba clr) arg3 ) ) ) (none) ) (defmethod draw-icon-array! ((this progress-icon-array) (arg0 int) (arg1 int) (arg2 float) (arg3 float) (arg4 rgba) (arg5 float)) (let ((sprite (new 'stack 'hud-sprite)) (s2-0 (new 'stack 'vector4w)) ) (set-vector! s2-0 arg0 arg1 0 1) (let ((v1-3 (-> sprite color-ptr))) (set! (-> v1-3 0) (the int (-> arg4 r))) (set! (-> v1-3 1) (the int (-> arg4 g))) (set! (-> v1-3 2) (the int (-> arg4 b))) (set! (-> v1-3 3) (the int (* arg5 (the float (-> arg4 a))))) ) (set! (-> sprite pos z) #xffffff) (set! (-> sprite pos w) 1) (set! (-> sprite scale-x) arg2) (set! (-> sprite scale-y) arg3) (dotimes (i (-> this length)) (let ((icon (-> this icons i))) (set! (-> sprite tid) (the-as texture-id (lookup-texture-by-id (-> icon tex-id)))) (set! (-> sprite flags) (the hud-sprite-flags (-> icon flags))) (set-as-offset-from! (the hud-sprite (-> sprite pos)) s2-0 (the int (* (the float (-> icon offset x)) arg2)) (the int (* (the float (-> icon offset y)) arg3)) ) (with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf)) (-> icon bucket)) (draw sprite buf (-> *level* level-default) #t)) ) ) ) (none) ) (defmethod draw-prev-next-footer ((this progress) (arg0 font-context) (arg1 float)) (progress-method-33 this (-> *progress-work* footer)) (draw-bg-box-alpha-2 this (-> *progress-work* footer) (* 64.0 arg1)) (draw-bg-box-outline this (-> *progress-work* footer) (* 128.0 arg1)) (set-color! arg0 (font-color font-color-33)) (set-scale! arg0 0.6) (let ((s4-1 (get-scissor-stack-top this))) (set! (-> arg0 origin x) (adjust-x-if-needed (+ 10.0 (-> s4-1 x)))) (set! (-> arg0 origin y) (+ (-> s4-1 y) (* 0.5 (- (- (-> s4-1 w) (-> s4-1 y)) (* 32.0 (-> arg0 scale)))))) (set-width! arg0 (the int (+ (- -20.0 (-> s4-1 x)) (-> s4-1 z)))) (set-flags! arg0 (font-flags kerning large)) (string-format "~S~S" (lookup-text! *common-text* (text-id progress-footer-prev-l1) #f) (lookup-text! *common-text* (text-id progress-prev) #f)) (print-game-text *temp-string* arg0 #f 44 (bucket-id hud-draw-hud-alpha)) (set! (-> arg0 origin x) (the float (adjust-x-if-needed (+ -10.0 (-> s4-1 z))))) ) (set-flags! arg0 (font-flags kerning right large)) (string-format "~S~S" (lookup-text! *common-text* (text-id progress-next) #f) (lookup-text! *common-text* (text-id progress-footer-next-r1) #f) ) (print-game-text *temp-string* arg0 #f 44 (bucket-id hud-draw-hud-alpha)) (progress-method-34 this) 0 ) (defmethod controls-page-info-method-11 ((this controls-page-info) (arg0 progress) (arg1 font-context) (arg2 float) (arg3 float)) (local-vars (v1-28 int) (v1-29 int) (sv-80 int)) (let ((s2-0 arg3)) (let ((s1-0 (get-scissor-stack-top arg0))) (progress-method-33 arg0 (-> *progress-work* sub-header)) (draw-bg-box-outline arg0 (-> *progress-work* sub-header) (* 128.0 arg3)) (set-flags! arg1 (font-flags kerning middle large)) (set! (-> arg1 origin x) (+ 10.0 arg2 (-> s1-0 x))) (set! (-> arg1 origin y) (-> s1-0 y)) (set-color! arg1 (font-color font-color-34)) (progress-method-45 arg0 arg1 (+ (- -20.0 (-> s1-0 x)) (-> s1-0 z)) 28.0 (lookup-text! *common-text* (-> this title) #f) 0.7 0.5 32) ) (progress-method-34 arg0) (progress-method-33 arg0 (-> *progress-work* sub-body-footer)) (progress-method-53 arg0 arg1) (set-flags! arg1 (font-flags kerning large)) (set-scale! arg1 0.425) (set-color! arg1 (font-color font-color-32)) (let* ((s0-1 (get-scissor-stack-top arg0)) (f28-0 (- (-> s0-1 z) (-> s0-1 x))) (s1-2 (init-text! this)) ) (let* ((f30-0 (/ f28-0 2)) (f28-1 (/ f28-0 2)) (f26-0 (+ arg2 (-> s0-1 x))) (f24-0 (+ arg2 (-> s0-1 x) f30-0)) ) (set-width! arg1 (if (not (-> *pc-settings* use-vis?)) (the int (* (-> *pc-settings* aspect-ratio-reciprocal) (+ -20.0 f30-0))) (the int (+ -20.0 f30-0)))) (set! sv-80 0) (let ((v1-27 sv-80) (a0-20 (min (the int (-> this current-index)) s1-2)) ) (set-on-less-than v1-28 v1-27 a0-20) (move-if-not-zero v1-29 a0-20 v1-28 v1-28) ) (set! sv-80 v1-29) (string-format "~S" (lookup-text! *common-text* (the-as text-id (-> this text sv-80 text)) #f)) (let ((f22-0 (print-game-text *temp-string* arg1 #t 40 (bucket-id hud-draw-hud-alpha)))) (string-format "~S" (lookup-text! *common-text* (-> this text sv-80 id) #f)) (let* ((f0-23 (print-game-text *temp-string* arg1 #t 40 (bucket-id hud-draw-hud-alpha))) (f22-1 (+ 8.0 (fmax f22-0 f0-23))) ) (let ((f2-0 (-> this current-index))) (set! (-> arg1 origin x) (+ 10.0 (-> s0-1 x))) (set! (-> arg1 origin y) (+ (- 4.0 (* f22-1 (- f2-0 (* (the float (the int (/ f2-0 1.0))) 1.0)))) (-> s0-1 y))) ) (while (and (< (-> arg1 origin y) (-> s0-1 w)) (< sv-80 s1-2)) (controls-string-info-method-9 (the-as controls-string-info (-> this text sv-80)) arg0 arg1 f26-0 f24-0 f30-0 f28-1 arg3 ) (1+! sv-80) ) (set! (-> this on-screen) (< (-> arg1 origin y) (-> s0-1 w))) (seek! (-> this current-index) (-> this target-index) (* (/ 300.0 f22-1) (seconds-per-frame))) ) ) ) (progress-method-34 arg0) (progress-method-33 arg0 (-> *progress-work* small-screen)) (progress-method-47 arg0 arg1 (!= (-> this current-index) 0.0) (and (not (-> this on-screen)) (!= (-> this current-index) (the float s1-2))) ) ) ) (progress-method-34 arg0) (none) ) (defmethod controls-string-info-method-9 ((this controls-string-info) (arg0 progress) (arg1 font-context) (arg2 float) (arg3 float) (arg4 float) (arg5 float) (arg6 float) ) (let ((s2-0 (get-scissor-stack-top arg0))) (set! (-> arg1 origin x) (adjust-x-if-needed (+ 10.0 arg2))) (set-width! arg1 (if (not (-> *pc-settings* use-vis?)) (the int (* (-> *pc-settings* aspect-ratio-reciprocal) (+ -20.0 arg4))) (the int (+ -20.0 arg4)))) (string-format "~S" (lookup-text! *common-text* (-> this action) #f)) (let ((f30-0 (print-game-text *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)))) (set! (-> arg1 origin x) (+ 10.0 arg3)) (set-width! arg1 (if (not (-> *pc-settings* use-vis?)) (the int (* (-> *pc-settings* aspect-ratio-reciprocal) (+ -20.0 arg5))) (the int (+ -20.0 arg5)))) (string-format "~S" (lookup-text! *common-text* (-> this button) #f)) (let* ((f0-11 (print-game-text *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha))) (f30-1 (+ 8.0 (fmax f30-0 f0-11))) ) (let ((s1-1 (new 'stack 'hud-box)) (f28-0 (+ arg3 (* 0.5 (- (-> s2-0 z) (-> s2-0 x))))) ) (set! (-> s1-1 box min y) (+ -6.0 (-> arg1 origin y))) (set! (-> s1-1 box max y) (+ (-> s1-1 box min y) f30-1)) (set-vector! (-> s1-1 color) 192 192 96 (the int (* 128.0 arg6))) (with-dma-buffer-add-bucket ((s2-1 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id hud-draw-hud-alpha) ) (set! (-> s1-1 box min x) (adjust-x-if-needed arg2)) (set! (-> s1-1 box max x) arg3) (draw-box-prim-only s1-1 s2-1) (set! (-> s1-1 box min x) arg3) (set! (-> s1-1 box max x) (adjust-x-if-needed f28-0)) (draw-box-prim-only s1-1 s2-1) ) ) (+! (-> arg1 origin y) f30-1) ) ) ) (none) ) (defmethod draw-header ((this progress) (arg0 font-context) (arg1 float) (arg2 text-id)) (progress-method-33 this (-> *progress-work* header)) (let ((s3-0 (get-scissor-stack-top this))) (draw-bg-box-alpha-2 this (-> *progress-work* header) (* 64.0 arg1)) (draw-bg-box-outline this (-> *progress-work* header) (* 128.0 arg1)) (set-flags! arg0 (font-flags kerning middle large)) (set-color! arg0 (font-color font-color-32)) (set! (-> arg0 origin x) (+ 10.0 (-> s3-0 x))) (set! (-> arg0 origin y) (-> s3-0 y)) (progress-method-45 this arg0 (+ (- -20.0 (-> s3-0 x)) (-> s3-0 z)) 45.0 (lookup-text! *common-text* arg2 #f) (if (not (-> *pc-settings* use-vis?)) 0.75 0.95) 0.1 32 ) ) (progress-method-34 this) 0 ) (defmethod draw-option ((this menu-memcard-slot-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (f28-0 (if (= (-> arg0 current) 'select-save-title) 0.2 0.25 ) ) (s3-0 *progress-work*) (f24-0 (-> *video-params* relative-x-scale)) ) (cond ((not (loaded? *bigmap*)) (progress-method-51 arg0 arg1) ) (else (set! (-> arg1 alpha) f30-0) (set-scale! arg1 0.6) (progress-method-33 arg0 (-> s3-0 body)) (let* ((s3-1 (get-scissor-stack-top arg0)) (s0-0 (new 'stack 'hud-box)) (f0-4 (* (- (-> s3-1 w) (-> s3-1 y)) f28-0)) (f26-0 (+ (-> s3-1 y) (* f0-4 (the float arg2)))) (f28-1 (+ f26-0 f0-4)) ) (let ((s2-0 *progress-save-info*)) (set! (-> arg1 origin x) (adjust-x-if-needed (+ 10.0 (-> s3-1 x)))) (set! (-> arg1 origin y) (+ f26-0 (* 0.5 (- f0-4 (* 32.0 (-> arg1 scale)))))) (set! (-> arg1 height) f0-4) (set-flags! arg1 (font-flags kerning large)) (when (and s2-0 (= (-> s2-0 formatted) 1) (= (-> s2-0 inited) 1)) (cond ((= (-> s2-0 file arg2 present) 1) (string-format "~S ~D" (lookup-text! *common-text* (text-id text-0073) #f) (1+ arg2)) (print-game-text *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) ) ((zero? (-> s2-0 file arg2 present)) (print-game-text (lookup-text! *common-text* (text-id progress-empty) #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) ) ) (when (= arg2 (-> arg0 option-index)) (set-scale! arg1 0.8) (with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id tex-hud-hud-alpha)) (let ((f24-1 (+ (-> s3-1 x) (* 0.4 (- (-> s3-1 z) (-> s3-1 x)))))) (set-vector! (-> s0-0 color) 128 128 128 (the int (* 16.0 f30-0))) (vector-copy! (the vector (-> s0-0 box)) s3-1) (set! (-> s0-0 box min x) f24-1) (draw-box-alpha-1 s0-0 buf) (set! (-> s0-0 box min x) (adjust-x-if-needed (-> s3-1 x))) (set! (-> s0-0 box max x) f24-1) ) (set! (-> s0-0 box min y) f26-0) (set! (-> s0-0 box max y) f28-1) (draw-box-alpha-1 s0-0 buf) (set-vector! (-> s0-0 color) 128 128 64 (the int (* 128.0 f30-0))) (when (!= f26-0 (-> s3-1 y)) (set! (-> s0-0 box min y) (-> s3-1 y)) (set! (-> s0-0 box max y) f26-0) (draw-box-prim-only s0-0 buf) ) (when (!= f28-1 (-> s3-1 w)) (set! (-> s0-0 box min y) f28-1) (set! (-> s0-0 box max y) (-> s3-1 w)) (draw-box-prim-only s0-0 buf) ) ) ) (when (= (-> s2-0 file arg2 present) 1) (when (= arg2 (-> arg0 option-index)) (draw-icon-array! (-> *progress-icon-arrays* (-> s2-0 file arg2 level-index)) ; (the int (+ (-> s3-1 x) (* 0.7 (- (-> s3-1 z) (-> s3-1 x))) (* -48.0 f24-0))) (the int (+ (adjust-x-if-needed (+ (-> s3-1 x) (* 0.7 (- (-> s3-1 z) (-> s3-1 x))))) (* -48.0 f24-0))) (the int (+ 32.0 (-> s3-1 y))) 1.0 1.0 (static-rgba #x80 #x80 #x80 #x80) f30-0) (set-scale! arg1 0.6) (set-color! arg1 (font-color font-color-32)) (adjust-font-origin-y arg0 arg1 0.675) (set-flags! arg1 (font-flags kerning right large)) (let* ((v1-91 (-> s2-0 file arg2 game-time0)) (v1-92 (logior (shl (-> s2-0 file arg2 game-time1) 32) v1-91))) (set! (-> arg1 origin x) (adjust-x-if-needed (+ (-> s3-1 x) (* 0.675 (- (-> s3-1 z) (-> s3-1 x)))))) (string-format "~2,'0D:~2,'0D" (/ (the-as int v1-92) #x107ac0) (/ (mod (the-as int v1-92) #x107ac0) #x4650)) ) (print-game-text *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) (draw-icon-array! (-> *progress-icon-arrays* 66) (the int (adjust-x-if-needed (+ 10.0 (* 0.4 (- (-> s3-1 z) (-> s3-1 x))) (-> s3-1 x)))) (the int (-> arg1 origin y)) 0.65 0.65 (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) f30-0 ) (set! (-> arg1 origin x) (adjust-x-if-needed (+ (- (+ -10.0 (-> s3-1 z)) (-> s3-1 x)) (-> s3-1 x)))) (string-format "~D%" (the int (-> s2-0 file arg2 completion-percentage))) (print-game-text *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) (draw-icon-array! (-> *progress-icon-arrays* 67) (the int (adjust-x-if-needed (+ -8.0 (* 0.75 (- (-> s3-1 z) (-> s3-1 x))) (-> s3-1 x)))) (the int (-> arg1 origin y)) 0.7 0.7 (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) f30-0 ) (adjust-font-origin-y arg0 arg1 0.83) (set! (-> arg1 origin x) (adjust-x-if-needed (+ (-> s3-1 x) (* 0.675 (- (-> s3-1 z) (-> s3-1 x)))))) (string-format "~D" (the int (-> s2-0 file arg2 skill-count))) (print-game-text *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) (draw-icon-array! (-> *progress-icon-arrays* 68) (the int (adjust-x-if-needed (+ 10.0 (* 0.4 (- (-> s3-1 z) (-> s3-1 x))) (-> s3-1 x)))) (the int (+ -2.0 (-> arg1 origin y))) 0.7 0.7 (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) f30-0 ) (set! (-> arg1 origin x) (adjust-x-if-needed (+ (- (+ -10.0 (-> s3-1 z)) (-> s3-1 x)) (-> s3-1 x)))) (string-format "~D" (the int (-> s2-0 file arg2 gem-count))) (print-game-text *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) (draw-icon-array! (-> *progress-icon-arrays* 69) (the int (adjust-x-if-needed (+ -14.0 (* 0.75 (- (-> s3-1 z) (-> s3-1 x))) (-> s3-1 x)))) (the int (-> arg1 origin y)) 0.5 0.5 (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) f30-0 ) (when (logtest? (-> s2-0 file arg2 secrets) 1) (set-flags! arg1 (font-flags kerning middle large)) (set! (-> arg1 origin x) (adjust-x-if-needed (+ (-> s3-1 x) (* 0.4 (- (-> s3-1 z) (-> s3-1 x)))))) (set! (-> arg1 origin y) (+ 8.0 (-> s3-1 y))) (set-width! arg1 (the int (* 0.6 (- (-> s3-1 z) (-> s3-1 x))))) (string-format "~S" (lookup-text! *common-text* (text-id progress-secrets-hero-mode) #f)) (print-game-text *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) ) ) ) ) ) ) (progress-method-34 arg0) (when (zero? arg2) (case (-> arg0 current) (('select-load) (draw-header arg0 arg1 f30-0 (text-id progress-load-file-select)) ) (('select-save-hero) (draw-header arg0 arg1 f30-0 (text-id save-hero-mode-file)) ) (else (draw-header arg0 arg1 f30-0 (text-id progress-save-file-select)) ) ) ) ) ) ) (none) ) (defmethod draw-option ((this menu-save-sub-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))) (progress-method-33 arg0 (-> *progress-work* body)) (let* ((s2-0 (get-scissor-stack-top arg0)) (s3-0 (new 'stack 'hud-box)) (width (if (not (-> *pc-settings* use-vis?)) (the int (+ -13.0 (* (-> *pc-settings* aspect-ratio-reciprocal) (* 0.4 (- (-> s2-0 z) (-> s2-0 x)))))) (the int (+ -10.0 (* 0.4 (- (-> s2-0 z) (-> s2-0 x))))) ) ) ) (set-width! arg1 width) (set-flags! arg1 (font-flags kerning large)) (set-scale! arg1 0.425) (let* ((f24-0 (* (- (-> s2-0 w) (-> s2-0 y)) 0.2)) (f28-1 (+ (-> s2-0 y) (* f24-0 (the float arg2)))) (f26-0 (+ f28-1 f24-0)) ) (let* ((f0-7 (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #t 44 (bucket-id hud-draw-hud-alpha)) ) (v1-11 arg1) (f1-9 (+ 10.0 (-> s2-0 x))) (f0-10 (+ f28-1 (* 0.5 (- f24-0 f0-7)))) ) (set! (-> v1-11 origin x) (adjust-x-if-needed f1-9)) (set! (-> v1-11 origin y) f0-10) ) (set! (-> arg1 height) f24-0) (when (= arg2 (-> arg0 option-index)) (set-scale! arg1 0.45) (with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id tex-hud-hud-alpha) ) (set-vector! (-> s3-0 color) 128 128 128 (the int (* 16.0 f30-0))) (set! (-> s3-0 box min x) (adjust-x-if-needed (-> s2-0 x))) (set! (-> s3-0 box max x) (+ (-> s2-0 x) (* 0.4 (- (-> s2-0 z) (-> s2-0 x))))) (set! (-> s3-0 box min y) f28-1) (set! (-> s3-0 box max y) f26-0) (draw-box-alpha-1 s3-0 buf) (set-vector! (-> s3-0 color) 128 128 64 (the int (* 128.0 f30-0))) (draw-box-prim-only s3-0 buf) ) ) ) ) ) (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) (progress-method-34 arg0) (none) ) (defmethod draw-option ((this menu-select-start-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> *progress-list-level* mode) (-> arg0 current)) (set! (-> *progress-list-level* act) (-> *progress-work* selected-num)) (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))) (let ((s3-0 (length *progress-list-level*))) (set-alpha! arg1 f30-0) (set-flags! arg1 (font-flags kerning large)) (set-scale! arg1 0.42) (progress-method-33 arg0 (-> *progress-work* body-footer)) (let ((idx (max 0 (the int (-> this current-index))))) (string-format "~S" (lookup-text! *common-text* (-> (progress-list-method-9 *progress-list-level* idx) text-name) #f)) (let ((f28-0 (print-game-text *temp-string* arg1 #t 44 (bucket-id hud-draw-hud-alpha)))) (let ((s1-1 (get-scissor-stack-top arg0))) (let* ((cur-idx (-> this current-index)) (f2-5 (+ (- 8.0 (* f28-0 (- cur-idx (* (the float (the int (/ cur-idx 1.0))) 1.0)))) (-> s1-1 y))) ) (set-origin! arg1 (the int (+ 10.0 (-> s1-1 x))) (the int f2-5)) ) (set-width! arg1 (the int (+ (- -20.0 (-> s1-1 x)) (-> s1-1 z)))) (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))) (set-height! arg1 (the int (- (-> s1-1 w) (-> s1-1 y)))) (while (and (< (-> arg1 origin y) (-> s1-1 w)) (< idx s3-0)) (cond ((= idx (-> this selected-index)) (set-color! arg1 (font-color font-color-34)) ) (else (set-color! arg1 (font-color font-color-32)) ) ) (string-format "~S" (lookup-text! *common-text* (-> (progress-list-method-9 *progress-list-level* idx) text-name) #f)) (let ((f26-0 (print-game-text *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)))) (if (= idx (-> this selected-index)) (draw-highlight-bar arg0 arg1 (the int (+ -2.0 (-> arg1 origin y))) (the int (+ 2.0 f26-0)) f30-0) ) (+! (-> arg1 origin y) f26-0) ) (1+! idx) ) ) (seek! (-> this current-index) (-> this target-index) (* (/ (-> this scroll-speed) f28-0) (seconds-per-frame)) ) ) ) ) (progress-method-34 arg0) (let ((selected (-> *progress-work* selected-num))) (draw-header arg0 arg1 f30-0 (cond ((zero? selected) (text-id progress-select-start) ) ((= selected 1) (text-id progress-title-level-select-act-1) ) ((= selected 2) (text-id progress-title-level-select-act-2) ) (else (text-id progress-title-level-select-act-3) ) ) ) ) (draw-bg-box-alpha-2 arg0 (-> *progress-work* footer) (* 64.0 f30-0)) (draw-bg-box-outline arg0 (-> *progress-work* footer) (* 128.0 f30-0)) ) (progress-method-47 arg0 arg1 (!= (-> this current-index) 0.0) (!= (-> this current-index) (the float (+ (-> arg0 total-num-tasks) -1))) ) (none) ) (defmethod draw-option ((this menu-select-scene-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))) (let* ((selected (-> *progress-work* selected-num)) (scenes (cond ((zero? selected) *hud-select-scene-act1* ) ((= selected 1) *hud-select-scene-act2* ) ((= selected 2) *hud-select-scene-act3* ) (else *hud-select-scene-commentary* ) ) ) (len (-> scenes length)) ) (set-alpha! arg1 f30-0) (set-flags! arg1 (font-flags kerning large)) (set-scale! arg1 0.42) (progress-method-33 arg0 (-> *progress-work* body-footer)) (let ((idx (max 0 (the int (-> this current-index))))) (string-format "~S" (lookup-text! *common-text* (-> scenes idx text) #f)) (let ((f28-0 (print-game-text *temp-string* arg1 #t 44 (bucket-id hud-draw-hud-alpha)))) (let ((s0-1 (get-scissor-stack-top arg0))) (let* ((cur-idx (-> this current-index)) (f2-5 (+ (- 8.0 (* f28-0 (- cur-idx (* (the float (the int (/ cur-idx 1.0))) 1.0)))) (-> s0-1 y))) ) (set-origin! arg1 (the int (+ 10.0 (-> s0-1 x))) (the int f2-5)) ) (set-width! arg1 (the int (+ (- -20.0 (-> s0-1 x)) (-> s0-1 z)))) (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))) (set-height! arg1 (the int (- (-> s0-1 w) (-> s0-1 y)))) (while (and (< (-> arg1 origin y) (-> s0-1 w)) (< idx len)) (cond ((= idx (-> this selected-index)) (set-color! arg1 (font-color font-color-34)) ) (else (set-color! arg1 (font-color font-color-32)) ) ) (string-format "~S" (lookup-text! *common-text* (-> scenes idx text) #f)) (let* ((f26-0 (print-game-text *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)))) (if (= idx (-> this selected-index)) (draw-highlight-bar arg0 arg1 (the int (+ -2.0 (-> arg1 origin y))) (the int (+ 2.0 f26-0)) f30-0) ) (+! (-> arg1 origin y) f26-0) ) (1+! idx) ) ) (seek! (-> this current-index) (-> this target-index) (* (/ (-> this scroll-speed) f28-0) (seconds-per-frame)) ) ) ) ) (progress-method-34 arg0) (let* ((selected (-> *progress-work* selected-num))) (draw-header arg0 arg1 f30-0 (cond ((zero? selected) (text-id progress-scene-player-act-1) ) ((= selected 1) (text-id progress-scene-player-act-2) ) ((= selected 2) (text-id progress-scene-player-act-3) ) (else (text-id progress-title-commentary) ) ) ) ) (draw-bg-box-alpha-2 arg0 (-> *progress-work* footer) (* 64.0 f30-0)) (draw-bg-box-outline arg0 (-> *progress-work* footer) (* 128.0 f30-0)) ) (progress-method-47 arg0 arg1 (!= (-> this current-index) 0.0) (!= (-> this current-index) (the float (+ (-> arg0 total-num-tasks) -1))) ) (none) ) (defmethod draw-option ((this menu-icon-info-option) (arg0 progress) (fnt font-context) (arg2 int) (arg3 symbol)) (set-alpha! fnt (- 1.0 (-> arg0 menu-transition))) (set-color! fnt (font-color font-color-32)) (set-scale! fnt 0.5) (true! (-> *bigmap* auto-save-icon-flag)) (set! (-> this sprites 0 tid) (the-as texture-id (get-texture checkpoint level-default-minimap))) (set! (-> this sprites 0 scale-x) 1.0) (set! (-> this sprites 0 scale-y) 1.0) (let ((icon-clr (-> this sprites 0 color-ptr))) (set! (-> icon-clr 0) 128) (set! (-> icon-clr 1) 128) (set! (-> icon-clr 2) 128) (set! (-> icon-clr 3) (the int (* 128.0 (- 1.0 (-> arg0 menu-transition))))) ) (set! (-> this sprites 0 pos z) #xffffff) (set! (-> this sprites 0 pos w) 0) (set-hud-piece-position! (-> this sprites 0) 240 160) (with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id hud-draw-hud-alpha) ) (draw (-> this sprites 0) buf (-> *level* level-default) #t) ) (set-flags! fnt (font-flags kerning middle middle-vert large)) (set! (-> fnt origin x) 90.0) (set! (-> fnt origin y) 80.0) (set-width! fnt 330) (set-height! fnt 85) (when (not (-> *pc-settings* use-vis?)) (set! (-> fnt origin x) (the float (adjust-game-x (-> fnt origin x)))) (*! (-> fnt width) (-> *pc-settings* aspect-ratio-reciprocal))) (print-game-text (lookup-text! *common-text* (text-id progress-autosave-notice) #f) fnt #f 44 (bucket-id hud-draw-hud-alpha) ) (+! (-> fnt origin y) 115.0) (set-height! fnt 95) (print-game-text (string-format (lookup-text! *common-text* (text-id progress-autosave-remove-warn) #f) 1) fnt #f 44 (bucket-id hud-draw-hud-alpha) ) (+! (-> fnt origin y) 90.0) (set-height! fnt 50) (set-color! fnt (font-color font-color-33)) (draw-highlight-bar arg0 fnt (the int (+ 12.0 (-> fnt origin y))) 24 (-> fnt alpha)) (print-game-text (lookup-text! *common-text* (text-id progress-continue) #f) fnt #f 44 (bucket-id hud-draw-hud-alpha) ) (none) ) (defmethod draw-option ((this menu-main-menu-option) (arg0 progress) (fnt font-context) (arg2 int) (arg3 symbol)) (when (and (nonzero? (-> this name)) (= arg2 (-> arg0 option-index))) (set-scale! fnt 0.75) (set-color! fnt (font-color font-color-32)) (set-alpha! fnt (- 1.0 (-> arg0 menu-transition))) (set-flags! fnt (font-flags shadow kerning middle large)) (set-width! fnt (if (= (get-aspect-ratio) 'aspect4x3) 235 175)) (set-height! fnt 80) (set! (-> fnt origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) 140 170))) (set! (-> fnt origin y) (the float (if (= (get-aspect-ratio) 'aspect4x3) 180 175))) (when (not (-> *pc-settings* use-vis?)) (set! (-> fnt origin x) (the float (adjust-game-x (-> fnt origin x)))) (*! (-> fnt width) (-> *pc-settings* aspect-ratio-reciprocal))) (cond ((= (-> this name) (text-id progress-bigmap)) (if (language? french) (set-scale! fnt 0.7) ) (print-game-text (lookup-text! *common-text* (-> this name) #f) fnt #f 44 (bucket-id hud-draw-hud-alpha)) (set! (-> fnt origin y) (the float (if (= (get-aspect-ratio) 'aspect4x3) 210 200))) (set-scale! fnt 0.6) ) (else (print-game-text (lookup-text! *common-text* (-> this name) #f) fnt #f 44 (bucket-id hud-draw-hud-alpha)) ) ) ) (none) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; CUSTOM MENU OPTIONS ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (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 font-color-32)) (set-flags! arg1 (font-flags kerning middle middle-vert large)) (print-game-text (lookup-text! *common-text* arg3 #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) (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))) #x3fffff)))) (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 hud-draw-hud-alpha)) (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 #x80 :g #x80 :b #x40 :a (the int (* 64.0 alpha))) #x3fffff))) (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 hud-draw-hud-alpha)) (set! (-> font origin y) (+ start-y y-down)) (print-game-text (string-format "~33L~C" 162) font #f 44 (bucket-id hud-draw-hud-alpha)))) 0) (defmethod draw-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))) (fmax! 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 font-color-32)) (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 hud-draw-hud-alpha)) (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 (font-color font-color-33)) (draw-up-down-aspect arg1 21.0 25.0)) (else (set-color! arg1 (font-color font-color-32)))) (print-game-text (string-format "~D" (-> *pc-settings* aspect-custom-x)) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) (set-scale! arg1 0.55) (set-color! arg1 (font-color font-color-32)) (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 hud-draw-hud-alpha)) (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 (font-color font-color-33)) (draw-up-down-aspect arg1 21.0 25.0)) (else (set-color! arg1 (font-color font-color-32)))) (print-game-text (string-format "~D" (-> *pc-settings* aspect-custom-y)) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) (set-scale! arg1 0.55) (set-color! arg1 (font-color font-color-32)) (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 hud-draw-hud-alpha))) (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 hud-draw-hud-alpha)))) (else (set-scale! arg1 0.55) (set-color! arg1 (font-color font-color-32)) (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 hud-draw-hud-alpha)))) (when-not-drawn-decoration (draw-decoration-aspect-ratio-custom obj arg1 alpha (text-id progress-aspect-ratio-custom-title) 0.55))) 0 (none)) (defmethod draw-option ((obj menu-frame-rate-disclaimer-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (set-color! arg1 (font-color red)) (set-scale! arg1 0.8) (set-flags! arg1 (font-flags kerning middle middle-vert large)) (set! (-> arg1 origin x) 90.0) (set! (-> arg1 origin y) 72.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))) (when (< (mod (-> *display* real-clock frame-counter) (seconds 1.2)) (seconds 1.0)) (print-game-text (lookup-text! *common-text* (text-id progress-fps-disclaimer-warning) #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha))) (+! (-> arg1 origin y) 80.0) (set-scale! arg1 0.45) (set-color! arg1 (font-color font-color-32)) (print-game-text (lookup-text! *common-text* (text-id progress-fps-disclaimer) #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) (+! (-> arg1 origin y) 65.0) (set-scale! arg1 0.55) (set-height! arg1 95) (print-game-text (lookup-text! *common-text* (text-id progress-memcard-continue?) #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) (+! (-> arg1 origin y) 58.0) (set-scale! arg1 0.5) (set-height! arg1 50) (set-color! arg1 (font-color font-color-32)) (when (time-elapsed? (-> *progress-state-pc* frame-rate-disclaimer-time) (seconds 3)) (draw-highlight (the int (+ 13.0 (-> arg1 origin y))) 18 (-> arg1 alpha)) ; (draw-yes-no arg0 arg1) (draw-yes-no-style-footer arg0 arg1 (text-id progress-yes) (text-id progress-no))) (none)) (defmethod draw-option ((this menu-sub-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (offset-y (-> this offset-y))) (set! (-> arg1 alpha) f30-0) (set-scale! arg1 0.85) ;; adjust for potentially hidden secrets menu (when (and (= *title-pc* (-> arg0 current-options)) (not (memcard-unlocked-secrets? #f #f))) ;; above secrets, shift down (+! offset-y 0.08) ) (adjust-font-origin-y arg0 arg1 offset-y) (when (not (and (= (-> this name) (text-id progress-secrets)) (= *title-pc* (-> arg0 current-options)) (not (memcard-unlocked-secrets? #f #f)) )) (cond ((= (-> arg0 option-index) arg2) (draw-highlight-bar arg0 arg1 (the int (+ -6.0 (-> arg1 origin y))) 35 f30-0) (let ((a0-4 arg1)) (set! (-> a0-4 color) (font-color font-color-33)))) (else (let ((a0-5 arg1)) (set! (-> a0-5 color) (font-color font-color-32))))) (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) ) ) 0 (none)) (defmethod draw-option ((this menu-exit-game-option) (progress progress) (fnt font-context) (arg2 int) (selected symbol)) (let ((alpha (* 2.0 (- 0.5 (-> progress menu-transition)))) (y (the int (+ -1.0 (-> fnt origin y)))) (offset-y (-> this offset-y)) (height 22)) (if (< alpha 0.0) (set! alpha 0.0)) (set! (-> fnt alpha) alpha) (set-scale! fnt 0.85) ;; adjust for potentially hidden secrets menu (when (not (memcard-unlocked-secrets? #f #f)) ;; below secrets, shift up (-! offset-y 0.07) ) (adjust-font-origin-y progress fnt offset-y) (when (nonzero? (-> this name)) (set-color! fnt (if (= arg2 (-> progress option-index)) (font-color font-color-32) (font-color font-color-33))) (cond ((= arg2 (-> progress option-index)) (set-color! fnt (font-color font-color-33)) (draw-highlight-bar progress fnt (the int (+ -6.0 (-> fnt origin y))) 35 alpha)) (else (set-color! fnt (font-color font-color-32)))) (if selected (set-color! fnt (font-color font-color-34))) (print-game-text (lookup-text! *common-text* (-> this name) #f) fnt #f 44 (bucket-id hud-draw-hud-alpha)) (let ((choice (&-> progress yes-no-choice)) (str (the string #f))) (set! str (cond (selected (set-color! fnt (font-color font-color-34)) (when (memcard-unlocked-secrets? #f #f) (draw-highlight-bar progress fnt (the int (+ 29.0 (-> fnt origin y))) 24 alpha) (+! (-> fnt origin y) 29.0) (set-scale! fnt 0.55)) (when (not (memcard-unlocked-secrets? #f #f)) (draw-highlight-bar progress fnt (the int (+ 29.0 (-> fnt origin y))) 23 alpha) (+! (-> fnt origin y) 29.0) (set-scale! fnt 0.60)) (cond ((-> choice 0) (string-format "~33L~S~44L ~S" (lookup-text! *common-text* (text-id progress-yes) #f) (lookup-text! *common-text* (text-id progress-no) #f)) (set! str *temp-string*)) (else (string-format "~44L~S ~33L~S~1L" (lookup-text! *common-text* (text-id progress-yes) #f) (lookup-text! *common-text* (text-id progress-no) #f)) (set! str *temp-string*))) str) (else (clear *temp-string*)))) (print-game-text str fnt #f 44 (bucket-id hud-draw-hud-alpha))))) (none)) (defun draw-decoration-resolution ((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 70) (set! s5-0 116) (set! sv-48 84) (set! s3-0 375) (set! s2-0 179)) (('aspect16x9) (set! gp-0 79) (set! s5-0 108) (set! sv-48 58) (set! s3-0 356) (set! s2-0 185) (set! sv-64 20))) (#when PC_PORT ;; added for better widescreen handling (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 font-color-32)) (set-flags! arg1 (font-flags kerning middle large)) (print-game-text (lookup-text! *common-text* arg3 #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) (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)) (+! (-> arg1 origin y) (the float sv-64)) (draw-savegame-box arg0 (the float gp-0) (the float (+ gp-0 s3-0)) (the float (+ s5-0 s2-0)) (the float (+ s5-0 s2-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))) #x3fffff)))) (defun begin-scissor-resolution ((arg0 hud-box)) (cond ((= (get-aspect-ratio) 'aspect16x9) (set! (-> arg0 min x) 79.0) (set! (-> arg0 min y) 108.0) (set! (-> arg0 max x) 434.0) (set! (-> arg0 max y) 293.0)) (else (set! (-> arg0 min x) 70.0) (set! (-> arg0 min y) 116.0) (set! (-> arg0 max x) 444.0) (set! (-> arg0 max y) 295.0))) (with-dma-buffer-add-bucket ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id hud-draw-hud-alpha)) (setup-scissor arg0 s4-0)) 0) (defun end-scissor-resolution ((arg0 hud-box) (arg1 float)) (with-dma-buffer-add-bucket ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id hud-draw-hud-alpha)) (restore-scissor arg0 s5-0)) 0) (defmethod draw-option ((this menu-resolution-option) (the-progress progress) (font font-context) (arg2 int) (arg3 symbol)) (let* ((alpha (* 2.0 (- 0.5 (-> the-progress menu-transition)))) (box (new 'stack 'hud-box)) (height 22) (text-pad 1) (text-height (+ height (* text-pad 2)))) (fmax! alpha 0.0) (set! (-> font alpha) alpha) (draw-decoration-resolution this font alpha (if (fullscreen?) (text-id progress-game-res-decoration) (text-id progress-window-size-decoration)) 0.65) (begin-scissor-resolution box) (set-flags! font (font-flags kerning large middle)) (cond ((< (-> this selected-index) 0) ;; not sure. ) ((-> this valid?) (set-scale! font 0.6) (set-color! font (font-color font-color-33)) (set! (-> font origin x) (+ (-> box min x) 16)) (set! (-> font width) (- (-> box max x) (-> box min x) (* 16 2))) (set-height! font 60) ;; draw the highlight first (draw-highlight 193 (- height 1) alpha) ;; now scroll and offset the list (if (> (fabs (- (-> this scroll-index) (the float (-> this selected-index)))) 2.0) (set! (-> this scroll-index) (the float (-> this selected-index))) (seek-ease! (-> this scroll-index) (the float (-> this selected-index)) (* 0.15 (-> PP clock time-adjust-ratio)) 0.3 (* 0.0015 (-> PP clock time-adjust-ratio)))) (set! (-> font origin y) (- 194.0 (* (-> this scroll-index) text-height) (- text-pad))) ;; now draw the list! (let ((valid-index 0)) (dotimes (i (-> this num-resolutions)) ;; count "valid" resolutions (let ((this-w 0) (this-h 0) (this-aspect 0.0)) (pc-get-resolution i (= (pc-get-display-mode) 'windowed) (& this-w) (& this-h)) (set! this-aspect (/ (the float this-w) (the float this-h))) (when (or (= (pc-get-display-mode) 'windowed) (< (fabs (- (-> this win-aspect) this-aspect)) 0.05)) (if (= valid-index (-> this selected-index)) (set-color! font (font-color font-color-33)) (set-color! font (font-color font-color-44))) (print-game-text (string-format "~D x ~D" this-w this-h) font #f 44 (bucket-id hud-draw-hud-alpha)) (+! (-> font origin y) text-height) (1+! valid-index)))) (when (fullscreen?) ;; draw extra hardcoded cases (if (= valid-index (-> this selected-index)) (set-color! font (font-color font-color-33)) (set-color! font (font-color font-color-44))) (print-game-text (string-format "~D x ~D" 512 416) font #f 44 (bucket-id hud-draw-hud-alpha)) (+! (-> font origin y) text-height) (1+! valid-index) (if (= valid-index (-> this selected-index)) (set-color! font (font-color font-color-33)) (set-color! font (font-color font-color-44))) (print-game-text (string-format "~D x ~D" 512 208) font #f 44 (bucket-id hud-draw-hud-alpha)) (+! (-> font origin y) text-height) (1+! valid-index)))) (else ;; wtf?? just print an ominous warning. (set-scale! font 0.6) (set-color! font (font-color red)) (set! (-> font origin x) (+ (-> box min x) 16)) (set! (-> font origin y) (+ (-> box min y) 120)) (set! (-> font width) (- (-> box max x) (-> box min x) (* 16 2))) (set-height! font 60) (print-game-text (lookup-text! *common-text* (text-id progress-error-no-resolutions) #f) font #f 44 (bucket-id hud-draw-hud-alpha)))) (end-scissor-resolution box 1.0)) 0 (none)) ; (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 hud-draw-hud-alpha) ; ) ; (draw-sprite2d-xy buf x y w h (new 'static 'rgba :r #x80 :g #x80 :b #x40 :a (the int (* 64.0 alpha))) #x3fffff) ; ) ; ) ; (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 hud-draw-hud-alpha) ; ) ; (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 hud-draw-hud-alpha) ; ) ; (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 font-color-33)) ; (set-flags! arg1 (font-flags kerning middle middle-vert large)) ; (print-game-text (lookup-text! *common-text* arg3 #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) ; (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))) ; #x3fffff ; ) ; ) ; ) ; ) ; (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 hud-draw-hud-alpha)) ; (set! (-> font origin y) (+ 3.0 (-> box max y))) ; (print-game-text (string-format "~33L~C" 162) font #f 44 (bucket-id hud-draw-hud-alpha)) ; ) ; ) ; 0) ; (defmethod draw-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) ; ))) ; (fmax! 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 font-color-33)) ; (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 (font-color font-color-33)) ; (set-color! arg1 (font-color font-color-44))) ; (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 hud-draw-hud-alpha)) ; (print-game-text (lookup-text! *common-text* (text-id progress-music-player-locked) #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha))) ; ) ; (+! (-> 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 font-color-34)) ; )) ; (else ; (set-color! arg1 (font-color font-color-33)) ; (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 font-color-33)) ; ) ; ) ; (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 hud-draw-hud-alpha)) ; (print-game-text (lookup-text! *common-text* (text-id progress-music-player-locked) #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha))) ; ) ; (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) ; (fmax! (-> 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 font-color-33)) ; (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 hud-draw-hud-alpha))) ; (set-flags! arg1 (font-flags kerning middle middle-vert 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 hud-draw-hud-alpha)) ; ;; 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 hud-draw-hud-alpha)) ; ) ; ) ; (else ; (print-game-text (lookup-text! *common-text* (text-id progress-music-player-no-track) #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) ; ) ; ) ; ;; 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 hud-draw-hud-alpha)) ; (+! (-> arg1 origin x) (-> arg1 width)) ; (set-flags! arg1 (font-flags kerning large right)) ; (set-width! arg1 arrow-w) ; (+! (-> arg1 origin x) (-> arg1 width)) ; (set-color! arg1 (progress-selected (seconds 0.5))) ; (print-game-text (string-format "~33L~C" 163) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) ; (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)))) ; (set-color! arg1 (font-color font-color-33)) ; (print-game-text (lookup-text! *common-text* (-> danger-text-list (-> obj excitement)) #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) ; (+! (-> arg1 origin x) (-> arg1 width)) ; (set-flags! arg1 (font-flags kerning large)) ; (set-width! arg1 arrow-w) ; (set-color! arg1 (progress-selected (seconds 0.5))) ; (print-game-text (string-format "~33L~C" 161) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) ; (with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf)) ; (bucket-id hud-draw-hud-alpha) ; ) ; (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) #x3fffff) (draw-sprite2d-xy buf mx 0 1 416 (static-rgba #xff #xff #xff #x40) #x3fffff)))) (defmacro spawn-draw-mouse-proc () `(process-spawn-function process :name "draw-mouse" :to *display-pool* (lambda :behavior process () (loop (suspend) (draw-mouse))))))