[jak2] Custom speedrun category continue select#3652
Draft
dallmeyer wants to merge 1 commit into
Draft
Conversation
dallmeyer
commented
Sep 5, 2024
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))))) |
Contributor
Author
There was a problem hiding this comment.
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?)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WIP - need to consolidate the existing
continue_point_namewith thecontinue_pointfield I added.Right now its completely functional, but
continue_pointis persisted as a u32 in the json - would be nice if it could be the string literal instead likecontinue_point_name.