From 62fa9d80e16e9e17c388ed12586e11aabba15d2a Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Sat, 9 Mar 2024 14:45:49 -0500 Subject: [PATCH] Fix minor issues related to the speedrunner mode menu, also stop saving the `pc-settings` every frame when sr mode is on (#3413) Fixes #3209 --- goal_src/jak2/pc/features/autosplit.gc | 2 +- goal_src/jak2/pc/features/speedruns.gc | 3 +++ goal_src/jak2/pc/pckernel.gc | 11 +++++++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/goal_src/jak2/pc/features/autosplit.gc b/goal_src/jak2/pc/features/autosplit.gc index 9fc7a7e7f5..430549bfd4 100644 --- a/goal_src/jak2/pc/features/autosplit.gc +++ b/goal_src/jak2/pc/features/autosplit.gc @@ -18,7 +18,7 @@ (defmethod update! ((this autosplit-info)) ;; general statistics - ;; when we are blacked out in loads the value of these are temporarily 0, and that messes with the auto splitter. + ;; when we are blacked out in loads the value of these are temporarily 0, and that messes with the auto splitter. (let ((in-blackout? (>= (-> *game-info* blackout-time) (current-time)))) (when (not in-blackout?) (set! (-> this num-orbs) (the int (-> *game-info* skill-total))) diff --git a/goal_src/jak2/pc/features/speedruns.gc b/goal_src/jak2/pc/features/speedruns.gc index 50a2c1cdfe..ebefbf7ade 100644 --- a/goal_src/jak2/pc/features/speedruns.gc +++ b/goal_src/jak2/pc/features/speedruns.gc @@ -492,6 +492,9 @@ (none))) (defmethod draw-menu ((this speedrun-manager)) + ;; don't allow the menu to open during blackouts, apparently causes bugs + (when (>= (-> *game-info* blackout-time) (current-time)) + (return 0)) ;; handle opening and closing the menu (cond ((!= (-> *pc-settings* speedrunner-mode-custom-bind) 0) diff --git a/goal_src/jak2/pc/pckernel.gc b/goal_src/jak2/pc/pckernel.gc index f24475f841..ebbfe0e6ed 100644 --- a/goal_src/jak2/pc/pckernel.gc +++ b/goal_src/jak2/pc/pckernel.gc @@ -674,10 +674,13 @@ ) ))) - (when (or (!= old (-> *pc-settings* cheats)) - (!= old-unlocked (-> *pc-settings* cheats-unlocked)) - (!= old-purchased (-> *pc-settings* cheats-purchased)) - (!= old-revealed (-> *pc-settings* cheats-revealed))) + ;; when speedrunning...the cheats are manually modified to facilitate the chosen category + ;; don't persist these and don't spam the pc-settings saving routine every frame. + (when (and (not (-> *pc-settings* speedrunner-mode?)) + (or (!= old (-> *pc-settings* cheats)) + (!= old-unlocked (-> *pc-settings* cheats-unlocked)) + (!= old-purchased (-> *pc-settings* cheats-purchased)) + (!= old-revealed (-> *pc-settings* cheats-revealed)))) ;; save pc-settings if we made new progress (pc-settings-save)))