[jak2] graphic options menu proof of concept (#2849)

![imagem](https://github.com/open-goal/jak-project/assets/7569514/b8eaa0b6-7c51-4bd8-96ac-5fb2e0d08c4a)

![imagem](https://github.com/open-goal/jak-project/assets/7569514/d2742cef-98d4-43e4-a48d-cc1996e41612)

(The "Custom" option does not do anything right now.)
This commit is contained in:
ManDude
2023-07-29 18:08:44 +01:00
committed by GitHub
parent 748a9f3b41
commit a626b6b60d
16 changed files with 789 additions and 78 deletions
+1 -1
View File
@@ -38,7 +38,7 @@
(idle () _type_ :state 21)
(go-away () _type_ :state 22)
(gone () _type_ :state 23)
(init-defaults (_type_) connection 24)
(init-defaults (_type_) object 24)
(respond-to-cpad (_type_) none 25)
(gone? (_type_) object 26)
(can-go-back? (_type_) symbol 27)
+14 -19
View File
@@ -35,8 +35,8 @@
(game-options-language-index int32 :offset-assert 152)
(game-options-subtitle-language-index int32 :offset-assert 156)
(graphic-options-item-selected int32 :offset-assert 160)
(graphic-options-item-picked basic :offset-assert 164)
(graphic-options-last-move uint64 :offset-assert 168)
(graphic-options-item-picked symbol :offset-assert 164)
(graphic-options-last-move time-frame :offset-assert 168)
(graphic-options-aspect-ratio symbol :offset-assert 176)
(graphic-options-progressive-scan symbol :offset-assert 180)
(qr-options-item-selected int32 :offset-assert 184)
@@ -157,6 +157,7 @@
)
;; definition for method 24 of type progress
;; WARN: Return type mismatch connection vs object.
(defmethod init-defaults progress ((obj progress))
"Initialize default menu settings."
(set! (-> *progress-state* aspect-ratio-choice) (get-aspect-ratio))
@@ -223,7 +224,7 @@
(&-> *setting-control* user-default dialog-volume)
)
(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)
(the-as object (set-setting-by-param *setting-control* 'extra-bank '((force2 menu1)) 0 0))
)
;; definition of type hud-ring-cell
@@ -3553,7 +3554,7 @@
)
;; definition for function update-center-screen
(defun update-center-screen ()
(defun update-center-screen ((arg0 menu-graphic-option) (arg1 progress) (arg2 symbol))
(let ((v1-0 #f))
(cond
(#t
@@ -3616,10 +3617,10 @@
(cond
((or (cpad-pressed? 0 down l-analog-down)
(and (cpad-hold? 0 down l-analog-down)
(>= (- (current-time) (the-as int (-> *progress-state* graphic-options-last-move))) (seconds 0.5))
(>= (- (current-time) (-> *progress-state* graphic-options-last-move)) (seconds 0.5))
)
)
(set! (-> *progress-state* graphic-options-last-move) (the-as uint (current-time)))
(set! (-> *progress-state* graphic-options-last-move) (current-time))
(set! (-> arg0 selected-option) #f)
(cond
((< (-> *progress-state* graphic-options-item-selected) (if (= (scf-get-territory) 1)
@@ -3638,10 +3639,10 @@
)
((or (cpad-pressed? 0 up l-analog-up)
(and (cpad-hold? 0 up l-analog-up)
(>= (- (current-time) (the-as int (-> *progress-state* graphic-options-last-move))) (seconds 0.5))
(>= (- (current-time) (-> *progress-state* graphic-options-last-move)) (seconds 0.5))
)
)
(set! (-> *progress-state* graphic-options-last-move) (the-as uint (current-time)))
(set! (-> *progress-state* graphic-options-last-move) (current-time))
(set! (-> arg0 selected-option) #f)
(cond
((> (-> *progress-state* graphic-options-item-selected) 0)
@@ -3661,8 +3662,8 @@
((cpad-pressed? 0 confirm)
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
(set! (-> *progress-state* graphic-options-last-move) (the-as uint (current-time)))
(set! (-> *progress-state* graphic-options-item-picked) (the-as basic #t))
(set! (-> *progress-state* graphic-options-last-move) (current-time))
(set! (-> *progress-state* graphic-options-item-picked) #t)
(set! (-> arg0 selected-option) #f)
(sound-play "generic-beep")
)
@@ -3699,10 +3700,7 @@
((and (zero? (-> *progress-state* graphic-options-item-selected))
(cpad-pressed? 0 up right down left l-analog-up l-analog-right l-analog-down l-analog-left)
)
(let ((t9-13 update-center-screen))
#t
(t9-13)
)
(update-center-screen obj arg0 #t)
)
((and (= (-> *progress-state* graphic-options-item-selected) 1) (cpad-pressed? 0 left l-analog-left))
(sound-play "generic-beep")
@@ -3741,12 +3739,9 @@
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
(sound-play "generic-beep")
(when (zero? (-> *progress-state* graphic-options-item-selected))
(let ((t9-28 update-center-screen))
#t
(t9-28)
(if (zero? (-> *progress-state* graphic-options-item-selected))
(update-center-screen obj arg0 #t)
)
)
(when (= (-> *progress-state* graphic-options-item-selected) 1)
(if (!= (-> *progress-state* graphic-options-aspect-ratio) (-> *setting-control* user-default aspect-ratio))
(set! (-> *setting-control* user-default aspect-ratio) (-> *progress-state* graphic-options-aspect-ratio))