Files
jak-project/goal_src/jak1/engine/ui/progress/progress-h.gc
T
2026-07-26 14:43:53 -04:00

358 lines
11 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
(bundles "ENGINE.CGO" "GAME.CGO")
(require "kernel-defs.gc")
;; PC port adds new menus and option types
(#cond
((not PC_PORT)
(defenum progress-screen
:type int64
(invalid -1)
(fuel-cell 0)
(money 1)
(buzzer 2)
(settings 3)
(game-settings 4)
(graphic-settings 5)
(sound-settings 6)
(memcard-no-space 7)
(memcard-not-inserted 8)
(memcard-not-formatted 9)
(memcard-format 10)
(memcard-data-exists 11)
(memcard-loading 12)
(memcard-saving 13)
(memcard-formatting 14)
(memcard-creating 15)
(load-game 16)
(save-game 17)
(save-game-title 18)
(memcard-insert 19)
(memcard-error-loading 20)
(memcard-error-saving 21)
(memcard-removed 22)
(memcard-no-data 23)
(memcard-error-formatting 24)
(memcard-error-creating 25)
(memcard-auto-save-error 26)
(title 27)
(settings-title 28)
(auto-save 29)
(pal-change-to-60hz 30)
(pal-now-60hz 31)
(no-disc 32)
(bad-disc 33)
(quit 34)
(max 35))
(defenum game-option-type
:type uint64
(slider 0)
(language 1)
(on-off 2)
(center-screen 3)
(aspect-ratio 4)
(video-mode 5)
(menu 6)
(yes-no 7)
(button 8)))
(#t
(defenum progress-screen
:type int64
(invalid -1)
(fuel-cell 0)
(money 1)
(buzzer 2)
(settings 3)
(game-settings 4)
(graphic-settings 5)
(sound-settings 6)
(memcard-no-space 7)
(memcard-not-inserted 8)
(memcard-not-formatted 9)
(memcard-format 10)
(memcard-data-exists 11)
(memcard-loading 12)
(memcard-saving 13)
(memcard-formatting 14)
(memcard-creating 15)
(load-game 16)
(save-game 17)
(save-game-title 18)
(memcard-insert 19)
(memcard-error-loading 20)
(memcard-error-saving 21)
(memcard-removed 22)
(memcard-no-data 23)
(memcard-error-formatting 24)
(memcard-error-creating 25)
(memcard-auto-save-error 26)
(title 27)
(settings-title 28)
(auto-save 29)
(pal-change-to-60hz 30)
(pal-now-60hz 31)
(no-disc 32)
(bad-disc 33)
(quit 34)
;; extra screens for pc port
;; input options
(input-options)
(select-controller)
(controller-binds) ;; 0x25
(keyboard-binds)
(mouse-binds)
(controller-options)
(mouse-options)
(reassign-binds-options)
(camera-options)
(accessibility-options)
(game-ps2-options)
(misc-options)
(resolution)
(aspect-msg)
(aspect-ratio)
(gfx-ps2-options)
(secrets)
(hint-log)
(cheats)
(scrapbook)
(music-player)
(scene-player)
(credits)
(quit-title)
(flava-player)
(memcard-disable-auto-save)
(memcard-auto-save-disabled)
(monitor)
(checkpoint-select)
(speedrun-options)
(speedrun-il-options)
(speedrun-cat-ext-options)
;; the last one!
(max))
(defenum game-option-type
:type uint64
(slider 0)
(language 1)
(on-off 2)
(center-screen 3)
(aspect-ratio 4)
(video-mode 5)
(menu 6)
(yes-no 7)
(button 8)
;; extra types for pc port
(normal-inverted)
(display-mode)
(msaa)
(frame-rate)
(lod-bg)
(lod-fg)
(resolution)
(aspect-new)
(language-subtitles)
(language-text)
(speaker)
(aspect-native)
(button-music)
(button-flava)
(cheat-toggle)
(monitor)
(controller)
(binding-assignment)
(confirmation))) ;; end of PC_PORT = #t branch for enum initialization
) ;; end of PC_PORT cond
(defenum game-option-menu
:type int32
:copy-entries progress-screen)
(defun-extern activate-progress process progress-screen none)
(defun-extern hide-progress-screen none)
(defun-extern hide-progress-icons none)
(defun-extern progress-allowed? symbol)
(defun-extern pause-allowed? symbol)
;; DECOMP BEGINS
;; Per-level totals used by the progress and save-file displays.
(deftype count-info (structure)
((money-count int32) ;; total precursor orbs
(buzzer-count int32)) ;; total scout flies
:pack-me)
;; Variable-length table of per-level collectible totals. The inline data continues beyond the
;; nominal header size.
(deftype game-count-info (basic)
((length int32)
(data count-info :inline :dynamic)))
;; Text for one power-cell task. The first three task-name entries describe the task during its
;; introduction/reminder, later-reminder, and reward/resolution phases. A completed task uses
;; text-index-when-resolved to select the name that remains on the progress screen.
(deftype task-info-data (basic)
((task-id game-task)
(task-name text-id 4)
(text-index-when-resolved int32)))
;; Progress-screen data for one level. text-group-index selects the level text bank, nb-of-tasks
;; gives the used portion of the eight-entry task-info array, and buzzer-task-index identifies the
;; scout-fly task or is -1 when the level has none.
(deftype level-tasks-info (basic)
((level-name-id text-id)
(text-group-index int32)
(nb-of-tasks int32)
(buzzer-task-index int32)
(task-info task-info-data 8)))
;; One pause-menu choice. option-type determines how the three parameters and value-to-modify are
;; interpreted: choices can edit a value, open another progress-screen, or act as a button.
(deftype game-option (basic)
((option-type game-option-type)
(name text-id)
(scale symbol)
(param1 float)
(param2 float)
(param3 game-option-menu)
(value-to-modify pointer)
;; fields below added in pc port
(option-disabled-func (function symbol))
(name-override string)
(on-change (function object none))
(on-confirm (function none))
(slider-step-size float)
(slider-show-decimal? symbol)
(bind-info bind-assignment-info :inline)))
;; Owns the pause/progress menu state, transitions, save-card display data, and the HUD icons and
;; particles used to draw each screen.
(deftype progress (process)
((current-debug-string int32)
(current-debug-language int32)
(current-debug-group int32)
(in-out-position int32)
(display-state progress-screen)
(next-display-state progress-screen)
(option-index int32)
(selected-option basic)
(completion-percentage float)
(ready-to-run basic)
(display-level-index int32)
(next-level-index int32)
(task-index int32)
(in-transition basic)
(last-in-transition basic)
(force-transition basic)
(stat-transition basic)
(level-transition int32)
(language-selection language-enum)
(language-direction symbol)
(language-transition basic)
(language-x-offset int32)
(sides-x-scale float)
(sides-y-scale float)
(left-x-offset int32)
(right-x-offset int32)
(button-scale float)
(slot-scale float)
(left-side-x-scale float)
(left-side-y-scale float)
(right-side-x-scale float)
(right-side-y-scale float)
(small-orb-y-offset int32)
(big-orb-y-offset int32)
(transition-offset int32)
(transition-offset-invert int32)
(transition-percentage float)
(transition-percentage-invert float)
(transition-speed float)
(total-nb-of-power-cells int32)
(total-nb-of-orbs int32)
(total-nb-of-buzzers int32)
(card-info mc-slot-info)
(last-option-index-change time-frame)
(video-mode-timeout time-frame)
(display-state-stack progress-screen 5)
(option-index-stack int32 5)
(display-state-pos int32)
(nb-of-icons int32)
(icons hud-icon 6)
(max-nb-of-particles int32)
(nb-of-particles int32)
(particles hud-particle 40)
(particle-state int32 40))
(:methods
(progress-method-14 (_type_) none)
(progress-method-15 (_type_) none)
(progress-method-16 (_type_) none)
(draw-progress (_type_) none)
(progress-method-18 () none)
(visible? (_type_) symbol)
(hidden? (_type_) symbol)
(adjust-sprites (_type_) none)
(adjust-icons (_type_) none)
(adjust-ratios (_type_ symbol symbol) none)
(draw-fuel-cell-screen (_type_ int) none)
(draw-money-screen (_type_ int) none)
(draw-buzzer-screen (_type_ int) none)
(draw-notice-screen (_type_) none)
(draw-options (_type_ int int float) none)
(respond-common (_type_) none)
(respond-progress (_type_) none)
(respond-memcard (_type_) none)
(can-go-back? (_type_) symbol)
(initialize-icons (_type_) none)
(initialize-particles (_type_) none)
(draw-memcard-storage-error (_type_ font-context) none)
(draw-memcard-data-exists (_type_ font-context) none)
(draw-memcard-no-data (_type_ font-context) none)
(draw-memcard-accessing (_type_ font-context) none)
(draw-memcard-insert (_type_ font-context) none)
(draw-memcard-file-select (_type_ font-context) none)
(draw-memcard-auto-save-error (_type_ font-context) none)
(draw-memcard-removed (_type_ font-context) none)
(draw-memcard-error (_type_ font-context) none)
(progress-method-44 (_type_) none)
(push! (_type_) none)
(pop! (_type_) none)
(progress-method-47 (_type_) none)
(enter! (_type_ progress-screen int) none)
(draw-memcard-format (_type_ font-context) none)
(draw-auto-save (_type_ font-context) none)
(set-transition-progress! (_type_ int) none)
(set-transition-speed! (_type_) none)
(set-memcard-screen (_type_ progress-screen) progress-screen)
(draw-pal-change-to-60hz (_type_ font-context) none)
(draw-pal-now-60hz (_type_ font-context) none)
(draw-no-disc (_type_ font-context) none)
(draw-bad-disc (_type_ font-context) none)
(draw-quit (_type_ font-context) none))
(:states
progress-coming-in
progress-debug
progress-going-out
progress-gone
progress-normal
progress-waiting))
(define *progress-process* (the-as (pointer progress) #f))
(define *progress-last-task-index* 0)
(defun-extern get-game-count int count-info)
(define-extern *level-task-data* (array level-tasks-info))
(define-extern *level-task-data-remap* (array int32))
(defun-extern deactivate-progress none)
(defun-extern calculate-completion progress float)
(defun-extern make-current-level-available-to-progress none)