mirror of
https://github.com/open-goal/jak-project
synced 2026-09-07 03:30:01 -04:00
427c952558
This PR fixes the alignment of text and other elements in several menus of Jak 3 (as well as some of Jak 2) when using Automatic or Custom aspect ratios. It also cleans up some of the relevant functions which are used to draw these menus (although I'm still learning how to clean goal code). I mostly used french text for testing (since the french text seems to push the font boundaries to their limits a bit more). I used Automatic 16:9 and Custom 4:1 aspect ratios for testing to see if my changes scale to other aspect ratios properly, comparing with PS2 4:3 for reference. ### Jak 3 ### Image Color Scale Before: - The black/white color scale would get stretched (beyond the limits of the menu in 4x1) <img width="1280" height="758" alt="color-scale-16x9-broken" src="https://github.com/user-attachments/assets/4b3b897e-1417-42da-86a1-dd78926ccb73" /> <img width="1283" height="747" alt="color-scale-4x1-broken" src="https://github.com/user-attachments/assets/44d192ba-5afe-43ae-9419-021123478a31" /> Reference (PS2 4:3 in OpenGoal): <img width="1278" height="773" alt="color-scale-reference" src="https://github.com/user-attachments/assets/d9bd8f4e-8f69-49a9-8a99-3fcd3d7a4097" /> After fixes: <img width="1283" height="765" alt="color-scale-16x9-fixed" src="https://github.com/user-attachments/assets/99422d7f-d688-4d91-8ce0-6ad0b7cb10df" /> <img width="1282" height="762" alt="color-scale-4x1-fixed" src="https://github.com/user-attachments/assets/6011f30a-0c31-4ea9-afe1-735ec36f3d32" /> ### Secrets menu Before: - The secret titles touch their costs (#4233). - The alignment of the top line showing orbs available/cost and total orbs collected is broken (more noticeable in 4:1) - The alignment of the titles for groups of secrets is broken (more noticeable in 4:1) - The indentation for secret titles relative to the group of secrets is also broken (again, more noticeable in 4:1) <img width="1286" height="758" alt="secrets-broken-16x9" src="https://github.com/user-attachments/assets/bd6c7dab-ce95-4349-bf1d-2a09f82fcbfe" /> <img width="1287" height="751" alt="secrets-broken-4x1" src="https://github.com/user-attachments/assets/3e1ce842-19ba-49b3-92f9-52034ae1982f" /> Reference (PS2 4:3 in OpenGoal): <img width="1280" height="761" alt="Screenshot from 2026-08-16 22-58-22" src="https://github.com/user-attachments/assets/7326a1c7-b479-4fb7-9450-377a05ab7963" /> After fixes: <img width="1280" height="722" alt="secrets-fixed-16x9" src="https://github.com/user-attachments/assets/0a66d45f-3aa3-4cc8-ac88-c6aef20f1319" /> <img width="1286" height="713" alt="secrets-fixed-4x1" src="https://github.com/user-attachments/assets/e8740739-42ac-4a12-aad1-e6620dfc73ed" /> ### Secrets purchase menu Before: - The text for the secret you're purchasing can get cut off if too big. - As before, the top line showing orb cost/orbs collected is misaligned. <img width="1288" height="754" alt="secrets-purchase-broken-16x9" src="https://github.com/user-attachments/assets/49b709e3-c015-42ba-b0aa-034769286d77" /> <img width="1281" height="756" alt="secrets-purchase-broken-4x1" src="https://github.com/user-attachments/assets/0c3c5e02-048a-4188-ada7-2413c384224b" /> Reference (PS2 4:3 in OpenGoal): <img width="1286" height="753" alt="secrets-purchase-reference" src="https://github.com/user-attachments/assets/bb0b1d1a-87f6-4343-8a82-2e1f968943cd" /> After fixes: <img width="1286" height="759" alt="secrets-purchase-fixed-16x9" src="https://github.com/user-attachments/assets/1d73593f-1d58-407e-9ce6-2da5bf0fd84b" /> <img width="1283" height="750" alt="secrets-purchase-fixed-4x1" src="https://github.com/user-attachments/assets/85c7e14d-c6b2-4b21-83e5-173af5cba185" /> ### Save/Load/Create Hero Mode Save menu Here I show the load game screen only but the bugs were the same among all 3 as the code is shared. The fixes apply to all 3 as well 😃 Before: - The header text is cut off in french. - There is a faint red rectangle to the right of the menu (look closely! It's a bit clearer and goes beyond the menu in 4x1). - The left yellow boxes around the save-games that are not selected do not scale properly (more noticeable in 4x1). <img width="1284" height="749" alt="load-broken-Automatic" src="https://github.com/user-attachments/assets/2ae3bd8b-42ec-49bc-9851-cbaace4ce64b" /> <img width="1285" height="751" alt="load-broken-4x1" src="https://github.com/user-attachments/assets/655de844-748c-43f9-a2e8-d779fe3a8e19" /> Reference (PS2 4:3 in OpenGoal): <img width="1281" height="762" alt="load-screen-4x3" src="https://github.com/user-attachments/assets/e4e320c9-999a-44a7-8b3e-34cfdbeef5a1" /> After Fixes: - Now headers that exceed the width of the menu screen will be shrunken down to fit. This will hopefully work for any other menus that need it as well 😃 - No more red rectangle on the right, and the yellow box to the left around the save games scales properly. <img width="1286" height="754" alt="load-fixed-automatic" src="https://github.com/user-attachments/assets/1a48d811-5684-4f7e-a12a-19e896e30b48" /> <img width="1288" height="749" alt="load-fixed-4x1" src="https://github.com/user-attachments/assets/f5a68cb1-576a-4927-977b-b3419aaf7c23" /> ### Missions menu Before: - Mission text is sometimes cut off on the right - Mission text is shifted to the right (more noticeable in 4x1) <img width="1286" height="753" alt="missions-alignment-broken-16x9" src="https://github.com/user-attachments/assets/37175eb7-e191-4c09-bb72-b40819acd99b" /> <img width="1281" height="750" alt="missions-alignment-broken-16x9-2" src="https://github.com/user-attachments/assets/482f351a-7386-4211-8434-cf60c0691fdb" /> <img width="1286" height="756" alt="missions-broken-4x1" src="https://github.com/user-attachments/assets/4cbfa4d0-999b-4265-bed0-957958663037" /> <img width="1290" height="750" alt="missions-broken-4x1-2" src="https://github.com/user-attachments/assets/4889b498-d6aa-4e6c-87fc-4dfadeac5827" /> Reference (PS2 4:3 in OpenGoal): <img width="1284" height="768" alt="missions-reference-1" src="https://github.com/user-attachments/assets/91a526c8-08c2-4a62-8219-09e967fab9c2" /> <img width="1276" height="755" alt="missions-reference-2" src="https://github.com/user-attachments/assets/65c4e944-5b1f-479a-bf7c-eca19c81f5d6" /> After: <img width="1281" height="760" alt="missions-fixed-16x9" src="https://github.com/user-attachments/assets/a972daf0-1872-46f0-a829-cd8d292df1d6" /> <img width="1282" height="750" alt="missions-fixed-16x9-2" src="https://github.com/user-attachments/assets/973611d6-a72c-43f8-b2f3-034e83f6c416" /> <img width="1289" height="760" alt="missions-alignment-fixed-4x1" src="https://github.com/user-attachments/assets/699c5dbc-8c39-468d-9e14-94007a789e48" /> <img width="1281" height="755" alt="missions-alignment-fixed-4x1-2" src="https://github.com/user-attachments/assets/89216187-d453-4d3e-8e8b-5ae365e7227d" /> ### Jak 2 ### Secrets menu orb icon Position was wrong in Automatic and some (but strangely, not all) Custom Aspect ratios. A correction for the aspect ratio was also being applied in the setter. Before: <img width="1284" height="755" alt="image" src="https://github.com/user-attachments/assets/0a15e238-1d98-4ba7-86ce-b295e8d78d7a" /> After: <img width="1283" height="755" alt="image" src="https://github.com/user-attachments/assets/bd97de44-ef41-426c-a76f-d4fe99a35285" /> ### Missions menu - Indentation was not working, even in 4:3, due to a typo. - Width was broken in Automatic and Custom Before: <img width="1281" height="753" alt="Screenshot from 2026-08-19 01-05-54" src="https://github.com/user-attachments/assets/6f5e3cc4-3522-45a5-a45b-34a46a7db544" /> After: <img width="1287" height="761" alt="image" src="https://github.com/user-attachments/assets/cae5498b-6ca4-40ab-a31c-feb8899bc1e7" />
2732 lines
127 KiB
Common Lisp
2732 lines
127 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 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) (font-ctx 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! (-> font-ctx alpha) sv-16)
|
|
(cond
|
|
((not (loaded? *bigmap*))
|
|
(progress-method-51 arg0 font-ctx)
|
|
)
|
|
(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 (* (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 (adjust-x-if-needed (+ 10.0 (-> 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! (-> font-ctx height) 28.0)
|
|
(set-flags! font-ctx (font-flags kerning large))
|
|
(let ((f28-0 0.45))
|
|
(set-color! font-ctx (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! font-ctx f28-0)
|
|
(set! (-> font-ctx origin x) (+ (adjust-x-if-needed (+ (-> s3-0 x) 10.0)) f30-0))
|
|
(set! (-> font-ctx origin y) (+ (-> s3-0 y) (* 0.5 (- 28.0 (* 32.0 f28-0)))))
|
|
)
|
|
)
|
|
(print-game-text *temp-string* font-ctx #f 44 (bucket-id hud-draw-hud-alpha))
|
|
(set-flags! font-ctx (font-flags kerning right large))
|
|
(set! (-> font-ctx origin x) (adjust-x-if-needed (- (-> s3-0 z) 10.0)))
|
|
)
|
|
;; This code draws the line in the secrets menu indicating the number of orbs obtained so far out of the total 600 in-game.
|
|
(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* font-ctx #f 44 (bucket-id hud-draw-hud-alpha))
|
|
(progress-method-34 arg0)
|
|
)
|
|
)
|
|
(set-scale! font-ctx 0.42)
|
|
(cond
|
|
((-> this available-title)
|
|
(progress-method-33 arg0 (-> *progress-work* body-footer))
|
|
(progress-method-53 arg0 font-ctx)
|
|
(set-color! font-ctx (font-color font-color-32))
|
|
(set-flags! font-ctx (font-flags kerning middle middle-vert large))
|
|
(string-format (lookup-text! *common-text* (text-id text-0080) #f))
|
|
(print-game-text *temp-string* font-ctx #f 44 (bucket-id hud-draw-hud-alpha))
|
|
(progress-method-34 arg0)
|
|
(progress-method-33 arg0 (-> *progress-work* footer))
|
|
(set-flags! font-ctx (font-flags kerning middle large))
|
|
(adjust-font-origin-y arg0 font-ctx 0.1)
|
|
(set-color! font-ctx (font-color font-color-33))
|
|
(let ((f0-16 (print-game-text
|
|
(lookup-text! *common-text* (text-id progress-continue) #f)
|
|
font-ctx
|
|
#f
|
|
32
|
|
(bucket-id hud-draw-hud-alpha)
|
|
)
|
|
)
|
|
)
|
|
(draw-highlight-bar arg0 font-ctx (the int (+ -2.0 (-> font-ctx origin y))) (the int (+ 4.0 f0-16)) (-> font-ctx alpha))
|
|
)
|
|
(progress-method-34 arg0)
|
|
)
|
|
((-> this buy-menu)
|
|
(progress-method-33 arg0 (-> *progress-work* body))
|
|
(adjust-font-origin-y arg0 font-ctx 0.45)
|
|
(progress-method-50
|
|
arg0
|
|
font-ctx
|
|
(-> *menu-secrets-array* (-> this selected-index) name)
|
|
(text-id progress-secrets-buy)
|
|
(text-id progress-secrets-cancel)
|
|
#t
|
|
#t
|
|
0.65
|
|
)
|
|
(draw-header arg0 font-ctx 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))
|
|
(secret-menu-height (- (-> s3-3 w) (-> s3-3 y)))
|
|
(f30-1 (* 24.0 (-> *video-params* relative-x-scale) (-> font-ctx scale)))
|
|
(secret-menu-width (- (- (-> s3-3 z) (-> s3-3 x)) 10.0))
|
|
)
|
|
(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* ((string-width (-> (get-string-length *temp-string* font-ctx) length))
|
|
(secret-text-width (- secret-menu-width 20.0))
|
|
)
|
|
(when (not (-> *pc-settings* use-vis?))
|
|
(*! secret-text-width (-> *pc-settings* aspect-ratio-reciprocal))
|
|
(set! (-> font-ctx origin x) (the float (adjust-game-x (+ 6.0 (-> s3-3 x)))))
|
|
)
|
|
(-! secret-text-width (+ string-width (* f30-1 2.0)))
|
|
(set-flags! font-ctx (font-flags kerning large))
|
|
(set-width! font-ctx (the int secret-text-width))
|
|
(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* font-ctx #t 40 (bucket-id hud-draw-hud-alpha))))
|
|
(let ((f0-33 4.0)
|
|
(f1-25 (-> this current-index))
|
|
)
|
|
(set! (-> font-ctx origin y)
|
|
(+ (- f0-33 (* f24-0 (- f1-25 (* (the float (the int (/ f1-25 1.0))) 1.0)))) (-> s3-3 y))
|
|
)
|
|
)
|
|
(set! (-> font-ctx height) secret-menu-height)
|
|
;; Continues printing lines in the secret menu while the font-context's origin is within the limits of the menu,
|
|
;; And the index counter s1-5 still refers to a secret index that actually exists in the array.
|
|
(while (and (< (-> font-ctx 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! (-> font-ctx origin x) (adjust-x-if-needed (+ 10.0 (-> s3-3 x))))
|
|
(set-width! font-ctx (the int secret-menu-width))
|
|
(set-color! font-ctx (font-color font-color-34))
|
|
(set-flags! font-ctx (font-flags kerning large))
|
|
(let ((f22-1 (-> font-ctx origin y)))
|
|
(string-format "~S" sv-240)
|
|
(set! (-> font-ctx origin y) (+ f22-1 (print-game-text *temp-string* font-ctx #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! (-> font-ctx origin x) (+ (adjust-x-if-needed (+ (-> s3-3 x) 10.0)) f30-1))
|
|
(set-width! font-ctx (the int secret-text-width))
|
|
(let ((v1-148 sv-288))
|
|
(cond
|
|
((or (= v1-148 4) (= v1-148 3))
|
|
(set-flags! font-ctx (font-flags kerning large ff7))
|
|
(set-color! font-ctx (font-color font-color-44))
|
|
)
|
|
((zero? v1-148)
|
|
(set-flags! font-ctx (font-flags kerning large))
|
|
(set-color! font-ctx (font-color font-color-34))
|
|
)
|
|
(else
|
|
(set-flags! font-ctx (font-flags kerning large))
|
|
(set-color! font-ctx (font-color font-color-32))
|
|
)
|
|
)
|
|
)
|
|
(let ((f22-2 (-> font-ctx origin y)))
|
|
(string-format "~S" sv-240) ;;Formatting secret text before printing it onscreen.
|
|
(let ((f20-0 (print-game-text *temp-string* font-ctx #f 40 (bucket-id hud-draw-hud-alpha))))
|
|
(when (not (logtest? (-> *menu-secrets-array* s1-5 flags) (secret-item-option-flags sf0)))
|
|
(set! (-> font-ctx origin x) (adjust-x-if-needed (+ (-> s3-3 x) secret-menu-width)))
|
|
(set-flags! font-ctx (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* font-ctx #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* font-ctx #f 40 (bucket-id hud-draw-hud-alpha))
|
|
)
|
|
(else
|
|
(string-format "~S" sv-352)
|
|
(print-game-text *temp-string* font-ctx #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* font-ctx #f 40 (bucket-id hud-draw-hud-alpha))
|
|
)
|
|
(else
|
|
(string-format "~S" sv-368)
|
|
(print-game-text *temp-string* font-ctx #f 40 (bucket-id hud-draw-hud-alpha))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(+! (-> font-ctx origin y) f20-0)
|
|
(if (= s1-5 (-> this selected-index))
|
|
(draw-highlight-bar arg0 font-ctx (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 font-ctx 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
|
|
font-ctx
|
|
(!= (-> 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) (font-ctx 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! (-> font-ctx 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! font-ctx (font-flags kerning large))
|
|
(set-scale! font-ctx 0.5)
|
|
(string-format "~S" (lookup-text! *common-text* (text-id progress-missions-complete-icon) #f))
|
|
(let ((mission-circle-icon-width (-> (get-string-length *temp-string* font-ctx) length)))
|
|
(set-width! font-ctx (the int (- (-> s3-0 z) (-> s3-0 x) 24.0 ) ) )
|
|
(when (not (-> *pc-settings* use-vis?))
|
|
(set-width! font-ctx (- (the int (* (-> font-ctx width) (-> *pc-settings* aspect-ratio-reciprocal) ) ) 8 ) )
|
|
)
|
|
(set-width! font-ctx (the int (- (-> font-ctx width) mission-circle-icon-width)))
|
|
(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* font-ctx #t 44 (bucket-id hud-draw-hud-alpha)))
|
|
(text-start-x (adjust-x-if-needed (+ 10.0 (-> s3-0 x))))
|
|
)
|
|
(let* ((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! (-> font-ctx origin x) text-start-x)
|
|
(set! (-> font-ctx origin y) f1-8)
|
|
)
|
|
(set! (-> font-ctx height) sv-188)
|
|
(while (and (< (-> font-ctx 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! (-> font-ctx origin x) text-start-x)
|
|
(cond
|
|
((or (= sv-288 (text-id progress-missions-todo)) (= sv-288 (text-id progress-missions-completed)))
|
|
(set! (-> font-ctx 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* font-ctx #f 44 (bucket-id hud-draw-hud-alpha))
|
|
(set-color! font-ctx (font-color font-color-32))
|
|
(set! (-> font-ctx origin x) (+ mission-circle-icon-width (adjust-x-if-needed (+ 14.0 (-> s3-0 x)))))
|
|
)
|
|
)
|
|
(let ((f26-0 (-> font-ctx origin y)))
|
|
(string-format "~S" (lookup-text! *common-text* sv-288 #f))
|
|
(set! (-> font-ctx origin y) (+ f26-0 (print-game-text *temp-string* font-ctx #f 44 (bucket-id hud-draw-hud-alpha))))
|
|
)
|
|
(1+! s1-2)
|
|
)
|
|
(set! (-> this on-screen) (< (-> font-ctx 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 font-ctx 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 font-ctx
|
|
(!= (-> 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) (font-ctx font-context) (arg1 float) (header-text-id text-id))
|
|
(progress-method-33 this (-> *progress-work* header))
|
|
(let* ((s3-0 (get-scissor-stack-top this))
|
|
(header-text (lookup-text! *common-text* header-text-id #f))
|
|
(header-area-width (+ (- -20.0 (-> s3-0 x)) (-> s3-0 z)))
|
|
(header-text-width (-> (get-string-length header-text font-ctx) length))
|
|
)
|
|
(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! font-ctx (font-flags kerning middle large))
|
|
(set-color! font-ctx (font-color font-color-32))
|
|
(set! (-> font-ctx origin x) (+ 10.0 (-> s3-0 x)))
|
|
(set! (-> font-ctx origin y) (-> s3-0 y))
|
|
(when (not (-> *pc-settings* use-vis?))
|
|
(*! header-area-width (-> *pc-settings* aspect-ratio-reciprocal))
|
|
(set! (-> font-ctx origin x) (the float (adjust-game-x (-> font-ctx origin x))))
|
|
)
|
|
(progress-method-45
|
|
this
|
|
font-ctx
|
|
header-area-width
|
|
45.0
|
|
header-text
|
|
(if (not (-> *pc-settings* use-vis?)) (* 0.75 (if (< header-area-width header-text-width)
|
|
(/ header-area-width header-text-width )
|
|
1.0
|
|
)) 0.95)
|
|
0.1
|
|
32
|
|
)
|
|
)
|
|
(progress-method-34 this)
|
|
0
|
|
)
|
|
|
|
(defmethod draw-option ((this menu-memcard-slot-option) (arg0 progress) (font-ctx 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 font-ctx)
|
|
)
|
|
(else
|
|
(set! (-> font-ctx alpha) f30-0)
|
|
(set-scale! font-ctx 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! (-> font-ctx origin x) (adjust-x-if-needed (+ 10.0 (-> s3-1 x))))
|
|
(set! (-> font-ctx origin y) (+ f26-0 (* 0.5 (- f0-4 (* 32.0 (-> font-ctx scale))))))
|
|
(set! (-> font-ctx height) f0-4)
|
|
(set-flags! font-ctx (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 progress-saved-game) #f) (1+ arg2))
|
|
(print-game-text *temp-string* font-ctx #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) font-ctx #f 44 (bucket-id hud-draw-hud-alpha))
|
|
)
|
|
)
|
|
(when (= arg2 (-> arg0 option-index))
|
|
(set-scale! font-ctx 0.8)
|
|
(with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id tex-hud-hud-alpha))
|
|
(let ((box-start (adjust-x-if-needed (-> s3-1 x)))
|
|
(box-end (adjust-x-if-needed (+ (-> 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) box-start)
|
|
(set! (-> s0-0 box max x) box-end)
|
|
)
|
|
(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! font-ctx 0.6)
|
|
(set-color! font-ctx (font-color font-color-32))
|
|
(adjust-font-origin-y arg0 font-ctx 0.675)
|
|
(set-flags! font-ctx (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! (-> font-ctx 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* font-ctx #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 (-> font-ctx origin y))
|
|
0.65
|
|
0.65
|
|
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
|
|
f30-0
|
|
)
|
|
(set! (-> font-ctx 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* font-ctx #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 (-> font-ctx origin y))
|
|
0.7
|
|
0.7
|
|
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
|
|
f30-0
|
|
)
|
|
(adjust-font-origin-y arg0 font-ctx 0.83)
|
|
(set! (-> font-ctx 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* font-ctx #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 (-> font-ctx origin y)))
|
|
0.7
|
|
0.7
|
|
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
|
|
f30-0
|
|
)
|
|
(set! (-> font-ctx origin x) (adjust-x-if-needed (- (-> s3-1 z) 10.0)))
|
|
(string-format "~D" (the int (-> s2-0 file arg2 gem-count)))
|
|
(print-game-text *temp-string* font-ctx #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 (-> font-ctx 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! font-ctx (font-flags kerning middle large))
|
|
(set-width! font-ctx (the int (* 0.6 (- (-> s3-1 z) (-> s3-1 x)))))
|
|
(set! (-> font-ctx origin x) (+ (-> s3-1 x) (* 0.4 (- (-> s3-1 z) (-> s3-1 x)))))
|
|
(when (not (-> *pc-settings* use-vis?))
|
|
(set-width! font-ctx (the int (* (-> font-ctx width) (-> *pc-settings* aspect-ratio-reciprocal))))
|
|
(set! (-> font-ctx origin x) (the float (adjust-game-x (-> font-ctx origin x))))
|
|
)
|
|
(set! (-> font-ctx origin y) (+ 8.0 (-> s3-1 y)))
|
|
(string-format "~S" (lookup-text! *common-text* (text-id progress-secrets-hero-mode) #f))
|
|
(print-game-text *temp-string* font-ctx #f 44 (bucket-id hud-draw-hud-alpha))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(progress-method-34 arg0)
|
|
;;Here are where the menu-headers are drawn
|
|
(when (zero? arg2)
|
|
(case (-> arg0 current)
|
|
(('select-load)
|
|
(draw-header arg0 font-ctx f30-0 (text-id progress-load-file-select))
|
|
)
|
|
(('select-save-hero)
|
|
(draw-header arg0 font-ctx f30-0 (text-id save-hero-mode-file))
|
|
)
|
|
(else
|
|
(draw-header arg0 font-ctx f30-0 (text-id progress-save-file-select))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
(defmethod draw-option ((this menu-save-sub-menu-option) (arg0 progress) (font-ctx 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! font-ctx width)
|
|
(set-flags! font-ctx (font-flags kerning large))
|
|
(set-scale! font-ctx 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) font-ctx #t 44 (bucket-id hud-draw-hud-alpha))
|
|
)
|
|
(f1-9 (+ 10.0 (-> s2-0 x)))
|
|
(f0-10 (+ f28-1 (* 0.5 (- f24-0 f0-7))))
|
|
)
|
|
(set! (-> font-ctx origin x) (adjust-x-if-needed f1-9))
|
|
(set! (-> font-ctx origin y) f0-10)
|
|
)
|
|
(set! (-> font-ctx height) f24-0)
|
|
(when (= arg2 (-> arg0 option-index))
|
|
(set-scale! font-ctx 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) font-ctx #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)
|
|
)
|
|
|
|
;; WARN: Return type mismatch int vs object.
|
|
(defmethod draw-button-text ((this progress) (font-ctx font-context) (display-text string))
|
|
(let ((f0-1 (- 1.0 (-> this menu-transition))))
|
|
(set-scale! font-ctx 0.5)
|
|
(set! (-> font-ctx alpha) f0-1)
|
|
)
|
|
(print-game-text display-text font-ctx #f 44 (bucket-id hud-draw-hud-alpha))
|
|
0
|
|
)
|
|
|
|
(defmethod progress-method-45 ((this progress)
|
|
(font-ctx font-context)
|
|
(text-area-width float)
|
|
(height-offset float)
|
|
(arg3 string)
|
|
(arg4 float)
|
|
(arg5 float)
|
|
(arg6 int)
|
|
)
|
|
(set-width! font-ctx 10000)
|
|
(set-scale! font-ctx arg4)
|
|
(string-format "~S" arg3)
|
|
(let ((temp-string-width (-> (get-string-length *temp-string* font-ctx) length)))
|
|
(set-width! font-ctx (the int text-area-width))
|
|
(cond
|
|
((< text-area-width temp-string-width)
|
|
(if (< (/ text-area-width temp-string-width) arg5)
|
|
(set-scale! font-ctx arg4)
|
|
(set-scale! font-ctx (/ (* text-area-width arg4) temp-string-width))
|
|
)
|
|
)
|
|
(else
|
|
(set-scale! font-ctx arg4)
|
|
)
|
|
)
|
|
)
|
|
(string-format "~S" arg3)
|
|
(let ((f30-0 (print-game-text *temp-string* font-ctx #t arg6 (bucket-id hud-draw-hud-alpha))))
|
|
(+! (-> font-ctx origin y) (* 0.5 (- height-offset f30-0)))
|
|
(let ((previous-origin-y (-> font-ctx origin y)))
|
|
(string-format "~S" arg3)
|
|
(print-game-text *temp-string* font-ctx #f arg6 (bucket-id hud-draw-hud-alpha))
|
|
(set! (-> font-ctx origin y) previous-origin-y)
|
|
)
|
|
f30-0
|
|
)
|
|
)
|
|
|
|
;; WARN: Return type mismatch int vs object.
|
|
(defmethod draw-yes-no-style-footer ((this progress) (font-ctx font-context) (yes-text-id text-id) (no-text-id text-id))
|
|
(string-format
|
|
(if (-> this yes-no-choice)
|
|
"~33L~S~44L ~S"
|
|
"~44L~S ~33L~S"
|
|
)
|
|
(lookup-text! *common-text* yes-text-id #f)
|
|
(lookup-text! *common-text* no-text-id #f)
|
|
)
|
|
(print-game-text *temp-string* font-ctx #f 44 (bucket-id hud-draw-hud-alpha))
|
|
0
|
|
)
|
|
|
|
;; ERROR: Stack slot load at 80 mismatch: defined as size 4, got size 16
|
|
;; ERROR: Stack slot load at 96 mismatch: defined as size 4, got size 16
|
|
;; ERROR: Stack slot load at 160 mismatch: defined as size 4, got size 16
|
|
;; ERROR: Stack slot load at 176 mismatch: defined as size 4, got size 16
|
|
;; ERROR: Stack slot load at 80 mismatch: defined as size 4, got size 16
|
|
;; ERROR: Stack slot load at 96 mismatch: defined as size 4, got size 16
|
|
;; ERROR: Stack slot load at 160 mismatch: defined as size 4, got size 16
|
|
;; ERROR: Stack slot load at 176 mismatch: defined as size 4, got size 16
|
|
;; ERROR: Stack slot load at 160 mismatch: defined as size 4, got size 16
|
|
;; ERROR: Stack slot load at 176 mismatch: defined as size 4, got size 16
|
|
;; ERROR: Stack slot load at 160 mismatch: defined as size 4, got size 16
|
|
;; ERROR: Stack slot load at 176 mismatch: defined as size 4, got size 16
|
|
;; ERROR: Stack slot load at 80 mismatch: defined as size 4, got size 16
|
|
;; ERROR: Stack slot load at 96 mismatch: defined as size 4, got size 16
|
|
;; ERROR: Stack slot load at 160 mismatch: defined as size 4, got size 16
|
|
;; ERROR: Stack slot load at 176 mismatch: defined as size 4, got size 16
|
|
;; ERROR: Stack slot load at 80 mismatch: defined as size 4, got size 16
|
|
;; ERROR: Stack slot load at 96 mismatch: defined as size 4, got size 16
|
|
;; ERROR: Stack slot load at 160 mismatch: defined as size 4, got size 16
|
|
;; ERROR: Stack slot load at 176 mismatch: defined as size 4, got size 16
|
|
;; ERROR: Stack slot load at 160 mismatch: defined as size 4, got size 16
|
|
;; ERROR: Stack slot load at 176 mismatch: defined as size 4, got size 16
|
|
;; WARN: Return type mismatch int vs object.
|
|
;; two-choice-prompt
|
|
(defmethod progress-method-50 ((this progress)
|
|
(font-ctx font-context)
|
|
(title-text-id text-id)
|
|
(option1-text-id text-id)
|
|
(option2-text-id text-id)
|
|
(arg4 symbol)
|
|
(arg5 symbol)
|
|
(arg6 float)
|
|
)
|
|
(let ((sv-16 (fmax 0.0 (* 2.0 (- 0.5 (-> this menu-transition)))))
|
|
(sv-20 (the-as string #f))
|
|
(sv-24 (get-scissor-stack-top this))
|
|
(option1-text (lookup-text! *common-text* option1-text-id #f))
|
|
(option2-text (lookup-text! *common-text* option2-text-id #f))
|
|
)
|
|
(set! (-> font-ctx alpha) sv-16)
|
|
(set! (-> font-ctx flags) (font-flags kerning middle large))
|
|
(let ((f30-0 0.0)
|
|
(text-height-offset (the-as float 24.5))
|
|
(text-area-width (+ (- -20.0 (-> sv-24 x)) (-> sv-24 z)))
|
|
(title-text (the-as string (lookup-text! *common-text* title-text-id #f)))
|
|
)
|
|
(set! (-> font-ctx origin x) (+ 10.0 (-> sv-24 x)))
|
|
(when (not (-> *pc-settings* use-vis?))
|
|
(*! text-area-width (-> *pc-settings* aspect-ratio-reciprocal))
|
|
(set! (-> font-ctx origin x) (the float (adjust-game-x (-> font-ctx origin x))))
|
|
)
|
|
(set! sv-20
|
|
(cond
|
|
(arg5
|
|
(set! (-> font-ctx color) (font-color font-color-32))
|
|
(let ((f28-0 (progress-method-45
|
|
this
|
|
font-ctx
|
|
text-area-width
|
|
text-height-offset
|
|
title-text
|
|
arg6
|
|
0.75
|
|
35
|
|
)
|
|
)
|
|
)
|
|
(set! f30-0 (/ f28-0 2))
|
|
(set-scale! font-ctx (/ (-> font-ctx scale) 2))
|
|
(draw-highlight-bar this font-ctx (the int (+ -1.0 (-> font-ctx origin y))) (the int (+ 2.0 f28-0)) sv-16)
|
|
(+! (-> font-ctx origin y) f28-0)
|
|
)
|
|
(string-format
|
|
(if (-> this yes-no-choice)
|
|
"~33L~S ~44L~S"
|
|
"~44L~S~33L ~S"
|
|
)
|
|
option1-text
|
|
option2-text
|
|
)
|
|
*temp-string*
|
|
)
|
|
(else
|
|
(set! (-> font-ctx color)
|
|
(if arg4
|
|
(font-color font-color-33)
|
|
(font-color font-color-32)
|
|
)
|
|
)
|
|
(let ((f28-1 (progress-method-45
|
|
this
|
|
font-ctx
|
|
text-area-width
|
|
text-height-offset
|
|
title-text
|
|
arg6
|
|
0.75
|
|
35
|
|
)
|
|
)
|
|
)
|
|
(when arg4
|
|
(let* ((a2-12 (the int (+ -1.0 (-> font-ctx origin y))))
|
|
(a3-6 (the int (+ 1.0 f28-1)))
|
|
)
|
|
(draw-highlight-bar this font-ctx a2-12 a3-6 (the-as float sv-16))
|
|
)
|
|
)
|
|
(+! (-> font-ctx origin y) f28-1)
|
|
)
|
|
(string-format
|
|
(if (-> this yes-no-choice)
|
|
"~1L~S~44L ~S"
|
|
"~44L~S ~1L~S~1L"
|
|
)
|
|
option1-text
|
|
option2-text
|
|
title-text
|
|
)
|
|
*temp-string*
|
|
)
|
|
)
|
|
)
|
|
(draw-button-text this font-ctx sv-20)
|
|
(+! (-> font-ctx origin y) f30-0)
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
;; WARN: Return type mismatch int vs object.
|
|
(defmethod progress-method-51 ((this progress) (font-ctx font-context))
|
|
(let ((v1-1 (get-scissor-stack-top this)))
|
|
(let ((f1-1 (+ (-> v1-1 y) (* 0.5 (- (-> v1-1 w) (-> v1-1 y))))))
|
|
(set! (-> font-ctx origin x) (-> v1-1 x))
|
|
(set! (-> font-ctx origin y) f1-1)
|
|
)
|
|
(set! (-> font-ctx width) (- (-> v1-1 z) (-> v1-1 x)))
|
|
)
|
|
(set-scale! font-ctx 0.6)
|
|
(set! (-> font-ctx flags) (font-flags kerning middle large))
|
|
(if (< (mod (current-time) 300) 210)
|
|
(print-game-text
|
|
(lookup-text! *common-text* (text-id progress-memcard-loading) #f)
|
|
font-ctx
|
|
#f
|
|
44
|
|
(bucket-id hud-draw-hud-alpha)
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod draw-option ((this menu-picture-slider-option) (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)
|
|
(progress-method-33 arg0 (-> *progress-work* body))
|
|
(cond
|
|
((not (loaded? *bigmap*))
|
|
(progress-method-51 arg0 arg1)
|
|
)
|
|
(else
|
|
(let ((f28-0 (-> (the-as (pointer float) (&+ (the-as pointer *setting-control*) (-> this setting-offset))))))
|
|
(draw-slider-option
|
|
arg0
|
|
arg1
|
|
(lookup-text! *common-text* (-> this name) #f)
|
|
f30-0
|
|
(-> this offset-y)
|
|
0.9
|
|
f28-0
|
|
(the-as float #f)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(when (zero? arg2)
|
|
(let ((s4-1 (get-scissor-stack-top arg0)))
|
|
(draw-header arg0 arg1 f30-0 (text-id progress-picture-options))
|
|
(draw-icon-array!
|
|
(-> *progress-icon-arrays* 75)
|
|
256
|
|
(the int (+ (-> s4-1 y) (* 0.75 (- (-> s4-1 w) (-> s4-1 y)))))
|
|
(if (not (-> *pc-settings* use-vis?))
|
|
(* (-> *video-params* relative-x-scale-reciprical) (-> *pc-settings* aspect-ratio-reciprocal))
|
|
(-> *video-params* relative-x-scale-reciprical)
|
|
)
|
|
10.0
|
|
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
|
|
f30-0
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(progress-method-34 arg0)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
|
|
(defmethod draw-option ((this menu-hero-mode-message-option) (arg0 progress) (font-ctx font-context) (arg2 int) (arg3 symbol))
|
|
(let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))
|
|
(s4-0 *progress-work*)
|
|
)
|
|
(progress-method-33 arg0 (-> s4-0 body-footer))
|
|
(progress-method-53 arg0 font-ctx)
|
|
(set! (-> font-ctx alpha) f30-0)
|
|
(set-scale! font-ctx 0.5)
|
|
(set! (-> font-ctx color) (font-color font-color-32))
|
|
(set! (-> font-ctx flags) (font-flags kerning middle middle-vert large))
|
|
(when (not (-> *pc-settings* use-vis?))
|
|
(set! (-> font-ctx origin x) (the float (adjust-game-x (-> font-ctx origin x))))
|
|
(set-width! font-ctx (the int (* (-> font-ctx width) (-> *pc-settings* aspect-ratio-reciprocal))))
|
|
)
|
|
(string-format (lookup-text! *common-text* (text-id hero-mode-how-to) #f) (the-as none #f))
|
|
(print-game-text *temp-string* font-ctx #f 44 (bucket-id hud-draw-hud-alpha))
|
|
(progress-method-34 arg0)
|
|
(progress-method-33 arg0 (-> s4-0 footer))
|
|
)
|
|
(progress-method-53 arg0 font-ctx)
|
|
(set! (-> font-ctx color) (font-color font-color-33))
|
|
(adjust-font-origin-y arg0 font-ctx 0.1)
|
|
(draw-highlight-bar arg0 font-ctx (the int (-> font-ctx origin y)) 18 (-> font-ctx alpha))
|
|
(print-game-text
|
|
(lookup-text! *common-text* (text-id progress-continue) #f)
|
|
font-ctx
|
|
#f
|
|
44
|
|
(bucket-id hud-draw-hud-alpha)
|
|
)
|
|
(progress-method-34 arg0)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
(defmethod draw-option ((this menu-already-exists-option) (arg0 progress) (font-ctx font-context) (arg2 int) (arg3 symbol))
|
|
(set! (-> font-ctx alpha) (- 1.0 (-> arg0 menu-transition)))
|
|
(set! (-> font-ctx color) (font-color font-color-32))
|
|
(set-scale! font-ctx 0.5)
|
|
(set! (-> font-ctx flags) (font-flags kerning middle middle-vert large))
|
|
(set! (-> font-ctx origin x) 80.0)
|
|
(set! (-> font-ctx origin y) 120.0)
|
|
(set-width! font-ctx 360)
|
|
(set-height! font-ctx 85)
|
|
(when (not (-> *pc-settings* use-vis?))
|
|
(set! (-> font-ctx origin x) (the float (adjust-game-x (-> font-ctx origin x))))
|
|
(set-width! font-ctx (the int (* (-> font-ctx width) (-> *pc-settings* aspect-ratio-reciprocal))))
|
|
)
|
|
(print-game-text
|
|
(lookup-text! *common-text* (text-id progress-memcard-overwrite-warning) #f)
|
|
font-ctx
|
|
#f
|
|
44
|
|
(bucket-id hud-draw-hud-alpha)
|
|
)
|
|
(+! (-> font-ctx origin y) 105.0)
|
|
(set-height! font-ctx 45)
|
|
(print-game-text
|
|
(lookup-text! *common-text* (text-id progress-memcard-overwrite-confirm?) #f)
|
|
font-ctx
|
|
#f
|
|
44
|
|
(bucket-id hud-draw-hud-alpha)
|
|
)
|
|
(+! (-> font-ctx origin y) 45.0)
|
|
(draw-highlight-bar arg0 font-ctx (the int (+ 8.0 (-> font-ctx origin y))) 24 (-> font-ctx alpha))
|
|
(draw-yes-no-style-footer arg0 font-ctx (text-id progress-yes) (text-id progress-no))
|
|
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))))))
|