Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jak2] Custom speedrun category continue select #3652

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dallmeyer
Copy link
Contributor

WIP - need to consolidate the existing continue_point_name with the continue_point field I added.

Right now its completely functional, but continue_point is persisted as a u32 in the json - would be nice if it could be the string literal instead like continue_point_name.

Comment on lines +37 to +53
(defun build-main-continue-point-list ()
;; reset list just to be safe
(set! *main-continue-point-list* '())
(let ((lvl-ptr *level-load-list*))
;; loop thru levels
(while (not (null? lvl-ptr))
(let* ((lvl (the-as level-load-info (-> (the-as symbol (car lvl-ptr)) value)))
(continue-ptr (-> lvl continues)))
(when (is-main-level? (-> lvl name))
;; loop thru level's continues
(while (not (null? continue-ptr))
(let ((cont (the-as continue-point (car continue-ptr))))
(when (is-main-continue? cont)
;; this continue is valid, push to list
(cons! *main-continue-point-list* (-> cont name))))
(set! continue-ptr (cdr continue-ptr)))))
(set! lvl-ptr (cdr lvl-ptr)))))
Copy link
Contributor Author

@dallmeyer dallmeyer Sep 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the popup-menu-dynamic-submenu iterates their lists by index, I figured it was better to flatten these once, rather than traverse the entire *level-load-list* every time we want to lookup continue points by index.

Open to other ideas too (we could instead have a static list, which would allow us to sort things nicely?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant