diff --git a/src/blueprints/angel_hook.uasset b/src/blueprints/angel_hook.uasset index 5c5d8e5..b87ba44 100644 Binary files a/src/blueprints/angel_hook.uasset and b/src/blueprints/angel_hook.uasset differ diff --git a/src/blueprints/bremur_hook.uasset b/src/blueprints/bremur_hook.uasset index 69821b9..8ac5b51 100644 Binary files a/src/blueprints/bremur_hook.uasset and b/src/blueprints/bremur_hook.uasset differ diff --git a/src/blueprints/hook.uasset b/src/blueprints/hook.uasset index 1558cf0..2a2ca45 100644 Binary files a/src/blueprints/hook.uasset and b/src/blueprints/hook.uasset differ diff --git a/src/blueprints/hook.uexp b/src/blueprints/hook.uexp index 56436a9..6c96238 100644 Binary files a/src/blueprints/hook.uexp and b/src/blueprints/hook.uexp differ diff --git a/src/blueprints/paulale_hook.uasset b/src/blueprints/paulale_hook.uasset index 466195a..2cd1f88 100644 Binary files a/src/blueprints/paulale_hook.uasset and b/src/blueprints/paulale_hook.uasset differ diff --git a/src/blueprints/player_hook.uasset b/src/blueprints/player_hook.uasset index 4f1bff7..65439a5 100644 Binary files a/src/blueprints/player_hook.uasset and b/src/blueprints/player_hook.uasset differ diff --git a/src/io.rs b/src/io.rs index 40c9d52..a3665bd 100644 --- a/src/io.rs +++ b/src/io.rs @@ -20,7 +20,6 @@ pub fn save( asset: &mut Asset, path: impl AsRef, ) -> Result<(), Error> { - asset.rebuild_name_map()?; asset.write_data( &mut File::create(&path)?, Some(&mut File::create(path.as_ref().with_extension("uexp"))?), diff --git a/src/lib.rs b/src/lib.rs index 70459fd..37af5cb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,9 +1,12 @@ +use eframe::egui; + mod io; mod logic; mod map; mod writing; pub struct Rando { + font: egui::FontDefinitions, notifs: egui_modal::Modal, pak: std::path::PathBuf, pak_str: String, @@ -39,6 +42,16 @@ impl Rando { .unwrap_or_default() }; + let mut font = egui::FontDefinitions::default(); + font.font_data.insert( + "cinzel".to_string(), + egui::FontData::from_static(include_bytes!("Cinzel-Regular.ttf")), + ); + font.families + .get_mut(&egui::FontFamily::Proportional) + .unwrap() + .insert(0, "cinzel".to_string()); + let notifs = egui_modal::Modal::new(&ctx.egui_ctx, "dialog"); let autoupdate = get_bool("autoupdate"); @@ -69,6 +82,7 @@ impl Rando { let pak_str = get_pak_str(&pak); Self { + font, notifs, pak, pak_str, @@ -146,20 +160,7 @@ macro_rules! notify { impl eframe::App for Rando { fn update(&mut self, ctx: &eframe::egui::Context, _: &mut eframe::Frame) { - use eframe::egui; - - let mut fonts = egui::FontDefinitions::default(); - fonts.font_data.insert( - "cinzel".to_string(), - egui::FontData::from_static(include_bytes!("Cinzel-Regular.ttf")), - ); - fonts - .families - .get_mut(&egui::FontFamily::Proportional) - .unwrap() - .insert(0, "cinzel".to_string()); - ctx.set_fonts(fonts); - + ctx.set_fonts(self.font.clone()); egui::CentralPanel::default().show(ctx, |ui| { ui.horizontal(|ui| { ui.heading( diff --git a/src/logic/checks.rs b/src/logic/checks.rs index 79b27ce..93743b2 100644 --- a/src/logic/checks.rs +++ b/src/logic/checks.rs @@ -1,7 +1,7 @@ use super::*; use crate::{no_walljump, walljump}; -pub const CHECKS: [Check; 252] = [ +pub const CHECKS: [Check; 254] = [ // Fire Keep Check { location: Locations::Lab, @@ -1340,7 +1340,13 @@ pub const CHECKS: [Check; 252] = [ drop: Drop::Ore(200), locks: &[Lock::Movement(&[no_walljump!(0, 3)])], }, - // i can't find pickups 11, 12 and 6 + // i can't find pickup 6 + Check { + location: Locations::Bunny, + context: Context::Overworld("Pickup11"), + drop: Drop::Ore(100), + locks: &[], + }, Check { location: Locations::Bunny, context: Context::Cutscene("NPC/Onops/Onop_Speedo/NPC_Onop_Speedo"), @@ -1353,6 +1359,12 @@ pub const CHECKS: [Check; 252] = [ drop: Drop::Ore(150), locks: &[Lock::Movement(&[no_walljump!(0, 1)])], }, + Check { + location: Locations::Bunny, + context: Context::Overworld("Pickup12"), + drop: Drop::Ore(150), + locks: &[Lock::Movement(&[no_walljump!(0, 1)])], + }, Check { location: Locations::Bunny, context: Context::Overworld("Dance_Platform_Windmill_Chest"), diff --git a/src/logic/locations.rs b/src/logic/locations.rs index d4818ed..2ee5309 100644 --- a/src/logic/locations.rs +++ b/src/logic/locations.rs @@ -154,7 +154,9 @@ impl Locations { Lock::Item(Items::KeyHolyMaster), ]], Locations::TempleGardens => &[&[ - Lock::Location(Locations::Stoneheart), + Lock::Item(Items::OldKey), + Lock::Item(Items::KeyHolyMaster), + Lock::Location(Locations::UthasEnd), Lock::Movement(&[no_walljump!(1, 0)]), ]], Locations::AbandonedPath => &[&[ diff --git a/src/writing.rs b/src/writing.rs index b24b151..180b8db 100644 --- a/src/writing.rs +++ b/src/writing.rs @@ -98,10 +98,8 @@ pub fn write(data: Data, app: &crate::Rando) -> Result<(), Error> { loc.with_extension("uexp"), )?; let mut spirit_hunter = open(&loc)?; - spirit_hunter.exports[440] - .get_base_export_mut() - .object_name - .content = "Pickup_A02_SRF2".to_string(); + spirit_hunter.exports[440].get_base_export_mut().object_name = + spirit_hunter.add_fname("Pickup_A02_SRF2"); save(&mut spirit_hunter, &loc)?; std::thread::scope(|thread| -> Result<(), Error> { for thread in [ @@ -149,8 +147,8 @@ fn create_hook( let mut hook = get_hook(&loc)?; // edit the item given by the kismet bytecode in the hook let exports::Export::FunctionExport( - exports::function_export::FunctionExport{ - struct_export: struct_export::StructExport{ + exports::function_export::FunctionExport { + struct_export: struct_export::StructExport { script_bytecode:Some(bytecode), .. }, diff --git a/src/writing/overworld.rs b/src/writing/overworld.rs index abb91bc..8b1673a 100644 --- a/src/writing/overworld.rs +++ b/src/writing/overworld.rs @@ -273,6 +273,7 @@ pub fn write( _ => (), } } + map.rebuild_name_map()?; save(&mut map, &loc)?; Ok(()) })); diff --git a/src/writing/savegames.rs b/src/writing/savegames.rs index 6d389f0..71a7458 100644 --- a/src/writing/savegames.rs +++ b/src/writing/savegames.rs @@ -142,6 +142,7 @@ pub fn write( .value .remove(i); } + savegame.rebuild_name_map()?; save(&mut savegame, savegame_loc)?; Ok(()) } diff --git a/src/writing/specific.rs b/src/writing/specific.rs index 5109a7d..71acef7 100644 --- a/src/writing/specific.rs +++ b/src/writing/specific.rs @@ -2,7 +2,7 @@ use super::*; pub fn write(cases: Vec, app: &crate::Rando, pak: &unpak::Pak) -> Result<(), Error> { for Check { context, drop, .. } in cases { - let Context::Specific(case,index) = context else{ + let Context::Specific(case, index) = context else { return Err(Error::Assumption)? }; create_hook(