mirror of
https://github.com/open-goal/jak-project
synced 2026-09-01 09:53:12 -04:00
g/j2: Fix subtitle setting persisting and add a toggle for the hint subtitles (#3689)
Fixes #3663
This commit is contained in:
@@ -8818,6 +8818,7 @@ Unlike [[engine]], users can use [[engine-pers]] as a parent class."
|
||||
(progress-graphics-msaa-off #x1338)
|
||||
(progress-graphics-display #x1339)
|
||||
(language-name-finnish #x133a)
|
||||
(progress-hint-subtitles #x133b)
|
||||
)
|
||||
;; ---text-id-h:text-id
|
||||
|
||||
|
||||
@@ -233,5 +233,6 @@
|
||||
"1337": "PS2 LOD Distance",
|
||||
"1338": "Off",
|
||||
"1339": "Display",
|
||||
"133a": "<FLAG_FINLAND> Suomi"
|
||||
"133a": "<FLAG_FINLAND> Suomi",
|
||||
"133b": "Hint Subtitles"
|
||||
}
|
||||
|
||||
@@ -829,6 +829,7 @@
|
||||
(progress-graphics-msaa-off #x1338)
|
||||
(progress-graphics-display #x1339)
|
||||
(language-name-finnish #x133a)
|
||||
(progress-hint-subtitles #x133b)
|
||||
)
|
||||
;; ---text-id
|
||||
|
||||
|
||||
@@ -102,6 +102,7 @@
|
||||
(controller-led-status? symbol)
|
||||
(speedrunner-mode-custom-bind uint32)
|
||||
(memcard-subtitles? symbol)
|
||||
(hint-subtitles? symbol)
|
||||
|
||||
(text-language pc-language) ;; language for game text
|
||||
)
|
||||
@@ -168,6 +169,7 @@
|
||||
(set! (-> obj memcard-volume-dialog) 0.75)
|
||||
(set! (-> obj memcard-vibration?) #t)
|
||||
(set! (-> obj memcard-subtitles?) #f)
|
||||
(set! (-> obj hint-subtitles?) #t)
|
||||
0)
|
||||
|
||||
(defmethod reset-extra ((obj pc-settings-jak2) (call-handlers symbol))
|
||||
|
||||
@@ -322,6 +322,7 @@
|
||||
(set! (-> *setting-control* user-default music-volume) (-> obj memcard-volume-music))
|
||||
(set! (-> *setting-control* user-default dialog-volume) (-> obj memcard-volume-dialog))
|
||||
(set! (-> *setting-control* user-default vibration) (-> obj memcard-vibration?))
|
||||
(set! (-> *setting-control* user-default subtitle) (-> obj memcard-subtitles?))
|
||||
obj)
|
||||
|
||||
(defmethod set-game-setting! ((obj pc-settings-jak2) (setting symbol) (value symbol))
|
||||
@@ -767,6 +768,7 @@
|
||||
(("cheats-unlocked") (set! (-> obj cheats-unlocked) (the-as pc-cheats (file-stream-read-int file))))
|
||||
(("cheats-backup") (file-stream-read-int file)) ;; TODO - Don't remove this, parsing code can't handle unexpected keys
|
||||
(("memcard-subtitles?") (set! (-> obj memcard-subtitles?) (file-stream-read-symbol file)))
|
||||
(("hint-subtitles?") (set! (-> obj hint-subtitles?) (file-stream-read-symbol file)))
|
||||
(("music-unlocked")
|
||||
(dotimes (i (/ (align64 (-> obj music-unlocked length)) 64))
|
||||
(bit-array<-int64 (-> obj music-unlocked) (* i 64) (file-stream-read-int file))
|
||||
@@ -819,6 +821,7 @@
|
||||
(format file " (cheats-purchased #x~x)~%" (-> obj cheats-purchased))
|
||||
(format file " (cheats-unlocked #x~x)~%" (-> obj cheats-unlocked))
|
||||
(format file " (memcard-subtitles? ~A)~%" (-> obj memcard-subtitles?))
|
||||
(format file " (hint-subtitles? ~A)~%" (-> obj hint-subtitles?))
|
||||
|
||||
(format file " (music-unlocked")
|
||||
(dotimes (i (/ (align64 (-> obj music-unlocked length)) 64))
|
||||
|
||||
@@ -336,6 +336,17 @@ This gives us more freedom to write code how we want.
|
||||
(pc-settings-save)
|
||||
(set! (-> *setting-control* user-default subtitle) val))))
|
||||
|
||||
(defmacro game-options-pc-hint-subtitle-toggle ()
|
||||
`(new 'static 'menu-generic-boolean-option
|
||||
:name (text-id progress-hint-subtitles)
|
||||
:truthy-text (text-id progress-on)
|
||||
:falsey-text (text-id progress-off)
|
||||
:get-value-fn (lambda () (-> *pc-settings* hint-subtitles?))
|
||||
:should-disable? (lambda () (not (-> *pc-settings* memcard-subtitles?)))
|
||||
:on-confirm (lambda ((val symbol))
|
||||
(set! (-> *pc-settings* hint-subtitles?) val)
|
||||
(pc-settings-save))))
|
||||
|
||||
(defmacro game-options-pc-subtitle-language ()
|
||||
`(new 'static 'menu-generic-carousel-option
|
||||
:name (text-id progress-sound-subtitle-language)
|
||||
@@ -454,6 +465,7 @@ This gives us more freedom to write code how we want.
|
||||
(progress-new-generic-scrolling-page (text-id progress-root-game-options)
|
||||
(game-options-pc-input-options)
|
||||
(game-options-pc-subtitle-toggle)
|
||||
(game-options-pc-hint-subtitle-toggle)
|
||||
(game-options-pc-subtitle-language)
|
||||
(game-options-pc-sound-language)
|
||||
(game-options-pc-text-language)
|
||||
@@ -466,6 +478,7 @@ This gives us more freedom to write code how we want.
|
||||
(progress-new-generic-scrolling-page (text-id progress-root-game-options)
|
||||
(game-options-pc-input-options)
|
||||
(game-options-pc-subtitle-toggle)
|
||||
(game-options-pc-hint-subtitle-toggle)
|
||||
(game-options-pc-subtitle-language)
|
||||
(game-options-pc-sound-language)
|
||||
(game-options-pc-text-language)
|
||||
|
||||
@@ -471,7 +471,9 @@
|
||||
(set! (-> self font origin y) cur-y)
|
||||
|
||||
;; check if we should actually draw subtitles and do it
|
||||
(when (and (-> *setting-control* user-current subtitle) (or *gui-kick-str* (= *master-mode* 'game)))
|
||||
(when (and (-> *setting-control* user-current subtitle)
|
||||
(or (-> self movie-mode?) (-> *pc-settings* hint-subtitles?))
|
||||
(or *gui-kick-str* (= *master-mode* 'game)))
|
||||
(set-action! *gui-control* (gui-action play) (-> self gui-id)
|
||||
(gui-channel none) (gui-action none) (the-as string #f) (the-as (function gui-connection symbol) #f) (the-as process #f))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user