Skip to content

Commit

Permalink
g/j2: speed up level-select menu scrolling (#3013)
Browse files Browse the repository at this point in the history
  • Loading branch information
xTVaser authored Sep 23, 2023
1 parent ff924f6 commit 2e43e18
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions goal_src/jak2/engine/ui/progress/progress.gc
Original file line number Diff line number Diff line change
Expand Up @@ -2880,6 +2880,42 @@
)
)
)
;; og:preserve-this - Added to make scrolling these menus faster (jak3 has this)
((or (cpad-pressed? 0 left) (and (cpad-hold? 0 left) (>= (- (current-time) (-> obj last-move)) (seconds 0.075))))
(when (> (-> obj task-index) 0)
(set! (-> obj last-move) (current-time))
(set! s4-0 #t)
(set! (-> obj task-index) (max (- (-> obj task-index) 5) 0))
(set! (-> arg0 sliding-height) 0.0)))
;; og:preserve-this - Added to make scrolling these menus faster (jak3 has this)
((or (cpad-pressed? 0 right) (and (cpad-hold? 0 right) (>= (- (current-time) (-> obj last-move)) (seconds 0.075))))
(let ((max-task-index -1))
(dotimes (s2-0 (-> *game-info* play-list length))
(let* ((v1-41 (-> *game-info* play-list s2-0))
(a0-20 (-> arg0 current))
(a0-22 (cond
((= a0-20 'select-pre-start)
(or (-> v1-41 play-continue) (-> v1-41 pre-play-continue))
)
((= a0-20 'select-kiosk-start)
(-> v1-41 kiosk-play-continue)
)
(else
(-> v1-41 play-continue)
)
)
)
)
(if (and a0-22 (lookup-text! *common-text* (-> v1-41 text-name) #t))
(+! max-task-index 1)
)
)
)
(when (< (-> obj task-index) max-task-index)
(set! (-> obj last-move) (current-time))
(set! s4-0 #t)
(set! (-> obj task-index) (min (+ (-> obj task-index) 5) max-task-index))
(set! (-> arg0 sliding-height) 0.0))))
((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))
Expand Down

0 comments on commit 2e43e18

Please sign in to comment.