Skip to content

Commit

Permalink
Fixed elevator scans font size for JP version
Browse files Browse the repository at this point in the history
  • Loading branch information
UltiNaruto committed Dec 18, 2023
1 parent bf5daeb commit 3461fc3
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/patches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4814,6 +4814,7 @@ fn make_elevators_patch<'a>(
auto_enabled_elevators: bool,
player_size: f32,
force_vanilla_layout: bool,
version: Version,
)
-> (bool, bool)
{
Expand Down Expand Up @@ -4960,25 +4961,34 @@ fn make_elevators_patch<'a>(
let control_name = hologram_name.clone();

patcher.add_resource_patch((&[elv.pak_name.as_bytes()], elv.room_strg, b"STRG".into()), move |res| {
let string = format!("Transport to {}\u{0}", room_dest_name);
let mut string = format!("Transport to {}\u{0}", room_dest_name);
if version == Version::NtscJ {
string = format!("&line-extra-space=4;&font=C29C51F1;{}", string);
}
let strg = structs::Strg::from_strings(vec![string]);
res.kind = structs::ResourceKind::Strg(strg);
Ok(())
});
patcher.add_resource_patch((&[elv.pak_name.as_bytes()], elv.hologram_strg, b"STRG".into()), move |res| {
let string = format!(
let mut string = format!(
"Access to &main-color=#FF3333;{} &main-color=#89D6FF;granted. Please step into the hologram.\u{0}",
hologram_name,
);
if version == Version::NtscJ {
string = format!("&line-extra-space=4;&font=C29C51F1;{}", string);
}
let strg = structs::Strg::from_strings(vec![string]);
res.kind = structs::ResourceKind::Strg(strg);
Ok(())
});
patcher.add_resource_patch((&[elv.pak_name.as_bytes()], elv.control_strg, b"STRG".into()), move |res| {
let string = format!(
let mut string = format!(
"Transport to &main-color=#FF3333;{}&main-color=#89D6FF; active.\u{0}",
control_name,
);
if version == Version::NtscJ {
string = format!("&line-extra-space=4;&font=C29C51F1;{}", string);
}
let strg = structs::Strg::from_strings(vec![string]);
res.kind = structs::ResourceKind::Strg(strg);
Ok(())
Expand Down Expand Up @@ -16267,6 +16277,7 @@ fn build_and_run_patches<'r>(gc_disc: &mut structs::GcDisc<'r>, config: &PatchCo
config.auto_enabled_elevators,
player_size,
config.force_vanilla_layout,
config.version,
);
let skip_frigate = skip_frigate && starting_room.mlvl != World::FrigateOrpheon.mlvl();

Expand Down

0 comments on commit 3461fc3

Please sign in to comment.