diff --git a/decompiler/config/jak3/all-types.gc b/decompiler/config/jak3/all-types.gc index eac8c2aad9..892df647e8 100644 --- a/decompiler/config/jak3/all-types.gc +++ b/decompiler/config/jak3/all-types.gc @@ -71,6 +71,11 @@ (uk-english 11) ) +(defenum language-enum-s32 + :type int32 + :copy-entries language-enum + ) + (define-extern *debug-segment* symbol) (define-extern nothing (function none)) (define-extern _format (function _varargs_ object)) @@ -10036,8 +10041,258 @@ (credits-08b6 #x08b6) ;; PC port IDs START - (discord-rpc-not-in-mission #x1200) - (discord-rpc-in-side-mission #x1201) + (discord-rpc-not-in-mission #x11fe) + (discord-rpc-in-side-mission #x11ff) + (progress-display-mode #x1200) + (progress-windowed #x1201) + (progress-fullscreen #x1202) + (progress-borderless #x1203) + (progress-aspect-ratio-auto #x1204) + (progress-aspect-ratio-custom #x1205) + (progress-aspect-ratio-4x3 #x1206) + (progress-aspect-ratio-16x9 #x1207) + (progress-aspect-ratio-custom-title #x1208) + (progress-aspect-ratio-custom-pad-x #x1209) + (progress-aspect-ratio-custom-pad-circle #x120a) + (progress-aspect-ratio-custom-warn #x120b) + (progress-music-player #x120c) + (progress-vsync #x120d) + (progress-text-language #x120e) + (progress-cheats #x120f) + (progress-aspect-ratio-custom-width #x1210) + (progress-aspect-ratio-custom-height #x1211) + (progress-music-player-locked #x1212) + (progress-music-player-now-playing #x1213) + (progress-music-player-no-track #x1214) + (progress-music-player-flava-default #x1215) + (progress-music-player-flava-gun #x1216) + (progress-music-player-flava-board #x1217) + (progress-music-player-flava-mech #x1218) + (progress-music-player-flava-darkjak #x1219) + (progress-music-player-flava-pilot #x121a) + (progress-music-player-danger #x121b) + (progress-music-player-danger-0 #x121c) + (progress-music-player-danger-1 #x121d) + (progress-music-player-danger-2 #x121e) + (progress-music-player-danger-3 #x121f) + (progress-music-player-city #x1220) + (progress-music-player-city-battle #x1221) + (progress-music-player-battle #x1222) + (progress-music-player-danger2 #x1223) + (progress-music-player-danger3 #x1224) + (progress-music-player-danger4 #x1225) + (progress-music-player-danger6 #x1226) + (progress-music-player-danger7 #x1227) + (progress-music-player-danger9 #x1228) + (progress-music-player-danger10 #x1229) + (progress-music-player-danger11 #x122a) + (progress-music-player-atoll #x122b) + (progress-music-player-atoll-battle #x122c) + (progress-music-player-strip #x122d) + (progress-music-player-forest #x122e) + (progress-music-player-forest-battle #x122f) + (progress-music-player-sewer #x1230) + (progress-music-player-sewer-battle #x1231) + (progress-music-player-mountain #x1232) + (progress-music-player-mountain-battle #x1233) + (progress-music-player-palcab #x1234) + (progress-music-player-palcab-battle #x1235) + (progress-music-player-race #x1236) + (progress-music-player-ruins #x1237) + (progress-window-size #x1238) + (progress-window-size-decoration #x1239) + (progress-game-res #x123a) + (progress-game-res-decoration #x123b) + (progress-lod-bg #x123c) + (progress-lod-fg #x123d) + (progress-subtitle-speaker #x123f) + (progress-subtitle-speaker-off #x1240) + (progress-subtitle-speaker-auto #x1241) + (progress-subtitle-speaker-on #x1242) + (progress-territory #x1243) + (progress-territory-scea #x1244) + (progress-territory-scee #x1245) + (progress-territory-scei #x1246) + (progress-territory-scek #x1247) + (progress-msaa #x1248) + (progress-msaa-x #x1249) + (progress-led-options #x124a) + (progress-led-state #x124b) + (progress-led-health #x124c) + (progress-disable-auto-save #x124d) + (progress-auto-save-disabled #x124e) + (progress-disable-auto-save-warn #x124f) + (progress-cheats-turbo-board #x1250) + (progress-cheats-health-bars #x1251) + (progress-cheats-vehicle-health-bars #x1252) + (progress-cheats-vehicle-invuln #x1253) + (progress-cheats-statistics #x1254) + (progress-cheats-suck-in-all #x1255) + (progress-cheats-music-player #x1256) + (progress-cheats-no-textures #x1257) + (progress-cheats-fast-movies #x1258) + (progress-cheats-slow-movies #x1259) + (progress-cheats-fast-speed #x125a) + (progress-cheats-slow-speed #x125b) + (progress-cheats-fast-travel #x125c) + (progress-cheats-orb-tracker #x125d) + (progress-cheats-real-time-of-day #x125e) + (progress-cheats-city-peace #x125f) + (progress-cheats-board-tricks #x1260) + (progress-cheats-weather-bad #x1261) + (progress-cheats-weather-good #x1262) + (progress-cheats-hijack-lines #x1263) + (progress-cheats-locked #x1264) + (progress-cheats-turbo-board-unlock #x1265) + (progress-cheats-health-bars-unlock #x1266) + (progress-cheats-vehicle-health-bars-unlock #x1267) + (progress-cheats-statistics-unlock #x1268) + (progress-cheats-suck-in-all-unlock #x1269) + (progress-cheats-fast-travel-unlock #x126a) + ; (progress-camera-options #x1280) + ; (progress-camera-options-first-horz #x1281) + ; (progress-camera-options-first-vert #x1282) + ; (progress-camera-options-third-horz #x1283) + ; (progress-camera-options-third-vert #x1284) + (progress-normal #x1286) + (progress-inverted #x1287) + (progress-ps2-parts #x1288) + (progress-discord-rpc #x1289) + (progress-lod-default #x128a) + (progress-lod-low #x128b) + (progress-lod-high #x128c) + (progress-credits #x128d) + (progress-frame-rate #x128e) + (progress-misc-game-options #x128f) + (progress-speedrunner-mode #x1290) + (progress-menu-input-options #x1291) + (progress-restore-defaults #x1292) + (progress-menu-controller-options #x1293) + (progress-controller-options-select-controller #x1294) + (progress-controller-options-analog-deadzone #x1295) + (progress-controller-options-ignore-if-unfocused #x1296) + (progress-controller-options-led-hp #x1297) + (progress-controller-options-led-state #x1298) + (progress-input-options-enable-keyboard #x1299) + (progress-input-options-enable-mouse #x129a) + (progress-menu-mouse-options #x129b) + (progress-mouse-options-track-camera #x129c) + (progress-mouse-options-horz-sens #x129d) + (progress-mouse-options-vert-sens #x129e) + (progress-mouse-options-player-movement #x129f) + (progress-shadows #x12a0) + (progress-shadows-normal #x12a1) + (progress-shadows-extended #x12a2) + (progress-error-no-resolutions #x12a3) + (progress-territory-auto #x12a4) + (progress-kill-stats #x12a5) + (progress-other-stats #x12a6) + (progress-ks-total-killed #x12a7) + (progress-ks-killed-by-jak #x12a8) + (progress-ks-killed-by-darkjak #x12a9) + (progress-ks-killed-by-daxter #x12aa) + (progress-ks-killed-by-others #x12ab) + (progress-ks-source-gun-yellow #x12ac) + (progress-ks-source-gun-red #x12ad) + (progress-ks-source-gun-blue #x12ae) + (progress-ks-source-gun-dark #x12af) + (progress-ks-source-board #x12b0) + (progress-ks-source-board-trick #x12b1) + (progress-ks-source-mech #x12b2) + (progress-ks-source-mech-bonk #x12b3) + (progress-ks-source-turret #x12b4) + (progress-ks-source-punch #x12b5) + (progress-ks-source-flop #x12b6) + (progress-ks-source-uppercut #x12b7) + (progress-ks-source-spin #x12b8) + (progress-ks-source-roll #x12b9) + (progress-ks-source-darkjak-punch #x12ba) + (progress-ks-source-darkjak-flop #x12bb) + (progress-ks-source-darkjak-uppercut #x12bc) + (progress-ks-source-darkjak-spin #x12bd) + (progress-ks-source-darkjak-roll #x12be) + (progress-ks-source-darkjak-bomb0 #x12bf) + (progress-ks-source-darkjak-bomb1 #x12c0) + (progress-ks-source-indax-punch #x12c1) + (progress-ks-source-indax-spin #x12c2) + (progress-ks-source-guard #x12c3) + (progress-ks-source-sig #x12c4) + (progress-ks-source-ashelin #x12c5) + (progress-ks-source-jinx #x12c6) + (progress-ks-source-grim #x12c7) + (progress-ks-source-mog #x12c8) + (progress-ks-source-metalhead #x12c9) + (progress-ks-source-other-bot #x12ca) + (progress-ks-source-other-enemy #x12cb) + (progress-input-options-auto-hide-cursor #x1300) + (progress-menu-reassign-binds #x1301) + (progress-reassign-binds-controller #x1302) + (progress-reassign-binds-keyboard #x1303) + (progress-reassign-binds-mouse #x1304) + (progress-multiselect-no-items-found #x1305) + (progress-keybinds-waiting-for-bind #x1306) + (progress-keybinds-unset #x1307) + (progress-unknown-option #x1308) + (progress-hires-sky #x1309) + (progress-fast-airlock #x130a) + (progress-fast-elevator #x130b) + (progress-highscores-header-speedrun #x130c) + (progress-highscores-subheader-speedrun-any #x130d) + (progress-highscores-subheader-speedrun-anyhoverless #x130e) + (progress-highscores-subheader-speedrun-allmissions #x130f) + (progress-highscores-subheader-speedrun-100 #x1310) + (progress-highscores-subheader-speedrun-anyorbs #x1311) + (progress-highscores-subheader-speedrun-anyhero #x1312) + (progress-highscores-local-time #x1313) + (progress-fps-disclaimer-warning #x1314) + (progress-fps-disclaimer #x1315) + (progress-highscores-local-score #x1316) + (trick-board-none #x1320) + (trick-board-spin #x1321) + (trick-board-boost #x1322) + (trick-board-flip #x1323) + (trick-board-rail #x1324) + (trick-board-rail-jump #x1325) + (trick-board-nosegrab #x1326) + (trick-board-method #x1327) + (trick-board-board-spin #x1328) + (trick-board-board-flip #x1329) + (trick-board-noseflip #x132a) + (trick-board-kickflip #x132b) + (trick-board-jump #x132c) + (trick-board-duck-jump #x132d) + (trick-board-quick-jump #x132e) + (trick-darkjak #x132f) + (trick-darkjak-bomb0 #x1330) + (trick-darkjak-bomb1 #x1331) + (trick-darkjak-giant #x1332) + (progress-graphics-ps2 #x1333) + (progress-graphics-actor-culling #x1334) + (progress-graphics-force-envmap #x1335) + (progress-fast-progress #x1336) + (progress-graphics-ps2-lod-dist #x1337) + (progress-graphics-msaa-off #x1338) + (progress-graphics-display #x1339) + (language-name-finnish #x133a) + (progress-hint-subtitles #x133b) + (language-name-portuguese #x133c) + (language-name-swedish #x133d) + (language-name-danish #x133e) + (language-name-norwegian #x133f) + (language-name-dutch #x1340) + (language-name-br-portuguese #x1341) + (language-name-hungarian #x1342) + (language-name-catalan #x1343) + (language-name-icelandic #x1344) + (language-name-polish #x1345) + (language-name-lithuanian #x1346) + (language-name-czech #x1347) + (language-name-croatian #x1348) + (language-name-galician #x1349) + (progress-controller-options-enable-pressure-sensitivity #x134a) + (progress-controller-options-swap-r1-r2 #x134b) + (progress-controller-options-enable-trigger-effects #x134c) + (progress-misc-fix-projectile-focus #x134d) ) ;; ---text-h:text-id @@ -27740,30 +27995,30 @@ (state-array symbol 8 :offset-assert 432) (option-index-stack int32 8 :offset-assert 464) ;; guessed by decompiler (state-pos int32 :offset-assert 496) - (secret-buying basic :offset-assert 500) - (secret-buy-choice basic :offset-assert 504) + (secret-buying symbol :offset-assert 500) + (secret-buy-choice symbol :offset-assert 504) (scanlines-alpha float :offset-assert 508) (start-time time-frame :offset-assert 512) (which-slot int32 :offset-assert 520) - (starting-state basic :offset-assert 524) - (yes-no-choice basic :offset-assert 528) + (starting-state symbol :offset-assert 524) + (yes-no-choice symbol :offset-assert 528) (time-out time-frame :offset-assert 536) (last-sound time-frame :offset-assert 544) (last-move time-frame :offset-assert 552) (center-x-backup int32 :offset-assert 560) (center-y-backup int32 :offset-assert 564) - (flip-horizontal basic :offset-assert 568) - (flip-vertical basic :offset-assert 572) - (progressive-scan basic :offset-assert 576) - (aspect-ratio basic :offset-assert 580) - (video-mode basic :offset-assert 584) + (flip-horizontal symbol :offset-assert 568) + (flip-vertical symbol :offset-assert 572) + (progressive-scan symbol :offset-assert 576) + (aspect-ratio symbol :offset-assert 580) + (video-mode symbol :offset-assert 584) (stereo-mode-backup int32 :offset-assert 588) - (vibrations basic :offset-assert 592) - (subtitles basic :offset-assert 596) - (languages int32 3 :offset-assert 600) - (subtitle-language-index int32 :offset 600) - (language-index int32 :offset 604) - (audio-language-index int32 :offset 608) + (vibrations symbol :offset-assert 592) + (subtitles symbol :offset-assert 596) + (languages language-enum-s32 3 :offset-assert 600) + (subtitle-language-index language-enum-s32 :offset 600) + (language-index language-enum-s32 :offset 604) + (audio-language-index language-enum-s32 :offset 608) (current-task-index int32 :offset-assert 612) (current-line-index int32 :offset-assert 616) (first-closed-line-index int32 :offset-assert 620) @@ -27789,7 +28044,7 @@ ) (:methods (init-defaults (_type_) object) ;; 24 - (respond-to-cpad (_type_) none) ;; 25 + (respond-to-cpad (_type_) object) ;; 25 (gone? (_type_) object) ;; 26 (can-go-back? (_type_) symbol) ;; 27 (get-state-check-card (_type_ symbol) symbol) ;; 28 @@ -27797,27 +28052,27 @@ (pop-state (_type_) int) ;; 30 (set-next-state (_type_ symbol int) int) ;; 31 (set-menu-options (_type_ symbol) int) ;; 32 - (progress-method-33 (_type_ progress-box) none) ;; 33 - (progress-method-34 (_type_) none) ;; 34 + (progress-method-33 (_type_ progress-box) object) ;; 33 + (progress-method-34 (_type_) object) ;; 34 (get-scissor-stack-top (_type_) vector) ;; 35 (get-language-by-idx (_type_ int) int) ;; 36 - (progress-method-37 (_type_) none) ;; 37 - (progress-method-38 (_type_ font-context float) none) ;; 38 - (progress-method-39 (_type_) none) ;; 39 - (progress-method-40 (_type_ font-context int int float) none) ;; 40 - (progress-method-41 (_type_ progress-box float) none) ;; 41 - (progress-method-42 (_type_ progress-box float) none) ;; 42 - (progress-method-43 (_type_ progress-box float) none) ;; 43 - (progress-method-44 (_type_ font-context string) none) ;; 44 + (set-selected-color (_type_) object) ;; 37 + (adjust-font-origin-y (_type_ font-context float) object) ;; 38 + (progress-method-39 (_type_) object) ;; 39 + (draw-highlight-bar (_type_ font-context int int float) object) ;; 40 + (draw-bg-box-outline (_type_ progress-box float) object) ;; 41 + (draw-bg-box-alpha-2 (_type_ progress-box float) object) ;; 42 + (draw-bg-box-alpha-1 (_type_ progress-box float) object) ;; 43 + (progress-method-44 (_type_ font-context string) object) ;; 44 (progress-method-45 (_type_ font-context float float string float float int) float) ;; 45 - (progress-method-46 (_type_ font-context float int) none) ;; 46 - (progress-method-47 (_type_ font-context symbol symbol) none) ;; 47 - (draw-prev-next-footer (_type_ font-context float) none) ;; 48 - (draw-yes-no-style-footer (_type_ font-context text-id text-id) none) ;; 49 - (progress-method-50 (_type_ font-context text-id text-id text-id symbol symbol float) none) ;; 50 - (progress-method-51 (_type_ font-context) none) ;; 51 - (progress-method-52 (_type_ font-context string float float float float float) none) ;; 52 - (progress-method-53 (_type_ font-context) none) ;; 53 + (draw-header (_type_ font-context float text-id) object) ;; 46 + (progress-method-47 (_type_ font-context symbol symbol) object) ;; 47 + (draw-prev-next-footer (_type_ font-context float) object) ;; 48 + (draw-yes-no-style-footer (_type_ font-context text-id text-id) object) ;; 49 + (progress-method-50 (_type_ font-context text-id text-id text-id symbol symbol float) object) ;; 50 + (progress-method-51 (_type_ font-context) object) ;; 51 + (draw-slider-option (_type_ font-context string float float float float float) object) ;; 52 + (progress-method-53 (_type_ font-context) object) ;; 53 ) ) @@ -27844,7 +28099,7 @@ (load-save-3b progress-box :inline :offset-assert 1216) (last-slot-saved int32 :offset-assert 1280) (selected-num int32 :offset-assert 1284) - (secrets-unlocked basic :offset-assert 1288) + (secrets-unlocked symbol :offset-assert 1288) (hero-mode-save symbol :offset-assert 1292) ) :method-count-assert 9 @@ -28170,7 +28425,7 @@ ((current-index float :offset-assert 64) (target-index float :offset-assert 68) (scroll-speed float :offset-assert 72) - (on-screen basic :offset-assert 76) + (on-screen symbol :offset-assert 76) ) :method-count-assert 12 :size-assert #x50 @@ -34702,7 +34957,7 @@ (deftype level-exit (process-drawable) ((minimap connection-minimap :offset-assert 200) (task-counter uint32 :offset-assert 204) - (ent basic :offset-assert 208) + (ent entity-actor :offset-assert 208) ) :method-count-assert 21 :size-assert #xd4 @@ -35904,7 +36159,7 @@ (stick-lock symbol :offset-assert 80) (flap-sound-id uint32 :offset-assert 84) (mode-sound-bank connection :offset-assert 88) - (mode basic :offset-assert 92) + (mode symbol :offset-assert 92) (color-index int32 :offset-assert 96) (as-daxter? symbol :offset-assert 100) (art-group-backup art-group :offset-assert 104) @@ -36063,8 +36318,8 @@ (fall-height meters :offset-assert 648) (mech-jump-thrust-fuel float :offset-assert 652) (strafe-jump-pre-window time-frame :offset-assert 656) - (strafe-jump basic :offset-assert 664) - (strafe-duck-jump basic :offset-assert 668) + (strafe-jump symbol :offset-assert 664) + (strafe-duck-jump symbol :offset-assert 668) (dark-jump-height-min meters :offset-assert 672) (dark-jump-height-max meters :offset-assert 676) (ladder-walk-up-speed meters :offset-assert 680) @@ -37748,8 +38003,8 @@ (mech-start-time time-frame :offset-assert 96) ;; time-frame (mech-time time-frame :offset-assert 104) ;; time-frame (no-get-off-time time-frame :offset-assert 112) ;; time-frame - (stick-lock basic :offset-assert 120) - (stick-off basic :offset-assert 124) + (stick-lock symbol :offset-assert 120) + (stick-off symbol :offset-assert 124) (forward-vel meters :offset-assert 128) (jump-thrust meters :offset-assert 132) (jump-thrust-fuel float :offset-assert 136) @@ -37772,8 +38027,8 @@ (exhaust-local-dir vector 2 :inline :offset-assert 400) ;; guessed by decompiler (smoke-local-pos vector 2 :inline :offset-assert 432) ;; guessed by decompiler (smoke-local-vel vector 2 :inline :offset-assert 464) ;; guessed by decompiler - (particle-system-2d basic :offset-assert 496) - (particle-system-3d basic :offset-assert 500) + (particle-system-2d sparticle-system :offset-assert 496) + (particle-system-3d sparticle-system :offset-assert 500) (part-thruster sparticle-launcher :offset-assert 504) (part-thruster-scale-x sp-field-init-spec :offset-assert 508) (part-thruster-scale-y sp-field-init-spec :offset-assert 512) @@ -38692,7 +38947,7 @@ ) (deftype ammo-collectable (collectable) - ((ammo-effect basic :offset-assert 404) + ((ammo-effect sparticle-launch-group :offset-assert 404) ) :method-count-assert 36 :size-assert #x198 @@ -54941,8 +55196,8 @@ ) (deftype prebot-medium-eco-creature (prebot-large-eco-creature) - ((is-top basic :offset-assert 776) - (is-bottom basic :offset-assert 780) + ((is-top symbol :offset-assert 776) + (is-bottom symbol :offset-assert 780) (initial-scale float :offset-assert 784) (final-scale float :offset-assert 788) ) diff --git a/decompiler/config/jak3/ntsc_v1/hacks.jsonc b/decompiler/config/jak3/ntsc_v1/hacks.jsonc index 556909555e..0aafe6edfc 100644 --- a/decompiler/config/jak3/ntsc_v1/hacks.jsonc +++ b/decompiler/config/jak3/ntsc_v1/hacks.jsonc @@ -269,7 +269,11 @@ "~140Hfg-sh: ~8,,0m": 1, "~267Hfg-p2: ~8,,0m~%": 1, "~30Hp2: ~8D~131Hhf: ~8D~%~1K": 2, - "Current time (~d:~d) [mission-percentage ~f~%": 2 + "Current time (~d:~d) [mission-percentage ~f~%": 2, + "~33L~S ~44L~S": 2, + "~44L~S~33L ~S": 2, + "~32L~S~44L ~S": 2, + "~44L~S ~32L~S~1L": 2 }, "blocks_ending_in_asm_branch": { @@ -472,7 +476,7 @@ // where "op" is the op number for the call to format. "dynamic_format_arg_counts": { "auto-save-post": [[182, 1]], - "(method 10 menu-secret-option)": [[289, 1]], + "(method 10 menu-secret-option)": [[289, 0]], "(method 10 menu-create-game-option)": [[49, 1]], "(method 10 menu-format-card-option)": [[49, 1]], "(method 10 menu-card-removed-option)": [[49, 1]], diff --git a/game/assets/jak3/text/game_custom_text_en-US.json b/game/assets/jak3/text/game_custom_text_en-US.json index 4d4270d89e..ce37b4c894 100644 --- a/game/assets/jak3/text/game_custom_text_en-US.json +++ b/game/assets/jak3/text/game_custom_text_en-US.json @@ -1,4 +1,248 @@ { - "1200": "Not in a mission", - "1201": "Playing a bonus mission" + "11fe": "Not in a mission", + "11ff": "Playing a bonus mission", + "1200": "Display Mode", + "1201": "Windowed", + "1202": "Fullscreen", + "1203": "Borderless", + "1204": "Automatic", + "1205": "Custom", + "1206": "4x3 (PS2)", + "1207": "16x9 (PS2)", + "1208": "Choose width and height ratio", + "1209": "Press to confirm and exit.", + "120a": "Press to confirm and exit.", + "120b": "Ratio must not be lower than 4x3!", + "120c": "Music Player", + "120d": "V-Sync", + "120e": "Text Language", + "120f": "OpenGOAL Secrets", + "1210": "Width", + "1211": "Height", + "1212": "??????????", + "1213": "Now playing...", + "1214": "No Track", + "1215": "Default", + "1216": "Morph Gun", + "1217": "JET-Board", + "1218": "Titan Suit", + "1219": "Dark Jak", + "121a": "Vehicle", + "121b": "Danger", + "121c": "None", + "121d": "Low", + "121e": "Medium", + "121f": "High", + "1220": "Haven Exploration", + "1221": "Guard Pursuit", + "1222": "Ram Head Battle (Alt)", + "1223": "Mar's Tomb", + "1224": "Onin Challenge", + "1225": "Metal Kor", + "1226": "Krew Battle", + "1227": "Baron Battle", + "1228": "Bouncing Boulders", + "1229": "Exploding Eco", + "122a": "Fortress Tank", + "122b": "Pumping Station", + "122c": "Protect Sig", + "122d": "Strip Mine", + "122e": "Haven Forest", + "122f": "Forest Dragons", + "1230": "The Fortress", + "1231": "Escape", + "1232": "Mountain Temple", + "1233": "Ram Head Battle", + "1234": "Praxis Palace", + "1235": "Weapons Factory", + "1236": "Arena Race", + "1237": "Dead Town", + "1238": "Window Size", + "1239": "Select Window Size", + "123a": "Game Resolution", + "123b": "Select Game Resolution", + "123c": "Level of Detail (Background)", + "123d": "Level of Detail (Foreground)", + "123f": "Show Speaker in Subtitle", + "1240": "Never", + "1241": "Off-Screen", + "1242": "Always", + "1243": "Game Territory", + "1244": "America (SCEA)", + "1245": "Europe (SCEE)", + "1246": "Japan (SCEI)", + "1247": "Korea (SCEK)", + "1248": "MSAA", + "1249": "~Dx", + "124a": "Controller LED Options", + "124b": "Show Player State", + "124c": "Show Amount of Health", + "124d": "Disable Auto-Save", + "124e": "Auto-Save Disabled", + "124f": "Are you sure you want to disable auto-save?", + "1250": "Turbo JET-Board in Haven City", + "1251": "Enemy Health Bars", + "1252": "Vehicle Health Bars", + "1253": "Vehicle Invulnerability", + "1254": "Statistics", + "1255": "Automatically Grab Collectables", + "1256": "Music Player", + "1257": "No Textures Mode", + "1258": "Fast Movies", + "1259": "Slow Movies", + "125a": "Fast Gameplay", + "125b": "Slow Gameplay", + "125c": "Instant Travel in Haven City", + "125d": "Precursor Orb Tracker", + "125e": "Real Time of Day", + "125f": "Pacified Haven City", + "1260": "JET-Board Trick Display", + "1261": "Bad Weather", + "1262": "Nice Weather", + "1263": "Vehicle Hijack Voice Lines", + "1264": "Locked", + "1265": "Hit all 3 valves and find Mar's Statue in \"~S\" in under ~D seconds", + "1266": "Reduce Haven City's population count by ~D", + "1267": "Reduce Haven City's vehicle count by ~D", + "1268": "Hunt every species of Metal Head", + "1269": "Use the JET-Board to break open containers", + "126a": "Transport the Rift Rider while leaving Samos and Young Samos unscathed", + "1280": "Camera Options", + "1281": "Left/Right (1st Person)", + "1282": "Up/Down (1st Person)", + "1283": "Left/Right (3rd Person)", + "1284": "Up/Down (3rd Person)", + "1285": "Reset to Default", + "1286": "Normal", + "1287": "Inverted", + "1288": "Particle Culling", + "1289": "Discord Rich-Presence", + "128a": "Default", + "128b": "Low", + "128c": "High", + "128d": "Credits", + "128e": "Frame Rate", + "128f": "Miscellaneous", + "1290": "Speedrunner Mode", + "1291": "Input Options", + "1292": "Restore Defaults", + "1293": "Controller Options", + "1294": "Select Controller", + "1295": "Analog Deadzone", + "1296": "Ignore When Window is Unfocused", + "1297": "Use LED for Health", + "1298": "Use LED for Other States", + "1299": "Enable Keyboard", + "129a": "Enable Mouse", + "129b": "Mouse Options", + "129c": "Track Camera", + "129d": "Horizontal Sensitivity", + "129e": "Vertical Sensitivity", + "129f": "Player Movement", + "12a0": "Object Shadows", + "12a1": "Normal", + "12a2": "Extended", + "12a3": "No valid resolutions found.", + "12a4": "Automatic", + "12a5": "Bestiary", + "12a6": "Other Statistics", + "12a7": "Total Killed", + "12a8": "Killed by Jak", + "12a9": "Killed by Dark Jak", + "12aa": "Killed by Daxter", + "12ab": "Killed by Others", + "12ac": "Blaster", + "12ad": "Scatter Gun", + "12ae": "Vulcan Fury", + "12af": "Peacemaker", + "12b0": "JET-Board", + "12b1": "JET-Board Trick", + "12b2": "Titan Suit Punch", + "12b3": "Titan Suit Body", + "12b4": "Gunpod", + "12b5": "Punch", + "12b6": "Flop", + "12b7": "Uppercut", + "12b8": "Spin", + "12b9": "Roll", + "12bf": "Dark Bomb", + "12c0": "Dark Blast", + "12c3": "Krimzon Guard", + "12c4": "Sig", + "12c5": "Ashelin", + "12c6": "Jinx", + "12c7": "Grim", + "12c8": "Mog", + "12c9": "Metal Heads", + "12ca": "Other Friends", + "12cb": "Other Enemies", + "1300": "Auto Hide Cursor", + "1301": "Reassign Binds", + "1302": "Controller Binds", + "1303": "Keyboard Binds", + "1304": "Mouse Binds", + "1305": "No Options", + "1306": "Waiting", + "1307": "Unset", + "1308": "Unknown", + "1309": "High-Resolution Sky", + "130a": "Fast Airlocks and Doors", + "130b": "Fast Elevators", + "130c": "Speedrun", + "130d": "Any%", + "130e": "Any% - Hoverless", + "130f": "All Missions", + "1310": "100%", + "1311": "Any% - All Orbs", + "1312": "Any% - Hero Mode", + "1313": "Local Time", + "1314": "Warning!", + "1315": "This setting is highly experimental. When not played at 60 frames per second, visual and gameplay issues may arise as a result.", + "1316": "Local Score", + "1320": "None", + "1321": "Spin", + "1322": "Boost", + "1323": "Flip", + "1324": "Rail Grind", + "1325": "Rail Jump", + "1326": "Nosegrab", + "1327": "Method", + "1328": "Board Spin", + "1329": "Board Flip", + "132a": "Noseflip", + "132b": "Kickflip", + "132c": "Jump", + "132d": "Duck Jump", + "132e": "Quick Jump", + "132f": "Dark Jak", + "1330": "Dark Bomb", + "1331": "Dark Blast", + "1332": "Dark Giant", + "1333": "PS2 Options", + "1334": "Actor Culling", + "1335": "Force Environment Mapping", + "1336": "Fast Progress Menu", + "1337": "PS2 LOD Distance", + "1338": "Off", + "1339": "Display", + "133a": " Suomi", + "133b": "Hint Subtitles", + "133c": "Português", + "133d": "Svenska ", + "133e": "Dansk", + "133f": "Norsk", + "1340": "Nederlands", + "1341": "Português (Brasil)", + "1342": "Magyar", + "1343": "Català", + "1344": "Íslenska ", + "1345": "Polski", + "1346": "Lietuvių Kalba", + "1347": "Čeština", + "1348": "Hrvatski", + "1349": "Galego", + "134a": "Pressure Sensitivity", + "134b": "Swap R1 and R2", + "134c": "Trigger Effects", + "134d": "Fix Projectile Focus" } diff --git a/game/graphics/opengl_renderer/OpenGLRenderer.cpp b/game/graphics/opengl_renderer/OpenGLRenderer.cpp index aeacfc1558..5b38618f90 100644 --- a/game/graphics/opengl_renderer/OpenGLRenderer.cpp +++ b/game/graphics/opengl_renderer/OpenGLRenderer.cpp @@ -149,6 +149,9 @@ void OpenGLRenderer::init_bucket_renderers_jak3() { init_bucket_renderer("ocean-mid-far", BucketCategory::OCEAN, BucketId::OCEAN_MID_FAR); + // 7 (hack for progress menu box) + init_bucket_renderer("progress-hack", BucketCategory::OTHER, + BucketId::PROGRESS_HACK, 0x8000); // 8 (in tfrag category for now, just for stat reporting.) init_bucket_renderer("hfrag", BucketCategory::TFRAG, BucketId::HFRAG); diff --git a/game/graphics/opengl_renderer/buckets.h b/game/graphics/opengl_renderer/buckets.h index 359dd57caa..dde5795152 100644 --- a/game/graphics/opengl_renderer/buckets.h +++ b/game/graphics/opengl_renderer/buckets.h @@ -419,9 +419,8 @@ enum class BucketId { TEX_LCOM_SKY_PRE = 4, SKY = 5, OCEAN_MID_FAR = 6, - + PROGRESS_HACK = 7, HFRAG = 8, - TEX_L0_TFRAG = 10, TFRAG_L0_TFRAG = 11, TIE_L0_TFRAG = 12, diff --git a/game/kernel/jak3/kmachine.cpp b/game/kernel/jak3/kmachine.cpp index fc19d0e8e5..e96095a773 100644 --- a/game/kernel/jak3/kmachine.cpp +++ b/game/kernel/jak3/kmachine.cpp @@ -377,22 +377,24 @@ void InitMachine_PCPort() { make_function_symbol_from_c("alloc-vagdir-names", (void*)kmachine_extras::alloc_vagdir_names); // external RPCs - /* make_function_symbol_from_c("pc-fetch-external-speedrun-times", - (void*)pc_fetch_external_speedrun_times); - make_function_symbol_from_c("pc-fetch-external-race-times", (void*)pc_fetch_external_race_times); - make_function_symbol_from_c("pc-fetch-external-highscores", (void*)pc_fetch_external_highscores); + (void*)kmachine_extras::pc_fetch_external_speedrun_times); + make_function_symbol_from_c("pc-fetch-external-race-times", + (void*)kmachine_extras::pc_fetch_external_race_times); + make_function_symbol_from_c("pc-fetch-external-highscores", + (void*)kmachine_extras::pc_fetch_external_highscores); make_function_symbol_from_c("pc-get-external-speedrun-time", - (void*)pc_get_external_speedrun_time); - make_function_symbol_from_c("pc-get-external-race-time", (void*)pc_get_external_race_time); - make_function_symbol_from_c("pc-get-external-highscore", (void*)pc_get_external_highscore); + (void*)kmachine_extras::pc_get_external_speedrun_time); + make_function_symbol_from_c("pc-get-external-race-time", + (void*)kmachine_extras::pc_get_external_race_time); + make_function_symbol_from_c("pc-get-external-highscore", + (void*)kmachine_extras::pc_get_external_highscore); make_function_symbol_from_c("pc-get-num-external-speedrun-times", - (void*)pc_get_num_external_speedrun_times); + (void*)kmachine_extras::pc_get_num_external_speedrun_times); make_function_symbol_from_c("pc-get-num-external-race-times", - (void*)pc_get_num_external_race_times); + (void*)kmachine_extras::pc_get_num_external_race_times); make_function_symbol_from_c("pc-get-num-external-highscores", - (void*)pc_get_num_external_highscores); - */ + (void*)kmachine_extras::pc_get_num_external_highscores); // speedrunning stuff make_function_symbol_from_c("pc-sr-mode-get-practice-entries-amount", diff --git a/goal_src/goal-lib.gc b/goal_src/goal-lib.gc index 4b2757fa69..f298d8ad15 100644 --- a/goal_src/goal-lib.gc +++ b/goal_src/goal-lib.gc @@ -662,6 +662,10 @@ `(set! ,val (max ,val ,maxval))) (defmacro min! (val minval) `(set! ,val (min ,val ,minval))) +(defmacro fmax! (val maxval) + `(set! ,val (fmax ,val ,maxval))) +(defmacro fmin! (val minval) + `(set! ,val (fmin ,val ,minval))) (defmacro minmax (val minval maxval) `(max (min ,val ,maxval) ,minval) diff --git a/goal_src/jak1/engine/game/game-save.gc b/goal_src/jak1/engine/game/game-save.gc index 405651ba97..eb1d4e9bb9 100644 --- a/goal_src/jak1/engine/game/game-save.gc +++ b/goal_src/jak1/engine/game/game-save.gc @@ -244,31 +244,31 @@ (((game-save-elt hint-list)) (dotimes (i (-> tag elt-count)) (awhen (text-id->string (-> *game-info* hint-control i id)) - (format #t " ~-32S [~D]~%" it i) - (format #t - " ~-32S: ~D~%" - "start-time" - (-> (the-as (pointer uint64) (&+ (&+ (the-as pointer tag) 16) (* i (-> tag elt-size)))) 0)) - (format #t - " ~-32S: ~D~%" - "last-time-called" - (-> (the-as (pointer uint64) (&+ (&+ (the-as pointer tag) 16) (* i (-> tag elt-size)))) 1)) - (format #t - " ~-32S: ~D~%" - "num-attempts" - (-> (the-as (pointer uint8) (&+ (&+ (the-as pointer tag) 16) (* i (-> tag elt-size)))) 16)) - (format #t - " ~-32S: ~D~%" - "num-success" - (-> (the-as (pointer uint8) (&+ (&+ (the-as pointer tag) 16) (* i (-> tag elt-size)))) 17))))) + (format #t " ~-32S [~D]~%" it i) + (format #t + " ~-32S: ~D~%" + "start-time" + (-> (the-as (pointer uint64) (&+ (&+ (the-as pointer tag) 16) (* i (-> tag elt-size)))) 0)) + (format #t + " ~-32S: ~D~%" + "last-time-called" + (-> (the-as (pointer uint64) (&+ (&+ (the-as pointer tag) 16) (* i (-> tag elt-size)))) 1)) + (format #t + " ~-32S: ~D~%" + "num-attempts" + (-> (the-as (pointer uint8) (&+ (&+ (the-as pointer tag) 16) (* i (-> tag elt-size)))) 16)) + (format #t + " ~-32S: ~D~%" + "num-success" + (-> (the-as (pointer uint8) (&+ (&+ (the-as pointer tag) 16) (* i (-> tag elt-size)))) 17))))) (((game-save-elt text-list)) (dotimes (i (* 8 (-> tag elt-count))) (awhen (text-id->string (the text-id i)) - (unless (string= it "*unknown*") - (format #t - " ~-32S: ~A~%" - it - (logtest? (-> (the-as (pointer uint8) (&+ (the-as pointer tag) 16)) (/ i 8)) (ash 1 (mod i 8)))))))) + (unless (string= it "*unknown*") + (format #t + " ~-32S: ~A~%" + it + (logtest? (-> (the-as (pointer uint8) (&+ (the-as pointer tag) 16)) (/ i 8)) (ash 1 (mod i 8)))))))) (((game-save-elt task-list) (game-save-elt perm-list)) (dotimes (i (-> tag elt-count)) (let ((perm (the-as entity-perm (&+ (the-as pointer tag) 16 (* i 16))))) @@ -603,7 +603,7 @@ (set! (-> *setting-control* default language) (the-as language-enum (-> save-data user-uint64)))) ;; ((= a0-1 (game-save-elt vibration)) (set! (-> *setting-control* default vibration) (= (-> save-data user-uint64) 1))) ;; ((= a0-1 (game-save-elt play-hints)) (set! (-> *setting-control* default play-hints) (= (-> save-data user-uint64) 1))) - (else (format 0 "PC PORT: Skipping setting from game save, its stored in the pc-settings now")))) + (else (format 0 "PC PORT: Skipping setting from game save, its stored in the pc-settings now~%")))) (set! save-data (the-as game-save-tag (&+ (the-as pointer save-data) (logand -16 (+ (* (the-as int (-> save-data elt-size)) (-> save-data elt-count)) 31))))))) diff --git a/goal_src/jak2/engine/game/game-save.gc b/goal_src/jak2/engine/game/game-save.gc index ab770a54b7..92ca1bd2ee 100644 --- a/goal_src/jak2/engine/game/game-save.gc +++ b/goal_src/jak2/engine/game/game-save.gc @@ -1164,7 +1164,7 @@ (the int (-> (the-as (inline-array game-save-tag) v1-0) 0 user-float0)) ) ) - (else (format 0 "PC PORT: Skipping setting from game save, its stored in the pc-settings now")) + (else (format 0 "PC PORT: Skipping setting from game save, its stored in the pc-settings now~%")) ) (set! v1-0 (&+ (the-as pointer v1-0) diff --git a/goal_src/jak3/dgos/game.gd b/goal_src/jak3/dgos/game.gd index 98baea1833..a990d70927 100644 --- a/goal_src/jak3/dgos/game.gd +++ b/goal_src/jak3/dgos/game.gd @@ -167,6 +167,8 @@ "cam-update-h.o" "hud-h.o" "progress-h.o" + "progress-h-pc.o" ;; added + "progress-generic-h-pc.o" ;; added "rpc-h.o" "path-h.o" "nav-mesh-h.o" @@ -388,8 +390,13 @@ "hud-classes.o" "secrets-menu.o" "progress-static.o" + "progress-static-pc.o" ;; added "progress.o" + "progress-pc.o" ;; added + "progress-generic-pc.o" ;; added "progress-draw.o" + "progress-draw-pc.o" ;; added + "progress-generic-draw-pc.o" ;; added "ocean.o" "ocean-vu0.o" "ocean-texture.o" diff --git a/goal_src/jak3/engine/common-obs/collectables.gc b/goal_src/jak3/engine/common-obs/collectables.gc index 021c7779cf..5da16cd923 100644 --- a/goal_src/jak3/engine/common-obs/collectables.gc +++ b/goal_src/jak3/engine/common-obs/collectables.gc @@ -2026,7 +2026,7 @@ ) (deftype ammo-collectable (collectable) - ((ammo-effect basic) + ((ammo-effect sparticle-launch-group) ) ) diff --git a/goal_src/jak3/engine/common-obs/generic-obs.gc b/goal_src/jak3/engine/common-obs/generic-obs.gc index 961a30ffc9..f82c14b0dc 100644 --- a/goal_src/jak3/engine/common-obs/generic-obs.gc +++ b/goal_src/jak3/engine/common-obs/generic-obs.gc @@ -1667,14 +1667,9 @@ (defbehavior lightning-tracker-init lightning-tracker ((arg0 lightning-spec) (arg1 time-frame) (arg2 symbol) (arg3 process-drawable) (arg4 vector) (arg5 vector)) (stack-size-set! (-> self main-thread) 128) (set! (-> self target0) (process->handle arg3)) - (let ((s1-1 (ppointer->process (-> self parent)))) - (set! (-> self target1) (process->handle (the-as process (if (type? s1-1 process-drawable) - s1-1 - ) - ) - ) - ) - ) + (set! (-> self target1) + (process->handle (the-as process (as-type (ppointer->process (-> self parent)) process-drawable))) + ) ;; Note: there's some changes here to skip setting things if arg4 is #f. ;; the address of #f is misaligned, but on ps2 the lq instruction will silently mask. ;; Loading from #f doesn't really make sense, so this was likely just a mistake in the @@ -3875,7 +3870,7 @@ (deftype level-exit (process-drawable) ((minimap connection-minimap) (task-counter uint32) - (ent basic) + (ent entity-actor) ) (:state-methods active diff --git a/goal_src/jak3/engine/game/game-save.gc b/goal_src/jak3/engine/game/game-save.gc index 61e9778690..4acb58ed82 100644 --- a/goal_src/jak3/engine/game/game-save.gc +++ b/goal_src/jak3/engine/game/game-save.gc @@ -1685,21 +1685,25 @@ (let ((v1-0 (the-as object (-> arg0 tag)))) (while (< (the-as int v1-0) (the-as int (&-> arg0 tag 0 user-int8 (-> arg0 length)))) (case (-> (the-as (inline-array game-save-tag) v1-0) 0 elt-type) - (((game-save-elt sfx-volume)) - (set! (-> *setting-control* user-default sfx-volume) - (-> (the-as (inline-array game-save-tag) v1-0) 0 user-float0) - ) - ) - (((game-save-elt music-volume)) - (set! (-> *setting-control* user-default music-volume) - (-> (the-as (inline-array game-save-tag) v1-0) 0 user-float0) - ) - ) - (((game-save-elt dialog-volume)) - (set! (-> *setting-control* user-default dialog-volume) - (-> (the-as (inline-array game-save-tag) v1-0) 0 user-float0) - ) - ) + ;; og:preserve-this moved these to pc-settings + (((game-save-elt sfx-volume) (game-save-elt music-volume) (game-save-elt dialog-volume) (game-save-elt vibration) (game-save-elt subtitle)) + (format 0 "game-info::load-game: skip setting ~S, stored in pc-settings now~%" + (game-save-elt->string (-> (the (inline-array game-save-tag) v1-0) 0 elt-type)))) + ; (((game-save-elt sfx-volume)) + ; (set! (-> *setting-control* user-default sfx-volume) + ; (-> (the-as (inline-array game-save-tag) v1-0) 0 user-float0) + ; ) + ; ) + ; (((game-save-elt music-volume)) + ; (set! (-> *setting-control* user-default music-volume) + ; (-> (the-as (inline-array game-save-tag) v1-0) 0 user-float0) + ; ) + ; ) + ; (((game-save-elt dialog-volume)) + ; (set! (-> *setting-control* user-default dialog-volume) + ; (-> (the-as (inline-array game-save-tag) v1-0) 0 user-float0) + ; ) + ; ) (((game-save-elt language)) (set! (-> *setting-control* user-default language) (the-as language-enum (-> (the-as (inline-array game-save-tag) v1-0) 0 user-uint64)) @@ -1720,16 +1724,17 @@ (the-as int (-> (the-as (inline-array game-save-tag) v1-0) 0 user-uint64)) ) ) - (((game-save-elt vibration)) - (set! (-> *setting-control* user-default vibration) - (= (-> (the-as (inline-array game-save-tag) v1-0) 0 user-uint64) 1) - ) - ) - (((game-save-elt subtitle)) - (set! (-> *setting-control* user-default subtitle) - (= (-> (the-as (inline-array game-save-tag) v1-0) 0 user-uint64) 1) - ) - ) + ;; og:preserve-this moved these to pc-settings + ; (((game-save-elt vibration)) + ; (set! (-> *setting-control* user-default vibration) + ; (= (-> (the-as (inline-array game-save-tag) v1-0) 0 user-uint64) 1) + ; ) + ; ) + ; (((game-save-elt subtitle)) + ; (set! (-> *setting-control* user-default subtitle) + ; (= (-> (the-as (inline-array game-save-tag) v1-0) 0 user-uint64) 1) + ; ) + ; ) (((game-save-elt flip-horizontal)) (set! (-> *setting-control* cam-default flip-horizontal) (= (-> (the-as (inline-array game-save-tag) v1-0) 0 user-uint64) 1) @@ -2416,7 +2421,9 @@ ) (suspend) ) - (activate-progress *dproc* 'icon-info) + ;; og:preserve-this disable auto-save prompt in speedrunner mode + (when (not (-> *pc-settings* speedrunner-mode?)) + (activate-progress *dproc* 'icon-info)) (while *progress-process* (suspend) ) diff --git a/goal_src/jak3/engine/game/settings-h.gc b/goal_src/jak3/engine/game/settings-h.gc index 6a44590ffe..6e2ec95f7c 100644 --- a/goal_src/jak3/engine/game/settings-h.gc +++ b/goal_src/jak3/engine/game/settings-h.gc @@ -284,6 +284,13 @@ ) ;; ---game-vehicle-u8 +(defmacro language? (&rest langs) + "is the current language any of the ones specified?" + `(or ,@(apply (lambda (x) `(= (-> *setting-control* user-default language) (language-enum ,x))) langs))) + +(defmacro text-language? (&rest langs) + "is the current language any of the ones specified?" + `(or ,@(apply (lambda (x) `(= (-> *pc-settings* text-language) (pc-language ,x))) langs))) ;; DECOMP BEGINS diff --git a/goal_src/jak3/engine/target/flut/flut-h.gc b/goal_src/jak3/engine/target/flut/flut-h.gc index b318e08495..8c6314747a 100644 --- a/goal_src/jak3/engine/target/flut/flut-h.gc +++ b/goal_src/jak3/engine/target/flut/flut-h.gc @@ -28,7 +28,7 @@ (stick-lock symbol) (flap-sound-id uint32) (mode-sound-bank connection) - (mode basic) + (mode symbol) (color-index int32) (as-daxter? symbol) (art-group-backup art-group) diff --git a/goal_src/jak3/engine/target/flut/target-flut.gc b/goal_src/jak3/engine/target/flut/target-flut.gc index 2f9b4de0c6..99d52bb0f4 100644 --- a/goal_src/jak3/engine/target/flut/target-flut.gc +++ b/goal_src/jak3/engine/target/flut/target-flut.gc @@ -999,19 +999,19 @@ (set! (-> self flut color-index) arg2) (case arg1 ((#t) - (set! (-> self flut mode) (the-as basic 'normal)) + (set! (-> self flut mode) 'normal) (set! (-> self flut as-daxter?) #f) ) (('racer) - (set! (-> self flut mode) (the-as basic arg1)) + (set! (-> self flut mode) arg1) (set! (-> self flut as-daxter?) #f) ) (('wild) - (set! (-> self flut mode) (the-as basic arg1)) + (set! (-> self flut mode) arg1) (set! (-> self flut as-daxter?) #t) ) (else - (set! (-> self flut mode) (the-as basic arg1)) + (set! (-> self flut mode) arg1) (set! (-> self flut as-daxter?) #f) ) ) diff --git a/goal_src/jak3/engine/target/mech/mech-h.gc b/goal_src/jak3/engine/target/mech/mech-h.gc index 6b6b24c6f0..ad9ca250f5 100644 --- a/goal_src/jak3/engine/target/mech/mech-h.gc +++ b/goal_src/jak3/engine/target/mech/mech-h.gc @@ -24,8 +24,8 @@ (mech-start-time time-frame) (mech-time time-frame) (no-get-off-time time-frame) - (stick-lock basic) - (stick-off basic) + (stick-lock symbol) + (stick-off symbol) (forward-vel meters) (jump-thrust meters) (jump-thrust-fuel float) @@ -48,8 +48,8 @@ (exhaust-local-dir vector 2 :inline) (smoke-local-pos vector 2 :inline) (smoke-local-vel vector 2 :inline) - (particle-system-2d basic) - (particle-system-3d basic) + (particle-system-2d sparticle-system) + (particle-system-3d sparticle-system) (part-thruster sparticle-launcher) (part-thruster-scale-x sp-field-init-spec) (part-thruster-scale-y sp-field-init-spec) diff --git a/goal_src/jak3/engine/target/mech/mech-part.gc b/goal_src/jak3/engine/target/mech/mech-part.gc index 3bbbba0576..1ae48a88c5 100644 --- a/goal_src/jak3/engine/target/mech/mech-part.gc +++ b/goal_src/jak3/engine/target/mech/mech-part.gc @@ -154,14 +154,7 @@ (a2-4 *launch-matrix*) ) (vector-copy! (-> a2-4 trans) s0-0) - (t9-4 - (the-as sparticle-system a0-7) - a1-6 - a2-4 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (t9-4 a0-7 a1-6 a2-4 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) ) diff --git a/goal_src/jak3/engine/target/mech/mech-states.gc b/goal_src/jak3/engine/target/mech/mech-states.gc index a447974878..a93e885847 100644 --- a/goal_src/jak3/engine/target/mech/mech-states.gc +++ b/goal_src/jak3/engine/target/mech/mech-states.gc @@ -1056,7 +1056,7 @@ ) :trans (-> target-mech-hit trans) :code (behavior ((arg0 symbol)) - (set! (-> self mech stick-off) (the-as basic #t)) + (set! (-> self mech stick-off) #t) (set! (-> self control unknown-word04) (the-as uint #f)) (set! (-> self control did-move-to-pole-or-max-jump-height) (the-as float (send-event (handle->process (-> self attack-info attacker)) 'target 'die arg0)) @@ -1341,7 +1341,7 @@ ) :enter (behavior () (set! (-> self control mod-surface) *mech-pickup-mods*) - (set! (-> self mech stick-off) (the-as basic #t)) + (set! (-> self mech stick-off) #t) (set-time! (-> self state-time)) (set-forward-vel 0.0) (set! (-> self carry other) (the-as handle #f)) @@ -1563,7 +1563,7 @@ (set! (-> self control mod-surface) *mech-walk-mods*) (set-time! (-> self state-time)) (set-forward-vel 0.0) - (set! (-> self mech stick-off) (the-as basic #t)) + (set! (-> self mech stick-off) #t) ) :exit (-> target-mech-carry-pickup exit) :code (behavior () @@ -2304,7 +2304,7 @@ (set! (-> self control mod-surface) *mech-walk-mods*) (set-time! (-> self state-time)) (set-forward-vel 0.0) - (set! (-> self mech stick-off) (the-as basic #t)) + (set! (-> self mech stick-off) #t) ) :exit (-> target-mech-carry-pickup exit) :code (behavior () @@ -2405,7 +2405,7 @@ (vector-copy! (-> self mech mech-trans) (-> self control unknown-vector38)) (quaternion-copy! (the-as quaternion (-> self mech mech-quat)) (-> self control unknown-quat40)) (vector-copy! (-> self mech mech-scale) (-> self control scale)) - (set! (-> self mech stick-off) (the-as basic #t)) + (set! (-> self mech stick-off) #t) (ja-no-eval :group! jakb-mech-get-on-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((f30-0 (sin (lerp-scale 0.0 16384.0 (ja-aframe-num 0) 70.0 80.0)))) @@ -2467,7 +2467,7 @@ (vector-copy! (-> self mech mech-trans) (-> self control unknown-vector38)) (quaternion-copy! (the-as quaternion (-> self mech mech-quat)) (-> self control unknown-quat40)) (vector-copy! (-> self mech mech-scale) (-> self control scale)) - (set! (-> self mech stick-off) (the-as basic #t)) + (set! (-> self mech stick-off) #t) (ja-no-eval :group! jakb-mech-get-on-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((f30-0 (sin (lerp-scale 0.0 16384.0 (ja-aframe-num 0) 70.0 80.0)))) @@ -2506,7 +2506,7 @@ :event target-mech-handler :enter (behavior () (vector-reset! (-> self control transv)) - (set! (-> self mech stick-off) (the-as basic #t)) + (set! (-> self mech stick-off) #t) (send-event (handle->process (-> self mech shield-handle)) 'enabled) ) :exit (behavior () @@ -2631,7 +2631,7 @@ (set! (-> self neck flex-blend) 0.0) (logior! (-> self target-flags) (target-flags tf2)) (logior! (-> self focus-status) (focus-status grabbed)) - (set! (-> self mech stick-off) (the-as basic #t)) + (set! (-> self mech stick-off) #t) (sound-stop (-> self mech engine-sound-id)) (sound-stop (-> self mech thrust-sound-id)) (sound-stop (-> self mech drag-sound-id)) diff --git a/goal_src/jak3/engine/target/target-util.gc b/goal_src/jak3/engine/target/target-util.gc index eb7aaa9e39..ce61a7558b 100644 --- a/goal_src/jak3/engine/target/target-util.gc +++ b/goal_src/jak3/engine/target/target-util.gc @@ -318,8 +318,8 @@ (fall-height meters) (mech-jump-thrust-fuel float) (strafe-jump-pre-window time-frame) - (strafe-jump basic) - (strafe-duck-jump basic) + (strafe-jump symbol) + (strafe-duck-jump symbol) (dark-jump-height-min meters) (dark-jump-height-max meters) (ladder-walk-up-speed meters) diff --git a/goal_src/jak3/engine/ui/progress/progress-draw.gc b/goal_src/jak3/engine/ui/progress/progress-draw.gc index ba740340ec..1e077de235 100644 --- a/goal_src/jak3/engine/ui/progress/progress-draw.gc +++ b/goal_src/jak3/engine/ui/progress/progress-draw.gc @@ -115,6 +115,7 @@ (the-as game-task-info #f) ) +;; WARN: Return type mismatch int vs object. (defmethod progress-method-53 ((this progress) (arg0 font-context)) (let ((v1-1 (get-scissor-stack-top this))) (let ((a0-1 arg0) @@ -130,25 +131,25 @@ (set! (-> arg0 height) (- (-> v1-1 w) (-> v1-1 y))) ) 0 - (none) ) (defmethod get-language-by-idx ((this progress) (arg0 int)) (if (and (= (scf-get-territory) 1) (zero? (-> this languages arg0))) 11 - (-> this languages arg0) + (the-as int (-> this languages arg0)) ) ) -(defmethod progress-method-38 ((this progress) (arg0 font-context) (arg1 float)) +;; WARN: Return type mismatch int vs object. +(defmethod adjust-font-origin-y ((this progress) (arg0 font-context) (arg1 float)) (let ((v1-1 (get-scissor-stack-top this))) (set! (-> arg0 origin y) (+ (-> v1-1 y) (* (- (-> v1-1 w) (-> v1-1 y)) arg1))) ) 0 - (none) ) -(defmethod progress-method-37 ((this progress)) +;; WARN: Return type mismatch int vs object. +(defmethod set-selected-color ((this progress)) (with-pp (let ((gp-0 33)) ;; og:preserve-this high fps fix @@ -168,11 +169,12 @@ (new 'static 'rgba :r #x60 :g #x60 :b #x60 :a #x80) ) ) + gp-0 ) - (none) ) ) +;; WARN: Return type mismatch int vs object. (defmethod progress-method-44 ((this progress) (arg0 font-context) (arg1 string)) (let ((f0-1 (- 1.0 (-> this menu-transition)))) (set-scale! arg0 0.5) @@ -180,7 +182,6 @@ ) (print-game-text arg1 arg0 #f 44 (bucket-id hud-draw-hud-alpha)) 0 - (none) ) (defmethod progress-method-45 ((this progress) @@ -240,7 +241,8 @@ ) ) -(defmethod progress-method-40 ((this progress) (arg0 font-context) (arg1 int) (arg2 int) (arg3 float)) +;; WARN: Return type mismatch int vs object. +(defmethod draw-highlight-bar ((this progress) (arg0 font-context) (arg1 int) (arg2 int) (arg3 float)) (let* ((v1-1 (get-scissor-stack-top this)) (a1-1 (the int (-> v1-1 x))) (a3-1 (the int (- (-> v1-1 z) (-> v1-1 x)))) @@ -261,10 +263,10 @@ ) ) 0 - (none) ) -(defmethod progress-method-41 ((this progress) (arg0 progress-box) (arg1 float)) +;; WARN: Return type mismatch int vs object. +(defmethod draw-bg-box-outline ((this progress) (arg0 progress-box) (arg1 float)) (with-dma-buffer-add-bucket ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) ;; og:preserve-this changed from particles bucket (bucket-id hud-draw-hud-alpha) @@ -281,10 +283,10 @@ ) ) 0 - (none) ) -(defmethod progress-method-42 ((this progress) (arg0 progress-box) (arg1 float)) +;; WARN: Return type mismatch int vs object. +(defmethod draw-bg-box-alpha-2 ((this progress) (arg0 progress-box) (arg1 float)) (with-dma-buffer-add-bucket ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id particles) ) @@ -300,10 +302,10 @@ ) ) 0 - (none) ) -(defmethod progress-method-43 ((this progress) (arg0 progress-box) (arg1 float)) +;; WARN: Return type mismatch int vs object. +(defmethod draw-bg-box-alpha-1 ((this progress) (arg0 progress-box) (arg1 float)) (with-dma-buffer-add-bucket ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) ;; og:preserve-this changed from bucket6 (bucket-id tex-hud-hud-alpha) @@ -320,15 +322,15 @@ ) ) 0 - (none) ) -(defmethod progress-method-46 ((this progress) (arg0 font-context) (arg1 float) (arg2 int)) +;; WARN: Return type mismatch int vs object. +(defmethod draw-header ((this progress) (arg0 font-context) (arg1 float) (arg2 text-id)) (progress-method-33 this (-> *progress-work* header)) (let ((s3-0 (get-scissor-stack-top this))) (let ((s1-0 *progress-work*)) - (progress-method-42 this (-> s1-0 header) (* 64.0 arg1)) - (progress-method-41 this (-> s1-0 header) (* 128.0 arg1)) + (draw-bg-box-alpha-2 this (-> s1-0 header) (* 64.0 arg1)) + (draw-bg-box-outline this (-> s1-0 header) (* 128.0 arg1)) ) (let ((a0-5 arg0)) (set! (-> a0-5 flags) (font-flags kerning middle large)) @@ -348,7 +350,7 @@ arg0 (+ (- -20.0 (-> s3-0 x)) (-> s3-0 z)) 45.0 - (lookup-text! *common-text* (the-as text-id arg2) #f) + (lookup-text! *common-text* arg2 #f) 0.95 0.1 32 @@ -356,9 +358,9 @@ ) (progress-method-34 this) 0 - (none) ) +;; WARN: Return type mismatch int vs object. (defmethod progress-method-47 ((this progress) (arg0 font-context) (arg1 symbol) (arg2 symbol)) (set-scale! arg0 0.5) (let ((a0-2 arg0)) @@ -400,15 +402,15 @@ ) ) 0 - (none) ) +;; WARN: Return type mismatch int vs object. (defmethod draw-prev-next-footer ((this progress) (arg0 font-context) (arg1 float)) (local-vars (sv-16 string)) (let ((s3-0 *progress-work*)) (progress-method-33 this (-> s3-0 footer)) - (progress-method-42 this (-> s3-0 footer) (* 64.0 arg1)) - (progress-method-41 this (-> s3-0 footer) (* 128.0 arg1)) + (draw-bg-box-alpha-2 this (-> s3-0 footer) (* 64.0 arg1)) + (draw-bg-box-outline this (-> s3-0 footer) (* 128.0 arg1)) ) (let ((a0-4 arg0)) (set! (-> a0-4 color) (font-color font-color-33)) @@ -456,9 +458,9 @@ ) (progress-method-34 this) 0 - (none) ) +;; WARN: Return type mismatch int vs object. (defmethod draw-yes-no-style-footer ((this progress) (arg0 font-context) (arg1 text-id) (arg2 text-id)) (local-vars (a0-5 string)) (cond @@ -483,7 +485,6 @@ ) (print-game-text a0-5 arg0 #f 44 (bucket-id hud-draw-hud-alpha)) 0 - (none) ) ;; ERROR: Stack slot load at 80 mismatch: defined as size 4, got size 16 @@ -508,6 +509,7 @@ ;; ERROR: Stack slot load at 176 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 160 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 176 mismatch: defined as size 4, got size 16 +;; WARN: Return type mismatch int vs object. (defmethod progress-method-50 ((this progress) (arg0 font-context) (arg1 text-id) @@ -556,48 +558,35 @@ (let* ((t0-1 (lookup-text! *common-text* arg1 #f)) (t2-1 0.75) (t3-1 35) - (t1-1 s1-0) - (f28-0 (sv-48 s0-1 sv-64 sv-80 sv-96 t0-1 t1-1 t2-1 t3-1)) + (f28-0 (sv-48 s0-1 sv-64 sv-80 sv-96 t0-1 s1-0 t2-1 t3-1)) ) (set! f30-0 (/ f28-0 2)) (set-scale! arg0 (/ (-> arg0 scale) 2)) - (let* ((a0-7 this) - (t9-3 (method-of-object a0-7 progress-method-40)) - (a1-3 arg0) - (a2-3 (the int (+ -1.0 (-> arg0 origin y)))) - (a3-2 (the int (+ 2.0 f28-0))) - (t0-2 sv-16) - ) - (t9-3 a0-7 a1-3 a2-3 a3-2 t0-2) - (+! (-> arg0 origin y) f28-0) - (set! sv-20 (cond - ((-> this yes-no-choice) - (format - (clear *temp-string*) - "~33L~S ~44L~S" - (lookup-text! *common-text* arg2 #f) - (lookup-text! *common-text* arg3 #f) - (the-as none t0-2) - (the-as none t1-1) - ) - *temp-string* - ) - (else - (format - (clear *temp-string*) - "~44L~S~33L ~S" - (lookup-text! *common-text* arg2 #f) - (lookup-text! *common-text* arg3 #f) - (the-as none t0-2) - (the-as none t1-1) - ) - *temp-string* - ) - ) - ) - ) + (draw-highlight-bar this arg0 (the int (+ -1.0 (-> arg0 origin y))) (the int (+ 2.0 f28-0)) sv-16) + (+! (-> arg0 origin y) f28-0) ) ) + (set! sv-20 (cond + ((-> this yes-no-choice) + (format + (clear *temp-string*) + "~33L~S ~44L~S" + (lookup-text! *common-text* arg2 #f) + (lookup-text! *common-text* arg3 #f) + ) + *temp-string* + ) + (else + (format + (clear *temp-string*) + "~44L~S~33L ~S" + (lookup-text! *common-text* arg2 #f) + (lookup-text! *common-text* arg3 #f) + ) + *temp-string* + ) + ) + ) ) (else (cond @@ -626,7 +615,7 @@ ) (when arg4 (let* ((a0-20 this) - (t9-14 (method-of-object a0-20 progress-method-40)) + (t9-14 (method-of-object a0-20 draw-highlight-bar)) (a1-12 arg0) (a2-12 (the int (+ -1.0 (-> arg0 origin y)))) (a3-6 (the int (+ 1.0 f28-1))) @@ -668,9 +657,9 @@ ) ) 0 - (none) ) +;; WARN: Return type mismatch int vs object. (defmethod progress-method-51 ((this progress) (arg0 font-context)) (let ((v1-1 (get-scissor-stack-top this))) (let ((a0-1 arg0) @@ -698,10 +687,10 @@ ) ) 0 - (none) ) -(defmethod progress-method-52 ((this progress) +;; WARN: Return type mismatch int vs object. +(defmethod draw-slider-option ((this progress) (arg0 font-context) (arg1 string) (arg2 float) @@ -826,7 +815,7 @@ ) (let ((f0-44 (progress-method-45 this arg0 f30-0 (* 32.0 f0-43) arg1 f0-43 0.75 32))) (if (= (-> this option-index) (-> this current-index)) - (progress-method-40 this arg0 (the int (+ -2.0 (-> arg0 origin y))) (the int (+ 4.0 f0-44)) arg2) + (draw-highlight-bar this arg0 (the int (+ -2.0 (-> arg0 origin y))) (the int (+ 4.0 f0-44)) arg2) ) ) ) @@ -843,7 +832,6 @@ ) (set! (-> arg0 flags) (font-flags kerning large)) 0 - (none) ) (defmethod draw-icon-array! ((this progress-icon-array) (arg0 int) (arg1 int) (arg2 float) (arg3 float) (arg4 rgba) (arg5 float)) @@ -1222,7 +1210,7 @@ ) (+! s1-2 1) ) - (set! (-> this on-screen) (the-as basic (< (-> arg1 origin y) (-> s3-0 w)))) + (set! (-> this on-screen) (< (-> arg1 origin y) (-> s3-0 w))) (seek! (-> this current-index) (-> this target-index) @@ -1236,9 +1224,9 @@ ) (progress-method-34 arg0) (let ((s3-1 *progress-work*)) - (progress-method-46 arg0 arg1 sv-176 106) - (progress-method-42 arg0 (-> s3-1 footer) (* 64.0 sv-176)) - (progress-method-41 arg0 (-> s3-1 footer) (* 128.0 sv-176)) + (draw-header arg0 arg1 sv-176 (text-id progress-missions)) + (draw-bg-box-alpha-2 arg0 (-> s3-1 footer) (* 64.0 sv-176)) + (draw-bg-box-outline arg0 (-> s3-1 footer) (* 128.0 sv-176)) ) (progress-method-47 arg0 @@ -1344,7 +1332,7 @@ (set! (-> a0-5 color) (font-color font-color-32)) ) (set! (-> arg1 origin x) (+ 10.0 arg2 (-> s3-0 x))) - (progress-method-38 arg0 arg1 0.01) + (adjust-font-origin-y arg0 arg1 0.01) (let ((v1-11 arg1)) (set! (-> v1-11 width) (* 0.75 f30-0)) ) @@ -1405,9 +1393,9 @@ ) ) ) - (progress-method-42 arg0 (-> s0-0 highscore-1) (* 16.0 arg3)) - (progress-method-41 arg0 (-> s0-0 highscore-1) (* 128.0 arg3)) - (progress-method-41 arg0 (-> s0-0 highscore-0) (* 128.0 arg3)) + (draw-bg-box-alpha-2 arg0 (-> s0-0 highscore-1) (* 16.0 arg3)) + (draw-bg-box-outline arg0 (-> s0-0 highscore-1) (* 128.0 arg3)) + (draw-bg-box-outline arg0 (-> s0-0 highscore-0) (* 128.0 arg3)) (progress-method-33 arg0 (-> s0-0 highscore-body)) ) ) @@ -1416,24 +1404,24 @@ (s3-1 (get-game-score-ref *game-info* (the-as int (-> this game-score)))) ) (set-scale! arg1 0.6) - (progress-method-38 arg0 arg1 0.03) + (adjust-font-origin-y arg0 arg1 0.03) (highscore-page-info-method-11 this arg1 56 (-> s3-1 0) f30-2 f28-2) (set-scale! arg1 0.5) - (progress-method-38 arg0 arg1 0.18) + (adjust-font-origin-y arg0 arg1 0.18) (highscore-page-info-method-11 this arg1 57 (-> s3-1 1) f30-2 f28-2) (set-scale! arg1 0.45) - (progress-method-38 arg0 arg1 0.31) + (adjust-font-origin-y arg0 arg1 0.31) (highscore-page-info-method-11 this arg1 58 (-> s3-1 2) f30-2 f28-2) (set-scale! arg1 0.425) - (progress-method-38 arg0 arg1 0.43) + (adjust-font-origin-y arg0 arg1 0.43) (highscore-page-info-method-11 this arg1 59 (-> s3-1 3) f30-2 f28-2) - (progress-method-38 arg0 arg1 0.545) + (adjust-font-origin-y arg0 arg1 0.545) (highscore-page-info-method-11 this arg1 60 (-> s3-1 4) f30-2 f28-2) - (progress-method-38 arg0 arg1 0.66) + (adjust-font-origin-y arg0 arg1 0.66) (highscore-page-info-method-11 this arg1 61 (-> s3-1 5) f30-2 f28-2) - (progress-method-38 arg0 arg1 0.775) + (adjust-font-origin-y arg0 arg1 0.775) (highscore-page-info-method-11 this arg1 62 (-> s3-1 6) f30-2 f28-2) - (progress-method-38 arg0 arg1 0.89) + (adjust-font-origin-y arg0 arg1 0.89) (highscore-page-info-method-11 this arg1 63 (-> s3-1 7) f30-2 f28-2) ) ) @@ -1486,14 +1474,14 @@ ) ) (progress-method-34 arg0) - (progress-method-46 arg0 arg1 f30-0 55) + (draw-header arg0 arg1 f30-0 (text-id progress-highscores)) (cond ((< 1.0 f28-0) (draw-prev-next-footer arg0 arg1 f30-0) ) (else - (progress-method-42 arg0 (-> s4-0 footer) (* 64.0 f30-0)) - (progress-method-41 arg0 (-> s4-0 footer) (* 128.0 f30-0)) + (draw-bg-box-alpha-2 arg0 (-> s4-0 footer) (* 64.0 f30-0)) + (draw-bg-box-outline arg0 (-> s4-0 footer) (* 128.0 f30-0)) ) ) ) @@ -1541,7 +1529,7 @@ (dotimes (s0-0 (-> this items length)) (when (and arg4 (have-items? this)) (set-scale! arg1 0.45) - (progress-method-38 arg0 arg1 0.9) + (adjust-font-origin-y arg0 arg1 0.9) (set! sv-16 print-game-text) (set! sv-32 format) (set! sv-48 (clear *temp-string*)) @@ -1570,7 +1558,7 @@ (let ((a0-2 arg1)) (set! (-> a0-2 color) (font-color font-color-32)) ) - (progress-method-38 arg0 arg1 0.01) + (adjust-font-origin-y arg0 arg1 0.01) (let ((s1-0 print-game-text)) (let ((s0-0 format)) (set! sv-16 (clear *temp-string*)) @@ -1619,7 +1607,7 @@ (inventory-screen-method-9 s4-1 arg0 arg1 f28-1 f30-0) ) (progress-method-34 arg0) - (progress-method-46 arg0 arg1 f30-0 1995) + (draw-header arg0 arg1 f30-0 (text-id progress-inventory)) (draw-prev-next-footer arg0 arg1 f30-0) ) 0 @@ -1739,7 +1727,7 @@ (let ((s1-0 (get-scissor-stack-top arg0))) (- (-> s1-0 z) (-> s1-0 x)) (progress-method-33 arg0 (-> s3-0 sub-header)) - (progress-method-41 arg0 (-> s3-0 sub-header) (* 128.0 s2-0)) + (draw-bg-box-outline arg0 (-> s3-0 sub-header) (* 128.0 s2-0)) (let ((a0-4 arg1)) (set! (-> a0-4 flags) (font-flags kerning middle large)) ) @@ -1879,7 +1867,7 @@ (s2-0 *progress-work*) ) (set! (-> arg1 alpha) f30-0) - (progress-method-46 arg0 arg1 f30-0 1581) + (draw-header arg0 arg1 f30-0 (text-id progress-controls)) (let ((a0-2 arg1)) (set! (-> a0-2 flags) (font-flags kerning middle large)) ) @@ -1899,8 +1887,8 @@ (draw-prev-next-footer arg0 arg1 f30-0) ) (else - (progress-method-42 arg0 (-> s2-0 footer) (* 64.0 f30-0)) - (progress-method-41 arg0 (-> s2-0 footer) (* 128.0 f30-0)) + (draw-bg-box-alpha-2 arg0 (-> s2-0 footer) (* 64.0 f30-0)) + (draw-bg-box-outline arg0 (-> s2-0 footer) (* 128.0 f30-0)) ) ) (progress-method-33 arg0 (-> s2-0 body-footer)) @@ -1928,8 +1916,8 @@ (let ((a1-2 arg1)) (set! (-> a1-2 flags) (font-flags kerning middle large)) ) - (progress-method-38 arg0 arg1 (-> this offset-y)) - (progress-method-40 arg0 arg1 (the int (-> arg1 origin y)) 44 f30-0) + (adjust-font-origin-y arg0 arg1 (-> this offset-y)) + (draw-highlight-bar arg0 arg1 (the int (-> arg1 origin y)) 44 f30-0) (+! (-> arg1 origin y) 8.0) (let ((a0-3 arg1)) (set! (-> a0-3 color) (font-color font-color-32)) @@ -1956,7 +1944,7 @@ 44 (bucket-id hud-draw-hud-alpha) ) - (progress-method-46 arg0 arg1 f30-0 11) + (draw-header arg0 arg1 f30-0 (text-id progress-language)) ) 0 (none) @@ -1966,10 +1954,10 @@ (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))) (set! (-> arg1 alpha) f30-0) (set-scale! arg1 0.85) - (progress-method-38 arg0 arg1 (-> this offset-y)) + (adjust-font-origin-y arg0 arg1 (-> this offset-y)) (cond ((= (-> arg0 option-index) arg2) - (progress-method-40 arg0 arg1 (the int (+ -6.0 (-> arg1 origin y))) 35 f30-0) + (draw-highlight-bar arg0 arg1 (the int (+ -6.0 (-> arg1 origin y))) 35 f30-0) (let ((a0-4 arg1)) (set! (-> a0-4 color) (font-color font-color-33)) ) @@ -1988,7 +1976,7 @@ (defmethod draw-option ((this menu-on-off-game-vibrations-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg0 yes-no-choice) (-> arg0 vibrations)) - (progress-method-38 arg0 arg1 0.19) + (adjust-font-origin-y arg0 arg1 0.19) (progress-method-50 arg0 arg1 @@ -2000,7 +1988,7 @@ 0.65 ) (let ((f0-1 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))) - (progress-method-46 arg0 arg1 f0-1 28) + (draw-header arg0 arg1 f0-1 (text-id progress-game-options)) ) 0 (none) @@ -2008,7 +1996,7 @@ (defmethod draw-option ((this menu-on-off-game-subtitles-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg0 yes-no-choice) (-> arg0 subtitles)) - (progress-method-38 arg0 arg1 0.34) + (adjust-font-origin-y arg0 arg1 0.34) (progress-method-50 arg0 arg1 @@ -2027,7 +2015,7 @@ (local-vars (sv-16 string) (sv-32 string)) (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))) (set-scale! arg1 0.65) - (progress-method-38 arg0 arg1 (-> this offset-y)) + (adjust-font-origin-y arg0 arg1 (-> this offset-y)) (set! (-> arg1 alpha) f30-0) (let ((a0-3 arg1)) (set! (-> a0-3 flags) (font-flags kerning middle large)) @@ -2050,7 +2038,7 @@ (let ((a0-12 arg1)) (set! (-> a0-12 color) (font-color font-color-34)) ) - (progress-method-40 arg0 arg1 (the int (-> arg1 origin y)) 42 f30-0) + (draw-highlight-bar arg0 arg1 (the int (-> arg1 origin y)) 42 f30-0) (let ((s2-1 print-game-text)) (let ((s1-1 format) (s0-1 (clear *temp-string*)) @@ -2093,7 +2081,7 @@ (let ((a0-30 arg1)) (set! (-> a0-30 color) (font-color font-color-33)) ) - (progress-method-40 arg0 arg1 (the int (-> arg1 origin y)) 24 f30-0) + (draw-highlight-bar arg0 arg1 (the int (-> arg1 origin y)) 24 f30-0) ) (else (let ((a0-32 arg1)) @@ -2155,7 +2143,7 @@ (let ((a0-3 arg1)) (set! (-> a0-3 color) (font-color font-color-34)) ) - (progress-method-38 arg0 arg1 0.45) + (adjust-font-origin-y arg0 arg1 0.45) (set! (-> arg1 origin x) (+ 30.0 (-> s4-0 x))) (let* ((s3-1 arg0) (s2-1 (method-of-object s3-1 progress-method-45)) @@ -2224,7 +2212,7 @@ (set! (-> a0-21 flags) (font-flags kerning middle large)) ) (set! (-> arg1 origin x) (-> s4-0 x)) - (progress-method-38 arg0 arg1 0.85) + (adjust-font-origin-y arg0 arg1 0.85) (set-scale! arg1 0.5) (let ((v1-27 arg1)) (set! (-> v1-27 width) (- (-> s4-0 z) (-> s4-0 x))) @@ -2239,7 +2227,7 @@ ) (else (let ((f28-1 0.7)) - (progress-method-38 arg0 arg1 (-> this offset-y)) + (adjust-font-origin-y arg0 arg1 (-> this offset-y)) (cond ((= (-> arg0 option-index) arg2) (let ((a0-27 arg1)) @@ -2266,7 +2254,7 @@ (f0-26 (s0-1 s1-2 sv-32 s4-1 sv-48 t0-7 t1-1 t2-1 t3-1)) ) (if (= (-> arg0 option-index) arg2) - (progress-method-40 arg0 arg1 (the int (+ -1.0 (-> arg1 origin y))) (the int (+ 4.0 f0-26)) f30-0) + (draw-highlight-bar arg0 arg1 (the int (+ -1.0 (-> arg1 origin y))) (the int (+ 4.0 f0-26)) f30-0) ) ) ) @@ -2281,15 +2269,14 @@ (defmethod draw-option ((this menu-aspect-ratio-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (when (not (and (zero? (-> arg0 option-index)) (-> arg0 selected-option))) - (set! (-> arg0 yes-no-choice) (the-as basic (= (if arg3 - (-> arg0 aspect-ratio) - (get-aspect-ratio) - ) - 'aspect4x3 - ) - ) + (set! (-> arg0 yes-no-choice) (= (if arg3 + (-> arg0 aspect-ratio) + (get-aspect-ratio) + ) + 'aspect4x3 + ) ) - (progress-method-38 arg0 arg1 (-> this offset-y)) + (adjust-font-origin-y arg0 arg1 (-> this offset-y)) (progress-method-50 arg0 arg1 @@ -2302,7 +2289,7 @@ ) ) (let ((f0-2 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))) - (progress-method-46 arg0 arg1 f0-2 29) + (draw-header arg0 arg1 f0-2 (text-id progress-graphic-options)) ) 0 (none) @@ -2315,13 +2302,12 @@ (arg3 symbol) ) (when (not (and (zero? (-> arg0 option-index)) (-> arg0 selected-option))) - (set! (-> arg0 yes-no-choice) (the-as basic (if arg3 - (-> arg0 progressive-scan) - (-> *setting-control* user-default set-video-mode) - ) - ) + (set! (-> arg0 yes-no-choice) (if arg3 + (-> arg0 progressive-scan) + (-> *setting-control* user-default set-video-mode) + ) ) - (progress-method-38 arg0 arg1 (-> this offset-y)) + (adjust-font-origin-y arg0 arg1 (-> this offset-y)) (progress-method-50 arg0 arg1 @@ -2339,15 +2325,14 @@ (defmethod draw-option ((this menu-video-mode-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (when (not (and (zero? (-> arg0 option-index)) (-> arg0 selected-option))) - (set! (-> arg0 yes-no-choice) (the-as basic (= (if arg3 - (-> arg0 video-mode) - (get-video-mode) - ) - 'pal - ) - ) + (set! (-> arg0 yes-no-choice) (= (if arg3 + (-> arg0 video-mode) + (get-video-mode) + ) + 'pal + ) ) - (progress-method-38 arg0 arg1 (-> this offset-y)) + (adjust-font-origin-y arg0 arg1 (-> this offset-y)) (progress-method-50 arg0 arg1 @@ -2372,7 +2357,7 @@ ) (else (let ((f28-0 (-> (the-as (pointer float) (&+ (the-as pointer *setting-control*) (-> this setting-offset)))))) - (progress-method-52 + (draw-slider-option arg0 arg1 (lookup-text! *common-text* (-> this name) #f) @@ -2386,7 +2371,7 @@ ) ) (if (zero? arg2) - (progress-method-46 arg0 arg1 f30-0 30) + (draw-header arg0 arg1 f30-0 (text-id progress-sound-options)) ) ) 0 @@ -2406,7 +2391,7 @@ (progress-method-51 arg0 arg1) ) ((begin - (progress-method-38 arg0 arg1 (-> this offset-y)) + (adjust-font-origin-y arg0 arg1 (-> this offset-y)) (set! s5-0 (-> *setting-control* user-default stereo-mode)) arg3 ) @@ -2423,7 +2408,7 @@ (let ((a0-12 arg1)) (set! (-> a0-12 color) (font-color font-color-34)) ) - (progress-method-40 arg0 arg1 (the int (+ -1.0 (-> arg1 origin y))) 42 f28-0) + (draw-highlight-bar arg0 arg1 (the int (+ -1.0 (-> arg1 origin y))) 42 f28-0) (let ((s3-1 print-game-text)) (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> this name) #f)) (s3-1 *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) @@ -2460,7 +2445,7 @@ ) (else (if (= (-> arg0 option-index) arg2) - (progress-method-40 arg0 arg1 (the int (-> arg1 origin y)) 21 f28-0) + (draw-highlight-bar arg0 arg1 (the int (-> arg1 origin y)) 21 f28-0) ) (let ((s3-2 print-game-text)) (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> this name) #f)) @@ -2498,7 +2483,7 @@ ) (else (let ((f28-0 (-> (the-as (pointer float) (&+ (the-as pointer *setting-control*) (-> this setting-offset)))))) - (progress-method-52 + (draw-slider-option arg0 arg1 (lookup-text! *common-text* (-> this name) #f) @@ -2513,7 +2498,7 @@ ) (when (zero? arg2) (let ((s4-1 (get-scissor-stack-top arg0))) - (progress-method-46 arg0 arg1 f30-0 1520) + (draw-header arg0 arg1 f30-0 (text-id progress-picture-options)) (draw-icon-array! (-> *progress-icon-arrays* 75) 256 @@ -2532,7 +2517,7 @@ ) (defmethod draw-option ((this menu-camera-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) - (progress-method-38 arg0 arg1 (-> this offset-y)) + (adjust-font-origin-y arg0 arg1 (-> this offset-y)) (let* ((v1-2 (-> this menu-option-type)) (v1-3 (cond ((= v1-2 12) @@ -2544,7 +2529,7 @@ ) ) ) - (set! (-> arg0 yes-no-choice) (the-as basic (not v1-3))) + (set! (-> arg0 yes-no-choice) (not v1-3)) ) (progress-method-50 arg0 @@ -2558,7 +2543,7 @@ ) (when (zero? arg2) (let ((f0-2 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))) - (progress-method-46 arg0 arg1 f0-2 1534) + (draw-header arg0 arg1 f0-2 (text-id progress-camera-options)) ) ) 0 @@ -2570,7 +2555,7 @@ (f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (s1-0 "?????????") ) - (progress-method-38 arg0 arg1 (-> this offset-y)) + (adjust-font-origin-y arg0 arg1 (-> this offset-y)) (set-scale! arg1 0.5) (if (= arg2 (-> arg0 option-index)) 33 @@ -2584,7 +2569,7 @@ ) ) (if (= arg2 (-> arg0 option-index)) - (progress-method-40 arg0 arg1 (the int (+ 2.0 (-> arg1 origin y))) (the int (+ -1.0 f0-3)) f30-0) + (draw-highlight-bar arg0 arg1 (the int (+ 2.0 (-> arg1 origin y))) (the int (+ -1.0 f0-3)) f30-0) ) ) ) @@ -2791,7 +2776,7 @@ (let ((a0-51 arg1)) (set! (-> a0-51 color) (font-color font-color-32)) ) - (progress-method-38 arg0 arg1 0.675) + (adjust-font-origin-y arg0 arg1 0.675) (let ((a0-53 arg1)) (set! (-> a0-53 flags) (font-flags kerning right large)) ) @@ -2840,7 +2825,7 @@ (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) f30-0 ) - (progress-method-38 arg0 arg1 0.83) + (adjust-font-origin-y arg0 arg1 0.83) (set! (-> arg1 origin x) (+ (-> s3-1 x) (* 0.675 (- (-> s3-1 z) (-> s3-1 x))))) (let ((s1-3 print-game-text)) (format (clear *temp-string*) "~D" (the int (-> s2-0 file arg2 skill-count))) @@ -2892,13 +2877,13 @@ (when (zero? arg2) (case (-> arg0 current) (('select-load) - (progress-method-46 arg0 arg1 f30-0 45) + (draw-header arg0 arg1 f30-0 (text-id progress-load-file-select)) ) (('select-save-hero) - (progress-method-46 arg0 arg1 f30-0 2198) + (draw-header arg0 arg1 f30-0 (text-id save-hero-mode-file)) ) (else - (progress-method-46 arg0 arg1 f30-0 44) + (draw-header arg0 arg1 f30-0 (text-id progress-save-file-select)) ) ) ) @@ -3075,7 +3060,7 @@ (let ((a0-26 arg1)) (set! (-> a0-26 color) (font-color font-color-33)) ) - (progress-method-40 arg0 arg1 (the int (+ 30.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (+ 30.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) (print-game-text (lookup-text! *common-text* (text-id progress-continue) #f) arg1 @@ -3089,7 +3074,7 @@ (set! (-> a0-30 color) (font-color font-color-33)) ) (+! (-> arg1 origin y) 20.0) - (progress-method-40 arg0 arg1 (the int (+ 30.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (+ 30.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) (draw-yes-no-style-footer arg0 arg1 @@ -3136,8 +3121,8 @@ (let ((a0-13 arg1)) (set! (-> a0-13 color) (font-color font-color-33)) ) - (progress-method-38 arg0 arg1 0.1) - (progress-method-40 arg0 arg1 (the int (-> arg1 origin y)) 18 (-> arg1 alpha)) + (adjust-font-origin-y arg0 arg1 0.1) + (draw-highlight-bar arg0 arg1 (the int (-> arg1 origin y)) 18 (-> arg1 alpha)) (print-game-text (lookup-text! *common-text* (text-id progress-continue) #f) arg1 @@ -3175,8 +3160,8 @@ (let ((a0-13 arg1)) (set! (-> a0-13 color) (font-color font-color-33)) ) - (progress-method-38 arg0 arg1 0.1) - (progress-method-40 arg0 arg1 (the int (-> arg1 origin y)) 18 (-> arg1 alpha)) + (adjust-font-origin-y arg0 arg1 0.1) + (draw-highlight-bar arg0 arg1 (the int (-> arg1 origin y)) 18 (-> arg1 alpha)) (print-game-text (lookup-text! *common-text* (text-id progress-continue) #f) arg1 @@ -3215,7 +3200,7 @@ (let ((a0-11 arg1)) (set! (-> a0-11 color) (font-color font-color-33)) ) - (progress-method-40 arg0 arg1 (the int (+ 17.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (+ 17.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) (print-game-text (lookup-text! *common-text* (text-id progress-memcard-go-back?) #f) arg1 @@ -3272,7 +3257,7 @@ (let ((a0-21 arg1)) (set! (-> a0-21 color) (font-color font-color-33)) ) - (progress-method-40 arg0 arg1 (the int (+ 9.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (+ 9.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) (print-game-text (lookup-text! *common-text* (text-id progress-continue) #f) arg1 @@ -3333,7 +3318,7 @@ (let ((a0-20 arg1)) (set! (-> a0-20 color) (font-color font-color-33)) ) - (progress-method-40 arg0 arg1 (the int (-> arg1 origin y)) 22 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (-> arg1 origin y)) 22 (-> arg1 alpha)) (print-game-text (lookup-text! *common-text* (text-id progress-continue) #f) arg1 @@ -3384,7 +3369,7 @@ (let ((a0-16 arg1)) (set! (-> a0-16 color) (font-color font-color-33)) ) - (progress-method-40 arg0 arg1 (the int (+ 5.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (+ 5.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) (print-game-text (lookup-text! *common-text* (text-id progress-continue) #f) arg1 @@ -3431,7 +3416,7 @@ (let ((a0-12 arg1)) (set! (-> a0-12 color) (font-color font-color-33)) ) - (progress-method-40 arg0 arg1 (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) (print-game-text (lookup-text! *common-text* (text-id progress-continue) #f) arg1 @@ -3478,7 +3463,7 @@ (let ((a0-12 arg1)) (set! (-> a0-12 color) (font-color font-color-33)) ) - (progress-method-40 arg0 arg1 (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) (print-game-text (lookup-text! *common-text* (text-id progress-continue) #f) arg1 @@ -3539,7 +3524,7 @@ (let ((a0-27 arg1)) (set! (-> a0-27 color) (font-color font-color-33)) ) - (progress-method-40 arg0 arg1 (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) (print-game-text (lookup-text! *common-text* (text-id progress-continue) #f) arg1 @@ -3579,7 +3564,7 @@ ) (+! (-> arg1 origin y) 95.0) (set-height! arg1 25) - (progress-method-40 arg0 arg1 (the int (-> arg1 origin y)) 44 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (-> arg1 origin y)) 44 (-> arg1 alpha)) (print-game-text (lookup-text! *common-text* (text-id progress-memcard-format?) #f) arg1 @@ -3623,7 +3608,7 @@ (bucket-id hud-draw-hud-alpha) ) (+! (-> arg1 origin y) 45.0) - (progress-method-40 arg0 arg1 (the int (+ 8.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (+ 8.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) (draw-yes-no-style-footer arg0 arg1 (text-id progress-yes) (text-id progress-no)) 0 (none) @@ -3656,7 +3641,7 @@ (bucket-id hud-draw-hud-alpha) ) (+! (-> arg1 origin y) 70.0) - (progress-method-40 arg0 arg1 (the int (+ 18.0 (-> arg1 origin y))) 22 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (+ 18.0 (-> arg1 origin y))) 22 (-> arg1 alpha)) (draw-yes-no-style-footer arg0 arg1 (text-id progress-yes) (text-id progress-no)) 0 (none) @@ -3710,7 +3695,7 @@ (bucket-id hud-draw-hud-alpha) ) (+! (-> arg1 origin y) 20.0) - (progress-method-40 arg0 arg1 (the int (-> arg1 origin y)) 24 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (-> arg1 origin y)) 24 (-> arg1 alpha)) (draw-yes-no-style-footer arg0 arg1 (text-id progress-yes) (text-id progress-no)) 0 (none) @@ -3746,7 +3731,7 @@ (bucket-id hud-draw-hud-alpha) ) (+! (-> arg1 origin y) 50.0) - (progress-method-40 arg0 arg1 (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) (draw-yes-no-style-footer arg0 arg1 (text-id progress-yes) (text-id progress-no)) 0 (none) @@ -3800,7 +3785,7 @@ (bucket-id hud-draw-hud-alpha) ) (+! (-> arg1 origin y) 25.0) - (progress-method-40 arg0 arg1 (the int (-> arg1 origin y)) 24 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (-> arg1 origin y)) 24 (-> arg1 alpha)) (draw-yes-no-style-footer arg0 arg1 (text-id progress-yes) (text-id progress-no)) 0 (none) @@ -3836,7 +3821,7 @@ (bucket-id hud-draw-hud-alpha) ) (+! (-> arg1 origin y) 70.0) - (progress-method-40 arg0 arg1 (the int (+ 20.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (+ 20.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) (draw-yes-no-style-footer arg0 arg1 (text-id progress-yes) (text-id progress-no)) 0 (none) @@ -3923,7 +3908,7 @@ ) (let ((f26-0 (s0-1 *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)))) (if (= s2-1 (-> this selected-index)) - (progress-method-40 arg0 arg1 (the int (+ -2.0 (-> arg1 origin y))) (the int (+ 2.0 f26-0)) f30-0) + (draw-highlight-bar arg0 arg1 (the int (+ -2.0 (-> arg1 origin y))) (the int (+ 2.0 f26-0)) f30-0) ) (+! (-> arg1 origin y) f26-0) ) @@ -3942,29 +3927,29 @@ (progress-method-34 arg0) (let ((s3-1 *progress-work*)) (let* ((a0-28 arg0) - (t9-16 (method-of-object a0-28 progress-method-46)) + (t9-16 (method-of-object a0-28 draw-header)) (a1-12 arg1) (a2-9 f30-0) (v1-46 (-> *progress-work* selected-num)) ) (t9-16 a0-28 a1-12 a2-9 (cond ((zero? v1-46) - 54 + (text-id progress-select-start) ) ((= v1-46 1) - 2126 + (text-id progress-title-level-select-act-1) ) ((= v1-46 2) - 2127 + (text-id progress-title-level-select-act-2) ) (else - 2128 + (text-id progress-title-level-select-act-3) ) ) ) ) - (progress-method-42 arg0 (-> s3-1 footer) (* 64.0 f30-0)) - (progress-method-41 arg0 (-> s3-1 footer) (* 128.0 f30-0)) + (draw-bg-box-alpha-2 arg0 (-> s3-1 footer) (* 64.0 f30-0)) + (draw-bg-box-outline arg0 (-> s3-1 footer) (* 128.0 f30-0)) ) ) (progress-method-47 @@ -4066,7 +4051,7 @@ (f26-0 (sv-64 a0-21 a1-7 a2-6 a3-2 (the-as bucket-id t0-2))) ) (if (= s1-1 (-> this selected-index)) - (progress-method-40 arg0 arg1 (the int (+ -2.0 (-> arg1 origin y))) (the int (+ 2.0 f26-0)) f30-0) + (draw-highlight-bar arg0 arg1 (the int (+ -2.0 (-> arg1 origin y))) (the int (+ 2.0 f26-0)) f30-0) ) (+! (-> arg1 origin y) f26-0) ) @@ -4084,29 +4069,29 @@ (progress-method-34 arg0) (let ((s3-1 *progress-work*)) (let* ((a0-25 arg0) - (t9-13 (method-of-object a0-25 progress-method-46)) + (t9-13 (method-of-object a0-25 draw-header)) (a1-10 arg1) (a2-9 f30-0) (v1-44 (-> *progress-work* selected-num)) ) (t9-13 a0-25 a1-10 a2-9 (cond ((zero? v1-44) - 91 + (text-id progress-scene-player-act-1) ) ((= v1-44 1) - 92 + (text-id progress-scene-player-act-2) ) ((= v1-44 2) - 93 + (text-id progress-scene-player-act-3) ) (else - 2002 + (text-id progress-title-commentary) ) ) ) ) - (progress-method-42 arg0 (-> s3-1 footer) (* 64.0 f30-0)) - (progress-method-41 arg0 (-> s3-1 footer) (* 128.0 f30-0)) + (draw-bg-box-alpha-2 arg0 (-> s3-1 footer) (* 64.0 f30-0)) + (draw-bg-box-outline arg0 (-> s3-1 footer) (* 128.0 f30-0)) ) ) (progress-method-47 @@ -4122,7 +4107,7 @@ (defmethod draw-option ((this menu-qr-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))) (set! (-> arg1 alpha) f30-0) - (progress-method-38 arg0 arg1 (-> this offset-y)) + (adjust-font-origin-y arg0 arg1 (-> this offset-y)) (cond (arg3 (let ((a0-2 arg1)) @@ -4146,7 +4131,7 @@ ) ) (when (= (-> arg0 option-index) arg2) - (progress-method-40 arg0 arg1 (the int (+ -2.0 (-> arg1 origin y))) (the int (+ 8.0 f28-0)) f30-0) + (draw-highlight-bar arg0 arg1 (the int (+ -2.0 (-> arg1 origin y))) (the int (+ 8.0 f28-0)) f30-0) (set! (-> arg1 origin y) (+ 4.0 f28-0 (-> arg1 origin y))) ) ) @@ -4155,7 +4140,7 @@ (draw-yes-no-style-footer arg0 arg1 (text-id progress-yes) (text-id progress-no)) ) (if (zero? arg2) - (progress-method-46 arg0 arg1 f30-0 116) + (draw-header arg0 arg1 f30-0 (text-id progress-qr)) ) ) 0 @@ -4201,18 +4186,18 @@ ) (cond ((kiosk?) - (set! (-> s4-0 secrets-unlocked) (the-as basic #t)) + (set! (-> s4-0 secrets-unlocked) #t) (set! s5-0 (logior (the-as int s5-0) 32)) ) ((unlocked-secret-menu? (the-as game-secrets s5-0)) - (set! (-> s4-0 secrets-unlocked) (the-as basic #t)) + (set! (-> s4-0 secrets-unlocked) #t) ) (else (set! (-> s4-0 secrets-unlocked) #f) ) ) (when *cheat-mode* - (set! (-> s4-0 secrets-unlocked) (the-as basic #t)) + (set! (-> s4-0 secrets-unlocked) #t) (set! s5-0 (logior (the-as int s5-0) #x3bfe)) ) ) @@ -4333,11 +4318,9 @@ ) ) -;; ERROR: Function may read a register that is not set: t1 (defmethod draw-option ((this menu-secret-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (a0-19 string) - (t1-0 int) (sv-16 float) (sv-24 int) (sv-96 int) @@ -4380,15 +4363,16 @@ ) (let ((f1-5 (* (the float (-> s2-0 h)) f0-5))) (+ (- (- -20.0 f30-0) (-> s3-0 x)) (-> s3-0 z)) - (set! t1-0 (logior #x808080 (shr (shl (the int (* 128.0 sv-16)) 56) 32))) - (draw-icon-array! - (-> *progress-icon-arrays* 68) - (the int (+ 10.0 (-> s3-0 x))) - (the int (+ (-> s3-0 y) (* 0.5 (- 28.0 f1-5)))) - f0-5 - f0-5 - (the-as rgba t1-0) - sv-16 + (let ((t1-0 (logior #x808080 (shr (shl (the int (* 128.0 sv-16)) 56) 32)))) + (draw-icon-array! + (-> *progress-icon-arrays* 68) + (the int (+ 10.0 (-> s3-0 x))) + (the int (+ (-> s3-0 y) (* 0.5 (- 28.0 f1-5)))) + f0-5 + f0-5 + (the-as rgba t1-0) + sv-16 + ) ) ) (let ((v1-26 arg1)) @@ -4453,14 +4437,7 @@ (s2-3 s1-2 s0-2 sv-128 a3-5) ) ) - (let ((a0-27 *temp-string*) - (a1-15 arg1) - (a2-9 #f) - (a3-6 44) - ) - (set! arg3 (the-as symbol 579)) - (s3-1 a0-27 a1-15 a2-9 a3-6 (the-as bucket-id arg3)) - ) + (s3-1 *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) ) (progress-method-34 arg0) ) @@ -4477,15 +4454,7 @@ (set! (-> a0-33 flags) (font-flags kerning middle middle-vert large)) ) (let ((s4-1 print-game-text)) - (let* ((s3-2 format) - (s2-4 (clear *temp-string*)) - (a0-35 *common-text*) - (t9-22 (method-of-object a0-35 lookup-text!)) - (a1-18 128) - (a2-10 #f) - ) - (s3-2 s2-4 (t9-22 a0-35 (the-as text-id a1-18) a2-10) (the-as none a2-10)) - ) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id text-0080) #f)) (s4-1 *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) ) (progress-method-34 arg0) @@ -4493,7 +4462,7 @@ (let ((a0-40 arg1)) (set! (-> a0-40 flags) (font-flags kerning middle large)) ) - (progress-method-38 arg0 arg1 0.1) + (adjust-font-origin-y arg0 arg1 0.1) (let ((a0-42 arg1)) (set! (-> a0-42 color) (font-color font-color-33)) ) @@ -4506,13 +4475,13 @@ ) ) ) - (progress-method-40 arg0 arg1 (the int (+ -2.0 (-> arg1 origin y))) (the int (+ 4.0 f0-16)) (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (+ -2.0 (-> arg1 origin y))) (the int (+ 4.0 f0-16)) (-> arg1 alpha)) ) (progress-method-34 arg0) ) ((-> this buy-menu) (progress-method-33 arg0 (-> *progress-work* body)) - (progress-method-38 arg0 arg1 0.45) + (adjust-font-origin-y arg0 arg1 0.45) (progress-method-50 arg0 arg1 @@ -4524,8 +4493,8 @@ 0.65 ) (let ((s4-3 *progress-work*)) - (progress-method-46 arg0 arg1 sv-16 84) - (progress-method-41 arg0 (-> s4-3 sub-header) (* 128.0 sv-16)) + (draw-header arg0 arg1 sv-16 (text-id progress-secrets)) + (draw-bg-box-outline arg0 (-> s4-3 sub-header) (* 128.0 sv-16)) ) (progress-method-34 arg0) ) @@ -4543,7 +4512,7 @@ (set! sv-144 "~32L~S~44L ~S") (set! sv-160 (lookup-text! *common-text* (text-id progress-on) #f)) (let ((a3-12 (lookup-text! *common-text* (text-id progress-off) #f))) - (s1-3 s0-3 sv-144 sv-160 a3-12 (the-as none arg3) (the-as none t1-0)) + (s1-3 s0-3 sv-144 sv-160 a3-12) ) ) (let* ((f0-27 (-> (s2-5 *temp-string* arg1) length)) @@ -4680,8 +4649,8 @@ (a1-45 arg1) (a2-31 #f) (a3-15 40) - (t0-9 579) - (f20-0 (sv-256 a0-87 a1-45 a2-31 a3-15 (the-as bucket-id t0-9))) + (t0-10 579) + (f20-0 (sv-256 a0-87 a1-45 a2-31 a3-15 (the-as bucket-id t0-10))) ) (when (not (logtest? (-> s2-6 s1-5 flags) (secret-item-option-flags sf0))) (set! (-> arg1 origin x) (+ (-> s3-3 x) f28-1)) @@ -4704,9 +4673,9 @@ (a1-49 arg1) (a2-35 #f) (a3-16 40) - (t0-10 579) + (t0-11 579) ) - (sv-304 a0-94 a1-49 a2-35 a3-16 (the-as bucket-id t0-10)) + (sv-304 a0-94 a1-49 a2-35 a3-16 (the-as bucket-id t0-11)) ) ) ((= sv-288 1) @@ -4717,7 +4686,7 @@ (let ((a0-97 (clear *temp-string*)) (a1-50 "~32L~S~44L ~S") ) - (sv-336 a0-97 a1-50 sv-352 sv-368 (the-as none t0-9) (the-as none t1-0)) + (sv-336 a0-97 a1-50 sv-352 sv-368) ) (s0-8 *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)) ) @@ -4746,7 +4715,7 @@ (a2-40 sv-352) (a3-20 sv-368) ) - (sv-400 a0-104 a1-54 a2-40 a3-20 (the-as none t0-9) (the-as none t1-0)) + (sv-400 a0-104 a1-54 a2-40 a3-20) ) (s0-10 *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)) ) @@ -4769,7 +4738,7 @@ ) (+! (-> arg1 origin y) f20-0) (if (= s1-5 (-> this selected-index)) - (progress-method-40 arg0 arg1 (the int (+ -2.0 f22-2)) (the int (+ 3.0 f20-0)) sv-16) + (draw-highlight-bar arg0 arg1 (the int (+ -2.0 f22-2)) (the int (+ 3.0 f20-0)) sv-16) ) ) ) @@ -4786,10 +4755,10 @@ ) (progress-method-34 arg0) (let ((s3-4 *progress-work*)) - (progress-method-46 arg0 arg1 sv-16 84) - (progress-method-41 arg0 (-> s3-4 sub-header) (* 128.0 sv-16)) - (progress-method-42 arg0 (-> s3-4 footer) (* 64.0 sv-16)) - (progress-method-41 arg0 (-> s3-4 footer) (* 128.0 sv-16)) + (draw-header arg0 arg1 sv-16 (text-id progress-secrets)) + (draw-bg-box-outline arg0 (-> s3-4 sub-header) (* 128.0 sv-16)) + (draw-bg-box-alpha-2 arg0 (-> s3-4 footer) (* 64.0 sv-16)) + (draw-bg-box-outline arg0 (-> s3-4 footer) (* 128.0 sv-16)) ) (progress-method-47 arg0 diff --git a/goal_src/jak3/engine/ui/progress/progress-h.gc b/goal_src/jak3/engine/ui/progress/progress-h.gc index b5a4c3fd8e..c066b0c403 100644 --- a/goal_src/jak3/engine/ui/progress/progress-h.gc +++ b/goal_src/jak3/engine/ui/progress/progress-h.gc @@ -169,7 +169,7 @@ (deftype progress (process-drawable) - ((scissor-stack vector 8 :inline) + ((scissor-stack vector 8 :inline) (scissor-count int32) (current-options menu-option-list) (menu-transition float) @@ -183,38 +183,38 @@ (next symbol) (ring-angle float) (ring-want-angle float) - (init-quat quaternion :inline) + (init-quat quaternion :inline) (pos-transition float) (anim-frame float) (swing float) (main-menu symbol) - (state-array symbol 8) - (option-index-stack int32 8) + (state-array symbol 8) + (option-index-stack int32 8) (state-pos int32) - (secret-buying basic) - (secret-buy-choice basic) + (secret-buying symbol) + (secret-buy-choice symbol) (scanlines-alpha float) (start-time time-frame) (which-slot int32) - (starting-state basic) - (yes-no-choice basic) + (starting-state symbol) + (yes-no-choice symbol) (time-out time-frame) (last-sound time-frame) (last-move time-frame) (center-x-backup int32) (center-y-backup int32) - (flip-horizontal basic) - (flip-vertical basic) - (progressive-scan basic) - (aspect-ratio basic) - (video-mode basic) + (flip-horizontal symbol) + (flip-vertical symbol) + (progressive-scan symbol) + (aspect-ratio symbol) + (video-mode symbol) (stereo-mode-backup int32) - (vibrations basic) - (subtitles basic) - (languages int32 3) - (subtitle-language-index int32 :overlay-at (-> languages 0)) - (language-index int32 :overlay-at (-> languages 1)) - (audio-language-index int32 :overlay-at (-> languages 2)) + (vibrations symbol) + (subtitles symbol) + (languages language-enum-s32 3) + (subtitle-language-index language-enum-s32 :overlay-at (-> languages 0)) + (language-index language-enum-s32 :overlay-at (-> languages 1)) + (audio-language-index language-enum-s32 :overlay-at (-> languages 2)) (current-task-index int32) (current-line-index int32) (first-closed-line-index int32) @@ -237,7 +237,7 @@ ) (:methods (init-defaults (_type_) object) - (respond-to-cpad (_type_) none) + (respond-to-cpad (_type_) object) (gone? (_type_) object) (can-go-back? (_type_) symbol) (get-state-check-card (_type_ symbol) symbol) @@ -245,27 +245,27 @@ (pop-state (_type_) int) (set-next-state (_type_ symbol int) int) (set-menu-options (_type_ symbol) int) - (progress-method-33 (_type_ progress-box) none) - (progress-method-34 (_type_) none) + (progress-method-33 (_type_ progress-box) object) + (progress-method-34 (_type_) object) (get-scissor-stack-top (_type_) vector) (get-language-by-idx (_type_ int) int) - (progress-method-37 (_type_) none) - (progress-method-38 (_type_ font-context float) none) - (progress-method-39 (_type_) none) - (progress-method-40 (_type_ font-context int int float) none) - (progress-method-41 (_type_ progress-box float) none) - (progress-method-42 (_type_ progress-box float) none) - (progress-method-43 (_type_ progress-box float) none) - (progress-method-44 (_type_ font-context string) none) + (set-selected-color (_type_) object) + (adjust-font-origin-y (_type_ font-context float) object) + (progress-method-39 (_type_) object) + (draw-highlight-bar (_type_ font-context int int float) object) + (draw-bg-box-outline (_type_ progress-box float) object) + (draw-bg-box-alpha-2 (_type_ progress-box float) object) + (draw-bg-box-alpha-1 (_type_ progress-box float) object) + (progress-method-44 (_type_ font-context string) object) (progress-method-45 (_type_ font-context float float string float float int) float) - (progress-method-46 (_type_ font-context float int) none) - (progress-method-47 (_type_ font-context symbol symbol) none) - (draw-prev-next-footer (_type_ font-context float) none) - (draw-yes-no-style-footer (_type_ font-context text-id text-id) none) - (progress-method-50 (_type_ font-context text-id text-id text-id symbol symbol float) none) - (progress-method-51 (_type_ font-context) none) - (progress-method-52 (_type_ font-context string float float float float float) none) - (progress-method-53 (_type_ font-context) none) + (draw-header (_type_ font-context float text-id) object) + (progress-method-47 (_type_ font-context symbol symbol) object) + (draw-prev-next-footer (_type_ font-context float) object) + (draw-yes-no-style-footer (_type_ font-context text-id text-id) object) + (progress-method-50 (_type_ font-context text-id text-id text-id symbol symbol float) object) + (progress-method-51 (_type_ font-context) object) + (draw-slider-option (_type_ font-context string float float float float float) object) + (progress-method-53 (_type_ font-context) object) ) ) @@ -293,7 +293,7 @@ (load-save-3b progress-box :inline) (last-slot-saved int32) (selected-num int32) - (secrets-unlocked basic) + (secrets-unlocked symbol) (hero-mode-save symbol) ) ) @@ -510,7 +510,7 @@ ((current-index float) (target-index float) (scroll-speed float) - (on-screen basic) + (on-screen symbol) ) ) diff --git a/goal_src/jak3/engine/ui/progress/progress.gc b/goal_src/jak3/engine/ui/progress/progress.gc index 2084e9e7e3..6b4e44e653 100644 --- a/goal_src/jak3/engine/ui/progress/progress.gc +++ b/goal_src/jak3/engine/ui/progress/progress.gc @@ -247,17 +247,21 @@ (set-time! (-> this last-move)) (set! (-> this center-x-backup) (-> *setting-control* user-default screenx)) (set! (-> this center-y-backup) (-> *setting-control* user-default screeny)) - (set! (-> this flip-horizontal) (the-as basic (-> *setting-control* cam-default flip-horizontal))) - (set! (-> this flip-vertical) (the-as basic (-> *setting-control* cam-default flip-vertical))) - (set! (-> this progressive-scan) (the-as basic (-> *setting-control* user-default set-video-mode))) - (set! (-> this aspect-ratio) (the-as basic (get-aspect-ratio))) - (set! (-> this video-mode) (the-as basic (get-video-mode))) + (set! (-> this flip-horizontal) (-> *setting-control* cam-default flip-horizontal)) + (set! (-> this flip-vertical) (-> *setting-control* cam-default flip-vertical)) + (set! (-> this progressive-scan) (-> *setting-control* user-default set-video-mode)) + (set! (-> this aspect-ratio) (get-aspect-ratio)) + (set! (-> this video-mode) (get-video-mode)) (set! (-> this stereo-mode-backup) (-> *setting-control* user-default stereo-mode)) - (set! (-> this vibrations) (the-as basic (-> *setting-control* user-default vibration))) - (set! (-> this subtitles) (the-as basic (-> *setting-control* user-default subtitle))) - (set! (-> this language-index) (the-as int (-> *setting-control* user-default language))) - (set! (-> this subtitle-language-index) (the-as int (-> *setting-control* user-default subtitle-language))) - (set! (-> this audio-language-index) (the-as int (-> *setting-control* user-default audio-language))) + (set! (-> this vibrations) (-> *setting-control* user-default vibration)) + (set! (-> this subtitles) (-> *setting-control* user-default subtitle)) + (set! (-> this language-index) (the-as language-enum-s32 (-> *setting-control* user-default language))) + (set! (-> this subtitle-language-index) + (the-as language-enum-s32 (-> *setting-control* user-default subtitle-language)) + ) + (set! (-> this audio-language-index) + (the-as language-enum-s32 (-> *setting-control* user-default audio-language)) + ) (set! (-> (the-as menu-missions-option (-> *missions-options* options 0)) current-index) 0.0) (set! (-> (the-as menu-missions-option (-> *missions-options* options 0)) target-index) 0.0) (set! (-> *progress-work* secrets-unlocked) #f) @@ -413,7 +417,7 @@ (set! (-> self pos-transition) 1.0) (init-defaults self) (set-next-state self arg0 0) - (set! (-> self starting-state) (the-as basic (-> self next))) + (set! (-> self starting-state) (-> self next)) (set! (-> self current) (-> self next)) (if (= arg0 'main) (set! (-> self next) 'none) @@ -921,7 +925,7 @@ 0 ) (('select-scene-special) - (set! (-> this starting-state) (the-as basic 'title)) + (set! (-> this starting-state) 'title) (set! (-> this state-pos) 0) (let ((v1-80 (-> this state-pos))) (set! (-> this state-array v1-80) 'title) @@ -970,6 +974,7 @@ 0 ) +;; WARN: Return type mismatch int vs object. (defmethod respond-to-cpad ((this progress)) (mc-get-slot-info 0 *progress-save-info*) (memcard-unlocked-secrets? this #f) @@ -1084,7 +1089,6 @@ ) ) 0 - (none) ) (defbehavior progress-trans progress () @@ -1130,7 +1134,7 @@ (cond ((and (cpad-hold? 0 l2) (cpad-hold? 0 r1)) (when (= (-> self current-options) *main-options*) - (set! (-> *progress-work* secrets-unlocked) (the-as basic #t)) + (set! (-> *progress-work* secrets-unlocked) #t) (set! (-> *progress-work* selected-num) 0) (set! (-> self current-options) *main-options-debug*) ) @@ -1315,6 +1319,7 @@ 0 ) +;; WARN: Return type mismatch int vs object. (defmethod progress-method-33 ((this progress) (arg0 progress-box)) (set! (-> this scissor-count) (min 7 (+ (-> this scissor-count) 1))) (let ((s5-0 (-> this scissor-stack (-> this scissor-count))) @@ -1367,9 +1372,9 @@ ) ) 0 - (none) ) +;; WARN: Return type mismatch int vs object. (defmethod progress-method-34 ((this progress)) (set! (-> this scissor-count) (max 0 (+ (-> this scissor-count) -1))) (let ((gp-0 (-> this scissor-stack (-> this scissor-count)))) @@ -1415,7 +1420,6 @@ ) ) 0 - (none) ) (defmethod get-scissor-stack-top ((this progress)) @@ -1425,7 +1429,7 @@ (defbehavior progress-post progress () (local-vars (sv-208 font-context) (sv-212 int) (sv-216 hud-box) (sv-220 symbol)) (when (-> self current-options) - (progress-method-37 self) + (set-selected-color self) (set! (-> self scissor-count) -1) (progress-method-33 self (-> *progress-work* full-screen)) (let ((gp-0 (-> self current-options options))) @@ -1445,8 +1449,8 @@ (begin-scan sv-216 self) (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> self menu-transition)))))) (when (not (or (= (-> self current) 'bigmap) (= (-> self next) 'bigmap))) - (progress-method-43 self (-> s4-0 small-screen) (* 144.0 f30-0)) - (progress-method-41 self (-> s4-0 small-screen) (* 128.0 f30-0)) + (draw-bg-box-alpha-1 self (-> s4-0 small-screen) (* 144.0 f30-0)) + (draw-bg-box-outline self (-> s4-0 small-screen) (* 128.0 f30-0)) ) ) ) @@ -2235,7 +2239,7 @@ (defmethod respond-progress ((this menu-already-exists-option) (arg0 progress) (arg1 symbol)) (let ((a1-2 (get-state-check-card arg0 'select-save)) - (gp-0 (the-as object #f)) + (gp-0 #f) ) (if (!= a1-2 'select-save) (set-next-state arg0 a1-2 0) @@ -2243,7 +2247,7 @@ (cond ((cpad-pressed? 0 left l-analog-left) (set! gp-0 (not (-> arg0 yes-no-choice))) - (set! (-> arg0 yes-no-choice) (the-as basic #t)) + (set! (-> arg0 yes-no-choice) #t) ) ((cpad-pressed? 0 right l-analog-right) (set! gp-0 (-> arg0 yes-no-choice)) @@ -2278,7 +2282,7 @@ (defmethod respond-progress ((this menu-create-game-option) (arg0 progress) (arg1 symbol)) (let ((s4-0 (&-> arg0 yes-no-choice)) - (gp-0 (the-as object #f)) + (gp-0 #f) ) (let ((a1-2 (get-state-check-card arg0 'select-save))) (if (!= a1-2 'select-save) @@ -2288,7 +2292,7 @@ (cond ((cpad-pressed? 0 left l-analog-left) (set! gp-0 (not (-> s4-0 0))) - (set! (-> s4-0 0) (the-as basic #t)) + (set! (-> s4-0 0) #t) ) ((cpad-pressed? 0 right l-analog-right) (set! gp-0 (-> s4-0 0)) @@ -2330,7 +2334,7 @@ ((cpad-pressed? 0 left l-analog-left) (when (and (not (-> s5-0 0)) (not (-> arg0 clear-screen))) (sound-play "generic-beep") - (set! (-> s5-0 0) (the-as basic #t)) + (set! (-> s5-0 0) #t) ) ) ((cpad-pressed? 0 right l-analog-right) @@ -2447,7 +2451,7 @@ (cond ((and (cpad-pressed? 0 left l-analog-left) (not (-> gp-0 0))) (sound-play "generic-beep") - (set! (-> gp-0 0) (the-as basic #t)) + (set! (-> gp-0 0) #t) ) ((and (cpad-pressed? 0 right l-analog-right) (-> gp-0 0)) (sound-play "generic-beep") @@ -2459,12 +2463,12 @@ (set! (-> arg0 time-out) 0) (cond ((-> arg0 yes-no-choice) - (set! (-> *setting-control* user-default video-mode) (the-as symbol (-> arg0 video-mode))) + (set! (-> *setting-control* user-default video-mode) (-> arg0 video-mode)) (set-time! (-> arg0 time-out)) (set-next-state arg0 'video-mode-ok 0) ) (else - (set! (-> arg0 video-mode) (the-as basic 'pal)) + (set! (-> arg0 video-mode) 'pal) (pop-state arg0) ) ) @@ -2479,7 +2483,7 @@ (cond ((and (cpad-pressed? 0 left l-analog-left) (not (-> s5-0 0))) (sound-play "generic-beep") - (set! (-> s5-0 0) (the-as basic #t)) + (set! (-> s5-0 0) #t) ) ((and (cpad-pressed? 0 right l-analog-right) (-> s5-0 0)) (sound-play "generic-beep") @@ -2493,8 +2497,8 @@ (sound-play "generic-beep") ) (else - (set! (-> arg0 video-mode) (the-as basic 'pal)) - (set! (-> *setting-control* user-default video-mode) (the-as symbol (-> arg0 video-mode))) + (set! (-> arg0 video-mode) 'pal) + (set! (-> *setting-control* user-default video-mode) (-> arg0 video-mode)) (sound-play "generic-beep") ) ) @@ -2505,8 +2509,8 @@ ) (when (and (nonzero? (-> arg0 time-out)) (< (seconds 10) (- (current-time) (-> arg0 time-out)))) (set! (-> arg0 time-out) 0) - (set! (-> arg0 video-mode) (the-as basic 'pal)) - (set! (-> *setting-control* user-default video-mode) (the-as symbol (-> arg0 video-mode))) + (set! (-> arg0 video-mode) 'pal) + (set! (-> *setting-control* user-default video-mode) (-> arg0 video-mode)) (pop-state arg0) ) 0 @@ -2517,8 +2521,8 @@ (cond ((and (cpad-pressed? 0 left l-analog-left) (not (-> s5-0 0))) (sound-play "generic-beep") - (set! (-> arg0 progressive-scan) (the-as basic #t)) - (set! (-> s5-0 0) (the-as basic #t)) + (set! (-> arg0 progressive-scan) #t) + (set! (-> s5-0 0) #t) ) ((and (cpad-pressed? 0 right l-analog-right) (-> s5-0 0)) (sound-play "generic-beep") @@ -2533,7 +2537,7 @@ ((-> arg0 yes-no-choice) (sound-play "generic-beep") (set-progressive-scan #t) - (set! (-> arg0 progressive-scan) (the-as basic #t)) + (set! (-> arg0 progressive-scan) #t) (set-time! (-> arg0 time-out)) (set-next-state arg0 'progressive-mode-ok 0) ) @@ -2554,7 +2558,7 @@ (cond ((and (cpad-pressed? 0 left l-analog-left) (not (-> s5-0 0))) (sound-play "generic-beep") - (set! (-> s5-0 0) (the-as basic #t)) + (set! (-> s5-0 0) #t) ) ((and (cpad-pressed? 0 right l-analog-right) (-> s5-0 0)) (sound-play "generic-beep") @@ -2571,7 +2575,7 @@ ) (else (sound-play "generic-beep") - (set! (-> arg0 progressive-scan) (the-as basic #t)) + (set! (-> arg0 progressive-scan) #t) ) ) (set! (-> arg0 time-out) 0) @@ -2668,7 +2672,7 @@ (defmethod respond-progress ((this menu-format-card-option) (arg0 progress) (arg1 symbol)) (let ((s4-0 (&-> arg0 yes-no-choice)) - (gp-0 (the-as object #f)) + (gp-0 #f) ) (let ((a1-2 (get-state-check-card arg0 (-> arg0 current)))) (set-next-state arg0 a1-2 0) @@ -2676,7 +2680,7 @@ (cond ((cpad-pressed? 0 left l-analog-left) (set! gp-0 (not (-> s4-0 0))) - (set! (-> s4-0 0) (the-as basic #t)) + (set! (-> s4-0 0) #t) ) ((cpad-pressed? 0 right l-analog-right) (set! gp-0 (-> s4-0 0)) @@ -3224,7 +3228,7 @@ ) (defmethod respond-progress ((this menu-secret-option) (arg0 progress) (arg1 symbol)) - (let ((gp-0 (the-as object #f))) + (let ((gp-0 #f)) (the float (+ (-> *menu-secrets-array* length) -1)) (let ((a0-1 (+ (-> *menu-secrets-array* length) -1)) (v1-5 *menu-secrets-array*) @@ -3252,7 +3256,7 @@ (cond ((cpad-pressed? 0 left l-analog-left) (set! gp-0 (not (-> arg0 yes-no-choice))) - (set! (-> arg0 yes-no-choice) (the-as basic #t)) + (set! (-> arg0 yes-no-choice) #t) ) ((cpad-pressed? 0 right l-analog-right) (set! gp-0 (-> arg0 yes-no-choice)) @@ -3422,39 +3426,45 @@ (set! (-> *cpad-list* cpads 0 buzz-pause-val 0) (the-as uint 255)) (set! (-> *cpad-list* cpads 0 buzz-pause-time) (the-as uint 15)) ) - (set! (-> arg0 vibrations) (the-as basic #t)) + (set! (-> arg0 vibrations) #t) ) ((4) - (set! (-> arg0 subtitles) (the-as basic #t)) + (set! (-> arg0 subtitles) #t) ) ((5) - (set! (-> arg0 subtitle-language-index) (mod (+ (-> arg0 subtitle-language-index) 9) 10)) - (if (and (= (-> arg0 subtitle-language-index) 7) + (set! (-> arg0 subtitle-language-index) + (the-as language-enum-s32 (mod (the-as int (+ (-> arg0 subtitle-language-index) 9)) 10)) + ) + (if (and (= (-> arg0 subtitle-language-index) (language-enum-s32 korean)) (or (= (scf-get-territory) 1) (and (!= (scf-get-territory) 3) (not *cheat-mode*) (!= *progress-cheat* 'language)) ) ) (+! (-> arg0 subtitle-language-index) -1) ) - (if (= (-> arg0 subtitle-language-index) 6) + (if (= (-> arg0 subtitle-language-index) (language-enum-s32 japanese)) (+! (-> arg0 subtitle-language-index) -2) ) ) ((6) - (set! (-> arg0 language-index) (mod (+ (-> arg0 language-index) 9) 10)) - (if (and (= (-> arg0 language-index) 7) + (set! (-> arg0 language-index) + (the-as language-enum-s32 (mod (the-as int (+ (-> arg0 language-index) 9)) 10)) + ) + (if (and (= (-> arg0 language-index) (language-enum-s32 korean)) (or (= (scf-get-territory) 1) (and (!= (scf-get-territory) 3) (not *cheat-mode*) (!= *progress-cheat* 'language)) ) ) (+! (-> arg0 language-index) -1) ) - (if (= (-> arg0 language-index) 6) + (if (= (-> arg0 language-index) (language-enum-s32 japanese)) (+! (-> arg0 language-index) -2) ) ) ((7) - (set! (-> arg0 audio-language-index) (mod (+ (-> arg0 audio-language-index) 4) 5)) + (set! (-> arg0 audio-language-index) + (the-as language-enum-s32 (mod (the-as int (+ (-> arg0 audio-language-index) 4)) 5)) + ) ) ) ) @@ -3468,11 +3478,13 @@ (set! (-> arg0 subtitles) #f) ) ((5) - (set! (-> arg0 subtitle-language-index) (mod (+ (-> arg0 subtitle-language-index) 1) 10)) - (if (= (-> arg0 subtitle-language-index) 5) + (set! (-> arg0 subtitle-language-index) + (the-as language-enum-s32 (mod (the-as int (+ (-> arg0 subtitle-language-index) 1)) 10)) + ) + (if (= (-> arg0 subtitle-language-index) (language-enum-s32 commentary)) (+! (-> arg0 subtitle-language-index) 2) ) - (if (and (= (-> arg0 subtitle-language-index) 7) + (if (and (= (-> arg0 subtitle-language-index) (language-enum-s32 korean)) (or (= (scf-get-territory) 1) (and (!= (scf-get-territory) 3) (not *cheat-mode*) (!= *progress-cheat* 'language)) ) @@ -3481,11 +3493,13 @@ ) ) ((6) - (set! (-> arg0 language-index) (mod (+ (-> arg0 language-index) 1) 10)) - (if (= (-> arg0 language-index) 5) + (set! (-> arg0 language-index) + (the-as language-enum-s32 (mod (the-as int (+ (-> arg0 language-index) 1)) 10)) + ) + (if (= (-> arg0 language-index) (language-enum-s32 commentary)) (+! (-> arg0 language-index) 2) ) - (if (and (= (-> arg0 language-index) 7) + (if (and (= (-> arg0 language-index) (language-enum-s32 korean)) (or (= (scf-get-territory) 1) (and (!= (scf-get-territory) 3) (not *cheat-mode*) (!= *progress-cheat* 'language)) ) @@ -3494,17 +3508,19 @@ ) ) ((7) - (set! (-> arg0 audio-language-index) (mod (+ (-> arg0 audio-language-index) 1) 5)) + (set! (-> arg0 audio-language-index) + (the-as language-enum-s32 (mod (the-as int (+ (-> arg0 audio-language-index) 1)) 5)) + ) ) ) ) ((cpad-pressed? 0 confirm) (case (-> this menu-option-type) ((3) - (set! (-> *setting-control* user-default vibration) (the-as symbol (-> arg0 vibrations))) + (set! (-> *setting-control* user-default vibration) (-> arg0 vibrations)) ) ((4) - (set! (-> *setting-control* user-default subtitle) (the-as symbol (-> arg0 subtitles))) + (set! (-> *setting-control* user-default subtitle) (-> arg0 subtitles)) ) ((5) (set! (-> *setting-control* user-default subtitle-language) @@ -3513,7 +3529,7 @@ ) ((6) (set! (-> *setting-control* user-default language) (the-as language-enum (-> arg0 language-index))) - (load-level-text-files (-> arg0 language-index)) + (load-level-text-files (the-as int (-> arg0 language-index))) ) ((7) (set! (-> *setting-control* user-default audio-language) @@ -3536,11 +3552,15 @@ (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons down l-analog-down)) ) (else - (set! (-> arg0 vibrations) (the-as basic (-> *setting-control* user-default vibration))) - (set! (-> arg0 subtitles) (the-as basic (-> *setting-control* user-default subtitle))) - (set! (-> arg0 language-index) (the-as int (-> *setting-control* user-default language))) - (set! (-> arg0 subtitle-language-index) (the-as int (-> *setting-control* user-default subtitle-language))) - (set! (-> arg0 audio-language-index) (the-as int (-> *setting-control* user-default audio-language))) + (set! (-> arg0 vibrations) (-> *setting-control* user-default vibration)) + (set! (-> arg0 subtitles) (-> *setting-control* user-default subtitle)) + (set! (-> arg0 language-index) (the-as language-enum-s32 (-> *setting-control* user-default language))) + (set! (-> arg0 subtitle-language-index) + (the-as language-enum-s32 (-> *setting-control* user-default subtitle-language)) + ) + (set! (-> arg0 audio-language-index) + (the-as language-enum-s32 (-> *setting-control* user-default audio-language)) + ) ) ) 0 @@ -3548,31 +3568,35 @@ (defmethod respond-progress ((this menu-language-option) (arg0 progress) (arg1 symbol)) (enable-level-text-file-loading) - (set! (-> arg0 language-index) (the-as int (-> *setting-control* user-default language))) + (set! (-> arg0 language-index) (the-as language-enum-s32 (-> *setting-control* user-default language))) (cond ((cpad-pressed? 0 left l-analog-left) (sound-play "generic-beep") - (set! (-> arg0 language-index) (mod (+ (-> arg0 language-index) 9) 10)) - (if (and (= (-> arg0 language-index) 7) + (set! (-> arg0 language-index) + (the-as language-enum-s32 (mod (the-as int (+ (-> arg0 language-index) 9)) 10)) + ) + (if (and (= (-> arg0 language-index) (language-enum-s32 korean)) (or (= (scf-get-territory) 1) (and (!= (scf-get-territory) 3) (not *cheat-mode*) (!= *progress-cheat* 'language)) ) ) (+! (-> arg0 language-index) -1) ) - (if (= (-> arg0 language-index) 6) + (if (= (-> arg0 language-index) (language-enum-s32 japanese)) (+! (-> arg0 language-index) -2) ) (set! (-> *setting-control* user-default language) (the-as language-enum (-> arg0 language-index))) - (load-level-text-files (-> arg0 language-index)) + (load-level-text-files (the-as int (-> arg0 language-index))) ) ((cpad-pressed? 0 right l-analog-right) (sound-play "generic-beep") - (set! (-> arg0 language-index) (mod (+ (-> arg0 language-index) 1) 10)) - (if (= (-> arg0 language-index) 5) + (set! (-> arg0 language-index) + (the-as language-enum-s32 (mod (the-as int (+ (-> arg0 language-index) 1)) 10)) + ) + (if (= (-> arg0 language-index) (language-enum-s32 commentary)) (+! (-> arg0 language-index) 2) ) - (if (and (= (-> arg0 language-index) 7) + (if (and (= (-> arg0 language-index) (language-enum-s32 korean)) (or (= (scf-get-territory) 1) (and (!= (scf-get-territory) 3) (not *cheat-mode*) (!= *progress-cheat* 'language)) ) @@ -3580,7 +3604,7 @@ (+! (-> arg0 language-index) 1) ) (set! (-> *setting-control* user-default language) (the-as language-enum (-> arg0 language-index))) - (load-level-text-files (-> arg0 language-index)) + (load-level-text-files (the-as int (-> arg0 language-index))) ) ((cpad-pressed? 0 confirm) (set! (-> *setting-control* user-default subtitle-language) (the-as language-enum (-> arg0 language-index))) @@ -3652,17 +3676,17 @@ (cond ((cpad-pressed? 0 left l-analog-left) (sound-play "generic-beep") - (set! (-> arg0 aspect-ratio) (the-as basic 'aspect4x3)) + (set! (-> arg0 aspect-ratio) 'aspect4x3) ) ((cpad-pressed? 0 right l-analog-right) (sound-play "generic-beep") - (set! (-> arg0 aspect-ratio) (the-as basic 'aspect16x9)) + (set! (-> arg0 aspect-ratio) 'aspect16x9) ) ((cpad-pressed? 0 triangle) - (set! (-> arg0 aspect-ratio) (the-as basic (get-aspect-ratio))) + (set! (-> arg0 aspect-ratio) (get-aspect-ratio)) ) ((cpad-pressed? 0 confirm) - (set! (-> *setting-control* user-default aspect-ratio) (the-as symbol (-> arg0 aspect-ratio))) + (set! (-> *setting-control* user-default aspect-ratio) (-> arg0 aspect-ratio)) ) ) ) @@ -3670,7 +3694,7 @@ (cond ((cpad-pressed? 0 left l-analog-left) (sound-play "generic-beep") - (set! (-> arg0 progressive-scan) (the-as basic #t)) + (set! (-> arg0 progressive-scan) #t) ) ((cpad-pressed? 0 right l-analog-right) (sound-play "generic-beep") @@ -3678,7 +3702,7 @@ (set! (-> *setting-control* user-default set-video-mode) #f) ) ((cpad-pressed? 0 triangle) - (set! (-> arg0 progressive-scan) (the-as basic (-> *setting-control* user-default set-video-mode))) + (set! (-> arg0 progressive-scan) (-> *setting-control* user-default set-video-mode)) ) ((cpad-pressed? 0 confirm) (push-state arg0) @@ -3690,21 +3714,21 @@ (cond ((cpad-pressed? 0 left l-analog-left) (sound-play "generic-beep") - (set! (-> arg0 video-mode) (the-as basic 'pal)) + (set! (-> arg0 video-mode) 'pal) ) ((cpad-pressed? 0 right l-analog-right) (sound-play "generic-beep") - (set! (-> arg0 video-mode) (the-as basic 'ntsc)) + (set! (-> arg0 video-mode) 'ntsc) ) ((cpad-pressed? 0 triangle) - (set! (-> arg0 video-mode) (the-as basic (get-video-mode))) + (set! (-> arg0 video-mode) (get-video-mode)) ) ((cpad-pressed? 0 confirm) (when (!= (-> *setting-control* user-default video-mode) (-> arg0 video-mode)) (let ((v1-88 (-> arg0 video-mode))) (case v1-88 (('pal) - (set! (-> *setting-control* user-default video-mode) (the-as symbol v1-88)) + (set! (-> *setting-control* user-default video-mode) v1-88) ) (('ntsc) (push-state arg0) @@ -3730,13 +3754,13 @@ (set! (-> arg0 center-y-backup) (-> *setting-control* user-default screeny)) ) ((9) - (set! (-> arg0 aspect-ratio) (the-as basic (-> *setting-control* user-default aspect-ratio))) + (set! (-> arg0 aspect-ratio) (-> *setting-control* user-default aspect-ratio)) ) ((10) - (set! (-> arg0 progressive-scan) (the-as basic (-> *setting-control* user-default set-video-mode))) + (set! (-> arg0 progressive-scan) (-> *setting-control* user-default set-video-mode)) ) ((11) - (set! (-> arg0 video-mode) (the-as basic (get-video-mode))) + (set! (-> arg0 video-mode) (get-video-mode)) ) ) ) @@ -3756,14 +3780,14 @@ (sound-play "generic-beep") ) ((cpad-pressed? 0 right l-analog-right) - (set! (-> arg0 flip-horizontal) (the-as basic #t)) + (set! (-> arg0 flip-horizontal) #t) (sound-play "generic-beep") ) ((cpad-pressed? 0 confirm) - (set! (-> *setting-control* cam-default flip-horizontal) (the-as symbol (-> arg0 flip-horizontal))) + (set! (-> *setting-control* cam-default flip-horizontal) (-> arg0 flip-horizontal)) ) ((cpad-pressed? 0 triangle) - (set! (-> arg0 flip-horizontal) (the-as basic (-> *setting-control* cam-current flip-horizontal))) + (set! (-> arg0 flip-horizontal) (-> *setting-control* cam-current flip-horizontal)) ) ) ) @@ -3774,14 +3798,14 @@ (sound-play "generic-beep") ) ((cpad-pressed? 0 right l-analog-right) - (set! (-> arg0 flip-vertical) (the-as basic #t)) + (set! (-> arg0 flip-vertical) #t) (sound-play "generic-beep") ) ((cpad-pressed? 0 confirm) - (set! (-> *setting-control* cam-default flip-vertical) (the-as symbol (-> arg0 flip-vertical))) + (set! (-> *setting-control* cam-default flip-vertical) (-> arg0 flip-vertical)) ) ((cpad-pressed? 0 triangle) - (set! (-> arg0 flip-vertical) (the-as basic (-> *setting-control* cam-current flip-vertical))) + (set! (-> arg0 flip-vertical) (-> *setting-control* cam-current flip-vertical)) ) ) ) @@ -3794,12 +3818,12 @@ (else (cond ((cpad-pressed? 0 confirm) - (set! (-> arg0 flip-horizontal) (the-as basic (-> *setting-control* cam-current flip-horizontal))) - (set! (-> arg0 flip-vertical) (the-as basic (-> *setting-control* cam-current flip-vertical))) + (set! (-> arg0 flip-horizontal) (-> *setting-control* cam-current flip-horizontal)) + (set! (-> arg0 flip-vertical) (-> *setting-control* cam-current flip-vertical)) ) ((cpad-pressed? 0 triangle) - (set! (-> arg0 flip-horizontal) (the-as basic (-> *setting-control* cam-current flip-horizontal))) - (set! (-> arg0 flip-vertical) (the-as basic (-> *setting-control* cam-current flip-vertical))) + (set! (-> arg0 flip-horizontal) (-> *setting-control* cam-current flip-horizontal)) + (set! (-> arg0 flip-vertical) (-> *setting-control* cam-current flip-vertical)) ) ) ) @@ -3985,7 +4009,7 @@ (cond ((and (cpad-pressed? 0 left l-analog-left) (not (-> s5-0 0))) (sound-play "generic-beep") - (set! (-> s5-0 0) (the-as basic #t)) + (set! (-> s5-0 0) #t) ) ((and (cpad-pressed? 0 right l-analog-right) (-> s5-0 0)) (sound-play "generic-beep") diff --git a/goal_src/jak3/engine/ui/text-h.gc b/goal_src/jak3/engine/ui/text-h.gc index 0fd42bdf54..efa8abd858 100644 --- a/goal_src/jak3/engine/ui/text-h.gc +++ b/goal_src/jak3/engine/ui/text-h.gc @@ -1346,8 +1346,258 @@ (credits-08b6 #x08b6) ;; PC port IDs START - (discord-rpc-not-in-mission #x1200) - (discord-rpc-in-side-mission #x1201) + (discord-rpc-not-in-mission #x11fe) + (discord-rpc-in-side-mission #x11ff) + (progress-display-mode #x1200) + (progress-windowed #x1201) + (progress-fullscreen #x1202) + (progress-borderless #x1203) + (progress-aspect-ratio-auto #x1204) + (progress-aspect-ratio-custom #x1205) + (progress-aspect-ratio-4x3 #x1206) + (progress-aspect-ratio-16x9 #x1207) + (progress-aspect-ratio-custom-title #x1208) + (progress-aspect-ratio-custom-pad-x #x1209) + (progress-aspect-ratio-custom-pad-circle #x120a) + (progress-aspect-ratio-custom-warn #x120b) + (progress-music-player #x120c) + (progress-vsync #x120d) + (progress-text-language #x120e) + (progress-cheats #x120f) + (progress-aspect-ratio-custom-width #x1210) + (progress-aspect-ratio-custom-height #x1211) + (progress-music-player-locked #x1212) + (progress-music-player-now-playing #x1213) + (progress-music-player-no-track #x1214) + (progress-music-player-flava-default #x1215) + (progress-music-player-flava-gun #x1216) + (progress-music-player-flava-board #x1217) + (progress-music-player-flava-mech #x1218) + (progress-music-player-flava-darkjak #x1219) + (progress-music-player-flava-pilot #x121a) + (progress-music-player-danger #x121b) + (progress-music-player-danger-0 #x121c) + (progress-music-player-danger-1 #x121d) + (progress-music-player-danger-2 #x121e) + (progress-music-player-danger-3 #x121f) + (progress-music-player-city #x1220) + (progress-music-player-city-battle #x1221) + (progress-music-player-battle #x1222) + (progress-music-player-danger2 #x1223) + (progress-music-player-danger3 #x1224) + (progress-music-player-danger4 #x1225) + (progress-music-player-danger6 #x1226) + (progress-music-player-danger7 #x1227) + (progress-music-player-danger9 #x1228) + (progress-music-player-danger10 #x1229) + (progress-music-player-danger11 #x122a) + (progress-music-player-atoll #x122b) + (progress-music-player-atoll-battle #x122c) + (progress-music-player-strip #x122d) + (progress-music-player-forest #x122e) + (progress-music-player-forest-battle #x122f) + (progress-music-player-sewer #x1230) + (progress-music-player-sewer-battle #x1231) + (progress-music-player-mountain #x1232) + (progress-music-player-mountain-battle #x1233) + (progress-music-player-palcab #x1234) + (progress-music-player-palcab-battle #x1235) + (progress-music-player-race #x1236) + (progress-music-player-ruins #x1237) + (progress-window-size #x1238) + (progress-window-size-decoration #x1239) + (progress-game-res #x123a) + (progress-game-res-decoration #x123b) + (progress-lod-bg #x123c) + (progress-lod-fg #x123d) + (progress-subtitle-speaker #x123f) + (progress-subtitle-speaker-off #x1240) + (progress-subtitle-speaker-auto #x1241) + (progress-subtitle-speaker-on #x1242) + (progress-territory #x1243) + (progress-territory-scea #x1244) + (progress-territory-scee #x1245) + (progress-territory-scei #x1246) + (progress-territory-scek #x1247) + (progress-msaa #x1248) + (progress-msaa-x #x1249) + (progress-led-options #x124a) + (progress-led-state #x124b) + (progress-led-health #x124c) + (progress-disable-auto-save #x124d) + (progress-auto-save-disabled #x124e) + (progress-disable-auto-save-warn #x124f) + (progress-cheats-turbo-board #x1250) + (progress-cheats-health-bars #x1251) + (progress-cheats-vehicle-health-bars #x1252) + (progress-cheats-vehicle-invuln #x1253) + (progress-cheats-statistics #x1254) + (progress-cheats-suck-in-all #x1255) + (progress-cheats-music-player #x1256) + (progress-cheats-no-textures #x1257) + (progress-cheats-fast-movies #x1258) + (progress-cheats-slow-movies #x1259) + (progress-cheats-fast-speed #x125a) + (progress-cheats-slow-speed #x125b) + (progress-cheats-fast-travel #x125c) + (progress-cheats-orb-tracker #x125d) + (progress-cheats-real-time-of-day #x125e) + (progress-cheats-city-peace #x125f) + (progress-cheats-board-tricks #x1260) + (progress-cheats-weather-bad #x1261) + (progress-cheats-weather-good #x1262) + (progress-cheats-hijack-lines #x1263) + (progress-cheats-locked #x1264) + (progress-cheats-turbo-board-unlock #x1265) + (progress-cheats-health-bars-unlock #x1266) + (progress-cheats-vehicle-health-bars-unlock #x1267) + (progress-cheats-statistics-unlock #x1268) + (progress-cheats-suck-in-all-unlock #x1269) + (progress-cheats-fast-travel-unlock #x126a) + ; (progress-camera-options #x1280) + ; (progress-camera-options-first-horz #x1281) + ; (progress-camera-options-first-vert #x1282) + ; (progress-camera-options-third-horz #x1283) + ; (progress-camera-options-third-vert #x1284) + (progress-normal #x1286) + (progress-inverted #x1287) + (progress-ps2-parts #x1288) + (progress-discord-rpc #x1289) + (progress-lod-default #x128a) + (progress-lod-low #x128b) + (progress-lod-high #x128c) + (progress-credits #x128d) + (progress-frame-rate #x128e) + (progress-misc-game-options #x128f) + (progress-speedrunner-mode #x1290) + (progress-menu-input-options #x1291) + (progress-restore-defaults #x1292) + (progress-menu-controller-options #x1293) + (progress-controller-options-select-controller #x1294) + (progress-controller-options-analog-deadzone #x1295) + (progress-controller-options-ignore-if-unfocused #x1296) + (progress-controller-options-led-hp #x1297) + (progress-controller-options-led-state #x1298) + (progress-input-options-enable-keyboard #x1299) + (progress-input-options-enable-mouse #x129a) + (progress-menu-mouse-options #x129b) + (progress-mouse-options-track-camera #x129c) + (progress-mouse-options-horz-sens #x129d) + (progress-mouse-options-vert-sens #x129e) + (progress-mouse-options-player-movement #x129f) + (progress-shadows #x12a0) + (progress-shadows-normal #x12a1) + (progress-shadows-extended #x12a2) + (progress-error-no-resolutions #x12a3) + (progress-territory-auto #x12a4) + (progress-kill-stats #x12a5) + (progress-other-stats #x12a6) + (progress-ks-total-killed #x12a7) + (progress-ks-killed-by-jak #x12a8) + (progress-ks-killed-by-darkjak #x12a9) + (progress-ks-killed-by-daxter #x12aa) + (progress-ks-killed-by-others #x12ab) + (progress-ks-source-gun-yellow #x12ac) + (progress-ks-source-gun-red #x12ad) + (progress-ks-source-gun-blue #x12ae) + (progress-ks-source-gun-dark #x12af) + (progress-ks-source-board #x12b0) + (progress-ks-source-board-trick #x12b1) + (progress-ks-source-mech #x12b2) + (progress-ks-source-mech-bonk #x12b3) + (progress-ks-source-turret #x12b4) + (progress-ks-source-punch #x12b5) + (progress-ks-source-flop #x12b6) + (progress-ks-source-uppercut #x12b7) + (progress-ks-source-spin #x12b8) + (progress-ks-source-roll #x12b9) + (progress-ks-source-darkjak-punch #x12ba) + (progress-ks-source-darkjak-flop #x12bb) + (progress-ks-source-darkjak-uppercut #x12bc) + (progress-ks-source-darkjak-spin #x12bd) + (progress-ks-source-darkjak-roll #x12be) + (progress-ks-source-darkjak-bomb0 #x12bf) + (progress-ks-source-darkjak-bomb1 #x12c0) + (progress-ks-source-indax-punch #x12c1) + (progress-ks-source-indax-spin #x12c2) + (progress-ks-source-guard #x12c3) + (progress-ks-source-sig #x12c4) + (progress-ks-source-ashelin #x12c5) + (progress-ks-source-jinx #x12c6) + (progress-ks-source-grim #x12c7) + (progress-ks-source-mog #x12c8) + (progress-ks-source-metalhead #x12c9) + (progress-ks-source-other-bot #x12ca) + (progress-ks-source-other-enemy #x12cb) + (progress-input-options-auto-hide-cursor #x1300) + (progress-menu-reassign-binds #x1301) + (progress-reassign-binds-controller #x1302) + (progress-reassign-binds-keyboard #x1303) + (progress-reassign-binds-mouse #x1304) + (progress-multiselect-no-items-found #x1305) + (progress-keybinds-waiting-for-bind #x1306) + (progress-keybinds-unset #x1307) + (progress-unknown-option #x1308) + (progress-hires-sky #x1309) + (progress-fast-airlock #x130a) + (progress-fast-elevator #x130b) + (progress-highscores-header-speedrun #x130c) + (progress-highscores-subheader-speedrun-any #x130d) + (progress-highscores-subheader-speedrun-anyhoverless #x130e) + (progress-highscores-subheader-speedrun-allmissions #x130f) + (progress-highscores-subheader-speedrun-100 #x1310) + (progress-highscores-subheader-speedrun-anyorbs #x1311) + (progress-highscores-subheader-speedrun-anyhero #x1312) + (progress-highscores-local-time #x1313) + (progress-fps-disclaimer-warning #x1314) + (progress-fps-disclaimer #x1315) + (progress-highscores-local-score #x1316) + (trick-board-none #x1320) + (trick-board-spin #x1321) + (trick-board-boost #x1322) + (trick-board-flip #x1323) + (trick-board-rail #x1324) + (trick-board-rail-jump #x1325) + (trick-board-nosegrab #x1326) + (trick-board-method #x1327) + (trick-board-board-spin #x1328) + (trick-board-board-flip #x1329) + (trick-board-noseflip #x132a) + (trick-board-kickflip #x132b) + (trick-board-jump #x132c) + (trick-board-duck-jump #x132d) + (trick-board-quick-jump #x132e) + (trick-darkjak #x132f) + (trick-darkjak-bomb0 #x1330) + (trick-darkjak-bomb1 #x1331) + (trick-darkjak-giant #x1332) + (progress-graphics-ps2 #x1333) + (progress-graphics-actor-culling #x1334) + (progress-graphics-force-envmap #x1335) + (progress-fast-progress #x1336) + (progress-graphics-ps2-lod-dist #x1337) + (progress-graphics-msaa-off #x1338) + (progress-graphics-display #x1339) + (language-name-finnish #x133a) + (progress-hint-subtitles #x133b) + (language-name-portuguese #x133c) + (language-name-swedish #x133d) + (language-name-danish #x133e) + (language-name-norwegian #x133f) + (language-name-dutch #x1340) + (language-name-br-portuguese #x1341) + (language-name-hungarian #x1342) + (language-name-catalan #x1343) + (language-name-icelandic #x1344) + (language-name-polish #x1345) + (language-name-lithuanian #x1346) + (language-name-czech #x1347) + (language-name-croatian #x1348) + (language-name-galician #x1349) + (progress-controller-options-enable-pressure-sensitivity #x134a) + (progress-controller-options-swap-r1-r2 #x134b) + (progress-controller-options-enable-trigger-effects #x134c) + (progress-misc-fix-projectile-focus #x134d) ) ;; ---text-id diff --git a/goal_src/jak3/engine/ui/text.gc b/goal_src/jak3/engine/ui/text.gc index fc636ce8d0..b711477fec 100644 --- a/goal_src/jak3/engine/ui/text.gc +++ b/goal_src/jak3/engine/ui/text.gc @@ -219,7 +219,9 @@ (defmethod lookup-text ((this level) (arg0 text-id) (arg1 symbol)) (let ((v1-0 *common-text*)) (dotimes (a3-0 (-> this loaded-text-info-count)) - (if (= (-> this loaded-text-info a3-0 language-id) (-> *setting-control* user-current language)) + ;; og:preserve-this added + (if (= (-> this loaded-text-info a3-0 language-id) (#if PC_PORT (the language-enum (-> *pc-settings* text-language)) + (-> *setting-control* user-current language))) (set! v1-0 (-> this loaded-text-info a3-0)) ) ) @@ -233,12 +235,18 @@ (defun load-game-text-info ((arg0 string) (arg1 (pointer object)) (arg2 kheap)) (local-vars (v0-4 int) (sv-16 object) (sv-20 int) (sv-24 int) (sv-32 int)) (set! sv-16 (-> arg1 0)) - (set! sv-20 (the-as int (-> *setting-control* user-current language))) + ;; og:preserve-this added + (set! sv-20 (#if PC_PORT (the int (-> *pc-settings* text-language)) + (-> *setting-control* user-current language))) (set! sv-24 0) (set! sv-32 (&- (-> arg2 top) (the-as uint (-> arg2 base)))) - (if (and (= (scf-get-territory) 1) (= sv-20 (language-enum english)) (not (demo?))) - (set! sv-20 11) - ) + ;; english -> UK english in PAL + ;; og:preserve-this no longer necessary. + (#unless PC_PORT + (if (and (= (scf-get-territory) GAME_TERRITORY_SCEE) (= sv-24 (the int (language-enum english))) (not (demo?))) + (set! sv-24 (the int (language-enum uk-english))) + ) + ) (when (and (or (= sv-16 #f) (!= (-> (the-as game-text-info sv-16) language-id) sv-20) (not (string= (-> (the-as game-text-info sv-16) group-name) arg0)) @@ -310,8 +318,8 @@ (when (or *level-text-file-load-flag* (>= arg0 0)) (load-game-text-info "common" (&-> '*common-text* value) *common-text-heap*) (#when PC_PORT - (protect ((-> *setting-control* user-current language)) - (set! (-> *setting-control* user-current language) (language-enum english)) + (protect ((-> *pc-settings* text-language)) + (set! (-> *pc-settings* text-language) (pc-language english)) (load-game-text-info "common" (&-> '*fallback-text* value) *fallback-text-heap*)))) (none)) @@ -564,6 +572,10 @@ (set! (-> arg1 origin y) sv-20) (set! (-> arg1 flags) sv-24) (set! (-> arg1 color) sv-28) + ;; og:preserve-this + (#when PC_PORT + (if (and *debug-segment* *display-text-box*) + (draw-debug-text-box arg1))) (if (> sv-64 0) (* sv-56 (the float sv-64)) 0.0 diff --git a/goal_src/jak3/kernel-defs.gc b/goal_src/jak3/kernel-defs.gc index 72e81c460d..103c2391e6 100644 --- a/goal_src/jak3/kernel-defs.gc +++ b/goal_src/jak3/kernel-defs.gc @@ -42,6 +42,19 @@ (uk-english 11) ) +(defenum language-enum-s32 + :type int32 + :copy-entries language-enum + ) + +(defenum runtime-exit-status + :type uint32 + (running) + (restart-runtime) + (exit) + (restart-in-debug) + ) + ;; fixed symbols (define-extern #f symbol) (define-extern #t symbol) @@ -198,9 +211,19 @@ (define-extern pc-set-auto-hide-cursor! (function symbol none)) (define-extern pc-get-pressure-sensitivity-enabled? (function symbol)) (define-extern pc-set-pressure-sensitivity-enabled! (function symbol none)) +(define-extern pc-current-controller-has-pressure-sensitivity? (function symbol)) (define-extern pc-current-controller-has-trigger-effect-support? (function symbol)) (define-extern pc-get-trigger-effects-enabled? (function symbol)) (define-extern pc-set-trigger-effects-enabled! (function symbol none)) +(defenum pc-trigger-effect-option + (left 0) + (right 1) + (both 2)) +(define-extern pc-clear-trigger-effect! (function pc-trigger-effect-option none)) +(define-extern pc-send-trigger-effect-feedback! (function pc-trigger-effect-option int int none)) +(define-extern pc-send-trigger-effect-vibrate! (function pc-trigger-effect-option int int int none)) +(define-extern pc-send-trigger-effect-weapon! (function pc-trigger-effect-option int int int none)) +(define-extern pc-send-trigger-rumble! (function int int int none)) ;; Display Related Functions (define-extern pc-get-display-mode (function symbol)) diff --git a/goal_src/jak3/levels/common/enemy/prebot-eco-creature.gc b/goal_src/jak3/levels/common/enemy/prebot-eco-creature.gc index 9d0c9e3f16..127338b3d6 100644 --- a/goal_src/jak3/levels/common/enemy/prebot-eco-creature.gc +++ b/goal_src/jak3/levels/common/enemy/prebot-eco-creature.gc @@ -1684,8 +1684,8 @@ ) (deftype prebot-medium-eco-creature (prebot-large-eco-creature) - ((is-top basic) - (is-bottom basic) + ((is-top symbol) + (is-bottom symbol) (initial-scale float) (final-scale float) ) @@ -2327,7 +2327,7 @@ ) (defmethod prebot-medium-eco-creature-method-196 ((this prebot-medium-eco-creature)) - (set! (-> this is-top) (the-as basic #t)) + (set! (-> this is-top) #t) (let ((v1-2 (-> this node-list data 32))) (set! (-> v1-2 param0) prebot-eco-creature-joint-callback) (set! (-> v1-2 param1) (the-as basic #x3d23d70a)) @@ -2389,7 +2389,7 @@ ) (defmethod prebot-medium-eco-creature-method-197 ((this prebot-medium-eco-creature)) - (set! (-> this is-bottom) (the-as basic #t)) + (set! (-> this is-bottom) #t) (let ((v1-2 (-> this node-list data 4))) (set! (-> v1-2 param0) prebot-eco-creature-joint-callback) (set! (-> v1-2 param1) (the-as basic #x3d23d70a)) diff --git a/goal_src/jak3/levels/factory/factory-manager.gc b/goal_src/jak3/levels/factory/factory-manager.gc index 1de4e22547..45b9aac73c 100644 --- a/goal_src/jak3/levels/factory/factory-manager.gc +++ b/goal_src/jak3/levels/factory/factory-manager.gc @@ -966,6 +966,8 @@ ) (defbehavior factory-fighter-init-by-other factory-fighter () + ;; og:preserve-this added + (stack-size-set! (-> self main-thread) 512) (init-collision! self) (quaternion-identity! (-> self root quat)) (vector-identity! (-> self root scale)) diff --git a/goal_src/jak3/levels/wascity/wasall-obs.gc b/goal_src/jak3/levels/wascity/wasall-obs.gc index dfda0a60a0..b1fa708cd9 100644 --- a/goal_src/jak3/levels/wascity/wasall-obs.gc +++ b/goal_src/jak3/levels/wascity/wasall-obs.gc @@ -391,7 +391,9 @@ (sound-stop (-> self sound-id-loop)) ) :trans (behavior () - (while (and *target* (not (logtest? (-> *target* focus-status) (focus-status dead)))) + ;; og:preserve-this fix infinite loop when this state is entered while debug hovering + ; (while (and *target* (not (logtest? (-> *target* focus-status) (focus-status dead)))) + (when (and *target* (not (focus-test? *target* dead))) (send-event *target* 'attack-invinc diff --git a/goal_src/jak3/pc/pckernel-impl.gc b/goal_src/jak3/pc/pckernel-impl.gc index 74f835b68c..3fbc2085de 100644 --- a/goal_src/jak3/pc/pckernel-impl.gc +++ b/goal_src/jak3/pc/pckernel-impl.gc @@ -104,7 +104,13 @@ ;; other (controller-led-status? symbol) + (controller-swap-r1-r2? symbol) (speedrunner-mode-custom-bind uint32) + + (memcard-subtitles? symbol) + + (text-language pc-language) ;; language for game text + (subtitle-language pc-language) ) (:methods @@ -152,6 +158,13 @@ (false! (-> obj minimap-force-north)) (false! (-> obj hires-clouds?)) (set! (-> obj speedrunner-mode-custom-bind) 0) + + (set! (-> obj memcard-volume-sfx) 0.5) + (set! (-> obj memcard-volume-music) 0.4) + (set! (-> obj memcard-volume-dialog) 0.75) + (set! (-> obj memcard-vibration?) #t) + (set! (-> obj memcard-subtitles?) #f) + (set! (-> obj hinttitles?) #t) 0) (defmethod reset-extra ((obj pc-settings-jak3) (call-handlers symbol)) diff --git a/goal_src/jak3/pc/pckernel.gc b/goal_src/jak3/pc/pckernel.gc index fe25ecd6d1..9239b5546c 100644 --- a/goal_src/jak3/pc/pckernel.gc +++ b/goal_src/jak3/pc/pckernel.gc @@ -214,6 +214,11 @@ (set! (-> obj music-unlocked) (new 'global 'bit-array (-> *music-player-tracks* length))) ((method-of-type pc-settings initialize) obj) + (set! (-> *setting-control* user-default sfx-volume) (-> obj memcard-volume-sfx)) + (set! (-> *setting-control* user-default music-volume) (-> obj memcard-volume-music)) + (set! (-> *setting-control* user-default dialog-volume) (-> obj memcard-volume-dialog)) + (set! (-> *setting-control* user-default vibration) (-> obj memcard-vibration?)) + (set! (-> *setting-control* user-default subtitle) (-> obj memcard-subtitles?)) obj) (defmethod set-game-setting! ((obj pc-settings-jak3) (setting symbol) (value symbol)) @@ -612,6 +617,7 @@ (("cheats-purchased") (set! (-> obj cheats-purchased) (the-as pc-cheats (file-stream-read-int file)))) (("cheats-unlocked") (set! (-> obj cheats-unlocked) (the-as pc-cheats (file-stream-read-int file)))) (("cheats-backup") (file-stream-read-int file)) ;; TODO - Don't remove this, parsing code can't handle unexpected keys + (("memcard-subtitles?") (set! (-> obj memcard-subtitles?) (file-stream-read-symbol file))) (("music-unlocked") (dotimes (i (/ (align64 (-> obj music-unlocked length)) 64)) (bit-array<-int64 (-> obj music-unlocked) (* i 64) (file-stream-read-int file)) @@ -663,6 +669,7 @@ (format file " (cheats-revealed #x~x)~%" (-> obj cheats-revealed)) (format file " (cheats-purchased #x~x)~%" (-> obj cheats-purchased)) (format file " (cheats-unlocked #x~x)~%" (-> obj cheats-unlocked)) + (format file " (memcard-subtitles? ~A)~%" (-> obj memcard-subtitles?)) (format file " (music-unlocked") (dotimes (i (/ (align64 (-> obj music-unlocked length)) 64)) diff --git a/goal_src/jak3/pc/progress/progress-draw-pc.gc b/goal_src/jak3/pc/progress/progress-draw-pc.gc new file mode 100644 index 0000000000..d68e129c2d --- /dev/null +++ b/goal_src/jak3/pc/progress/progress-draw-pc.gc @@ -0,0 +1,2090 @@ +;;-*-Lisp-*- +(in-package goal) + +#| + + Additional PC port specific file for overriding/expanding the progress menu + This gives us more freedom to write code how we want. + +|# + +(defun setup-scissor ((this hud-box) (buf dma-buffer)) + (dma-buffer-add-gs-set buf (scissor-1 (new 'static 'gs-scissor + :scax0 (the int (-> this min x)) + :scay0 (the int (-> this min y)) + :scax1 (the int (-> this max x)) + :scay1 (the int (-> this max y)) + ) + ) + ) + ) + +(defun restore-scissor ((this hud-box) (buf dma-buffer)) + (dma-buffer-add-gs-set buf (scissor-1 (new 'static 'gs-scissor :scax1 #x1ff :scay1 #x19f))) + ) + +(defmacro adjust-x-if-needed (x) + "adjust an x screen coord if ps2 vis is disabled" + `(if (not (-> *pc-settings* use-vis?)) (the float (adjust-game-x (the float ,x))) ,x)) + +(defmacro swap-confirm? () + "is the confirm button swapped from X?" + `(and (language? japanese korean) + (case (scf-get-territory) + ((GAME_TERRITORY_SCEI GAME_TERRITORY_SCEK) #t) + (else #f)))) + +(defmacro set-hud-sprite-attributes! (sprite &key (r 128) &key (g 128) &key (b 128) &key (a 1.0) &key x &key y &key (z #xffffff) &key (w 1) &key tex &key (scale-x 1.0) &key (scale-y 1.0)) + (with-gensyms (col) + `(begin + (let ((,col (-> ,sprite color2))) + (set! (-> ,col 0) ,r) + (set! (-> ,col 1) ,g) + (set! (-> ,col 2) ,b) + (set! (-> ,col 3) (the int (* 128.0 ,a)))) + (set! (-> ,sprite pos z) ,z) + (set! (-> ,sprite pos w) ,w) + (set! (-> ,sprite tex) ,tex) + (set! (-> ,sprite scale-x) ,scale-x) + (set! (-> ,sprite scale-y) ,scale-y) + (set-hud-piece-position! ,sprite ,x ,y)))) + +(defun draw-savegame-box ((arg0 menu-option) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) + (set! (-> arg0 box 0 min x) arg1) + (set! (-> arg0 box 0 max x) arg2) + (set! (-> arg0 box 0 min y) arg3) + (set! (-> arg0 box 0 max y) arg4) + (with-dma-buffer-add-bucket ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id hud-draw-hud-alpha)) + (draw-box-prim-only (the-as hud-box (-> arg0 box)) s5-0))) + +(defun draw-highlight ((y-pos int) (height int) (alpha float)) + (let ((x-pos (if (= (get-aspect-ratio) 'aspect4x3) 70 79)) + (width (if (= (get-aspect-ratio) 'aspect4x3) 374 355))) + ;; og:preserve-this + (#when PC_PORT + ;; added for better widescreen handling + (when (not (-> *pc-settings* use-vis?)) + (set! x-pos (the int (adjust-game-x (the float x-pos)))) + (set! width (the int (* (-> *pc-settings* aspect-ratio-reciprocal) width))))) + (with-dma-buffer-add-bucket ((buffer (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id hud-draw-hud-alpha)) + (draw-sprite2d-xy buffer + x-pos + y-pos + width + height + (new 'static 'rgba :r #x80 :g #x80 :b #x40 :a (the int (* 64.0 alpha))) + #x3fffff)))) + +(defmethod set-selected-color ((this progress)) + (with-pp + ;; og:preserve-this high fps fix + (if (< (seconds 0.027) (logand (the int (* DISPLAY_FPS_RATIO (-> pp clock integral-frame-counter))) 15)) + (set-font-color (font-color font-color-33) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) + (set-font-color (font-color font-color-33) + (new 'static 'rgba :r #x60 :g #x60 :b #x60 :a #x80) + (new 'static 'rgba :r #x60 :g #x60 :b #x60 :a #x80) + (new 'static 'rgba :r #x60 :g #x60 :b #x60 :a #x80) + (new 'static 'rgba :r #x60 :g #x60 :b #x60 :a #x80))) + (none))) + +(defmethod draw-highlight-bar ((this progress) (arg0 font-context) (arg1 int) (arg2 int) (arg3 float)) + (let* ((v1-1 (get-scissor-stack-top this)) + (a1-1 (the int (-> v1-1 x))) + (a3-1 (the int (- (-> v1-1 z) (-> v1-1 x)))) + (f0-6 (- 1.0 (-> this menu-transition)))) + (with-dma-buffer-add-bucket ((s3-0 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id hud-draw-hud-alpha)) + (when (not (-> *pc-settings* use-vis?)) + (set! a1-1 (the int (adjust-game-x (the float a1-1)))) + (set! a3-1 (the int (* (-> *pc-settings* aspect-ratio-reciprocal) a3-1)))) + (draw-sprite2d-xy s3-0 + a1-1 + arg1 + a3-1 + arg2 + (new 'static 'rgba :r #x80 :g #x80 :b #x40 :a (the int (* 64.0 f0-6))) + #x3fffff))) + 0) + +(defmethod draw-bg-box-outline ((this progress) (arg0 progress-box) (arg1 float)) + (with-dma-buffer-add-bucket ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) + ;; og:preserve-this changed from particles bucket + (bucket-id hud-draw-hud-alpha)) + (let* ((box (case (get-aspect-ratio) + (('aspect4x3) (-> arg0 aspect4x3)) + (('aspect16x9) (-> arg0 aspect16x9)))) + (box1 (new 'stack 'hud-box))) + (mem-copy! (the pointer box1) (the pointer box) (size-of hud-box)) + (set! (-> box1 color w) (the int arg1)) + (#when PC_PORT + (when (not (-> *pc-settings* use-vis?)) + (set! (-> box1 min x) (the float (the int (adjust-game-x (-> box min x))))) + (set! (-> box1 max x) (the float (the int (adjust-game-x (-> box max x))))))) + (draw-box-prim-only box1 s4-0))) + 0) + +(defmethod draw-bg-box-alpha-2 ((this progress) (arg0 progress-box) (arg1 float)) + (with-dma-buffer-add-bucket ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id particles)) + (let* ((box (case (get-aspect-ratio) + (('aspect4x3) (-> arg0 aspect4x3)) + (('aspect16x9) (-> arg0 aspect16x9)))) + (box1 (new 'stack 'hud-box))) + (mem-copy! (the pointer box1) (the pointer box) (size-of hud-box)) + (set! (-> box1 color w) (the int arg1)) + (#when PC_PORT + (when (not (-> *pc-settings* use-vis?)) + (set! (-> box1 min x) (the float (the int (adjust-game-x (-> box min x))))) + (set! (-> box1 max x) (the float (the int (adjust-game-x (-> box max x))))))) + (draw-box-alpha-2 box1 s4-0))) + 0) + +(defmethod draw-bg-box-alpha-1 ((this progress) (arg0 progress-box) (arg1 float)) + (with-dma-buffer-add-bucket ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) + ;; og:preserve-this changed from bucket6 + (bucket-id bucket7)) + (let* ((box (case (get-aspect-ratio) + (('aspect4x3) (-> arg0 aspect4x3)) + (('aspect16x9) (-> arg0 aspect16x9)))) + (box1 (new 'stack 'hud-box))) + (mem-copy! (the pointer box1) (the pointer box) (size-of hud-box)) + (set! (-> box1 color w) (the int arg1)) + (#when PC_PORT + (when (not (-> *pc-settings* use-vis?)) + (set! (-> box1 min x) (the float (the int (adjust-game-x (-> box min x))))) + (set! (-> box1 max x) (the float (the int (adjust-game-x (-> box max x))))))) + (draw-box-alpha-1 box1 s4-0))) + 0) + +(defmethod draw-slider-option ((this progress) (arg0 font-context) (arg1 string) (arg2 float) (arg3 float) (arg4 float) (arg5 float) (arg6 float)) + (local-vars (sv-80 float) (sv-96 float) (sv-112 vector) (sv-128 int) (sv-144 rgba)) + (set! sv-80 arg3) + (let ((s1-0 arg4) + (s5-0 arg5)) + (set! sv-96 arg6) + (set! sv-112 (get-scissor-stack-top this)) + (let ((slider (new 'stack 'hud-sprite)) + (f30-0 (* (- (-> sv-112 z) (-> sv-112 x)) s1-0))) + (let ((s1-1 (- (- 256 (if sv-96 10 0)) (the int (/ f30-0 2))))) + (#when PC_PORT + (when (not (-> *pc-settings* use-vis?)) + (set! s1-1 (the int (adjust-game-x (the float s1-1)))) + (set! f30-0 (* (-> *pc-settings* aspect-ratio-reciprocal) f30-0)))) + (set! sv-128 (the int (+ (-> sv-112 y) (* (- (-> sv-112 w) (-> sv-112 y)) sv-80)))) + (let ((f28-0 f30-0)) + (let ((f24-0 (-> *video-params* relative-x-scale-reciprical)) + (f26-0 (-> *video-params* relative-x-scale))) + (with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id hud-draw-hud-alpha)) + (set! (-> slider tid) (the-as texture-id (get-texture hud-sliderbackground progress-minimap))) + (if (-> slider tid) (set! (-> slider scale-x) (/ (* f30-0 f24-0) (the float (-> (the-as texture (-> slider tid)) w))))) + (set! (-> slider scale-y) 0.7) + (let ((v1-28 (-> slider color-ptr))) + (set! (-> v1-28 0) 128) + (set! (-> v1-28 1) 128) + (set! (-> v1-28 2) 128) + (set! (-> v1-28 3) (the int (* 128.0 arg2)))) + (set-vector! (-> slider pos) s1-1 sv-128 #x3fffff 0) + (draw slider buf (-> *level* level-default) #t) + (let ((f24-1 0.2)) + (set! (-> slider tid) (the-as texture-id (get-texture hud-sliderframe progress-minimap))) + (set! (-> slider scale-x) f24-1) + (set! (-> slider scale-y) 1.33) + (if (-> slider tid) (set! f28-0 (- f30-0 (* f24-1 f26-0 (the float (-> (the-as texture (-> slider tid)) w))))))) + (let* ((v1-39 (the int (* f28-0 s5-0))) + (a1-3 (+ s1-1 (the int (* 18.0 f26-0)) v1-39)) + (a3-2 (the int (- f28-0 (the float v1-39)))) + (t1-1 (shr (shl (the int (* 128.0 arg2)) 56) 32))) + (draw-sprite2d-xy buf a1-3 (+ sv-128 7) a3-2 9 (the-as rgba t1-1) #x3fffff)) + (set-vector! (-> slider pos) (+ s1-1 (the int (* f28-0 s5-0))) (+ sv-128 -4) #x3fffff 0) + (draw slider buf (-> *level* level-default) #t) + (when sv-96 + (set! sv-144 (-> *font-work* color-table 32 color 0)) + (set! (-> slider tid) (the-as texture-id (get-texture hud-speaker-empty progress-minimap))) + (set! (-> slider scale-x) 1.0) + (set! (-> slider scale-y) 1.0) + (let ((v1-55 (-> slider color-ptr))) + (set! (-> v1-55 0) (the-as int (-> sv-144 r))) + (set! (-> v1-55 1) (the-as int (-> sv-144 g))) + (set! (-> v1-55 2) (the-as int (-> sv-144 b))) + (set! (-> v1-55 3) (the int (* 128.0 arg2)))) + (set-vector! (-> slider pos) (+ s1-1 -20) (+ sv-128 -5) #x3fffff 0) + (draw slider buf (-> *level* level-default) #t) + (set! (-> slider tid) (the-as texture-id (get-texture hud-speaker-full progress-minimap))) + (set! (-> slider scale-x) 1.0) + (set! (-> slider scale-y) 1.0) + (set-vector! (-> slider pos) (+ (the int f30-0) 8 s1-1) (+ sv-128 -5) #x3fffff 0) + (draw slider buf (-> *level* level-default) #t))) + (set-scale! arg0 0.5) + (set-flags! arg0 (font-flags kerning large)) + (let ((f1-14 (the float s1-1)) + (f2-3 (+ -20.0 (the float sv-128)))) + (set! (-> arg0 origin x) f1-14) + (set! (-> arg0 origin y) f2-3)) + (let ((f0-44 (progress-method-45 this arg0 f30-0 (* 32.0 0.5) arg1 0.5 0.75 32))) + (if (= (-> this option-index) (-> this current-index)) + (draw-highlight-bar this arg0 (the int (+ -2.0 (-> arg0 origin y))) (the int (+ 4.0 f0-44)) arg2)))) + (+! (-> arg0 origin x) f30-0)) + (set-flags! arg0 (font-flags kerning right large)) + (string-format "~D%" (the int (* 100.0 s5-0))) + (print-game-text *temp-string* arg0 #f 44 (bucket-id hud-draw-hud-alpha))) + (set-flags! arg0 (font-flags kerning large)) + 0))) + +(defmethod draw-option ((this menu-unlocked-sub-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (let ((s2-0 (memcard-unlocked-secrets? arg0 #t)) + (f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))) + (adjust-font-origin-y arg0 arg1 (-> this offset-y)) + (set-scale! arg1 0.5) + (if (= arg2 (-> arg0 option-index)) 33 32) + (let ((f0-3 (if (logtest? s2-0 (-> this mask)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) + (print-game-text "?????????" arg1 #f 44 (bucket-id hud-draw-hud-alpha))))) + (if (= arg2 (-> arg0 option-index)) + (draw-highlight-bar arg0 arg1 (the int (+ 2.0 (-> arg1 origin y))) (the int (+ -1.0 f0-3)) f30-0)))) + (none)) + +(defmethod draw-option ((this menu-secret-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars + (sv-16 float) + (sv-24 int) + (sv-96 int) + (sv-112 int) + (sv-128 int) + (sv-192 string) + (sv-208 text-id) + (sv-240 string) + (sv-288 int) + (sv-352 string) + (sv-368 string) + ) + (set! sv-16 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (set! (-> arg1 alpha) sv-16) + (cond + ((not (loaded? *bigmap*)) + (progress-method-51 arg0 arg1) + ) + (else + (let ((s2-0 (get-texture hud-orb progress-minimap))) + (when (and s2-0 (not (-> this available-title))) + (progress-method-33 arg0 (-> *progress-work* sub-header)) + (let ((s3-0 (get-scissor-stack-top arg0))) + (let* ((f0-5 0.64) + (f30-0 (+ 10.0 (* (the float (-> s2-0 w)) f0-5 (-> *video-params* relative-x-scale)))) + ) + (let ((f1-5 (* (the float (-> s2-0 h)) f0-5))) + (draw-icon-array! + (-> *progress-icon-arrays* 68) + (the int (+ 10.0 (adjust-x-if-needed (-> s3-0 x)))) + (the int (+ (-> s3-0 y) (* 0.5 (- 28.0 f1-5)))) + f0-5 + f0-5 + (the rgba (logior #x808080 (shr (shl (the int (* 128.0 sv-16)) 56) 32))) + sv-16 + ) + ) + (set! (-> arg1 height) 28.0) + (set-flags! arg1 (font-flags kerning large)) + (let ((f28-0 0.45)) + (set-color! arg1 (font-color font-color-34)) + (cond + ((-> this buy-menu) + (string-format "x~D ~S" (-> *menu-secrets-array* (-> this selected-index) cost) (lookup-text! *common-text* (text-id progress-secrets-price) #f)) + ) + (else + (string-format "x~D ~S" (the int (-> *game-info* skill)) (lookup-text! *common-text* (text-id progress-secrets-orbs-available) #f)) + ) + ) + (set-scale! arg1 f28-0) + (set! (-> arg1 origin x) (+ (adjust-x-if-needed (-> s3-0 x)) f30-0)) + (set! (-> arg1 origin y) (+ (-> s3-0 y) (* 0.5 (- 28.0 (* 32.0 f28-0))))) + ) + ) + (print-game-text *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) + (set-flags! arg1 (font-flags kerning right large)) + (set! (-> arg1 origin x) (+ -10.0 (adjust-x-if-needed (-> s3-0 z)))) + ) + (string-format "~D/600 ~S" (the int (-> *game-info* skill-total)) (lookup-text! *common-text* (text-id progress-secrets-orbs-collected) #f)) + (print-game-text *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) + (progress-method-34 arg0) + ) + ) + (set-scale! arg1 0.42) + (cond + ((-> this available-title) + (progress-method-33 arg0 (-> *progress-work* body-footer)) + (progress-method-53 arg0 arg1) + (set-color! arg1 (font-color font-color-32)) + (set-flags! arg1 (font-flags kerning middle middle-vert large)) + (string-format (lookup-text! *common-text* (text-id text-0080) #f)) + (print-game-text *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) + (progress-method-34 arg0) + (progress-method-33 arg0 (-> *progress-work* footer)) + (set-flags! arg1 (font-flags kerning middle large)) + (adjust-font-origin-y arg0 arg1 0.1) + (set-color! arg1 (font-color font-color-33)) + (let ((f0-16 (print-game-text + (lookup-text! *common-text* (text-id progress-continue) #f) + arg1 + #f + 32 + (bucket-id hud-draw-hud-alpha) + ) + ) + ) + (draw-highlight-bar arg0 arg1 (the int (+ -2.0 (-> arg1 origin y))) (the int (+ 4.0 f0-16)) (-> arg1 alpha)) + ) + (progress-method-34 arg0) + ) + ((-> this buy-menu) + (progress-method-33 arg0 (-> *progress-work* body)) + (adjust-font-origin-y arg0 arg1 0.45) + (progress-method-50 + arg0 + arg1 + (-> *menu-secrets-array* (-> this selected-index) name) + (text-id progress-secrets-buy) + (text-id progress-secrets-cancel) + #t + #t + 0.65 + ) + (draw-header arg0 arg1 sv-16 (text-id progress-secrets)) + (draw-bg-box-outline arg0 (-> *progress-work* sub-header) (* 128.0 sv-16)) + (progress-method-34 arg0) + ) + (else + (progress-method-33 arg0 (-> *progress-work* sub-body-footer)) + (let* ((s3-3 (get-scissor-stack-top arg0)) + (f22-0 (- (-> s3-3 w) (-> s3-3 y))) + (f30-1 (+ 10.0 (* 24.0 (-> *video-params* relative-x-scale) (-> arg1 scale)))) + (f28-1 (+ (- -10.0 (-> s3-3 x)) (-> s3-3 z))) + ) + (string-format "~32L~S~44L ~S" (lookup-text! *common-text* (text-id progress-on) #f) (lookup-text! *common-text* (text-id progress-off) #f)) + (let* ((f0-27 (-> (get-string-length *temp-string* arg1) length)) + (f26-0 (- (- (- f28-1 f30-1) f0-27) f30-1)) + ) + (set-flags! arg1 (font-flags kerning large)) + (set! (-> arg1 width) f26-0) + (let ((s1-5 (max 0 (the int (-> this current-index))))) + (let* ((a0-61 (-> *menu-secrets-array* s1-5)) + (s0-4 (-> a0-61 name)) + ) + (case (secret-item-option-method-12 a0-61) + ((4) + (set! sv-192 "?????????") + ) + (else + (set! sv-192 (lookup-text! *common-text* s0-4 #f)) + ) + ) + ) + (string-format "~S" sv-192) + (let ((f24-0 (print-game-text *temp-string* arg1 #t 40 (bucket-id hud-draw-hud-alpha)))) + (let ((f0-33 4.0) + (f1-25 (-> this current-index)) + ) + (set! (-> arg1 origin y) + (+ (- f0-33 (* f24-0 (- f1-25 (* (the float (the int (/ f1-25 1.0))) 1.0)))) (-> s3-3 y)) + ) + ) + (set! (-> arg1 height) f22-0) + (while (and (< (-> arg1 origin y) (-> s3-3 w)) (< s1-5 (-> *menu-secrets-array* length))) + (let ((s0-6 (-> *menu-secrets-array* s1-5))) + (set! sv-208 (-> *menu-secrets-array* s1-5 name)) + (set! sv-288 (secret-item-option-method-12 s0-6)) + (case sv-288 + ((4) + (set! sv-240 "?????????") + ) + (else + (set! sv-240 (lookup-text! *common-text* sv-208 #f)) + ) + ) + (cond + ((logtest? (-> *menu-secrets-array* s1-5 flags) (secret-item-option-flags sf0)) + (set! (-> arg1 origin x) (+ 10.0 (adjust-x-if-needed (-> s3-3 x)))) + (set! (-> arg1 width) f28-1) + (set-color! arg1 (font-color font-color-34)) + (set-flags! arg1 (font-flags kerning large)) + (let ((f22-1 (-> arg1 origin y))) + (string-format "~S" sv-240) + (set! (-> arg1 origin y) (+ f22-1 (print-game-text *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)))) + ) + ) + ((not (and (logtest? (-> *menu-secrets-array* s1-5 flags) (secret-item-option-flags sf4)) + (or (nonzero? (-> *setting-control* user-current subtitle-language)) + (nonzero? (-> *setting-control* user-current language)) + (nonzero? (-> *setting-control* user-current audio-language)) + ) + ) + ) + (set! (-> arg1 origin x) (adjust-x-if-needed (+ (-> s3-3 x) f30-1))) + (set! (-> arg1 width) f26-0) + (let ((v1-148 sv-288)) + (cond + ((or (= v1-148 4) (= v1-148 3)) + (set-flags! arg1 (font-flags kerning large ff7)) + (set-color! arg1 (font-color font-color-44)) + ) + ((zero? v1-148) + (set-flags! arg1 (font-flags kerning large)) + (set-color! arg1 (font-color font-color-34)) + ) + (else + (set-flags! arg1 (font-flags kerning large)) + (set-color! arg1 (font-color font-color-32)) + ) + ) + ) + (let ((f22-2 (-> arg1 origin y))) + (string-format "~S" sv-240) + (let ((f20-0 (print-game-text *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)))) + (when (not (logtest? (-> *menu-secrets-array* s1-5 flags) (secret-item-option-flags sf0))) + (set! (-> arg1 origin x) (adjust-x-if-needed (+ (-> s3-3 x) f28-1))) + (set-flags! arg1 (font-flags kerning right large)) + (set! sv-352 (lookup-text! *common-text* (text-id progress-on) #f)) + (set! sv-368 (lookup-text! *common-text* (text-id progress-off) #f)) + (cond + ((or (zero? sv-288) (= sv-288 3)) + (string-format "~d" (-> s0-6 cost)) + (print-game-text *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)) + ) + ((= sv-288 1) + (cond + ((logtest? (-> *menu-secrets-array* s1-5 flags) (secret-item-option-flags sf1)) + (string-format "~32L~S~44L ~S" sv-352 sv-368) + (print-game-text *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)) + ) + (else + (string-format "~S" sv-352) + (print-game-text *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)) + ) + ) + ) + ((= sv-288 2) + (cond + ((logtest? (-> *menu-secrets-array* s1-5 flags) (secret-item-option-flags sf1)) + (string-format "~44L~S ~32L~S~1L" sv-352 sv-368) + (print-game-text *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)) + ) + (else + (string-format "~S" sv-368) + (print-game-text *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)) + ) + ) + ) + ) + ) + (+! (-> arg1 origin y) f20-0) + (if (= s1-5 (-> this selected-index)) + (draw-highlight-bar arg0 arg1 (the int (+ -2.0 f22-2)) (the int (+ 3.0 f20-0)) sv-16) + ) + ) + ) + ) + ) + ) + (+! s1-5 1) + ) + (seek! (-> this current-index) (-> this target-index) (* (/ 600.0 f24-0) (seconds-per-frame))) + ) + ) + ) + ) + (progress-method-34 arg0) + (draw-header arg0 arg1 sv-16 (text-id progress-secrets)) + (draw-bg-box-outline arg0 (-> *progress-work* sub-header) (* 128.0 sv-16)) + (draw-bg-box-alpha-2 arg0 (-> *progress-work* footer) (* 64.0 sv-16)) + (draw-bg-box-outline arg0 (-> *progress-work* footer) (* 128.0 sv-16)) + (progress-method-47 + arg0 + arg1 + (!= (-> this current-index) 0.0) + (!= (-> this current-index) (the float (+ (-> *menu-secrets-array* length) -1))) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod draw-option ((this menu-missions-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars + (sv-176 float) + (sv-180 game-task-node-info) + (sv-184 game-task-node-info) + (sv-188 float) + (sv-192 int) + (sv-200 symbol) + (sv-208 int) + (sv-216 (array game-task-node-info)) + (sv-256 string) + (sv-272 game-task-node-info) + (sv-288 text-id) + ) + (set! sv-176 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (set! sv-180 (new 'stack 'game-task-node-info)) + (set! sv-184 (new 'stack 'game-task-node-info)) + (set! (-> arg0 current-task-index) (length (-> *game-info* sub-task-list))) + (set! (-> arg0 current-line-index) -1) + (set! (-> arg0 current-task) (game-task unknown)) + (set! (-> arg0 first-closed-line-index) -1) + (set! (-> arg0 extra-text-state) -1) + (set! (-> arg0 num-open-tasks-found) 0) + (set! (-> arg0 num-closed-tasks-found) 0) + (set! (-> arg1 alpha) sv-176) + (set! (-> *game-info* mission-list 0) sv-180) + (set! (-> sv-180 description) (text-id progress-missions-todo)) + (set! (-> sv-184 description) (text-id progress-missions-completed)) + (progress-method-33 arg0 (-> *progress-work* body-footer)) + (let ((s3-0 (get-scissor-stack-top arg0))) + (set! sv-188 (- (-> s3-0 w) (-> s3-0 y))) + (set! sv-192 1) + (set! sv-200 #t) + (set! sv-216 (-> *game-info* mission-list)) + (dotimes (s2-0 (length (-> *game-info* sub-task-list))) + (let ((v0-6 (find-mission-text-at-index arg0 s2-0))) + (when v0-6 + (when (and (logtest? (-> v0-6 flags) (game-task-node-flag closed)) sv-200) + (set! sv-200 #f) + (set! (-> sv-216 sv-192) sv-184) + (1+! sv-192) + ) + (set! (-> sv-216 sv-192) v0-6) + (1+! sv-192) + ) + ) + ) + (set! (-> arg0 total-num-tasks) sv-192) + (sort-task-node-result (-> arg0 total-num-tasks)) + (set-flags! arg1 (font-flags kerning large)) + (set-scale! arg1 0.5) + (string-format "~S" (lookup-text! *common-text* (text-id progress-missions-complete-icon) #f)) + (let ((f30-1 (+ 14.0 (-> (get-string-length *temp-string* arg1) length)))) + (set! (-> arg1 width) (+ (- (- -10.0 f30-1) (-> s3-0 x)) (-> s3-0 z))) + (let ((s2-2 (-> *game-info* mission-list)) + (s1-2 (max 0 (the int (-> this current-index)))) + ) + (let* ((s0-1 (-> s2-2 s1-2)) + (a1-10 + (if (and (logtest? (-> s0-1 flags) (game-task-node-flag closed)) (task-complete? *game-info* (-> s0-1 task))) + (-> *game-info* play-list (-> s0-1 task) text-name) + (-> s0-1 description) + ) + ) + ) + (set! sv-256 (lookup-text! *common-text* a1-10 #f)) + ) + (string-format "~S" sv-256) + (let ((f28-0 (print-game-text *temp-string* arg1 #t 44 (bucket-id hud-draw-hud-alpha)))) + (let* ((v1-60 arg1) + (f0-14 (+ 10.0 (-> s3-0 x))) + (f1-6 4.0) + (f2-2 (-> this current-index)) + (f1-8 (+ (- f1-6 (* f28-0 (- f2-2 (* (the float (the int (/ f2-2 1.0))) 1.0)))) (-> s3-0 y))) + ) + (set! (-> v1-60 origin x) f0-14) + (set! (-> v1-60 origin y) f1-8) + ) + (set! (-> arg1 height) sv-188) + (while (and (< (-> arg1 origin y) (-> s3-0 w)) (< s1-2 (-> arg0 total-num-tasks))) + (set! sv-272 (-> s2-2 s1-2)) + (if (and (logtest? (-> sv-272 flags) (game-task-node-flag closed)) (task-complete? *game-info* (-> sv-272 task))) + (set! sv-288 (-> *game-info* play-list (-> sv-272 task) text-name)) + (set! sv-288 (-> sv-272 description)) + ) + (set! (-> arg1 origin x) (+ 10.0 (adjust-x-if-needed (-> s3-0 x)))) + (cond + ((or (= sv-288 (text-id progress-missions-todo)) (= sv-288 (text-id progress-missions-completed))) + (let ((a0-41 arg1)) + (set! (-> a0-41 color) (font-color font-color-34)) + ) + ) + (else + (string-format "~S" (lookup-text! *common-text* + (if (logtest? (-> sv-272 flags) (game-task-node-flag closed)) + (text-id progress-missions-complete-icon) + (text-id progress-missions-todo-icon) + ) + #f)) + (print-game-text *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) + (set-color! arg1 (font-color font-color-32)) + (set! (-> arg1 origin x) (+ (adjust-x-if-needed (-> s3-0 x)) f30-1)) + ) + ) + (let ((f26-0 (-> arg1 origin y))) + (string-format "~S" (lookup-text! *common-text* sv-288 #f)) + (set! (-> arg1 origin y) (+ f26-0 (print-game-text *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)))) + ) + (1+! s1-2) + ) + (set! (-> this on-screen) (< (-> arg1 origin y) (-> s3-0 w))) + (seek! + (-> this current-index) + (-> this target-index) + (* (/ (-> this scroll-speed) f28-0) (seconds-per-frame)) + ) + ) + ) + ) + ) + (progress-method-34 arg0) + (draw-header arg0 arg1 sv-176 (text-id progress-missions)) + (draw-bg-box-alpha-2 arg0 (-> *progress-work* footer) (* 64.0 sv-176)) + (draw-bg-box-outline arg0 (-> *progress-work* footer) (* 128.0 sv-176)) + (progress-method-47 arg0 arg1 + (!= (-> this current-index) 0.0) + (and (not (-> this on-screen)) (!= (-> this current-index) (the float (+ (-> arg0 total-num-tasks) -1))))) + (none) + ) + +(defmethod draw-option ((this menu-highscores-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (s4-0 *progress-work*) + ) + (set! (-> arg1 alpha) f30-0) + (set-flags! arg1 (font-flags kerning middle large)) + (progress-method-33 arg0 (-> s4-0 body-footer)) + (progress-method-53 arg0 arg1) + (let ((f28-0 (the float (menu-highscores-option-method-12 this)))) + (let* ((f0-2 (-> this current-index)) + (f26-0 (- f0-2 (* (the float (the int (/ f0-2 f28-0))) f28-0))) + (f0-4 (+ 1.0 f26-0)) + (f0-5 (- f0-4 (* (the float (the int (/ f0-4 f28-0))) f28-0))) + (s2-0 (-> this pages (the int f26-0))) + (s3-1 (-> this pages (the int f0-5))) + (s1-0 (get-scissor-stack-top arg0)) + (f0-8 (- (-> s1-0 z) (-> s1-0 x))) + ) + (when (!= f28-0 0.0) + (let ((f26-1 (* (- 1.0 (- f26-0 (* (the float (the int (/ f26-0 1.0))) 1.0))) f0-8))) + (set! (-> arg1 origin x) (+ (- f26-1 f0-8) (-> s1-0 x))) + (highscore-page-info-method-9 + (the highscore-page-info s2-0) + arg0 + arg1 + (- f26-1 f0-8) + f30-0 + ) + (when (< 1.0 f28-0) + (set! (-> arg1 origin x) (+ f26-1 (-> s1-0 x))) + (highscore-page-info-method-9 + (the highscore-page-info s3-1) + arg0 + arg1 + f26-1 + f30-0 + ) + ) + ) + ) + ) + (progress-method-34 arg0) + (draw-header arg0 arg1 f30-0 (text-id progress-highscores)) + (cond + ((< 1.0 f28-0) + (draw-prev-next-footer arg0 arg1 f30-0) + ) + (else + (draw-bg-box-alpha-2 arg0 (-> s4-0 footer) (* 64.0 f30-0)) + (draw-bg-box-outline arg0 (-> s4-0 footer) (* 128.0 f30-0)) + ) + ) + ) + ) + (none) + ) + +(defmethod highscore-page-info-method-9 ((this highscore-page-info) (arg0 progress) (arg1 font-context) (arg2 float) (arg3 float)) + (local-vars + (sv-16 highscore-info) + (sv-96 int) + (sv-112 int) + ) + (let ((s3-0 (get-scissor-stack-top arg0))) + (let ((f28-0 (-> *video-params* relative-x-scale))) + (set! sv-16 (-> *highscore-info-array* (-> this game-score))) + (let ((f30-0 (- (-> s3-0 z) (-> s3-0 x))) + (s0-0 *progress-work*) + ) + (set-flags! arg1 (font-flags kerning large)) + (set-scale! arg1 0.675) + (set-color! arg1 (font-color font-color-32)) + (set! (-> arg1 origin x) (+ 10.0 arg2 (adjust-x-if-needed (-> s3-0 x)))) + (adjust-font-origin-y arg0 arg1 0.01) + (if (not (-> *pc-settings* use-vis?)) + (set! (-> arg1 width) (* 0.75 (-> *pc-settings* aspect-ratio-reciprocal) f30-0)) + (set! (-> arg1 width) (* 0.75 f30-0)) + ) + ;; hack to scissor top part of highscore display + ;; top right icon + (with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id hud-draw-pris2)) + (let ((hiscore0-box (case (get-aspect-ratio) + (('aspect4x3) (-> s0-0 highscore-0 aspect4x3 box)) + (('aspect16x9) (-> s0-0 highscore-0 aspect16x9 box))))) + (dma-buffer-add-gs-set buf + (scissor-1 + (new 'static 'gs-scissor + :scax0 (the int (adjust-x-if-needed (-> hiscore0-box min x))) + :scay0 (the int (-> hiscore0-box min y)) + :scax1 (the int (adjust-x-if-needed (-> hiscore0-box max x))) + :scay1 (the int (-> hiscore0-box max y))))))) + ;; text + (with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id hud-draw-hud-alpha)) + (let ((hiscore0-box (case (get-aspect-ratio) + (('aspect4x3) (-> s0-0 highscore-0 aspect4x3 box)) + (('aspect16x9) (-> s0-0 highscore-0 aspect16x9 box)))) + (hiscore1-box (case (get-aspect-ratio) + (('aspect4x3) (-> s0-0 highscore-1 aspect4x3 box)) + (('aspect16x9) (-> s0-0 highscore-1 aspect16x9 box))))) + (dma-buffer-add-gs-set buf + (scissor-1 + (new 'static 'gs-scissor + :scax0 (the int (adjust-x-if-needed (-> hiscore0-box min x))) + :scay0 (the int (-> hiscore0-box min y)) + :scax1 (the int (adjust-x-if-needed (-> hiscore0-box max x))) + :scay1 (the int (-> hiscore1-box max y))))))) + (string-format "~S" (lookup-text! *common-text* (-> this text) #f)) + (print-game-text *temp-string* arg1 #f 32 (bucket-id hud-draw-hud-alpha)) + (draw-icon-array! + (-> *progress-icon-arrays* (-> this icon)) + (the int (+ (- (adjust-x-if-needed (-> s3-0 z)) (* (-> this icon-offsetx) f28-0)) arg2)) + (the int (+ (-> s3-0 y) (-> this icon-offsety))) + (-> this icon-scalex) + (-> this icon-scaley) + (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a (the int (* 128.0 arg3))) + arg3 + ) + (when (not (logtest? (-> sv-16 flags) (highscore-flags hf1))) + (let ((f28-1 (* 20.0 f28-0)) + (f26-0 (+ 50.0 (-> s3-0 y))) + ) + (set! sv-96 (the int (+ 48.0 (-> s3-0 y)))) + (set! sv-112 (logior #x808080 (shr (shl (the int (* 128.0 arg3)) 56) 32))) + (let ((f24-0 0.25) + (f22-0 (+ 10.0 arg2 (-> s3-0 x))) + ) + (set-scale! arg1 0.45) + (let ((f20-0 f22-0)) + (draw-icon-array! (-> *progress-icon-arrays* 63) (the int (adjust-x-if-needed f20-0)) sv-96 0.25 0.25 (the-as rgba sv-112) arg3) + (highscore-page-info-method-10 this arg1 (-> sv-16 gold-score) (+ (adjust-x-if-needed f20-0) f28-1) f26-0) + ) + (let ((f20-1 (+ f22-0 (* 0.333 f30-0)))) + (draw-icon-array! (-> *progress-icon-arrays* 64) (the int (adjust-x-if-needed f20-1)) sv-96 0.25 0.25 (the-as rgba sv-112) arg3) + (highscore-page-info-method-10 this arg1 (-> sv-16 silver-score) (+ (adjust-x-if-needed f20-1) f28-1) f26-0) + ) + (let ((f30-1 (+ f22-0 (* 0.667 f30-0)))) + (draw-icon-array! (-> *progress-icon-arrays* 65) (the int (adjust-x-if-needed f30-1)) sv-96 f24-0 f24-0 (the-as rgba sv-112) arg3) + (highscore-page-info-method-10 this arg1 (-> sv-16 bronze-score) (+ (adjust-x-if-needed f30-1) f28-1) f26-0) + ) + ) + ) + ) + (draw-bg-box-alpha-2 arg0 (-> s0-0 highscore-1) (* 16.0 arg3)) + (draw-bg-box-outline arg0 (-> s0-0 highscore-1) (* 128.0 arg3)) + (draw-bg-box-outline arg0 (-> s0-0 highscore-0) (* 128.0 arg3)) + (progress-method-33 arg0 (-> s0-0 highscore-body)) + ) + ) + (let ((f30-2 (+ 10.0 arg2 (adjust-x-if-needed (-> s3-0 x)))) + (f28-2 (+ -10.0 arg2 (adjust-x-if-needed (-> s3-0 z)))) + (s3-1 (get-game-score-ref *game-info* (the-as int (-> this game-score)))) + ) + (set-scale! arg1 0.6) + (adjust-font-origin-y arg0 arg1 0.03) + (highscore-page-info-method-11 this arg1 56 (-> s3-1 0) f30-2 f28-2) + (set-scale! arg1 0.5) + (adjust-font-origin-y arg0 arg1 0.18) + (highscore-page-info-method-11 this arg1 57 (-> s3-1 1) f30-2 f28-2) + (set-scale! arg1 0.45) + (adjust-font-origin-y arg0 arg1 0.31) + (highscore-page-info-method-11 this arg1 58 (-> s3-1 2) f30-2 f28-2) + (set-scale! arg1 0.425) + (adjust-font-origin-y arg0 arg1 0.43) + (highscore-page-info-method-11 this arg1 59 (-> s3-1 3) f30-2 f28-2) + (adjust-font-origin-y arg0 arg1 0.545) + (highscore-page-info-method-11 this arg1 60 (-> s3-1 4) f30-2 f28-2) + (adjust-font-origin-y arg0 arg1 0.66) + (highscore-page-info-method-11 this arg1 61 (-> s3-1 5) f30-2 f28-2) + (adjust-font-origin-y arg0 arg1 0.775) + (highscore-page-info-method-11 this arg1 62 (-> s3-1 6) f30-2 f28-2) + (adjust-font-origin-y arg0 arg1 0.89) + (highscore-page-info-method-11 this arg1 63 (-> s3-1 7) f30-2 f28-2) + ) + ) + (progress-method-34 arg0) + 0 + (none) + ) + +(defmethod draw-option ((this menu-inventory) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))) + (set! (-> arg1 alpha) f30-0) + (set-flags! arg1 (font-flags kerning middle large)) + (progress-method-33 arg0 (-> *progress-work* body-footer)) + (progress-method-53 arg0 arg1) + (let* ((f0-2 (the float (-> this screens length))) + (f28-0 (-> this current-index)) + (f1-3 (+ 1.0 f28-0)) + (f0-4 (- f1-3 (* (the float (the int (/ f1-3 f0-2))) f0-2))) + (s3-0 (-> this screens (the int f28-0))) + (s4-1 (-> this screens (the int f0-4))) + (s2-0 (get-scissor-stack-top arg0)) + (f0-7 (- (-> s2-0 z) (-> s2-0 x))) + (f28-1 (* (- 1.0 (- f28-0 (* (the float (the int (/ f28-0 1.0))) 1.0))) f0-7)) + ) + (set! (-> arg1 origin x) (+ (- f28-1 f0-7) (-> s2-0 x))) + (inventory-screen-method-9 s3-0 arg0 arg1 (- f28-1 f0-7) f30-0) + (set! (-> arg1 origin x) (+ f28-1 (-> s2-0 x))) + (inventory-screen-method-9 s4-1 arg0 arg1 f28-1 f30-0) + ) + (progress-method-34 arg0) + (draw-header arg0 arg1 f30-0 (text-id progress-inventory)) + (draw-prev-next-footer arg0 arg1 f30-0) + ) + (none) + ) + +(defmethod inventory-screen-method-9 ((this inventory-screen) (arg0 progress) (arg1 font-context) (arg2 float) (arg3 float)) + (set-scale! arg1 0.45) + (set-color! arg1 (font-color font-color-32)) + (adjust-font-origin-y arg0 arg1 0.01) + (string-format "~S" (lookup-text! *common-text* (-> this name) #f)) + (print-game-text *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) + (dotimes (s1-1 (-> this groups length)) + (inventory-item-group-method-10 + (-> this groups s1-1) + arg0 + arg1 + arg2 + arg3 + (the-as int (= s1-1 (-> this current-index))) + ) + ) + (none) + ) + +(defmethod inventory-item-group-method-10 ((this inventory-item-group) (arg0 progress) (arg1 font-context) (arg2 float) (arg3 float) (arg4 int)) + (dotimes (i (-> this items length)) + (when (and arg4 (have-items? this)) + (set-scale! arg1 0.45) + (adjust-font-origin-y arg0 arg1 0.9) + (string-format "~S" (lookup-text! *common-text* (-> this name) #f)) + (print-game-text *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + (inventory-item-method-10 (-> this items i) arg0 arg1 arg2 arg3 (the symbol arg4)) + ) + (none) + ) + +(defmethod inventory-item-method-10 ((this inventory-item) (arg0 progress) (arg1 font-context) (arg2 float) (arg3 float) (arg4 symbol)) + (let ((clr #x20000000)) + (when (item-obtained? this) + (if arg4 + (set! clr #x80ffffff) + (set! clr #x80808080) + ) + ) + (let ((s3-1 (new 'stack 'vector2)) + (v1-9 (get-scissor-stack-top arg0)) + (f0-0 (-> this icon-scale)) + ) + (set! (-> s3-1 x) (+ (-> v1-9 x) (* (- (-> v1-9 z) (-> v1-9 x)) (-> this offset x)) arg2)) + (set! (-> s3-1 y) (+ (-> v1-9 y) (* (- (-> v1-9 w) (-> v1-9 y)) (-> this offset y)))) + (draw-icon-array! + (-> *progress-icon-arrays* (-> this icon)) + (the int (adjust-x-if-needed (-> s3-1 x))) + (the int (-> s3-1 y)) + f0-0 + f0-0 + (the rgba clr) + arg3 + ) + ) + ) + (none) + ) + +(defmethod draw-icon-array! ((this progress-icon-array) (arg0 int) (arg1 int) (arg2 float) (arg3 float) (arg4 rgba) (arg5 float)) + (let ((sprite (new 'stack 'hud-sprite)) + (s2-0 (new 'stack 'vector4w)) + ) + (set-vector! s2-0 arg0 arg1 0 1) + (let ((v1-3 (-> sprite color-ptr))) + (set! (-> v1-3 0) (the int (-> arg4 r))) + (set! (-> v1-3 1) (the int (-> arg4 g))) + (set! (-> v1-3 2) (the int (-> arg4 b))) + (set! (-> v1-3 3) (the int (* arg5 (the float (-> arg4 a))))) + ) + (set! (-> sprite pos z) #xffffff) + (set! (-> sprite pos w) 1) + (set! (-> sprite scale-x) arg2) + (set! (-> sprite scale-y) arg3) + (dotimes (i (-> this length)) + (let ((icon (-> this icons i))) + (set! (-> sprite tid) (the-as texture-id (lookup-texture-by-id (-> icon tex-id)))) + (set! (-> sprite flags) (the hud-sprite-flags (-> icon flags))) + (set-as-offset-from! + (the hud-sprite (-> sprite pos)) + s2-0 + (the int (* (the float (-> icon offset x)) arg2)) + (the int (* (the float (-> icon offset y)) arg3)) + ) + (with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf)) (-> icon bucket)) + (draw sprite buf (-> *level* level-default) #t)) + ) + ) + ) + (none) + ) + +(defmethod draw-prev-next-footer ((this progress) (arg0 font-context) (arg1 float)) + (progress-method-33 this (-> *progress-work* footer)) + (draw-bg-box-alpha-2 this (-> *progress-work* footer) (* 64.0 arg1)) + (draw-bg-box-outline this (-> *progress-work* footer) (* 128.0 arg1)) + (set-color! arg0 (font-color font-color-33)) + (set-scale! arg0 0.6) + (let ((s4-1 (get-scissor-stack-top this))) + (set! (-> arg0 origin x) (adjust-x-if-needed (+ 10.0 (-> s4-1 x)))) + (set! (-> arg0 origin y) (+ (-> s4-1 y) (* 0.5 (- (- (-> s4-1 w) (-> s4-1 y)) (* 32.0 (-> arg0 scale)))))) + (set-width! arg0 (the int (+ (- -20.0 (-> s4-1 x)) (-> s4-1 z)))) + (set-flags! arg0 (font-flags kerning large)) + (string-format "~S~S" (lookup-text! *common-text* (text-id progress-footer-prev-l1) #f) (lookup-text! *common-text* (text-id progress-prev) #f)) + (print-game-text *temp-string* arg0 #f 44 (bucket-id hud-draw-hud-alpha)) + (set! (-> arg0 origin x) (the float (adjust-x-if-needed (+ -10.0 (-> s4-1 z))))) + ) + (set-flags! arg0 (font-flags kerning right large)) + (string-format "~S~S" + (lookup-text! *common-text* (text-id progress-next) #f) + (lookup-text! *common-text* (text-id progress-footer-next-r1) #f) + ) + (print-game-text *temp-string* arg0 #f 44 (bucket-id hud-draw-hud-alpha)) + (progress-method-34 this) + 0 + ) + +(defmethod controls-page-info-method-11 ((this controls-page-info) (arg0 progress) (arg1 font-context) (arg2 float) (arg3 float)) + (local-vars (v1-28 int) (v1-29 int) (sv-80 int)) + (let ((s2-0 arg3)) + (let ((s1-0 (get-scissor-stack-top arg0))) + (progress-method-33 arg0 (-> *progress-work* sub-header)) + (draw-bg-box-outline arg0 (-> *progress-work* sub-header) (* 128.0 arg3)) + (set-flags! arg1 (font-flags kerning middle large)) + (set! (-> arg1 origin x) (+ 10.0 arg2 (-> s1-0 x))) + (set! (-> arg1 origin y) (-> s1-0 y)) + (set-color! arg1 (font-color font-color-34)) + (progress-method-45 arg0 arg1 (+ (- -20.0 (-> s1-0 x)) (-> s1-0 z)) 28.0 (lookup-text! *common-text* (-> this title) #f) 0.7 0.5 32) + ) + (progress-method-34 arg0) + (progress-method-33 arg0 (-> *progress-work* sub-body-footer)) + (progress-method-53 arg0 arg1) + (set-flags! arg1 (font-flags kerning large)) + (set-scale! arg1 0.425) + (set-color! arg1 (font-color font-color-32)) + (let* ((s0-1 (get-scissor-stack-top arg0)) + (f28-0 (- (-> s0-1 z) (-> s0-1 x))) + (s1-2 (init-text! this)) + ) + (let* ((f30-0 (/ f28-0 2)) + (f28-1 (/ f28-0 2)) + (f26-0 (+ arg2 (-> s0-1 x))) + (f24-0 (+ arg2 (-> s0-1 x) f30-0)) + ) + (set-width! arg1 (if (not (-> *pc-settings* use-vis?)) + (the int (* (-> *pc-settings* aspect-ratio-reciprocal) (+ -20.0 f30-0))) + (the int (+ -20.0 f30-0)))) + (set! sv-80 0) + (let ((v1-27 sv-80) + (a0-20 (min (the int (-> this current-index)) s1-2)) + ) + (set-on-less-than v1-28 v1-27 a0-20) + (move-if-not-zero v1-29 a0-20 v1-28 v1-28) + ) + (set! sv-80 v1-29) + (string-format "~S" (lookup-text! *common-text* (the-as text-id (-> this text sv-80 text)) #f)) + (let ((f22-0 (print-game-text *temp-string* arg1 #t 40 (bucket-id hud-draw-hud-alpha)))) + (string-format "~S" (lookup-text! *common-text* (-> this text sv-80 id) #f)) + (let* ((f0-23 (print-game-text *temp-string* arg1 #t 40 (bucket-id hud-draw-hud-alpha))) + (f22-1 (+ 8.0 (fmax f22-0 f0-23))) + ) + (let ((f2-0 (-> this current-index))) + (set! (-> arg1 origin x) (+ 10.0 (-> s0-1 x))) + (set! (-> arg1 origin y) (+ (- 4.0 (* f22-1 (- f2-0 (* (the float (the int (/ f2-0 1.0))) 1.0)))) (-> s0-1 y))) + ) + (while (and (< (-> arg1 origin y) (-> s0-1 w)) (< sv-80 s1-2)) + (controls-string-info-method-9 + (the-as controls-string-info (-> this text sv-80)) + arg0 + arg1 + f26-0 + f24-0 + f30-0 + f28-1 + arg3 + ) + (1+! sv-80) + ) + (set! (-> this on-screen) (< (-> arg1 origin y) (-> s0-1 w))) + (seek! (-> this current-index) (-> this target-index) (* (/ 300.0 f22-1) (seconds-per-frame))) + ) + ) + ) + (progress-method-34 arg0) + (progress-method-33 arg0 (-> *progress-work* small-screen)) + (progress-method-47 + arg0 + arg1 + (!= (-> this current-index) 0.0) + (and (not (-> this on-screen)) (!= (-> this current-index) (the float s1-2))) + ) + ) + ) + (progress-method-34 arg0) + (none) + ) + +(defmethod controls-string-info-method-9 ((this controls-string-info) + (arg0 progress) + (arg1 font-context) + (arg2 float) + (arg3 float) + (arg4 float) + (arg5 float) + (arg6 float) + ) + (let ((s2-0 (get-scissor-stack-top arg0))) + (set! (-> arg1 origin x) (adjust-x-if-needed (+ 10.0 arg2))) + (set-width! arg1 (if (not (-> *pc-settings* use-vis?)) + (the int (* (-> *pc-settings* aspect-ratio-reciprocal) (+ -20.0 arg4))) + (the int (+ -20.0 arg4)))) + (string-format "~S" (lookup-text! *common-text* (-> this action) #f)) + (let ((f30-0 (print-game-text *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)))) + (set! (-> arg1 origin x) (+ 10.0 arg3)) + (set-width! arg1 (if (not (-> *pc-settings* use-vis?)) + (the int (* (-> *pc-settings* aspect-ratio-reciprocal) (+ -20.0 arg5))) + (the int (+ -20.0 arg5)))) + (string-format "~S" (lookup-text! *common-text* (-> this button) #f)) + (let* ((f0-11 (print-game-text *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha))) + (f30-1 (+ 8.0 (fmax f30-0 f0-11))) + ) + (let ((s1-1 (new 'stack 'hud-box)) + (f28-0 (+ arg3 (* 0.5 (- (-> s2-0 z) (-> s2-0 x))))) + ) + (set! (-> s1-1 box min y) (+ -6.0 (-> arg1 origin y))) + (set! (-> s1-1 box max y) (+ (-> s1-1 box min y) f30-1)) + (set-vector! (-> s1-1 color) 192 192 96 (the int (* 128.0 arg6))) + (with-dma-buffer-add-bucket ((s2-1 (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id hud-draw-hud-alpha) + ) + (set! (-> s1-1 box min x) (adjust-x-if-needed arg2)) + (set! (-> s1-1 box max x) arg3) + (draw-box-prim-only s1-1 s2-1) + (set! (-> s1-1 box min x) arg3) + (set! (-> s1-1 box max x) (adjust-x-if-needed f28-0)) + (draw-box-prim-only s1-1 s2-1) + ) + ) + (+! (-> arg1 origin y) f30-1) + ) + ) + ) + (none) + ) + +(defmethod draw-header ((this progress) (arg0 font-context) (arg1 float) (arg2 text-id)) + (progress-method-33 this (-> *progress-work* header)) + (let ((s3-0 (get-scissor-stack-top this))) + (draw-bg-box-alpha-2 this (-> *progress-work* header) (* 64.0 arg1)) + (draw-bg-box-outline this (-> *progress-work* header) (* 128.0 arg1)) + (set-flags! arg0 (font-flags kerning middle large)) + (set-color! arg0 (font-color font-color-32)) + (set! (-> arg0 origin x) (+ 10.0 (-> s3-0 x))) + (set! (-> arg0 origin y) (-> s3-0 y)) + (progress-method-45 + this + arg0 + (+ (- -20.0 (-> s3-0 x)) (-> s3-0 z)) + 45.0 + (lookup-text! *common-text* arg2 #f) + (if (not (-> *pc-settings* use-vis?)) 0.75 0.95) + 0.1 + 32 + ) + ) + (progress-method-34 this) + 0 + ) + +(defmethod draw-option ((this menu-memcard-slot-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (f28-0 (if (= (-> arg0 current) 'select-save-title) + 0.2 + 0.25 + ) + ) + (s3-0 *progress-work*) + (f24-0 (-> *video-params* relative-x-scale)) + ) + (cond + ((not (loaded? *bigmap*)) + (progress-method-51 arg0 arg1) + ) + (else + (set! (-> arg1 alpha) f30-0) + (set-scale! arg1 0.6) + (progress-method-33 arg0 (-> s3-0 body)) + (let* ((s3-1 (get-scissor-stack-top arg0)) + (s0-0 (new 'stack 'hud-box)) + (f0-4 (* (- (-> s3-1 w) (-> s3-1 y)) f28-0)) + (f26-0 (+ (-> s3-1 y) (* f0-4 (the float arg2)))) + (f28-1 (+ f26-0 f0-4)) + ) + (let ((s2-0 *progress-save-info*)) + (set! (-> arg1 origin x) (adjust-x-if-needed (+ 10.0 (-> s3-1 x)))) + (set! (-> arg1 origin y) (+ f26-0 (* 0.5 (- f0-4 (* 32.0 (-> arg1 scale)))))) + (set! (-> arg1 height) f0-4) + (set-flags! arg1 (font-flags kerning large)) + (when (and s2-0 (= (-> s2-0 formatted) 1) (= (-> s2-0 inited) 1)) + (cond + ((= (-> s2-0 file arg2 present) 1) + (string-format "~S ~D" (lookup-text! *common-text* (text-id text-0073) #f) (1+ arg2)) + (print-game-text *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + ((zero? (-> s2-0 file arg2 present)) + (print-game-text (lookup-text! *common-text* (text-id progress-empty) #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + ) + (when (= arg2 (-> arg0 option-index)) + (set-scale! arg1 0.8) + (with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id tex-hud-hud-alpha)) + (let ((f24-1 (+ (-> s3-1 x) (* 0.4 (- (-> s3-1 z) (-> s3-1 x)))))) + (set-vector! (-> s0-0 color) 128 128 128 (the int (* 16.0 f30-0))) + (vector-copy! (the vector (-> s0-0 box)) s3-1) + (set! (-> s0-0 box min x) f24-1) + (draw-box-alpha-1 s0-0 buf) + (set! (-> s0-0 box min x) (adjust-x-if-needed (-> s3-1 x))) + (set! (-> s0-0 box max x) f24-1) + ) + (set! (-> s0-0 box min y) f26-0) + (set! (-> s0-0 box max y) f28-1) + (draw-box-alpha-1 s0-0 buf) + (set-vector! (-> s0-0 color) 128 128 64 (the int (* 128.0 f30-0))) + (when (!= f26-0 (-> s3-1 y)) + (set! (-> s0-0 box min y) (-> s3-1 y)) + (set! (-> s0-0 box max y) f26-0) + (draw-box-prim-only s0-0 buf) + ) + (when (!= f28-1 (-> s3-1 w)) + (set! (-> s0-0 box min y) f28-1) + (set! (-> s0-0 box max y) (-> s3-1 w)) + (draw-box-prim-only s0-0 buf) + ) + ) + ) + (when (= (-> s2-0 file arg2 present) 1) + (when (= arg2 (-> arg0 option-index)) + (draw-icon-array! + (-> *progress-icon-arrays* (-> s2-0 file arg2 level-index)) + ; (the int (+ (-> s3-1 x) (* 0.7 (- (-> s3-1 z) (-> s3-1 x))) (* -48.0 f24-0))) + (the int (+ (adjust-x-if-needed (+ (-> s3-1 x) (* 0.7 (- (-> s3-1 z) (-> s3-1 x))))) (* -48.0 f24-0))) + (the int (+ 32.0 (-> s3-1 y))) + 1.0 + 1.0 + (static-rgba #x80 #x80 #x80 #x80) + f30-0) + (set-scale! arg1 0.6) + (set-color! arg1 (font-color font-color-32)) + (adjust-font-origin-y arg0 arg1 0.675) + (set-flags! arg1 (font-flags kerning right large)) + (let* ((v1-91 (-> s2-0 file arg2 game-time0)) + (v1-92 (logior (shl (-> s2-0 file arg2 game-time1) 32) v1-91))) + (set! (-> arg1 origin x) (adjust-x-if-needed (+ (-> s3-1 x) (* 0.675 (- (-> s3-1 z) (-> s3-1 x)))))) + (string-format "~2,'0D:~2,'0D" (/ (the-as int v1-92) #x107ac0) (/ (mod (the-as int v1-92) #x107ac0) #x4650)) + ) + (print-game-text *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) + (draw-icon-array! + (-> *progress-icon-arrays* 66) + (the int (adjust-x-if-needed (+ 10.0 (* 0.4 (- (-> s3-1 z) (-> s3-1 x))) (-> s3-1 x)))) + (the int (-> arg1 origin y)) + 0.65 + 0.65 + (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + f30-0 + ) + (set! (-> arg1 origin x) (adjust-x-if-needed (+ (- (+ -10.0 (-> s3-1 z)) (-> s3-1 x)) (-> s3-1 x)))) + (string-format "~D%" (the int (-> s2-0 file arg2 completion-percentage))) + (print-game-text *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) + (draw-icon-array! + (-> *progress-icon-arrays* 67) + (the int (adjust-x-if-needed (+ -8.0 (* 0.75 (- (-> s3-1 z) (-> s3-1 x))) (-> s3-1 x)))) + (the int (-> arg1 origin y)) + 0.7 + 0.7 + (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + f30-0 + ) + (adjust-font-origin-y arg0 arg1 0.83) + (set! (-> arg1 origin x) (adjust-x-if-needed (+ (-> s3-1 x) (* 0.675 (- (-> s3-1 z) (-> s3-1 x)))))) + (string-format "~D" (the int (-> s2-0 file arg2 skill-count))) + (print-game-text *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) + (draw-icon-array! + (-> *progress-icon-arrays* 68) + (the int (adjust-x-if-needed (+ 10.0 (* 0.4 (- (-> s3-1 z) (-> s3-1 x))) (-> s3-1 x)))) + (the int (+ -2.0 (-> arg1 origin y))) + 0.7 + 0.7 + (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + f30-0 + ) + (set! (-> arg1 origin x) (adjust-x-if-needed (+ (- (+ -10.0 (-> s3-1 z)) (-> s3-1 x)) (-> s3-1 x)))) + (string-format "~D" (the int (-> s2-0 file arg2 gem-count))) + (print-game-text *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) + (draw-icon-array! + (-> *progress-icon-arrays* 69) + (the int (adjust-x-if-needed (+ -14.0 (* 0.75 (- (-> s3-1 z) (-> s3-1 x))) (-> s3-1 x)))) + (the int (-> arg1 origin y)) + 0.5 + 0.5 + (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + f30-0 + ) + (when (logtest? (-> s2-0 file arg2 secrets) 1) + (set-flags! arg1 (font-flags kerning middle large)) + (set! (-> arg1 origin x) (adjust-x-if-needed (+ (-> s3-1 x) (* 0.4 (- (-> s3-1 z) (-> s3-1 x)))))) + (set! (-> arg1 origin y) (+ 8.0 (-> s3-1 y))) + (set-width! arg1 (the int (* 0.6 (- (-> s3-1 z) (-> s3-1 x))))) + (string-format "~S" (lookup-text! *common-text* (text-id progress-secrets-hero-mode) #f)) + (print-game-text *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + ) + ) + ) + ) + ) + (progress-method-34 arg0) + (when (zero? arg2) + (case (-> arg0 current) + (('select-load) + (draw-header arg0 arg1 f30-0 (text-id progress-load-file-select)) + ) + (('select-save-hero) + (draw-header arg0 arg1 f30-0 (text-id save-hero-mode-file)) + ) + (else + (draw-header arg0 arg1 f30-0 (text-id progress-save-file-select)) + ) + ) + ) + ) + ) + ) + (none) + ) + +(defmethod draw-option ((this menu-save-sub-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))) + (progress-method-33 arg0 (-> *progress-work* body)) + (let* ((s2-0 (get-scissor-stack-top arg0)) + (s3-0 (new 'stack 'hud-box)) + (width (if (not (-> *pc-settings* use-vis?)) + (the int (+ -13.0 (* (-> *pc-settings* aspect-ratio-reciprocal) (* 0.4 (- (-> s2-0 z) (-> s2-0 x)))))) + (the int (+ -10.0 (* 0.4 (- (-> s2-0 z) (-> s2-0 x))))) + ) + ) + ) + (set-width! arg1 width) + (set-flags! arg1 (font-flags kerning large)) + (set-scale! arg1 0.425) + (let* ((f24-0 (* (- (-> s2-0 w) (-> s2-0 y)) 0.2)) + (f28-1 (+ (-> s2-0 y) (* f24-0 (the float arg2)))) + (f26-0 (+ f28-1 f24-0)) + ) + (let* ((f0-7 + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #t 44 (bucket-id hud-draw-hud-alpha)) + ) + (v1-11 arg1) + (f1-9 (+ 10.0 (-> s2-0 x))) + (f0-10 (+ f28-1 (* 0.5 (- f24-0 f0-7)))) + ) + (set! (-> v1-11 origin x) (adjust-x-if-needed f1-9)) + (set! (-> v1-11 origin y) f0-10) + ) + (set! (-> arg1 height) f24-0) + (when (= arg2 (-> arg0 option-index)) + (set-scale! arg1 0.45) + (with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id tex-hud-hud-alpha) + ) + (set-vector! (-> s3-0 color) 128 128 128 (the int (* 16.0 f30-0))) + (set! (-> s3-0 box min x) (adjust-x-if-needed (-> s2-0 x))) + (set! (-> s3-0 box max x) (+ (-> s2-0 x) (* 0.4 (- (-> s2-0 z) (-> s2-0 x))))) + (set! (-> s3-0 box min y) f28-1) + (set! (-> s3-0 box max y) f26-0) + (draw-box-alpha-1 s3-0 buf) + (set-vector! (-> s3-0 color) 128 128 64 (the int (* 128.0 f30-0))) + (draw-box-prim-only s3-0 buf) + ) + ) + ) + ) + ) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) + (progress-method-34 arg0) + (none) + ) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; CUSTOM MENU OPTIONS +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defun draw-decoration-aspect-ratio-custom ((arg0 menu-option) (arg1 font-context) (arg2 float) (arg3 text-id) (arg5 float)) + (let ((gp-0 70) + (s5-0 120) + (sv-48 87) + (s3-0 375) + (s2-0 210) + (sv-64 0)) + (case (get-aspect-ratio) + (('aspect4x3) (set! gp-0 69) (set! s5-0 129) (set! sv-48 80) (set! s3-0 375) (set! s2-0 210)) + (('aspect16x9) (set! gp-0 79) (set! s5-0 129) (set! sv-48 68) (set! s3-0 356) (set! s2-0 244))) + (when (not (-> *pc-settings* use-vis?)) + (set! gp-0 (the int (adjust-game-x (the float gp-0)))) + (set! s3-0 (the int (* (-> *pc-settings* aspect-ratio-reciprocal) s3-0)))) + (set-scale! arg1 arg5) + (set! (-> arg1 origin y) (the float sv-48)) + (set! (-> arg1 height) 50.0) + (set-color! arg1 (font-color font-color-32)) + (set-flags! arg1 (font-flags kerning middle middle-vert large)) + (print-game-text (lookup-text! *common-text* arg3 #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) + (set-vector! (-> arg0 box 0 color) 64 128 128 (the int (* 128.0 arg2))) + (draw-savegame-box arg0 (the float gp-0) (the float (+ gp-0 s3-0)) (the float s5-0) (the float s5-0)) + (with-dma-buffer-add-bucket ((s0-1 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id particles)) + (draw-sprite2d-xy s0-1 + gp-0 + s5-0 + s3-0 + s2-0 + (new 'static 'rgba :r #x40 :g #x40 :b #x40 :a (the int (* 64.0 arg2))) + #x3fffff)))) + +(defun draw-highlight-aspect ((x int) (y int) (w int) (h int) (alpha float)) + "draw the highlight for a number in the aspect ratio screen" + (with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id hud-draw-hud-alpha)) + (when (not (-> *pc-settings* use-vis?)) + (set! x (adjust-game-x (the float x))) + (set! w (the int (* (-> *pc-settings* aspect-ratio-reciprocal) w)))) + (draw-sprite2d-xy buf x y w h (new 'static 'rgba :r #x80 :g #x80 :b #x40 :a (the int (* 64.0 alpha))) #x3fffff))) + +(defun draw-up-down-aspect ((font font-context) (y-up float) (y-down float)) + (protect ((-> font origin x) + (-> font origin y) + (-> font scale)) + (let ((start-y (-> font origin y))) + (set-scale! font 0.5) + (set! (-> font origin y) (- start-y y-up)) + (print-game-text (string-format "~33L~C" 160) font #f 44 (bucket-id hud-draw-hud-alpha)) + (set! (-> font origin y) (+ start-y y-down)) + (print-game-text (string-format "~33L~C" 162) font #f 44 (bucket-id hud-draw-hud-alpha)))) + 0) + +(defmethod draw-option ((obj menu-aspect-ratio-custom-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (let* ((alpha (* 2.0 (- 0.5 (-> arg0 menu-transition)))) + (middle-pad 15.0) + (middle-pad-uncorrected middle-pad) + (numbers-y 206.0) + (numbers-text-y (- numbers-y 44.0)) + (hilite-width 36) + (hilite-height 16) + (hilite-y-ofs 6) + (hilite-height-total (+ hilite-height (* 2 hilite-y-ofs))) + (font-w 100) + (font-w-corrected (if (not (-> *pc-settings* use-vis?)) (the int (* (-> *pc-settings* aspect-ratio-reciprocal) font-w)) font-w))) + (fmax! alpha 0.0) + (set! (-> arg1 alpha) alpha) + (set-flags! arg1 (font-flags kerning middle large)) + (set-scale! arg1 0.65) + (set-color! arg1 (font-color font-color-32)) + (set! (-> arg1 origin y) 80.0) + (if (not (-> *pc-settings* use-vis?)) (*! middle-pad (-> *pc-settings* aspect-ratio-reciprocal))) + (protect ((-> arg1 origin x) + (-> arg1 width)) + (set-scale! arg1 0.6) + (set-width! arg1 50) + (set! (-> arg1 origin y) numbers-y) + (set! (-> arg1 origin x) (- 256.0 25)) + (print-game-text "x" arg1 #f 44 (bucket-id hud-draw-hud-alpha)) + (set-width! arg1 font-w-corrected) + (set-scale! arg1 0.6) + (set! (-> arg1 origin y) numbers-y) + (set! (-> arg1 origin x) (- 256.0 middle-pad font-w-corrected)) + (cond + ((= 0 (-> *progress-state-pc* aspect-ratio-ratio-index)) + (draw-highlight-aspect (- (the int (+ (- 256.0 middle-pad-uncorrected font-w) (/ font-w 2))) (/ hilite-width 2)) + (- (the int (-> arg1 origin y)) hilite-y-ofs) + hilite-width + hilite-height-total + alpha) + (set-color! arg1 (font-color font-color-33)) + (draw-up-down-aspect arg1 21.0 25.0)) + (else (set-color! arg1 (font-color font-color-32)))) + (print-game-text (string-format "~D" (-> *pc-settings* aspect-custom-x)) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) + (set-scale! arg1 0.55) + (set-color! arg1 (font-color font-color-32)) + (set! (-> arg1 origin y) numbers-text-y) + (print-game-text (lookup-text! *common-text* (text-id progress-aspect-ratio-custom-width) #f) + arg1 + #f + 44 + (bucket-id hud-draw-hud-alpha)) + (set-scale! arg1 0.6) + (set! (-> arg1 origin y) numbers-y) + (set! (-> arg1 origin x) (+ 256.0 middle-pad)) + (cond + ((= 1 (-> *progress-state-pc* aspect-ratio-ratio-index)) + (draw-highlight-aspect (- (the int (+ (+ 256.0 middle-pad-uncorrected) (/ font-w 2))) (/ hilite-width 2)) + (- (the int (-> arg1 origin y)) hilite-y-ofs) + hilite-width + hilite-height-total + alpha) + (set-color! arg1 (font-color font-color-33)) + (draw-up-down-aspect arg1 21.0 25.0)) + (else (set-color! arg1 (font-color font-color-32)))) + (print-game-text (string-format "~D" (-> *pc-settings* aspect-custom-y)) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) + (set-scale! arg1 0.55) + (set-color! arg1 (font-color font-color-32)) + (set! (-> arg1 origin y) numbers-text-y) + (print-game-text (lookup-text! *common-text* (text-id progress-aspect-ratio-custom-height) #f) + arg1 + #f + 44 + (bucket-id hud-draw-hud-alpha))) + (set! (-> arg1 origin y) 289.0) + (cond + ((< (/ (the float (-> *pc-settings* aspect-custom-x)) (the float (-> *pc-settings* aspect-custom-y))) (/ 4.0 3.0)) + (set-scale! arg1 0.5) + (set-color! arg1 (font-color red)) + (when (and (< (/ (the float (-> *pc-settings* aspect-custom-x)) (the float (-> *pc-settings* aspect-custom-y))) (/ 4.0 3.0)) + (< (mod (-> *display* real-clock frame-counter) (seconds 1.2)) (seconds 1.0))) + (print-game-text (lookup-text! *common-text* (text-id progress-aspect-ratio-custom-warn) #f) + arg1 + #f + 44 + (bucket-id hud-draw-hud-alpha)))) + (else + (set-scale! arg1 0.55) + (set-color! arg1 (font-color font-color-32)) + (print-game-text (lookup-text! *common-text* + (if (not (swap-confirm?)) (text-id progress-aspect-ratio-custom-pad-x) (text-id progress-aspect-ratio-custom-pad-circle)) + #f) + arg1 + #f + 44 + (bucket-id hud-draw-hud-alpha)))) + (when-not-drawn-decoration (draw-decoration-aspect-ratio-custom obj arg1 alpha (text-id progress-aspect-ratio-custom-title) 0.55))) + 0 + (none)) + +(defmethod draw-option ((obj menu-frame-rate-disclaimer-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (set-color! arg1 (font-color red)) + (set-scale! arg1 0.8) + (set-flags! arg1 (font-flags kerning middle middle-vert large)) + (set! (-> arg1 origin x) 90.0) + (set! (-> arg1 origin y) 72.0) + (set-width! arg1 330) + (set-height! arg1 85) + (when (not (-> *pc-settings* use-vis?)) + (set! (-> arg1 origin x) (the float (adjust-game-x (-> arg1 origin x)))) + (*! (-> arg1 width) (-> *pc-settings* aspect-ratio-reciprocal))) + (when (< (mod (-> *display* real-clock frame-counter) (seconds 1.2)) (seconds 1.0)) + (print-game-text (lookup-text! *common-text* (text-id progress-fps-disclaimer-warning) #f) + arg1 + #f + 44 + (bucket-id hud-draw-hud-alpha))) + (+! (-> arg1 origin y) 80.0) + (set-scale! arg1 0.45) + (set-color! arg1 (font-color font-color-32)) + (print-game-text (lookup-text! *common-text* (text-id progress-fps-disclaimer) #f) + arg1 + #f + 44 + (bucket-id hud-draw-hud-alpha)) + (+! (-> arg1 origin y) 65.0) + (set-scale! arg1 0.55) + (set-height! arg1 95) + (print-game-text (lookup-text! *common-text* (text-id progress-memcard-continue?) #f) + arg1 + #f + 44 + (bucket-id hud-draw-hud-alpha)) + (+! (-> arg1 origin y) 58.0) + (set-scale! arg1 0.5) + (set-height! arg1 50) + (set-color! arg1 (font-color font-color-32)) + (when (time-elapsed? (-> *progress-state-pc* frame-rate-disclaimer-time) (seconds 3)) + (draw-highlight (the int (+ 13.0 (-> arg1 origin y))) 18 (-> arg1 alpha)) + ; (draw-yes-no arg0 arg1) + (draw-yes-no-style-footer arg0 arg1 (text-id progress-yes) (text-id progress-no))) + (none)) + +(defmethod draw-option ((this menu-sub-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))) + (set! (-> arg1 alpha) f30-0) + (set-scale! arg1 0.85) + (adjust-font-origin-y arg0 arg1 (-> this offset-y)) + (cond + ((= (-> arg0 option-index) arg2) + (draw-highlight-bar arg0 arg1 (the int (+ -6.0 (-> arg1 origin y))) 35 f30-0) + (let ((a0-4 arg1)) (set! (-> a0-4 color) (font-color font-color-33)))) + (else (let ((a0-5 arg1)) (set! (-> a0-5 color) (font-color font-color-32)))))) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) + 0 + (none)) + +(defmethod draw-option ((this menu-exit-game-option) (progress progress) (fnt font-context) (arg2 int) (selected symbol)) + (let ((alpha (* 2.0 (- 0.5 (-> progress menu-transition)))) + (y (the int (+ -1.0 (-> fnt origin y)))) + (height 22)) + (if (< alpha 0.0) (set! alpha 0.0)) + (set! (-> fnt alpha) alpha) + (set-scale! fnt 0.85) + ; (set! (-> fnt height) 25.0) + ; (set! height 28) + (adjust-font-origin-y progress fnt (-> this offset-y)) + ; (when (not (memcard-unlocked-secrets? #f #f)) + ; (-! (-> fnt origin y) 45.0) + ; (-! y 49) + ; ) + ; (when (memcard-unlocked-secrets? #f #f) + ; (-! (-> fnt origin y) 35.0) + ; (-! y 38) + ; ) + (when (nonzero? (-> this name)) + (set-color! fnt (if (= arg2 (-> progress option-index)) (font-color font-color-32) (font-color font-color-33))) + (cond + ((= arg2 (-> progress option-index)) + (set-color! fnt (font-color font-color-33)) + (draw-highlight-bar progress fnt (the int (+ -6.0 (-> fnt origin y))) 35 alpha)) + (else (set-color! fnt (font-color font-color-32)))) + (if selected (set-color! fnt (font-color font-color-34))) + (print-game-text (lookup-text! *common-text* (-> this name) #f) fnt #f 44 (bucket-id hud-draw-hud-alpha)) + (let ((choice (&-> progress yes-no-choice)) + (str (the string #f))) + (set! str + (cond + (selected + (set-color! fnt (font-color font-color-34)) + (when (memcard-unlocked-secrets? #f #f) + (draw-highlight-bar progress fnt (the int (+ 29.0 (-> fnt origin y))) 24 alpha) + (+! (-> fnt origin y) 29.0) + (set-scale! fnt 0.55)) + (when (not (memcard-unlocked-secrets? #f #f)) + (draw-highlight-bar progress fnt (the int (+ 23.0 (-> fnt origin y))) 23 alpha) + (+! (-> fnt origin y) 23.0) + (set-scale! fnt 0.60)) + (cond + ((-> choice 0) + (string-format "~33L~S~44L ~S" + (lookup-text! *common-text* (text-id progress-yes) #f) + (lookup-text! *common-text* (text-id progress-no) #f)) + (set! str *temp-string*)) + (else + (string-format "~44L~S ~33L~S~1L" + (lookup-text! *common-text* (text-id progress-yes) #f) + (lookup-text! *common-text* (text-id progress-no) #f)) + (set! str *temp-string*))) + str) + (else (clear *temp-string*)))) + (print-game-text str fnt #f 44 (bucket-id hud-draw-hud-alpha))))) + (none)) + +(defun draw-decoration-resolution ((arg0 menu-option) (arg1 font-context) (arg2 float) (arg3 text-id) (arg5 float)) + (let ((gp-0 70) + (s5-0 120) + (sv-48 87) + (s3-0 375) + (s2-0 210) + (sv-64 0)) + (case (get-aspect-ratio) + (('aspect4x3) (set! gp-0 70) (set! s5-0 116) (set! sv-48 84) (set! s3-0 375) (set! s2-0 179)) + (('aspect16x9) (set! gp-0 79) (set! s5-0 108) (set! sv-48 58) (set! s3-0 356) (set! s2-0 185) (set! sv-64 20))) + (#when PC_PORT + ;; added for better widescreen handling + (when (not (-> *pc-settings* use-vis?)) + (set! gp-0 (the int (adjust-game-x (the float gp-0)))) + (set! s3-0 (the int (* (-> *pc-settings* aspect-ratio-reciprocal) s3-0))))) + (set-scale! arg1 arg5) + (set! (-> arg1 origin y) (the float sv-48)) + (set! (-> arg1 height) 50.0) + (set-color! arg1 (font-color font-color-32)) + (set-flags! arg1 (font-flags kerning middle large)) + (print-game-text (lookup-text! *common-text* arg3 #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) + (set-vector! (-> arg0 box 0 color) 64 128 128 (the int (* 128.0 arg2))) + (draw-savegame-box arg0 (the float gp-0) (the float (+ gp-0 s3-0)) (the float s5-0) (the float s5-0)) + (+! (-> arg1 origin y) (the float sv-64)) + (draw-savegame-box arg0 (the float gp-0) (the float (+ gp-0 s3-0)) (the float (+ s5-0 s2-0)) (the float (+ s5-0 s2-0))) + (with-dma-buffer-add-bucket ((s0-1 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id particles)) + (draw-sprite2d-xy s0-1 + gp-0 + s5-0 + s3-0 + s2-0 + (new 'static 'rgba :r #x40 :g #x40 :b #x40 :a (the int (* 64.0 arg2))) + #x3fffff)))) + +(defun begin-scissor-resolution ((arg0 hud-box)) + (cond + ((= (get-aspect-ratio) 'aspect16x9) + (set! (-> arg0 min x) 79.0) + (set! (-> arg0 min y) 108.0) + (set! (-> arg0 max x) 434.0) + (set! (-> arg0 max y) 293.0)) + (else + (set! (-> arg0 min x) 70.0) + (set! (-> arg0 min y) 116.0) + (set! (-> arg0 max x) 444.0) + (set! (-> arg0 max y) 295.0))) + (with-dma-buffer-add-bucket ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id hud-draw-hud-alpha)) + (setup-scissor arg0 s4-0)) + 0) + +(defun end-scissor-resolution ((arg0 hud-box) (arg1 float)) + (with-dma-buffer-add-bucket ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id hud-draw-hud-alpha)) + (restore-scissor arg0 s5-0)) + 0) + +(defmethod draw-option ((this menu-resolution-option) (the-progress progress) (font font-context) (arg2 int) (arg3 symbol)) + (let* ((alpha (* 2.0 (- 0.5 (-> the-progress menu-transition)))) + (box (new 'stack 'hud-box)) + (height 22) + (text-pad 1) + (text-height (+ height (* text-pad 2)))) + (fmax! alpha 0.0) + (set! (-> font alpha) alpha) + (draw-decoration-resolution this + font + alpha + (if (fullscreen?) (text-id progress-game-res-decoration) (text-id progress-window-size-decoration)) + 0.65) + (begin-scissor-resolution box) + (set-flags! font (font-flags kerning large middle)) + (cond + ((< (-> this selected-index) 0) + ;; not sure. + ) + ((-> this valid?) + (set-scale! font 0.6) + (set-color! font (font-color font-color-33)) + (set! (-> font origin x) (+ (-> box min x) 16)) + (set! (-> font width) (- (-> box max x) (-> box min x) (* 16 2))) + (set-height! font 60) + ;; draw the highlight first + (draw-highlight 193 (- height 1) alpha) + ;; now scroll and offset the list + (if (> (fabs (- (-> this scroll-index) (the float (-> this selected-index)))) 2.0) + (set! (-> this scroll-index) (the float (-> this selected-index))) + (seek-ease! (-> this scroll-index) + (the float (-> this selected-index)) + (* 0.15 (-> PP clock time-adjust-ratio)) + 0.3 + (* 0.0015 (-> PP clock time-adjust-ratio)))) + (set! (-> font origin y) (- 194.0 (* (-> this scroll-index) text-height) (- text-pad))) + ;; now draw the list! + (let ((valid-index 0)) + (dotimes (i (-> this num-resolutions)) + ;; count "valid" resolutions + (let ((this-w 0) + (this-h 0) + (this-aspect 0.0)) + (pc-get-resolution i (= (pc-get-display-mode) 'windowed) (& this-w) (& this-h)) + (set! this-aspect (/ (the float this-w) (the float this-h))) + (when (or (= (pc-get-display-mode) 'windowed) (< (fabs (- (-> this win-aspect) this-aspect)) 0.05)) + (if (= valid-index (-> this selected-index)) + (set-color! font (font-color font-color-33)) + (set-color! font (font-color font-color-44))) + (print-game-text (string-format "~D x ~D" this-w this-h) font #f 44 (bucket-id hud-draw-hud-alpha)) + (+! (-> font origin y) text-height) + (1+! valid-index)))) + (when (fullscreen?) + ;; draw extra hardcoded cases + (if (= valid-index (-> this selected-index)) + (set-color! font (font-color font-color-33)) + (set-color! font (font-color font-color-44))) + (print-game-text (string-format "~D x ~D" 512 416) font #f 44 (bucket-id hud-draw-hud-alpha)) + (+! (-> font origin y) text-height) + (1+! valid-index) + (if (= valid-index (-> this selected-index)) + (set-color! font (font-color font-color-33)) + (set-color! font (font-color font-color-44))) + (print-game-text (string-format "~D x ~D" 512 208) font #f 44 (bucket-id hud-draw-hud-alpha)) + (+! (-> font origin y) text-height) + (1+! valid-index)))) + (else + ;; wtf?? just print an ominous warning. + (set-scale! font 0.6) + (set-color! font (font-color red)) + (set! (-> font origin x) (+ (-> box min x) 16)) + (set! (-> font origin y) (+ (-> box min y) 120)) + (set! (-> font width) (- (-> box max x) (-> box min x) (* 16 2))) + (set-height! font 60) + (print-game-text (lookup-text! *common-text* (text-id progress-error-no-resolutions) #f) + font + #f + 44 + (bucket-id hud-draw-hud-alpha)))) + (end-scissor-resolution box 1.0)) + 0 + (none)) + +; (defun draw-highlight-music-player ((x int) (y int) (w int) (h int) (alpha float)) +; "draw the highlight for a number in the music player screen" +; (with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf)) +; (bucket-id hud-draw-hud-alpha) +; ) +; (draw-sprite2d-xy buf x y w h (new 'static 'rgba :r #x80 :g #x80 :b #x40 :a (the int (* 64.0 alpha))) #x3fffff) +; ) +; ) + +; (defun begin-scissor-music-player ((box hud-box)) +; (cond +; ((= (get-aspect-ratio) 'aspect16x9) +; (set! (-> box min x) 19.0) +; (set! (-> box min y) 129.0) +; (set! (-> box max x) 274.0) +; (set! (-> box max y) 304.0) +; ) +; (else +; (set! (-> box min x) 70.0) +; (set! (-> box min y) 129.0) +; (set! (-> box max x) 268.0) +; (set! (-> box max y) 270.0) +; ) +; ) +; (#when PC_PORT +; (set! (-> box min x) (the float (the int (adjust-game-x (-> box min x))))) +; (set! (-> box max x) (the float (the int (adjust-game-x (-> box max x))))) +; ) +; (with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf)) +; (bucket-id hud-draw-hud-alpha) +; ) +; (setup-scissor box buf) +; ) +; 0 +; ) + +; (defun end-scissor-music-player ((box hud-box)) +; (with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf)) +; (bucket-id hud-draw-hud-alpha) +; ) +; (restore-scissor box buf) +; ) +; 0 +; ) + +; (defun draw-decoration-music-player ((arg0 menu-option) (arg1 font-context) (arg2 float) (arg3 text-id) (arg5 float) (box hud-box)) +; (let ((list-x (the int (-> box min x))) +; (list-y (the int (-> box min y))) +; (title-x 70) +; (title-y 80) +; (list-w (the int (- (-> box max x) (-> box min x)))) +; (list-h (the int (- (-> box max y) (-> box min y)))) +; (full-w 375) +; (full-h 199) +; ) +; (case (get-aspect-ratio) +; (('aspect16x9) +; (set! title-y 69) +; (set! full-w 355) +; (set! full-h 233) +; (*! arg5 1.25) +; ) +; ) +; (when (not (-> *pc-settings* use-vis?)) +; (set! title-x (the int (adjust-game-x (the float title-x)))) +; (set! full-w (the int (* (-> *pc-settings* aspect-ratio-reciprocal) full-w))) +; ) +; (set-scale! arg1 arg5) +; (set-origin! arg1 title-x title-y) +; (set! (-> arg1 width) 375.0) +; (set! (-> arg1 height) 48.0) +; (when (not (-> *pc-settings* use-vis?)) +; (*! (-> arg1 width) (-> *pc-settings* aspect-ratio-reciprocal)) +; ) +; (set-color! arg1 (font-color font-color-33)) +; (set-flags! arg1 (font-flags kerning middle middle-vert large)) +; (print-game-text (lookup-text! *common-text* arg3 #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) +; (set-vector! (-> arg0 box 0 color) 64 128 128 (the int (* 128.0 arg2))) +; (draw-savegame-box arg0 (the float list-x) (the float (+ list-x full-w)) (the float list-y) (the float list-y)) +; (draw-savegame-box arg0 (the float list-x) (the float (+ list-x list-w)) (the float (+ list-y list-h)) (the float (+ list-y list-h))) +; (draw-savegame-box arg0 (the float (+ list-x list-w)) (the float (+ list-x list-w)) (the float list-y) (the float (+ list-y full-h))) +; (with-dma-buffer-add-bucket ((s0-1 (-> *display* frames (-> *display* on-screen) global-buf)) +; (bucket-id particles) +; ) +; (draw-sprite2d-xy +; s0-1 +; list-x +; list-y +; list-w +; list-h +; (new 'static 'rgba :r #x40 :g #x40 :b #x40 :a (the int (* 64.0 arg2))) +; #x3fffff +; ) +; ) +; ) +; ) + +; (defun draw-up-down-music-player ((font font-context) (box hud-box)) +; (protect ((-> font origin x) (-> font origin y) (-> font scale) (-> font width) (-> font height)) + +; (let ((start-y (-> font origin y))) +; (set-scale! font 0.5) +; (set! (-> font width) (- (-> box max x) (-> box min x))) +; (set! (-> font height) 16.0) +; (set-flags! font (font-flags kerning large middle)) +; (set! (-> font origin x) (-> box min x)) +; (set! (-> font origin y) (- (-> box min y) (-> font height))) +; (print-game-text (string-format "~33L~C" 160) font #f 44 (bucket-id hud-draw-hud-alpha)) +; (set! (-> font origin y) (+ 3.0 (-> box max y))) +; (print-game-text (string-format "~33L~C" 162) font #f 44 (bucket-id hud-draw-hud-alpha)) +; ) +; ) +; 0) + +; (defmethod draw-option ((obj menu-music-player-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +; (let* ((alpha (* 2.0 (- 0.5 (-> arg0 menu-transition)))) +; (y-pad-top 11) +; (text-height 23) +; (old-y 0.0) +; (list-text-y (+ (- (-> obj current-scroll)) y-pad-top)) +; (max-lines 8) +; (tab-music 6.0) +; (tab-flava 12.0) +; (box (new 'stack 'hud-box)) +; (flava-text-list (new 'static 'boxed-array :type text-id +; (text-id progress-music-player-flava-default) +; (text-id progress-music-player-flava-gun) +; (text-id progress-music-player-flava-board) +; (text-id progress-music-player-flava-mech) +; (text-id progress-music-player-flava-darkjak) +; (text-id progress-music-player-flava-pilot) +; ))) +; (fmax! alpha 0.0) +; (set! (-> arg1 alpha) alpha) +; (when (not (-> *pc-settings* use-vis?)) +; (*! tab-music (-> *pc-settings* aspect-ratio-reciprocal)) +; (*! tab-flava (-> *pc-settings* aspect-ratio-reciprocal)) +; ;(set! danger-w (the int (* (-> *pc-settings* aspect-ratio-reciprocal) danger-w))) +; ) +; (set-flags! arg1 (font-flags kerning large)) +; (set-scale! arg1 0.6) +; (set-color! arg1 (font-color font-color-33)) +; (begin-scissor-music-player box) +; (+! list-text-y (-> box min y)) +; (set-scale! arg1 0.45) +; (set! (-> arg1 origin x) (+ (-> box min x) tab-music)) +; ;(format *stdcon* "m: ~D f: ~D scroll: ~f~%" (-> obj music-index) (-> obj flava-index) (-> obj current-scroll)) +; (dotimes (i (-> *music-player-tracks* length)) +; (set! (-> arg1 origin y) (set! old-y list-text-y)) +; (set! (-> arg1 width) (- (-> box max x) (-> box min x))) +; (cond +; ((= i (-> obj music-index)) +; (+! list-text-y text-height) +; (cond +; ((-> *progress-state-pc* music-player-selected) +; ;; restore these later +; (let* ((flava-bits (the-as int (-> *music-player-tracks* i flava))) +; (flava-count (count-bits flava-bits)) +; (flava-text-height (the int (* (/ 0.42 0.45) text-height)))) +; ;; draw highlight first +; (draw-highlight-music-player (the int (-> box min x)) (the int (+ -6.0 (-> arg1 origin y))) +; (the int (- (-> box max x) (-> box min x))) (+ text-height (* flava-count flava-text-height)) +; alpha) +; ;; draw text for each flava! +; (protect ((-> arg1 origin x) (-> arg1 origin y) (-> arg1 scale)) +; (set-scale! arg1 0.42) +; (+! (-> arg1 origin x) tab-flava) +; (set! (-> arg1 origin y) list-text-y) +; (dotimes (f flava-count) +; (if (= f (-> obj flava-index)) +; (set-color! arg1 (font-color font-color-33)) +; (set-color! arg1 (font-color font-color-44))) +; (let ((flava (bit-on-offset flava-bits f))) +; (if (flava-unlocked? flava) +; (print-game-text (lookup-text! *common-text* (-> flava-text-list (bit-on-offset flava-bits f)) #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) +; (print-game-text (lookup-text! *common-text* (text-id progress-music-player-locked) #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha))) +; ) +; (+! (-> arg1 origin y) flava-text-height) +; ) +; ) +; ;; advance list height +; (+! list-text-y (* flava-count flava-text-height)) +; ;; set color to selected +; (set-color! arg1 (font-color font-color-34)) +; )) +; (else +; (set-color! arg1 (font-color font-color-33)) +; (draw-highlight-music-player (the int (-> box min x)) (the int (+ -6.0 (-> arg1 origin y))) +; (the int (- (-> box max x) (-> box min x))) text-height +; alpha) +; )) +; (when (< (-> arg1 origin y) (+ (-> box min y) y-pad-top)) +; (set! (-> obj current-scroll) (seek-ease (-> obj current-scroll) (+ (-> obj current-scroll) (- (-> arg1 origin y) (+ (-> box min y) y-pad-top))) +; (if (-> *progress-state-pc* music-player-selected) 999999.0 (* 0.1 text-height (-> arg0 clock time-adjust-ratio))) +; (* 0.3 text-height) +; (* 0.01 text-height (-> arg0 clock time-adjust-ratio))))) +; (when (> list-text-y (-> box max y)) +; (set! (-> obj current-scroll) (seek-ease (-> obj current-scroll) (+ (-> obj current-scroll) (- list-text-y (-> box max y))) +; (if (-> *progress-state-pc* music-player-selected) 999999.0 (* 0.1 text-height (-> arg0 clock time-adjust-ratio))) +; (* 0.3 text-height) +; (* 0.01 text-height (-> arg0 clock time-adjust-ratio))))) +; ) +; (else +; (+! list-text-y text-height) +; (set-color! arg1 (font-color font-color-33)) +; ) +; ) +; (if (get-bit (-> *pc-settings* music-unlocked) i) +; (print-game-text (lookup-text! *common-text* (-> *music-player-tracks* i text) #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) +; (print-game-text (lookup-text! *common-text* (text-id progress-music-player-locked) #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha))) +; ) +; (if (< (- list-text-y (-> box max y)) 0.0) +; (+! (-> obj current-scroll) (- list-text-y (-> box max y)))) +; (unless (-> *progress-state-pc* music-player-selected) +; (fmax! (-> obj max-scroll) (-> obj current-scroll))) +; (end-scissor-music-player box) +; ;; draw right panel text +; (let ((icon-x 0) +; (icon-y 174) +; (icon-w (if (= (get-aspect-ratio) 'aspect4x3) +; 64 +; 48)) +; (icon-h 64) +; (icon-scale 0.7) +; (icon-id 0) +; (danger-pad 8.0) +; (danger-w 73) +; (arrow-w 14) +; (danger-text-list (new 'static 'boxed-array :type text-id +; (text-id progress-music-player-danger-0) +; (text-id progress-music-player-danger-1) +; (text-id progress-music-player-danger-2) +; (text-id progress-music-player-danger-3) +; ))) +; (set-flags! arg1 (font-flags kerning middle large)) +; (case (get-aspect-ratio) +; (('aspect16x9) +; (set-origin! arg1 281 160) +; (set-width! arg1 144) +; (set! icon-y 190) +; ) +; (else +; (set-origin! arg1 278 144) +; (set-width! arg1 158) +; ) +; ) +; (when (not (-> *pc-settings* use-vis?)) +; (set! (-> arg1 origin x) (the float (adjust-game-x (-> arg1 origin x)))) +; (*! danger-pad (-> *pc-settings* aspect-ratio-reciprocal)) +; (*! (-> arg1 width) (-> *pc-settings* aspect-ratio-reciprocal)) +; (set! icon-w (the int (* (-> *pc-settings* aspect-ratio-reciprocal) icon-w))) +; (set! danger-w (the int (* (-> *pc-settings* aspect-ratio-reciprocal) danger-w))) +; (set! arrow-w (the int (* (-> *pc-settings* aspect-ratio-reciprocal) arrow-w))) +; ) +; (set-height! arg1 40) +; (set-scale! arg1 0.42) +; (set-color! arg1 (font-color font-color-33)) +; (when (-> *progress-state-pc* music-player-track) +; (print-game-text (lookup-text! *common-text* (text-id progress-music-player-now-playing) #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha))) +; (set-flags! arg1 (font-flags kerning middle middle-vert large)) +; (+! (-> arg1 origin y) 110.0) +; (set-scale! arg1 0.48) +; (cond +; ((-> *progress-state-pc* music-player-track) +; (set! icon-id (-> *progress-state-pc* music-player-track icon)) ;; use this icon ID +; (print-game-text (lookup-text! *common-text* (-> *progress-state-pc* music-player-track text) #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) +; ;; print flava if needed too +; (when (nonzero? (-> *progress-state-pc* music-player-track flava)) +; (+! (-> arg1 origin y) 36.0) +; (set-scale! arg1 0.42) +; (print-game-text (lookup-text! *common-text* (-> flava-text-list (-> *progress-state-pc* music-player-flava)) #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) +; ) +; ) +; (else +; (print-game-text (lookup-text! *common-text* (text-id progress-music-player-no-track) #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) +; ) +; ) +; ;; draw right panel icon +; (set! icon-x (the int (+ (-> arg1 origin x) (/ (-> arg1 width) 2)))) +; (set! icon-w (the int (* icon-scale icon-w))) +; (set! icon-h (the int (* icon-scale icon-h))) +; ;; center icon. the icon is 96x96 but each sprite is 64x64, hence 1.5 +; (-! icon-x (the int (/ (* 1.5 icon-w) 2))) +; (set-hud-sprite-attributes! (-> obj sprites 0) :tex (lookup-texture-by-id (get-level-icon-id-01 icon-id)) :a alpha :scale-x icon-scale :scale-y icon-scale :x icon-x :y icon-y) +; (set-hud-sprite-attributes! (-> obj sprites 1) :tex (lookup-texture-by-id (get-level-icon-id-02 icon-id)) :a alpha :scale-x icon-scale :scale-y icon-scale :x (+ icon-x icon-w) :y icon-y) +; (set-hud-sprite-attributes! (-> obj sprites 2) :tex (lookup-texture-by-id (get-level-icon-id-03 icon-id)) :a alpha :scale-x icon-scale :scale-y icon-scale :x icon-x :y (+ icon-y icon-h)) +; (set-hud-sprite-attributes! (-> obj sprites 3) :tex (lookup-texture-by-id (get-level-icon-id-04 icon-id)) :a alpha :scale-x icon-scale :scale-y icon-scale :x (+ icon-x icon-w) :y (+ icon-y icon-h)) +; ;; danger scroller +; (set-scale! arg1 0.42) +; (set! (-> arg1 origin y) (+ 26.0 (-> box max y))) +; (set! (-> arg1 origin x) (+ danger-pad (-> box min x))) +; (set-width! arg1 danger-w) +; (set-flags! arg1 (font-flags kerning large)) +; (print-game-text (lookup-text! *common-text* (text-id progress-music-player-danger) #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) +; (+! (-> arg1 origin x) (-> arg1 width)) +; (set-flags! arg1 (font-flags kerning large right)) +; (set-width! arg1 arrow-w) +; (+! (-> arg1 origin x) (-> arg1 width)) +; (set-color! arg1 (progress-selected (seconds 0.5))) +; (print-game-text (string-format "~33L~C" 163) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) +; (set-flags! arg1 (font-flags kerning large middle)) +; (set-width! arg1 (the int (- (-> box max x) (-> box min x) danger-w (* arrow-w 2) (* danger-pad 2)))) +; (set-color! arg1 (font-color font-color-33)) +; (print-game-text (lookup-text! *common-text* (-> danger-text-list (-> obj excitement)) #f) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) +; (+! (-> arg1 origin x) (-> arg1 width)) +; (set-flags! arg1 (font-flags kerning large)) +; (set-width! arg1 arrow-w) +; (set-color! arg1 (progress-selected (seconds 0.5))) +; (print-game-text (string-format "~33L~C" 161) arg1 #f 44 (bucket-id hud-draw-hud-alpha)) +; (with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf)) +; (bucket-id hud-draw-hud-alpha) +; ) +; (draw (-> obj sprites 0) buf (-> *level* default-level)) +; (draw (-> obj sprites 1) buf (-> *level* default-level)) +; (draw (-> obj sprites 2) buf (-> *level* default-level)) +; (draw (-> obj sprites 3) buf (-> *level* default-level)) +; ) +; ) +; (when-not-drawn-decoration +; (draw-up-down-music-player arg1 box) +; (draw-decoration-music-player obj arg1 alpha (-> obj name) 0.7 box)) +; ) +; 0 +; (none)) + +(#when PC_PORT + (defun-debug draw-mouse () + "draw some extra mouse info" + (let ((mx (+ (the int (-> *mouse* posx)) 256)) + (my (+ (the int (-> *mouse* posy)) 208))) + (format *stdcon* "mouse pos: (~D,~D)~%" mx my) + (with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id debug-no-zbuf2)) + (draw-sprite2d-xy buf 0 my 512 1 (static-rgba #xff #xff #xff #x40) #x3fffff) + (draw-sprite2d-xy buf mx 0 1 416 (static-rgba #xff #xff #xff #x40) #x3fffff)))) + (defmacro spawn-draw-mouse-proc () + `(process-spawn-function process + :name "draw-mouse" + :to + *display-pool* + (lambda :behavior process () + (loop + (suspend) + (draw-mouse)))))) diff --git a/goal_src/jak3/pc/progress/progress-generic-draw-pc.gc b/goal_src/jak3/pc/progress/progress-generic-draw-pc.gc new file mode 100644 index 0000000000..cc83323767 --- /dev/null +++ b/goal_src/jak3/pc/progress/progress-generic-draw-pc.gc @@ -0,0 +1,634 @@ +;;-*-Lisp-*- +(in-package goal) + + +;; + +(defglobalconstant DEBUG_PAGE_ROWS #f) + +(defconstant FONT_SIZE_HEADER 0.6) ;; font size for the decoration text +(defconstant FONT_SIZE_OPTION 0.5) ;; font size for regular options +(defconstant FONT_SIZE_OPTION_EXTRA 0.35) ;; font size for option sub-text +(defconstant HIGHLIGHT_SIZE 18) ;; default highlight size for options +(defconstant HIGHLIGHT_SIZE_LARGE 33) + + +;; + + +(defun draw-page-border ((hud-bounds hud-box) (alpha float)) + (let ((x-pos 70) + (y-pos 112) + (width 375) + (background-height 200)) + (when (= (get-aspect-ratio) 'aspect16x9) + (set! x-pos 79) + (set! y-pos 86) + (set! width 356) + (set! background-height 255)) + (#when PC_PORT + ;; added for better widescreen handling + (when (not (-> *pc-settings* use-vis?)) + (set! x-pos (the int (adjust-game-x (the float x-pos)))) + (set! width (the int (* (-> *pc-settings* aspect-ratio-reciprocal) width))))) + (set-vector! (-> hud-bounds color) 128 128 64 (the int (* 128.0 alpha))) + ;; Top Line + (set! (-> hud-bounds min x) (the float x-pos)) + (set! (-> hud-bounds max x) (the float (+ x-pos width))) + (set! (-> hud-bounds min y) (the float y-pos)) + (set! (-> hud-bounds max y) (the float y-pos)) + (with-dma-buffer-add-bucket ((buffer-1 (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id hud-draw-hud-alpha)) + (draw-box-prim-only hud-bounds buffer-1)) + ;; Bottom Line + (set! (-> hud-bounds min x) (the float x-pos)) + (set! (-> hud-bounds max x) (the float (+ x-pos width))) + (set! (-> hud-bounds min y) (the float (+ y-pos background-height))) + (set! (-> hud-bounds max y) (the float (+ y-pos background-height))) + (with-dma-buffer-add-bucket ((buffer-2 (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id hud-draw-hud-alpha)) + (draw-box-prim-only hud-bounds buffer-2))) + (none)) + +(defun draw-page-background ((alpha float)) + (let ((x-pos 70) + (y-pos 112) + (width 375) + (background-height 200)) + (when (= (get-aspect-ratio) 'aspect16x9) + (set! x-pos 79) + (set! y-pos 86) + (set! width 356) + (set! background-height 256)) + (#when PC_PORT + ;; added for better widescreen handling + (when (not (-> *pc-settings* use-vis?)) + (set! x-pos (the int (adjust-game-x (the float x-pos)))) + (set! width (the int (* (-> *pc-settings* aspect-ratio-reciprocal) width))))) + (with-dma-buffer-add-bucket ((buffer (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id bucket7)) + (draw-sprite2d-xy buffer x-pos y-pos width background-height + (new 'static 'rgba :r #x80 :g #x80 :b #x40 :a (the int (* 64.0 alpha))) #x3fffff) + )) + (none)) + +(defun draw-page-header ((font-ctx font-context) (text text-id) (alpha float)) + (let ((x-pos 70) + (y-pos 82) + (width 375)) + (when (= (get-aspect-ratio) 'aspect16x9) + (set! x-pos 79) + (set! y-pos 55) + (set! width 356)) + ; (progress-method-42 (-> *progress-process*) (-> *progress-work* header) (* 64.0 alpha)) + ; (progress-method-41 (-> *progress-process*) (-> *progress-work* header) (* 128.0 alpha)) + (set-scale! font-ctx FONT_SIZE_HEADER) + (set! (-> font-ctx origin y) (the float y-pos)) + (set-color! font-ctx (font-color font-color-32)) + (print-game-text (lookup-text! *common-text* text #f) font-ctx #f 44 (bucket-id hud-draw-hud-alpha))) + (none)) + +(defun draw-scrolling-page-up-down-arrows ((font-ctx font-context) (draw-up? symbol) (draw-down? symbol)) + (let ((new-x-pos 250.0) + (new-y-pos-up 100) + (new-y-pos-down 211) + (new-scale 0.5) + (old-scale (-> font-ctx scale)) + (old-x-pos (-> font-ctx origin x)) + (old-y-pos (-> font-ctx origin y))) + (when (= (get-aspect-ratio) 'aspect16x9) + (set! new-x-pos 251.5) + (set! new-y-pos-up 75) + (set! new-y-pos-down 265)) + (set! (-> font-ctx scale) new-scale) + (when draw-up? + (set! (-> font-ctx origin x) (the float new-x-pos)) + (set! (-> font-ctx origin y) (the float new-y-pos-up)) + (let ((print-text-fn print-game-text)) + (format (clear *progress-generic-temp-string*) "~33L~C" 160) + (print-text-fn *progress-generic-temp-string* font-ctx #f 44 (bucket-id hud-draw-hud-alpha)))) + (when draw-down? + (set! (-> font-ctx origin x) (the float new-x-pos)) + (set! (-> font-ctx origin y) (the float (+ new-y-pos-up new-y-pos-down))) + (let ((print-text-fn-1 print-game-text)) + (format (clear *progress-generic-temp-string*) "~33L~C" 162) + (print-text-fn-1 *progress-generic-temp-string* font-ctx #f 44 (bucket-id hud-draw-hud-alpha)))) + (set! (-> font-ctx origin x) old-x-pos) + (set! (-> font-ctx origin y) old-y-pos) + (set! (-> font-ctx scale) old-scale)) + (none)) + +;; The boundary info could be moved to the menu-option, every one of these is duplicate code +(defun begin-scissor-scrolling-page ((hud-bounds hud-box)) + (cond + ((= (get-aspect-ratio) 'aspect16x9) + (set! (-> hud-bounds min x) 19.0) + (set! (-> hud-bounds min y) 86.0) + (set! (-> hud-bounds max x) 494.0) + (set! (-> hud-bounds max y) 340.0)) + (else + (set! (-> hud-bounds min x) 70.0) + (set! (-> hud-bounds min y) 112.0) + (set! (-> hud-bounds max x) 444.0) + (set! (-> hud-bounds max y) 312.0))) + (#when PC_PORT + (set! (-> hud-bounds min x) (the float (the int (adjust-game-x (-> hud-bounds min x))))) + (set! (-> hud-bounds max x) (the float (the int (adjust-game-x (-> hud-bounds max x)))))) + (with-dma-buffer-add-bucket ((buffer (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id hud-draw-hud-alpha)) + (setup-scissor hud-bounds buffer)) + (none)) + +(defun end-scissor-scrolling-page ((hud-bounds hud-box) (arg1 float)) + (with-dma-buffer-add-bucket ((buffer (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id hud-draw-hud-alpha) + ) + (restore-scissor hud-bounds buffer)) + (none)) + +(defun-debug draw-generic-page-row-line ((y-coord int)) + (#when DEBUG_PAGE_ROWS + (with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id debug-no-zbuf2)) + (draw-sprite2d-xy buf 0 y-coord 512 1 (static-rgba #xff #xff #xff #x40) #x3fffff))) + 0) + +(defmethod draw-option ((obj menu-generic-scrolling-page) (progress progress) (font-ctx font-context) (arg3 int) (arg4 symbol)) + (when (or (zero? (-> obj mounted?)) (not (-> obj mounted?))) + (on-mount! obj)) + ;; the list has a total of 200px of y-height + ;; with 10px of margin at the top and bottom, that leaves 180 / 4 = 45px per item + ;; it's the responsibility of each generic component to center itself within these 45px lines + (when (not (-> *progress-pc-generic-store* clear-screen?)) + (let* ((font-alpha (fmax 0.0 (* 2.0 (- 0.5 (-> progress menu-transition))))) + (hud-bounds (new 'stack-no-clear 'hud-box)) + (max-page-size (if (= (get-aspect-ratio) 'aspect16x9) 7 5)) + (margin-top-bottom 0.0) + (line-height (/ (if (= (get-aspect-ratio) 'aspect16x9) 253.0 200.0) max-page-size))) + (set! (-> font-ctx alpha) font-alpha) + (set-color! font-ctx (font-color font-color-32)) + ;; header + (draw-page-header font-ctx (-> obj name) font-alpha) + ;; background borders + (draw-page-border (-> obj box 0) font-alpha) + ;; background + (draw-page-background font-alpha) + (begin-scissor-scrolling-page hud-bounds) + (if (= (get-aspect-ratio) 'aspect16x9) + (set! (-> font-ctx origin y) (+ 86.0 margin-top-bottom)) + (set! (-> font-ctx origin y) (+ 112.0 margin-top-bottom))) + + ;; do scrolling. if we notice we need to scroll too much, we just snap immediately instead of smoothly stepping. + (cond + ((> (-> *progress-pc-generic-store* current-menu-scroll-index) (-> *progress-pc-generic-store* current-menu-hover-index)) + (if (>= (fabs (- (-> *progress-pc-generic-store* current-menu-scroll-index) (the float (-> *progress-pc-generic-store* current-menu-hover-index)))) 2.0) + (set! (-> *progress-pc-generic-store* current-menu-scroll-index) (the float (-> *progress-pc-generic-store* current-menu-hover-index))) + (seek-ease! (-> *progress-pc-generic-store* current-menu-scroll-index) (the float (-> *progress-pc-generic-store* current-menu-hover-index)) (* 0.125 (-> PP clock time-adjust-ratio)) 0.3 (* 0.00125 (-> PP clock time-adjust-ratio))))) + ((< (+ (-> *progress-pc-generic-store* current-menu-scroll-index) (1- max-page-size)) (-> *progress-pc-generic-store* current-menu-hover-index)) + (if (>= (fabs (- (-> *progress-pc-generic-store* current-menu-scroll-index) (the float (- (-> *progress-pc-generic-store* current-menu-hover-index) (1- max-page-size))))) 2.0) + (set! (-> *progress-pc-generic-store* current-menu-scroll-index) (the float (- (-> *progress-pc-generic-store* current-menu-hover-index) (1- max-page-size)))) + (seek-ease! (-> *progress-pc-generic-store* current-menu-scroll-index) (the float (- (-> *progress-pc-generic-store* current-menu-hover-index) (1- max-page-size))) (* 0.125 (-> PP clock time-adjust-ratio)) 0.3 (* 0.00125 (-> PP clock time-adjust-ratio))))) + ) + + ;; render items + (let* ((start-index (the int (-> *progress-pc-generic-store* current-menu-scroll-index))) + ;; we add 1 because the scroll effect will reveal 1 extra + (end-index (min (-> obj menu-options length) (+ start-index max-page-size 1)))) + ;; scroll adjust + (-! (-> font-ctx origin y) (* line-height (fabs (- (-> *progress-pc-generic-store* current-menu-scroll-index) start-index)))) + (while (< start-index end-index) + (let ((menu-option (-> obj menu-options start-index))) + (when (nonzero? menu-option) + ;; save the y,x position as who knows where it will end up after the component finishes rendering + (let ((old-y-pos (-> font-ctx origin y)) + (old-x-pos (-> font-ctx origin x))) + (draw-option menu-option progress font-ctx start-index + (= (-> obj selected-option-index) start-index)) + ;; move to the next line + (set! (-> font-ctx origin y) (+ old-y-pos line-height)) + ;; - debugging, draw the dividing lines to make centering new items easier + (draw-generic-page-row-line (the int (-> font-ctx origin y))) + (set! (-> font-ctx origin x) old-x-pos) + ;; reset the font color + (set-color! font-ctx (font-color font-color-32))))) + (+! start-index 1))) + ;; end + (end-scissor-scrolling-page hud-bounds 1.0) + (set-flags! font-ctx (font-flags kerning large)) + (let ((draw-up-arrow? (< 0 (-> *progress-pc-generic-store* current-menu-hover-index))) + (draw-down-arrow? (< (-> *progress-pc-generic-store* current-menu-hover-index) (1- (-> obj menu-options length))))) + (draw-scrolling-page-up-down-arrows font-ctx draw-up-arrow? draw-down-arrow?)))) + (none)) + +(defun draw-generic-highlight ((y-pos int) (height int) (alpha float)) + (let ((x-pos (if (= (get-aspect-ratio) 'aspect4x3) + 70 + 50)) + (width (if (= (get-aspect-ratio) 'aspect4x3) + 374 + 500))) + (when (not (-> *pc-settings* use-vis?)) + (set! x-pos (the int (adjust-game-x (the float x-pos)))) + (set! width (the int (* (-> *pc-settings* aspect-ratio-reciprocal) width)))) + (with-dma-buffer-add-bucket ((buffer (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id hud-draw-hud-alpha) + ) + (draw-sprite2d-xy buffer x-pos y-pos width height + (new 'static 'rgba :r #x80 :g #x80 :b #x40 :a (the int (* 64.0 alpha))) #x3fffff)))) + +(defmethod draw-option ((obj menu-generic-boolean-option) (arg0 progress) (font-ctx font-context) (option-index int) (selected? symbol)) + (when (not (-> obj mounted?)) + (on-mount! obj)) + (let ((alpha (* 2.0 (- 0.5 (-> arg0 menu-transition)))) + (line-height 18.0)) + (fmax! alpha 0.0) + (set! (-> font-ctx alpha) alpha) + (set-flags! font-ctx (font-flags kerning middle large)) + (set-scale! font-ctx FONT_SIZE_OPTION) + (+! (-> font-ctx origin y) (if (= (get-aspect-ratio) 'aspect4x3) 7.0 5.0)) + (cond + (selected? + (set-color! font-ctx (font-color font-color-34)) + (draw-generic-highlight (the int (- (-> font-ctx origin y) 2.0)) HIGHLIGHT_SIZE_LARGE alpha) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) font-ctx #f 44 (bucket-id hud-draw-hud-alpha)) + (+! (-> font-ctx origin y) line-height) + (set! *progress-generic-temp-string* (clear *progress-generic-temp-string*)) + (if (-> obj value) + (format *progress-generic-temp-string* "~33L~S~44L ~S" (lookup-text! *common-text* (-> obj truthy-text) #f) (lookup-text! *common-text* (-> obj falsey-text) #f)) + (format *progress-generic-temp-string* "~44L~S ~33L~S~1L" (lookup-text! *common-text* (-> obj truthy-text) #f) (lookup-text! *common-text* (-> obj falsey-text) #f)))) + ;; hover case + (else + (cond + ((and (nonzero? (-> obj should-disable?)) + (-> obj should-disable?) + ((-> obj should-disable?))) + (set-color! font-ctx (font-color font-color-44)) + (when (= option-index (-> *progress-pc-generic-store* current-menu-hover-index)) + (draw-generic-highlight (the int (+ -2.0 (-> font-ctx origin y))) HIGHLIGHT_SIZE (* 0.5 alpha)))) + ((= option-index (-> *progress-pc-generic-store* current-menu-hover-index)) + (set-color! font-ctx (font-color font-color-33)) + (draw-generic-highlight (the int (+ -2.0 (-> font-ctx origin y))) HIGHLIGHT_SIZE alpha)) + (else + (set-color! font-ctx (font-color font-color-32)))) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) font-ctx #f 44 (bucket-id hud-draw-hud-alpha)) + (+! (-> font-ctx origin y) line-height) + (set! *progress-generic-temp-string* (clear *progress-generic-temp-string*)) + (let ((actual-value (call-get-value-fn obj))) + (if actual-value + (format *progress-generic-temp-string* "~1L~S~44L ~S" (lookup-text! *common-text* (-> obj truthy-text) #f) (lookup-text! *common-text* (-> obj falsey-text) #f)) + (format *progress-generic-temp-string* "~44L~S ~1L~S~1L" (lookup-text! *common-text* (-> obj truthy-text) #f) (lookup-text! *common-text* (-> obj falsey-text) #f)))))) + (set-scale! font-ctx FONT_SIZE_OPTION_EXTRA) + (print-game-text *progress-generic-temp-string* font-ctx #f 44 (bucket-id hud-draw-hud-alpha))) + (none)) + +(defmethod draw-option ((obj menu-generic-carousel-option) + (progress progress) + (font-ctx font-context) + (option-index int) + (selected? symbol)) + (when (not (-> obj mounted?)) + (on-mount! obj)) + (let ((alpha (fmax (* 2.0 (- 0.5 (-> progress menu-transition))) 0.0))) + (set! (-> font-ctx scale) 0.45) + (set! (-> font-ctx alpha) alpha) + (+! (-> font-ctx origin y) 5.0) + (set-flags! font-ctx (font-flags kerning middle large)) + ;; the item label + (cond + (selected? + (set! (-> font-ctx color) (font-color font-color-34)) + (draw-generic-highlight (the int (- (-> font-ctx origin y) 2.0)) HIGHLIGHT_SIZE_LARGE alpha)) + ((and (nonzero? (-> obj should-disable?)) + (!= (-> obj should-disable?) #f) + ((-> obj should-disable?))) + (set-color! font-ctx (font-color font-color-32)) + (when (= option-index (-> *progress-pc-generic-store* current-menu-hover-index)) + (draw-generic-highlight (the int (+ -2.0 (-> font-ctx origin y))) HIGHLIGHT_SIZE (* 0.5 alpha)))) + ((= option-index (-> *progress-pc-generic-store* current-menu-hover-index)) + (set! (-> font-ctx color) (font-color font-color-33)) + (draw-generic-highlight (the int (- (-> font-ctx origin y) 2.0)) HIGHLIGHT_SIZE alpha))) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) font-ctx #f 44 (bucket-id hud-draw-hud-alpha)) + (+! (-> font-ctx origin y) 18.0) + (set! (-> font-ctx scale) 0.35) + (set! (-> font-ctx color) (font-color font-color-34)) + ;; the value + (cond + ((or (< (-> obj item-index) 0) (> (-> obj item-index) (num-items obj))) + (print-game-text (lookup-text! *common-text* (text-id progress-multiselect-no-items-found) #f) font-ctx #f 44 (bucket-id hud-draw-hud-alpha))) + ((and selected? (>= (-> obj item-index) 0) (< (-> obj item-index) (num-items obj))) + (format (clear *progress-generic-temp-string*) "~33L~C ~S ~33L~C" 163 (get-item-label obj (-> obj item-index)) 161) + (print-game-text *progress-generic-temp-string* font-ctx #f 44 (bucket-id hud-draw-hud-alpha))) + (else + (let ((actual-index (call-get-item-index-fn obj))) + (print-game-text (get-item-label obj actual-index) font-ctx #f 44 (bucket-id hud-draw-hud-alpha)))))) + (none)) + +(defun draw-generic-simple-string-option ((option menu-generic-option) (progress progress) (font-ctx font-context) (option-index int) (str string)) + (let ((alpha (* 2.0 (- 0.5 (-> progress menu-transition)))) + (line-height 23.0)) + (fmax! alpha 0.0) + (set! (-> font-ctx alpha) alpha) + (set-flags! font-ctx (font-flags kerning middle large)) + (set-scale! font-ctx FONT_SIZE_OPTION) + (+! (-> font-ctx origin y) (if (= (get-aspect-ratio) 'aspect4x3) 14.0 11.0)) + (cond + ((and (nonzero? (-> option should-disable?)) + (!= (-> option should-disable?) #f) + ((-> option should-disable?))) + (set-color! font-ctx (font-color font-color-44)) + (when (= option-index (-> *progress-pc-generic-store* current-menu-hover-index)) + (draw-generic-highlight (the int (+ -2.0 (-> font-ctx origin y))) HIGHLIGHT_SIZE (* 0.5 alpha)))) + ((= option-index (-> *progress-pc-generic-store* current-menu-hover-index)) + (set-color! font-ctx (font-color font-color-33)) + (draw-generic-highlight (the int (+ -2.0 (-> font-ctx origin y))) HIGHLIGHT_SIZE alpha)) + (else + (set-color! font-ctx (font-color font-color-32)))) + (print-game-text str font-ctx #f 44 (bucket-id hud-draw-hud-alpha))) + (none)) + +(defmethod draw-option ((obj menu-generic-link-option) (progress progress) (font-ctx font-context) (option-index int) (selected? symbol)) + (when (not (-> obj mounted?)) + (on-mount! obj)) + (draw-generic-simple-string-option obj progress font-ctx option-index (lookup-text! *common-text* (-> obj name) #f)) + (none)) + +(defmethod draw-option ((obj menu-generic-button-option) (progress progress) (font-ctx font-context) (option-index int) (selected? symbol)) + (when (not (-> obj mounted?)) + (on-mount! obj)) + (draw-generic-simple-string-option obj progress font-ctx option-index (lookup-text! *common-text* (-> obj name) #f)) + (none)) + +(defmethod draw-option ((obj menu-generic-confirm-option) (progress progress) (font-ctx font-context) (option-index int) (selected? symbol)) + (when (not (-> obj mounted?)) + (on-mount! obj)) + ;; drawn different depending on whether or not the confirmation prompt is open + (cond + (selected? + ;; TODO - this is duplicate code with the boolean option, but i ran out of arguments, make a struct or something later + (let ((alpha (* 2.0 (- 0.5 (-> progress menu-transition)))) + (line-height 18.0)) + (fmax! alpha 0.0) + (set! (-> font-ctx alpha) alpha) + (set-flags! font-ctx (font-flags kerning middle large)) + (set-scale! font-ctx FONT_SIZE_OPTION) + (+! (-> font-ctx origin y) (if (= (get-aspect-ratio) 'aspect4x3) 7.0 5.0)) + (cond + (selected? + (set-color! font-ctx (font-color font-color-33)) + (draw-generic-highlight (the int (- (-> font-ctx origin y) 2.0)) HIGHLIGHT_SIZE_LARGE alpha) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) font-ctx #f 44 (bucket-id hud-draw-hud-alpha)) + (+! (-> font-ctx origin y) line-height) + (set! *progress-generic-temp-string* (clear *progress-generic-temp-string*)) + (if (-> obj confirmed?) + (format *progress-generic-temp-string* "~33L~S~35L ~S" (lookup-text! *common-text* (text-id progress-yes) #f) (lookup-text! *common-text* (text-id progress-no) #f)) + (format *progress-generic-temp-string* "~35L~S ~33L~S~1L" (lookup-text! *common-text* (text-id progress-yes) #f) (lookup-text! *common-text* (text-id progress-no) #f)))) + ;; hover case + (else + (cond + ((and (nonzero? (-> obj should-disable?)) + (!= (-> obj should-disable?) #f) + ((-> obj should-disable?))) + (set-color! font-ctx (font-color font-color-32)) + (when (= option-index (-> *progress-pc-generic-store* current-menu-hover-index)) + (draw-generic-highlight (the int (+ -1.0 (-> font-ctx origin y))) HIGHLIGHT_SIZE (* 0.5 alpha)))) + ((= option-index (-> *progress-pc-generic-store* current-menu-hover-index)) + (set-color! font-ctx (font-color font-color-33)) + (draw-generic-highlight (the int (+ -1.0 (-> font-ctx origin y))) HIGHLIGHT_SIZE alpha)) + (else + (set-color! font-ctx (font-color font-color-34)))) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) font-ctx #f 44 (bucket-id hud-draw-hud-alpha)) + (+! (-> font-ctx origin y) line-height) + (set! *progress-generic-temp-string* (clear *progress-generic-temp-string*)) + (if (-> obj confirmed?) + (format *progress-generic-temp-string* "~1L~S~35L ~S" (lookup-text! *common-text* (text-id progress-yes) #f) (lookup-text! *common-text* (text-id progress-no) #f)) + (format *progress-generic-temp-string* "~35L~S ~1L~S~1L" (lookup-text! *common-text* (text-id progress-yes) #f) (lookup-text! *common-text* (text-id progress-no) #f))))) + (set-scale! font-ctx FONT_SIZE_OPTION_EXTRA) + (print-game-text *progress-generic-temp-string* font-ctx #f 44 (bucket-id hud-draw-hud-alpha)))) + (else + (draw-generic-simple-string-option obj progress font-ctx option-index (lookup-text! *common-text* (-> obj name) #f)))) + (none)) + +(defmethod draw-option ((obj menu-generic-slider-option) (arg0 progress) (font-ctx font-context) (option-index int) (selected? symbol)) + (when (not (-> obj mounted?)) + (on-mount! obj)) + (let ((alpha (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (slider-value (if selected? (-> obj value) (call-get-value-fn obj)))) + (set! (-> font-ctx alpha) alpha) + (set-scale! font-ctx FONT_SIZE_OPTION) + (+! (-> font-ctx origin y) 20.0) + (case (get-aspect-ratio) + (('aspect4x3)) + (('aspect16x9))) + (set-flags! font-ctx (font-flags kerning middle large)) + (cond + (selected? + (set-scale! font-ctx FONT_SIZE_OPTION_EXTRA) + (+! (-> font-ctx origin y) (if (= (get-aspect-ratio) 'aspect4x3) -15.0 -15.0)) + (set-color! font-ctx (font-color font-color-33)) + (draw-generic-highlight (the int (+ -2.0 (-> font-ctx origin y))) HIGHLIGHT_SIZE_LARGE alpha) + (if (= (-> obj show-decimal?) #t) + (print-game-text (string-format "~S: ~,,2f" (lookup-text! *common-text* (-> obj name) #f) slider-value) font-ctx #f 44 (bucket-id hud-draw-hud-alpha)) + (print-game-text (string-format "~S: ~D" (lookup-text! *common-text* (-> obj name) #f) slider-value) font-ctx #f 44 (bucket-id hud-draw-hud-alpha))) + (set! (-> obj bar-sprite tex) (get-texture hud-sliderbackground progress-minimap)) + (set! (-> obj bar-sprite scale-x) 2.0) + (set! (-> obj bar-sprite scale-y) 0.5) + (let ((sprite-color-0 (-> obj bar-sprite color-ptr))) + (set! (-> sprite-color-0 0) 128) + (set! (-> sprite-color-0 1) 128) + (set! (-> sprite-color-0 2) 128) + (set! (-> sprite-color-0 3) 128) + ) + (set! (-> obj bar-sprite pos z) #x3fffff) + (set! (-> obj bar-sprite pos w) 0) + (set! (-> obj bar-cursor-sprite tex) (get-texture hud-sliderframe progress-minimap)) + (set! (-> obj bar-cursor-sprite scale-x) 0.2) + (set! (-> obj bar-cursor-sprite scale-y) 1.0) + (let ((sprite-color-1 (-> obj bar-cursor-sprite color-ptr))) + (set! (-> sprite-color-1 0) 128) + (set! (-> sprite-color-1 1) 128) + (set! (-> sprite-color-1 2) 128) + (set! (-> sprite-color-1 3) 128) + ) + (set! (-> obj bar-cursor-sprite pos z) #x3fffff) + (set! (-> obj bar-cursor-sprite pos w) 0) + ;; bar + (set-hud-piece-position! (-> obj bar-sprite) (the int (adjust-game-x 135.0)) (+ (the int (-> font-ctx origin y)) (if (= (get-aspect-ratio) 'aspect4x3) 18 15))) + ;; calculate the percentage of the bar based on the range + ;; (actual + abs(range-min)) / (range-max + abs(range-min)) = percentage + (let* ((percentage (/ (+ slider-value (fabs (-> obj min-value))) + (+ (-> obj max-value) (fabs (-> obj min-value))))) + ;; cursor (135 -> 365) = 230 pixels + (cursor-x-pos (adjust-game-x-int (+ 135 (* (if (= (get-aspect-ratio) 'aspect4x3) 230.0 231.0) percentage)))) + (bar-remainder (- (adjust-game-x-int 365) cursor-x-pos))) + ;; cursor position + (set-hud-piece-position! (-> obj bar-cursor-sprite) cursor-x-pos (+ (the int (-> font-ctx origin y)) (if (= (get-aspect-ratio) 'aspect4x3) 14 11))) + (with-dma-buffer-add-bucket ((buffer (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id hud-draw-hud-alpha)) + (draw (-> obj bar-sprite) buffer (-> *level* level-default) #t) + ;; bar mask + ;; TODO - bar remainder isnt correct on custom aspect ratios since those internally still return `aspect4x3` for (get-aspect-ratio), this is a larger issue though + ;; perhaps just standardize menu size in general and ditch aspect ratio differences. + (draw-sprite2d-xy buffer (+ cursor-x-pos 10) (+ (the int (-> font-ctx origin y)) (if (= (get-aspect-ratio) 'aspect4x3) 23 20)) (+ bar-remainder (if (= (get-aspect-ratio) 'aspect4x3) 9 6)) 6 + (new 'static 'rgba :r (the int (* 0.0 alpha slider-value)) + :g (the int (* 0.0 alpha slider-value)) + :b (the int (* 0.0 alpha slider-value)) + :a (the int (* 128.0 alpha))) + #x3fffff) + (draw (-> obj bar-cursor-sprite) buffer (-> *level* level-default) #t)))) + (else + (+! (-> font-ctx origin y) -8.0) + (cond + ((and (nonzero? (-> obj should-disable?)) + (!= (-> obj should-disable?) #f) + ((-> obj should-disable?))) + (set-color! font-ctx (font-color font-color-44)) + (when (= option-index (-> *progress-pc-generic-store* current-menu-hover-index)) + (draw-generic-highlight (the int (+ -1.0 (-> font-ctx origin y))) HIGHLIGHT_SIZE (* 0.5 alpha)))) + ((= option-index (-> *progress-pc-generic-store* current-menu-hover-index)) + (set-color! font-ctx (font-color font-color-33)) + (draw-generic-highlight (the int (+ -2.0 (-> font-ctx origin y))) HIGHLIGHT_SIZE alpha)) + (else + (set-color! font-ctx (font-color font-color-32)))) + (if (= (-> obj show-decimal?) #t) + (print-game-text (string-format "~S: ~,,2f" (lookup-text! *common-text* (-> obj name) #f) slider-value) font-ctx #f 44 (bucket-id hud-draw-hud-alpha)) + (print-game-text (string-format "~S: ~D" (lookup-text! *common-text* (-> obj name) #f) slider-value) font-ctx #f 44 (bucket-id hud-draw-hud-alpha))))) + ) + (none)) + +(defmethod draw-option ((obj menu-generic-details-page) (progress progress) (font-ctx font-context) (option-index int) (selected? symbol)) + (when (or (zero? (-> obj mounted?)) (not (-> obj mounted?))) + (on-mount! obj)) + ;; the list has a total of 200px of y-height + ;; with 10px of margin at the top and bottom, that leaves 180 / 4 = 45px per item + ;; it's the responsibility of each generic component to center itself within these 45px lines + (when (not (-> *progress-pc-generic-store* clear-screen?)) + (let* ((font-alpha (fmax 0.0 (* 2.0 (- 0.5 (-> progress menu-transition))))) + (hud-bounds (new 'stack-no-clear 'hud-box)) + (max-page-size (if (= (get-aspect-ratio) 'aspect16x9) 12 10)) + (margin-top-bottom 0.0) + (line-height (/ (if (= (get-aspect-ratio) 'aspect16x9) 253.0 200.0) max-page-size))) + (set! (-> font-ctx alpha) font-alpha) + (set-color! font-ctx (font-color font-color-32)) + ;; header + (draw-page-header font-ctx (-> obj name) font-alpha) + ;; background borders + (draw-page-border (-> obj box 0) font-alpha) + ;; background + (draw-page-background font-alpha) + (begin-scissor-scrolling-page hud-bounds) + (if (= (get-aspect-ratio) 'aspect16x9) + (set! (-> font-ctx origin y) (+ 86.0 margin-top-bottom)) + (set! (-> font-ctx origin y) (+ 112.0 margin-top-bottom))) + ;; render items + (let* ((entry-index (max 0 (* (/ (-> *progress-pc-generic-store* current-menu-hover-index) max-page-size) max-page-size))) + (end-index (min (-> obj entries length) (+ entry-index max-page-size)))) + (while (< entry-index end-index) + (let ((entry (-> obj entries entry-index))) + (when (nonzero? entry) + ;; save the y,x position as who knows where it will end up after the component finishes rendering + (let ((old-y-pos (-> font-ctx origin y)) + (old-x-pos (-> font-ctx origin x))) + (draw-option entry progress font-ctx entry-index + (= (-> obj selected-entry-index) entry-index)) + ;; move to the next line + (set! (-> font-ctx origin y) (+ old-y-pos line-height)) + ;; - debugging, draw the dividing lines to make center new items easier + (draw-generic-page-row-line (the int (-> font-ctx origin y))) + (set! (-> font-ctx origin x) old-x-pos) + ;; reset the font color + (set-color! font-ctx (font-color font-color-32))))) + (+! entry-index 1))) + ;; end + (end-scissor-scrolling-page hud-bounds 1.0) + (set-flags! font-ctx (font-flags kerning large)) + (let* ((draw-up-arrow? (and (not (zero? (-> *progress-pc-generic-store* current-menu-hover-index))) + (>= (-> *progress-pc-generic-store* current-menu-hover-index) max-page-size))) + (last-page-remainder (mod (-> obj entries length) max-page-size)) + (last-page-starting-index (if (zero? last-page-remainder) + (- (-> obj entries length) max-page-size) + (- (-> obj entries length) last-page-remainder))) + (draw-down-arrow? (and (> (-> obj entries length) max-page-size) + (< (-> *progress-pc-generic-store* current-menu-hover-index) last-page-starting-index)))) + (draw-scrolling-page-up-down-arrows font-ctx draw-up-arrow? draw-down-arrow?)))) + (none)) + +(defmethod draw-option ((obj menu-generic-details-keybind-entry) (progress progress) (font-ctx font-context) (option-index int) (selected? symbol)) + (when (or (zero? (-> obj mounted?)) (not (-> obj mounted?))) + (on-mount! obj)) + ;; TODO - implement `should-disable?` if it's ever relevant (its not right now) + (let ((alpha (* 2.0 (- 0.5 (-> progress menu-transition)))) + (line-height 23.0)) + (fmax! alpha 0.0) + (set! (-> font-ctx alpha) alpha) + (set-scale! font-ctx 0.40) + (cond + ((= option-index (-> *progress-pc-generic-store* current-menu-hover-index)) + (set-color! font-ctx (font-color font-color-33)) + (draw-generic-highlight (the int (+ 2.0 (-> font-ctx origin y))) 18 alpha)) + (else + (set-color! font-ctx (font-color font-color-32)))) + ;; Print left aligned text + (set-flags! font-ctx (font-flags kerning middle-vert large)) + (-! (-> font-ctx origin y) 1.0) + (set! (-> font-ctx origin x) (the float (adjust-game-x (if (= (get-aspect-ratio) 'aspect16x9) 25.0 80.0)))) + (print-game-text (get-keybind-string obj) font-ctx #f 44 (bucket-id hud-draw-hud-alpha)) + ;; Now print the right aligned text + (set! (-> font-ctx origin x) (the float (adjust-game-x (if (= (get-aspect-ratio) 'aspect16x9) 490.0 438.0)))) + (+! (-> font-ctx origin y) 6.0) + (set-flags! font-ctx (font-flags kerning right large)) + (let ((bind (pc-get-current-bind (-> obj bind-info) *pc-cpp-temp-string*))) + (cond + (selected? + (print-game-text (string-format "~S...(~Ds)" (lookup-text! *common-text* (text-id progress-keybinds-waiting-for-bind) #f) + (inc (/ (- (seconds 5) (- (current-time) (-> *progress-pc-generic-store* keybind-select-time))) TICKS_PER_SECOND))) + font-ctx #f 44 (bucket-id hud-draw-hud-alpha))) + ((not bind) + (print-game-text (lookup-text! *common-text* (text-id progress-keybinds-unset) #f) font-ctx #f 44 (bucket-id hud-draw-hud-alpha))) + ((string= *pc-cpp-temp-string* "unknown") + (print-game-text (lookup-text! *common-text* (text-id progress-unknown-option) #f) font-ctx #f 44 (bucket-id hud-draw-hud-alpha))) + (else + (print-game-text *pc-cpp-temp-string* font-ctx #f 44 (bucket-id hud-draw-hud-alpha)))))) + (none)) + +(defmethod draw-option ((obj menu-generic-details-confirm-entry) (progress progress) (font-ctx font-context) (option-index int) (selected? symbol)) + (when (or (zero? (-> obj mounted?)) (not (-> obj mounted?))) + (on-mount! obj)) + ;; TODO - implement `should-disable?` if it's ever relevant (its not right now) + (let ((alpha (* 2.0 (- 0.5 (-> progress menu-transition)))) + (line-height 23.0)) + (fmax! alpha 0.0) + (set! (-> font-ctx alpha) alpha) + (set-scale! font-ctx 0.40) + (cond + ((= option-index (-> *progress-pc-generic-store* current-menu-hover-index)) + (set-color! font-ctx (font-color font-color-33)) + (draw-generic-highlight (the int (+ 2.0 (-> font-ctx origin y))) 18 alpha)) + (else + (set-color! font-ctx (font-color font-color-32)))) + ;; Print left aligned text + (set-flags! font-ctx (font-flags kerning middle-vert large)) + (-! (-> font-ctx origin y) 1.0) + (set! (-> font-ctx origin x) (the float (adjust-game-x (if (= (get-aspect-ratio) 'aspect16x9) 25.0 80.0)))) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) font-ctx #f 44 (bucket-id hud-draw-hud-alpha)) + (when selected? + ;; Now print the right aligned text, if the option is selected + (set! (-> font-ctx origin x) (the float (adjust-game-x (if (= (get-aspect-ratio) 'aspect16x9) 430.0 438.0)))) + (+! (-> font-ctx origin y) 6.0) + (set-flags! font-ctx (font-flags kerning right large)) + (clear *progress-generic-temp-string*) + (if (-> obj confirmed?) + (format *progress-generic-temp-string* "~33L~S~35L ~S" (lookup-text! *common-text* (text-id progress-yes) #f) (lookup-text! *common-text* (text-id progress-no) #f)) + (format *progress-generic-temp-string* "~35L~S ~33L~S~1L" (lookup-text! *common-text* (text-id progress-yes) #f) (lookup-text! *common-text* (text-id progress-no) #f))) + (print-game-text *progress-generic-temp-string* font-ctx #f 44 (bucket-id hud-draw-hud-alpha)))) + (none)) + + +(defmethod draw-option ((obj menu-generic-to-resolutions-option) (progress progress) (font-ctx font-context) (option-index int) (selected? symbol)) + ;; change the name depending on whether we're fullscreen or not + (cond + ((and (= (-> obj name) (text-id progress-window-size)) (fullscreen?)) + (set! (-> obj name) (text-id progress-game-res))) + ((and (= (-> obj name) (text-id progress-game-res)) (not (fullscreen?))) + (set! (-> obj name) (text-id progress-window-size)))) + (call-parent-method obj progress font-ctx option-index selected?)) + diff --git a/goal_src/jak3/pc/progress/progress-generic-h-pc.gc b/goal_src/jak3/pc/progress/progress-generic-h-pc.gc new file mode 100644 index 0000000000..2c6608a76f --- /dev/null +++ b/goal_src/jak3/pc/progress/progress-generic-h-pc.gc @@ -0,0 +1,279 @@ +;;-*-Lisp-*- +(in-package goal) + + +(deftype generic-progress-state-entry (structure) + "All info that is pushed onto a 'stack' when navigating to a sub-menu with + the new generic menu options" + (;; what needs to be drawn now, the normal progress code figures this out with a hard-coded switch statement, this avoids that + (ref menu-option-list) + ;; generic function to potentially run some setup code when the entry is loaded + (on-load (function none)) + ;; so we can restore back to the same menu position + (hover-index int32) + (scroll-index int32) + ;; symbol used normally for progress stuff + (progress-id symbol)) + (:methods + (call-on-load (_type_) none))) + +(deftype progress-pc-generic-store (structure) + "Isolated type for keeping track of some global state, as re-using the normal [[*progress*]] object + can lead to unexpected behaviour -- they change some values all over the place" + ((current-menu-hover-index int32) + (current-menu-scroll-index float) + (clear-screen? symbol) + (keybind-select-time time-frame) + (history-stack generic-progress-state-entry 10 :inline) + (history-stack-index int32) + (current-highscore-page-index int32) + (custom-highscore-score float) ;; TODO - just needed a way to pass a `(pointer float)` to C++, didn't seem like you could do such a thing with a `let` binding? + ) + (:methods + (init! (_type_) none) + (navigate! (_type_ progress menu-option-list (function none)) none) + (back! (_type_ progress) none) + (has-history? (_type_) symbol) + (clear-history-if-empty! (_type_) none) + (clear-history! (_type_) none))) + +(define *progress-pc-generic-store* (new 'static 'progress-pc-generic-store)) + +(deftype menu-generic-option (menu-option) + ((mounted? symbol) + (should-disable? (function symbol))) + (:methods + (on-mount! "Called when the menu item is first drawn as a means to initialize defaults, etc" (_type_) none) + (should-disable? (_type_) symbol))) + +(deftype menu-generic-button-option (menu-generic-option) + "A button option that run its action when selected" + (;; props + (on-confirm (function progress none))) + (:methods + (call-on-confirm (_type_ progress) none))) + +(deftype menu-generic-scrolling-page (menu-generic-option) + "A menu option that holds menu options" + (;; props + (menu-options (array menu-option)) + ;; state + (selected-option-index int32) + (last-move time-frame))) + +(deftype menu-generic-link-option (menu-generic-option) + "A very simple link option that allows you to link to any other [[menu-option-list]]" + (;; props + (target menu-option-list) + ;; generic function to potentially run some setup code when the entry is loaded + ;; this is not called from the link option, but rather stored in the history entry + (on-load (function none)))) + +(deftype menu-generic-boolean-option (menu-generic-option) + "Generic two option menu entry (ie. yes/no)" + (;; props + (truthy-text text-id) + (falsey-text text-id) + ;; state + (value symbol) + ;; lambdas + (get-value-fn (function symbol)) + (on-confirm (function symbol none))) + (:methods + (call-get-value-fn (_type_) symbol) + (call-on-confirm (_type_ symbol) none))) + +(deftype menu-generic-carousel-option (menu-generic-option) + "Generic left-right menu entry (ie. language selection)" + (;; props + ;; - either you can provide a list of hard-coded items (takes precedence) + (items (array text-id)) + ;; - or you can provide functions that return the max-size and the string labels at those indicies + (get-max-size-fn (function int)) + (get-item-label-fn (function int string)) + (no-items-label text-id) ;; TODO - implement if `progress-multiselect-no-items-found` isn't ever sufficient + ;; state + (item-index int32) + ;; lambdas + (get-item-index-fn (function int)) + (on-confirm (function int progress none))) + (:methods + (num-items (_type_) int) + (get-item-label (_type_ int) string) + (call-get-item-index-fn (_type_) int) + (call-on-confirm (_type_ int progress) none))) + +(deftype menu-generic-confirm-option (menu-generic-option) + "A button option that confirms before triggering it's action" + (;; props + (on-confirm (function none)) + ;; state + (confirmed? symbol)) + (:methods + (call-on-confirm (_type_) none))) + +(deftype menu-generic-slider-option (menu-generic-option) + "A generic slider, can go into the negative as well." + (;; props + (min-value float) + (max-value float) + (step float) + (show-decimal? symbol) + ;; state + (value float) + (bar-sprite hud-sprite :inline) + (bar-cursor-sprite hud-sprite :inline) + (last-sound-played time-frame) + ;; lambdas + (get-value-fn (function float)) + (on-confirm (function float none))) + (:methods + (call-get-value-fn (_type_) float) + (call-on-confirm (_type_ float) none))) + +(deftype menu-generic-details-entry (menu-generic-option) + "A generic details list entry" + ()) + +(deftype menu-generic-to-resolutions-option (menu-generic-button-option) + "Specialization of a generic button option" + ()) + +(defenum controller-keybind + :type int8 + (select 0) + (l3 1) + (r3 2) + (start 3) + (dpad-up 4) + (dpad-right 5) + (dpad-down 6) + (dpad-left 7) + (l2 8) + (r2 9) + (l1 10) + (r1 11) + (triangle 12) + (circle 13) + (cross 14) + (square 15) + (l-analog-up 16) + (l-analog-down 17) + (l-analog-left 18) + (l-analog-right 19) + (r-analog-up 20) + (r-analog-down 21) + (r-analog-left 22) + (r-analog-right 23)) + +(defenum input-device-type + :type int8 + (controller 0) + (keyboard 1) + (mouse 2)) + +(deftype menu-generic-details-keybind-entry (menu-generic-details-entry) + ((keybind controller-keybind) + (device-type input-device-type) + ;; state + (bind-info bind-assignment-info :inline)) + (:methods + (get-keybind-string (_type_) string))) + +(deftype menu-generic-details-confirm-entry (menu-generic-details-entry) + (;; props + (on-confirm (function none)) + ;; state + (confirmed? symbol)) + (:methods + (call-on-confirm (_type_) none))) + +(deftype menu-generic-details-page (menu-generic-option) + "A generic details list page, compact rows that can be selected. + This is very similar to the [[menu-generic-scrolling-page]] component but instead of holding + [[menu-option]]s, it holds [[menu-generic-details-entry]]'s" + ((entries (array menu-generic-details-entry)) + ;; state + (selected-entry-index int32) + (last-move time-frame))) + +(defmacro progress-new-generic-option (option) + `(new 'static 'menu-option-list :options (new 'static 'boxed-array :type menu-option ,option))) + +(defmacro progress-new-generic-scrolling-page (title &rest options) + `(new 'static 'menu-option-list + :options (new 'static 'boxed-array :type menu-option + (new 'static 'menu-generic-scrolling-page + :name ,title + :menu-options (new 'static 'boxed-array :type menu-option + ,@options))))) + +(defmacro progress-new-generic-link (text target &key (should-disable? #f)) + `(new 'static 'menu-generic-link-option + :name ,text + :should-disable? ,should-disable? + :target ,target)) + +(defmacro progress-new-generic-link-to-page (title &key (should-disable? #f) &rest options) + `(new 'static 'menu-generic-link-option + :name ,title + :should-disable? ,should-disable? + :target (new 'static 'menu-option-list + :options (new 'static 'boxed-array :type menu-option + ,@options)))) + +(defmacro progress-new-generic-link-to-scrolling-page (title &key (should-disable? #f) &rest options) + `(new 'static 'menu-generic-link-option + :name ,title + :should-disable? ,should-disable? + :target (new 'static 'menu-option-list + :options (new 'static 'boxed-array :type menu-option + (new 'static 'menu-generic-scrolling-page + :name ,title + :menu-options (new 'static 'boxed-array :type menu-option + ,@options)))))) + +(defmacro progress-new-generic-link-to-keybind-details-page (title &key (should-disable? #f) &key device-type &key entries &key confirm) + `(new 'static 'menu-generic-link-option + :name ,title + :should-disable? ,should-disable? + :target (new 'static 'menu-option-list + :options (new 'static 'boxed-array :type menu-option + (new 'static 'menu-generic-details-page + :name ,title + :entries (new 'static 'boxed-array :type menu-generic-details-entry + ,@(apply (lambda (x) `(new 'static 'menu-generic-details-keybind-entry :keybind (controller-keybind ,x) :device-type (input-device-type ,device-type))) entries) + (new 'static 'menu-generic-details-confirm-entry :name ,(first confirm) :on-confirm ,(second confirm)))))))) + +(defmacro static-progress-generic-pc-settings-lod-default-high-boolean (name field) + `(new 'static 'menu-generic-boolean-option + :name ,name + :truthy-text (text-id progress-lod-default) + :falsey-text (text-id progress-lod-high) + :get-value-fn (lambda () ,field) + :on-confirm (lambda ((val symbol)) + (set! ,field val) + (pc-settings-save)))) + +(defmacro static-progress-generic-pc-settings-on-off-boolean (name field) + `(new 'static 'menu-generic-boolean-option + :name ,name + :truthy-text (text-id progress-on) + :falsey-text (text-id progress-off) + :get-value-fn (lambda () ,field) + :on-confirm (lambda ((val symbol)) + (set! ,field val) + (pc-settings-save)))) + +(defmacro static-progress-generic-pc-settings-shadows-normal-extended-boolean (name field) + `(new 'static 'menu-generic-boolean-option + :name ,name + :truthy-text (text-id progress-shadows-normal) + :falsey-text (text-id progress-shadows-extended) + :get-value-fn (lambda () ,field) + :on-confirm (lambda ((val symbol)) + (set! ,field val) + (pc-settings-save)))) + +(define *progress-generic-temp-string* (new 'global 'string 512 (the string #f))) + diff --git a/goal_src/jak3/pc/progress/progress-generic-pc.gc b/goal_src/jak3/pc/progress/progress-generic-pc.gc new file mode 100644 index 0000000000..9eeb7609c5 --- /dev/null +++ b/goal_src/jak3/pc/progress/progress-generic-pc.gc @@ -0,0 +1,589 @@ +;;-*-Lisp-*- +(in-package goal) + +(defmethod call-on-load ((this generic-progress-state-entry)) + (when (and (nonzero? (-> this on-load)) (!= (-> this on-load) #f)) + ((-> this on-load))) + (none)) + +(defmethod call-get-value-fn ((this menu-generic-boolean-option)) + (if (and (nonzero? (-> this get-value-fn)) (!= (-> this get-value-fn) #f)) + ((-> this get-value-fn)) + #f)) + +(defmethod call-on-confirm ((this menu-generic-boolean-option) (val symbol)) + (when (and (nonzero? (-> this on-confirm)) (!= (-> this on-confirm) #f)) + ((-> this on-confirm) val)) + (none)) + +(defmethod call-get-item-index-fn ((this menu-generic-carousel-option)) + (if (and (nonzero? (-> this get-item-index-fn)) (!= (-> this get-item-index-fn) #f)) + ((-> this get-item-index-fn)) + 0)) + +(defmethod call-on-confirm ((this menu-generic-carousel-option) (val int) (the-progress progress)) + (when (and (nonzero? (-> this on-confirm)) (-> this on-confirm)) + ((-> this on-confirm) val the-progress)) + (none)) + +(defmethod call-on-confirm ((this menu-generic-button-option) (the-progress progress)) + (when (and (nonzero? (-> this on-confirm)) (-> this on-confirm)) + ((-> this on-confirm) the-progress)) + (none)) + +(defmethod call-on-confirm ((this menu-generic-confirm-option)) + (when (and (nonzero? (-> this on-confirm)) (!= (-> this on-confirm) #f)) + ((-> this on-confirm))) + (none)) + +(defmethod call-get-value-fn ((this menu-generic-slider-option)) + (if (and (nonzero? (-> this get-value-fn)) (!= (-> this get-value-fn) #f)) + ((-> this get-value-fn)) + 0.0)) + +(defmethod call-on-confirm ((this menu-generic-slider-option) (val float)) + (when (and (nonzero? (-> this on-confirm)) (!= (-> this on-confirm) #f)) + ((-> this on-confirm) val)) + (none)) + +(defmethod init! ((this progress-pc-generic-store)) + (set! (-> this clear-screen?) #f) + (set! (-> this keybind-select-time) 0) + (set! (-> this current-highscore-page-index) 0) + (none)) + +(defmethod call-on-confirm ((this menu-generic-details-confirm-entry)) + (when (and (nonzero? (-> this on-confirm)) (!= (-> this on-confirm) #f)) + ((-> this on-confirm))) + (none)) + +(defmethod navigate! ((this progress-pc-generic-store) (progress progress) (target menu-option-list) (on-load (function none))) + (when (< (-> this history-stack-index) 9) ;; hard-coded length + ;; if this is the first history entry, we push the current page as well + ;; if it's not, then we update the current entry before proceeding to the next page + (if (has-history? this) + (let ((stack-entry (-> this history-stack (-> this history-stack-index)))) + (set! (-> stack-entry hover-index) (-> this current-menu-hover-index)) + (set! (-> stack-entry scroll-index) (the int (-> this current-menu-scroll-index))) + (set! (-> stack-entry progress-id) (-> progress current))) + (let ((stack-entry (-> this history-stack (-> this history-stack-index)))) + (set! (-> stack-entry ref) (-> progress current-options)) + (set! (-> stack-entry on-load) on-load) + (set! (-> stack-entry hover-index) (-> this current-menu-hover-index)) + (set! (-> stack-entry scroll-index) (the int (-> this current-menu-scroll-index))) + (set! (-> stack-entry progress-id) (-> progress current)))) + ;; push the target history entry now + (inc! (-> this history-stack-index)) + ;; Create a new stack entry + (let ((stack-entry (-> this history-stack (-> this history-stack-index)))) + (set! (-> stack-entry ref) target) + (set! (-> stack-entry on-load) on-load) + (set! (-> stack-entry hover-index) 0) + (set! (-> stack-entry progress-id) 'generic-menu)) + ;; Update global state + (set! (-> this clear-screen?) #t) + (set! (-> progress next) 'generic-menu) + (set! (-> progress selected-option) #f)) + (none)) + +(defmethod back! ((this progress-pc-generic-store) (progress progress)) + (set! (-> this history-stack-index) (max 0 (dec (-> this history-stack-index)))) + (set! (-> this clear-screen?) #t) + (set! (-> progress next) 'generic-menu) + (set! (-> progress selected-option) #f) + (none)) + +(defmethod has-history? ((this progress-pc-generic-store)) + (> (-> this history-stack-index) 0)) + +(defmethod clear-history-if-empty! ((this progress-pc-generic-store)) + "if we have no history, just reset the entry. This is so we don't preserve state after completely exiting the menu" + (when (not (has-history? this)) + (set! (-> this history-stack-index) 0) + (set! (-> this clear-screen?) #f) + (set! (-> this current-menu-hover-index) 0) + (set! (-> this current-menu-scroll-index) 0.0) + (let ((stack-entry (-> this history-stack (-> this history-stack-index)))) + (set! (-> stack-entry hover-index) 0) + (set! (-> stack-entry ref) #f) + (set! (-> stack-entry on-load) #f) + (set! (-> stack-entry progress-id) #f))) + (none)) + +(defmethod clear-history! ((this progress-pc-generic-store)) + (set! (-> this history-stack-index) 0) + (set! (-> this clear-screen?) #t) + (set! (-> this current-menu-hover-index) 0) + (set! (-> this current-menu-scroll-index) 0.0) + (none)) + +(defmethod on-mount! ((this menu-generic-option)) + (set! (-> this mounted?) #t) + (none)) + +;; TODO - call the parent methods, when there is an elegant way to do so (not having to know the ID) + +(defmethod on-mount! ((this menu-generic-carousel-option)) + (set! (-> this mounted?) #t) + (set! (-> this item-index) 0) + (none)) + +(defmethod on-mount! ((this menu-generic-scrolling-page)) + (set! (-> this mounted?) #t) + (set! (-> this selected-option-index) -1) + (none)) + +(defmethod on-mount! ((this menu-generic-details-page)) + (set! (-> this mounted?) #t) + (set! (-> this selected-entry-index) -1) + (none)) + +(defmethod on-mount! ((this menu-generic-confirm-option)) + (set! (-> this mounted?) #t) + (set! (-> this confirmed?) #f) + (none)) + +(defun controller-keybind->input-index ((bind controller-keybind)) + (case bind + (((controller-keybind l-analog-up)) 1) + (((controller-keybind l-analog-down)) 1) + (((controller-keybind l-analog-left)) 0) + (((controller-keybind l-analog-right)) 0) + (((controller-keybind r-analog-up)) 3) + (((controller-keybind r-analog-down)) 3) + (((controller-keybind r-analog-left)) 2) + (((controller-keybind r-analog-right)) 2) + (else (the int bind)))) + +(defmethod on-mount! ((this menu-generic-details-keybind-entry)) + (set! (-> this mounted?) #t) + (set! (-> this bind-info port) 0) ;; always port 0 for now + (set! (-> this bind-info device-type) (the int (-> this device-type))) + (set! (-> this bind-info for-buttons?) #t) + (set! (-> this bind-info analog-min-range?) #f) + (set! (-> this bind-info input-idx) (controller-keybind->input-index (-> this keybind))) + (case (-> this keybind) + (((controller-keybind l-analog-up) (controller-keybind l-analog-down) (controller-keybind l-analog-left) (controller-keybind l-analog-right) + (controller-keybind r-analog-up) (controller-keybind r-analog-down) (controller-keybind r-analog-left) (controller-keybind r-analog-right)) + (set! (-> this bind-info for-buttons?) #f) + (case (-> this keybind) + (((controller-keybind l-analog-up) (controller-keybind l-analog-left) (controller-keybind r-analog-up) (controller-keybind r-analog-left)) + (set! (-> this bind-info analog-min-range?) #t))))) + (none)) + +;; Progress Code Overrides + +(defmethod respond-to-cpad ((this progress)) + (mc-get-slot-info 0 *progress-save-info*) + (memcard-unlocked-secrets? this #f) + ;; ND originally did this...called this every frame in the game options, looked like a hack + ;; there's probably a way to consistently do it synchronously + (load-level-text-files (the-as int (-> *pc-settings* text-language))) + (when (-> this current-options) + (let ((option-array (-> this current-options options)) + (has-generic-history? (has-history? *progress-pc-generic-store*))) + (when (and option-array (= (-> this menu-transition) 0.0)) + (let ((in-generic-page? (and (= (-> option-array length) 1) + (or (type? (-> option-array 0) menu-generic-scrolling-page) + (type? (-> option-array 0) menu-generic-details-page))))) + (cond + ;; If it's a scrolling menu, we have to pull from it's list of items + (in-generic-page? + ;; update the scrolling list + (respond-progress + (the-as menu-option (-> option-array 0)) + this + (and (= (-> this menu-transition) 0.0) (-> this selected-option)))) + ;; Do a bounds check to avoid crashing + ((>= (-> this option-index) (-> option-array length)) + (format 0 "respond-to-cpad:progress: Option index ~D out of bounds~%" (-> this option-index))) + (else + (respond-progress + (the-as menu-option (-> option-array (-> this option-index))) + this + (and (= (-> this menu-transition) 0.0) (-> this selected-option))))) + (cond + ((-> this selected-option) + (cond + ((cpad-pressed? 0 confirm) + (set! (-> this selected-option) #f) + ) + ((cpad-pressed? 0 triangle) + (when (not in-generic-page?) + (if (= (-> this current-options) *main-options*) + (sound-play "window-contract") + (sound-play "generic-beep"))) + (set! (-> this selected-option) #f)))) + (else + (cond + ((cpad-pressed? 0 up l-analog-up) + (cond + ((= (-> this current-options) *main-options*) + (sound-play "ring-select")) + ((!= (length option-array) 1) + (sound-play "roll-over"))) + ;; skip over hidden secrets menu + (if (and (= *title-pc* (-> this current-options)) (not (memcard-unlocked-secrets? #f #f)) (= (-> this option-index) 3)) + (set! (-> this option-index) 3)) + (cond + ((> (-> this want-option-index) 0) + (set! (-> this want-option-index) -1)) + ((< -2 (-> this want-option-index)) + (+! (-> this want-option-index) -1)))) + ((cpad-pressed? 0 down l-analog-down) + (cond + ((= (-> this current-options) *main-options*) + (sound-play "ring-select")) + ((!= (length option-array) 1) + (sound-play "roll-over"))) + ;; skip over hidden secrets menu + (if (and (= *title-pc* (-> this current-options)) (not (memcard-unlocked-secrets? #f #f)) (= (-> this option-index) 2)) + (set! (-> this option-index) 3)) + (cond + ((< (-> this want-option-index) 0) + (set! (-> this want-option-index) 1)) + ((< (-> this want-option-index) 2) + (+! (-> this want-option-index) 1)))) + ((cpad-pressed? 0 confirm) + (cpad-clear! 0 confirm) + (when (and (not in-generic-page?) + (not (-> this clear-screen))) + (sound-play "generic-beep")) + ;; don't "select" the page link + (when (!= (-> this next) 'generic-menu) + (set! (-> this selected-option) #t))) + ((cpad-pressed? 0 triangle) + ;; if we are within a generic managed menu option, handle the stack elsewhere + ;; TODO - this likely has issues if we have a nested-non-generic menu, but deal with that use-case if it's ever + ;; actually employed + (when (and (not has-generic-history?) (can-go-back? this)) + (cpad-clear! 0 triangle) + (if (and (= (-> this starting-state) 'main) (!= (-> this current-options) *main-options*)) + (sound-play "window-contract") + (sound-play "generic-beep")) + (clear-history-if-empty! *progress-pc-generic-store*) + (pop-state this)))))))))) + (none)) + +;; Component implementation + +;; - input handling + +(defmethod respond-progress ((this menu-generic-scrolling-page) (progress progress) (selected? symbol)) + "Handle progress menu navigation logic." + (let ((selected-item? #f)) + (if (= (-> this selected-option-index) -1) + (cond + ((or (cpad-pressed? 0 down l-analog-down) + (and (cpad-hold? 0 down l-analog-down) + (>= (- (current-time) (the-as int (-> this last-move))) (seconds 0.2)))) + (set! (-> this last-move) (current-time)) + (cond + ((< (-> *progress-pc-generic-store* current-menu-hover-index) (dec (-> this menu-options length))) + (+! (-> *progress-pc-generic-store* current-menu-hover-index) 1) + (sound-play "roll-over")) + (else + (set! (-> *progress-pc-generic-store* current-menu-hover-index) 0) + (sound-play "roll-over")))) + ((or (cpad-pressed? 0 up l-analog-up) + (and (cpad-hold? 0 up l-analog-up) + (>= (- (current-time) (the-as int (-> this last-move))) (seconds 0.2)))) + (set! (-> this last-move) (current-time)) + (+! (-> *progress-pc-generic-store* current-menu-hover-index) -1) + (sound-play "roll-over") + (when (< (-> *progress-pc-generic-store* current-menu-hover-index) 0) + (set! (-> *progress-pc-generic-store* current-menu-hover-index) (dec (-> this menu-options length))))) + ((cpad-pressed? 0 confirm) + (when (< (-> *progress-pc-generic-store* current-menu-hover-index) (-> this menu-options length)) + (let ((menu-option (-> this menu-options (-> *progress-pc-generic-store* current-menu-hover-index)))) + ;; if the option is disabled, return early + (when (and (type? menu-option menu-generic-option) + (nonzero? (-> (the-as menu-generic-option menu-option) should-disable?)) + (!= (-> (the-as menu-generic-option menu-option) should-disable?) #f) + ((-> (the-as menu-generic-option menu-option) should-disable?))) + (sound-play "roll-over") + (cpad-clear! 0 confirm) + (return 0)) + ;; ignore confirm if it's a link + (cond + ;; TODO the condition for menu-generic-to-resolutions-option shouldn't be required if it + ;; followed the existing pattern of being a page that contains options, instead of a single option that is a page + ;; There are already components that do a similar thing (see menu-generic-details-page) + ((or (type? menu-option menu-generic-link-option) (type? menu-option menu-generic-to-resolutions-option)) + (set! selected-item? #t)) + (else + (set! (-> this selected-option-index) (-> *progress-pc-generic-store* current-menu-hover-index)) + (sound-play "generic-beep")))))) + ((cpad-pressed? 0 triangle) + ;; we are in a sub-page, time to go back + (when (has-history? *progress-pc-generic-store*) + (back! *progress-pc-generic-store* progress) + (sound-play "generic-beep")))) + ;; menu option already selected + (cond + ((cpad-pressed? 0 confirm) + (set! (-> this selected-option-index) -1)) + ((cpad-pressed? 0 triangle) + (set! (-> this selected-option-index) -1)))) + ;; propagate event to menu-option + (when (< (-> *progress-pc-generic-store* current-menu-hover-index) (-> this menu-options length)) + (respond-progress (-> this menu-options (-> *progress-pc-generic-store* current-menu-hover-index)) progress (or selected? selected-item?)))) + 0) + +(defmethod respond-progress ((this menu-generic-boolean-option) (progress progress) (selected? symbol)) + (if selected? + (cond + ((cpad-pressed? 0 left l-analog-left right l-analog-right) + (if (-> this value) + (set! (-> this value) #f) + (set! (-> this value) #t)) + (sound-play "generic-beep")) + ((cpad-pressed? 0 confirm) + (call-on-confirm this (-> this value)) + (sound-play "generic-beep"))) + (cond + ((cpad-pressed? 0 confirm) + ;; set the value, this is so we edit the component's state and not the actual underlying value + ;; in other words, don't change the setting until the user has actually confirmed the change! + (set! (-> this value) (call-get-value-fn this))))) + 0) + +(defmethod respond-progress ((this menu-generic-carousel-option) (progress progress) (selected? symbol)) + (if selected? + (cond + ((cpad-pressed? 0 left l-analog-left) + (dec! (-> this item-index)) + (when (< (-> this item-index) 0) + (set! (-> this item-index) (dec (num-items this)))) + (sound-play "generic-beep")) + ((cpad-pressed? 0 right l-analog-right) + (inc! (-> this item-index)) + (when (>= (-> this item-index) (num-items this)) + (set! (-> this item-index) 0)) + (sound-play "generic-beep")) + ((cpad-pressed? 0 confirm) + (call-on-confirm this (-> this item-index) progress) + (sound-play "generic-beep"))) + (cond + ((cpad-pressed? 0 confirm) + ;; set the value, this is so we edit the component's state and not the actual underlying value + ;; in other words, don't change the setting until the user has actually confirmed the change! + (set! (-> this item-index) (call-get-item-index-fn this))))) + 0) + +(defmethod respond-progress ((this menu-generic-link-option) (progress progress) (selected? symbol)) + (when (and selected? (cpad-pressed? 0 confirm)) + (navigate! *progress-pc-generic-store* progress (-> this target) (-> this on-load)) + (set! (-> progress selected-option) #f) + (sound-play "generic-beep")) + 0) + +(defmethod respond-progress ((this menu-generic-button-option) (progress progress) (selected? symbol)) + (cond + ((cpad-pressed? 0 confirm) + (cpad-clear! 0 confirm) + (call-on-confirm this progress) + (sound-play "generic-beep"))) + 0) + +(defmethod respond-progress ((this menu-generic-confirm-option) (progress progress) (selected? symbol)) + (if selected? + (cond + ((cpad-pressed? 0 left l-analog-left right l-analog-right) + (if (-> this confirmed?) + (set! (-> this confirmed?) #f) + (set! (-> this confirmed?) #t)) + (sound-play "generic-beep")) + ((cpad-pressed? 0 confirm) + (call-on-confirm this) + (sound-play "generic-beep"))) + (cond + ((cpad-pressed? 0 confirm) + (set! (-> this confirmed?) #f)))) + 0) + +(defmethod respond-progress ((this menu-generic-slider-option) (progress progress) (selected? symbol)) + (if selected? + (cond + ((and (> (-> this value) (-> this min-value)) + (cpad-hold? 0 left l-analog-left)) + ;; TODO - might not work well on higher frame-rates + (set! (-> this value) (fmax (- (-> this value) (-> this step)) (-> this min-value))) + (when (< (seconds 0.03) (- (current-time) (-> this last-sound-played))) + (set! (-> this last-sound-played) (current-time)) + (sound-play-by-name (static-sound-name "menu-slide") (new-sound-id) 512 0 0 (sound-group sfx) #t))) + ((and (< (-> this value) (-> this max-value)) + (cpad-hold? 0 right l-analog-right)) + ;; TODO - might not work well on higher frame-rates + (set! (-> this value) (fmin (+ (-> this value) (-> this step)) (-> this max-value))) + (when (< (seconds 0.03) (- (current-time) (-> this last-sound-played))) + (set! (-> this last-sound-played) (current-time)) + (sound-play-by-name (static-sound-name "menu-slide") (new-sound-id) 512 0 0 (sound-group sfx) #t))) + ((cpad-pressed? 0 confirm) + (call-on-confirm this (-> this value)) + (sound-play "generic-beep"))) + (cond + ((cpad-pressed? 0 confirm) + ;; set the value, this is so we edit the component's state and not the actual underlying value + ;; in other words, don't change the setting until the user has actually confirmed the change! + (set! (-> this value) (call-get-value-fn this))))) + 0) + +(defmethod respond-progress ((this menu-generic-details-page) (progress progress) (selected? symbol)) + (if (= (-> this selected-entry-index) -1) + (cond + ((or (cpad-pressed? 0 down l-analog-down) + (and (cpad-hold? 0 down l-analog-down) + (>= (- (current-time) (the-as int (-> this last-move))) (seconds 0.2)))) + (set! (-> this last-move) (current-time)) + (cond + ((< (-> *progress-pc-generic-store* current-menu-hover-index) (dec (-> this entries length))) + (+! (-> *progress-pc-generic-store* current-menu-hover-index) 1) + (sound-play "roll-over")) + (else + (set! (-> *progress-pc-generic-store* current-menu-hover-index) 0) + (sound-play "roll-over")))) + ((or (cpad-pressed? 0 up l-analog-up) + (and (cpad-hold? 0 up l-analog-up) + (>= (- (current-time) (the-as int (-> this last-move))) (seconds 0.2)))) + (set! (-> this last-move) (current-time)) + (+! (-> *progress-pc-generic-store* current-menu-hover-index) -1) + (sound-play "roll-over") + (when (< (-> *progress-pc-generic-store* current-menu-hover-index) 0) + (set! (-> *progress-pc-generic-store* current-menu-hover-index) (dec (-> this entries length))))) + ((cpad-pressed? 0 confirm) + (when (< (-> *progress-pc-generic-store* current-menu-hover-index) (-> this entries length)) + (set! (-> this selected-entry-index) (-> *progress-pc-generic-store* current-menu-hover-index)) + (sound-play "generic-beep"))) + ((cpad-pressed? 0 triangle) + ;; we are in a sub-page, time to go back + (when (has-history? *progress-pc-generic-store*) + (back! *progress-pc-generic-store* progress) + (sound-play "score-slide")))) + ;; menu option already selected + (cond + ((cpad-pressed? 0 confirm) + (set! (-> this selected-entry-index) -1)) + ((cpad-pressed? 0 triangle) + (set! (-> this selected-entry-index) -1)) + ;; keybinds + ((nonzero? (-> *progress-pc-generic-store* keybind-select-time)) + ;; when the bind has been set, or it's expired + (when (or (not (pc-waiting-for-bind?)) + (>= (- (current-time) (the-as int (-> *progress-pc-generic-store* keybind-select-time))) (seconds 5.0))) + (set! (-> *progress-pc-generic-store* keybind-select-time) 0) + (set! (-> this selected-entry-index) -1) + (set! (-> progress selected-option) #f) + (cond + ((not (pc-waiting-for-bind?)) + (sound-play "generic-beep")) + (else + (pc-stop-waiting-for-bind!) + (sound-play "roll-over"))))))) + ;; propagate event to menu-option + (when (< (-> *progress-pc-generic-store* current-menu-hover-index) (-> this entries length)) + (respond-progress (-> this entries (-> *progress-pc-generic-store* current-menu-hover-index)) progress selected?)) + 0) + +(defmethod respond-progress ((this menu-generic-details-keybind-entry) (progress progress) (selected? symbol)) + (when (not selected?) + (cond + ((cpad-pressed? 0 confirm) + (let ((bind-info (-> this bind-info))) + (pc-set-waiting-for-bind! (-> bind-info device-type) (not (-> bind-info for-buttons?)) (-> bind-info analog-min-range?) (-> bind-info input-idx))) + (set! (-> *progress-pc-generic-store* keybind-select-time) (current-time))))) + 0) + +(defmethod respond-progress ((this menu-generic-details-confirm-entry) (progress progress) (selected? symbol)) + (if selected? + (cond + ((cpad-pressed? 0 left l-analog-left right l-analog-right) + (if (-> this confirmed?) + (set! (-> this confirmed?) #f) + (set! (-> this confirmed?) #t)) + (sound-play "generic-beep")) + ((cpad-pressed? 0 confirm) + (call-on-confirm this) + (sound-play "generic-beep"))) + (cond + ((cpad-pressed? 0 confirm) + (set! (-> this confirmed?) #f)))) + 0) + +;; - rest of component logic + +(defmethod num-items ((this menu-generic-carousel-option)) + "Get the number of items in the carousel" + (if (and (nonzero? (-> this items)) (!= (-> this items) #f)) + (-> this items length) + (if (and (and (nonzero? (-> this get-max-size-fn)) (!= (-> this get-max-size-fn) #f)) + (and (nonzero? (-> this get-item-label-fn)) (!= (-> this get-max-size-fn) #f))) + ((-> this get-max-size-fn)) + 0))) + +(defmethod get-item-label ((this menu-generic-carousel-option) (item-index int)) + "Gets the string label of the currently choosen item, preferring the `items` array if it exists" + (if (and (nonzero? (-> this items)) (!= (-> this items) #f)) + (lookup-text! *common-text* (-> this items item-index) #f) + (if (and (nonzero? (-> this get-item-label-fn)) (!= (-> this get-max-size-fn) #f)) + ((-> this get-item-label-fn) item-index) + "#ERROR"))) + +;; TODO - it could be possible to map certain controllers to buttons (ie. dualshock controllers could have nice mappings instead of SDL named ones) +(defmethod get-keybind-string ((this menu-generic-details-keybind-entry)) + (case (-> this keybind) + (((controller-keybind cross)) + ;; the PS2 TRC says it should be pronounced "ecks", hence why every game that speaks the buttons out loud says X, plus at least 80% of people also already say X (i assume in part because of that). + ;; the official spelling is probably "cross" (see PS2 development reference manuals), but that has less weight in the context of displaying the name to the user, I think? + ;; "cross" seems to be mainly a UK thing (those weirdos) + (if (language? uk-english) + "~Y~22L<~Z~Y~27L*~Z~Y~1L>~Z~Y~23L[~Z~+26H Cross" + "~Y~22L<~Z~Y~27L*~Z~Y~1L>~Z~Y~23L[~Z~+26H X")) + (((controller-keybind square)) + "~Y~22L<~Z~Y~24L#~Z~Y~1L>~Z~Y~23L[~Z~+26H S~+7Vq~-7Vuare") + (((controller-keybind circle)) + "~Y~22L<~Z~Y~25L@~Z~Y~1L>~Z~Y~23L[~Z~+26H Circle") + (((controller-keybind triangle)) + "~Y~22L<~Z~Y~26L;~Z~Y~1L>~Z~Y~23L[~Z~+26H Trian~+7Vg~-7Vle") + (((controller-keybind dpad-up)) + "~Y~0L\ca1~Z~3L~+17H~-13V\ca2~Z~0L~+17H~+14V\ca0~Z~0L~+32H\ca3~Z~+56H D-Pad U~+7Vp~-7V") + (((controller-keybind dpad-down)) + "~Y~0L\ca1~Z~0L~+17H~-13V\ca2~Z~3L~+17H~+14V\ca0~Z~0L~+32H\ca3~Z~+56H D-Pad Down") + (((controller-keybind dpad-right)) + "~Y~0L\ca1~Z~0L~+17H~-13V\ca2~Z~0L~+17H~+14V\ca0~Z~3L~+32H\ca3~Z~+56H D-Pad Ri~+7Vg~-7Vht") + (((controller-keybind dpad-left)) + "~Y~3L\ca1~Z~0L~+17H~-13V\ca2~Z~0L~+17H~+14V\ca0~Z~0L~+32H\ca3~Z~+56H D-Pad Left") + (((controller-keybind l1)) + "~Y~22L~-2H~-12V\ca6\ca7~Z~22L~-2H~+17V\cb0\cb1~Z~1L~+4H~+3V\c95~Z~+38H L1") + (((controller-keybind l2)) + "~Y~22L~-2H~-6V\ca8\ca9~Z~22L~-2H~+16V\cb2\cb3~Z~1L~+5H~-2V\c97~Z~+38H L2") + (((controller-keybind l3)) + "\c91 L3") + (((controller-keybind r1)) + "~Y~22L~-2H~-12V\ca6\ca7~Z~22L~-2H~+17V\cb0\cb1~Z~1L~+6H~+3V\c94~Z~+38H R1") + (((controller-keybind r2)) + "~Y~22L~-2H~-6V\ca8\ca9~Z~22L~-2H~+16V\cb2\cb3~Z~1L~+5H~-2V\c96~Z~+38H R2") + (((controller-keybind r3)) + "\c91 R3") + (((controller-keybind select)) + "\c92 Select") + (((controller-keybind start)) + "\c92 Start") + (((controller-keybind l-analog-up)) + "~Y~1L\c91~Z~-17V~6L\c98~Z~+26H Left Analo~+7Vg~-7V U~+7Vp~-7V") + (((controller-keybind l-analog-down)) + "~Y~1L\c91~Z~+15V~6L\c9c~Z~+26H Left Analo~+7Vg~-7V Down") + (((controller-keybind l-analog-left)) + "~Y~1L\c91~Z~-17H~6L\c9e~Z~+26H Left Analo~+7Vg~-7V Left") + (((controller-keybind l-analog-right)) + "~Y~1L\c91~Z~+17H~6L\ca4~Z~+26H Left Analo~+7Vg~-7V Ri~+7Vg~-7Vht") + (((controller-keybind r-analog-up)) + "~Y~1L\c91~Z~-17V~6L\c98~Z~+26H Ri~+7Vg~-7Vht Analo~+7Vg~-7V U~+7Vp~-7V") + (((controller-keybind r-analog-down)) + "~Y~1L\c91~Z~+15V~6L\c9c~Z~+26H Ri~+7Vg~-7Vht Analo~+7Vg~-7V Down") + (((controller-keybind r-analog-left)) + "~Y~1L\c91~Z~-17H~6L\c9e~Z~+26H Ri~+7Vg~-7Vht Analo~+7Vg~-7V Left") + (((controller-keybind r-analog-right)) + "~Y~1L\c91~Z~+17H~6L\ca4~Z~+26H Ri~+7Vg~-7Vht Analo~+7Vg~-7V Ri~+7Vg~-7Vht") + (else + "Unknown Bind"))) diff --git a/goal_src/jak3/pc/progress/progress-h-pc.gc b/goal_src/jak3/pc/progress/progress-h-pc.gc new file mode 100644 index 0000000000..a629e669c2 --- /dev/null +++ b/goal_src/jak3/pc/progress/progress-h-pc.gc @@ -0,0 +1,61 @@ +;;-*-Lisp-*- +(in-package goal) + +#| + + Additional PC port specific file for overriding/expanding the progress menu + This gives us more freedom to write code how we want. + +|# + + +(defmacro push-and-set-state (progress state) + `(begin + (push-state ,progress) + (set-next-state ,progress ,state 0))) + +(deftype menu-aspect-ratio-custom-option (menu-option) + () + ) + +(deftype menu-frame-rate-disclaimer-option (menu-option) + () + ) + +(deftype menu-exit-game-option (menu-qr-option) + () + ) + +(deftype menu-resolution-option (menu-option) + ((last-move time-frame) + (selected-index int16) + (scroll-index float) + (valid? symbol) + + ;; OS state kept for drawing later, avoids desync and duplicate fetching + (num-resolutions int) + (win-aspect float) + (win-w int64) + (win-h int64) + ) + ) + +(deftype menu-music-player-option (menu-option) + ((last-move time-frame) + + ;; player params + (music-index int16) + (flava-index int8) + (excitement int8) + + ;; scroll + (current-scroll float) + (max-scroll float) + + ;; sprites 0-3 used to show level icon + (sprites hud-sprite 4 :inline) + ) + ) + + + diff --git a/goal_src/jak3/pc/progress/progress-pc.gc b/goal_src/jak3/pc/progress/progress-pc.gc new file mode 100644 index 0000000000..19aa5a8777 --- /dev/null +++ b/goal_src/jak3/pc/progress/progress-pc.gc @@ -0,0 +1,1522 @@ +;;-*-Lisp-*- +(in-package goal) + +#| + + Additional PC port specific file for overriding/expanding the progress menu + This gives us more freedom to write code how we want. + +|# + +(deftype progress-global-state-pc (basic) + ((decoration-draw-time time-frame) + + (aspect-ratio-ratio-index int8) + + (frame-rate-choice-index int8) + (frame-rate-disclaimer-time time-frame) + + (music-player-track music-player-track-info) + (music-player-flava int8) + (music-player-selected symbol) + ) + ) + + +(define *progress-state-pc* (new 'static 'progress-global-state-pc :music-player-track #f)) + +(defmacro when-not-drawn-decoration (&rest body) + `(when (> (-> *display* real-clock integral-frame-counter) (-> *progress-state-pc* decoration-draw-time)) + ,@body + (set! (-> *progress-state-pc* decoration-draw-time) (-> *display* real-clock integral-frame-counter)))) + +(defun mc-status-code->string ((status mc-status-code)) + (enum->string mc-status-code status)) + +(defmethod progress-method-33 ((this progress) (arg0 progress-box)) + (set! (-> this scissor-count) (min 7 (+ (-> this scissor-count) 1))) + (let ((s5-0 (-> this scissor-stack (-> this scissor-count))) + (box (new 'stack 'hud-box)) + (gp-1 (if (= (get-aspect-ratio) 'aspect4x3) + (-> arg0 aspect4x3) + (-> arg0 aspect16x9) + ) + ) + ) + (vector-copy! s5-0 (the-as vector gp-1)) + (mem-copy! (the pointer box) (the pointer gp-1) (size-of hud-box)) + (set! gp-1 box) + (#when PC_PORT + (when (not (-> *pc-settings* use-vis?)) + (set! (-> gp-1 min x) (the float (adjust-game-x (-> gp-1 min x)))) + (set! (-> gp-1 max x) (the float (adjust-game-x (-> gp-1 max x)))) + ) + ) + (with-dma-buffer-add-bucket ((v1-12 (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id hud-draw-hud-alpha) + ) + (dma-buffer-add-gs-set v1-12 + (scissor-1 + (new 'static 'gs-scissor + :scax0 (the int (-> gp-1 box min x)) + :scay0 (the int (-> gp-1 box min y)) + :scax1 (the int (-> gp-1 box max x)) + :scay1 (the int (-> gp-1 box max y)) + ) + ) + ) + ) + (with-dma-buffer-add-bucket ((v1-23 (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id particles) + ) + (dma-buffer-add-gs-set v1-23 + (scissor-1 + (new 'static 'gs-scissor + :scax0 (the int (-> gp-1 box min x)) + :scay0 (the int (-> gp-1 box min y)) + :scax1 (the int (-> gp-1 box max x)) + :scay1 (the int (-> gp-1 box max y)) + ) + ) + ) + ) + (with-dma-buffer-add-bucket ((v1-34 (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id hud-draw-pris2) + ) + (dma-buffer-add-gs-set v1-34 (scissor-1 (new 'static 'gs-scissor + :scax0 (the int (-> gp-1 box min x)) + :scay0 (the int (-> gp-1 box min y)) + :scax1 (the int (-> gp-1 box max x)) + :scay1 (the int (-> gp-1 box max y)) + ) + ) + ) + ) + ) + 0 + ) + +(defbehavior progress-trans progress () + ;; og:preserve-this added variable + (let ((speed-mod (if (-> *pc-settings* fast-progress?) (-> *pc-cheat-state* progress-speed) 1.0))) + (cond + ((and (= (-> self next) 'none) (or (= (-> self starting-state) 'main) (= (-> self anim-frame) 1.0))) + (set! (-> self menu-transition) + (seek-ease + (-> self menu-transition) + 0.0 + (/ (* speed-mod (-> self clock time-adjust-ratio)) 10) + 0.4 + (/ (-> self clock time-adjust-ratio) 100) + ) + ) + ) + (else + (seek! (-> self menu-transition) 1.0 (/ (-> self clock time-adjust-ratio) 10)) + (when (and (= (-> self menu-transition) 1.0) + (or (and (nonzero? (-> self state-pos)) (= (-> self anim-frame) 1.0)) + (or (and (zero? (-> self state-pos)) (= (-> self anim-frame) 0.0)) + (and (!= (-> self starting-state) 'main) (!= (-> self next) 'none)) + ) + ) + ) + (set! (-> self current) (-> self next)) + (set! (-> self next) 'none) + (set! (-> self option-index) (-> self next-option-index)) + (set! (-> self want-option-index) 0) + (set-menu-options self (-> self current)) + (set! (-> self scanlines-alpha) 0.0) + ) + ) + ) + (set! (-> self main-menu) + (and (zero? (-> self state-pos)) (and (= (-> self menu-transition) 0.0) + (= (-> self next) 'none) + (or (= (-> self state-array 0) 'main) (= (-> self current) 'main)) + ) + ) + ) + (when *cheat-mode* + (when (zero? (-> self state-pos)) + (cond + ((and (cpad-hold? 0 l2) (cpad-hold? 0 r1)) + (when (= (-> self current-options) *main-options*) + (set! (-> *progress-work* secrets-unlocked) #t) + (set! (-> *progress-work* selected-num) 0) + (set! (-> self current-options) *main-options-debug*) + ) + ) + ((= (-> self current-options) *main-options-debug*) + (set! (-> self current-options) *main-options*) + ) + ) + ) + ) + (if (= (-> self ring-angle) (-> self ring-want-angle)) + (respond-to-cpad self) + ) + (let ((f30-0 (/ (-> self clock time-adjust-ratio) 200))) + (cond + ((= (-> self menu-transition) 1.0) + (if (and (zero? (-> self state-pos)) (= (-> self starting-state) 'main)) + (seek! (-> self anim-frame) 0.0 (/ (-> self clock time-adjust-ratio) 50)) + (seek! (-> self anim-frame) 1.0 (/ (-> self clock time-adjust-ratio) 50)) + ) + (let ((f0-27 (if (and (zero? (-> self state-pos)) (!= (-> self starting-state) 'title)) + 0.0 + 0.2 + ) + ) + ) + (when (= (-> self next) 'bigmap) + (set! f0-27 0.4) + (set! f30-0 (/ (-> self clock time-adjust-ratio) 125)) + ) + (seek! (-> self pos-transition) f0-27 f30-0) + ) + ) + ((zero? (-> self state-pos)) + (if (= (-> self current) 'bigmap) + (set! f30-0 (/ (-> self clock time-adjust-ratio) 20)) + ) + (if (!= (-> self starting-state) 'title) + (seek! (-> self pos-transition) 0.0 f30-0) + ) + ) + ) + ) + (if (!= (-> self starting-state) 'main) + (set! (-> self pos-transition) 0.2) + ) + (set-ring-position self) + (when (= (-> self ring-angle) (-> self ring-want-angle)) + (cond + ((< (-> self want-option-index) 0) + (cond + ((and (= *cheat-mode* #f) (or (demo?) (kiosk?))) + (if (> (-> self option-index) 0) + (+! (-> self option-index) -1) + ) + ) + (else + (set! (-> self option-index) + (min-max-wrap-around (+ (-> self option-index) -1) 0 (+ (length (-> self current-options options)) -1)) + ) + ) + ) + (set! (-> self graphic-index) (-> self option-index)) + (+! (-> self want-option-index) 1) + ) + ((> (-> self want-option-index) 0) + (cond + ((and (= *cheat-mode* #f) (or (demo?) (kiosk?))) + (if (< (-> self option-index) (+ (length (-> self current-options options)) -1)) + (+! (-> self option-index) 1) + ) + ) + (else + (set! (-> self option-index) + (min-max-wrap-around (+ (-> self option-index) 1) 0 (+ (length (-> self current-options options)) -1)) + ) + ) + ) + (+! (-> self want-option-index) -1) + ) + ) + ) + (if (= (-> self anim-frame) 0.0) + (set! (-> self swing) (seek-ease + (-> self swing) + 4.0 + (/ (-> self clock time-adjust-ratio) 20) + 0.5 + (/ (-> self clock time-adjust-ratio) 200) + ) + ) + (set! (-> self swing) (seek-ease + (-> self swing) + 0.0 + (* 0.07 (-> self clock time-adjust-ratio)) + 0.5 + (* 0.007 (-> self clock time-adjust-ratio)) + ) + ) + ) + (when (-> self main-menu) + (set! (-> self ring-want-angle) (ceil (* 182.04445 (* 36.0 (the float (-> self option-index)))))) + (if (and (= (-> self ring-want-angle) 0.0) (< 32768.0 (-> self ring-angle))) + (set! (-> self ring-want-angle) 65536.0) + ) + (let ((f0-54 (- (-> self ring-want-angle) (-> self ring-angle)))) + (when (< 32768.0 (fabs f0-54)) + (if (< 0.0 f0-54) + (+! (-> self ring-angle) 65536.0) + (+! (-> self ring-angle) -65536.0) + ) + ) + ) + (seek! (-> self ring-angle) (-> self ring-want-angle) (* speed-mod 910.2222 (-> self clock time-adjust-ratio))) + ) + (let ((gp-4 (quaternion-vector-angle! + (new 'stack-no-clear 'quaternion) + *x-vector* + (* 182.04445 (* (-> self swing) (sin (the float (* 40 (current-time)))))) + ) + ) + (s5-4 (quaternion-vector-angle! + (new 'stack-no-clear 'quaternion) + *y-vector* + (* 182.04445 (* (-> self swing) (sin (the float (* 0 (current-time)))))) + ) + ) + ) + (quaternion*! (-> self root quat) (-> self init-quat) gp-4) + (quaternion*! (-> self root quat) (-> self root quat) s5-4) + ) + (quaternion-normalize! (-> self root quat)) + (if (= (-> self ring-angle) (-> self ring-want-angle)) + (set! (-> self graphic-index) (-> self option-index)) + ) + (case *kernel-boot-message* + (('kiosk) + (if (and (nonzero? (-> self start-time)) + (>= (- (-> *display* real-clock frame-counter) (-> self start-time)) (seconds 60)) + (>= (- (-> *display* real-clock frame-counter) (-> *cpad-list* cpads 0 real-change-time)) (seconds 60)) + (or (can-go-back? self) (= (-> self current) 'select-kiosk-start-special)) + (not (handle->process (-> *game-info* auto-save-proc))) + ) + (initialize! *game-info* 'game (the-as game-save #f) (the-as string #f) (the-as resetter-spec #f)) + ) + ) + ) + ) + (none) + ) + +(defun end-scan ((arg0 hud-box) (arg1 float)) + (with-dma-buffer-add-bucket ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id bucket582) + ) + (#when PC_PORT + (when (not (-> *pc-settings* use-vis?)) + (set! (-> arg0 min x) (the float (the int (adjust-game-x (-> arg0 min x))))) + (set! (-> arg0 max x) (the float (the int (adjust-game-x (-> arg0 max x))))) + ) + ) + (draw-scan-and-line arg0 s5-0 arg1) + ) + 0 + ) + +(defbehavior progress-post progress () + (local-vars (sv-208 font-context) (sv-212 int) (sv-216 hud-box) (sv-220 symbol)) + (when (-> self current-options) + (set-selected-color self) + (set! (-> self scissor-count) -1) + (progress-method-33 self (-> *progress-work* full-screen)) + (let ((gp-0 (-> self current-options options))) + (let ((s3-0 (-> self current-options y-center)) + (s5-0 (-> self current-options y-space)) + ) + (let ((s2-0 (new-stack-matrix0)) + (s4-0 *progress-work*) + ) + (mem-copy! (the-as pointer s2-0) (the-as pointer *font-default-matrix*) 64) + (set! sv-208 (new 'stack 'font-context s2-0 0 0 0.0 (font-color default) (font-flags shadow kerning))) + (set! sv-212 (- s3-0 (/ (* s5-0 (length gp-0)) 2))) + (set! sv-216 (new 'stack-no-clear 'hud-box)) + (set! sv-220 (and (!= (-> self current) 'main) (or (= (-> self next) 'none) (> (-> self state-pos) 0)))) + (progress-method-33 self (-> s4-0 small-screen)) + (when sv-220 + (begin-scan sv-216 self) + (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> self menu-transition)))))) + (when (not (or (= (-> self current) 'bigmap) (= (-> self next) 'bigmap))) + (draw-bg-box-alpha-1 self (-> s4-0 small-screen) (* 144.0 f30-0)) + (draw-bg-box-outline self (-> s4-0 small-screen) (* 128.0 f30-0)) + ) + ) + ) + ) + ; (if (or (= (-> self current-options) *title*) (= (-> self current-options) *options-options*)) + ; (+ s5-0 20) + ; ) + (if (or (= (-> self current-options) *title-pc*) (= (-> self current-options) *options-options-pc*)) + (+! s5-0 20) + ) + ) + (dotimes (s5-1 (length gp-0)) + (set! (-> self current-index) s5-1) + (set-scale! sv-208 0.5) + (set! (-> sv-208 origin x) 70.0) + (set! (-> sv-208 origin y) (the float sv-212)) + (set-width! sv-208 375) + (set-height! sv-208 30) + (set! (-> sv-208 flags) (font-flags kerning middle middle-vert large)) + (let ((v1-51 sv-208)) + (set! (-> v1-51 color) (if (and (= s5-1 (-> self option-index)) (= (-> self menu-transition) 0.0)) + (font-color font-color-33) + (font-color font-color-32) + ) + ) + ) + ;; og:preserve-this added for proper aspect ratio-ing + (#when PC_PORT + (when (not (-> *pc-settings* use-vis?)) + (set! (-> sv-208 origin x) (the float (the int (adjust-game-x (-> sv-208 origin x))))) + (set! (-> sv-208 width) (the float (the int (* (-> sv-208 width) (-> *pc-settings* aspect-ratio-reciprocal))))) + ) + ) + (draw-option + (-> gp-0 s5-1) + self + sv-208 + s5-1 + (and (= (-> self menu-transition) 0.0) (-> self selected-option) (= s5-1 (-> self option-index))) + ) + ) + ) + (if sv-220 + (set! (-> self scanlines-alpha) (seek-ease + (-> self scanlines-alpha) + (- 1.0 (-> self menu-transition)) + (/ (-> self clock time-adjust-ratio) 20) + 0.3 + (/ (-> self clock time-adjust-ratio) 1000) + ) + ) + ) + (progress-method-34 self) + (end-scan sv-216 (-> self scanlines-alpha)) + ) + (when (and (< 0.8 (-> self anim-frame)) (or (= (-> self current) 'bigmap) (= (-> self next) 'bigmap))) + (progress-method-33 self (-> *progress-work* full-screen)) + (cond + ((>= (-> self pos-transition) 0.38) + (draw! *bigmap* 1792 1840 2304 2256) + ) + (else + (let ((s4-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 21))) + (s3-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 24))) + (gp-1 (new 'stack-no-clear 'vector4w)) + ) + (set! (-> gp-1 quad) (the-as uint128 0)) + (let ((s5-2 (new 'stack-no-clear 'vector4w))) + (set! (-> s5-2 quad) (the-as uint128 0)) + (if (and (transform-point-qword! gp-1 s4-1) (transform-point-qword! s5-2 s3-1)) + (draw! *bigmap* (/ (-> s5-2 x) 16) (/ (-> s5-2 y) 16) (/ (-> gp-1 x) 16) (/ (-> gp-1 y) 16)) + ) + ) + ) + ) + ) + (progress-method-34 self) + ) + (ja-post) + ) + +(set! (-> (method-of-type progress come-in) trans) + (lambda :behavior progress () + (let ((f30-0 (if (= (-> self starting-state) 'main) + 0.0 + 0.2 + ) + ) + ;; og:preserve-this added variable + (speed-mod (if (-> *pc-settings* fast-progress?) (-> *pc-cheat-state* progress-speed) 1.0)) + ) + (when (hud-hidden?) + (set! (-> self pos-transition) (seek-ease + (-> self pos-transition) + f30-0 + (* speed-mod 0.03 (-> self clock time-adjust-ratio)) + 0.4 + (* 0.003 (-> self clock time-adjust-ratio)) + ) + ) + (when (= (-> self lock-tick-count) 1) + (sound-play "ring-appear") + (set-menu-mode *blit-displays-work* #t) + ) + (+! (-> self lock-tick-count) 1) + ) + (set-ring-position self) + (when (= (-> self pos-transition) f30-0) + (set! (-> self start-time) (-> *display* real-clock frame-counter)) + (go-virtual idle) + ) + ) + ) + ) + +(set! (-> (method-of-type progress go-away) trans) + (lambda :behavior progress () + ;; og:preserve-this added variable + (let ((speed-mod (if (-> *pc-settings* fast-progress?) (-> *pc-cheat-state* progress-speed) 1.0))) + (seek! (-> self anim-frame) 0.0 (/ (* speed-mod (-> self clock time-adjust-ratio)) 50)) + (cond + ((= (-> self anim-frame) 0.0) + (seek! (-> self pos-transition) 1.0 (/ (* speed-mod (-> self clock time-adjust-ratio)) 50)) + (if (= (-> self pos-transition) 1.0) + (go-virtual gone) + ) + ) + (else + (seek! (-> self pos-transition) 0.0 (/ (* speed-mod (-> self clock time-adjust-ratio)) 50)) + ) + ) + (set-ring-position self) + ) + ) + ) + +(set! (-> (method-of-type progress idle) event) + (lambda :behavior progress ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notify) + (cond + ((= (-> block param 0) 'done) + (let ((status (the mc-status-code (-> block param 1)))) + (format #t "DONE NOTIFY: ~S ~S~%" (mc-status-code->string status) (-> self current)) + ) + ;; og:preserve-this patched to next instead of current because we save synchronously + (case (-> self next) + (('saving) + (cond + ((= (-> self state-array 0) 'title) + (let ((gp-1 (-> *setting-control* user-default auto-save))) + (sound-volume-off) + (set! (-> *setting-control* user-default auto-save) gp-1) + (progress-intro-start) + ) + ) + ((-> *progress-work* hero-mode-save) + (set-next-state self 'hero-mode-message 0) + ) + (else + (pop-state self) + ) + ) + ) + (('formatting) + (set-next-state self 'creating 0) + ) + (('creating) + (cond + ((= (-> self state-array 0) 'title) + (set-next-state self 'select-save-title 0) + ) + ((-> *progress-work* hero-mode-save) + (set-next-state self 'select-save-hero 0) + ) + (else + (set-next-state self 'select-save 0) + ) + ) + ) + ) + ) + ((= (-> block param 0) 'error) + (let ((status (the mc-status-code (-> block param 1)))) + (format #t "ERROR NOTIFY: ~S ~S ~S~%" + (mc-status-code->string status) + (-> self current) + (-> self next) + ) + ) + (case (-> block param 1) + ((14) + (set-next-state self 'insufficient-space 0) + ) + (else + (case (-> self next) ;; og:preserve-this patched to next instead of current because we save synchronously + (('formatting 'format-card) + (set-next-state self 'error-formatting 0) + ) + (('creating 'create-game) + (set-next-state self 'error-creating 0) + ) + (('saving 'select-save 'select-save-title 'select-save-hero 'already-exists) + (set-next-state self 'error-saving 0) + ) + (('loading 'select-load) + (set-next-state self 'error-loading 0) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + +(defmethod set-menu-options ((this progress) (arg0 symbol)) + (set! (-> this current-options) #f) + (case arg0 + (('go-away) + (go (method-of-object this go-away)) + ) + (('main) + (set! (-> this current-options) (cond + (*cheat-mode* + *main-options* + ) + ((kiosk?) + *main-kiosk-options* + ) + ((= *kernel-boot-message* 'demo) + *main-demo-options* + ) + ((= *kernel-boot-message* 'demo-shared) + *main-demo-shared-options* + ) + (else + *main-options* + ) + ) + ) + ) + (('options) + (set! (-> this current-options) *options-options-pc*) + ) + (('controls) + (set! (-> (the-as paged-menu-option (-> *controls-options* options 0)) page-index) 0) + (set! (-> (the-as paged-menu-option (-> *controls-options* options 0)) prev-page-index) 0) + (set! (-> this current-options) *controls-options*) + ) + (('game-options) + (set! (-> this current-options) (cond + ((demo?) + (if (= (scf-get-territory) 1) + *game-options-demo* + *game-options-demo* + ) + ) + (else + *game-options-pc* + ) + ) + ) + ) + (('graphic-options) + (set! (-> this current-options) + (if (or (= (scf-get-territory) 1) (and (= *progress-cheat* 'pal) (cpad-hold? 0 l2) (cpad-hold? 0 r2))) + *graphic-title-options-pal* + *graphic-options-pc* + ) + ) + ) + (('sound-options) + (set! (-> this current-options) *sound-options-pc*) + ) + (('picture-options) + (set! (-> this current-options) *picture-options*) + ) + (('camera-options) + (set! (-> this current-options) *camera-options*) + ) + (('select-load 'select-save) + (set! (-> this current-options) *load-save-options*) + ) + (('select-save-title) + (set! (-> this current-options) *save-options-title*) + ) + (('select-save-hero) + (logior! (-> *game-info* purchase-secrets) (game-secrets hero-mode)) + (set! (-> *progress-work* hero-mode-save) #t) + (set! (-> this current-options) *load-save-options*) + ) + (('hero-mode-message) + (set! (-> this current-options) *hero-mode-message-options*) + ) + (('loading 'saving 'creating 'formatting) + (set! (-> this current-options) *loading-options*) + ) + (('unformatted-card 'insufficient-space 'no-memory-card) + (set! (-> this current-options) *insufficient-space-options*) + ) + (('secrets-insufficient-space 'secrets-no-memory-card) + (set! (-> this current-options) *secrets-insufficient-space-options*) + ) + (('insert-card) + (set! (-> this current-options) *insert-card-options*) + ) + (('error-loading 'error-saving 'error-formatting 'error-creating) + (set! (-> this current-options) *error-loading-options*) + ) + (('error-auto-saving) + (set! (-> this current-options) *error-auto-saving-options*) + ) + (('card-removed) + (set! (-> this current-options) *card-removed-options*) + ) + (('error-disc-removed) + (set! (-> this current-options) *error-disc-removed-options*) + ) + (('error-reading) + (set! (-> this current-options) *error-reading-options*) + ) + (('icon-info) + (set! (-> this current-options) *icon-info-options*) + ) + (('format-card) + (set! (-> this current-options) *format-card-options*) + ) + (('already-exists) + (set! (-> this current-options) *already-exists-options*) + ) + (('create-game) + (set! (-> this current-options) *create-game-options*) + ) + (('video-mode-warning) + (set! (-> this current-options) *video-mode-warning-options*) + ) + (('video-mode-ok) + (set! (-> this current-options) *video-mode-ok-options*) + ) + (('progressive-mode-warning) + (set! (-> this current-options) *progressive-mode-warning-options*) + ) + (('progressive-mode-ok) + (set! (-> this current-options) *progressive-mode-ok-options*) + ) + (('language-select) + (set! (-> this current-options) *language-options*) + ) + (('title) + (set! (-> this current-options) *title-pc*) + ) + (('title-options) + (set! (-> this current-options) *options-options-pc*) + ) + (('select-start 'select-pre-start 'select-kiosk-start 'select-kiosk-start-special) + (set! (-> this current-options) *select-start-options*) + (set! (-> (the-as menu-select-start-option (-> *select-start-options* options 0)) current-index) 0.0) + (set! (-> (the-as menu-select-start-option (-> *select-start-options* options 0)) target-index) 0.0) + (set! (-> (the-as menu-select-start-option (-> *select-start-options* options 0)) selected-index) 0) + 0 + ) + (('select-scene) + (set! (-> this current-options) *select-scene-options*) + (set! (-> (the-as menu-select-scene-option (-> *select-scene-options* options 0)) current-index) 0.0) + (set! (-> (the-as menu-select-scene-option (-> *select-scene-options* options 0)) target-index) 0.0) + (set! (-> (the-as menu-select-scene-option (-> *select-scene-options* options 0)) selected-index) 0) + 0 + ) + (('select-scene-special) + (set! (-> this starting-state) 'title) + (set! (-> this state-pos) 0) + (let ((v1-80 (-> this state-pos))) + (set! (-> this state-array v1-80) 'title) + (set! (-> this option-index-stack v1-80) 3) + (let ((v1-81 (+ v1-80 1))) + (set! (-> this state-array v1-81) 'unlocked-secrets) + (set! (-> this option-index-stack v1-81) (-> this option-index)) + (set! (-> this state-pos) (+ v1-81 1)) + ) + ) + (dotimes (s5-1 (-> this state-pos)) + (format #t "select-scene-special: ~S ~D~%" (-> this state-array s5-1) (-> this option-index-stack s5-1)) + ) + (set! (-> this current-options) *select-scene-options*) + ) + (('inventory) + (set! (-> this current-options) *inventory*) + ) + (('bigmap) + (set! (-> this current-options) *bigmap-options*) + ) + (('missions) + (set! (-> this missions-total-spacing) 0.0) + (set! (-> (the-as menu-missions-option (-> *missions-options* options 0)) current-index) 0.0) + (set! (-> (the-as menu-missions-option (-> *missions-options* options 0)) target-index) 0.0) + (set! (-> this current-options) *missions-options*) + ) + (('highscores) + (set! (-> this current-options) *highscores-options*) + ) + (('secret) + (set! (-> this secret-buying) #f) + (set! (-> this current-options) *secret-options*) + ) + (('quit-restart) + (set! (-> this current-options) *quit-restart-options*) + ) + (('unlocked-secrets) + (set! (-> this current-options) *unlocked-secrets-pc*) + ) + ;; pc menus + (('aspect-ratio-custom) + (set! (-> *progress-state-pc* aspect-ratio-ratio-index) 0) + (set! (-> this current-options) *aspect-ratio-custom-options*) + ) + (('music-player) + (set! (-> *progress-state-pc* music-player-selected) #f) + (set! (-> (the-as menu-music-player-option (-> *music-player-options* options 0)) excitement) 0) + (set! (-> this current-options) *music-player-options*) + (when (aif (level-get *level* 'title) (= (-> it status) 'active)) + (remove-setting *setting-control* (handle->process (-> *game-info* controller 0)) 'music-volume) + ) + ) + (('resolutions) + (set! (-> (the-as menu-resolution-option (-> *resolutions-options* options 0)) selected-index) -1) + (set! (-> this current-options) *resolutions-options*) + ) + (('fps-disclaimer) + (set-time! (-> *progress-state-pc* frame-rate-disclaimer-time)) + (set! (-> this current-options) *frame-rate-disclaimer-options*) + ) + (('generic-menu) + ;; a single condition to handle all generic menu links + (let ((curr-history-entry (-> *progress-pc-generic-store* history-stack + (-> *progress-pc-generic-store* history-stack-index)))) + ;; call the on-load function is appropriate, this can be used to perform some kind of generic setup + ;; for the particular route + (call-on-load curr-history-entry) + ;; restore state from the history entry + (set! (-> *progress-pc-generic-store* clear-screen?) #f) + (set! (-> *progress-pc-generic-store* current-menu-hover-index) (-> curr-history-entry hover-index)) + (set! (-> *progress-pc-generic-store* current-menu-scroll-index) (the float (-> curr-history-entry scroll-index))) + (if (!= (-> curr-history-entry progress-id) 'generic-menu) + ;; do a recursive call to hit the relevant case in this switch + (set-menu-options this (-> curr-history-entry progress-id)) + ;; otherwise, set the options + (set! (-> this current-options) (-> curr-history-entry ref))))) + ) + (when (= (-> this current-options) #f) + (format #t "Didn't find new menu settings!!~%") + (pop-state this) + ) + 0 + ) + +(defun set-progress-frame-rate-index ((idx int)) + "Set the frame rate option index accordingly." + (when idx + (set! (-> *progress-state-pc* frame-rate-choice-index) idx) + (return 0) + ) + ;; default to 60 fps + (set! (-> *progress-state-pc* frame-rate-choice-index) 0) + ;; lookup entry that matches + (dotimes (i (-> *frame-rate-options* length)) + (if (= (-> *pc-settings* target-fps) (-> *frame-rate-options* i)) + (set! (-> *progress-state-pc* frame-rate-choice-index) i)) + ) + 0) + +(defmethod init-defaults ((this progress)) + (set! (-> this total-num-tasks) 0) + (set! (-> this clear-screen) #f) + (set! (-> this scanlines-alpha) 0.0) + (set-time! (-> this start-time)) + (set! (-> this which-slot) (-> *progress-work* last-slot-saved)) + (set! (-> this yes-no-choice) #f) + (set-time! (-> this time-out)) + (set-time! (-> this last-sound)) + (set-time! (-> this last-move)) + (set! (-> this center-x-backup) (-> *setting-control* user-default screenx)) + (set! (-> this center-y-backup) (-> *setting-control* user-default screeny)) + (set! (-> this flip-horizontal) (-> *setting-control* cam-default flip-horizontal)) + (set! (-> this flip-vertical) (-> *setting-control* cam-default flip-vertical)) + (set! (-> this progressive-scan) (-> *setting-control* user-default set-video-mode)) + (set! (-> this aspect-ratio) (get-aspect-ratio)) + (set! (-> this video-mode) (get-video-mode)) + (set! (-> this stereo-mode-backup) (-> *setting-control* user-default stereo-mode)) + (set! (-> this vibrations) (-> *setting-control* user-default vibration)) + (set! (-> this subtitles) (-> *setting-control* user-default subtitle)) + (set! (-> this language-index) (the-as language-enum-s32 (-> *setting-control* user-default language))) + (set! (-> this subtitle-language-index) + (the-as language-enum-s32 (-> *setting-control* user-default subtitle-language)) + ) + (set! (-> this audio-language-index) + (the-as language-enum-s32 (-> *setting-control* user-default audio-language)) + ) + (set! (-> (the-as menu-missions-option (-> *missions-options* options 0)) current-index) 0.0) + (set! (-> (the-as menu-missions-option (-> *missions-options* options 0)) target-index) 0.0) + (set! (-> *progress-work* secrets-unlocked) #f) + (set! (-> *progress-work* hero-mode-save) #f) + (set-setting-by-param *setting-control* 'extra-bank '((force2 menu1)) 0 0) + (cond + ((or (nonzero? (-> *setting-control* user-current subtitle-language)) + (nonzero? (-> *setting-control* user-current language)) + (nonzero? (-> *setting-control* user-current audio-language)) + ) + (set! (-> *unlocked-secrets* options length) 11) + ) + (else + (set! (-> *unlocked-secrets* options length) 12) + ) + ) + ;; PC STATE BEGIN + ;; -------------- + (init! *progress-pc-generic-store*) + (set! (-> *progress-state-pc* music-player-track) #f) + ) + +(defun progress-pc-fetch-external-times ((highscore-index int)) + (when (-> *pc-settings* speedrunner-mode?) + (case highscore-index + ((0) (pc-fetch-external-highscores "was-pre-game")) + ((1) (pc-fetch-external-highscores "air-time")) + ((2) (pc-fetch-external-highscores "total-air-time")) + ((3) (pc-fetch-external-highscores "jump-distance")) + ((4) (pc-fetch-external-highscores "total-jump-distance")) + ((5) (pc-fetch-external-highscores "roll-count")) + ((6) (pc-fetch-external-highscores "wascity-gungame")) + ((7) (pc-fetch-external-highscores "jetboard")) + ((8) (pc-fetch-external-highscores "gungame-yellow-2")) + ((9) (pc-fetch-external-highscores "gungame-red-2")) + ((10) (pc-fetch-external-highscores "gungame-ratchet")) + ((11) (pc-fetch-external-highscores "gungame-clank")) + ((12) (pc-fetch-external-highscores "power-game")) + ((13) (pc-fetch-external-highscores "destroy-interceptors")) + ((14) (pc-fetch-external-race-times "time-trial")) + ((15) (pc-fetch-external-race-times "rally")) + ((16) (pc-fetch-external-speedrun-times "any")) + ((17) (pc-fetch-external-speedrun-times "nooob")) + ((18) (pc-fetch-external-speedrun-times "allmissions")) + ((19) (pc-fetch-external-speedrun-times "100")) + ((20) (pc-fetch-external-speedrun-times "anyorbs")) + ((21) (pc-fetch-external-speedrun-times "anyhero"))))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; CUSTOM MENU OPTIONS +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + +(defmacro min-max-wrap-around+! (var inc minimum maximum) + `(set! ,var (min-max-wrap-around (+ ,var ,inc) ,minimum ,maximum))) + +(defmethod respond-progress ((obj menu-aspect-ratio-custom-option) (arg0 progress) (arg1 symbol)) + "Handle progress menu navigation logic." + + (let ((aspect-custom-val-ptr (case (-> *progress-state-pc* aspect-ratio-ratio-index) + ((0) + (&-> *pc-settings* aspect-custom-x)) + ((1) + (&-> *pc-settings* aspect-custom-y)) + (else + (&-> *pc-settings* aspect-custom-x)) + ))) + (cond + ((cpad-pressed? 0 left l-analog-left) + (when (< 0 (-> *progress-state-pc* aspect-ratio-ratio-index)) + (sound-play "roll-over") + (1-! (-> *progress-state-pc* aspect-ratio-ratio-index)) + ) + ) + ((cpad-pressed? 0 right l-analog-right) + (when (> 1 (-> *progress-state-pc* aspect-ratio-ratio-index)) + (sound-play "roll-over") + (1+! (-> *progress-state-pc* aspect-ratio-ratio-index)) + ) + ) + ((cpad-pressed? 0 up l-analog-up) + (when (> 99 (-> aspect-custom-val-ptr)) + (sound-play "roll-over") + (1+! (-> aspect-custom-val-ptr)) + ) + ) + ((cpad-pressed? 0 down l-analog-down) + (when (< 1 (-> aspect-custom-val-ptr)) + (sound-play "roll-over") + (1-! (-> aspect-custom-val-ptr)) + ) + ) + ((cpad-pressed? 0 triangle) + (cpad-clear! 0 triangle) + (sound-play "generic-beep") + (pop-state arg0) + ) + ((cpad-pressed? 0 confirm) + (cpad-clear! 0 confirm) + (when (>= (/ (the float (-> *pc-settings* aspect-custom-x)) (the float (-> *pc-settings* aspect-custom-y))) (/ 4.0 3.0)) + (set! (-> *setting-control* user-default aspect-ratio) 'aspect4x3) + (set-aspect! *pc-settings* (-> *pc-settings* aspect-custom-x) (-> *pc-settings* aspect-custom-y)) + (sound-play "generic-beep") + (pop-state arg0) + ) + ) + )) + 0 + ) + +(defmethod respond-progress ((this menu-frame-rate-disclaimer-option) (arg0 progress) (arg1 symbol)) + "Handle progress menu navigation logic." + (when (time-elapsed? (-> *progress-state-pc* frame-rate-disclaimer-time) (seconds 3)) + (let ((choice (&-> arg0 yes-no-choice)) + (sound? #f) + ) + (cond + ((cpad-pressed? 0 left l-analog-left) + (set! sound? (not (-> choice 0))) + (set! (-> choice 0) #t) + ) + ((cpad-pressed? 0 right l-analog-right) + (set! sound? (-> choice 0)) + (set! (-> choice 0) #f) + ) + ((cpad-pressed? 0 confirm) + (cpad-clear! 0 confirm) + (cond + ((-> arg0 yes-no-choice) + (true! *frame-rate-disclaimer-seen?*) + (sound-play "generic-beep") + (set-frame-rate! *pc-settings* (-> *frame-rate-options* (-> *progress-state-pc* frame-rate-choice-index)) #t) + (commit-to-file *pc-settings*) + (pop-state arg0) + ) + (else + (sound-play "generic-beep") + (set-progress-frame-rate-index (the int #f)) + (pop-state arg0) + ) + ) + ) + ) + (if sound? + (sound-play "generic-beep") + ) + ) + ) + 0 + ) + +(defbehavior play-music-player progress ((info music-player-track-info) (flava int)) + "play a music track using music player track info." + + (set! (-> *progress-state-pc* music-player-track) info) + (set-setting! 'music (-> info name) 0.0 0) + (set-setting! 'sound-flava #f 999999.0 flava) + (set-setting! 'sound-mode #f 0.0 (-> info mode)) + (apply-settings *setting-control*) + (sound-group-continue (sound-group music)) + 0) + + +(defbehavior stop-music-player progress () + "play a music track using music player track info." + + (remove-setting! 'music) + (remove-setting! 'sound-flava) + (remove-setting! 'sound-mode) + (sound-set-midi-reg 0 0) + (sound-set-midi-reg 2 0) + (sound-set-midi-reg 16 0) + (set! (-> *progress-state-pc* music-player-track) #f) + ;(min! (-> *setting-control* user-current sound-excitement) 0.0) + (sound-set-midi-reg 16 (the int (* 100.0 (-> *setting-control* user-current sound-excitement)))) + (set! (-> *setting-control* sound-excitement-change-time) (-> *display* base-clock frame-counter)) + (apply-settings *setting-control*) + (sound-group-pause (sound-group music)) + 0) + +(defun count-bits ((val int)) + "return the number of bits set to 1." + + (let ((bits 0)) + (dotimes (i 64) + (if (logtest? val (ash 1 i)) + (1+! bits)) + ) + bits) + ) + +(defun bit-on-offset ((bits int) (n int)) + "return the bit offset of where the n'th bit that is set to 1 is" + + (let ((bit-on-i 0)) + (dotimes (i 64) + (if (logtest? bits (ash 1 i)) + (if (= bit-on-i n) + (return i) + (1+! bit-on-i))) + )) + -1) + + +(defmethod respond-progress ((obj menu-music-player-option) (arg0 progress) (arg1 symbol)) + "Handle progress menu navigation logic." + + (if (= 0.0 (-> obj max-scroll)) + (set! (-> obj max-scroll) (+ -141.0 (* (-> *music-player-tracks* length) 23)))) + + ;; control logic + (let ((scroll-sound? #f) + (track-max (1- (-> *music-player-tracks* length))) + (flava-max (1- (count-bits (the-as int (-> *music-player-tracks* (-> obj music-index) flava))))) + (old-excitement (-> obj excitement)) + (play? #f)) + + ;; excitement controls + (cond + ((cpad-pressed? 0 right l-analog-right) + (seekl! (-> obj excitement) 3 1)) + ((cpad-pressed? 0 left l-analog-left) + (seekl! (-> obj excitement) 0 1)) + ) + (when (!= (-> obj excitement) old-excitement) + (sound-play "generic-beep") + (sound-set-midi-reg 16 (* 25 (-> obj excitement))) ;; play new excitement track + (unless (or (< (-> obj excitement) old-excitement) (process-by-name "sound-stinger" arg0)) + (process-spawn-function process :to arg0 :name "sound-stinger" + (lambda :behavior process ((stinger int)) + (let ((state-time (current-time))) + (format 0 "set stinger ~D~%" stinger) + (sound-set-midi-reg 0 stinger) + (until (>= (- (current-time) state-time) (seconds 0.5)) + (suspend)) + (sound-set-midi-reg 0 0) + ) + ) + (+ 9 (-> obj excitement))) + ) + (unless (process-by-name "sound-excitement" arg0) + (process-spawn-function process :to arg0 :name "sound-excitement" + (lambda :behavior process ((excite-fade int)) + (let ((state-time (current-time))) + (format 0 "set excitement fade ~D~%" (* 25 excite-fade)) + (sound-set-midi-reg 2 (* 25 excite-fade)) ;; fade out old excitement track + (until (>= (- (current-time) state-time) (seconds 0.8)) + (suspend)) + ) + ) + old-excitement) + ) + ) + + (cond + ((or (cpad-pressed? 0 down l-analog-down) + (and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (-> obj last-move)) (seconds 0.2)))) + (set! (-> obj last-move) (current-time)) + (true! scroll-sound?) + (cond + ((-> *progress-state-pc* music-player-selected) + (min-max-wrap-around+! (-> obj flava-index) 1 0 flava-max)) + (else + (min-max-wrap-around+! (-> obj music-index) 1 0 track-max) + (if (= (-> obj music-index) 0) + (set! (-> obj current-scroll) 0.0))) + )) + ((or (cpad-pressed? 0 up l-analog-up) + (and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (-> obj last-move)) (seconds 0.2)))) + (set! (-> obj last-move) (current-time)) + (true! scroll-sound?) + (cond + ((-> *progress-state-pc* music-player-selected) + (min-max-wrap-around+! (-> obj flava-index) -1 0 flava-max)) + (else + (min-max-wrap-around+! (-> obj music-index) -1 0 track-max) + (if (= (-> obj music-index) track-max) + (set! (-> obj current-scroll) (-> obj max-scroll)))) + )) + ((cpad-pressed? 0 confirm) + (cpad-clear! 0 confirm) + (sound-play "generic-beep") + + (cond + ;; track is locked. do nothing. + ((not (get-bit (-> *pc-settings* music-unlocked) (-> obj music-index))) + ) + ;; we have a track with a submenu selected + ((-> *progress-state-pc* music-player-selected) + (let ((flava (bit-on-offset (the-as int (-> *music-player-tracks* (-> obj music-index) flava)) (-> obj flava-index)))) + (cond + ((flava-unlocked? flava) + (set! (-> *progress-state-pc* music-player-flava) flava) + (true! play?) + ;; exit submenu + (false! (-> *progress-state-pc* music-player-selected)) + ) + (else + ;; do nothing. + ) + ) + ) + ) + ;; we have a track with a submenu that's not open, open it + ((nonzero? (-> *music-player-tracks* (-> obj music-index) flava)) + ;; same track that's currently playing, we can just reuse the flava position that's being used + ;; otherwise use zero. + (if (= (-> *progress-state-pc* music-player-track) (-> *music-player-tracks* (-> obj music-index))) + (set! (-> obj flava-index) (count-bits (logand (1- (ash 1 (-> *progress-state-pc* music-player-flava))) (the-as int (-> *music-player-tracks* (-> obj music-index) flava))))) + (set! (-> obj flava-index) 0)) + (true! (-> *progress-state-pc* music-player-selected))) + ;; no submenu required, just play track. + (else + (set! (-> *progress-state-pc* music-player-flava) 0) + (true! play?)) + ) + (when play? + (play-music-player (-> *music-player-tracks* (-> obj music-index)) (-> *progress-state-pc* music-player-flava)) + ) + ) + ((cpad-pressed? 0 triangle) + (cpad-clear! 0 triangle) + (sound-play "generic-beep") + (cond + ((-> *progress-state-pc* music-player-selected) + (false! (-> *progress-state-pc* music-player-selected))) + (else + (stop-music-player) + (pop-state arg0)) + ) + ) + ) + (when scroll-sound? + (sound-play "roll-over")) + ) + 0 + ) + + + +(defun calculate-current-resolution-index ((want-aspect float) (want-w int) (want-h int)) + (let ((res-w 0) + (res-h 0) + (res-aspect 0.0) + (res-valid 0)) + (dotimes (i (pc-get-num-resolutions (= (pc-get-display-mode) 'windowed))) + (pc-get-resolution i (= (pc-get-display-mode) 'windowed) (& res-w) (& res-h)) + (set! res-aspect (/ (the float res-w) (the float res-h))) + (when (or (= (pc-get-display-mode) 'windowed) + (< (fabs (- want-aspect res-aspect)) 0.05)) + (if (and (= res-h want-h) (= res-w want-w)) + (return res-valid)) + (1+! res-valid)) + ) + (cond + ;; 512x416 + ((and (= want-w 512) (= want-h 416)) + res-valid) + ;; 512x208 + ((and (= want-w 512) (= want-h 208)) + (1+ res-valid)) + ;; nothing found + (else + -1) + )) + ) + + +(defglobalconstant DEBUG_RESOLUTION_OPTION #f) +(defmethod respond-progress ((this menu-resolution-option) (arg0 progress) (arg1 symbol)) + "Handle progress menu navigation logic." + + ;; control logic + (let ((scroll-sound? #f) + (resolutions-valid 0) + (resolution-found #f) + (cur-w 0) + (cur-h 0) + (select-w -1) + (select-h -1) + ) + + (set! (-> this num-resolutions) (pc-get-num-resolutions (= (pc-get-display-mode) 'windowed))) + (cond + ;; valid state + ((> (-> this num-resolutions) 0) + (true! (-> this valid?)) + + ;; this code isnt the greatest... + ;; the logic here is that, unlike jak 1, we don't build a list of resolutions and then scroll through that. + ;; we calculate the list every frame, keeping track of the index that is highlighted. + ;; this allows for infinite resolutions and for it to update live according to monitor changes. + + (cond + ((fullscreen?) + ;; grab current window sizes for aspect ratio purposes (only relevant for fullscreen) + (pc-get-window-size (&-> this win-w) (&-> this win-h)) + + (set! cur-w (-> *pc-settings* width)) + (set! cur-h (-> *pc-settings* height)) + (set! (-> this win-aspect) (/ (the float (-> this win-w)) (the float (-> this win-h)))) + (#when DEBUG_RESOLUTION_OPTION (format *stdcon* "fullscreen mode~%")) + ) + (else + (set! cur-w (-> *pc-settings* window-width)) + (set! cur-h (-> *pc-settings* window-height)) + (set! (-> this win-aspect) (/ (the float cur-w) (the float cur-h))) + (#when DEBUG_RESOLUTION_OPTION (format *stdcon* "windowed mode~%")) + ) + ) + + ;; check if we want to automatically pick something already + (when (= -1 (-> this selected-index)) + (set! (-> this selected-index) (calculate-current-resolution-index (-> this win-aspect) cur-w cur-h)) + (#when DEBUG_RESOLUTION_OPTION (format #t "recalc index got ~D~%" (-> this selected-index))) + ;; update if not invalid? + (cond + ((= (-> this selected-index) -1) + (set! (-> this selected-index) 0) ;; give up, just select the first one by default. + ) + (else + (set! select-w cur-w) + (set! select-h cur-h) + (true! resolution-found) + (set! (-> this scroll-index) (the float (-> this selected-index))) + ) + ) + ) + + ;; if we haven't automatically picked a resolution, iterate and find the one highlighted + (when (not resolution-found) + (#when DEBUG_RESOLUTION_OPTION (format *stdcon* "finding resolution ~D~%" (-> this selected-index))) + (dotimes (i (-> this num-resolutions)) + + ;; count "valid" resolutions + (let ((this-w 0) (this-h 0) (this-aspect 0.0)) + (pc-get-resolution i (= (pc-get-display-mode) 'windowed) (& this-w) (& this-h)) + (set! this-aspect (/ (the float this-w) (the float this-h))) + + (when (or (= (pc-get-display-mode) 'windowed) + (< (fabs (- (-> this win-aspect) this-aspect)) 0.05)) + ;; this is the highlighted option - save it + (when (= resolutions-valid (-> this selected-index)) + (set! select-w this-w) (set! select-h this-h) + (true! resolution-found) + ;;(set! i (-> this num-resolutions)) ;; abandon loop + ) + (1+! resolutions-valid) + )) + ) + ) + + ;; if still didn't find it, it must be one of the hardcoded cases + (cond + (resolution-found + ;; yay + ) + ;; 512x416 + ((and (fullscreen?) (= resolutions-valid (-> this selected-index))) + (set! select-w 512) + (set! select-h 416) + ) + ;; 512x208 + ((and (fullscreen?) (= (1+ resolutions-valid) (-> this selected-index))) + (set! select-w 512) + (set! select-h 208) + ) + ;; STILL nothing? I don't know how this happens, just don't even try then. + (else + (false! (-> this valid?)) + ) + ) + + ;; hardcoded cases + (when (fullscreen?) + (+! resolutions-valid 2)) + ) + ;; not sure what happened, but there's not even any resolutions + (else + (false! (-> this valid?)) + ) + ) + + (cond + ((-> this valid?) + (#when DEBUG_RESOLUTION_OPTION + (format *stdcon* "selected: ~D (~D x ~D)~%" (-> this selected-index) select-w select-h) + (format *stdcon* "current: ~D x ~D~%" cur-w cur-h) + (format *stdcon* "resolution: ~D valid (out of ~D)~%" resolutions-valid (-> this num-resolutions)) + ) + (cond + ;; navigate up + ((or (cpad-pressed? 0 up l-analog-up) + (and (cpad-hold? 0 up l-analog-up) (time-elapsed? (-> this last-move) (seconds 0.2)))) + (set-time! (-> this last-move)) + (true! scroll-sound?) + (min-max-wrap-around+! (-> this selected-index) -1 0 (1- resolutions-valid)) + ) + ;; navigate down + ((or (cpad-pressed? 0 down l-analog-down) + (and (cpad-hold? 0 down l-analog-down) (time-elapsed? (-> this last-move) (seconds 0.2)))) + (set-time! (-> this last-move)) + (true! scroll-sound?) + (min-max-wrap-around+! (-> this selected-index) 1 0 (1- resolutions-valid)) + ) + ;; select + ((cpad-pressed? 0 confirm) + (cpad-clear! 0 confirm) + (set-window-size! *pc-settings* select-w select-h) + (pc-settings-save) + (pop-state arg0)) + ;; exit + ((cpad-pressed? 0 triangle) + (cpad-clear! 0 triangle) + (pop-state arg0)) + ) + ) + (else + ;; just triangle to exit + (when (cpad-pressed? 0 triangle) + (cpad-clear! 0 triangle) + (pop-state arg0)) + ) + ) + + (when scroll-sound? + (sound-play "roll-over")) + ) + 0 + ) + + + +(defun hide-progress-screen () + (when (and *progress-process* (!= (-> *progress-process* 0 starting-state) 'title)) + (stop-music-player) + (set-next-state (-> *progress-process* 0) 'go-away 0) + (clear-history! *progress-pc-generic-store*) + ) + (none) + ) + +;; NOTE - this technically includes the gold/silver/bronze times +;; maybe figure out how to omit them eventually, (not sure if there is anything that differentiates them) +;; From a highscores perspective it doesn't really matter, the default scores are awful +(define-extern get-highscore-score (function int int)) +(defun progress-pc-get-num-nonzero-local-scores ((highscore-index int)) + (let ((count 0) + (score-ptr (get-game-score-ref *game-info* (get-highscore-score highscore-index)))) + (dotimes (idx 8) + (when (> (-> score-ptr idx) 0) + (inc! count))) + count)) + +(defun progress-pc-max-external-scores ((highscore-index int)) + (case highscore-index + ((0) (pc-get-num-external-highscores "scatter")) + ((1) (pc-get-num-external-highscores "blaster")) + ((2) (pc-get-num-external-highscores "vulcan")) + ((3) (pc-get-num-external-highscores "peacemaker")) + ((4) (pc-get-num-external-highscores "jetboard")) + ((5) (pc-get-num-external-race-times "class3")) + ((6) (pc-get-num-external-race-times "class2")) + ((7) (pc-get-num-external-race-times "class1")) + ((8) (pc-get-num-external-race-times "port")) + ((9) (pc-get-num-external-race-times "erol")) + ((10) (pc-get-num-external-race-times "class3rev")) + ((11) (pc-get-num-external-race-times "class2rev")) + ((12) (pc-get-num-external-race-times "class1rev")) + ((13) (pc-get-num-external-highscores "onin")) + ((14) (pc-get-num-external-highscores "mash")))) + +(defun progress-pc-max-highscore-rows ((highscore-index int)) + (case highscore-index + ((0) (+ (progress-pc-get-num-nonzero-local-scores highscore-index) (pc-get-num-external-highscores "scatter"))) + ((1) (+ (progress-pc-get-num-nonzero-local-scores highscore-index) (pc-get-num-external-highscores "blaster"))) + ((2) (+ (progress-pc-get-num-nonzero-local-scores highscore-index) (pc-get-num-external-highscores "vulcan"))) + ((3) (+ (progress-pc-get-num-nonzero-local-scores highscore-index) (pc-get-num-external-highscores "peacemaker"))) + ((4) (+ (progress-pc-get-num-nonzero-local-scores highscore-index) (pc-get-num-external-highscores "jetboard"))) + ((5) (+ (progress-pc-get-num-nonzero-local-scores highscore-index) (pc-get-num-external-race-times "class3"))) + ((6) (+ (progress-pc-get-num-nonzero-local-scores highscore-index) (pc-get-num-external-race-times "class2"))) + ((7) (+ (progress-pc-get-num-nonzero-local-scores highscore-index) (pc-get-num-external-race-times "class1"))) + ((8) (+ (progress-pc-get-num-nonzero-local-scores highscore-index) (pc-get-num-external-race-times "port"))) + ((9) (+ (progress-pc-get-num-nonzero-local-scores highscore-index) (pc-get-num-external-race-times "erol"))) + ((10) (+ (progress-pc-get-num-nonzero-local-scores highscore-index) (pc-get-num-external-race-times "class3rev"))) + ((11) (+ (progress-pc-get-num-nonzero-local-scores highscore-index) (pc-get-num-external-race-times "class2rev"))) + ((12) (+ (progress-pc-get-num-nonzero-local-scores highscore-index) (pc-get-num-external-race-times "class1rev"))) + ((13) (+ (progress-pc-get-num-nonzero-local-scores highscore-index) (pc-get-num-external-highscores "onin"))) + ((14) (+ (progress-pc-get-num-nonzero-local-scores highscore-index) (pc-get-num-external-highscores "mash"))) + ((15) (pc-get-num-external-speedrun-times "any")) + ((16) (pc-get-num-external-speedrun-times "anyhoverless")) + ((17) (pc-get-num-external-speedrun-times "allmissions")) + ((18) (pc-get-num-external-speedrun-times "100")) + ((19) (pc-get-num-external-speedrun-times "anyorbs")) + ((20) (pc-get-num-external-speedrun-times "anyhero")) + (else 8))) + +(defmethod respond-progress ((this menu-sub-menu-option) (arg0 progress) (arg1 symbol)) + (let ((s4-0 *progress-work*)) + (when (and (not (-> s4-0 secrets-unlocked)) + (or (= (-> arg0 current-options) *title-pc*) + (= (-> arg0 current-options) *unlocked-secrets*) + (= (-> arg0 current-options) *select-scene-options*) + (= (-> arg0 current-options) *select-start-options*) + ) + ) + (set! (-> arg0 state-pos) 0) + (set-next-state arg0 'secrets-insufficient-space 0) + ) + (when (= (-> this name) (text-id progress-continue-without-save)) + (let ((a1-3 (get-state-check-card arg0 (-> arg0 current)))) + (set-next-state arg0 a1-3 0) + ) + ) + (when (and (= (-> this name) (text-id progress-secrets)) + (= *title-pc* (-> arg0 current-options)) + (not (-> s4-0 secrets-unlocked)) + (= (-> arg0 option-index) 3) + ) + (set! (-> arg0 option-index) 0) + 0 + ) + ) + (when (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)) + (cond + ((= (-> this name) (text-id progress-exit-demo)) + (case *kernel-boot-message* + (('demo-shared) + (set! *master-exit* 'force) + (set-master-mode 'game) + ) + (('demo) + (set! (-> *game-info* mode) 'play) + (initialize! *game-info* 'game (the-as game-save #f) "title-restart" (the-as resetter-spec #f)) + ) + ) + ) + ((= (-> this name) (text-id progress-continue-without-save)) + (progress-intro-start) + ) + ((= (-> this next-state) 'back) + (pop-state arg0) + ) + (else + (sound-play "generic-beep") + (push-state arg0) + (set-next-state arg0 (-> this next-state) 0) + ) + ) + ) + 0 + ) + +(defmethod respond-progress ((this menu-exit-game-option) (arg0 progress) (selected? symbol)) + "Handle progress menu navigation logic." + (let ((choice (&-> arg0 yes-no-choice)) + (gp-0 #f) + ) + (when selected? + (cond + ((cpad-pressed? 0 left l-analog-left) + (when (not (-> choice 0)) + (set! gp-0 #t) + (set! (-> choice 0) #t) + ) + ) + ((cpad-pressed? 0 right l-analog-right) + (set! gp-0 (the symbol (-> choice 0))) + (set! (-> choice 0) #f) + ) + ((cpad-pressed? 0 confirm) + (if (-> choice 0) + (kernel-shutdown (the int (runtime-exit-status exit))) + ) + ) + ) + ) + (if gp-0 + (sound-play "generic-beep") + ) + ) + 0 + ) diff --git a/goal_src/jak3/pc/progress/progress-static-pc.gc b/goal_src/jak3/pc/progress/progress-static-pc.gc new file mode 100644 index 0000000000..b3e3cc7f01 --- /dev/null +++ b/goal_src/jak3/pc/progress/progress-static-pc.gc @@ -0,0 +1,832 @@ +;;-*-Lisp-*- +(in-package goal) + +#|@file +Additional PC port specific file for overriding/expanding the progress menu +This gives us more freedom to write code how we want. +|# + +(define *title-pc* + (new 'static 'menu-option-list + :y-center #xc6 + :y-space 15 + :scale 0.82 + :options (new 'static 'boxed-array :type menu-option + (new 'static 'menu-sub-menu-option + :name (text-id progress-title-new-game) + :offset-y 0.15 + :next-state 'select-save-title + ) + (new 'static 'menu-sub-menu-option :name (text-id progress-load-save) :offset-y 0.3 :next-state 'select-load) + (new 'static 'menu-sub-menu-option :name (text-id progress-options) :offset-y 0.45 :next-state 'title-options) + (new 'static 'menu-sub-menu-option :name (text-id progress-secrets) :offset-y 0.6 :next-state 'unlocked-secrets) + (new 'static 'menu-exit-game-option :name (text-id progress-quit) :offset-y 0.75) + ) + ) + ) + +(define *sound-options-pc* + (progress-new-generic-scrolling-page (text-id progress-sound-options) + (new 'static 'menu-generic-slider-option + :name (text-id progress-sfx-volume) + :min-value 0.0 + :max-value 1.0 + :step 0.01 + :show-decimal? #t + :get-value-fn (lambda () (-> *pc-settings* memcard-volume-sfx)) + :on-confirm (lambda ((val float)) + (set! (-> *pc-settings* memcard-volume-sfx) val) + (pc-settings-save) + (set! (-> *setting-control* user-default sfx-volume) val))) + (new 'static 'menu-generic-slider-option + :name (text-id progress-music-volume) + :min-value 0.0 + :max-value 1.0 + :step 0.01 + :show-decimal? #t + :get-value-fn (lambda () (-> *pc-settings* memcard-volume-music)) + :on-confirm (lambda ((val float)) + (set! (-> *pc-settings* memcard-volume-music) val) + (pc-settings-save) + (set! (-> *setting-control* user-default music-volume) val))) + (new 'static 'menu-generic-slider-option + :name (text-id progress-speech-volume) + :min-value 0.0 + :max-value 1.0 + :step 0.01 + :show-decimal? #t + :get-value-fn (lambda () (-> *pc-settings* memcard-volume-dialog)) + :on-confirm (lambda ((val float)) + (set! (-> *pc-settings* memcard-volume-dialog) val) + (pc-settings-save) + (set! (-> *setting-control* user-default dialog-volume) val))) + (new 'static 'menu-generic-carousel-option + :name (text-id progress-sound-format) + :get-max-size-fn (lambda () 3) + :get-item-label-fn (lambda ((index int)) + (case index + ((0) (lookup-text! *common-text* (text-id progress-sound-mono) #f)) + ((1) (lookup-text! *common-text* (text-id progress-sound-stereo) #f)) + ((2) (lookup-text! *common-text* (text-id progress-sound-surround) #f)))) + :get-item-index-fn (lambda () (-> *setting-control* user-default stereo-mode)) + :on-confirm (lambda ((index int) (the-progress progress)) (set! (-> *setting-control* user-default stereo-mode) index))))) + +(define *options-options-pc* (new 'static 'menu-option-list + :y-center #xc6 + :y-space 30 + :scale 0.82 + :options (new 'static 'boxed-array :type menu-option + (new 'static 'menu-sub-menu-option + :name (text-id progress-game-options) + :offset-y 0.1 + :next-state 'game-options + ) + (new 'static 'menu-sub-menu-option + :name (text-id progress-graphic-options) + :offset-y 0.275 + :next-state 'graphic-options + ) + (new 'static 'menu-sub-menu-option + :name (text-id progress-sound-options) + :offset-y 0.45 + :next-state 'sound-options + ) + (new 'static 'menu-sub-menu-option + :name (text-id progress-picture-options) + :offset-y 0.625 + :next-state 'picture-options + ) + (new 'static 'menu-sub-menu-option + :name (text-id progress-camera-options) + :offset-y 0.8 + :next-state 'camera-options + ) + ) + ) + ) + +(define *unlocked-secrets-pc* + (new 'static 'menu-option-list + :y-center #xc6 + :y-space 30 + :scale 0.82 + :options (new 'static 'boxed-array :type menu-option + (new 'static 'menu-unlocked-sub-menu-option + :name (text-id progress-title-level-select-act-1) + :offset-y 0.0384 + :next-state 'select-start + :mask #x20 + :value 1 + ) + (new 'static 'menu-unlocked-sub-menu-option + :name (text-id progress-title-level-select-act-2) + :offset-y 0.1153 + :next-state 'select-start + :mask #x40 + :value 2 + ) + (new 'static 'menu-unlocked-sub-menu-option + :name (text-id progress-title-level-select-act-3) + :offset-y 0.1923 + :next-state 'select-start + :mask #x80 + :value 3 + ) + (new 'static 'menu-unlocked-sub-menu-option + :name (text-id progress-title-scrap-book) + :offset-y 0.2692 + :next-state 'go-away + :mask #x100 + :value 1 + ) + (new 'static 'menu-unlocked-sub-menu-option + :name (text-id progress-title-mega-scrap-book) + :offset-y 0.3461 + :next-state 'go-away + :mask #x200 + :value 2 + ) + (new 'static 'menu-unlocked-sub-menu-option + :name (text-id progress-title-jak1-mdl-viewer) + :offset-y 0.423 + :next-state 'select-model + :mask #x800 + :value 1 + ) + (new 'static 'menu-unlocked-sub-menu-option + :name (text-id progress-title-jak2-mdl-viewer) + :offset-y 0.5 + :next-state 'select-model + :mask #x1000 + :value 2 + ) + (new 'static 'menu-unlocked-sub-menu-option + :name (text-id progress-title-jak3-mdl-viewer) + :offset-y 0.5769 + :next-state 'select-model + :mask #x2000 + :value 3 + ) + (new 'static 'menu-unlocked-sub-menu-option + :name (text-id progress-scene-player-act-1) + :offset-y 0.6538 + :next-state 'select-scene + :mask #x2 + ) + (new 'static 'menu-unlocked-sub-menu-option + :name (text-id progress-scene-player-act-2) + :offset-y 0.7307 + :next-state 'select-scene + :mask #x4 + :value 1 + ) + (new 'static 'menu-unlocked-sub-menu-option + :name (text-id progress-scene-player-act-3) + :offset-y 0.8076 + :next-state 'select-scene + :mask #x8 + :value 2 + ) + (new 'static 'menu-unlocked-sub-menu-option + :name (text-id progress-title-commentary) + :offset-y 0.8846 + :next-state 'select-scene + :mask #x10 + :value 3 + ) + ; (new 'static 'menu-unlocked-sub-menu-option :name (text-id progress-music-player) :offset-y 0.9) + ) + ) + ) + +;; TODO - this is a gross misuse of macros, instead if we want to hide a very small amount of options in one menu versus another +;; it's a clear indication of a missing feature (add a lambda that determines visibility, or just the use disabled one) +(defmacro game-options-pc-input-options () + `(progress-new-generic-link-to-scrolling-page (text-id progress-menu-input-options) + ; (progress-new-generic-link-to-scrolling-page (text-id progress-camera-options) + ; (new 'static 'menu-generic-boolean-option + ; :name (text-id progress-camera-options-first-horz) + ; :truthy-text (text-id progress-normal) + ; :falsey-text (text-id progress-inverted) + ; :get-value-fn (lambda () (-> *pc-settings* first-camera-h-inverted?)) + ; :on-confirm (lambda ((val symbol)) + ; (set! (-> *pc-settings* first-camera-h-inverted?) val) + ; (pc-settings-save))) + ; (new 'static 'menu-generic-boolean-option + ; :name (text-id progress-camera-options-first-vert) + ; :truthy-text (text-id progress-normal) + ; :falsey-text (text-id progress-inverted) + ; :get-value-fn (lambda () (-> *pc-settings* first-camera-v-inverted?)) + ; :on-confirm (lambda ((val symbol)) + ; (set! (-> *pc-settings* first-camera-v-inverted?) val) + ; (pc-settings-save))) + ; (new 'static 'menu-generic-boolean-option + ; :name (text-id progress-camera-options-third-horz) + ; :truthy-text (text-id progress-normal) + ; :falsey-text (text-id progress-inverted) + ; :get-value-fn (lambda () (-> *pc-settings* third-camera-h-inverted?)) + ; :on-confirm (lambda ((val symbol)) + ; (set! (-> *pc-settings* third-camera-h-inverted?) val) + ; (pc-settings-save))) + ; (new 'static 'menu-generic-boolean-option + ; :name (text-id progress-camera-options-third-vert) + ; :truthy-text (text-id progress-normal) + ; :falsey-text (text-id progress-inverted) + ; :get-value-fn (lambda () (-> *pc-settings* third-camera-v-inverted?)) + ; :on-confirm (lambda ((val symbol)) + ; (set! (-> *pc-settings* third-camera-v-inverted?) val) + ; (pc-settings-save))) + ; (new 'static 'menu-generic-confirm-option + ; :name (text-id progress-restore-defaults) + ; :on-confirm (lambda ((val symbol)) + ; (reset-camera *pc-settings* #t) + ; (pc-settings-save)))) + (progress-new-generic-link-to-scrolling-page (text-id progress-menu-controller-options) :should-disable? (lambda () (<= (pc-get-controller-count) 0)) + (new 'static 'menu-generic-carousel-option + :name (text-id progress-controller-options-select-controller) + :get-max-size-fn (lambda () (pc-get-controller-count)) + :get-item-label-fn (lambda ((index int)) + (pc-get-controller-name index *pc-cpp-temp-string*) + *pc-cpp-temp-string*) + :get-item-index-fn (lambda () (pc-get-controller-index 0)) + :on-confirm (lambda ((index int) (the-progress progress)) (pc-set-controller! index 0))) + (new 'static 'menu-generic-boolean-option + :name (text-id progress-vibration) + :should-disable? (lambda () (not (pc-current-controller-has-rumble?))) + :truthy-text (text-id progress-on) + :falsey-text (text-id progress-off) + :get-value-fn (lambda () (-> *setting-control* user-default vibration)) + :on-confirm (lambda ((val symbol)) + (set! (-> *pc-settings* memcard-vibration?) val) + (pc-settings-save) + (set! (-> *setting-control* user-default vibration) val))) + (new 'static 'menu-generic-slider-option + :name (text-id progress-controller-options-analog-deadzone) + :min-value 0.0 + :max-value 1.0 + :step 0.01 + :show-decimal? #t + :get-value-fn (lambda () (-> *pc-settings* stick-deadzone)) + :on-confirm (lambda ((val float)) + (set! (-> *pc-settings* stick-deadzone) val) + (pc-settings-save))) + (new 'static 'menu-generic-boolean-option + :name (text-id progress-controller-options-ignore-if-unfocused) + :truthy-text (text-id progress-on) + :falsey-text (text-id progress-off) + :get-value-fn (lambda () (-> *pc-settings* ignore-controller-win-unfocused?)) + :on-confirm (lambda ((val symbol)) + (set! (-> *pc-settings* ignore-controller-win-unfocused?) val) + (pc-settings-save))) + (new 'static 'menu-generic-boolean-option + :name (text-id progress-controller-options-led-hp) + :should-disable? (lambda () (not (pc-current-controller-has-led?))) + :truthy-text (text-id progress-on) + :falsey-text (text-id progress-off) + :get-value-fn (lambda () (-> *pc-settings* controller-led-hp?)) + :on-confirm (lambda ((val symbol)) + (set! (-> *pc-settings* controller-led-hp?) val) + (pc-settings-save))) + (new 'static 'menu-generic-boolean-option + :name (text-id progress-controller-options-led-state) + :should-disable? (lambda () (not (pc-current-controller-has-led?))) + :truthy-text (text-id progress-on) + :falsey-text (text-id progress-off) + :get-value-fn (lambda () (-> *pc-settings* controller-led-eco?)) + :on-confirm (lambda ((val symbol)) + (set! (-> *pc-settings* controller-led-eco?) val) + (pc-settings-save))) + (new 'static 'menu-generic-boolean-option + :name (text-id progress-controller-options-enable-pressure-sensitivity) + :should-disable? (lambda () (not (pc-current-controller-has-pressure-sensitivity?))) + :truthy-text (text-id progress-on) + :falsey-text (text-id progress-off) + :get-value-fn (lambda () (pc-get-pressure-sensitivity-enabled?)) + :on-confirm (lambda ((val symbol)) (pc-set-pressure-sensitivity-enabled! val))) + (new 'static 'menu-generic-boolean-option + :name (text-id progress-controller-options-swap-r1-r2) + :truthy-text (text-id progress-on) + :falsey-text (text-id progress-off) + :get-value-fn (lambda () (-> *pc-settings* controller-swap-r1-r2?)) + :on-confirm (lambda ((val symbol)) + (set! (-> *pc-settings* controller-swap-r1-r2?) val) + (pc-settings-save))) + (new 'static 'menu-generic-boolean-option + :name (text-id progress-controller-options-enable-trigger-effects) + :should-disable? (lambda () (not (pc-current-controller-has-trigger-effect-support?))) + :truthy-text (text-id progress-on) + :falsey-text (text-id progress-off) + :get-value-fn (lambda () (pc-get-trigger-effects-enabled?)) + :on-confirm (lambda ((val symbol)) (pc-set-trigger-effects-enabled! val))) + (new 'static 'menu-generic-confirm-option + :name (text-id progress-restore-defaults) + :on-confirm (lambda ((val symbol)) + (reset-input *pc-settings* 'controller #t) + (pc-set-pressure-sensitivity-enabled! #f) + (pc-set-trigger-effects-enabled! #f) + (set-ignore-controller-in-bg! *pc-settings* (-> *pc-settings* ignore-controller-win-unfocused?)) + (pc-settings-save)))) + (new 'static 'menu-generic-boolean-option + :name (text-id progress-input-options-enable-keyboard) + :truthy-text (text-id progress-on) + :falsey-text (text-id progress-off) + :get-value-fn (lambda () (pc-get-keyboard-enabled?)) + :on-confirm (lambda ((val symbol)) (pc-set-keyboard-enabled! val))) + (new 'static 'menu-generic-boolean-option + :name (text-id progress-input-options-enable-mouse) + :truthy-text (text-id progress-on) + :falsey-text (text-id progress-off) + :get-value-fn (lambda () (-> *pc-settings* mouse-enabled?)) + :on-confirm (lambda ((val symbol)) + (set! (-> *pc-settings* mouse-enabled?) val) + (update-mouse-controls! *pc-settings*) + (pc-settings-save))) + (progress-new-generic-link-to-scrolling-page (text-id progress-menu-mouse-options) :should-disable? (lambda () (not (-> *pc-settings* mouse-enabled?))) + (new 'static 'menu-generic-boolean-option + :name (text-id progress-mouse-options-track-camera) + :truthy-text (text-id progress-on) + :falsey-text (text-id progress-off) + :get-value-fn (lambda () (-> *pc-settings* mouse-camera?)) + :on-confirm (lambda ((val symbol)) + (set! (-> *pc-settings* mouse-camera?) val) + (update-mouse-controls! *pc-settings*) + (pc-settings-save))) + (new 'static 'menu-generic-slider-option + :name (text-id progress-mouse-options-horz-sens) + :should-disable? (lambda () (not (-> *pc-settings* mouse-camera?))) + :min-value -100.0 + :max-value 100.0 + :step 0.10 + :show-decimal? #t + :get-value-fn (lambda () (-> *pc-settings* mouse-xsens)) + :on-confirm (lambda ((val float)) + (set! (-> *pc-settings* mouse-xsens) val) + (update-mouse-controls! *pc-settings*) + (pc-settings-save))) + (new 'static 'menu-generic-slider-option + :name (text-id progress-mouse-options-vert-sens) + :should-disable? (lambda () (not (-> *pc-settings* mouse-camera?))) + :min-value -100.0 + :max-value 100.0 + :step 0.10 + :show-decimal? #t + :get-value-fn (lambda () (-> *pc-settings* mouse-ysens)) + :on-confirm (lambda ((val float)) + (set! (-> *pc-settings* mouse-ysens) val) + (update-mouse-controls! *pc-settings*) + (pc-settings-save))) + (new 'static 'menu-generic-boolean-option + :name (text-id progress-mouse-options-player-movement) + :truthy-text (text-id progress-on) + :falsey-text (text-id progress-off) + :get-value-fn (lambda () (-> *pc-settings* mouse-movement?)) + :on-confirm (lambda ((val symbol)) + (set! (-> *pc-settings* mouse-movement?) val) + (update-mouse-controls! *pc-settings*) + (pc-settings-save))) + (new 'static 'menu-generic-confirm-option + :name (text-id progress-restore-defaults) + :on-confirm (lambda ((val symbol)) + (reset-input *pc-settings* 'mouse #t) + (update-mouse-controls! *pc-settings*) + (pc-settings-save)))) + (new 'static 'menu-generic-boolean-option + :name (text-id progress-input-options-auto-hide-cursor) + :truthy-text (text-id progress-on) + :falsey-text (text-id progress-off) + :get-value-fn (lambda () (-> *pc-settings* auto-hide-cursor?)) + :on-confirm (lambda ((val symbol)) + (set! (-> *pc-settings* auto-hide-cursor?) val) + (update-mouse-controls! *pc-settings*) + (pc-settings-save))) + (progress-new-generic-link-to-scrolling-page (text-id progress-menu-reassign-binds) + (progress-new-generic-link-to-keybind-details-page (text-id progress-reassign-binds-controller) + :should-disable? (lambda () (<= (pc-get-controller-count) 0)) + :device-type controller + :entries (select l3 r3 start dpad-up dpad-right dpad-down dpad-left l2 r2 l1 r1 triangle circle cross square) + :confirm ((text-id progress-restore-defaults) (lambda () (pc-reset-bindings-to-defaults! 0 0)))) + (progress-new-generic-link-to-keybind-details-page (text-id progress-reassign-binds-keyboard) + :should-disable? (lambda () (not (pc-get-keyboard-enabled?))) + :device-type keyboard + :entries (l-analog-up l-analog-down l-analog-left l-analog-right r-analog-up r-analog-down r-analog-left r-analog-right + select l3 r3 start dpad-up dpad-right dpad-down dpad-left l2 r2 l1 r1 triangle circle cross square) + :confirm ((text-id progress-restore-defaults) (lambda () (pc-reset-bindings-to-defaults! 0 1)))) + (progress-new-generic-link-to-keybind-details-page (text-id progress-reassign-binds-mouse) + :should-disable? (lambda () (not (-> *pc-settings* mouse-enabled?))) + :device-type mouse + :entries (select l3 r3 start dpad-up dpad-right dpad-down dpad-left l2 r2 l1 r1 triangle circle cross square) + :confirm ((text-id progress-restore-defaults) (lambda () (pc-reset-bindings-to-defaults! 0 2))))) + (new 'static 'menu-generic-confirm-option + :name (text-id progress-restore-defaults) + :on-confirm (lambda ((val symbol)) + (reset-input *pc-settings* 'input #t) + (pc-set-keyboard-enabled! (-> *pc-settings* keyboard-enabled?)) + (update-mouse-controls! *pc-settings*) + (pc-settings-save))))) + +(defmacro game-options-pc-subtitle-toggle () + `(new 'static 'menu-generic-boolean-option + :name (text-id progress-subtitles) + :truthy-text (text-id progress-on) + :falsey-text (text-id progress-off) + :get-value-fn (lambda () (-> *setting-control* user-default subtitle)) + :on-confirm (lambda ((val symbol)) + (set! (-> *pc-settings* memcard-subtitles?) val) + (pc-settings-save) + (set! (-> *setting-control* user-default subtitle) val)))) + +(defmacro game-options-pc-hint-subtitle-toggle () + `(new 'static 'menu-generic-boolean-option + :name (text-id progress-hint-subtitles) + :truthy-text (text-id progress-on) + :falsey-text (text-id progress-off) + :get-value-fn (lambda () (-> *pc-settings* hinttitles?)) + :on-confirm (lambda ((val symbol)) + (set! (-> *pc-settings* hinttitles?) val) + (pc-settings-save)))) + +(defmacro game-options-pc-subtitle-language () + `(new 'static 'menu-generic-carousel-option + :name (text-id progress-subtitle-language) + :items (new 'static 'boxed-array :type text-id + (text-id progress-language-english) + (text-id progress-language-french) + (text-id progress-language-german) + (text-id progress-language-spanish) + (text-id progress-language-italian) + (text-id progress-language-commentary) + (text-id progress-language-japanese) + (text-id progress-language-korean) + (text-id progress-language-russian) + (text-id progress-language-portuguese) + (text-id progress-language-dutch) + (text-id progress-language-english-uk) + ; (text-id language-name-finnish) + ; (text-id language-name-swedish) + ; (text-id language-name-danish) + ; (text-id language-name-norwegian) + ; (text-id language-name-dutch) + ; (text-id language-name-br-portuguese) + ; (text-id language-name-hungarian) + ; (text-id language-name-catalan) + ; (text-id language-name-icelandic) + ; (text-id language-name-polish) + ; (text-id language-name-lithuanian) + ; (text-id language-name-czech) + ; (text-id language-name-croatian) + ; (text-id language-name-galician) + ) + :get-item-index-fn (lambda () (-> *pc-settings* subtitle-language)) + :on-confirm (lambda ((index int) (the-progress progress)) + (set! (-> *pc-settings* subtitle-language) (the-as pc-language index)) + (pc-settings-save)))) + +(defmacro game-options-pc-sound-language () + `(new 'static 'menu-generic-carousel-option + :name (text-id progress-language) + :items (new 'static 'boxed-array :type text-id + (text-id progress-language-english) + (text-id progress-language-french) + (text-id progress-language-german) + (text-id progress-language-spanish) + (text-id progress-language-italian) + (text-id progress-language-commentary) + (text-id progress-language-japanese) + (text-id progress-language-korean) + (text-id progress-language-russian) + (text-id progress-language-portuguese) + (text-id progress-language-dutch) + (text-id progress-language-english-uk) + ) + :get-item-index-fn (lambda () (-> *setting-control* user-default language)) + :on-confirm (lambda ((index int) (the-progress progress)) + (set! (-> *setting-control* user-default language) (the-as language-enum index))))) + +(defmacro game-options-pc-text-language () + `(new 'static 'menu-generic-carousel-option + :name (text-id progress-text-language) + :items (new 'static 'boxed-array :type text-id + (text-id progress-language-english) + (text-id progress-language-french) + (text-id progress-language-german) + (text-id progress-language-spanish) + (text-id progress-language-italian) + (text-id progress-language-commentary) + (text-id progress-language-japanese) + (text-id progress-language-korean) + (text-id progress-language-russian) + (text-id progress-language-portuguese) + (text-id progress-language-dutch) + (text-id progress-language-english-uk) + ; (text-id language-name-finnish) + ; (text-id language-name-swedish) + ; (text-id language-name-danish) + ; (text-id language-name-norwegian) + ; (text-id language-name-dutch) + ; (text-id language-name-br-portuguese) + ; (text-id language-name-hungarian) + ; (text-id language-name-catalan) + ; (text-id language-name-icelandic) + ; (text-id language-name-polish) + ; (text-id language-name-lithuanian) + ; (text-id language-name-czech) + ; (text-id language-name-croatian) + ; (text-id language-name-galician) + ) + :get-item-index-fn (lambda () (-> *pc-settings* text-language)) + :on-confirm (lambda ((index int) (the-progress progress)) + (set! (-> *pc-settings* text-language) (the-as pc-language index)) + ;; NOTE - this doesn't actually work (naughty dog tried it too in their progress code) + (load-level-text-files (the-as int (-> *pc-settings* text-language))) + (pc-settings-save)))) + +(defmacro misc-options-pc-discord-rpc () + `(new 'static 'menu-generic-boolean-option + :name (text-id progress-discord-rpc) + :truthy-text (text-id progress-on) + :falsey-text (text-id progress-off) + :get-value-fn (lambda () (-> *pc-settings* discord-rpc?)) + :on-confirm (lambda ((val symbol)) + (set! (-> *pc-settings* discord-rpc?) val) + (pc-settings-save)))) + +(defmacro misc-options-pc-speedrunner-mode () + `(new 'static 'menu-generic-boolean-option + :name (text-id progress-speedrunner-mode) + :truthy-text (text-id progress-on) + :falsey-text (text-id progress-off) + :get-value-fn (lambda () (-> *pc-settings* speedrunner-mode?)) + :on-confirm (lambda ((val symbol)) + (set! (-> *pc-settings* speedrunner-mode?) val) + (pc-settings-save)))) + +(defmacro misc-options-pc-fast-progress () + `(new 'static 'menu-generic-boolean-option + :name (text-id progress-fast-progress) + :truthy-text (text-id progress-on) + :falsey-text (text-id progress-off) + :get-value-fn (lambda () (-> *pc-settings* fast-progress?)) + :on-confirm (lambda ((val symbol)) + (set! (-> *pc-settings* fast-progress?) val) + (pc-settings-save)))) + +(defmacro misc-options-pc-projectile-focus () + `(new 'static 'menu-generic-boolean-option + :name (text-id progress-misc-fix-projectile-focus) + :truthy-text (text-id progress-on) + :falsey-text (text-id progress-off) + :get-value-fn (lambda () (-> *pc-settings* fix-projectile-focus)) + :on-confirm (lambda ((val symbol)) + (set! (-> *pc-settings* fix-projectile-focus) val) + (pc-settings-save)))) + +(define *game-options-pc* + (progress-new-generic-scrolling-page (text-id progress-game-options) + (game-options-pc-input-options) + (game-options-pc-subtitle-toggle) + (game-options-pc-hint-subtitle-toggle) + (game-options-pc-subtitle-language) + (game-options-pc-sound-language) + (game-options-pc-text-language) + (progress-new-generic-link-to-scrolling-page (text-id progress-misc-game-options) + (misc-options-pc-discord-rpc) + (misc-options-pc-speedrunner-mode) + (misc-options-pc-fast-progress) + (misc-options-pc-projectile-focus)))) + +(define *game-options-title-pc* + (progress-new-generic-scrolling-page (text-id progress-game-options) + (game-options-pc-input-options) + (game-options-pc-subtitle-toggle) + (game-options-pc-hint-subtitle-toggle) + (game-options-pc-subtitle-language) + (game-options-pc-sound-language) + (game-options-pc-text-language) + ;; TODO - is there a reason we only display the territory setting on the title screen? + (new 'static 'menu-generic-carousel-option + :name (text-id progress-territory) + :items (new 'static 'boxed-array :type text-id + (text-id progress-territory-auto) + (text-id progress-territory-scea) + (text-id progress-territory-scee) + (text-id progress-territory-scei) + (text-id progress-territory-scek)) + :get-item-index-fn (lambda () (1+ (-> *pc-settings* territory))) + :on-confirm (lambda ((index int) (the-progress progress)) (set! (-> *pc-settings* territory) (1- index)) (pc-settings-save))) + (progress-new-generic-link-to-scrolling-page (text-id progress-misc-game-options) + (misc-options-pc-discord-rpc) + (misc-options-pc-speedrunner-mode) + ;; TODO - is there a reason we only display the fast airlock and fast-elevator setting on the title screen (worried about people changing it mid game?) + (new 'static 'menu-generic-boolean-option + :name (text-id progress-fast-airlock) + :truthy-text (text-id progress-on) + :falsey-text (text-id progress-off) + :get-value-fn (lambda () (-> *pc-settings* fast-airlock?)) + :on-confirm (lambda ((val symbol)) + (set! (-> *pc-settings* fast-airlock?) val) + (pc-settings-save))) + (new 'static 'menu-generic-boolean-option + :name (text-id progress-fast-elevator) + :truthy-text (text-id progress-on) + :falsey-text (text-id progress-off) + :get-value-fn (lambda () (-> *pc-settings* fast-elevator?)) + :on-confirm (lambda ((val symbol)) + (set! (-> *pc-settings* fast-elevator?) val) + (pc-settings-save))) + (misc-options-pc-fast-progress)))) + + +(define *msaa-options* (new 'static 'boxed-array :type int16 1 2 4 8 16)) +(define *frame-rate-options* (new 'static 'boxed-array :type int16 60 75 90 120 144 165 240)) +(define *frame-rate-disclaimer-seen?* #f) + +(define *graphic-options-pc* + (progress-new-generic-scrolling-page (text-id progress-graphic-options) + ;; NOTE/TODO - this doesn't follow the established generic menu pattern + ;; a generic scrolling list menu component should be created (similar to menu-generic-details-page) + ;; so the code can be localized to functions instead of scattered around in a bunch of switch statements + (new 'static 'menu-generic-to-resolutions-option + :name (text-id progress-window-size) + :on-confirm (lambda ((the-progress progress)) + (push-and-set-state the-progress 'resolutions))) + (new 'static 'menu-generic-carousel-option + :name (text-id progress-graphics-display) + :get-item-index-fn (lambda () (pc-get-display-id)) + :get-max-size-fn (lambda () (pc-get-display-count)) + :get-item-label-fn (lambda ((index int)) + (let ((name (pc-get-display-name index *pc-cpp-temp-string*))) + (if name + (string-format "(~D) ~S" index *pc-cpp-temp-string*) + (string-format "Dis~+7Vp~-7Vla~+7Vy~-7V ~D" index)) + )) + :on-confirm (lambda ((index int) (the-progress progress)) + (pc-set-display-id! index)) + :should-disable? (lambda () (or (= (pc-get-display-mode) 'windowed) (<= (pc-get-display-count) 1)))) + (new 'static 'menu-generic-carousel-option + :name (text-id progress-display-mode) + :items (new 'static 'boxed-array :type text-id + (text-id progress-windowed) + (text-id progress-fullscreen) + (text-id progress-borderless)) + :get-item-index-fn (lambda () + (case (pc-get-display-mode) + (('windowed) 0) + (('fullscreen) 1) + (('borderless) 2))) + :on-confirm (lambda ((index int) (the-progress progress)) + (case index + ((0) (pc-set-display-mode! 'windowed)) + ((1) (pc-set-display-mode! 'fullscreen)) + ((2) (pc-set-display-mode! 'borderless))))) + (new 'static 'menu-generic-carousel-option + :name (text-id progress-graphics-aspect-ratio) + :items (new 'static 'boxed-array :type text-id + (text-id progress-aspect-ratio-4x3) + (text-id progress-aspect-ratio-16x9) + (text-id progress-aspect-ratio-auto) + (text-id progress-aspect-ratio-custom)) + :get-item-index-fn (lambda () + (cond + ((not (-> *pc-settings* use-vis?)) + (if (-> *pc-settings* aspect-ratio-auto?) 2 3)) + (else + (case (get-aspect-ratio) + (('aspect16x9) 1) + (else 0))))) + :on-confirm (lambda ((index int) (the-progress progress)) + (case index + ((0) + (if (not (-> *pc-settings* use-vis?)) + (false! (-> *setting-control* user-current aspect-ratio))) + (set! (-> *setting-control* user-default aspect-ratio) 'aspect4x3) + (true! (-> *pc-settings* use-vis?))) + ((1) + (if (not (-> *pc-settings* use-vis?)) + (false! (-> *setting-control* user-current aspect-ratio))) + (set! (-> *setting-control* user-default aspect-ratio) 'aspect16x9) + (true! (-> *pc-settings* use-vis?))) + ((2) + (set! (-> *setting-control* user-default aspect-ratio) 'aspect4x3) + (true! (-> *pc-settings* aspect-ratio-auto?)) + (false! (-> *pc-settings* use-vis?))) + ((3) + (push-and-set-state the-progress 'aspect-ratio-custom))) + (pc-settings-save))) + (new 'static 'menu-generic-carousel-option + :name (text-id progress-frame-rate) + :should-disable? (lambda () (or (not *debug-segment*) (-> *pc-settings* speedrunner-mode?))) + :get-item-index-fn (lambda () + ;; TODO - use an array + (case (-> *pc-settings* target-fps) + ((60) 0) + ((75) 1) + ((90) 2) + ((120) 3) + ((144) 4) + ((165) 5) + ((240) 6))) + :get-max-size-fn (lambda () (-> *frame-rate-options* length)) + :get-item-label-fn (lambda ((index int)) (string-format "~D" (-> *frame-rate-options* index))) + :on-confirm (lambda ((index int) (the-progress progress)) + (cond + ((or (zero? index) (= (-> *frame-rate-options* index) (-> *pc-settings* target-fps)) *frame-rate-disclaimer-seen?*) + (set-frame-rate! *pc-settings* (-> *frame-rate-options* index) #t) + (pc-settings-save)) + (else + (defun-extern set-progress-frame-rate-index int int) + (set-progress-frame-rate-index index) + (push-and-set-state the-progress 'fps-disclaimer))))) + (new 'static 'menu-generic-boolean-option + :name (text-id progress-vsync) + :truthy-text (text-id progress-on) + :falsey-text (text-id progress-off) + :get-value-fn (lambda () (-> *pc-settings* vsync?)) + :on-confirm (lambda ((val symbol)) + (set! (-> *pc-settings* vsync?) val) + (pc-settings-save))) + (new 'static 'menu-generic-carousel-option + :name (text-id progress-msaa) + :get-item-index-fn (lambda () + ;; TODO - use an array + (case (-> *pc-settings* gfx-msaa) + ((1) 0) + ((2) 1) + ((4) 2) + ((8) 3) + ((16) 4))) + :get-max-size-fn (lambda () (-> *msaa-options* length)) + :get-item-label-fn (lambda ((index int)) + (if (zero? index) + (lookup-text! *common-text* (text-id progress-graphics-msaa-off) #f) + (string-format (lookup-text! *common-text* (text-id progress-msaa-x) #f) (-> *msaa-options* index)))) + :on-confirm (lambda ((index int) (the-progress progress)) + (set! (-> *pc-settings* gfx-msaa) (ash 1 index)) + (pc-settings-save))) + (progress-new-generic-link-to-scrolling-page (text-id progress-graphics-ps2) + (new 'static 'menu-generic-boolean-option + :name (text-id progress-lod-bg) + :truthy-text (text-id progress-lod-low) + :falsey-text (text-id progress-lod-high) + :get-value-fn (lambda () (> (-> *pc-settings* lod-force-tfrag) 0)) + :on-confirm (lambda ((val symbol)) + (cond + (val + (set! (-> *pc-settings* lod-force-tfrag) 2) + (set! (-> *pc-settings* lod-force-tie) 2)) + (else + (set! (-> *pc-settings* lod-force-tfrag) 0) + (set! (-> *pc-settings* lod-force-tie) 0))) + (pc-settings-save))) + (static-progress-generic-pc-settings-lod-default-high-boolean (text-id progress-lod-fg) (-> *pc-settings* ps2-lod-dist?)) + (static-progress-generic-pc-settings-on-off-boolean (text-id progress-ps2-parts) (-> *pc-settings* ps2-parts?)) + (static-progress-generic-pc-settings-shadows-normal-extended-boolean (text-id progress-shadows) (-> *pc-settings* ps2-shadow?)) + (static-progress-generic-pc-settings-on-off-boolean (text-id progress-hires-sky) (-> *pc-settings* hires-clouds?))) + )) + + + +(define *frame-rate-disclaimer-options* + (new 'static 'menu-option-list + :y-center 198 + :y-space 34 + :scale 0.82 + :options (new 'static 'boxed-array :type menu-option (new 'static 'menu-frame-rate-disclaimer-option)) + ) + ) + +(define *aspect-ratio-custom-options* + (new 'static 'menu-option-list + :y-center 198 + :y-space 34 + :scale 0.82 + :options (new 'static 'boxed-array :type menu-option + (new 'static 'menu-aspect-ratio-custom-option :name (text-id progress-aspect-ratio-custom-title)) + ) + ) + ) + + +(define *music-player-options* + (new 'static 'menu-option-list + :y-center 198 + :y-space 34 + :scale 0.82 + :options (new 'static 'boxed-array :type menu-option + (new 'static 'menu-music-player-option :name (text-id progress-music-player)) + ) + ) + ) + + +(define *resolutions-options* + (new 'static 'menu-option-list + :y-center 198 + :y-space 34 + :scale 0.82 + :options (new 'static 'boxed-array :type menu-option + (new 'static 'menu-resolution-option :name (text-id progress-window-size)) + ) + ) + ) + + diff --git a/goal_src/jak3/pc/util/display-font-color.gc b/goal_src/jak3/pc/util/display-font-color.gc new file mode 100644 index 0000000000..4b26f7d56e --- /dev/null +++ b/goal_src/jak3/pc/util/display-font-color.gc @@ -0,0 +1,42 @@ +;;-*-Lisp-*- +(in-package goal) +(require "engine/gfx/hw/display-h.gc") +(require "kernel/gstring.gc") +(require "kernel/gstate.gc") + +(defun font-color->string ((val font-color)) + (enum->string font-color val)) + +(deftype color-display (process) ()) + +(define *color-displays* (the color-display #f)) + +(defmethod relocate ((this color-display) (offset int)) + (set! *color-displays* this) + (if *color-displays* (&+! *color-displays* offset)) + (call-parent-method this offset)) + +(defun draw-all-font-colors () + (with-dma-buffer-add-bucket ((buf (-> (current-frame) debug-buf)) (bucket-id debug-no-zbuf2)) + (dotimes (i 44) + (draw-string-xy (string-format "~2D ~S" i (font-color->string (the font-color i))) + buf + (+ 4 (* (get-screen-x 0.5) (mod i 2))) + (+ 8 (* 8 (/ i 2))) + (the font-color i) + (font-flags shadow))))) + +(defun start-display-text-colors () + (if *color-displays* + (format #t "Colors are already being displayed") + (set! *color-displays* + (the color-display (ppointer->process (process-spawn-function color-display + :name "color-display" + (lambda :behavior color-display () + (loop + (draw-all-font-colors) + (suspend))))))))) + +(defun-debug stop-display-text-colors () + "Kill the example text color display" + (kill-by-name "color-display" *active-pool*)) diff --git a/test/decompiler/reference/jak3/engine/common-obs/collectables_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/collectables_REF.gc index 98aff6b322..328d0eb18b 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/collectables_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/collectables_REF.gc @@ -2435,7 +2435,7 @@ ;; definition of type ammo-collectable (deftype ammo-collectable (collectable) - ((ammo-effect basic) + ((ammo-effect sparticle-launch-group) ) ) diff --git a/test/decompiler/reference/jak3/engine/common-obs/generic-obs_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/generic-obs_REF.gc index 04f8f1ff34..8443071ca0 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/generic-obs_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/generic-obs_REF.gc @@ -4494,7 +4494,7 @@ (deftype level-exit (process-drawable) ((minimap connection-minimap) (task-counter uint32) - (ent basic) + (ent entity-actor) ) (:state-methods active diff --git a/test/decompiler/reference/jak3/engine/target/flut/flut-h_REF.gc b/test/decompiler/reference/jak3/engine/target/flut/flut-h_REF.gc index b0a2a2cc21..120d4a59b9 100644 --- a/test/decompiler/reference/jak3/engine/target/flut/flut-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/flut/flut-h_REF.gc @@ -11,7 +11,7 @@ (stick-lock symbol) (flap-sound-id uint32) (mode-sound-bank connection) - (mode basic) + (mode symbol) (color-index int32) (as-daxter? symbol) (art-group-backup art-group) diff --git a/test/decompiler/reference/jak3/engine/target/flut/target-flut_REF.gc b/test/decompiler/reference/jak3/engine/target/flut/target-flut_REF.gc index d397046ea9..cd3e8d64d9 100644 --- a/test/decompiler/reference/jak3/engine/target/flut/target-flut_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/flut/target-flut_REF.gc @@ -1041,19 +1041,19 @@ (set! (-> self flut color-index) arg2) (case arg1 ((#t) - (set! (-> self flut mode) (the-as basic 'normal)) + (set! (-> self flut mode) 'normal) (set! (-> self flut as-daxter?) #f) ) (('racer) - (set! (-> self flut mode) (the-as basic arg1)) + (set! (-> self flut mode) arg1) (set! (-> self flut as-daxter?) #f) ) (('wild) - (set! (-> self flut mode) (the-as basic arg1)) + (set! (-> self flut mode) arg1) (set! (-> self flut as-daxter?) #t) ) (else - (set! (-> self flut mode) (the-as basic arg1)) + (set! (-> self flut mode) arg1) (set! (-> self flut as-daxter?) #f) ) ) diff --git a/test/decompiler/reference/jak3/engine/target/mech/mech-h_REF.gc b/test/decompiler/reference/jak3/engine/target/mech/mech-h_REF.gc index ee94412385..a571694a0d 100644 --- a/test/decompiler/reference/jak3/engine/target/mech/mech-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/mech/mech-h_REF.gc @@ -19,8 +19,8 @@ (mech-start-time time-frame) (mech-time time-frame) (no-get-off-time time-frame) - (stick-lock basic) - (stick-off basic) + (stick-lock symbol) + (stick-off symbol) (forward-vel meters) (jump-thrust meters) (jump-thrust-fuel float) @@ -43,8 +43,8 @@ (exhaust-local-dir vector 2 :inline) (smoke-local-pos vector 2 :inline) (smoke-local-vel vector 2 :inline) - (particle-system-2d basic) - (particle-system-3d basic) + (particle-system-2d sparticle-system) + (particle-system-3d sparticle-system) (part-thruster sparticle-launcher) (part-thruster-scale-x sp-field-init-spec) (part-thruster-scale-y sp-field-init-spec) diff --git a/test/decompiler/reference/jak3/engine/target/mech/mech-part_REF.gc b/test/decompiler/reference/jak3/engine/target/mech/mech-part_REF.gc index 31a07412da..c79e883b6e 100644 --- a/test/decompiler/reference/jak3/engine/target/mech/mech-part_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/mech/mech-part_REF.gc @@ -159,14 +159,7 @@ (a2-4 *launch-matrix*) ) (vector-copy! (-> a2-4 trans) s0-0) - (t9-4 - (the-as sparticle-system a0-7) - a1-6 - a2-4 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) + (t9-4 a0-7 a1-6 a2-4 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) ) diff --git a/test/decompiler/reference/jak3/engine/target/mech/mech-states_REF.gc b/test/decompiler/reference/jak3/engine/target/mech/mech-states_REF.gc index 634013aad4..941c4bcdf0 100644 --- a/test/decompiler/reference/jak3/engine/target/mech/mech-states_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/mech/mech-states_REF.gc @@ -1094,7 +1094,7 @@ ) :trans (-> target-mech-hit trans) :code (behavior ((arg0 symbol)) - (set! (-> self mech stick-off) (the-as basic #t)) + (set! (-> self mech stick-off) #t) (set! (-> self control unknown-word04) (the-as uint #f)) (set! (-> self control did-move-to-pole-or-max-jump-height) (the-as float (send-event (handle->process (-> self attack-info attacker)) 'target 'die arg0)) @@ -1383,7 +1383,7 @@ ) :enter (behavior () (set! (-> self control mod-surface) *mech-pickup-mods*) - (set! (-> self mech stick-off) (the-as basic #t)) + (set! (-> self mech stick-off) #t) (set-time! (-> self state-time)) (set-forward-vel 0.0) (set! (-> self carry other) (the-as handle #f)) @@ -1606,7 +1606,7 @@ (set! (-> self control mod-surface) *mech-walk-mods*) (set-time! (-> self state-time)) (set-forward-vel 0.0) - (set! (-> self mech stick-off) (the-as basic #t)) + (set! (-> self mech stick-off) #t) ) :exit (-> target-mech-carry-pickup exit) :code (behavior () @@ -2369,7 +2369,7 @@ (set! (-> self control mod-surface) *mech-walk-mods*) (set-time! (-> self state-time)) (set-forward-vel 0.0) - (set! (-> self mech stick-off) (the-as basic #t)) + (set! (-> self mech stick-off) #t) ) :exit (-> target-mech-carry-pickup exit) :code (behavior () @@ -2471,7 +2471,7 @@ (vector-copy! (-> self mech mech-trans) (-> self control unknown-vector38)) (quaternion-copy! (the-as quaternion (-> self mech mech-quat)) (-> self control unknown-quat40)) (vector-copy! (-> self mech mech-scale) (-> self control scale)) - (set! (-> self mech stick-off) (the-as basic #t)) + (set! (-> self mech stick-off) #t) (ja-no-eval :group! jakb-mech-get-on-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((f30-0 (sin (lerp-scale 0.0 16384.0 (ja-aframe-num 0) 70.0 80.0)))) @@ -2534,7 +2534,7 @@ (vector-copy! (-> self mech mech-trans) (-> self control unknown-vector38)) (quaternion-copy! (the-as quaternion (-> self mech mech-quat)) (-> self control unknown-quat40)) (vector-copy! (-> self mech mech-scale) (-> self control scale)) - (set! (-> self mech stick-off) (the-as basic #t)) + (set! (-> self mech stick-off) #t) (ja-no-eval :group! jakb-mech-get-on-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((f30-0 (sin (lerp-scale 0.0 16384.0 (ja-aframe-num 0) 70.0 80.0)))) @@ -2574,7 +2574,7 @@ :event target-mech-handler :enter (behavior () (vector-reset! (-> self control transv)) - (set! (-> self mech stick-off) (the-as basic #t)) + (set! (-> self mech stick-off) #t) (send-event (handle->process (-> self mech shield-handle)) 'enabled) ) :exit (behavior () @@ -2701,7 +2701,7 @@ (set! (-> self neck flex-blend) 0.0) (logior! (-> self target-flags) (target-flags tf2)) (logior! (-> self focus-status) (focus-status grabbed)) - (set! (-> self mech stick-off) (the-as basic #t)) + (set! (-> self mech stick-off) #t) (sound-stop (-> self mech engine-sound-id)) (sound-stop (-> self mech thrust-sound-id)) (sound-stop (-> self mech drag-sound-id)) diff --git a/test/decompiler/reference/jak3/engine/target/target-util_REF.gc b/test/decompiler/reference/jak3/engine/target/target-util_REF.gc index cbc99b7ef7..4989878d8d 100644 --- a/test/decompiler/reference/jak3/engine/target/target-util_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-util_REF.gc @@ -324,8 +324,8 @@ (fall-height meters) (mech-jump-thrust-fuel float) (strafe-jump-pre-window time-frame) - (strafe-jump basic) - (strafe-duck-jump basic) + (strafe-jump symbol) + (strafe-duck-jump symbol) (dark-jump-height-min meters) (dark-jump-height-max meters) (ladder-walk-up-speed meters) diff --git a/test/decompiler/reference/jak3/engine/ui/progress/progress-draw_REF.gc b/test/decompiler/reference/jak3/engine/ui/progress/progress-draw_REF.gc index 9cbb8918d8..dfde34a5db 100644 --- a/test/decompiler/reference/jak3/engine/ui/progress/progress-draw_REF.gc +++ b/test/decompiler/reference/jak3/engine/ui/progress/progress-draw_REF.gc @@ -113,7 +113,7 @@ ) ;; definition for method 53 of type progress -;; WARN: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs object. (defmethod progress-method-53 ((this progress) (arg0 font-context)) (let ((v1-1 (get-scissor-stack-top this))) (let ((a0-1 arg0) @@ -129,30 +129,28 @@ (set! (-> arg0 height) (- (-> v1-1 w) (-> v1-1 y))) ) 0 - (none) ) ;; definition for method 36 of type progress (defmethod get-language-by-idx ((this progress) (arg0 int)) (if (and (= (scf-get-territory) 1) (zero? (-> this languages arg0))) 11 - (-> this languages arg0) + (the-as int (-> this languages arg0)) ) ) ;; definition for method 38 of type progress -;; WARN: Return type mismatch int vs none. -(defmethod progress-method-38 ((this progress) (arg0 font-context) (arg1 float)) +;; WARN: Return type mismatch int vs object. +(defmethod adjust-font-origin-y ((this progress) (arg0 font-context) (arg1 float)) (let ((v1-1 (get-scissor-stack-top this))) (set! (-> arg0 origin y) (+ (-> v1-1 y) (* (- (-> v1-1 w) (-> v1-1 y)) arg1))) ) 0 - (none) ) ;; definition for method 37 of type progress -;; WARN: Return type mismatch int vs none. -(defmethod progress-method-37 ((this progress)) +;; WARN: Return type mismatch int vs object. +(defmethod set-selected-color ((this progress)) (with-pp (let ((gp-0 33)) (if (< (seconds 0.027) (logand (-> pp clock integral-frame-counter) 15)) @@ -171,13 +169,13 @@ (new 'static 'rgba :r #x60 :g #x60 :b #x60 :a #x80) ) ) + gp-0 ) - (none) ) ) ;; definition for method 44 of type progress -;; WARN: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs object. (defmethod progress-method-44 ((this progress) (arg0 font-context) (arg1 string)) (let ((f0-1 (- 1.0 (-> this menu-transition)))) (set-scale! arg0 0.5) @@ -185,7 +183,6 @@ ) (print-game-text arg1 arg0 #f 44 (bucket-id hud-draw-hud-alpha)) 0 - (none) ) ;; definition for method 45 of type progress @@ -248,8 +245,8 @@ ) ;; definition for method 40 of type progress -;; WARN: Return type mismatch int vs none. -(defmethod progress-method-40 ((this progress) (arg0 font-context) (arg1 int) (arg2 int) (arg3 float)) +;; WARN: Return type mismatch int vs object. +(defmethod draw-highlight-bar ((this progress) (arg0 font-context) (arg1 int) (arg2 int) (arg3 float)) (let* ((v1-1 (get-scissor-stack-top this)) (a1-1 (the int (-> v1-1 x))) (a3-1 (the int (- (-> v1-1 z) (-> v1-1 x)))) @@ -270,12 +267,11 @@ ) ) 0 - (none) ) ;; definition for method 41 of type progress -;; WARN: Return type mismatch int vs none. -(defmethod progress-method-41 ((this progress) (arg0 progress-box) (arg1 float)) +;; WARN: Return type mismatch int vs object. +(defmethod draw-bg-box-outline ((this progress) (arg0 progress-box) (arg1 float)) (with-dma-buffer-add-bucket ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id particles) ) @@ -291,12 +287,11 @@ ) ) 0 - (none) ) ;; definition for method 42 of type progress -;; WARN: Return type mismatch int vs none. -(defmethod progress-method-42 ((this progress) (arg0 progress-box) (arg1 float)) +;; WARN: Return type mismatch int vs object. +(defmethod draw-bg-box-alpha-2 ((this progress) (arg0 progress-box) (arg1 float)) (with-dma-buffer-add-bucket ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id particles) ) @@ -312,12 +307,11 @@ ) ) 0 - (none) ) ;; definition for method 43 of type progress -;; WARN: Return type mismatch int vs none. -(defmethod progress-method-43 ((this progress) (arg0 progress-box) (arg1 float)) +;; WARN: Return type mismatch int vs object. +(defmethod draw-bg-box-alpha-1 ((this progress) (arg0 progress-box) (arg1 float)) (with-dma-buffer-add-bucket ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id bucket6) ) @@ -333,17 +327,16 @@ ) ) 0 - (none) ) ;; definition for method 46 of type progress -;; WARN: Return type mismatch int vs none. -(defmethod progress-method-46 ((this progress) (arg0 font-context) (arg1 float) (arg2 int)) +;; WARN: Return type mismatch int vs object. +(defmethod draw-header ((this progress) (arg0 font-context) (arg1 float) (arg2 text-id)) (progress-method-33 this (-> *progress-work* header)) (let ((s3-0 (get-scissor-stack-top this))) (let ((s1-0 *progress-work*)) - (progress-method-42 this (-> s1-0 header) (* 64.0 arg1)) - (progress-method-41 this (-> s1-0 header) (* 128.0 arg1)) + (draw-bg-box-alpha-2 this (-> s1-0 header) (* 64.0 arg1)) + (draw-bg-box-outline this (-> s1-0 header) (* 128.0 arg1)) ) (let ((a0-5 arg0)) (set! (-> a0-5 flags) (font-flags kerning middle large)) @@ -363,7 +356,7 @@ arg0 (+ (- -20.0 (-> s3-0 x)) (-> s3-0 z)) 45.0 - (lookup-text! *common-text* (the-as text-id arg2) #f) + (lookup-text! *common-text* arg2 #f) 0.95 0.1 32 @@ -371,11 +364,10 @@ ) (progress-method-34 this) 0 - (none) ) ;; definition for method 47 of type progress -;; WARN: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs object. (defmethod progress-method-47 ((this progress) (arg0 font-context) (arg1 symbol) (arg2 symbol)) (set-scale! arg0 0.5) (let ((a0-2 arg0)) @@ -417,18 +409,17 @@ ) ) 0 - (none) ) ;; definition for method 48 of type progress ;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs object. (defmethod draw-prev-next-footer ((this progress) (arg0 font-context) (arg1 float)) (local-vars (sv-16 string)) (let ((s3-0 *progress-work*)) (progress-method-33 this (-> s3-0 footer)) - (progress-method-42 this (-> s3-0 footer) (* 64.0 arg1)) - (progress-method-41 this (-> s3-0 footer) (* 128.0 arg1)) + (draw-bg-box-alpha-2 this (-> s3-0 footer) (* 64.0 arg1)) + (draw-bg-box-outline this (-> s3-0 footer) (* 128.0 arg1)) ) (let ((a0-4 arg0)) (set! (-> a0-4 color) (font-color font-color-33)) @@ -476,11 +467,10 @@ ) (progress-method-34 this) 0 - (none) ) ;; definition for method 49 of type progress -;; WARN: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs object. (defmethod draw-yes-no-style-footer ((this progress) (arg0 font-context) (arg1 text-id) (arg2 text-id)) (local-vars (a0-5 string)) (cond @@ -505,7 +495,6 @@ ) (print-game-text a0-5 arg0 #f 44 (bucket-id hud-draw-hud-alpha)) 0 - (none) ) ;; definition for method 50 of type progress @@ -532,7 +521,7 @@ ;; ERROR: Stack slot load at 176 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 160 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 176 mismatch: defined as size 4, got size 16 -;; WARN: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs object. (defmethod progress-method-50 ((this progress) (arg0 font-context) (arg1 text-id) @@ -581,48 +570,35 @@ (let* ((t0-1 (lookup-text! *common-text* arg1 #f)) (t2-1 0.75) (t3-1 35) - (t1-1 s1-0) - (f28-0 (sv-48 s0-1 sv-64 sv-80 sv-96 t0-1 t1-1 t2-1 t3-1)) + (f28-0 (sv-48 s0-1 sv-64 sv-80 sv-96 t0-1 s1-0 t2-1 t3-1)) ) (set! f30-0 (/ f28-0 2)) (set-scale! arg0 (/ (-> arg0 scale) 2)) - (let* ((a0-7 this) - (t9-3 (method-of-object a0-7 progress-method-40)) - (a1-3 arg0) - (a2-3 (the int (+ -1.0 (-> arg0 origin y)))) - (a3-2 (the int (+ 2.0 f28-0))) - (t0-2 sv-16) - ) - (t9-3 a0-7 a1-3 a2-3 a3-2 t0-2) - (+! (-> arg0 origin y) f28-0) - (set! sv-20 (cond - ((-> this yes-no-choice) - (format - (clear *temp-string*) - "~33L~S ~44L~S" - (lookup-text! *common-text* arg2 #f) - (lookup-text! *common-text* arg3 #f) - (the-as none t0-2) - (the-as none t1-1) - ) - *temp-string* - ) - (else - (format - (clear *temp-string*) - "~44L~S~33L ~S" - (lookup-text! *common-text* arg2 #f) - (lookup-text! *common-text* arg3 #f) - (the-as none t0-2) - (the-as none t1-1) - ) - *temp-string* - ) - ) - ) - ) + (draw-highlight-bar this arg0 (the int (+ -1.0 (-> arg0 origin y))) (the int (+ 2.0 f28-0)) sv-16) + (+! (-> arg0 origin y) f28-0) ) ) + (set! sv-20 (cond + ((-> this yes-no-choice) + (format + (clear *temp-string*) + "~33L~S ~44L~S" + (lookup-text! *common-text* arg2 #f) + (lookup-text! *common-text* arg3 #f) + ) + *temp-string* + ) + (else + (format + (clear *temp-string*) + "~44L~S~33L ~S" + (lookup-text! *common-text* arg2 #f) + (lookup-text! *common-text* arg3 #f) + ) + *temp-string* + ) + ) + ) ) (else (cond @@ -651,7 +627,7 @@ ) (when arg4 (let* ((a0-20 this) - (t9-14 (method-of-object a0-20 progress-method-40)) + (t9-14 (method-of-object a0-20 draw-highlight-bar)) (a1-12 arg0) (a2-12 (the int (+ -1.0 (-> arg0 origin y)))) (a3-6 (the int (+ 1.0 f28-1))) @@ -693,11 +669,10 @@ ) ) 0 - (none) ) ;; definition for method 51 of type progress -;; WARN: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs object. (defmethod progress-method-51 ((this progress) (arg0 font-context)) (let ((v1-1 (get-scissor-stack-top this))) (let ((a0-1 arg0) @@ -725,7 +700,6 @@ ) ) 0 - (none) ) ;; definition for method 52 of type progress @@ -734,8 +708,8 @@ ;; WARN: Stack slot offset 80 signed mismatch ;; WARN: Stack slot offset 80 signed mismatch ;; WARN: Stack slot offset 80 signed mismatch -;; WARN: Return type mismatch int vs none. -(defmethod progress-method-52 ((this progress) +;; WARN: Return type mismatch int vs object. +(defmethod draw-slider-option ((this progress) (arg0 font-context) (arg1 string) (arg2 float) @@ -860,7 +834,7 @@ ) (let ((f0-44 (progress-method-45 this arg0 f30-0 (* 32.0 f0-43) arg1 f0-43 0.75 32))) (if (= (-> this option-index) (-> this current-index)) - (progress-method-40 this arg0 (the int (+ -2.0 (-> arg0 origin y))) (the int (+ 4.0 f0-44)) arg2) + (draw-highlight-bar this arg0 (the int (+ -2.0 (-> arg0 origin y))) (the int (+ 4.0 f0-44)) arg2) ) ) ) @@ -877,7 +851,6 @@ ) (set! (-> arg0 flags) (font-flags kerning large)) 0 - (none) ) ;; definition for method 9 of type progress-icon-array @@ -1268,7 +1241,7 @@ ) (+! s1-2 1) ) - (set! (-> this on-screen) (the-as basic (< (-> arg1 origin y) (-> s3-0 w)))) + (set! (-> this on-screen) (< (-> arg1 origin y) (-> s3-0 w))) (seek! (-> this current-index) (-> this target-index) @@ -1282,9 +1255,9 @@ ) (progress-method-34 arg0) (let ((s3-1 *progress-work*)) - (progress-method-46 arg0 arg1 sv-176 106) - (progress-method-42 arg0 (-> s3-1 footer) (* 64.0 sv-176)) - (progress-method-41 arg0 (-> s3-1 footer) (* 128.0 sv-176)) + (draw-header arg0 arg1 sv-176 (text-id progress-missions)) + (draw-bg-box-alpha-2 arg0 (-> s3-1 footer) (* 64.0 sv-176)) + (draw-bg-box-outline arg0 (-> s3-1 footer) (* 128.0 sv-176)) ) (progress-method-47 arg0 @@ -1399,7 +1372,7 @@ (set! (-> a0-5 color) (font-color font-color-32)) ) (set! (-> arg1 origin x) (+ 10.0 arg2 (-> s3-0 x))) - (progress-method-38 arg0 arg1 0.01) + (adjust-font-origin-y arg0 arg1 0.01) (let ((v1-11 arg1)) (set! (-> v1-11 width) (* 0.75 f30-0)) ) @@ -1460,9 +1433,9 @@ ) ) ) - (progress-method-42 arg0 (-> s0-0 highscore-1) (* 16.0 arg3)) - (progress-method-41 arg0 (-> s0-0 highscore-1) (* 128.0 arg3)) - (progress-method-41 arg0 (-> s0-0 highscore-0) (* 128.0 arg3)) + (draw-bg-box-alpha-2 arg0 (-> s0-0 highscore-1) (* 16.0 arg3)) + (draw-bg-box-outline arg0 (-> s0-0 highscore-1) (* 128.0 arg3)) + (draw-bg-box-outline arg0 (-> s0-0 highscore-0) (* 128.0 arg3)) (progress-method-33 arg0 (-> s0-0 highscore-body)) ) ) @@ -1471,24 +1444,24 @@ (s3-1 (get-game-score-ref *game-info* (the-as int (-> this game-score)))) ) (set-scale! arg1 0.6) - (progress-method-38 arg0 arg1 0.03) + (adjust-font-origin-y arg0 arg1 0.03) (highscore-page-info-method-11 this arg1 56 (-> s3-1 0) f30-2 f28-2) (set-scale! arg1 0.5) - (progress-method-38 arg0 arg1 0.18) + (adjust-font-origin-y arg0 arg1 0.18) (highscore-page-info-method-11 this arg1 57 (-> s3-1 1) f30-2 f28-2) (set-scale! arg1 0.45) - (progress-method-38 arg0 arg1 0.31) + (adjust-font-origin-y arg0 arg1 0.31) (highscore-page-info-method-11 this arg1 58 (-> s3-1 2) f30-2 f28-2) (set-scale! arg1 0.425) - (progress-method-38 arg0 arg1 0.43) + (adjust-font-origin-y arg0 arg1 0.43) (highscore-page-info-method-11 this arg1 59 (-> s3-1 3) f30-2 f28-2) - (progress-method-38 arg0 arg1 0.545) + (adjust-font-origin-y arg0 arg1 0.545) (highscore-page-info-method-11 this arg1 60 (-> s3-1 4) f30-2 f28-2) - (progress-method-38 arg0 arg1 0.66) + (adjust-font-origin-y arg0 arg1 0.66) (highscore-page-info-method-11 this arg1 61 (-> s3-1 5) f30-2 f28-2) - (progress-method-38 arg0 arg1 0.775) + (adjust-font-origin-y arg0 arg1 0.775) (highscore-page-info-method-11 this arg1 62 (-> s3-1 6) f30-2 f28-2) - (progress-method-38 arg0 arg1 0.89) + (adjust-font-origin-y arg0 arg1 0.89) (highscore-page-info-method-11 this arg1 63 (-> s3-1 7) f30-2 f28-2) ) ) @@ -1543,14 +1516,14 @@ ) ) (progress-method-34 arg0) - (progress-method-46 arg0 arg1 f30-0 55) + (draw-header arg0 arg1 f30-0 (text-id progress-highscores)) (cond ((< 1.0 f28-0) (draw-prev-next-footer arg0 arg1 f30-0) ) (else - (progress-method-42 arg0 (-> s4-0 footer) (* 64.0 f30-0)) - (progress-method-41 arg0 (-> s4-0 footer) (* 128.0 f30-0)) + (draw-bg-box-alpha-2 arg0 (-> s4-0 footer) (* 64.0 f30-0)) + (draw-bg-box-outline arg0 (-> s4-0 footer) (* 128.0 f30-0)) ) ) ) @@ -1603,7 +1576,7 @@ (dotimes (s0-0 (-> this items length)) (when (and arg4 (have-items? this)) (set-scale! arg1 0.45) - (progress-method-38 arg0 arg1 0.9) + (adjust-font-origin-y arg0 arg1 0.9) (set! sv-16 print-game-text) (set! sv-32 format) (set! sv-48 (clear *temp-string*)) @@ -1635,7 +1608,7 @@ (let ((a0-2 arg1)) (set! (-> a0-2 color) (font-color font-color-32)) ) - (progress-method-38 arg0 arg1 0.01) + (adjust-font-origin-y arg0 arg1 0.01) (let ((s1-0 print-game-text)) (let ((s0-0 format)) (set! sv-16 (clear *temp-string*)) @@ -1686,7 +1659,7 @@ (inventory-screen-method-9 s4-1 arg0 arg1 f28-1 f30-0) ) (progress-method-34 arg0) - (progress-method-46 arg0 arg1 f30-0 1995) + (draw-header arg0 arg1 f30-0 (text-id progress-inventory)) (draw-prev-next-footer arg0 arg1 f30-0) ) 0 @@ -1823,7 +1796,7 @@ (let ((s1-0 (get-scissor-stack-top arg0))) (- (-> s1-0 z) (-> s1-0 x)) (progress-method-33 arg0 (-> s3-0 sub-header)) - (progress-method-41 arg0 (-> s3-0 sub-header) (* 128.0 s2-0)) + (draw-bg-box-outline arg0 (-> s3-0 sub-header) (* 128.0 s2-0)) (let ((a0-4 arg1)) (set! (-> a0-4 flags) (font-flags kerning middle large)) ) @@ -1965,7 +1938,7 @@ (s2-0 *progress-work*) ) (set! (-> arg1 alpha) f30-0) - (progress-method-46 arg0 arg1 f30-0 1581) + (draw-header arg0 arg1 f30-0 (text-id progress-controls)) (let ((a0-2 arg1)) (set! (-> a0-2 flags) (font-flags kerning middle large)) ) @@ -1985,8 +1958,8 @@ (draw-prev-next-footer arg0 arg1 f30-0) ) (else - (progress-method-42 arg0 (-> s2-0 footer) (* 64.0 f30-0)) - (progress-method-41 arg0 (-> s2-0 footer) (* 128.0 f30-0)) + (draw-bg-box-alpha-2 arg0 (-> s2-0 footer) (* 64.0 f30-0)) + (draw-bg-box-outline arg0 (-> s2-0 footer) (* 128.0 f30-0)) ) ) (progress-method-33 arg0 (-> s2-0 body-footer)) @@ -2016,8 +1989,8 @@ (let ((a1-2 arg1)) (set! (-> a1-2 flags) (font-flags kerning middle large)) ) - (progress-method-38 arg0 arg1 (-> this offset-y)) - (progress-method-40 arg0 arg1 (the int (-> arg1 origin y)) 44 f30-0) + (adjust-font-origin-y arg0 arg1 (-> this offset-y)) + (draw-highlight-bar arg0 arg1 (the int (-> arg1 origin y)) 44 f30-0) (+! (-> arg1 origin y) 8.0) (let ((a0-3 arg1)) (set! (-> a0-3 color) (font-color font-color-32)) @@ -2044,7 +2017,7 @@ 44 (bucket-id hud-draw-hud-alpha) ) - (progress-method-46 arg0 arg1 f30-0 11) + (draw-header arg0 arg1 f30-0 (text-id progress-language)) ) 0 (none) @@ -2056,10 +2029,10 @@ (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))) (set! (-> arg1 alpha) f30-0) (set-scale! arg1 0.85) - (progress-method-38 arg0 arg1 (-> this offset-y)) + (adjust-font-origin-y arg0 arg1 (-> this offset-y)) (cond ((= (-> arg0 option-index) arg2) - (progress-method-40 arg0 arg1 (the int (+ -6.0 (-> arg1 origin y))) 35 f30-0) + (draw-highlight-bar arg0 arg1 (the int (+ -6.0 (-> arg1 origin y))) 35 f30-0) (let ((a0-4 arg1)) (set! (-> a0-4 color) (font-color font-color-33)) ) @@ -2080,7 +2053,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod draw-option ((this menu-on-off-game-vibrations-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg0 yes-no-choice) (-> arg0 vibrations)) - (progress-method-38 arg0 arg1 0.19) + (adjust-font-origin-y arg0 arg1 0.19) (progress-method-50 arg0 arg1 @@ -2092,7 +2065,7 @@ 0.65 ) (let ((f0-1 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))) - (progress-method-46 arg0 arg1 f0-1 28) + (draw-header arg0 arg1 f0-1 (text-id progress-game-options)) ) 0 (none) @@ -2102,7 +2075,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod draw-option ((this menu-on-off-game-subtitles-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg0 yes-no-choice) (-> arg0 subtitles)) - (progress-method-38 arg0 arg1 0.34) + (adjust-font-origin-y arg0 arg1 0.34) (progress-method-50 arg0 arg1 @@ -2124,7 +2097,7 @@ (local-vars (sv-16 string) (sv-32 string)) (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))) (set-scale! arg1 0.65) - (progress-method-38 arg0 arg1 (-> this offset-y)) + (adjust-font-origin-y arg0 arg1 (-> this offset-y)) (set! (-> arg1 alpha) f30-0) (let ((a0-3 arg1)) (set! (-> a0-3 flags) (font-flags kerning middle large)) @@ -2147,7 +2120,7 @@ (let ((a0-12 arg1)) (set! (-> a0-12 color) (font-color font-color-34)) ) - (progress-method-40 arg0 arg1 (the int (-> arg1 origin y)) 42 f30-0) + (draw-highlight-bar arg0 arg1 (the int (-> arg1 origin y)) 42 f30-0) (let ((s2-1 print-game-text)) (let ((s1-1 format) (s0-1 (clear *temp-string*)) @@ -2190,7 +2163,7 @@ (let ((a0-30 arg1)) (set! (-> a0-30 color) (font-color font-color-33)) ) - (progress-method-40 arg0 arg1 (the int (-> arg1 origin y)) 24 f30-0) + (draw-highlight-bar arg0 arg1 (the int (-> arg1 origin y)) 24 f30-0) ) (else (let ((a0-32 arg1)) @@ -2255,7 +2228,7 @@ (let ((a0-3 arg1)) (set! (-> a0-3 color) (font-color font-color-34)) ) - (progress-method-38 arg0 arg1 0.45) + (adjust-font-origin-y arg0 arg1 0.45) (set! (-> arg1 origin x) (+ 30.0 (-> s4-0 x))) (let* ((s3-1 arg0) (s2-1 (method-of-object s3-1 progress-method-45)) @@ -2324,7 +2297,7 @@ (set! (-> a0-21 flags) (font-flags kerning middle large)) ) (set! (-> arg1 origin x) (-> s4-0 x)) - (progress-method-38 arg0 arg1 0.85) + (adjust-font-origin-y arg0 arg1 0.85) (set-scale! arg1 0.5) (let ((v1-27 arg1)) (set! (-> v1-27 width) (- (-> s4-0 z) (-> s4-0 x))) @@ -2339,7 +2312,7 @@ ) (else (let ((f28-1 0.7)) - (progress-method-38 arg0 arg1 (-> this offset-y)) + (adjust-font-origin-y arg0 arg1 (-> this offset-y)) (cond ((= (-> arg0 option-index) arg2) (let ((a0-27 arg1)) @@ -2366,7 +2339,7 @@ (f0-26 (s0-1 s1-2 sv-32 s4-1 sv-48 t0-7 t1-1 t2-1 t3-1)) ) (if (= (-> arg0 option-index) arg2) - (progress-method-40 arg0 arg1 (the int (+ -1.0 (-> arg1 origin y))) (the int (+ 4.0 f0-26)) f30-0) + (draw-highlight-bar arg0 arg1 (the int (+ -1.0 (-> arg1 origin y))) (the int (+ 4.0 f0-26)) f30-0) ) ) ) @@ -2383,15 +2356,14 @@ ;; WARN: Return type mismatch int vs none. (defmethod draw-option ((this menu-aspect-ratio-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (when (not (and (zero? (-> arg0 option-index)) (-> arg0 selected-option))) - (set! (-> arg0 yes-no-choice) (the-as basic (= (if arg3 - (-> arg0 aspect-ratio) - (get-aspect-ratio) - ) - 'aspect4x3 - ) - ) + (set! (-> arg0 yes-no-choice) (= (if arg3 + (-> arg0 aspect-ratio) + (get-aspect-ratio) + ) + 'aspect4x3 + ) ) - (progress-method-38 arg0 arg1 (-> this offset-y)) + (adjust-font-origin-y arg0 arg1 (-> this offset-y)) (progress-method-50 arg0 arg1 @@ -2404,7 +2376,7 @@ ) ) (let ((f0-2 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))) - (progress-method-46 arg0 arg1 f0-2 29) + (draw-header arg0 arg1 f0-2 (text-id progress-graphic-options)) ) 0 (none) @@ -2419,13 +2391,12 @@ (arg3 symbol) ) (when (not (and (zero? (-> arg0 option-index)) (-> arg0 selected-option))) - (set! (-> arg0 yes-no-choice) (the-as basic (if arg3 - (-> arg0 progressive-scan) - (-> *setting-control* user-default set-video-mode) - ) - ) + (set! (-> arg0 yes-no-choice) (if arg3 + (-> arg0 progressive-scan) + (-> *setting-control* user-default set-video-mode) + ) ) - (progress-method-38 arg0 arg1 (-> this offset-y)) + (adjust-font-origin-y arg0 arg1 (-> this offset-y)) (progress-method-50 arg0 arg1 @@ -2445,15 +2416,14 @@ ;; WARN: Return type mismatch int vs none. (defmethod draw-option ((this menu-video-mode-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (when (not (and (zero? (-> arg0 option-index)) (-> arg0 selected-option))) - (set! (-> arg0 yes-no-choice) (the-as basic (= (if arg3 - (-> arg0 video-mode) - (get-video-mode) - ) - 'pal - ) - ) + (set! (-> arg0 yes-no-choice) (= (if arg3 + (-> arg0 video-mode) + (get-video-mode) + ) + 'pal + ) ) - (progress-method-38 arg0 arg1 (-> this offset-y)) + (adjust-font-origin-y arg0 arg1 (-> this offset-y)) (progress-method-50 arg0 arg1 @@ -2480,7 +2450,7 @@ ) (else (let ((f28-0 (-> (the-as (pointer float) (&+ (the-as pointer *setting-control*) (-> this setting-offset)))))) - (progress-method-52 + (draw-slider-option arg0 arg1 (lookup-text! *common-text* (-> this name) #f) @@ -2494,7 +2464,7 @@ ) ) (if (zero? arg2) - (progress-method-46 arg0 arg1 f30-0 30) + (draw-header arg0 arg1 f30-0 (text-id progress-sound-options)) ) ) 0 @@ -2516,7 +2486,7 @@ (progress-method-51 arg0 arg1) ) ((begin - (progress-method-38 arg0 arg1 (-> this offset-y)) + (adjust-font-origin-y arg0 arg1 (-> this offset-y)) (set! s5-0 (-> *setting-control* user-default stereo-mode)) arg3 ) @@ -2533,7 +2503,7 @@ (let ((a0-12 arg1)) (set! (-> a0-12 color) (font-color font-color-34)) ) - (progress-method-40 arg0 arg1 (the int (+ -1.0 (-> arg1 origin y))) 42 f28-0) + (draw-highlight-bar arg0 arg1 (the int (+ -1.0 (-> arg1 origin y))) 42 f28-0) (let ((s3-1 print-game-text)) (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> this name) #f)) (s3-1 *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) @@ -2570,7 +2540,7 @@ ) (else (if (= (-> arg0 option-index) arg2) - (progress-method-40 arg0 arg1 (the int (-> arg1 origin y)) 21 f28-0) + (draw-highlight-bar arg0 arg1 (the int (-> arg1 origin y)) 21 f28-0) ) (let ((s3-2 print-game-text)) (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> this name) #f)) @@ -2610,7 +2580,7 @@ ) (else (let ((f28-0 (-> (the-as (pointer float) (&+ (the-as pointer *setting-control*) (-> this setting-offset)))))) - (progress-method-52 + (draw-slider-option arg0 arg1 (lookup-text! *common-text* (-> this name) #f) @@ -2625,7 +2595,7 @@ ) (when (zero? arg2) (let ((s4-1 (get-scissor-stack-top arg0))) - (progress-method-46 arg0 arg1 f30-0 1520) + (draw-header arg0 arg1 f30-0 (text-id progress-picture-options)) (draw-icon-array! (-> *progress-icon-arrays* 75) 256 @@ -2646,7 +2616,7 @@ ;; definition for method 10 of type menu-camera-option ;; WARN: Return type mismatch int vs none. (defmethod draw-option ((this menu-camera-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) - (progress-method-38 arg0 arg1 (-> this offset-y)) + (adjust-font-origin-y arg0 arg1 (-> this offset-y)) (let* ((v1-2 (-> this menu-option-type)) (v1-3 (cond ((= v1-2 12) @@ -2658,7 +2628,7 @@ ) ) ) - (set! (-> arg0 yes-no-choice) (the-as basic (not v1-3))) + (set! (-> arg0 yes-no-choice) (not v1-3)) ) (progress-method-50 arg0 @@ -2672,7 +2642,7 @@ ) (when (zero? arg2) (let ((f0-2 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))) - (progress-method-46 arg0 arg1 f0-2 1534) + (draw-header arg0 arg1 f0-2 (text-id progress-camera-options)) ) ) 0 @@ -2686,7 +2656,7 @@ (f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (s1-0 "?????????") ) - (progress-method-38 arg0 arg1 (-> this offset-y)) + (adjust-font-origin-y arg0 arg1 (-> this offset-y)) (set-scale! arg1 0.5) (if (= arg2 (-> arg0 option-index)) 33 @@ -2700,7 +2670,7 @@ ) ) (if (= arg2 (-> arg0 option-index)) - (progress-method-40 arg0 arg1 (the int (+ 2.0 (-> arg1 origin y))) (the int (+ -1.0 f0-3)) f30-0) + (draw-highlight-bar arg0 arg1 (the int (+ 2.0 (-> arg1 origin y))) (the int (+ -1.0 f0-3)) f30-0) ) ) ) @@ -2912,7 +2882,7 @@ (let ((a0-51 arg1)) (set! (-> a0-51 color) (font-color font-color-32)) ) - (progress-method-38 arg0 arg1 0.675) + (adjust-font-origin-y arg0 arg1 0.675) (let ((a0-53 arg1)) (set! (-> a0-53 flags) (font-flags kerning right large)) ) @@ -2961,7 +2931,7 @@ (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) f30-0 ) - (progress-method-38 arg0 arg1 0.83) + (adjust-font-origin-y arg0 arg1 0.83) (set! (-> arg1 origin x) (+ (-> s3-1 x) (* 0.675 (- (-> s3-1 z) (-> s3-1 x))))) (let ((s1-3 print-game-text)) (format (clear *temp-string*) "~D" (the int (-> s2-0 file arg2 skill-count))) @@ -3013,13 +2983,13 @@ (when (zero? arg2) (case (-> arg0 current) (('select-load) - (progress-method-46 arg0 arg1 f30-0 45) + (draw-header arg0 arg1 f30-0 (text-id progress-load-file-select)) ) (('select-save-hero) - (progress-method-46 arg0 arg1 f30-0 2198) + (draw-header arg0 arg1 f30-0 (text-id save-hero-mode-file)) ) (else - (progress-method-46 arg0 arg1 f30-0 44) + (draw-header arg0 arg1 f30-0 (text-id progress-save-file-select)) ) ) ) @@ -3202,7 +3172,7 @@ (let ((a0-26 arg1)) (set! (-> a0-26 color) (font-color font-color-33)) ) - (progress-method-40 arg0 arg1 (the int (+ 30.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (+ 30.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) (print-game-text (lookup-text! *common-text* (text-id progress-continue) #f) arg1 @@ -3216,7 +3186,7 @@ (set! (-> a0-30 color) (font-color font-color-33)) ) (+! (-> arg1 origin y) 20.0) - (progress-method-40 arg0 arg1 (the int (+ 30.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (+ 30.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) (draw-yes-no-style-footer arg0 arg1 @@ -3265,8 +3235,8 @@ (let ((a0-13 arg1)) (set! (-> a0-13 color) (font-color font-color-33)) ) - (progress-method-38 arg0 arg1 0.1) - (progress-method-40 arg0 arg1 (the int (-> arg1 origin y)) 18 (-> arg1 alpha)) + (adjust-font-origin-y arg0 arg1 0.1) + (draw-highlight-bar arg0 arg1 (the int (-> arg1 origin y)) 18 (-> arg1 alpha)) (print-game-text (lookup-text! *common-text* (text-id progress-continue) #f) arg1 @@ -3306,8 +3276,8 @@ (let ((a0-13 arg1)) (set! (-> a0-13 color) (font-color font-color-33)) ) - (progress-method-38 arg0 arg1 0.1) - (progress-method-40 arg0 arg1 (the int (-> arg1 origin y)) 18 (-> arg1 alpha)) + (adjust-font-origin-y arg0 arg1 0.1) + (draw-highlight-bar arg0 arg1 (the int (-> arg1 origin y)) 18 (-> arg1 alpha)) (print-game-text (lookup-text! *common-text* (text-id progress-continue) #f) arg1 @@ -3348,7 +3318,7 @@ (let ((a0-11 arg1)) (set! (-> a0-11 color) (font-color font-color-33)) ) - (progress-method-40 arg0 arg1 (the int (+ 17.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (+ 17.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) (print-game-text (lookup-text! *common-text* (text-id progress-memcard-go-back?) #f) arg1 @@ -3407,7 +3377,7 @@ (let ((a0-21 arg1)) (set! (-> a0-21 color) (font-color font-color-33)) ) - (progress-method-40 arg0 arg1 (the int (+ 9.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (+ 9.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) (print-game-text (lookup-text! *common-text* (text-id progress-continue) #f) arg1 @@ -3470,7 +3440,7 @@ (let ((a0-20 arg1)) (set! (-> a0-20 color) (font-color font-color-33)) ) - (progress-method-40 arg0 arg1 (the int (-> arg1 origin y)) 22 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (-> arg1 origin y)) 22 (-> arg1 alpha)) (print-game-text (lookup-text! *common-text* (text-id progress-continue) #f) arg1 @@ -3523,7 +3493,7 @@ (let ((a0-16 arg1)) (set! (-> a0-16 color) (font-color font-color-33)) ) - (progress-method-40 arg0 arg1 (the int (+ 5.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (+ 5.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) (print-game-text (lookup-text! *common-text* (text-id progress-continue) #f) arg1 @@ -3572,7 +3542,7 @@ (let ((a0-12 arg1)) (set! (-> a0-12 color) (font-color font-color-33)) ) - (progress-method-40 arg0 arg1 (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) (print-game-text (lookup-text! *common-text* (text-id progress-continue) #f) arg1 @@ -3621,7 +3591,7 @@ (let ((a0-12 arg1)) (set! (-> a0-12 color) (font-color font-color-33)) ) - (progress-method-40 arg0 arg1 (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) (print-game-text (lookup-text! *common-text* (text-id progress-continue) #f) arg1 @@ -3684,7 +3654,7 @@ (let ((a0-27 arg1)) (set! (-> a0-27 color) (font-color font-color-33)) ) - (progress-method-40 arg0 arg1 (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) (print-game-text (lookup-text! *common-text* (text-id progress-continue) #f) arg1 @@ -3726,7 +3696,7 @@ ) (+! (-> arg1 origin y) 95.0) (set-height! arg1 25) - (progress-method-40 arg0 arg1 (the int (-> arg1 origin y)) 44 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (-> arg1 origin y)) 44 (-> arg1 alpha)) (print-game-text (lookup-text! *common-text* (text-id progress-memcard-format?) #f) arg1 @@ -3772,7 +3742,7 @@ (bucket-id hud-draw-hud-alpha) ) (+! (-> arg1 origin y) 45.0) - (progress-method-40 arg0 arg1 (the int (+ 8.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (+ 8.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) (draw-yes-no-style-footer arg0 arg1 (text-id progress-yes) (text-id progress-no)) 0 (none) @@ -3807,7 +3777,7 @@ (bucket-id hud-draw-hud-alpha) ) (+! (-> arg1 origin y) 70.0) - (progress-method-40 arg0 arg1 (the int (+ 18.0 (-> arg1 origin y))) 22 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (+ 18.0 (-> arg1 origin y))) 22 (-> arg1 alpha)) (draw-yes-no-style-footer arg0 arg1 (text-id progress-yes) (text-id progress-no)) 0 (none) @@ -3863,7 +3833,7 @@ (bucket-id hud-draw-hud-alpha) ) (+! (-> arg1 origin y) 20.0) - (progress-method-40 arg0 arg1 (the int (-> arg1 origin y)) 24 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (-> arg1 origin y)) 24 (-> arg1 alpha)) (draw-yes-no-style-footer arg0 arg1 (text-id progress-yes) (text-id progress-no)) 0 (none) @@ -3901,7 +3871,7 @@ (bucket-id hud-draw-hud-alpha) ) (+! (-> arg1 origin y) 50.0) - (progress-method-40 arg0 arg1 (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) (draw-yes-no-style-footer arg0 arg1 (text-id progress-yes) (text-id progress-no)) 0 (none) @@ -3957,7 +3927,7 @@ (bucket-id hud-draw-hud-alpha) ) (+! (-> arg1 origin y) 25.0) - (progress-method-40 arg0 arg1 (the int (-> arg1 origin y)) 24 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (-> arg1 origin y)) 24 (-> arg1 alpha)) (draw-yes-no-style-footer arg0 arg1 (text-id progress-yes) (text-id progress-no)) 0 (none) @@ -3995,7 +3965,7 @@ (bucket-id hud-draw-hud-alpha) ) (+! (-> arg1 origin y) 70.0) - (progress-method-40 arg0 arg1 (the int (+ 20.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (+ 20.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) (draw-yes-no-style-footer arg0 arg1 (text-id progress-yes) (text-id progress-no)) 0 (none) @@ -4085,7 +4055,7 @@ ) (let ((f26-0 (s0-1 *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)))) (if (= s2-1 (-> this selected-index)) - (progress-method-40 arg0 arg1 (the int (+ -2.0 (-> arg1 origin y))) (the int (+ 2.0 f26-0)) f30-0) + (draw-highlight-bar arg0 arg1 (the int (+ -2.0 (-> arg1 origin y))) (the int (+ 2.0 f26-0)) f30-0) ) (+! (-> arg1 origin y) f26-0) ) @@ -4104,29 +4074,29 @@ (progress-method-34 arg0) (let ((s3-1 *progress-work*)) (let* ((a0-28 arg0) - (t9-16 (method-of-object a0-28 progress-method-46)) + (t9-16 (method-of-object a0-28 draw-header)) (a1-12 arg1) (a2-9 f30-0) (v1-46 (-> *progress-work* selected-num)) ) (t9-16 a0-28 a1-12 a2-9 (cond ((zero? v1-46) - 54 + (text-id progress-select-start) ) ((= v1-46 1) - 2126 + (text-id progress-title-level-select-act-1) ) ((= v1-46 2) - 2127 + (text-id progress-title-level-select-act-2) ) (else - 2128 + (text-id progress-title-level-select-act-3) ) ) ) ) - (progress-method-42 arg0 (-> s3-1 footer) (* 64.0 f30-0)) - (progress-method-41 arg0 (-> s3-1 footer) (* 128.0 f30-0)) + (draw-bg-box-alpha-2 arg0 (-> s3-1 footer) (* 64.0 f30-0)) + (draw-bg-box-outline arg0 (-> s3-1 footer) (* 128.0 f30-0)) ) ) (progress-method-47 @@ -4231,7 +4201,7 @@ (f26-0 (sv-64 a0-21 a1-7 a2-6 a3-2 (the-as bucket-id t0-2))) ) (if (= s1-1 (-> this selected-index)) - (progress-method-40 arg0 arg1 (the int (+ -2.0 (-> arg1 origin y))) (the int (+ 2.0 f26-0)) f30-0) + (draw-highlight-bar arg0 arg1 (the int (+ -2.0 (-> arg1 origin y))) (the int (+ 2.0 f26-0)) f30-0) ) (+! (-> arg1 origin y) f26-0) ) @@ -4249,29 +4219,29 @@ (progress-method-34 arg0) (let ((s3-1 *progress-work*)) (let* ((a0-25 arg0) - (t9-13 (method-of-object a0-25 progress-method-46)) + (t9-13 (method-of-object a0-25 draw-header)) (a1-10 arg1) (a2-9 f30-0) (v1-44 (-> *progress-work* selected-num)) ) (t9-13 a0-25 a1-10 a2-9 (cond ((zero? v1-44) - 91 + (text-id progress-scene-player-act-1) ) ((= v1-44 1) - 92 + (text-id progress-scene-player-act-2) ) ((= v1-44 2) - 93 + (text-id progress-scene-player-act-3) ) (else - 2002 + (text-id progress-title-commentary) ) ) ) ) - (progress-method-42 arg0 (-> s3-1 footer) (* 64.0 f30-0)) - (progress-method-41 arg0 (-> s3-1 footer) (* 128.0 f30-0)) + (draw-bg-box-alpha-2 arg0 (-> s3-1 footer) (* 64.0 f30-0)) + (draw-bg-box-outline arg0 (-> s3-1 footer) (* 128.0 f30-0)) ) ) (progress-method-47 @@ -4289,7 +4259,7 @@ (defmethod draw-option ((this menu-qr-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))) (set! (-> arg1 alpha) f30-0) - (progress-method-38 arg0 arg1 (-> this offset-y)) + (adjust-font-origin-y arg0 arg1 (-> this offset-y)) (cond (arg3 (let ((a0-2 arg1)) @@ -4313,7 +4283,7 @@ ) ) (when (= (-> arg0 option-index) arg2) - (progress-method-40 arg0 arg1 (the int (+ -2.0 (-> arg1 origin y))) (the int (+ 8.0 f28-0)) f30-0) + (draw-highlight-bar arg0 arg1 (the int (+ -2.0 (-> arg1 origin y))) (the int (+ 8.0 f28-0)) f30-0) (set! (-> arg1 origin y) (+ 4.0 f28-0 (-> arg1 origin y))) ) ) @@ -4322,7 +4292,7 @@ (draw-yes-no-style-footer arg0 arg1 (text-id progress-yes) (text-id progress-no)) ) (if (zero? arg2) - (progress-method-46 arg0 arg1 f30-0 116) + (draw-header arg0 arg1 f30-0 (text-id progress-qr)) ) ) 0 @@ -4370,18 +4340,18 @@ ) (cond ((kiosk?) - (set! (-> s4-0 secrets-unlocked) (the-as basic #t)) + (set! (-> s4-0 secrets-unlocked) #t) (set! s5-0 (logior (the-as int s5-0) 32)) ) ((unlocked-secret-menu? (the-as game-secrets s5-0)) - (set! (-> s4-0 secrets-unlocked) (the-as basic #t)) + (set! (-> s4-0 secrets-unlocked) #t) ) (else (set! (-> s4-0 secrets-unlocked) #f) ) ) (when *cheat-mode* - (set! (-> s4-0 secrets-unlocked) (the-as basic #t)) + (set! (-> s4-0 secrets-unlocked) #t) (set! s5-0 (logior (the-as int s5-0) #x3bfe)) ) ) @@ -4508,11 +4478,9 @@ ;; definition for method 10 of type menu-secret-option ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -;; ERROR: Function may read a register that is not set: t1 (defmethod draw-option ((this menu-secret-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (a0-19 string) - (t1-0 int) (sv-16 float) (sv-24 int) (sv-96 int) @@ -4555,15 +4523,16 @@ ) (let ((f1-5 (* (the float (-> s2-0 h)) f0-5))) (+ (- (- -20.0 f30-0) (-> s3-0 x)) (-> s3-0 z)) - (set! t1-0 (logior #x808080 (shr (shl (the int (* 128.0 sv-16)) 56) 32))) - (draw-icon-array! - (-> *progress-icon-arrays* 68) - (the int (+ 10.0 (-> s3-0 x))) - (the int (+ (-> s3-0 y) (* 0.5 (- 28.0 f1-5)))) - f0-5 - f0-5 - (the-as rgba t1-0) - sv-16 + (let ((t1-0 (logior #x808080 (shr (shl (the int (* 128.0 sv-16)) 56) 32)))) + (draw-icon-array! + (-> *progress-icon-arrays* 68) + (the int (+ 10.0 (-> s3-0 x))) + (the int (+ (-> s3-0 y) (* 0.5 (- 28.0 f1-5)))) + f0-5 + f0-5 + (the-as rgba t1-0) + sv-16 + ) ) ) (let ((v1-26 arg1)) @@ -4628,14 +4597,7 @@ (s2-3 s1-2 s0-2 sv-128 a3-5) ) ) - (let ((a0-27 *temp-string*) - (a1-15 arg1) - (a2-9 #f) - (a3-6 44) - ) - (set! arg3 (the-as symbol 579)) - (s3-1 a0-27 a1-15 a2-9 a3-6 (the-as bucket-id arg3)) - ) + (s3-1 *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) ) (progress-method-34 arg0) ) @@ -4652,15 +4614,7 @@ (set! (-> a0-33 flags) (font-flags kerning middle middle-vert large)) ) (let ((s4-1 print-game-text)) - (let* ((s3-2 format) - (s2-4 (clear *temp-string*)) - (a0-35 *common-text*) - (t9-22 (method-of-object a0-35 lookup-text!)) - (a1-18 128) - (a2-10 #f) - ) - (s3-2 s2-4 (t9-22 a0-35 (the-as text-id a1-18) a2-10) (the-as none a2-10)) - ) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id text-0080) #f)) (s4-1 *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) ) (progress-method-34 arg0) @@ -4668,7 +4622,7 @@ (let ((a0-40 arg1)) (set! (-> a0-40 flags) (font-flags kerning middle large)) ) - (progress-method-38 arg0 arg1 0.1) + (adjust-font-origin-y arg0 arg1 0.1) (let ((a0-42 arg1)) (set! (-> a0-42 color) (font-color font-color-33)) ) @@ -4681,13 +4635,13 @@ ) ) ) - (progress-method-40 arg0 arg1 (the int (+ -2.0 (-> arg1 origin y))) (the int (+ 4.0 f0-16)) (-> arg1 alpha)) + (draw-highlight-bar arg0 arg1 (the int (+ -2.0 (-> arg1 origin y))) (the int (+ 4.0 f0-16)) (-> arg1 alpha)) ) (progress-method-34 arg0) ) ((-> this buy-menu) (progress-method-33 arg0 (-> *progress-work* body)) - (progress-method-38 arg0 arg1 0.45) + (adjust-font-origin-y arg0 arg1 0.45) (progress-method-50 arg0 arg1 @@ -4699,8 +4653,8 @@ 0.65 ) (let ((s4-3 *progress-work*)) - (progress-method-46 arg0 arg1 sv-16 84) - (progress-method-41 arg0 (-> s4-3 sub-header) (* 128.0 sv-16)) + (draw-header arg0 arg1 sv-16 (text-id progress-secrets)) + (draw-bg-box-outline arg0 (-> s4-3 sub-header) (* 128.0 sv-16)) ) (progress-method-34 arg0) ) @@ -4718,7 +4672,7 @@ (set! sv-144 "~32L~S~44L ~S") (set! sv-160 (lookup-text! *common-text* (text-id progress-on) #f)) (let ((a3-12 (lookup-text! *common-text* (text-id progress-off) #f))) - (s1-3 s0-3 sv-144 sv-160 a3-12 (the-as none arg3) (the-as none t1-0)) + (s1-3 s0-3 sv-144 sv-160 a3-12) ) ) (let* ((f0-27 (-> (s2-5 *temp-string* arg1) length)) @@ -4855,8 +4809,8 @@ (a1-45 arg1) (a2-31 #f) (a3-15 40) - (t0-9 579) - (f20-0 (sv-256 a0-87 a1-45 a2-31 a3-15 (the-as bucket-id t0-9))) + (t0-10 579) + (f20-0 (sv-256 a0-87 a1-45 a2-31 a3-15 (the-as bucket-id t0-10))) ) (when (not (logtest? (-> s2-6 s1-5 flags) (secret-item-option-flags sf0))) (set! (-> arg1 origin x) (+ (-> s3-3 x) f28-1)) @@ -4879,9 +4833,9 @@ (a1-49 arg1) (a2-35 #f) (a3-16 40) - (t0-10 579) + (t0-11 579) ) - (sv-304 a0-94 a1-49 a2-35 a3-16 (the-as bucket-id t0-10)) + (sv-304 a0-94 a1-49 a2-35 a3-16 (the-as bucket-id t0-11)) ) ) ((= sv-288 1) @@ -4892,7 +4846,7 @@ (let ((a0-97 (clear *temp-string*)) (a1-50 "~32L~S~44L ~S") ) - (sv-336 a0-97 a1-50 sv-352 sv-368 (the-as none t0-9) (the-as none t1-0)) + (sv-336 a0-97 a1-50 sv-352 sv-368) ) (s0-8 *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)) ) @@ -4921,7 +4875,7 @@ (a2-40 sv-352) (a3-20 sv-368) ) - (sv-400 a0-104 a1-54 a2-40 a3-20 (the-as none t0-9) (the-as none t1-0)) + (sv-400 a0-104 a1-54 a2-40 a3-20) ) (s0-10 *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)) ) @@ -4944,7 +4898,7 @@ ) (+! (-> arg1 origin y) f20-0) (if (= s1-5 (-> this selected-index)) - (progress-method-40 arg0 arg1 (the int (+ -2.0 f22-2)) (the int (+ 3.0 f20-0)) sv-16) + (draw-highlight-bar arg0 arg1 (the int (+ -2.0 f22-2)) (the int (+ 3.0 f20-0)) sv-16) ) ) ) @@ -4961,10 +4915,10 @@ ) (progress-method-34 arg0) (let ((s3-4 *progress-work*)) - (progress-method-46 arg0 arg1 sv-16 84) - (progress-method-41 arg0 (-> s3-4 sub-header) (* 128.0 sv-16)) - (progress-method-42 arg0 (-> s3-4 footer) (* 64.0 sv-16)) - (progress-method-41 arg0 (-> s3-4 footer) (* 128.0 sv-16)) + (draw-header arg0 arg1 sv-16 (text-id progress-secrets)) + (draw-bg-box-outline arg0 (-> s3-4 sub-header) (* 128.0 sv-16)) + (draw-bg-box-alpha-2 arg0 (-> s3-4 footer) (* 64.0 sv-16)) + (draw-bg-box-outline arg0 (-> s3-4 footer) (* 128.0 sv-16)) ) (progress-method-47 arg0 @@ -4979,3 +4933,7 @@ 0 (none) ) + + + + diff --git a/test/decompiler/reference/jak3/engine/ui/progress/progress-h_REF.gc b/test/decompiler/reference/jak3/engine/ui/progress/progress-h_REF.gc index 852cb9870f..448a9edeff 100644 --- a/test/decompiler/reference/jak3/engine/ui/progress/progress-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/ui/progress/progress-h_REF.gc @@ -62,7 +62,7 @@ ;; definition of type progress (deftype progress (process-drawable) - ((scissor-stack vector 8 :inline) + ((scissor-stack vector 8 :inline) (scissor-count int32) (current-options menu-option-list) (menu-transition float) @@ -76,38 +76,38 @@ (next symbol) (ring-angle float) (ring-want-angle float) - (init-quat quaternion :inline) + (init-quat quaternion :inline) (pos-transition float) (anim-frame float) (swing float) (main-menu symbol) - (state-array symbol 8) - (option-index-stack int32 8) + (state-array symbol 8) + (option-index-stack int32 8) (state-pos int32) - (secret-buying basic) - (secret-buy-choice basic) + (secret-buying symbol) + (secret-buy-choice symbol) (scanlines-alpha float) (start-time time-frame) (which-slot int32) - (starting-state basic) - (yes-no-choice basic) + (starting-state symbol) + (yes-no-choice symbol) (time-out time-frame) (last-sound time-frame) (last-move time-frame) (center-x-backup int32) (center-y-backup int32) - (flip-horizontal basic) - (flip-vertical basic) - (progressive-scan basic) - (aspect-ratio basic) - (video-mode basic) + (flip-horizontal symbol) + (flip-vertical symbol) + (progressive-scan symbol) + (aspect-ratio symbol) + (video-mode symbol) (stereo-mode-backup int32) - (vibrations basic) - (subtitles basic) - (languages int32 3) - (subtitle-language-index int32 :overlay-at (-> languages 0)) - (language-index int32 :overlay-at (-> languages 1)) - (audio-language-index int32 :overlay-at (-> languages 2)) + (vibrations symbol) + (subtitles symbol) + (languages language-enum-s32 3) + (subtitle-language-index language-enum-s32 :overlay-at (-> languages 0)) + (language-index language-enum-s32 :overlay-at (-> languages 1)) + (audio-language-index language-enum-s32 :overlay-at (-> languages 2)) (current-task-index int32) (current-line-index int32) (first-closed-line-index int32) @@ -130,7 +130,7 @@ ) (:methods (init-defaults (_type_) object) - (respond-to-cpad (_type_) none) + (respond-to-cpad (_type_) object) (gone? (_type_) object) (can-go-back? (_type_) symbol) (get-state-check-card (_type_ symbol) symbol) @@ -138,27 +138,27 @@ (pop-state (_type_) int) (set-next-state (_type_ symbol int) int) (set-menu-options (_type_ symbol) int) - (progress-method-33 (_type_ progress-box) none) - (progress-method-34 (_type_) none) + (progress-method-33 (_type_ progress-box) object) + (progress-method-34 (_type_) object) (get-scissor-stack-top (_type_) vector) (get-language-by-idx (_type_ int) int) - (progress-method-37 (_type_) none) - (progress-method-38 (_type_ font-context float) none) - (progress-method-39 (_type_) none) - (progress-method-40 (_type_ font-context int int float) none) - (progress-method-41 (_type_ progress-box float) none) - (progress-method-42 (_type_ progress-box float) none) - (progress-method-43 (_type_ progress-box float) none) - (progress-method-44 (_type_ font-context string) none) + (set-selected-color (_type_) object) + (adjust-font-origin-y (_type_ font-context float) object) + (progress-method-39 (_type_) object) + (draw-highlight-bar (_type_ font-context int int float) object) + (draw-bg-box-outline (_type_ progress-box float) object) + (draw-bg-box-alpha-2 (_type_ progress-box float) object) + (draw-bg-box-alpha-1 (_type_ progress-box float) object) + (progress-method-44 (_type_ font-context string) object) (progress-method-45 (_type_ font-context float float string float float int) float) - (progress-method-46 (_type_ font-context float int) none) - (progress-method-47 (_type_ font-context symbol symbol) none) - (draw-prev-next-footer (_type_ font-context float) none) - (draw-yes-no-style-footer (_type_ font-context text-id text-id) none) - (progress-method-50 (_type_ font-context text-id text-id text-id symbol symbol float) none) - (progress-method-51 (_type_ font-context) none) - (progress-method-52 (_type_ font-context string float float float float float) none) - (progress-method-53 (_type_ font-context) none) + (draw-header (_type_ font-context float text-id) object) + (progress-method-47 (_type_ font-context symbol symbol) object) + (draw-prev-next-footer (_type_ font-context float) object) + (draw-yes-no-style-footer (_type_ font-context text-id text-id) object) + (progress-method-50 (_type_ font-context text-id text-id text-id symbol symbol float) object) + (progress-method-51 (_type_ font-context) object) + (draw-slider-option (_type_ font-context string float float float float float) object) + (progress-method-53 (_type_ font-context) object) ) ) @@ -258,7 +258,7 @@ (load-save-3b progress-box :inline) (last-slot-saved int32) (selected-num int32) - (secrets-unlocked basic) + (secrets-unlocked symbol) (hero-mode-save symbol) ) ) @@ -1044,7 +1044,7 @@ ((current-index float) (target-index float) (scroll-speed float) - (on-screen basic) + (on-screen symbol) ) ) diff --git a/test/decompiler/reference/jak3/engine/ui/progress/progress_REF.gc b/test/decompiler/reference/jak3/engine/ui/progress/progress_REF.gc index ee6aa7af28..0062369b38 100644 --- a/test/decompiler/reference/jak3/engine/ui/progress/progress_REF.gc +++ b/test/decompiler/reference/jak3/engine/ui/progress/progress_REF.gc @@ -247,17 +247,21 @@ (set-time! (-> this last-move)) (set! (-> this center-x-backup) (-> *setting-control* user-default screenx)) (set! (-> this center-y-backup) (-> *setting-control* user-default screeny)) - (set! (-> this flip-horizontal) (the-as basic (-> *setting-control* cam-default flip-horizontal))) - (set! (-> this flip-vertical) (the-as basic (-> *setting-control* cam-default flip-vertical))) - (set! (-> this progressive-scan) (the-as basic (-> *setting-control* user-default set-video-mode))) - (set! (-> this aspect-ratio) (the-as basic (get-aspect-ratio))) - (set! (-> this video-mode) (the-as basic (get-video-mode))) + (set! (-> this flip-horizontal) (-> *setting-control* cam-default flip-horizontal)) + (set! (-> this flip-vertical) (-> *setting-control* cam-default flip-vertical)) + (set! (-> this progressive-scan) (-> *setting-control* user-default set-video-mode)) + (set! (-> this aspect-ratio) (get-aspect-ratio)) + (set! (-> this video-mode) (get-video-mode)) (set! (-> this stereo-mode-backup) (-> *setting-control* user-default stereo-mode)) - (set! (-> this vibrations) (the-as basic (-> *setting-control* user-default vibration))) - (set! (-> this subtitles) (the-as basic (-> *setting-control* user-default subtitle))) - (set! (-> this language-index) (the-as int (-> *setting-control* user-default language))) - (set! (-> this subtitle-language-index) (the-as int (-> *setting-control* user-default subtitle-language))) - (set! (-> this audio-language-index) (the-as int (-> *setting-control* user-default audio-language))) + (set! (-> this vibrations) (-> *setting-control* user-default vibration)) + (set! (-> this subtitles) (-> *setting-control* user-default subtitle)) + (set! (-> this language-index) (the-as language-enum-s32 (-> *setting-control* user-default language))) + (set! (-> this subtitle-language-index) + (the-as language-enum-s32 (-> *setting-control* user-default subtitle-language)) + ) + (set! (-> this audio-language-index) + (the-as language-enum-s32 (-> *setting-control* user-default audio-language)) + ) (set! (-> (the-as menu-missions-option (-> *missions-options* options 0)) current-index) 0.0) (set! (-> (the-as menu-missions-option (-> *missions-options* options 0)) target-index) 0.0) (set! (-> *progress-work* secrets-unlocked) #f) @@ -434,7 +438,7 @@ (set! (-> self pos-transition) 1.0) (init-defaults self) (set-next-state self arg0 0) - (set! (-> self starting-state) (the-as basic (-> self next))) + (set! (-> self starting-state) (-> self next)) (set! (-> self current) (-> self next)) (if (= arg0 'main) (set! (-> self next) 'none) @@ -959,7 +963,7 @@ 0 ) (('select-scene-special) - (set! (-> this starting-state) (the-as basic 'title)) + (set! (-> this starting-state) 'title) (set! (-> this state-pos) 0) (let ((v1-80 (-> this state-pos))) (set! (-> this state-array v1-80) 'title) @@ -1009,7 +1013,7 @@ ) ;; definition for method 25 of type progress -;; WARN: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs object. (defmethod respond-to-cpad ((this progress)) (mc-get-slot-info 0 *progress-save-info*) (memcard-unlocked-secrets? this #f) @@ -1124,7 +1128,6 @@ ) ) 0 - (none) ) ;; definition for function progress-trans @@ -1172,7 +1175,7 @@ (cond ((and (cpad-hold? 0 l2) (cpad-hold? 0 r1)) (when (= (-> self current-options) *main-options*) - (set! (-> *progress-work* secrets-unlocked) (the-as basic #t)) + (set! (-> *progress-work* secrets-unlocked) #t) (set! (-> *progress-work* selected-num) 0) (set! (-> self current-options) *main-options-debug*) ) @@ -1361,7 +1364,7 @@ ;; definition for method 33 of type progress ;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs object. (defmethod progress-method-33 ((this progress) (arg0 progress-box)) (set! (-> this scissor-count) (min 7 (+ (-> this scissor-count) 1))) (let ((s5-0 (-> this scissor-stack (-> this scissor-count))) @@ -1414,11 +1417,10 @@ ) ) 0 - (none) ) ;; definition for method 34 of type progress -;; WARN: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs object. (defmethod progress-method-34 ((this progress)) (set! (-> this scissor-count) (max 0 (+ (-> this scissor-count) -1))) (let ((gp-0 (-> this scissor-stack (-> this scissor-count)))) @@ -1464,7 +1466,6 @@ ) ) 0 - (none) ) ;; definition for method 35 of type progress @@ -1485,7 +1486,7 @@ (defbehavior progress-post progress () (local-vars (sv-208 font-context) (sv-212 int) (sv-216 hud-box) (sv-220 symbol)) (when (-> self current-options) - (progress-method-37 self) + (set-selected-color self) (set! (-> self scissor-count) -1) (progress-method-33 self (-> *progress-work* full-screen)) (let ((gp-0 (-> self current-options options))) @@ -1505,8 +1506,8 @@ (begin-scan sv-216 self) (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> self menu-transition)))))) (when (not (or (= (-> self current) 'bigmap) (= (-> self next) 'bigmap))) - (progress-method-43 self (-> s4-0 small-screen) (* 144.0 f30-0)) - (progress-method-41 self (-> s4-0 small-screen) (* 128.0 f30-0)) + (draw-bg-box-alpha-1 self (-> s4-0 small-screen) (* 144.0 f30-0)) + (draw-bg-box-outline self (-> s4-0 small-screen) (* 128.0 f30-0)) ) ) ) @@ -2306,7 +2307,7 @@ ;; definition for method 9 of type menu-already-exists-option (defmethod respond-progress ((this menu-already-exists-option) (arg0 progress) (arg1 symbol)) (let ((a1-2 (get-state-check-card arg0 'select-save)) - (gp-0 (the-as object #f)) + (gp-0 #f) ) (if (!= a1-2 'select-save) (set-next-state arg0 a1-2 0) @@ -2314,7 +2315,7 @@ (cond ((cpad-pressed? 0 left l-analog-left) (set! gp-0 (not (-> arg0 yes-no-choice))) - (set! (-> arg0 yes-no-choice) (the-as basic #t)) + (set! (-> arg0 yes-no-choice) #t) ) ((cpad-pressed? 0 right l-analog-right) (set! gp-0 (-> arg0 yes-no-choice)) @@ -2350,7 +2351,7 @@ ;; definition for method 9 of type menu-create-game-option (defmethod respond-progress ((this menu-create-game-option) (arg0 progress) (arg1 symbol)) (let ((s4-0 (&-> arg0 yes-no-choice)) - (gp-0 (the-as object #f)) + (gp-0 #f) ) (let ((a1-2 (get-state-check-card arg0 'select-save))) (if (!= a1-2 'select-save) @@ -2360,7 +2361,7 @@ (cond ((cpad-pressed? 0 left l-analog-left) (set! gp-0 (not (-> s4-0 0))) - (set! (-> s4-0 0) (the-as basic #t)) + (set! (-> s4-0 0) #t) ) ((cpad-pressed? 0 right l-analog-right) (set! gp-0 (-> s4-0 0)) @@ -2403,7 +2404,7 @@ ((cpad-pressed? 0 left l-analog-left) (when (and (not (-> s5-0 0)) (not (-> arg0 clear-screen))) (sound-play "generic-beep") - (set! (-> s5-0 0) (the-as basic #t)) + (set! (-> s5-0 0) #t) ) ) ((cpad-pressed? 0 right l-analog-right) @@ -2523,7 +2524,7 @@ (cond ((and (cpad-pressed? 0 left l-analog-left) (not (-> gp-0 0))) (sound-play "generic-beep") - (set! (-> gp-0 0) (the-as basic #t)) + (set! (-> gp-0 0) #t) ) ((and (cpad-pressed? 0 right l-analog-right) (-> gp-0 0)) (sound-play "generic-beep") @@ -2535,12 +2536,12 @@ (set! (-> arg0 time-out) 0) (cond ((-> arg0 yes-no-choice) - (set! (-> *setting-control* user-default video-mode) (the-as symbol (-> arg0 video-mode))) + (set! (-> *setting-control* user-default video-mode) (-> arg0 video-mode)) (set-time! (-> arg0 time-out)) (set-next-state arg0 'video-mode-ok 0) ) (else - (set! (-> arg0 video-mode) (the-as basic 'pal)) + (set! (-> arg0 video-mode) 'pal) (pop-state arg0) ) ) @@ -2556,7 +2557,7 @@ (cond ((and (cpad-pressed? 0 left l-analog-left) (not (-> s5-0 0))) (sound-play "generic-beep") - (set! (-> s5-0 0) (the-as basic #t)) + (set! (-> s5-0 0) #t) ) ((and (cpad-pressed? 0 right l-analog-right) (-> s5-0 0)) (sound-play "generic-beep") @@ -2570,8 +2571,8 @@ (sound-play "generic-beep") ) (else - (set! (-> arg0 video-mode) (the-as basic 'pal)) - (set! (-> *setting-control* user-default video-mode) (the-as symbol (-> arg0 video-mode))) + (set! (-> arg0 video-mode) 'pal) + (set! (-> *setting-control* user-default video-mode) (-> arg0 video-mode)) (sound-play "generic-beep") ) ) @@ -2582,8 +2583,8 @@ ) (when (and (nonzero? (-> arg0 time-out)) (< (seconds 10) (- (current-time) (-> arg0 time-out)))) (set! (-> arg0 time-out) 0) - (set! (-> arg0 video-mode) (the-as basic 'pal)) - (set! (-> *setting-control* user-default video-mode) (the-as symbol (-> arg0 video-mode))) + (set! (-> arg0 video-mode) 'pal) + (set! (-> *setting-control* user-default video-mode) (-> arg0 video-mode)) (pop-state arg0) ) 0 @@ -2595,8 +2596,8 @@ (cond ((and (cpad-pressed? 0 left l-analog-left) (not (-> s5-0 0))) (sound-play "generic-beep") - (set! (-> arg0 progressive-scan) (the-as basic #t)) - (set! (-> s5-0 0) (the-as basic #t)) + (set! (-> arg0 progressive-scan) #t) + (set! (-> s5-0 0) #t) ) ((and (cpad-pressed? 0 right l-analog-right) (-> s5-0 0)) (sound-play "generic-beep") @@ -2611,7 +2612,7 @@ ((-> arg0 yes-no-choice) (sound-play "generic-beep") (set-progressive-scan #t) - (set! (-> arg0 progressive-scan) (the-as basic #t)) + (set! (-> arg0 progressive-scan) #t) (set-time! (-> arg0 time-out)) (set-next-state arg0 'progressive-mode-ok 0) ) @@ -2633,7 +2634,7 @@ (cond ((and (cpad-pressed? 0 left l-analog-left) (not (-> s5-0 0))) (sound-play "generic-beep") - (set! (-> s5-0 0) (the-as basic #t)) + (set! (-> s5-0 0) #t) ) ((and (cpad-pressed? 0 right l-analog-right) (-> s5-0 0)) (sound-play "generic-beep") @@ -2650,7 +2651,7 @@ ) (else (sound-play "generic-beep") - (set! (-> arg0 progressive-scan) (the-as basic #t)) + (set! (-> arg0 progressive-scan) #t) ) ) (set! (-> arg0 time-out) 0) @@ -2755,7 +2756,7 @@ ;; definition for method 9 of type menu-format-card-option (defmethod respond-progress ((this menu-format-card-option) (arg0 progress) (arg1 symbol)) (let ((s4-0 (&-> arg0 yes-no-choice)) - (gp-0 (the-as object #f)) + (gp-0 #f) ) (let ((a1-2 (get-state-check-card arg0 (-> arg0 current)))) (set-next-state arg0 a1-2 0) @@ -2763,7 +2764,7 @@ (cond ((cpad-pressed? 0 left l-analog-left) (set! gp-0 (not (-> s4-0 0))) - (set! (-> s4-0 0) (the-as basic #t)) + (set! (-> s4-0 0) #t) ) ((cpad-pressed? 0 right l-analog-right) (set! gp-0 (-> s4-0 0)) @@ -3323,7 +3324,7 @@ ;; definition for method 9 of type menu-secret-option (defmethod respond-progress ((this menu-secret-option) (arg0 progress) (arg1 symbol)) - (let ((gp-0 (the-as object #f))) + (let ((gp-0 #f)) (the float (+ (-> *menu-secrets-array* length) -1)) (let ((a0-1 (+ (-> *menu-secrets-array* length) -1)) (v1-5 *menu-secrets-array*) @@ -3351,7 +3352,7 @@ (cond ((cpad-pressed? 0 left l-analog-left) (set! gp-0 (not (-> arg0 yes-no-choice))) - (set! (-> arg0 yes-no-choice) (the-as basic #t)) + (set! (-> arg0 yes-no-choice) #t) ) ((cpad-pressed? 0 right l-analog-right) (set! gp-0 (-> arg0 yes-no-choice)) @@ -3522,39 +3523,45 @@ (set! (-> *cpad-list* cpads 0 buzz-pause-val 0) (the-as uint 255)) (set! (-> *cpad-list* cpads 0 buzz-pause-time) (the-as uint 15)) ) - (set! (-> arg0 vibrations) (the-as basic #t)) + (set! (-> arg0 vibrations) #t) ) ((4) - (set! (-> arg0 subtitles) (the-as basic #t)) + (set! (-> arg0 subtitles) #t) ) ((5) - (set! (-> arg0 subtitle-language-index) (mod (+ (-> arg0 subtitle-language-index) 9) 10)) - (if (and (= (-> arg0 subtitle-language-index) 7) + (set! (-> arg0 subtitle-language-index) + (the-as language-enum-s32 (mod (the-as int (+ (-> arg0 subtitle-language-index) 9)) 10)) + ) + (if (and (= (-> arg0 subtitle-language-index) (language-enum-s32 korean)) (or (= (scf-get-territory) 1) (and (!= (scf-get-territory) 3) (not *cheat-mode*) (!= *progress-cheat* 'language)) ) ) (+! (-> arg0 subtitle-language-index) -1) ) - (if (= (-> arg0 subtitle-language-index) 6) + (if (= (-> arg0 subtitle-language-index) (language-enum-s32 japanese)) (+! (-> arg0 subtitle-language-index) -2) ) ) ((6) - (set! (-> arg0 language-index) (mod (+ (-> arg0 language-index) 9) 10)) - (if (and (= (-> arg0 language-index) 7) + (set! (-> arg0 language-index) + (the-as language-enum-s32 (mod (the-as int (+ (-> arg0 language-index) 9)) 10)) + ) + (if (and (= (-> arg0 language-index) (language-enum-s32 korean)) (or (= (scf-get-territory) 1) (and (!= (scf-get-territory) 3) (not *cheat-mode*) (!= *progress-cheat* 'language)) ) ) (+! (-> arg0 language-index) -1) ) - (if (= (-> arg0 language-index) 6) + (if (= (-> arg0 language-index) (language-enum-s32 japanese)) (+! (-> arg0 language-index) -2) ) ) ((7) - (set! (-> arg0 audio-language-index) (mod (+ (-> arg0 audio-language-index) 4) 5)) + (set! (-> arg0 audio-language-index) + (the-as language-enum-s32 (mod (the-as int (+ (-> arg0 audio-language-index) 4)) 5)) + ) ) ) ) @@ -3568,11 +3575,13 @@ (set! (-> arg0 subtitles) #f) ) ((5) - (set! (-> arg0 subtitle-language-index) (mod (+ (-> arg0 subtitle-language-index) 1) 10)) - (if (= (-> arg0 subtitle-language-index) 5) + (set! (-> arg0 subtitle-language-index) + (the-as language-enum-s32 (mod (the-as int (+ (-> arg0 subtitle-language-index) 1)) 10)) + ) + (if (= (-> arg0 subtitle-language-index) (language-enum-s32 commentary)) (+! (-> arg0 subtitle-language-index) 2) ) - (if (and (= (-> arg0 subtitle-language-index) 7) + (if (and (= (-> arg0 subtitle-language-index) (language-enum-s32 korean)) (or (= (scf-get-territory) 1) (and (!= (scf-get-territory) 3) (not *cheat-mode*) (!= *progress-cheat* 'language)) ) @@ -3581,11 +3590,13 @@ ) ) ((6) - (set! (-> arg0 language-index) (mod (+ (-> arg0 language-index) 1) 10)) - (if (= (-> arg0 language-index) 5) + (set! (-> arg0 language-index) + (the-as language-enum-s32 (mod (the-as int (+ (-> arg0 language-index) 1)) 10)) + ) + (if (= (-> arg0 language-index) (language-enum-s32 commentary)) (+! (-> arg0 language-index) 2) ) - (if (and (= (-> arg0 language-index) 7) + (if (and (= (-> arg0 language-index) (language-enum-s32 korean)) (or (= (scf-get-territory) 1) (and (!= (scf-get-territory) 3) (not *cheat-mode*) (!= *progress-cheat* 'language)) ) @@ -3594,17 +3605,19 @@ ) ) ((7) - (set! (-> arg0 audio-language-index) (mod (+ (-> arg0 audio-language-index) 1) 5)) + (set! (-> arg0 audio-language-index) + (the-as language-enum-s32 (mod (the-as int (+ (-> arg0 audio-language-index) 1)) 5)) + ) ) ) ) ((cpad-pressed? 0 confirm) (case (-> this menu-option-type) ((3) - (set! (-> *setting-control* user-default vibration) (the-as symbol (-> arg0 vibrations))) + (set! (-> *setting-control* user-default vibration) (-> arg0 vibrations)) ) ((4) - (set! (-> *setting-control* user-default subtitle) (the-as symbol (-> arg0 subtitles))) + (set! (-> *setting-control* user-default subtitle) (-> arg0 subtitles)) ) ((5) (set! (-> *setting-control* user-default subtitle-language) @@ -3613,7 +3626,7 @@ ) ((6) (set! (-> *setting-control* user-default language) (the-as language-enum (-> arg0 language-index))) - (load-level-text-files (-> arg0 language-index)) + (load-level-text-files (the-as int (-> arg0 language-index))) ) ((7) (set! (-> *setting-control* user-default audio-language) @@ -3636,11 +3649,15 @@ (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons down l-analog-down)) ) (else - (set! (-> arg0 vibrations) (the-as basic (-> *setting-control* user-default vibration))) - (set! (-> arg0 subtitles) (the-as basic (-> *setting-control* user-default subtitle))) - (set! (-> arg0 language-index) (the-as int (-> *setting-control* user-default language))) - (set! (-> arg0 subtitle-language-index) (the-as int (-> *setting-control* user-default subtitle-language))) - (set! (-> arg0 audio-language-index) (the-as int (-> *setting-control* user-default audio-language))) + (set! (-> arg0 vibrations) (-> *setting-control* user-default vibration)) + (set! (-> arg0 subtitles) (-> *setting-control* user-default subtitle)) + (set! (-> arg0 language-index) (the-as language-enum-s32 (-> *setting-control* user-default language))) + (set! (-> arg0 subtitle-language-index) + (the-as language-enum-s32 (-> *setting-control* user-default subtitle-language)) + ) + (set! (-> arg0 audio-language-index) + (the-as language-enum-s32 (-> *setting-control* user-default audio-language)) + ) ) ) 0 @@ -3649,31 +3666,35 @@ ;; definition for method 9 of type menu-language-option (defmethod respond-progress ((this menu-language-option) (arg0 progress) (arg1 symbol)) (enable-level-text-file-loading) - (set! (-> arg0 language-index) (the-as int (-> *setting-control* user-default language))) + (set! (-> arg0 language-index) (the-as language-enum-s32 (-> *setting-control* user-default language))) (cond ((cpad-pressed? 0 left l-analog-left) (sound-play "generic-beep") - (set! (-> arg0 language-index) (mod (+ (-> arg0 language-index) 9) 10)) - (if (and (= (-> arg0 language-index) 7) + (set! (-> arg0 language-index) + (the-as language-enum-s32 (mod (the-as int (+ (-> arg0 language-index) 9)) 10)) + ) + (if (and (= (-> arg0 language-index) (language-enum-s32 korean)) (or (= (scf-get-territory) 1) (and (!= (scf-get-territory) 3) (not *cheat-mode*) (!= *progress-cheat* 'language)) ) ) (+! (-> arg0 language-index) -1) ) - (if (= (-> arg0 language-index) 6) + (if (= (-> arg0 language-index) (language-enum-s32 japanese)) (+! (-> arg0 language-index) -2) ) (set! (-> *setting-control* user-default language) (the-as language-enum (-> arg0 language-index))) - (load-level-text-files (-> arg0 language-index)) + (load-level-text-files (the-as int (-> arg0 language-index))) ) ((cpad-pressed? 0 right l-analog-right) (sound-play "generic-beep") - (set! (-> arg0 language-index) (mod (+ (-> arg0 language-index) 1) 10)) - (if (= (-> arg0 language-index) 5) + (set! (-> arg0 language-index) + (the-as language-enum-s32 (mod (the-as int (+ (-> arg0 language-index) 1)) 10)) + ) + (if (= (-> arg0 language-index) (language-enum-s32 commentary)) (+! (-> arg0 language-index) 2) ) - (if (and (= (-> arg0 language-index) 7) + (if (and (= (-> arg0 language-index) (language-enum-s32 korean)) (or (= (scf-get-territory) 1) (and (!= (scf-get-territory) 3) (not *cheat-mode*) (!= *progress-cheat* 'language)) ) @@ -3681,7 +3702,7 @@ (+! (-> arg0 language-index) 1) ) (set! (-> *setting-control* user-default language) (the-as language-enum (-> arg0 language-index))) - (load-level-text-files (-> arg0 language-index)) + (load-level-text-files (the-as int (-> arg0 language-index))) ) ((cpad-pressed? 0 confirm) (set! (-> *setting-control* user-default subtitle-language) (the-as language-enum (-> arg0 language-index))) @@ -3754,17 +3775,17 @@ (cond ((cpad-pressed? 0 left l-analog-left) (sound-play "generic-beep") - (set! (-> arg0 aspect-ratio) (the-as basic 'aspect4x3)) + (set! (-> arg0 aspect-ratio) 'aspect4x3) ) ((cpad-pressed? 0 right l-analog-right) (sound-play "generic-beep") - (set! (-> arg0 aspect-ratio) (the-as basic 'aspect16x9)) + (set! (-> arg0 aspect-ratio) 'aspect16x9) ) ((cpad-pressed? 0 triangle) - (set! (-> arg0 aspect-ratio) (the-as basic (get-aspect-ratio))) + (set! (-> arg0 aspect-ratio) (get-aspect-ratio)) ) ((cpad-pressed? 0 confirm) - (set! (-> *setting-control* user-default aspect-ratio) (the-as symbol (-> arg0 aspect-ratio))) + (set! (-> *setting-control* user-default aspect-ratio) (-> arg0 aspect-ratio)) ) ) ) @@ -3772,7 +3793,7 @@ (cond ((cpad-pressed? 0 left l-analog-left) (sound-play "generic-beep") - (set! (-> arg0 progressive-scan) (the-as basic #t)) + (set! (-> arg0 progressive-scan) #t) ) ((cpad-pressed? 0 right l-analog-right) (sound-play "generic-beep") @@ -3780,7 +3801,7 @@ (set! (-> *setting-control* user-default set-video-mode) #f) ) ((cpad-pressed? 0 triangle) - (set! (-> arg0 progressive-scan) (the-as basic (-> *setting-control* user-default set-video-mode))) + (set! (-> arg0 progressive-scan) (-> *setting-control* user-default set-video-mode)) ) ((cpad-pressed? 0 confirm) (push-state arg0) @@ -3792,21 +3813,21 @@ (cond ((cpad-pressed? 0 left l-analog-left) (sound-play "generic-beep") - (set! (-> arg0 video-mode) (the-as basic 'pal)) + (set! (-> arg0 video-mode) 'pal) ) ((cpad-pressed? 0 right l-analog-right) (sound-play "generic-beep") - (set! (-> arg0 video-mode) (the-as basic 'ntsc)) + (set! (-> arg0 video-mode) 'ntsc) ) ((cpad-pressed? 0 triangle) - (set! (-> arg0 video-mode) (the-as basic (get-video-mode))) + (set! (-> arg0 video-mode) (get-video-mode)) ) ((cpad-pressed? 0 confirm) (when (!= (-> *setting-control* user-default video-mode) (-> arg0 video-mode)) (let ((v1-88 (-> arg0 video-mode))) (case v1-88 (('pal) - (set! (-> *setting-control* user-default video-mode) (the-as symbol v1-88)) + (set! (-> *setting-control* user-default video-mode) v1-88) ) (('ntsc) (push-state arg0) @@ -3832,13 +3853,13 @@ (set! (-> arg0 center-y-backup) (-> *setting-control* user-default screeny)) ) ((9) - (set! (-> arg0 aspect-ratio) (the-as basic (-> *setting-control* user-default aspect-ratio))) + (set! (-> arg0 aspect-ratio) (-> *setting-control* user-default aspect-ratio)) ) ((10) - (set! (-> arg0 progressive-scan) (the-as basic (-> *setting-control* user-default set-video-mode))) + (set! (-> arg0 progressive-scan) (-> *setting-control* user-default set-video-mode)) ) ((11) - (set! (-> arg0 video-mode) (the-as basic (get-video-mode))) + (set! (-> arg0 video-mode) (get-video-mode)) ) ) ) @@ -3859,14 +3880,14 @@ (sound-play "generic-beep") ) ((cpad-pressed? 0 right l-analog-right) - (set! (-> arg0 flip-horizontal) (the-as basic #t)) + (set! (-> arg0 flip-horizontal) #t) (sound-play "generic-beep") ) ((cpad-pressed? 0 confirm) - (set! (-> *setting-control* cam-default flip-horizontal) (the-as symbol (-> arg0 flip-horizontal))) + (set! (-> *setting-control* cam-default flip-horizontal) (-> arg0 flip-horizontal)) ) ((cpad-pressed? 0 triangle) - (set! (-> arg0 flip-horizontal) (the-as basic (-> *setting-control* cam-current flip-horizontal))) + (set! (-> arg0 flip-horizontal) (-> *setting-control* cam-current flip-horizontal)) ) ) ) @@ -3877,14 +3898,14 @@ (sound-play "generic-beep") ) ((cpad-pressed? 0 right l-analog-right) - (set! (-> arg0 flip-vertical) (the-as basic #t)) + (set! (-> arg0 flip-vertical) #t) (sound-play "generic-beep") ) ((cpad-pressed? 0 confirm) - (set! (-> *setting-control* cam-default flip-vertical) (the-as symbol (-> arg0 flip-vertical))) + (set! (-> *setting-control* cam-default flip-vertical) (-> arg0 flip-vertical)) ) ((cpad-pressed? 0 triangle) - (set! (-> arg0 flip-vertical) (the-as basic (-> *setting-control* cam-current flip-vertical))) + (set! (-> arg0 flip-vertical) (-> *setting-control* cam-current flip-vertical)) ) ) ) @@ -3897,12 +3918,12 @@ (else (cond ((cpad-pressed? 0 confirm) - (set! (-> arg0 flip-horizontal) (the-as basic (-> *setting-control* cam-current flip-horizontal))) - (set! (-> arg0 flip-vertical) (the-as basic (-> *setting-control* cam-current flip-vertical))) + (set! (-> arg0 flip-horizontal) (-> *setting-control* cam-current flip-horizontal)) + (set! (-> arg0 flip-vertical) (-> *setting-control* cam-current flip-vertical)) ) ((cpad-pressed? 0 triangle) - (set! (-> arg0 flip-horizontal) (the-as basic (-> *setting-control* cam-current flip-horizontal))) - (set! (-> arg0 flip-vertical) (the-as basic (-> *setting-control* cam-current flip-vertical))) + (set! (-> arg0 flip-horizontal) (-> *setting-control* cam-current flip-horizontal)) + (set! (-> arg0 flip-vertical) (-> *setting-control* cam-current flip-vertical)) ) ) ) @@ -4092,7 +4113,7 @@ (cond ((and (cpad-pressed? 0 left l-analog-left) (not (-> s5-0 0))) (sound-play "generic-beep") - (set! (-> s5-0 0) (the-as basic #t)) + (set! (-> s5-0 0) #t) ) ((and (cpad-pressed? 0 right l-analog-right) (-> s5-0 0)) (sound-play "generic-beep") diff --git a/test/decompiler/reference/jak3/levels/common/enemy/prebot-eco-creature_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/prebot-eco-creature_REF.gc index 03b10efbd2..c1ffad6d27 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/prebot-eco-creature_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/prebot-eco-creature_REF.gc @@ -1721,8 +1721,8 @@ ;; definition of type prebot-medium-eco-creature (deftype prebot-medium-eco-creature (prebot-large-eco-creature) - ((is-top basic) - (is-bottom basic) + ((is-top symbol) + (is-bottom symbol) (initial-scale float) (final-scale float) ) @@ -2388,7 +2388,7 @@ ;; definition for method 196 of type prebot-medium-eco-creature ;; WARN: Return type mismatch int vs none. (defmethod prebot-medium-eco-creature-method-196 ((this prebot-medium-eco-creature)) - (set! (-> this is-top) (the-as basic #t)) + (set! (-> this is-top) #t) (let ((v1-2 (-> this node-list data 32))) (set! (-> v1-2 param0) prebot-eco-creature-joint-callback) (set! (-> v1-2 param1) (the-as basic #x3d23d70a)) @@ -2452,7 +2452,7 @@ ;; definition for method 197 of type prebot-medium-eco-creature ;; WARN: Return type mismatch int vs none. (defmethod prebot-medium-eco-creature-method-197 ((this prebot-medium-eco-creature)) - (set! (-> this is-bottom) (the-as basic #t)) + (set! (-> this is-bottom) #t) (let ((v1-2 (-> this node-list data 4))) (set! (-> v1-2 param0) prebot-eco-creature-joint-callback) (set! (-> v1-2 param1) (the-as basic #x3d23d70a))