[game] pc port progress menu (#1281)

* fix typo

* more typo

* shorten discord rpc text

* allow expanding enums after the fact (untested)

* make `game_text` work similar to subtitles

* update progress decomp

* update some types + `do-not-decompile` in bitfield

* fixes and fall back to original progress code

* update `progress` decomp with new enums

* update config files

* fix enums and debug menu

* always allocate (but not use) a lot of particles

* small rework to display mode options

* revert resolution/aspect-ratio symbol mess

* begin the override stuff

* make `progress-draw` more readable

* more fixes

* codacy good boy points

* first step overriding code

* finish progress overrides, game options menu fully functional!

* minor fixes

* Update game.gp

* Update sparticle-launcher.gc

* clang

* change camera controls text

* oops

* some cleanup

* derp

* nice job

* implement menu scrolling lol

* make scrollable menus less cramped, fix arrows

* make some carousell things i guess

* add msaa carousell to test

* oops

* Update progress-pc.gc

* make `pc-get-screen-size` (untested)

* resolution menu

* input fixes

* return when selecting resolution

* scroll fixes

* Update progress-pc.gc

* add "fit to screen" button

* bug

* complete resolutions menu

* aspect ratio menu

* subtitles language

* subtitle speaker

* final adjustments

* ref test

* fix tests

* fix ref!

* reduce redundancy a bit

* fix mem leaks?

* save settings on progress exit

* fix init reorder

* remove unused code

* rename goal project-like files to the project extension

* sha display toggle

* aspect ratio settings fixes

* dont store text db's in compiler

* properly save+load native aspect stuff
This commit is contained in:
ManDude
2022-04-11 23:38:54 +01:00
committed by GitHub
parent b408c78698
commit a7eee4fdc9
185 changed files with 6172 additions and 11465 deletions
+210 -210
View File
@@ -1579,7 +1579,7 @@
(sv-464 int)
(sv-480 int)
(sv-496 int)
(sv-512 uint)
(sv-512 int)
(sv-528 (function _varargs_ object))
(sv-544 string)
(sv-560 string)
@@ -1629,7 +1629,7 @@
(set! sv-144 s2-1)
(let ((v1-18 (-> s3-0 s0-0 option-type)))
(cond
((= v1-18 7)
((= v1-18 (game-option-type yes-no))
(cond
((-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify)))
(set! sv-160 format)
@@ -1655,7 +1655,7 @@
)
)
)
((or (= v1-18 6) (= v1-18 8))
((or (= v1-18 (game-option-type menu)) (= v1-18 (game-option-type button)))
(cond
((nonzero? (-> s3-0 s0-0 name))
(set! sv-912 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f))
@@ -1673,7 +1673,7 @@
)
(set! (-> sv-112 origin x) (the float (- sv-128 (-> obj left-x-offset))))
(case (-> s3-0 s0-0 option-type)
((3)
(((game-option-type center-screen))
(set! (-> sv-112 origin y) (the float (+ s2-1 -20)))
)
(else
@@ -1693,7 +1693,7 @@
(sv-288 a0-23 a1-11 a2-10 a3-4 t0-1)
)
(case (-> s3-0 s0-0 option-type)
((3)
(((game-option-type center-screen))
(set! sv-144 (+ s2-1 3))
sv-144
)
@@ -1702,243 +1702,243 @@
sv-144
)
)
(let ((v1-81 (-> s3-0 s0-0 option-type)))
(cond
((zero? v1-81)
(let* ((v1-82 (the-as uint #x8000ffff))
(f0-12 (* 0.01 (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify)))))
(a0-34 (logior (logand v1-82 -256) (shr (shl (the int (+ 64.0 (* 191.0 f0-12))) 56) 56)))
(a3-5 (logior (logand a0-34 -65281) (shr (shl (shr (shl a0-34 56) 56) 56) 48)))
)
(draw-percent-bar (- 75 (-> obj left-x-offset)) (+ s2-1 8) f0-12 (the-as int a3-5))
)
(set! sv-304 format)
(let ((a0-42 (clear *temp-string*))
(a1-13 "~D")
(a2-12 (the int (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify)))))
)
(sv-304 a0-42 a1-13 a2-12)
)
(set! sv-912 *temp-string*)
(set! sv-128 (+ (the int (* 2.5 (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) -100))
sv-128
)
((= v1-81 2)
(cond
((-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify)))
(set! sv-320 format)
(set! sv-336 (clear *temp-string*))
(set! sv-352 "~30L~S~0L ~S")
(set! sv-368 (lookup-text! *common-text* (game-text-id on) #f))
(let ((a3-6 (lookup-text! *common-text* (game-text-id off) #f)))
(sv-320 sv-336 sv-352 sv-368 a3-6)
(case (-> s3-0 s0-0 option-type)
(((game-option-type slider))
(let* ((v1-82 (the-as uint #x8000ffff))
(f0-12 (* 0.01 (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify)))))
(a0-34 (logior (logand v1-82 -256) (shr (shl (the int (+ 64.0 (* 191.0 f0-12))) 56) 56)))
(a3-5 (logior (logand a0-34 -65281) (shr (shl (shr (shl a0-34 56) 56) 56) 48)))
)
(set! sv-912 *temp-string*)
sv-912
)
(else
(set! sv-384 format)
(set! sv-400 (clear *temp-string*))
(set! sv-416 "~0L~S ~30L~S~1L")
(set! sv-432 (lookup-text! *common-text* (game-text-id on) #f))
(let ((a3-7 (lookup-text! *common-text* (game-text-id off) #f)))
(sv-384 sv-400 sv-416 sv-432 a3-7)
)
(set! sv-912 *temp-string*)
sv-912
(draw-percent-bar (- 75 (-> obj left-x-offset)) (+ s2-1 8) f0-12 (the-as int a3-5))
)
(set! sv-304 format)
(let ((a0-42 (clear *temp-string*))
(a1-13 "~D")
(a2-12 (the int (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify)))))
)
(sv-304 a0-42 a1-13 a2-12)
)
(set! sv-912 *temp-string*)
(set! sv-128 (+ (the int (* 2.5 (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) -100))
sv-128
)
(((game-option-type on-off))
(cond
((-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify)))
(set! sv-320 format)
(set! sv-336 (clear *temp-string*))
(set! sv-352 "~30L~S~0L ~S")
(set! sv-368 (lookup-text! *common-text* (game-text-id on) #f))
(let ((a3-6 (lookup-text! *common-text* (game-text-id off) #f)))
(sv-320 sv-336 sv-352 sv-368 a3-6)
)
(set! sv-912 *temp-string*)
sv-912
)
(else
(set! sv-384 format)
(set! sv-400 (clear *temp-string*))
(set! sv-416 "~0L~S ~30L~S~1L")
(set! sv-432 (lookup-text! *common-text* (game-text-id on) #f))
(let ((a3-7 (lookup-text! *common-text* (game-text-id off) #f)))
(sv-384 sv-400 sv-416 sv-432 a3-7)
)
(set! sv-912 *temp-string*)
sv-912
)
)
((= v1-81 1)
(set! sv-512 (-> obj language-selection))
(set! sv-448 (-> (the-as (pointer uint64) (-> s3-0 s0-0 value-to-modify))))
(if (and (zero? (scf-get-territory))
(not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2)))
)
(set! sv-464 5)
(set! sv-464 6)
)
(if (-> obj language-transition)
(set! (-> obj language-x-offset)
(seekl (-> obj language-x-offset) 200 (the int (* 10.0 (-> *display* time-adjust-ratio))))
)
)
(when (>= (-> obj language-x-offset) 100)
(set! (-> obj language-selection) sv-448)
(set! sv-512 sv-448)
(set! (-> obj language-transition) #f)
(set! (-> obj language-x-offset) 0)
0
)
(((game-option-type language))
(set! sv-512 (the-as int (-> obj language-selection)))
(set! sv-448 (-> (the-as (pointer uint64) (-> s3-0 s0-0 value-to-modify))))
(if (and (zero? (scf-get-territory))
(not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2)))
)
(set! sv-464 5)
(set! sv-464 6)
)
(set! (-> sv-112 origin y) (the float (+ s2-1 3)))
(let ((a0-62 sv-112))
(set! (-> a0-62 color) (font-color lighter-lighter-blue))
(if (-> obj language-transition)
(set! (-> obj language-x-offset)
(seekl (-> obj language-x-offset) 200 (the int (* 10.0 (-> *display* time-adjust-ratio))))
)
)
(when (>= (-> obj language-x-offset) 100)
(set! (-> obj language-selection) (the-as language-enum sv-448))
(set! sv-512 (the-as int sv-448))
(set! (-> obj language-transition) #f)
(set! (-> obj language-x-offset) 0)
0
(set! sv-480 (mod (the-as int (+ sv-512 1)) sv-464))
(let ((a0-66 (mod (+ sv-464 -1 sv-512) sv-464))
(v1-153 (mod (the-as int (+ sv-512 2)) sv-464))
)
(set! sv-496 (mod (+ sv-464 -2 sv-512) sv-464))
(cond
((-> obj language-direction)
(let ((a2-22 (- 200 (+ (-> obj language-x-offset) 100))))
(print-language-name a0-66 sv-112 a2-22 #f)
)
(let ((a2-23 (+ (-> obj language-x-offset) 100)))
(cond
((< a2-23 150)
(let ((t9-27 print-language-name)
(a1-30 sv-112)
(a3-9 #t)
)
(t9-27 sv-480 a1-30 a2-23 a3-9)
)
)
(set! (-> sv-112 origin y) (the float (+ s2-1 3)))
(let ((a0-62 sv-112))
(set! (-> a0-62 color) (font-color lighter-lighter-blue))
)
0
(set! sv-480 (mod (+ sv-512 1) sv-464))
(let ((a0-66 (mod (+ sv-464 -1 sv-512) sv-464))
(v1-153 (mod (+ sv-512 2) sv-464))
)
(set! sv-496 (mod (+ sv-464 -2 sv-512) sv-464))
(cond
((-> obj language-direction)
(let ((a2-22 (- 200 (+ (-> obj language-x-offset) 100))))
(print-language-name a0-66 sv-112 a2-22 #f)
)
(let ((a2-23 (+ (-> obj language-x-offset) 100)))
(cond
((< a2-23 150)
(let ((t9-27 print-language-name)
(a1-30 sv-112)
(a3-9 #t)
)
(t9-27 sv-480 a1-30 a2-23 a3-9)
)
(else
(let ((a2-24 (- 200 (-> obj language-x-offset)))
(t9-28 print-language-name)
(a1-31 sv-112)
(a3-10 #f)
)
(t9-28 sv-496 a1-31 a2-24 a3-10)
)
)
(else
(let ((a2-24 (- 200 (-> obj language-x-offset)))
(t9-28 print-language-name)
(a1-31 sv-112)
(a3-10 #f)
)
(t9-28 sv-496 a1-31 a2-24 a3-10)
)
)
)
)
(else
(let ((a2-25 (+ (-> obj language-x-offset) 100)))
(cond
((< a2-25 150)
(print-language-name a0-66 sv-112 a2-25 #f)
)
(else
(let ((a2-26 (- 200 (-> obj language-x-offset))))
(print-language-name v1-153 sv-112 a2-26 #t)
)
)
(else
(let ((a2-25 (+ (-> obj language-x-offset) 100)))
(cond
((< a2-25 150)
(print-language-name a0-66 sv-112 a2-25 #f)
)
(else
(let ((a2-26 (- 200 (-> obj language-x-offset))))
(print-language-name v1-153 sv-112 a2-26 #t)
)
)
)
(let ((a2-27 (- 200 (+ (-> obj language-x-offset) 100))))
(print-language-name sv-480 sv-112 a2-27 #t)
)
)
(let ((a2-27 (- 200 (+ (-> obj language-x-offset) 100))))
(print-language-name sv-480 sv-112 a2-27 #t)
)
)
)
(when (not (-> obj language-transition))
(let ((a0-75 sv-112))
(set! (-> a0-75 color) (font-color yellow-green-2))
)
(when (not (-> obj language-transition))
(let ((a0-75 sv-112))
(set! (-> a0-75 color) (font-color yellow-green-2))
)
)
(let ((t9-32 print-language-name)
(a1-37 sv-112)
(a2-28 (-> obj language-x-offset))
(a3-14 (-> obj language-direction))
)
)
(let ((t9-32 print-language-name)
(a1-37 sv-112)
(a2-28 (-> obj language-x-offset))
(a3-14 (-> obj language-direction))
)
(t9-32 (the-as int sv-512) a1-37 a2-28 (the-as symbol a3-14))
)
(t9-32 sv-512 a1-37 a2-28 a3-14)
)
((= v1-81 3)
(set! sv-912 (lookup-text! *common-text* (game-text-id move-dpad) #f))
sv-912
)
((= v1-81 4)
(cond
((= (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) 'aspect4x3)
(set! sv-528 format)
(set! sv-544 (clear *temp-string*))
(set! sv-560 "~30L~S~0L ~S")
(set! sv-576 (lookup-text! *common-text* (game-text-id 4x3) #f))
(let ((a3-15 (lookup-text! *common-text* (game-text-id 16x9) #f)))
(sv-528 sv-544 sv-560 sv-576 a3-15)
)
(set! sv-912 *temp-string*)
sv-912
)
(((game-option-type center-screen))
(set! sv-912 (lookup-text! *common-text* (game-text-id move-dpad) #f))
sv-912
)
(((game-option-type aspect-ratio))
(cond
((= (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) 'aspect4x3)
(set! sv-528 format)
(set! sv-544 (clear *temp-string*))
(set! sv-560 "~30L~S~0L ~S")
(set! sv-576 (lookup-text! *common-text* (game-text-id 4x3) #f))
(let ((a3-15 (lookup-text! *common-text* (game-text-id 16x9) #f)))
(sv-528 sv-544 sv-560 sv-576 a3-15)
)
(else
(set! sv-592 format)
(set! sv-608 (clear *temp-string*))
(set! sv-624 "~0L~S ~30L~S~1L")
(set! sv-640 (lookup-text! *common-text* (game-text-id 4x3) #f))
(let ((a3-16 (lookup-text! *common-text* (game-text-id 16x9) #f)))
(sv-592 sv-608 sv-624 sv-640 a3-16)
)
(set! sv-912 *temp-string*)
sv-912
(set! sv-912 *temp-string*)
sv-912
)
(else
(set! sv-592 format)
(set! sv-608 (clear *temp-string*))
(set! sv-624 "~0L~S ~30L~S~1L")
(set! sv-640 (lookup-text! *common-text* (game-text-id 4x3) #f))
(let ((a3-16 (lookup-text! *common-text* (game-text-id 16x9) #f)))
(sv-592 sv-608 sv-624 sv-640 a3-16)
)
(set! sv-912 *temp-string*)
sv-912
)
)
((= v1-81 5)
(cond
((= (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) 'ntsc)
(set! sv-656 format)
(set! sv-672 (clear *temp-string*))
(set! sv-688 "~0L~S ~30L~S~1L")
(set! sv-704 (lookup-text! *common-text* (game-text-id 50hz) #f))
(let ((a3-17 (lookup-text! *common-text* (game-text-id 60hz) #f)))
(sv-656 sv-672 sv-688 sv-704 a3-17)
)
(set! sv-912 *temp-string*)
sv-912
)
(((game-option-type video-mode))
(cond
((= (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) 'ntsc)
(set! sv-656 format)
(set! sv-672 (clear *temp-string*))
(set! sv-688 "~0L~S ~30L~S~1L")
(set! sv-704 (lookup-text! *common-text* (game-text-id 50hz) #f))
(let ((a3-17 (lookup-text! *common-text* (game-text-id 60hz) #f)))
(sv-656 sv-672 sv-688 sv-704 a3-17)
)
(else
(set! sv-720 format)
(set! sv-736 (clear *temp-string*))
(set! sv-752 "~30L~S~0L ~S")
(set! sv-768 (lookup-text! *common-text* (game-text-id 50hz) #f))
(let ((a3-18 (lookup-text! *common-text* (game-text-id 60hz) #f)))
(sv-720 sv-736 sv-752 sv-768 a3-18)
)
(set! sv-912 *temp-string*)
sv-912
(set! sv-912 *temp-string*)
sv-912
)
(else
(set! sv-720 format)
(set! sv-736 (clear *temp-string*))
(set! sv-752 "~30L~S~0L ~S")
(set! sv-768 (lookup-text! *common-text* (game-text-id 50hz) #f))
(let ((a3-18 (lookup-text! *common-text* (game-text-id 60hz) #f)))
(sv-720 sv-736 sv-752 sv-768 a3-18)
)
(set! sv-912 *temp-string*)
sv-912
)
)
)
)
)
)
(else
(let ((v1-195 (-> s3-0 s0-0 option-type)))
(cond
((or (zero? v1-195) (= v1-195 3) (= v1-195 4) (= v1-195 5))
(set! sv-912 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f))
sv-912
)
((= v1-195 2)
(set! sv-784 format)
(set! sv-800 (clear *temp-string*))
(set! sv-816 "~S: ~S")
(set! sv-832 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f))
(let ((a3-19 (if (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify)))
(lookup-text! *common-text* (game-text-id on) #f)
(lookup-text! *common-text* (game-text-id off) #f)
)
)
)
(sv-784 sv-800 sv-816 sv-832 a3-19)
)
(set! sv-912 *temp-string*)
sv-912
)
((= v1-195 1)
(set! sv-848 format)
(set! sv-864 (clear *temp-string*))
(set! sv-880 "~S: ~S")
(set! sv-896 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f))
(let ((a3-20 (lookup-text!
*common-text*
(-> *language-name-remap* (-> (the-as (pointer uint64) (-> s3-0 s0-0 value-to-modify))))
#f
)
)
)
(sv-848 sv-864 sv-880 sv-896 a3-20)
)
(set! sv-912 *temp-string*)
sv-912
)
(case (-> s3-0 s0-0 option-type)
(((game-option-type slider)
(game-option-type center-screen)
(game-option-type aspect-ratio)
(game-option-type video-mode)
)
(set! sv-912 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f))
sv-912
)
(((game-option-type on-off))
(set! sv-784 format)
(set! sv-800 (clear *temp-string*))
(set! sv-816 "~S: ~S")
(set! sv-832 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f))
(let ((a3-19 (if (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify)))
(lookup-text! *common-text* (game-text-id on) #f)
(lookup-text! *common-text* (game-text-id off) #f)
)
)
)
(sv-784 sv-800 sv-816 sv-832 a3-19)
)
(set! sv-912 *temp-string*)
sv-912
)
(((game-option-type language))
(set! sv-848 format)
(set! sv-864 (clear *temp-string*))
(set! sv-880 "~S: ~S")
(set! sv-896 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f))
(let ((a3-20 (lookup-text!
*common-text*
(-> *language-name-remap* (-> (the-as (pointer uint64) (-> s3-0 s0-0 value-to-modify))))
#f
)
)
)
(sv-848 sv-864 sv-880 sv-896 a3-20)
)
(set! sv-912 *temp-string*)
sv-912
)
)
)
)