mirror of
https://github.com/open-goal/jak-project
synced 2026-08-06 09:54:10 -04:00
1163 lines
65 KiB
Common Lisp
1163 lines
65 KiB
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
(bundles "ENGINE.CGO" "GAME.CGO")
|
|
(require "engine/ui/progress/progress-static.gc")
|
|
(require "engine/game/main.gc")
|
|
(require "engine/ui/hud-classes.gc")
|
|
|
|
;; DECOMP BEGINS
|
|
|
|
(defun adjust-pos ((value int) (threshold int))
|
|
"Return the amount by which value exceeds threshold, clamped to zero. Progress-screen elements
|
|
use successive thresholds to stagger a shared transition."
|
|
(if (< value threshold) 0 (- value threshold)))
|
|
|
|
(defmethod draw-fuel-cell-screen ((this progress) (level-index int))
|
|
"Draw the power-cell task screen for level-index. Arrange one task egg per level task,
|
|
mark its current task state, rotate the four power-cell models, and print the selected
|
|
task name and completion label."
|
|
(hide-progress-icons)
|
|
(let ((level-record (-> *level-task-data* level-index)))
|
|
(if (and (= *cheat-mode* 'debug) (cpad-hold? 0 l3)) (format *stdcon* "fcd:~d~%" (-> *game-info* fuel-cell-deaths)))
|
|
(set! (-> *progress-process* 0 particles 14 init-pos x) -320.0)
|
|
(set! (-> *progress-process* 0 particles 15 init-pos x) -320.0)
|
|
(set! (-> *progress-process* 0 icons 4 icon-x) -320)
|
|
(when (and (!= level-record #f) (= (-> *game-info* level-opened level-index) 1))
|
|
(let ((task-start-x (- (-> *task-egg-starting-x* (-> level-record nb-of-tasks)) (-> this left-x-offset)))
|
|
(task-spacing (the int (* 47.0 (-> this transition-percentage-invert)))))
|
|
0
|
|
(let ((particle-index 6)
|
|
(horizontal-offset 0)
|
|
(vertical-offset (if (= (-> this level-transition) 1) (- (-> this transition-offset)) (-> this transition-offset)))
|
|
(opacity (-> this transition-percentage-invert))
|
|
(selected-text-index 0)
|
|
(selected-task-complete? #f))
|
|
(when (-> this stat-transition)
|
|
(set! task-spacing 47)
|
|
(set! horizontal-offset
|
|
(if (!= (-> this display-state) (-> this next-display-state)) (- (-> this transition-offset)) (-> this transition-offset)))
|
|
(set! vertical-offset 0)
|
|
(set! opacity 1.0))
|
|
(let ((icon-index 0))
|
|
(while (< icon-index 4)
|
|
(let ((icon-root (-> this icons icon-index icon 0 root)))
|
|
(set-yaw-angle-clear-roll-pitch! icon-root (+ (y-angle icon-root) (* 182.04445 (/ (-> *display* time-adjust-ratio) 2)))))
|
|
(+! icon-index 1)))
|
|
(let ((task-x (+ task-start-x (/ (- (* 47 (-> level-record nb-of-tasks)) (* task-spacing (-> level-record nb-of-tasks))) 2)))
|
|
(task-index 0))
|
|
(while (< task-index (-> level-record nb-of-tasks))
|
|
(let ((status (get-task-status (-> level-record task-info task-index task-id)))
|
|
(text-index -1)
|
|
(complete? #f))
|
|
(set! (-> this particle-state particle-index) 2)
|
|
(cond
|
|
((or (= status (task-status need-hint)) (= status (task-status unknown)))
|
|
(if (= *kernel-boot-message* 'play) (set! (-> this particle-state particle-index) 1)))
|
|
((= status (task-status invalid))
|
|
(set! text-index (-> level-record task-info task-index text-index-when-resolved))
|
|
(set! (-> this particle-state particle-index) 3)
|
|
(set! complete? #t))
|
|
((= status (task-status need-introduction)) (set! text-index 0))
|
|
((= status (task-status need-reminder-a)) (set! text-index 0))
|
|
((= status (task-status need-reminder)) (set! text-index 1))
|
|
((= status (task-status need-reward-speech)) (set! text-index 2))
|
|
((= status (task-status need-resolution)) (set! text-index 2)))
|
|
(if (and (!= *kernel-boot-message* 'play) (= text-index -1)) (set! text-index 0))
|
|
(set! (-> this particles particle-index init-pos x) (the float (+ task-x horizontal-offset)))
|
|
(set! (-> this particles particle-index init-pos y) (the float (+ vertical-offset 204)))
|
|
(+! particle-index 1)
|
|
(when (= task-index (-> this task-index))
|
|
(set! selected-text-index text-index)
|
|
(set! selected-task-complete? complete?)
|
|
(set! (-> this particles 5 init-pos x) (the float (+ task-x horizontal-offset)))
|
|
(set! (-> this particles 5 init-pos y) (the float (+ vertical-offset 204)))))
|
|
(+! task-x task-spacing)
|
|
(+! task-index 1)))
|
|
(dotimes (unused-slot-index (- 8 (-> level-record nb-of-tasks)))
|
|
(set! (-> *progress-process* 0 particles particle-index init-pos x) (the float (+ horizontal-offset -320)))
|
|
(set! (-> this particles particle-index init-pos y) (the float (+ vertical-offset 194)))
|
|
(+! particle-index 1))
|
|
(when *common-text*
|
|
(when (and (!= selected-text-index -1)
|
|
(> (-> level-record nb-of-tasks) 0)
|
|
(>= (-> this task-index) 0)
|
|
(< (-> this task-index) (-> level-record nb-of-tasks)))
|
|
(let ((task-font (new 'stack
|
|
'font-context
|
|
*font-default-matrix*
|
|
(- (+ horizontal-offset 32) (-> this left-x-offset))
|
|
(+ (/ vertical-offset 2) 125)
|
|
8325000.0
|
|
(font-color progress-yellow)
|
|
(font-flags shadow kerning))))
|
|
(set-width! task-font 328)
|
|
(set-height! task-font 50)
|
|
(set-scale! task-font 0.7)
|
|
(set-flags! task-font (font-flags shadow kerning middle middle-vert large))
|
|
(print-game-text-scaled (lookup-text! *common-text* (-> level-record task-info (-> this task-index) task-name selected-text-index) #f)
|
|
opacity
|
|
task-font
|
|
(the int (* 128.0 opacity)))
|
|
(when selected-task-complete?
|
|
(set! (-> task-font origin x) (the float (- (+ horizontal-offset 32) (-> this left-x-offset))))
|
|
(set! (-> task-font origin y) (the float (+ (/ vertical-offset 2) 175)))
|
|
(set-color! task-font (font-color progress-blue))
|
|
(set-height! task-font 15)
|
|
(set-scale! task-font 0.5)
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id task-completed) #f)
|
|
opacity
|
|
task-font
|
|
(the int (* 128.0 opacity)))))))))))
|
|
0
|
|
(none))
|
|
|
|
(defmethod draw-money-screen ((this progress) (level-index int))
|
|
"Draw the precursor-orb totals for level-index. Position and rotate the large orb during
|
|
transitions, then print the level and whole-game collected counts."
|
|
(hide-progress-icons)
|
|
(let* ((icon-offset (/ (-> this transition-offset) 16))
|
|
(vertical-offset (if (= (-> this level-transition) 1) (- (-> this transition-offset)) (-> this transition-offset)))
|
|
(opacity (-> this transition-percentage-invert))
|
|
(text-offset (- icon-offset)))
|
|
(when (-> this stat-transition)
|
|
(set! icon-offset
|
|
(if (!= (-> this display-state) (-> this next-display-state)) (- (-> this transition-offset)) (-> this transition-offset)))
|
|
(set! text-offset icon-offset)
|
|
(set! vertical-offset 0)
|
|
(set! opacity 1.0))
|
|
(set! (-> this particles 15 init-pos x) (the float (- (+ icon-offset 150) (-> this left-x-offset))))
|
|
(set! (-> this particles 15 init-pos y) (the float (+ vertical-offset 214)))
|
|
(set! (-> this icons 4 icon-x) (- (+ icon-offset 148) (-> this left-x-offset)))
|
|
(set! (-> this icons 4 icon-y) (+ (-> this big-orb-y-offset) vertical-offset))
|
|
(let ((orb-root (-> this icons 4 icon 0 root)))
|
|
(set-yaw-angle-clear-roll-pitch! orb-root (- (y-angle orb-root) (* 182.04445 (* 4.0 (-> *display* time-adjust-ratio))))))
|
|
(let ((font (new 'stack
|
|
'font-context
|
|
*font-default-matrix*
|
|
(- (+ text-offset 200) (-> this left-x-offset))
|
|
(+ (/ vertical-offset 2) 96)
|
|
8325000.0
|
|
(font-color default)
|
|
(font-flags shadow kerning))))
|
|
(set-width! font 328)
|
|
(set-height! font 70)
|
|
(set-flags! font (font-flags shadow kerning large))
|
|
(let ((print-level-count print-game-text-scaled))
|
|
(format (clear *temp-string*)
|
|
"~D/~D"
|
|
(-> *game-info* money-per-level level-index)
|
|
(-> *game-counts* data level-index money-count))
|
|
(print-level-count *temp-string* opacity font (the int (* 128.0 opacity))))
|
|
(set-width! font 428)
|
|
(+! (-> font origin x) -220.0)
|
|
(+! (-> font origin y) 40.0)
|
|
(set-flags! font (font-flags shadow kerning middle large))
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id total-collected) #f)
|
|
(* 0.7 opacity)
|
|
font
|
|
(the int (* 128.0 opacity)))
|
|
(+! (-> font origin y) 15.0)
|
|
(let ((print-total-count print-game-text-scaled))
|
|
(format (clear *temp-string*) "~D/~D" (the int (-> *game-info* money-total)) (-> this total-nb-of-orbs))
|
|
(print-total-count *temp-string* opacity font (the int (* 128.0 opacity))))))
|
|
0
|
|
(none))
|
|
|
|
(defmethod draw-buzzer-screen ((this progress) (level-index int))
|
|
"Draw the scout-fly totals for level-index. Position the large icon during transitions,
|
|
derive the level count from its designated task, and print level and whole-game totals."
|
|
(hide-progress-icons)
|
|
(let* ((level-record (-> *level-task-data* level-index))
|
|
(icon-offset (/ (-> this transition-offset) 16))
|
|
(vertical-offset (if (= (-> this level-transition) 1) (- (-> this transition-offset)) (-> this transition-offset)))
|
|
(opacity (-> this transition-percentage-invert))
|
|
(text-offset (- icon-offset)))
|
|
(when (-> this stat-transition)
|
|
(set! icon-offset
|
|
(if (!= (-> this display-state) (-> this next-display-state)) (- (-> this transition-offset)) (-> this transition-offset)))
|
|
(set! text-offset icon-offset)
|
|
(set! vertical-offset 0)
|
|
(set! opacity 1.0))
|
|
(set! (-> this particles 14 init-pos x) (the float (- (+ icon-offset 150) (-> this left-x-offset))))
|
|
(set! (-> this particles 14 init-pos y) (the float (+ vertical-offset 214)))
|
|
(let ((level-count 0))
|
|
(let ((task-index (-> level-record buzzer-task-index)))
|
|
(if (!= task-index -1) (set! level-count (buzzer-count *game-info* (-> level-record task-info task-index task-id)))))
|
|
(let ((font (new 'stack
|
|
'font-context
|
|
*font-default-matrix*
|
|
(- (+ text-offset 200) (-> this left-x-offset))
|
|
(+ (/ vertical-offset 2) 96)
|
|
8325000.0
|
|
(font-color default)
|
|
(font-flags shadow kerning))))
|
|
(set-width! font 328)
|
|
(set-height! font 70)
|
|
(set-flags! font (font-flags shadow kerning large))
|
|
(let ((print-level-count print-game-text-scaled))
|
|
(format (clear *temp-string*) "~D/~D" level-count (-> *game-counts* data level-index buzzer-count))
|
|
(print-level-count *temp-string* opacity font (the int (* 128.0 opacity))))
|
|
(set-width! font 428)
|
|
(+! (-> font origin x) -220.0)
|
|
(+! (-> font origin y) 40.0)
|
|
(set-flags! font (font-flags shadow kerning middle large))
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id total-collected) #f)
|
|
(* 0.7 opacity)
|
|
font
|
|
(the int (* 128.0 opacity)))
|
|
(+! (-> font origin y) 15.0)
|
|
(let ((print-total-count print-game-text-scaled))
|
|
(format (clear *temp-string*) "~D/~D" (the int (-> *game-info* buzzer-total)) (-> this total-nb-of-buzzers))
|
|
(print-total-count *temp-string* opacity font (the int (* 128.0 opacity)))))))
|
|
0
|
|
(none))
|
|
|
|
(defmethod draw-memcard-storage-error ((this progress) (font font-context))
|
|
"Draw the not-formatted, no-space, or not-inserted memory-card message, including the
|
|
required-space details and continue prompt."
|
|
(set-scale! font 0.55)
|
|
(set-width! font 265)
|
|
(set-height! font 55)
|
|
(set-flags! font (font-flags shadow kerning middle middle-vert large))
|
|
(let ((title-id (text-id memcard-not-formatted-title)))
|
|
(case (-> this display-state)
|
|
(((progress-screen memcard-no-space)) (set! title-id (text-id memcard-no-space)))
|
|
(((progress-screen memcard-not-inserted)) (set! title-id (text-id memcard-not-inserted))))
|
|
(let ((print-title print-game-text-scaled))
|
|
(format (clear *temp-string*) (lookup-text! *common-text* title-id #f) 1)
|
|
(print-title *temp-string* (-> this transition-percentage-invert) font 128)))
|
|
(set! (-> font origin x) (the float (- 20 (-> this left-x-offset))))
|
|
(set! (-> font origin y) 70.0)
|
|
(set-width! font 350)
|
|
(set-height! font 40)
|
|
(let ((print-space-required print-game-text-scaled))
|
|
(format (clear *temp-string*)
|
|
(lookup-text! *common-text* (text-id memcard-space-requirement1) #f)
|
|
(if (-> this card-info) (-> this card-info mem-required) 0))
|
|
(print-space-required *temp-string* (-> this transition-percentage-invert) font 128))
|
|
(set! (-> font origin y) 115.0)
|
|
(set-height! font 60)
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id memcard-space-requirement2) #f)
|
|
(-> this transition-percentage-invert)
|
|
font
|
|
128)
|
|
(set-scale! font 0.65)
|
|
(set! (-> font origin y) 160.0)
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id continue?) #f)
|
|
(-> this transition-percentage-invert)
|
|
font
|
|
128)
|
|
0
|
|
(none))
|
|
|
|
(defmethod draw-memcard-format ((this progress) (font font-context))
|
|
"Explain that the memory card is unformatted and ask whether to format it."
|
|
(set! (-> font origin y) 35.0)
|
|
(set-scale! font 0.55)
|
|
(set-width! font 265)
|
|
(set-height! font 55)
|
|
(set-flags! font (font-flags shadow kerning middle middle-vert large))
|
|
(let ((print-title print-game-text-scaled))
|
|
(format (clear *temp-string*) (lookup-text! *common-text* (text-id memcard-not-formatted-title) #f) 1)
|
|
(print-title *temp-string* (-> this transition-percentage-invert) font 128))
|
|
(set! (-> font origin x) (the float (- 20 (-> this left-x-offset))))
|
|
(set! (-> font origin y) 105.0)
|
|
(set-width! font 360)
|
|
(set-height! font 40)
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id memcard-not-formatted-msg) #f)
|
|
(-> this transition-percentage-invert)
|
|
font
|
|
128)
|
|
(set-scale! font 0.65)
|
|
(set! (-> font origin y) 138.0)
|
|
(set-height! font 60)
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id format?) #f)
|
|
(-> this transition-percentage-invert)
|
|
font
|
|
128)
|
|
0
|
|
(none))
|
|
|
|
(defmethod draw-memcard-data-exists ((this progress) (font font-context))
|
|
"Draw the warning that the selected memory-card slot already contains save data and ask
|
|
whether it should be overwritten."
|
|
(set-scale! font 0.65)
|
|
(set-flags! font (font-flags shadow kerning middle middle-vert large))
|
|
(set! (-> font origin x) (the float (- 20 (-> this left-x-offset))))
|
|
(set! (-> font origin y) 55.0)
|
|
(set-width! font 365)
|
|
(set-height! font 75)
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id save-data-already-exists) #f)
|
|
(-> this transition-percentage-invert)
|
|
font
|
|
128)
|
|
(set! (-> font origin y) 140.0)
|
|
(set-width! font 360)
|
|
(set-height! font 40)
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id overwrite?) #f)
|
|
(-> this transition-percentage-invert)
|
|
font
|
|
128)
|
|
0
|
|
(none))
|
|
|
|
(defmethod draw-memcard-no-data ((this progress) (font font-context))
|
|
"Draw the notice that no save data exists and ask whether a new save should be created."
|
|
(set-scale! font 0.65)
|
|
(set-flags! font (font-flags shadow kerning middle middle-vert large))
|
|
(set! (-> font origin x) (the float (- 20 (-> this left-x-offset))))
|
|
(set! (-> font origin y) 40.0)
|
|
(set-width! font 365)
|
|
(set-height! font 75)
|
|
(let ((print-no-data print-game-text-scaled))
|
|
(format (clear *temp-string*) (lookup-text! *common-text* (text-id no-save-data) #f) 1)
|
|
(print-no-data *temp-string* (-> this transition-percentage-invert) font 128))
|
|
(set! (-> font origin y) 130.0)
|
|
(set-width! font 360)
|
|
(set-height! font 40)
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id create-save-data?) #f)
|
|
(-> this transition-percentage-invert)
|
|
font
|
|
128)
|
|
0
|
|
(none))
|
|
|
|
(defmethod draw-memcard-accessing ((this progress) (font font-context))
|
|
"Draw the blinking loading, saving, formatting, or creating status for the active
|
|
memory-card operation, followed by the do-not-remove warning."
|
|
(set-scale! font 1.0)
|
|
(set-flags! font (font-flags shadow kerning middle middle-vert large))
|
|
(set! (-> font origin x) (the float (- 20 (-> this left-x-offset))))
|
|
(set! (-> font origin y) 35.0)
|
|
(set-width! font 365)
|
|
(set-height! font 75)
|
|
(when (or (< (mod (-> *display* real-frame-counter) 300) 150) (!= (-> this transition-percentage-invert) 1.0))
|
|
(let ((status-text-id (text-id loading-data)))
|
|
(case (-> this display-state)
|
|
(((progress-screen memcard-saving)) (set! status-text-id (text-id saving-data)))
|
|
(((progress-screen memcard-formatting)) (set! status-text-id (text-id formatting)))
|
|
(((progress-screen memcard-creating)) (set! status-text-id (text-id creating-save-data))))
|
|
(print-game-text-scaled (lookup-text! *common-text* status-text-id #f) (-> this transition-percentage-invert) font 128)))
|
|
(set-scale! font 0.65)
|
|
(set-flags! font (font-flags shadow kerning middle middle-vert large))
|
|
(set! (-> font origin x) (the float (- 15 (-> this left-x-offset))))
|
|
(set! (-> font origin y) 100.0)
|
|
(set-width! font 370)
|
|
(set-height! font 75)
|
|
(let ((print-warning print-game-text-scaled))
|
|
(format (clear *temp-string*) (lookup-text! *common-text* (text-id memcard-do-not-remove) #f) 1)
|
|
(print-warning *temp-string* (-> this transition-percentage-invert) font 128))
|
|
0
|
|
(none))
|
|
|
|
(defmethod draw-memcard-insert ((this progress) (font font-context))
|
|
"Ask the player to insert a memory card or go back. The Japanese missing-card case adds a
|
|
separate not-inserted warning above the ordinary prompt."
|
|
(set-scale! font 0.65)
|
|
(set-flags! font (font-flags shadow kerning middle middle-vert large))
|
|
(set! (-> font origin x) (the float (- 50 (-> this left-x-offset))))
|
|
(set! (-> font origin y) 35.0)
|
|
(set-width! font 310)
|
|
(set-height! font 110)
|
|
;; og:preserve-this PAL patch here
|
|
(let ((card-info (-> this card-info)))
|
|
(when (and (= (-> *setting-control* default language) (language-enum japanese)) card-info (zero? (-> card-info handle)))
|
|
(set! (-> font origin y) -15.0)
|
|
(let ((print-prompt print-game-text-scaled))
|
|
(format (clear *temp-string*) (lookup-text! *common-text* (text-id memcard-not-inserted) #f) 1)
|
|
(print-prompt *temp-string* (-> this transition-percentage-invert) font 128))
|
|
(set! (-> font origin y) 53.0)))
|
|
(let ((print-prompt print-game-text-scaled))
|
|
(format (clear *temp-string*) (lookup-text! *common-text* (text-id insert-memcard) #f) 1)
|
|
(print-prompt *temp-string* (-> this transition-percentage-invert) font 128))
|
|
(set-scale! font 0.65)
|
|
(set! (-> font origin y) 130.0)
|
|
(set-height! font 60)
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id back?) #f) (-> this transition-percentage-invert) font 128)
|
|
0
|
|
(none))
|
|
|
|
(defmethod draw-memcard-file-select ((this progress) (font font-context))
|
|
"Draw four sliding memory-card file slots. Show each save's level and, while its details
|
|
are visible, its collectable totals, completion, and territory-formatted timestamp;
|
|
otherwise show an empty slot."
|
|
(let ((slide-offset (* (+ (-> this transition-offset) -256) 2)))
|
|
(if (< slide-offset 0) (set! slide-offset 0))
|
|
(if (< 500 slide-offset) (set! slide-offset 700))
|
|
(set! (-> this particles 19 init-pos x) (the float (- (- 202 (adjust-pos slide-offset 150)) (-> this left-x-offset))))
|
|
(set! (-> this particles 20 init-pos x) (the float (- (+ (adjust-pos slide-offset 100) 202) (-> this left-x-offset))))
|
|
(set! (-> this particles 21 init-pos x) (the float (- (- 202 (adjust-pos slide-offset 50)) (-> this left-x-offset))))
|
|
(set! (-> this particles 22 init-pos x) (the float (- (+ slide-offset 202) (-> this left-x-offset)))))
|
|
(cond
|
|
((= (-> *setting-control* current video-mode) 'pal)
|
|
(set! (-> this particles 21 init-pos y) 256.0)
|
|
(set! (-> this particles 22 init-pos y) 338.0))
|
|
(else (set! (-> this particles 21 init-pos y) 255.0) (set! (-> this particles 22 init-pos y) 336.0)))
|
|
(let ((opacity (* 2.0 (+ -0.5 (-> this transition-percentage-invert)))))
|
|
128
|
|
(if (< opacity 0.0) (set! opacity 0.0))
|
|
(let ((alpha (the int (* 128.0 opacity))))
|
|
(set-scale! font 0.5)
|
|
(set-flags! font (font-flags shadow kerning middle middle-vert large))
|
|
(set! (-> font origin x) (the float (- 102 (-> this left-x-offset))))
|
|
(set! (-> font origin y) 5.0)
|
|
(set-width! font 200)
|
|
(set-height! font 20)
|
|
(print-game-text (lookup-text! *common-text*
|
|
(if (= (-> this display-state) (progress-screen load-game)) (text-id select-file-to-load) (text-id select-file-to-save))
|
|
#f)
|
|
font
|
|
#f
|
|
alpha
|
|
22)
|
|
(set! (-> font origin y) 26.0)
|
|
(set-height! font 20)
|
|
(let ((card-info (-> this card-info))
|
|
(particle-index 23))
|
|
(dotimes (slot-index 4)
|
|
(set! (-> font origin x) (the float (- 41 (-> this left-x-offset))))
|
|
(set-flags! font (font-flags shadow kerning middle middle-vert large))
|
|
(set-color! font (font-color default))
|
|
(set-width! font 320)
|
|
(cond
|
|
((and card-info (= (-> card-info formatted) 1) (= (-> card-info inited) 1) (= (-> card-info file slot-index present) 1))
|
|
(set! (-> this particles particle-index init-pos x) (the float (- 66 (-> this left-x-offset))))
|
|
(set-scale! font 0.6)
|
|
(if (and (< (-> card-info file slot-index level-index) (length *level-task-data-remap*))
|
|
(> (-> card-info file slot-index level-index) 0))
|
|
(print-game-text (lookup-text! *common-text*
|
|
(-> *level-task-data* (-> *level-task-data-remap* (+ (-> card-info file slot-index level-index) -1)) level-name-id)
|
|
#f)
|
|
font
|
|
#f
|
|
alpha
|
|
22)
|
|
(print-game-text "OLD SAVE GAME" font #f alpha 22))
|
|
(set-color! font (font-color progress-memcard))
|
|
(cond
|
|
((or (>= (seconds 2) (- (-> *display* real-frame-counter) (-> this last-option-index-change)))
|
|
(or (< (mod (- (-> *display* real-frame-counter) (-> this last-option-index-change)) 1200) 600)
|
|
(!= (-> this option-index) slot-index)
|
|
(-> this in-transition)))
|
|
(set-scale! font 0.5)
|
|
(+! (-> font origin y) 16.0)
|
|
(set-flags! font (font-flags shadow kerning middle large))
|
|
(set! (-> font origin x) (the float (- -73 (-> this left-x-offset))))
|
|
(set-width! font 350)
|
|
(let ((print-cell-count print-game-text))
|
|
(format (clear *temp-string*) "~D" (the int (-> card-info file slot-index fuel-cell-count)))
|
|
(print-cell-count *temp-string* font #f alpha 22))
|
|
(set! (-> font origin x) (the float (- 1 (-> this left-x-offset))))
|
|
(let ((print-orb-count print-game-text))
|
|
(format (clear *temp-string*) "~D" (the int (-> card-info file slot-index money-count)))
|
|
(print-orb-count *temp-string* font #f alpha 22))
|
|
(set! (-> font origin x) (the float (- 79 (-> this left-x-offset))))
|
|
(let ((print-scout-fly-count print-game-text))
|
|
(format (clear *temp-string*) "~D" (the int (-> card-info file slot-index buzzer-count)))
|
|
(print-scout-fly-count *temp-string* font #f alpha 22))
|
|
(+! (-> font origin y) 1.0)
|
|
(set-scale! font 1.0)
|
|
(set-flags! font (font-flags shadow kerning right large))
|
|
(set! (-> font origin x) (the float (- 352 (-> this left-x-offset))))
|
|
(let ((print-completion print-game-text))
|
|
(format (clear *temp-string*) "~D%" (the int (-> card-info file slot-index completion-percentage)))
|
|
(print-completion *temp-string* font #f alpha 22))
|
|
(set-scale! font 0.5)
|
|
(+! (-> font origin y) 9.0)
|
|
;; og:preserve-this add 'middle' flag when custom-aspect to snap totals with counts
|
|
(if (-> *pc-settings* use-vis?)
|
|
(set-flags! font (font-flags shadow kerning large))
|
|
(set-flags! font (font-flags shadow kerning middle large)))
|
|
;; og:preserve-this when custom-aspect use same offsets from counts for totals
|
|
(set! (-> font origin x) (the float (- (if (-> *pc-settings* use-vis?) 85 -73) (-> this left-x-offset))))
|
|
(let ((print-cell-total print-game-text))
|
|
(let ((format-cell-total format))
|
|
(format-cell-total (clear *temp-string*)
|
|
"/~D"
|
|
(if (< 100 (the int (-> card-info file slot-index fuel-cell-count))) (-> this total-nb-of-power-cells) 100)))
|
|
(print-cell-total *temp-string* font #f alpha 22))
|
|
;; og:preserve-this when custom-aspect use same offsets from counts for totals
|
|
(set! (-> font origin x) (the float (- (if (-> *pc-settings* use-vis?) 150 1) (-> this left-x-offset))))
|
|
(let ((print-orb-total print-game-text))
|
|
(format (clear *temp-string*) "/~D" (-> this total-nb-of-orbs))
|
|
(print-orb-total *temp-string* font #f alpha 22))
|
|
;; og:preserve-this when custom-aspect use same offsets from counts for totals
|
|
(set! (-> font origin x) (the float (- (if (-> *pc-settings* use-vis?) 238 79) (-> this left-x-offset))))
|
|
(let ((print-scout-fly-total print-game-text))
|
|
(format (clear *temp-string*) "/~D" (-> this total-nb-of-buzzers))
|
|
(print-scout-fly-total *temp-string* font #f alpha 22))
|
|
(+! (-> font origin y) 15.0))
|
|
(else
|
|
(+! (-> font origin y) 18.0)
|
|
(set! (-> font origin x) (the float (- 28 (-> this left-x-offset))))
|
|
(set-scale! font 0.8)
|
|
(set-flags! font (font-flags shadow kerning middle large))
|
|
(set-width! font 350)
|
|
;; og:preserve-this pc port stuff here, added YMD
|
|
(case (scf-get-territory)
|
|
((GAME_TERRITORY_SCEA)
|
|
(print-game-text (string-format "~X/~X/20~2X ~2X:~2X"
|
|
(-> card-info file slot-index month)
|
|
(-> card-info file slot-index day)
|
|
(-> card-info file slot-index year)
|
|
(-> card-info file slot-index hour)
|
|
(-> card-info file slot-index minute))
|
|
font
|
|
#f
|
|
alpha
|
|
22))
|
|
((GAME_TERRITORY_SCEI)
|
|
(print-game-text (string-format "20~2X/~X/~X ~2X:~2X"
|
|
(-> card-info file slot-index year)
|
|
(-> card-info file slot-index month)
|
|
(-> card-info file slot-index day)
|
|
(-> card-info file slot-index hour)
|
|
(-> card-info file slot-index minute))
|
|
font
|
|
#f
|
|
alpha
|
|
22))
|
|
(else
|
|
(print-game-text (string-format "~X/~X/20~2X ~2X:~2X"
|
|
(-> card-info file slot-index day)
|
|
(-> card-info file slot-index month)
|
|
(-> card-info file slot-index year)
|
|
(-> card-info file slot-index hour)
|
|
(-> card-info file slot-index minute))
|
|
font
|
|
#f
|
|
alpha
|
|
22)))
|
|
(set! (-> this particles particle-index init-pos x) -320.0)
|
|
(+! (-> font origin y) 23.0))))
|
|
(else
|
|
(set! (-> this particles particle-index init-pos x) -320.0)
|
|
(+! (-> font origin y) 12.0)
|
|
(set-scale! font 0.7)
|
|
(print-game-text (lookup-text! *common-text* (text-id empty) #f) font #f alpha 22)
|
|
(+! (-> font origin y) 29.0)))
|
|
(+! particle-index 1)))))
|
|
0
|
|
(none))
|
|
|
|
(defmethod draw-memcard-auto-save-error ((this progress) (font font-context))
|
|
"Draw the save error, card check, and autosave-disabled messages, followed by the continue
|
|
prompt."
|
|
(set-scale! font 0.6)
|
|
(set-flags! font (font-flags shadow kerning middle middle-vert large))
|
|
(set! (-> font origin x) (the float (- 70 (-> this left-x-offset))))
|
|
(set! (-> font origin y) 5.0)
|
|
(set-width! font 265)
|
|
(set-height! font 35)
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id error-saving) #f)
|
|
(-> this transition-percentage-invert)
|
|
font
|
|
128)
|
|
(set! (-> font origin x) (the float (- 20 (-> this left-x-offset))))
|
|
(set! (-> font origin y) 34.0)
|
|
(set-width! font 360)
|
|
(set-height! font 50)
|
|
(let ((print-card-check print-game-text-scaled))
|
|
(format (clear *temp-string*) (lookup-text! *common-text* (text-id check-memcard) #f) 1)
|
|
(print-card-check *temp-string* (-> this transition-percentage-invert) font 128))
|
|
(set! (-> font origin y) 89.0)
|
|
(set-width! font 360)
|
|
(set-height! font 20)
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id autosave-disabled-title) #f)
|
|
(-> this transition-percentage-invert)
|
|
font
|
|
128)
|
|
(set! (-> font origin y) 118.0)
|
|
(set-width! font 360)
|
|
(set-height! font 60)
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id autosave-disabled-msg) #f)
|
|
(-> this transition-percentage-invert)
|
|
font
|
|
128)
|
|
(set-scale! font 0.65)
|
|
(set! (-> font origin y) 160.0)
|
|
(set-height! font 60)
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id continue?) #f)
|
|
(-> this transition-percentage-invert)
|
|
font
|
|
128)
|
|
0
|
|
(none))
|
|
|
|
(defmethod draw-memcard-removed ((this progress) (font font-context))
|
|
"Warn that the memory card was removed and autosave has been disabled, then draw the
|
|
continue prompt."
|
|
(set-scale! font 0.6)
|
|
(set-flags! font (font-flags shadow kerning middle middle-vert large))
|
|
(set! (-> font origin x) (the float (- 70 (-> this left-x-offset))))
|
|
(set! (-> font origin y) 10.0)
|
|
(set-width! font 265)
|
|
(set-height! font 55)
|
|
(let ((print-removed print-game-text-scaled))
|
|
(format (clear *temp-string*) (lookup-text! *common-text* (text-id memcard-removed) #f) 1)
|
|
(print-removed *temp-string* (-> this transition-percentage-invert) font 128))
|
|
(set! (-> font origin x) (the float (- 20 (-> this left-x-offset))))
|
|
(set! (-> font origin y) 78.0)
|
|
(set-width! font 360)
|
|
(set-height! font 20)
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id autosave-disabled-title) #f)
|
|
(-> this transition-percentage-invert)
|
|
font
|
|
128)
|
|
(set! (-> font origin y) 112.0)
|
|
(set-width! font 360)
|
|
(set-height! font 60)
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id autosave-disabled-msg) #f)
|
|
(-> this transition-percentage-invert)
|
|
font
|
|
128)
|
|
(set-scale! font 0.65)
|
|
(set! (-> font origin y) 160.0)
|
|
(set-height! font 60)
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id continue?) #f)
|
|
(-> this transition-percentage-invert)
|
|
font
|
|
128)
|
|
0
|
|
(none))
|
|
|
|
(defmethod draw-memcard-error ((this progress) (font font-context))
|
|
"Draw the operation-specific load, save, format, or create error, followed by the card
|
|
check and continue messages."
|
|
(set! (-> font origin y) 15.0)
|
|
(set-scale! font 0.7)
|
|
(set-width! font 265)
|
|
(set-height! font 55)
|
|
(set-flags! font (font-flags shadow kerning middle middle-vert large))
|
|
(let ((title-id (text-id error-loading)))
|
|
(case (-> this display-state)
|
|
(((progress-screen memcard-error-saving)) (set! title-id (text-id error-saving)))
|
|
(((progress-screen memcard-error-formatting)) (set! title-id (text-id error-formatting)))
|
|
(((progress-screen memcard-error-creating)) (set! title-id (text-id error-creating-data))))
|
|
(let ((print-title print-game-text-scaled))
|
|
(format (clear *temp-string*) (lookup-text! *common-text* title-id #f) 1)
|
|
(print-title *temp-string* (-> this transition-percentage-invert) font 128)))
|
|
(set! (-> font origin x) (the float (- 20 (-> this left-x-offset))))
|
|
(set! (-> font origin y) 80.0)
|
|
(set-width! font 360)
|
|
(set-height! font 70)
|
|
(let ((print-card-check print-game-text-scaled))
|
|
(format (clear *temp-string*) (lookup-text! *common-text* (text-id check-memcard-and-retry) #f) 1)
|
|
(print-card-check *temp-string* (-> this transition-percentage-invert) font 128))
|
|
(set-scale! font 0.65)
|
|
(set! (-> font origin y) 155.0)
|
|
(set-height! font 60)
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id continue?) #f)
|
|
(-> this transition-percentage-invert)
|
|
font
|
|
128)
|
|
0
|
|
(none))
|
|
|
|
(defmethod draw-auto-save ((this progress) (font font-context))
|
|
"Draw the autosave warning and continue prompt, and blink the save-status icon near the
|
|
prompt while the screen is fully visible."
|
|
(set! (-> font origin x) (the float (- 35 (-> this left-x-offset))))
|
|
(set! (-> font origin y) 18.0)
|
|
(set-scale! font 0.6)
|
|
(set-width! font 330)
|
|
(set-height! font 60)
|
|
(set-flags! font (font-flags shadow kerning middle middle-vert large))
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id autosave-warn-title) #f)
|
|
(-> this transition-percentage-invert)
|
|
font
|
|
128)
|
|
(set! (-> font origin x) (the float (- 15 (-> this left-x-offset))))
|
|
(set! (-> font origin y) 110.0)
|
|
(set-width! font 370)
|
|
(set-height! font 60)
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id autosave-warn-msg) #f)
|
|
(-> this transition-percentage-invert)
|
|
font
|
|
128)
|
|
(set-scale! font 0.65)
|
|
(set! (-> font origin y) 175.0)
|
|
(set-height! font 20)
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id continue?) #f)
|
|
(-> this transition-percentage-invert)
|
|
font
|
|
128)
|
|
(set! (-> *progress-process* 0 particles 31 init-pos y) (the float (if (= (get-aspect-ratio) 'aspect16x9) 170 180)))
|
|
(set! (-> *progress-process* 0 particles 31 init-pos x)
|
|
(the float
|
|
(- (if (or (< (mod (-> *display* real-frame-counter) 300) 270) (!= (-> this transition-percentage-invert) 1.0)) 205 -320)
|
|
(-> this left-x-offset))))
|
|
0
|
|
(none))
|
|
|
|
(defmethod draw-pal-change-to-60hz ((this progress) (font font-context))
|
|
"Draw the PAL 60 Hz support warning and continue prompt before changing video mode."
|
|
(set! (-> font origin x) (the float (- 50 (-> this left-x-offset))))
|
|
(set! (-> font origin y) 20.0)
|
|
(set-scale! font 0.6)
|
|
(set-width! font 300)
|
|
(set-height! font 40)
|
|
(set-flags! font (font-flags shadow kerning middle middle-vert large))
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id screen-change-to-60hz) #f)
|
|
(-> this transition-percentage-invert)
|
|
font
|
|
128)
|
|
(set! (-> font origin x) (the float (- 15 (-> this left-x-offset))))
|
|
(set! (-> font origin y) 60.0)
|
|
(set-width! font 370)
|
|
(set-height! font 60)
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id screen-60hz-warn-support) #f)
|
|
(-> this transition-percentage-invert)
|
|
font
|
|
128)
|
|
(set! (-> font origin y) 120.0)
|
|
(set-height! font 50)
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id screen-60hz-warn-timer) #f)
|
|
(-> this transition-percentage-invert)
|
|
font
|
|
128)
|
|
(set-scale! font 0.65)
|
|
(set! (-> font origin y) 175.0)
|
|
(set-height! font 20)
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id continue?) #f)
|
|
(-> this transition-percentage-invert)
|
|
font
|
|
128)
|
|
0
|
|
(none))
|
|
|
|
(defmethod draw-no-disc ((this progress) (font font-context))
|
|
"Draw the missing-disc warning. Offer the continue prompt only after a disc is present."
|
|
(set! (-> font origin x) (the float (- 50 (-> this left-x-offset))))
|
|
(set! (-> font origin y) 50.0)
|
|
(set-scale! font 0.6)
|
|
(set-width! font 300)
|
|
(set-height! font 40)
|
|
(set-flags! font (font-flags shadow kerning middle middle-vert large))
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id no-disc-title) #f)
|
|
(-> this transition-percentage-invert)
|
|
font
|
|
128)
|
|
(set! (-> font origin x) (the float (- 20 (-> this left-x-offset))))
|
|
(set! (-> font origin y) 90.0)
|
|
(set-width! font 360)
|
|
(set-height! font 60)
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id no-disc-msg) #f)
|
|
(-> this transition-percentage-invert)
|
|
font
|
|
128)
|
|
(when (is-cd-in?)
|
|
(set-scale! font 0.65)
|
|
(set! (-> font origin y) 155.0)
|
|
(set-height! font 20)
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id continue?) #f)
|
|
(-> this transition-percentage-invert)
|
|
font
|
|
128))
|
|
0
|
|
(none))
|
|
|
|
(defmethod draw-bad-disc ((this progress) (font font-context))
|
|
"Draw the unreadable-disc warning and continue prompt."
|
|
(set! (-> font origin x) (the float (- 50 (-> this left-x-offset))))
|
|
(set! (-> font origin y) 50.0)
|
|
(set-scale! font 0.6)
|
|
(set-width! font 300)
|
|
(set-height! font 40)
|
|
(set-flags! font (font-flags shadow kerning middle middle-vert large))
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id bad-disc-title) #f)
|
|
(-> this transition-percentage-invert)
|
|
font
|
|
128)
|
|
(set! (-> font origin x) (the float (- 20 (-> this left-x-offset))))
|
|
(set! (-> font origin y) 90.0)
|
|
(set-width! font 360)
|
|
(set-height! font 60)
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id bad-disc-msg) #f)
|
|
(-> this transition-percentage-invert)
|
|
font
|
|
128)
|
|
(set-scale! font 0.65)
|
|
(set! (-> font origin y) 155.0)
|
|
(set-height! font 20)
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id continue?) #f)
|
|
(-> this transition-percentage-invert)
|
|
font
|
|
128)
|
|
0
|
|
(none))
|
|
|
|
(defmethod draw-quit ((this progress) (font font-context))
|
|
"Draw the quit confirmation prompt."
|
|
(set! (-> font origin x) (the float (- 50 (-> this left-x-offset))))
|
|
(set! (-> font origin y) 70.0)
|
|
(set-scale! font 0.6)
|
|
(set-width! font 300)
|
|
(set-height! font 40)
|
|
(set-flags! font (font-flags shadow kerning middle middle-vert large))
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id quit?) #f) (-> this transition-percentage-invert) font 128)
|
|
0
|
|
(none))
|
|
|
|
(defmethod draw-pal-now-60hz ((this progress) (font font-context))
|
|
"Explain that the display is now running at 60 Hz and ask whether to keep the mode."
|
|
(set! (-> font origin x) (the float (- 50 (-> this left-x-offset))))
|
|
(set! (-> font origin y) 45.0)
|
|
(set-scale! font 0.6)
|
|
(set-width! font 300)
|
|
(set-height! font 50)
|
|
(set-flags! font (font-flags shadow kerning middle middle-vert large))
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id screen-now-60hz) #f)
|
|
(-> this transition-percentage-invert)
|
|
font
|
|
128)
|
|
(set! (-> font origin y) 95.0)
|
|
(set-height! font 50)
|
|
(print-game-text-scaled (lookup-text! *common-text* (text-id screen-60hz-keep?) #f)
|
|
(-> this transition-percentage-invert)
|
|
font
|
|
128)
|
|
0
|
|
(none))
|
|
|
|
(defmethod draw-notice-screen ((this progress))
|
|
"Create the common notice font context and dispatch the active memory-card, autosave,
|
|
video-mode, disc, or quit screen to its specialized drawing method."
|
|
(hide-progress-icons)
|
|
(when *common-text*
|
|
(let ((font (new 'stack
|
|
'font-context
|
|
*font-default-matrix*
|
|
(- 70 (-> this left-x-offset))
|
|
10
|
|
0.0
|
|
(font-color default)
|
|
(font-flags shadow kerning))))
|
|
(case (-> this display-state)
|
|
(((progress-screen memcard-format)) (draw-memcard-format this font))
|
|
(((progress-screen memcard-no-space) (progress-screen memcard-not-inserted) (progress-screen memcard-not-formatted))
|
|
(draw-memcard-storage-error this font))
|
|
(((progress-screen memcard-data-exists)) (draw-memcard-data-exists this font))
|
|
(((progress-screen memcard-no-data)) (draw-memcard-no-data this font))
|
|
(((progress-screen memcard-loading)
|
|
(progress-screen memcard-saving)
|
|
(progress-screen memcard-formatting)
|
|
(progress-screen memcard-creating))
|
|
(draw-memcard-accessing this font))
|
|
(((progress-screen memcard-insert)) (draw-memcard-insert this font))
|
|
(((progress-screen load-game) (progress-screen save-game) (progress-screen save-game-title))
|
|
(draw-memcard-file-select this font))
|
|
(((progress-screen memcard-auto-save-error)) (draw-memcard-auto-save-error this font))
|
|
(((progress-screen memcard-removed)) (draw-memcard-removed this font))
|
|
(((progress-screen memcard-error-loading)
|
|
(progress-screen memcard-error-saving)
|
|
(progress-screen memcard-error-formatting)
|
|
(progress-screen memcard-error-creating))
|
|
(draw-memcard-error this font))
|
|
(((progress-screen auto-save)) (draw-auto-save this font))
|
|
(((progress-screen pal-change-to-60hz)) (draw-pal-change-to-60hz this font))
|
|
(((progress-screen pal-now-60hz)) (draw-pal-now-60hz this font))
|
|
(((progress-screen no-disc)) (draw-no-disc this font))
|
|
(((progress-screen bad-disc)) (draw-bad-disc this font))
|
|
(((progress-screen quit)) (draw-quit this font)))))
|
|
0
|
|
(none))
|
|
|
|
(defun draw-percent-bar ((x int) (y int) (fraction float) (color rgba))
|
|
"Draw a 255-by-14 translucent backing at x and y, then fill its inner 255-by-10 region by
|
|
fraction using color."
|
|
(with-dma-buffer-add-bucket ((packet-buffer (-> (current-frame) global-buf)) (bucket-id sprite))
|
|
(draw-sprite2d-xy packet-buffer x y 255 14 (new 'static 'rgba :a #x60))
|
|
(draw-sprite2d-xy packet-buffer x (+ y 2) (the int (* 255.0 fraction)) 10 color))
|
|
0
|
|
(none))
|
|
|
|
(defun print-language-name ((language-index int) (font font-context) (x-offset int) (move-right? symbol))
|
|
"Draw language-index with horizontal offset and a linear distance fade. move-right? selects
|
|
the offset direction; restore the font position and default color afterward."
|
|
(let ((signed-offset (if move-right? x-offset (- x-offset))))
|
|
(+! (-> font origin x) (the float signed-offset))
|
|
(let ((opacity (- 1.0 (* 0.0033333334 (the float x-offset)))))
|
|
(print-game-text-scaled (lookup-text! *common-text* (-> *language-name-remap* language-index) #f)
|
|
opacity
|
|
font
|
|
(the int (* 128.0 opacity))))
|
|
(set! (-> font origin x) (- (-> font origin x) (the float signed-offset))))
|
|
(set-color! font (font-color default))
|
|
font)
|
|
|
|
(defmethod draw-options ((this progress) (base-y int) (row-spacing int) (base-scale float))
|
|
"Draw the current option table centered around base-y with row-spacing and base-scale.
|
|
Render menu labels, toggles, slider values and bars, the animated language carousel,
|
|
and the active selection highlight."
|
|
(let ((options (-> *options-remap* (-> this display-state))))
|
|
(when options
|
|
(let ((row-y (- base-y (/ (* row-spacing (length options)) 2)))
|
|
(option-number 0)
|
|
(initial-x-offset 27)
|
|
(unused-option-state 0)
|
|
(font (new 'stack 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning))))
|
|
(set-width! font 350)
|
|
(set-height! font 25)
|
|
(set-flags! font (font-flags shadow kerning middle middle-vert large))
|
|
(dotimes (i (length options))
|
|
(let ((option-text (the string #f))
|
|
(x-offset 27)
|
|
(y-offset row-y))
|
|
(let ((option-type (-> options i option-type)))
|
|
(cond
|
|
((= option-type (game-option-type yes-no))
|
|
(if (-> (the-as (pointer uint32) (-> options i value-to-modify)))
|
|
(set! option-text
|
|
(string-format "~30L~S~0L ~S"
|
|
(lookup-text! *common-text* (text-id yes) #f)
|
|
(lookup-text! *common-text* (text-id no) #f)))
|
|
(set! option-text
|
|
(string-format "~0L~S ~30L~S~1L"
|
|
(lookup-text! *common-text* (text-id yes) #f)
|
|
(lookup-text! *common-text* (text-id no) #f)))))
|
|
((or (= option-type (game-option-type menu)) (= option-type (game-option-type button)))
|
|
(cond
|
|
((nonzero? (-> options i name)) (set! option-text (lookup-text! *common-text* (-> options i name) #f)))
|
|
(else (set! option-text (the-as string #f)))))
|
|
((and (-> this selected-option) (= (-> this option-index) i))
|
|
(set-color! font (font-color default))
|
|
(set! (-> font origin x) (the float (- x-offset (-> this left-x-offset))))
|
|
(case (-> options i option-type)
|
|
(((game-option-type center-screen)) (set! (-> font origin y) (the float (+ row-y -20))))
|
|
(else (set! (-> font origin y) (the float (+ row-y -8)))))
|
|
(set-scale! font 0.6)
|
|
(print-game-text (lookup-text! *common-text* (-> options i name) #f) font #f 128 22)
|
|
(case (-> options i option-type)
|
|
(((game-option-type center-screen)) (set! y-offset (+ row-y 3)))
|
|
(else (set! y-offset (+ row-y 7))))
|
|
(case (-> options i option-type)
|
|
(((game-option-type slider))
|
|
(let* ((bar-color-base (the-as uint #x8000ffff))
|
|
(slider-fraction (* 0.01 (-> (the-as (pointer float) (-> options i value-to-modify)))))
|
|
(bar-color-alpha (logior (logand bar-color-base -256) (shr (shl (the int (+ 64.0 (* 191.0 slider-fraction))) 56) 56)))
|
|
(bar-color (logior (logand bar-color-alpha -65281) (shr (shl (shr (shl bar-color-alpha 56) 56) 56) 48))))
|
|
(draw-percent-bar (- 75 (-> this left-x-offset)) (+ row-y 8) slider-fraction (the-as rgba bar-color)))
|
|
(set! option-text (string-format "~D" (the int (-> (the-as (pointer float) (-> options i value-to-modify))))))
|
|
(set! x-offset (+ (the int (* 2.5 (-> (the-as (pointer float) (-> options i value-to-modify))))) -100))
|
|
x-offset)
|
|
(((game-option-type on-off))
|
|
(if (-> (the-as (pointer uint32) (-> options i value-to-modify)))
|
|
(set! option-text
|
|
(string-format "~30L~S~0L ~S"
|
|
(lookup-text! *common-text* (text-id on) #f)
|
|
(lookup-text! *common-text* (text-id off) #f)))
|
|
(set! option-text
|
|
(string-format "~0L~S ~30L~S~1L"
|
|
(lookup-text! *common-text* (text-id on) #f)
|
|
(lookup-text! *common-text* (text-id off) #f)))))
|
|
(((game-option-type language))
|
|
(let ((old-language (-> this language-selection))
|
|
(new-language (-> (the-as (pointer language-enum) (-> options i value-to-modify))))
|
|
(language-count (if (and (= (scf-get-territory) GAME_TERRITORY_SCEA)
|
|
(not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2))))
|
|
5
|
|
6)))
|
|
(if (-> this language-transition)
|
|
(seekl! (-> this language-x-offset) 200 (the int (* 10.0 (-> *display* time-adjust-ratio)))))
|
|
(when (>= (-> this language-x-offset) 100)
|
|
(set! (-> this language-selection) new-language)
|
|
(set! old-language new-language)
|
|
(set! (-> this language-transition) #f)
|
|
(set! (-> this language-x-offset) 0))
|
|
(set! (-> font origin y) (the float (+ row-y 3)))
|
|
(set-color! font (font-color progress-blue))
|
|
0
|
|
(let ((next-language (mod (+ old-language 1) language-count))
|
|
(previous-language (mod (+ language-count -1 old-language) language-count))
|
|
(next-next-language (mod (+ old-language 2) language-count))
|
|
(previous-previous-language (mod (+ language-count -2 old-language) language-count)))
|
|
(cond
|
|
((-> this language-direction)
|
|
(let ((previous-x (- 200 (+ (-> this language-x-offset) 100))))
|
|
(print-language-name previous-language font previous-x #f))
|
|
(let ((incoming-next-x (+ (-> this language-x-offset) 100)))
|
|
(cond
|
|
((< incoming-next-x 150) (print-language-name (the int next-language) font incoming-next-x #t))
|
|
(else
|
|
(let ((outgoing-previous-x (- 200 (-> this language-x-offset))))
|
|
(print-language-name previous-previous-language font outgoing-previous-x #f))))))
|
|
(else
|
|
(let ((incoming-previous-x (+ (-> this language-x-offset) 100)))
|
|
(cond
|
|
((< incoming-previous-x 150) (print-language-name previous-language font incoming-previous-x #f))
|
|
(else
|
|
(let ((outgoing-next-x (- 200 (-> this language-x-offset))))
|
|
(print-language-name (the int next-next-language) font outgoing-next-x #t)))))
|
|
(let ((next-x (- 200 (+ (-> this language-x-offset) 100))))
|
|
(print-language-name (the int next-language) font next-x #t)))))
|
|
(if (not (-> this language-transition)) (set-color! font (font-color progress-selected)))
|
|
(print-language-name (the-as int old-language) font (-> this language-x-offset) (-> this language-direction))))
|
|
(((game-option-type center-screen)) (set! option-text (lookup-text! *common-text* (text-id move-dpad) #f)))
|
|
(((game-option-type aspect-ratio))
|
|
(if (= (-> (the-as (pointer uint32) (-> options i value-to-modify))) 'aspect4x3)
|
|
(set! option-text
|
|
(string-format "~30L~S~0L ~S"
|
|
(lookup-text! *common-text* (text-id 4x3) #f)
|
|
(lookup-text! *common-text* (text-id 16x9) #f)))
|
|
(set! option-text
|
|
(string-format "~0L~S ~30L~S~1L"
|
|
(lookup-text! *common-text* (text-id 4x3) #f)
|
|
(lookup-text! *common-text* (text-id 16x9) #f)))))
|
|
(((game-option-type video-mode))
|
|
(if (= (-> (the-as (pointer uint32) (-> options i value-to-modify))) 'ntsc)
|
|
(set! option-text
|
|
(string-format "~0L~S ~30L~S~1L"
|
|
(lookup-text! *common-text* (text-id 50hz) #f)
|
|
(lookup-text! *common-text* (text-id 60hz) #f)))
|
|
(set! option-text
|
|
(string-format "~30L~S~0L ~S"
|
|
(lookup-text! *common-text* (text-id 50hz) #f)
|
|
(lookup-text! *common-text* (text-id 60hz) #f)))))))
|
|
(else
|
|
(case (-> options i option-type)
|
|
(((game-option-type slider)
|
|
(game-option-type center-screen)
|
|
(game-option-type aspect-ratio)
|
|
(game-option-type video-mode))
|
|
(set! option-text (lookup-text! *common-text* (-> options i name) #f)))
|
|
(((game-option-type on-off))
|
|
(set! option-text
|
|
(string-format "~S: ~S"
|
|
(lookup-text! *common-text* (-> options i name) #f)
|
|
(if (-> (the-as (pointer uint32) (-> options i value-to-modify)))
|
|
(lookup-text! *common-text* (text-id on) #f)
|
|
(lookup-text! *common-text* (text-id off) #f)))))
|
|
(((game-option-type language))
|
|
(set! option-text
|
|
(string-format "~S: ~S"
|
|
(lookup-text! *common-text* (-> options i name) #f)
|
|
(lookup-text! *common-text* (-> *language-name-remap* (-> (the-as (pointer uint64) (-> options i value-to-modify)))) #f))))))))
|
|
(when option-text
|
|
(let ((transition-opacity (-> this transition-percentage-invert)))
|
|
(set-color! font
|
|
(if (and (= i (-> this option-index)) (not (-> this in-transition))) (font-color progress-selected) (font-color default)))
|
|
(set! (-> font origin x) (the float (- x-offset (-> this left-x-offset))))
|
|
(set! (-> font origin y)
|
|
(the float (the int (* (the float y-offset) (if (-> options i scale) transition-opacity 1.0)))))
|
|
(set-scale! font (* base-scale transition-opacity))
|
|
(print-game-text option-text font #f (the int (* 128.0 transition-opacity)) 22)))
|
|
(+! row-y row-spacing)
|
|
(+! option-number 1))))))
|
|
0
|
|
(none))
|
|
|
|
(defmethod draw-progress ((this progress))
|
|
"Draw the persistent progress overlay: current collectable counts, completion percentage,
|
|
option buttons, and the small collectable icons. Slide each group on its own staggered
|
|
path during progress-screen transitions."
|
|
(let ((hud-x (+ -409.0 (-> this particles 2 init-pos x) (* 0.8 (the float (-> this left-x-offset)))))
|
|
(transition-offset (if (or (-> this stat-transition) (nonzero? (-> this level-transition))) 0 (-> this transition-offset))))
|
|
(let ((opacity (if (or (-> this stat-transition) (nonzero? (-> this level-transition))) 1.0 (-> this transition-percentage-invert))))
|
|
(with-dma-buffer-add-bucket ((packet-buffer (-> *display* frames (-> *display* on-screen) frame global-buf)) (bucket-id debug)) :bucket-group (-> *display* frames (-> *display* on-screen) frame bucket-group) (let ((draw-money draw-string-xy))
|
|
(format (clear *temp-string*) "~D" (the int (+ 0.5 (-> *target* game money))))
|
|
(draw-money *temp-string*
|
|
packet-buffer
|
|
(the int (+ 428.0 (the float transition-offset) hud-x))
|
|
(- 12 (the int (/ hud-x 6)))
|
|
(font-color default)
|
|
(font-flags shadow kerning large))) (let ((draw-power-cells draw-string-xy))
|
|
(format (clear *temp-string*) "~D" (the int (+ 0.5 (-> *target* game fuel))))
|
|
(draw-power-cells *temp-string*
|
|
packet-buffer
|
|
(the int (+ 456.0 (the float (adjust-pos transition-offset 50)) hud-x))
|
|
(- 48 (the int (/ hud-x 8)))
|
|
(font-color default)
|
|
(font-flags shadow kerning large))) (let ((draw-scout-flies draw-string-xy))
|
|
(format (clear *temp-string*) "~D" (the int (+ 0.5 (-> *target* fact buzzer))))
|
|
(draw-scout-flies *temp-string*
|
|
packet-buffer
|
|
(the int (+ 469.0 (the float (adjust-pos transition-offset 100)) hud-x))
|
|
89
|
|
(font-color default)
|
|
(font-flags shadow kerning large))))
|
|
(let ((font (new 'stack
|
|
'font-context
|
|
*font-default-matrix*
|
|
(the int (+ (- 423.0 (the float (/ (-> this left-x-offset) 2))) hud-x (the float (adjust-pos transition-offset 150))))
|
|
131
|
|
0.0
|
|
(font-color default)
|
|
(font-flags shadow kerning))))
|
|
(set-width! font 100)
|
|
(set-height! font 15)
|
|
(set-scale! font 0.5)
|
|
(set-flags! font (font-flags shadow kerning large))
|
|
(print-game-text (lookup-text! *common-text* (text-id options) #f) font #f 128 22)
|
|
(set-width! font 160)
|
|
(set-height! font 22)
|
|
(set-scale! font 1.3)
|
|
(set-color! font (font-color progress-percent))
|
|
(set! (-> font origin x)
|
|
(+ (- 435.0 (the float (if (< (-> *progress-process* 0 completion-percentage) 10.0) 93 80))) hud-x))
|
|
(set! (-> font origin y) 180.0)
|
|
(set-flags! font (font-flags shadow kerning middle middle-vert large))
|
|
(let ((print-percent print-game-text))
|
|
(format (clear *temp-string*) "~2D%" (the int (-> *progress-process* 0 completion-percentage)))
|
|
(print-percent *temp-string* font #f (the int (* 128.0 opacity)) 22))))
|
|
0.0
|
|
(let ((button-radius (+ -94.0 (-> this particles 2 init-pos x)))
|
|
(button-center-x 90)
|
|
(button-center-y 224)
|
|
(button-transition (/ transition-offset 5))
|
|
(button-scale (-> this button-scale)))
|
|
(let ((button-x-angle (* 182.04445 (- (/ -36.0 button-scale) (the float button-transition)))))
|
|
(set! (-> this particles 27 init-pos x)
|
|
(the float (+ button-center-x (the int (* button-radius (cos button-x-angle))))))
|
|
(set! (-> this particles 27 init-pos y)
|
|
(the float (+ button-center-y (the int (* button-radius (sin button-x-angle)))))))
|
|
(let ((button-square-angle (* 182.04445 (- (/ -21.0 button-scale) (the float (adjust-pos button-transition 10))))))
|
|
(set! (-> this particles 28 init-pos x)
|
|
(the float (+ button-center-x (the int (* button-radius (cos button-square-angle))))))
|
|
(set! (-> this particles 28 init-pos y)
|
|
(the float (+ button-center-y (the int (* button-radius (sin button-square-angle)))))))
|
|
(let ((button-triangle-angle (* 182.04445 (- (/ -6.0 button-scale) (the float (adjust-pos button-transition 15))))))
|
|
(set! (-> this particles 29 init-pos x)
|
|
(the float (+ button-center-x (the int (* button-radius (cos button-triangle-angle))))))
|
|
(set! (-> this particles 29 init-pos y)
|
|
(the float (+ button-center-y (the int (* button-radius (sin button-triangle-angle)))))))
|
|
(let ((button-circle-angle (* 182.04445 (- (/ 9.0 button-scale) (the float (adjust-pos button-transition 20))))))
|
|
(set! (-> this particles 30 init-pos x)
|
|
(the float (+ button-center-x (the int (* button-radius (cos button-circle-angle))))))
|
|
(set! (-> this particles 30 init-pos y)
|
|
(the float (+ button-center-y (the int (* button-radius (sin button-circle-angle))))))))
|
|
(when *cheat-mode*
|
|
(let ((autosave-text "AUTO SAVE OFF"))
|
|
(if (-> *setting-control* current auto-save) (set! autosave-text "AUTO SAVE ON"))
|
|
(with-dma-buffer-add-bucket ((debug-packet-buffer (-> *display* frames (-> *display* on-screen) frame global-buf)) (bucket-id debug)) :bucket-group (-> *display* frames (-> *display* on-screen) frame bucket-group) (draw-string-xy autosave-text
|
|
debug-packet-buffer
|
|
(the int (+ 430.0 hud-x))
|
|
200
|
|
(font-color progress-memcard)
|
|
(font-flags shadow kerning middle)))))
|
|
(let ((small-orb-root (-> this icons 5 icon 0 root)))
|
|
(set-yaw-angle-clear-roll-pitch! small-orb-root
|
|
(- (y-angle small-orb-root) (* 182.04445 (* 4.0 (-> *display* time-adjust-ratio))))))
|
|
(let* ((in-out-fraction (* 0.00024414062 (the float (-> *progress-process* 0 in-out-position))))
|
|
(icon-slide (* 300.0 in-out-fraction)))
|
|
(set! (-> this particles 18 init-pos x)
|
|
(the float
|
|
(+ (the int (the float (adjust-pos transition-offset 50))) 394 (the int icon-slide) (-> this right-x-offset))))
|
|
(set! (-> this particles 18 init-pos y) (the float (- 40 (the int (* 80.0 in-out-fraction)))))
|
|
(set! (-> this icons 5 icon-x)
|
|
(+ (the int (the float (adjust-pos transition-offset 50))) 393 (the int icon-slide) (-> this right-x-offset)))
|
|
(set! (-> this icons 5 icon-y) (- (-> this small-orb-y-offset) (the int (* 80.0 in-out-fraction))))
|
|
(set! (-> this particles 16 init-pos x)
|
|
(the float
|
|
(+ (the int (the float (adjust-pos transition-offset 100))) 425 (the int icon-slide) (-> this right-x-offset))))
|
|
(set! (-> this particles 16 init-pos y) (the float (- 112 (the int (* 60.0 in-out-fraction)))))
|
|
(set! (-> this particles 17 init-pos x)
|
|
(the float
|
|
(+ (the int (the float (adjust-pos transition-offset 150)))
|
|
442
|
|
(the int icon-slide)
|
|
(the int (* 0.7 (the float (-> this right-x-offset)))))))))
|
|
(set! (-> this particles 17 init-pos y) 193.0)
|
|
0
|
|
(none))
|