From c848c69fd02f7dae644a2d89dd773f7489502e1d Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Sun, 28 Jul 2024 21:28:12 -0400 Subject: [PATCH] g/j2: move audio settings into `progress-pc` code and do the same --- goal_src/jak2/pc/progress/progress-pc.gc | 20 ++++---- .../jak2/pc/progress/progress-static-pc.gc | 46 +++++++++++++++++++ 2 files changed, 56 insertions(+), 10 deletions(-) diff --git a/goal_src/jak2/pc/progress/progress-pc.gc b/goal_src/jak2/pc/progress/progress-pc.gc index 59dacc8d26..dc2153250c 100644 --- a/goal_src/jak2/pc/progress/progress-pc.gc +++ b/goal_src/jak2/pc/progress/progress-pc.gc @@ -104,15 +104,15 @@ (set! (-> (the-as menu-on-off-option (-> *graphic-title-options-pal* options 2)) value-to-modify) (&-> *setting-control* user-default use-progressive-scan) ) - (set! (-> (the-as menu-slider-option (-> *sound-options* options 0)) value-to-modify) - (&-> *pc-settings* memcard-volume-sfx) - ) - (set! (-> (the-as menu-slider-option (-> *sound-options* options 1)) value-to-modify) - (&-> *pc-settings* memcard-volume-music) - ) - (set! (-> (the-as menu-slider-option (-> *sound-options* options 2)) value-to-modify) - (&-> *pc-settings* memcard-volume-dialog) - ) + ;; (set! (-> (the-as menu-slider-option (-> *sound-options* options 0)) value-to-modify) + ;; (&-> *pc-settings* memcard-volume-sfx) + ;; ) + ;; (set! (-> (the-as menu-slider-option (-> *sound-options* options 1)) value-to-modify) + ;; (&-> *pc-settings* memcard-volume-music) + ;; ) + ;; (set! (-> (the-as menu-slider-option (-> *sound-options* options 2)) value-to-modify) + ;; (&-> *pc-settings* memcard-volume-dialog) + ;; ) (set! (-> (the-as menu-missions-option (-> *missions-options* options 0)) task-line-index) 0) (set-setting-by-param *setting-control* 'extra-bank '((force2 menu1)) 0 0) @@ -183,7 +183,7 @@ (set! (-> obj current-options) *graphic-options-pc*) ) (('sound-options) - (set! (-> obj current-options) *sound-options*) + (set! (-> obj current-options) *sound-options-pc*) ) (('select-load 'select-save) (set! (-> obj current-options) *load-save-options*) diff --git a/goal_src/jak2/pc/progress/progress-static-pc.gc b/goal_src/jak2/pc/progress/progress-static-pc.gc index 55b9dac78e..2e389f2672 100644 --- a/goal_src/jak2/pc/progress/progress-static-pc.gc +++ b/goal_src/jak2/pc/progress/progress-static-pc.gc @@ -36,6 +36,52 @@ This gives us more freedom to write code how we want. ) ) +(define *sound-options-pc* + (progress-new-generic-scrolling-page (text-id progress-root-sound-options) + (new 'static 'menu-generic-slider-option + :name (text-id progress-sound-sfx-volume) + :min-value 0.0 + :max-value 1.0 + :step 0.01 + :show-decimal? #t + :get-value-fn (lambda () (-> *pc-settings* memcard-volume-sfx)) + :on-confirm (lambda ((val float)) + (set! (-> *pc-settings* memcard-volume-sfx) val) + (pc-settings-save) + (set! (-> *setting-control* user-default sfx-volume) val))) + (new 'static 'menu-generic-slider-option + :name (text-id progress-sound-music-volume) + :min-value 0.0 + :max-value 1.0 + :step 0.01 + :show-decimal? #t + :get-value-fn (lambda () (-> *pc-settings* memcard-volume-music)) + :on-confirm (lambda ((val float)) + (set! (-> *pc-settings* memcard-volume-music) val) + (pc-settings-save) + (set! (-> *setting-control* user-default music-volume) val))) + (new 'static 'menu-generic-slider-option + :name (text-id progress-sound-speech-volume) + :min-value 0.0 + :max-value 1.0 + :step 0.01 + :show-decimal? #t + :get-value-fn (lambda () (-> *pc-settings* memcard-volume-dialog)) + :on-confirm (lambda ((val float)) + (set! (-> *pc-settings* memcard-volume-dialog) val) + (pc-settings-save) + (set! (-> *setting-control* user-default dialog-volume) val))) + (new 'static 'menu-generic-carousel-option + :name (text-id progress-sound-format) + :get-max-size-fn (lambda () 3) + :get-item-label-fn (lambda ((index int)) + (case index + ((0) (lookup-text! *common-text* (text-id progress-sound-mono) #f)) + ((1) (lookup-text! *common-text* (text-id progress-sound-stereo) #f)) + ((2) (lookup-text! *common-text* (text-id progress-sound-surround) #f)))) + :get-item-index-fn (lambda () (-> *setting-control* user-default stereo-mode)) + :on-confirm (lambda ((index int) (the-progress progress)) (set! (-> *setting-control* user-default stereo-mode) index))))) + (define *options-pc* (new 'static 'menu-option-list :y-center #xc6 :y-space 30