cleanup cheats menu + change game territory logic + some subtitles (#1733)

* use `game-text-id->string` function here

* small cleanup to pc progress code

* better way to handle "locked" texts

* this is better

* fix potential incompatibilities with merc & ocean renderers

* show cheat requirements in menu + change requirements

* increase size of money starburst

* split some more subtitles

* potentially fix a vsync bug?

* change territory encoding logic

* pass game territory to compiler

* ugh LOL
This commit is contained in:
ManDude
2022-08-06 16:57:19 +01:00
committed by GitHub
parent b3e77c673f
commit 26f19e8b14
21 changed files with 149 additions and 86 deletions
+2
View File
@@ -1528,6 +1528,8 @@
(cheat-invinc #x1095)
(cheat-tunes #x1096)
(cheat-sky #x1097)
(cheat-req-100-percent #x1098)
(cheat-req-beat-game #x1099)
(music-player #x10c0)
(scene-player #x10c1)
(play-credits #x10c2)
+24 -11
View File
@@ -5,12 +5,14 @@
#include <unordered_map>
#include "common/log/log.h"
#include "common/util/Assert.h"
#include "common/util/FileUtil.h"
#include <common/util/json_util.h>
#include <common/util/read_iso_file.h>
#include "common/util/json_util.h"
#include "common/util/read_iso_file.h"
#include <third-party/json.hpp>
#include "game/kernel/common/kboot.h"
#include "third-party/json.hpp"
#include "third-party/xxhash.hpp"
enum class ExtractorErrorCode {
@@ -34,12 +36,23 @@ enum GameIsoFlags { FLAG_JAK1_BLACK_LABEL = (1 << 0) };
static const std::unordered_map<std::string, GameIsoFlags> sGameIsoFlagNames = {
{"jak1-black-label", FLAG_JAK1_BLACK_LABEL}};
static const std::unordered_map<int, std::string> sGameIsoTerritoryMap = {
{GAME_TERRITORY_SCEA, "NTSC-U"},
{GAME_TERRITORY_SCEE, "PAL"},
{GAME_TERRITORY_SCEI, "NTSC-J"}};
std::string get_territory_name(int territory) {
ASSERT_MSG(sGameIsoTerritoryMap.count(territory),
fmt::format("territory {} not found in territory name map"));
return sGameIsoTerritoryMap.at(territory);
}
// used for - decompiler_out/<jak1> and iso_data/<jak1>
std::unordered_map<std::string, std::string> data_subfolders = {{"jak1", "jak1"}};
struct ISOMetadata {
std::string canonical_name;
std::string region;
int region; // territory code
int num_files;
xxh::hash64_t contents_hash;
std::string decomp_config;
@@ -80,7 +93,7 @@ std::optional<BuildInfo> get_buildinfo_from_path(fs::path iso_data_path) {
static const ISOMetadata jak1_ntsc_black_label_info = {
"Jak & Daxter™: The Precursor Legacy (Black Label)",
"NTSC-U",
GAME_TERRITORY_SCEA,
337,
11363853835861842434U,
"jak1_ntsc_black_label",
@@ -93,7 +106,7 @@ static const std::unordered_map<std::string, std::unordered_map<xxh::hash64_t, I
{{7280758013604870207U, jak1_ntsc_black_label_info},
{744661860962747854,
{"Jak & Daxter™: The Precursor Legacy",
"NTSC-U",
GAME_TERRITORY_SCEA,
338,
8538304367812415885U,
"jak1_jp",
@@ -102,7 +115,7 @@ static const std::unordered_map<std::string, std::unordered_map<xxh::hash64_t, I
{"SCES-50361",
{{12150718117852276522U,
{"Jak & Daxter™: The Precursor Legacy",
"PAL",
GAME_TERRITORY_SCEE,
338,
16850370297611763875U,
"jak1_pal",
@@ -111,7 +124,7 @@ static const std::unordered_map<std::string, std::unordered_map<xxh::hash64_t, I
{"SCPS-15021",
{{16909372048085114219U,
{"ジャックXダクスター  旧世界の遺産",
"NTSC-J",
GAME_TERRITORY_SCEI,
338,
1262350561338887717,
"jak1_jp",
@@ -140,13 +153,13 @@ ISOMetadata get_version_info_or_default(const fs::path& iso_data_path) {
const auto build_info = get_buildinfo_from_path(iso_data_path);
if (!build_info) {
lg::warn(
"unable locate buildinfo.json file in iso data path, defaulting to Jak 1 - NTSC "
"Black Label");
"unable locate buildinfo.json file in iso data path, defaulting to Jak 1 - NTSC-U Black "
"Label");
} else {
auto maybe_version_info = get_version_info_from_build_info(build_info.value());
if (!maybe_version_info) {
lg::warn(
"unable to determine game version from buildinfo.json file, defaulting to Jak 1 - NTSC "
"unable to determine game version from buildinfo.json file, defaulting to Jak 1 - NTSC-U "
"Black Label");
} else {
version_info = maybe_version_info.value();
+2 -1
View File
@@ -75,7 +75,7 @@ std::tuple<std::optional<ISOMetadata>, ExtractorErrorCode> validate(
// Print out some information
lg::info("Detected Game Metadata:");
lg::info("\tDetected - {}", version_info.canonical_name);
lg::info("\tRegion - {}", version_info.region);
lg::info("\tRegion - {}", get_territory_name(version_info.region));
lg::info("\tSerial - {}", dbEntry->first);
lg::info("\tUses Decompiler Config - {}", version_info.decomp_config);
@@ -204,6 +204,7 @@ ExtractorErrorCode compile(const fs::path& iso_data_path, const std::string& dat
if (version_info.game_name == "jak1") {
compiler.make_system().set_constant("*jak1-full-game*", !(flags & FLAG_JAK1_BLACK_LABEL));
compiler.make_system().set_constant("*jak1-territory*", version_info.region);
}
auto project_path = file_util::get_jak_project_dir() / "goal_src" / data_subfolder / "game.gp";
+19 -8
View File
@@ -1107,12 +1107,21 @@
)
("sksp0064" :hint #x245 (0 "DAXTER" "WATCH YOUR BACK! YOU REMEMBER WHAT HAPPENED THE LAST TIME WE WERE HERE."))
("sksp0067" :hint #x249 (0 "DAXTER" "DON'T FALL INTO THE MIST BELOW US! 'CAUSE I DON'T THINK WE'LL MAKE IT BACK."))
("sksp0059" :hint #x26e (0 "DAXTER" "THIS PLACE GIVES ME THE WILLIES! LET'S KEEP YOU OUT OF THE OOZE, OKAY?"))
("sksp0067" :hint #x249
(0 "DAXTER" "DON'T FALL INTO THE MIST BELOW US!")
(125 "DAXTER" "'CAUSE I DON'T THINK WE'LL MAKE IT BACK.")
)
("sksp0059" :hint #x26e
(0 "DAXTER" "THIS PLACE GIVES ME THE WILLIES!")
(110)
(125 "DAXTER" "LET'S KEEP YOU OUT OF THE OOZE, OKAY?")
)
("sksp0060" :hint #x26f
(0 "DAXTER" "(WHIMPERS) THIS PLACE GIVES ME THE CREEPS! AND TRUST ME, IT'S A WHOLE NEW EXPERIENCE")
(337 "DAXTER" "WHEN YOU'RE COVERED IN FUZZ!")
(0 "DAXTER" "(WHIMPERS) THIS PLACE GIVES ME THE CREEPS!")
(170 "DAXTER" "AND TRUST ME, IT'S A WHOLE NEW EXPERIENCE")
(335 "DAXTER" "WHEN YOU'RE COVERED IN FUZZ!")
)
("sksp0056" :hint #x27b (0 "DAXTER" "HEY! I SEE THE SCULPTOR'S MUSE!"))
@@ -1126,12 +1135,14 @@
("sagevb02" :hint #x28a
(6 "SAGE" "I HAVE TO ADMIT, I'M IMPRESSED. YOU TWO DIDN'T SCREW UP!")
(385)
(400 "SAGE" "NOW THAT THE LURKERS CAN'T OPEN THAT SILO, THEY CAN'T FLOOD THE WORLD WITH DARK ECO")
(390)
(410 "SAGE" "NOW THAT THE LURKERS CAN'T OPEN THAT SILO")
(555 "SAGE" "THEY CAN'T FLOOD THE WORLD WITH DARK ECO")
(710 "SAGE" "AND CAUSE UNTOLD DESTRUCTION.")
(863)
(880 "SAGE" "WIPE THAT RIDICULOUS GRIN OFF YOUR FACE, DAXTER! THE TWO OF YOU HAVE PLENTY TO DO.")
(1191 "SAGE" "GET ON WITH IT!")
(880 "SAGE" "WIPE THAT RIDICULOUS GRIN OFF YOUR FACE, DAXTER!")
(1065 "SAGE" "THE TWO OF YOU HAVE PLENTY TO DO.")
(1188 "SAGE" "GET ON WITH IT!")
)
("asstvb03" :hint #x28b
+4
View File
@@ -200,6 +200,10 @@
"ALL MUSIC TRACKS")
(#x1097 "REAL TIME OF DAY"
"REAL TIME OF DAY")
(#x1098 "REACH 100% COMPLETION"
"REACH 100% COMPLETION")
(#x1099 "BEAT THE GAME"
"BEAT THE GAME")
(#x10c0 "MUSIC PLAYER"
"MUSIC PLAYER")
+4 -1
View File
@@ -15,7 +15,7 @@
// a GfxDisplay class is equivalent to a window that displays stuff. This holds an actual internal
// window pointer used by whichever renderer. It also contains functions for setting and
// retrieving certain window parameters.
// Maybe this is better implemented as an abstract class and renderers would have overrides?
// specific renderers should override this class, the methods are abstract.
class GfxDisplay {
const char* m_title;
@@ -62,6 +62,9 @@ class GfxDisplay {
m_fullscreen_mode = m_fullscreen_target_mode;
m_fullscreen_screen = m_fullscreen_target_screen;
// hack, force a vsync update.
Gfx::g_global_settings.old_vsync = !Gfx::g_global_settings.vsync;
}
bool is_active() const { return get_window() != nullptr; }
@@ -575,7 +575,7 @@ void Merc2::flush_draw_buckets(SharedRenderState* /*render_state*/, ScopedProfil
);
glVertexAttribIPointer(5, // location 0 in the
3, // 3 floats per vert
4, // 3 floats per vert
GL_UNSIGNED_BYTE, // u8's
sizeof(tfrag3::MercVertex), //
(void*)offsetof(tfrag3::MercVertex, mats[0]) // offset in array
@@ -54,7 +54,7 @@ CommonOceanRenderer::CommonOceanRenderer() {
// byte data
glEnableVertexAttribArray(3);
glVertexAttribIPointer(3, // location 3 in the shader
1, //
4, //
GL_UNSIGNED_BYTE, // u8's
sizeof(Vertex), //
(void*)offsetof(Vertex, fog) // offset in array
+6 -1
View File
@@ -456,5 +456,10 @@
;; build system ;;
;;;;;;;;;;;;;;;;;;;;;;;;
(define *jak1-full-game* (if (user? dass) #t #f))
(define GAME_TERRITORY_SCEA 0)
(define GAME_TERRITORY_SCEE 1)
(define GAME_TERRITORY_SCEI 2)
(define *jak1-full-game* (if (user? dass) #t #f))
(define *jak1-territory* GAME_TERRITORY_SCEA)
+2
View File
@@ -13,6 +13,8 @@
(defmacro __get_jak1_full_game () *jak1-full-game*)
(defconstant *jak1-full-game* (__get_jak1_full_game))
(defmacro __get_jak1_territory () *jak1-territory*)
(defconstant *jak1-territory* (__get_jak1_territory))
(defmacro load-art-import (name)
`(asm-file ,(string-append "goal_src/jak1/import/" (symbol->string name) "-ag.gc") :no-code :no-throw))
@@ -2067,7 +2067,7 @@
:init-specs
((sp-tex spt-texture (new 'static 'texture-id :index #x2c :page #x2))
(sp-flt spt-num 1.0)
(sp-flt spt-scale-x (meters 1.22))
(sp-flt spt-scale-x (meters 1.28))
(sp-copy-from-other spt-scale-y -4)
(sp-flt spt-r 128.0)
(sp-flt spt-g 128.0)
+1 -1
View File
@@ -1964,7 +1964,7 @@
)
;; text id (can be hint ambient)
((and (= (-> e tag i name) 'text-id) (= (-> e tag i elt-count) 1) (= (-> e tag i elt-type) int32))
(format *debug-temp-string* " (game-text-id ~S)" (enum->string game-text-id (-> (the (pointer int32) data) 0)))
(format *debug-temp-string* " (game-text-id ~S)" (game-text-id->string (-> (the (pointer game-text-id) data) 0)))
)
;; eco-info, like in vents, crates, or collectables in general
((and (= (-> e tag i name) 'eco-info) (= (-> e tag i elt-count) 2) (= (-> e tag i elt-type) int32))
+11 -3
View File
@@ -345,10 +345,18 @@
;;;;;;;;;;;;;;;;;;;;;;
(defun scf-get-territory ()
"this overrides the kernel version."
(if (and *jak1-full-game* (= (language-enum japanese) (-> *setting-control* default language)))
GAME_TERRITORY_SCEI
"this overrides the kernel version which usually has a hardcoded value."
(if (not *debug-segment*)
(return *jak1-territory*))
(case (-> *setting-control* default language)
(((language-enum japanese))
GAME_TERRITORY_SCEI)
(((language-enum english))
GAME_TERRITORY_SCEA)
(else
GAME_TERRITORY_SCEE)
)
)
;;;;;;;;;;;;;;;;;;;;;;
+1 -1
View File
@@ -151,7 +151,7 @@
)
(case (scf-get-territory)
((2)
((GAME_TERRITORY_SCEI)
(sound-bank-load (static-sound-name "commonj"))
)
(else
+2 -2
View File
@@ -82,10 +82,10 @@
)
(when (= s2-0 3841)
(case (scf-get-territory)
((1)
((GAME_TERRITORY_SCEE)
(set! s3-0 (lookup-text! *common-text* (game-text-id europe) #t))
)
((2)
((GAME_TERRITORY_SCEI)
(set! s3-0 (lookup-text! *common-text* (game-text-id inc) #t))
)
)
@@ -857,7 +857,7 @@
(set! (-> v1-133 width) (the float 350))
)
(cond
((= (scf-get-territory) 1)
((= (scf-get-territory) GAME_TERRITORY_SCEE)
(let ((s0-10 print-game-text))
(set! sv-128 format)
(let ((a0-69 (clear *temp-string*))
+2 -2
View File
@@ -1303,7 +1303,7 @@
(if (> (the-as int (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify)))) 0)
(+! (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify))) -1)
(set! (-> (the-as (pointer int64) (-> s5-0 (-> obj option-index) value-to-modify)))
(if (and (zero? (scf-get-territory))
(if (and (= (scf-get-territory) GAME_TERRITORY_SCEA)
(not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2)))
)
4
@@ -1390,7 +1390,7 @@
(set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'ntsc)
)
(((game-option-type language))
(let ((v1-243 (if (and (zero? (scf-get-territory))
(let ((v1-243 (if (and (= (scf-get-territory) GAME_TERRITORY_SCEA)
(not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2)))
)
4
+2
View File
@@ -678,6 +678,8 @@
(cheat-invinc #x1095)
(cheat-tunes #x1096)
(cheat-sky #x1097)
(cheat-req-100-percent #x1098)
(cheat-req-beat-game #x1099)
(music-player #x10c0)
(scene-player #x10c1)
(play-credits #x10c2)
+2 -2
View File
@@ -23,7 +23,7 @@
(load-state-want-levels 'demo 'village1)
(load-state-want-vis 'vi1)
(case (scf-get-territory)
((2)
((GAME_TERRITORY_SCEI)
(let ((gp-0 (ppointer->handle (static-screen-spawn
6
(new 'static 'texture-id :page #x27c)
@@ -73,7 +73,7 @@
)
)
)
((1)
((GAME_TERRITORY_SCEE)
(case (-> *setting-control* current language)
(((language-enum french))
(let ((gp-3 (ppointer->handle (static-screen-spawn
+3 -3
View File
@@ -242,7 +242,7 @@
)
(send-event (handle->process (-> self camera)) 'mask 0)
(case (scf-get-territory)
((2)
((GAME_TERRITORY_SCEI)
(set! (-> self volumes)
(ppointer->handle (process-spawn logo-slave (-> self entity) *logo-volumes-japan-sg* :to self))
)
@@ -577,7 +577,7 @@
(set! (-> *time-of-day-context* title-light-group dir1 levels x) 0.0)
(set! (-> *time-of-day-context* title-light-group ambi levels x) 0.444)
(case (scf-get-territory)
((2)
((GAME_TERRITORY_SCEI)
(initialize-skeleton self *logo-japan-sg* '())
)
(else
@@ -687,7 +687,7 @@
(let ((gp-0 (the-as handle #f)))
;; PAL patch here
(cond
((and (= (scf-get-territory) 2) *first-boot*)
((and (= (scf-get-territory) GAME_TERRITORY_SCEI) *first-boot*)
(set! *first-boot* #f)
(set! gp-0 (ppointer->handle (static-screen-spawn
5
+58 -46
View File
@@ -326,16 +326,16 @@
(defmacro def-language-remap-info (langs)
`(quote ,(apply (lambda (x) `((the binteger (game-text-id ,x)) (the binteger (pc-subtitle-lang ,x)))) langs))
(defmacro def-language-remap-info (name langs)
`(define ,name (quote ,(apply (lambda (x) `((the binteger (game-text-id ,x)) (the binteger (pc-subtitle-lang ,x)))) langs)))
)
(define *language-remap-info-pc* (def-language-remap-info
(english uk-english french german spanish italian japanese portuguese br-portuguese swedish finnish danish norwegian)))
(def-language-remap-info *language-remap-info-pc*
(english uk-english french german spanish italian japanese portuguese br-portuguese swedish finnish danish norwegian))
(define *text-languages* (static-text-list-array
english uk-english french german spanish italian japanese))
english uk-english french german spanish italian japanese))
(define *subtitle-languages* (static-text-list-array
english german spanish))
english german spanish))
@@ -403,7 +403,7 @@
)
(defmacro add-flava-player-option (text-id flava)
"add a resolution button to *temp-options* with specified size"
"add a music player w/ flava button to *temp-options* with specified size"
`(let ((option (-> *temp-options* (length *temp-options*))))
(set! (-> option option-type) (game-option-type button-flava))
(set! (-> option name) ,text-id)
@@ -414,6 +414,18 @@
)
)
(defmacro add-monitor-option (text-id monitor)
"add a display button to *temp-options* with specified size"
`(let ((option (-> *temp-options* (length *temp-options*))))
(set! (-> option option-type) (game-option-type monitor))
(set! (-> option name) ,text-id)
(set! (-> option param1) (the float ,monitor))
(set! (-> option scale) #t)
(1+! (-> *temp-options* length))
)
)
(defmacro add-back-option ()
"add *back-button* to *temp-options*"
`(let ((option (-> *temp-options* (length *temp-options*))))
@@ -434,7 +446,8 @@
;; hack - do not use screen resolution in windowed mode, taskbar etc. messes it up and makes it useless!
(skip? (= 'windowed display-mode))
;; shortcut
(max-options (1- (-> *temp-options* allocated-length))))
;; we reserve 3 options.
(max-options (+ -3 (-> *temp-options* allocated-length))))
;; get screen size (for capping)
(pc-get-screen-size -1 (the (pointer int32) (& sx)) (the (pointer int32) (& sy)))
@@ -476,16 +489,13 @@
(true! done?))
))
;; extra funny options
(when (and (!= display-mode 'windowed)
(< (length *temp-options*) (- (-> *temp-options* allocated-length) 3)))
(when (!= display-mode 'windowed)
(add-resolution-option 512 224)
(add-resolution-option 512 448)
)
(add-resolution-option 512 448))
(add-back-option)
)
*temp-options*
)
@@ -507,18 +517,11 @@
(set! (-> *temp-options* length) 0)
(dotimes (i (pc-get-monitor-count))
(let ((option (-> *temp-options* (length *temp-options*))))
(set! (-> option option-type) (game-option-type monitor))
(set! (-> option name) (game-text-id display-fmt))
(set! (-> option param1) (the float i))
(set! (-> option scale) #t)
(1+! (-> *temp-options* length))
)
(add-monitor-option (game-text-id display-fmt) i)
)
(add-back-option)
)
*temp-options*)
@@ -635,10 +638,13 @@
(set! (-> *options-remap* i) #f)
)
;; give cheats
(when (task-closed? (game-task finalboss-movies) (task-status need-reminder))
(logior! (-> *pc-settings* cheats-known) (pc-cheats sidekick-blue invinc tunes sky))
(when (>= (calculate-completion (the progress #f)) 100.0)
(logior! (-> *pc-settings* cheats-known) (pc-cheats eco-blue eco-red eco-green eco-yellow))))
;; set up options for each screen
(when (>= (calculate-completion (the progress #f)) 100.0)
(logior! (-> *pc-settings* cheats-known) (pc-cheats eco-blue eco-red eco-green eco-yellow sidekick-blue invinc tunes sky))
)
(set! (-> *options-remap* (progress-screen settings)) (if (or *cheat-mode* (nonzero? (-> *pc-settings* cheats-known)))
*main-options-secrets*
*main-options-pc*))
@@ -1671,6 +1677,7 @@
(unkx 27)
(unk2 0)
(font (new 'stack 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning)))
(locked-str (lookup-text! *common-text* (game-text-id locked) #f))
)
;; set the common params for the text drawing
(set-width! font 370)
@@ -1717,6 +1724,7 @@
(let ((option-str (the string #f)) ;; the option text
(option-x 17)
(option-y y-off)
(locked? #f)
)
(case (-> options index option-type)
(((game-option-type yes-no))
@@ -1730,24 +1738,25 @@
;; menu option or simple button. just draw its text!
(if (nonzero? (-> options index name))
(set! option-str (lookup-text! *common-text* (-> options index name) #f))
(set! option-str (the-as string #f))
(set! option-str #f)
)
(if (and (not (-> *setting-control* default auto-save))
(when (and (not (-> *setting-control* default auto-save))
(= (game-text-id disable-auto-save) (-> options index name)))
(set! option-str (lookup-text! *common-text* (game-text-id auto-save-disabled) #f)))
(set! option-str (lookup-text! *common-text* (game-text-id auto-save-disabled) #f))
(true! locked?))
)
(((game-option-type button-music))
;; a button for the music player. has the text "locked" sometimes!
(if (and (nonzero? (-> options index name)) (find-music-log (progress-get-music-by-index index)))
(set! option-str (lookup-text! *common-text* (-> options index name) #f))
(set! option-str (lookup-text! *common-text* (game-text-id locked) #f))
(set! option-str locked-str)
)
)
(((game-option-type button-flava))
;; a button for the flava player. has the text "locked" sometimes!
(if (and (nonzero? (-> options index name)) (find-flava-log (progress-get-music-by-index *progress-music*) (the int (-> options index param1))))
(set! option-str (lookup-text! *common-text* (-> options index name) #f))
(set! option-str (lookup-text! *common-text* (game-text-id locked) #f))
(set! option-str locked-str)
)
)
(((game-option-type resolution) (game-option-type aspect-new))
@@ -1812,17 +1821,10 @@
)
)
(((game-option-type cheat-toggle))
(cond
((not (logtest? (-> *pc-settings* cheats-known) (ash 1 (the int (-> options index param1)))))
(set! option-str (lookup-text! *common-text* (game-text-id locked) #f))
(if (-> (the-as (pointer symbol) (-> options index value-to-modify)))
(set! option-str (string-format "~30L~S~0L ~S" (lookup-text! *common-text* (game-text-id on) #f) (lookup-text! *common-text* (game-text-id off) #f)))
(set! option-str (string-format "~0L~S ~30L~S" (lookup-text! *common-text* (game-text-id on) #f) (lookup-text! *common-text* (game-text-id off) #f)))
)
(else
(if (-> (the-as (pointer symbol) (-> options index value-to-modify)))
(set! option-str (string-format "~30L~S~0L ~S" (lookup-text! *common-text* (game-text-id on) #f) (lookup-text! *common-text* (game-text-id off) #f)))
(set! option-str (string-format "~0L~S ~30L~S" (lookup-text! *common-text* (game-text-id on) #f) (lookup-text! *common-text* (game-text-id off) #f)))
)
)
)
)
(((game-option-type display-mode)
(game-option-type msaa)
@@ -1938,7 +1940,21 @@
(((game-option-type cheat-toggle))
(cond
((not (logtest? (-> *pc-settings* cheats-known) (ash 1 (the int (-> options index param1)))))
(set! option-str (lookup-text! *common-text* (game-text-id locked) #f))
(true! locked?)
(case (ash 1 (the int (-> options index param1)))
(((pc-cheats eco-blue)
(pc-cheats eco-green)
(pc-cheats eco-red)
(pc-cheats eco-yellow))
(set! option-str (lookup-text! *common-text* (game-text-id cheat-req-100-percent) #f)))
(((pc-cheats sky)
(pc-cheats sidekick-blue)
(pc-cheats tunes)
(pc-cheats invinc))
(set! option-str (lookup-text! *common-text* (game-text-id cheat-req-beat-game) #f)))
(else
(set! option-str locked-str))
)
)
(else
(set! option-str (string-format "~S: ~S" (lookup-text! *common-text* (-> options index name) #f)
@@ -1995,13 +2011,9 @@
)
(set-color! font (cond
((and (!= index (-> obj option-index))
(string= (lookup-text! *common-text* (game-text-id locked) #f) option-str)) ;; hacky..
(or locked? (= locked-str option-str)))
;; for "locked" options!
(font-color flat-dark-purple))
((and (!= index (-> obj option-index))
(not (-> *setting-control* default auto-save))
(= (game-text-id disable-auto-save) (-> options index name)))
(font-color flat-dark-purple))
((and (= index (-> obj option-index))
(not (or (progress-scrolling?) (-> obj in-transition))))
(font-color yellow-green-2))