mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 11:26:18 -04:00
g/jak2: allow L1 + R1 + Start
to open speedrun menu as well (#3131)
This commit is contained in:
parent
a0e998afb3
commit
fff3a85531
|
@ -34,7 +34,8 @@
|
|||
(deftype speedrun-menu (process-drawable)
|
||||
((popup-menu popup-menu)
|
||||
(draw-menu? symbol)
|
||||
(ignore-menu-toggle? symbol))
|
||||
(ignore-menu-toggle? symbol)
|
||||
(opened-with-start? symbol))
|
||||
(:methods
|
||||
(draw! (_type_) none))
|
||||
(:states
|
||||
|
|
|
@ -94,6 +94,7 @@
|
|||
(set! (-> *speedrun-menu* 0 popup-menu) *speedrun-popup-menu*)
|
||||
(set! (-> *speedrun-menu* 0 draw-menu?) #f)
|
||||
(set! (-> *speedrun-menu* 0 ignore-menu-toggle?) #f)
|
||||
(set! (-> *speedrun-menu* 0 opened-with-start?) #f)
|
||||
(go idle)
|
||||
(none))
|
||||
|
||||
|
@ -125,25 +126,35 @@
|
|||
|
||||
(defmethod draw! ((this speedrun-menu))
|
||||
;; handle opening and closing the menu
|
||||
;; allow the menu to be toggled again once one of the currents is released
|
||||
;; allow the menu to be toggled again once one of the current buttons are released
|
||||
(when (and (-> this ignore-menu-toggle?)
|
||||
(or (not (cpad-hold? 0 l1)) (not (cpad-hold? 0 r1)) (not (cpad-hold? 0 select))))
|
||||
(or (not (cpad-hold? 0 l1)) (not (cpad-hold? 0 r1)))
|
||||
(or (and (-> this opened-with-start?) (not (cpad-hold? 0 start)))
|
||||
(and (not (-> this opened-with-start?)) (not (cpad-hold? 0 select)))))
|
||||
(set! (-> this ignore-menu-toggle?) #f))
|
||||
(when (and (cpad-hold? 0 l1) (cpad-hold? 0 r1) (cpad-hold? 0 select)
|
||||
(when (and (cpad-hold? 0 l1) (cpad-hold? 0 r1) (or (cpad-hold? 0 select) (cpad-hold? 0 start))
|
||||
(not (-> this ignore-menu-toggle?)))
|
||||
(cond
|
||||
((= *master-mode* 'game)
|
||||
(set-master-mode 'menu)
|
||||
(set! (-> this draw-menu?) #t))
|
||||
(set-master-mode 'menu)
|
||||
(set! (-> this draw-menu?) #t))
|
||||
((= *master-mode* 'menu)
|
||||
(set-master-mode 'game)
|
||||
(set! (-> this draw-menu?) #f)))
|
||||
(set-master-mode 'game)
|
||||
(set! (-> this draw-menu?) #f)))
|
||||
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons l1))
|
||||
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons l1))
|
||||
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons r1))
|
||||
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons r1))
|
||||
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons select))
|
||||
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons select))
|
||||
;; Track whether or not the menu was opened with start or select...
|
||||
(cond
|
||||
((cpad-hold? 0 select)
|
||||
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons select))
|
||||
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons select))
|
||||
(set! (-> this opened-with-start?) #f))
|
||||
((cpad-hold? 0 start)
|
||||
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons start))
|
||||
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons start))
|
||||
(set! (-> this opened-with-start?) #t)))
|
||||
(set! (-> this ignore-menu-toggle?) #t))
|
||||
(when (-> this draw-menu?)
|
||||
;; handle any inputs for within the menu
|
||||
|
|
Loading…
Reference in a new issue