teleporter
This commit is contained in:
@@ -119,7 +119,7 @@ fn parse_bounds_args() -> Option<Bounds> {
|
|||||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
let logger = DedupLogger::new();
|
let logger = DedupLogger::new();
|
||||||
log::set_boxed_logger(Box::new(logger))
|
log::set_boxed_logger(Box::new(logger))
|
||||||
.map(|()| log::set_max_level(LevelFilter::Trace))
|
.map(|()| log::set_max_level(LevelFilter::Warn))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
info!("🎮 Cursebreaker - Scene Parser");
|
info!("🎮 Cursebreaker - Scene Parser");
|
||||||
@@ -197,8 +197,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
.map(|p| p.to_string_lossy().to_string())
|
.map(|p| p.to_string_lossy().to_string())
|
||||||
.unwrap_or_else(|_| scene_path.to_string_lossy().to_string());
|
.unwrap_or_else(|_| scene_path.to_string_lossy().to_string());
|
||||||
|
|
||||||
info!("\n📁 [{}/{}] Parsing scene: {}", idx + 1, scene_files.len(), relative_path);
|
print!("\n📁 [{}/{}] Parsing scene: {}", idx + 1, scene_files.len(), relative_path);
|
||||||
log::logger().flush();
|
|
||||||
|
|
||||||
match project.parse_scene_filtered(&relative_path, Some(&type_filter)) {
|
match project.parse_scene_filtered(&relative_path, Some(&type_filter)) {
|
||||||
Ok(mut scene) => {
|
Ok(mut scene) => {
|
||||||
@@ -242,17 +241,17 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
process_item_icons_from_map(&cb_assets_path, &mut conn, &all_unique_harvestables)?;
|
process_item_icons_from_map(&cb_assets_path, &mut conn, &all_unique_harvestables)?;
|
||||||
|
|
||||||
// Print summary
|
// Print summary
|
||||||
info!("\n==================================================");
|
println!("\n==================================================");
|
||||||
info!("📊 SUMMARY");
|
println!("📊 SUMMARY");
|
||||||
info!("==================================================");
|
println!("==================================================");
|
||||||
info!(" Scenes processed: {} ({} failed)", scenes_processed, scenes_failed);
|
println!(" Scenes processed: {} ({} failed)", scenes_processed, scenes_failed);
|
||||||
info!(" Resources: {}", total_resources);
|
println!(" Resources: {}", total_resources);
|
||||||
info!(" Teleporters: {}", total_teleporters);
|
println!(" Teleporters: {}", total_teleporters);
|
||||||
info!(" Workbenches: {}", total_workbenches);
|
println!(" Workbenches: {}", total_workbenches);
|
||||||
info!(" Loot spawners: {}", total_loot);
|
println!(" Loot spawners: {}", total_loot);
|
||||||
info!(" Map icons: {}", total_map_icons);
|
println!(" Map icons: {}", total_map_icons);
|
||||||
info!(" Map name changers:{}", total_map_name_changers);
|
println!(" Map name changers:{}", total_map_name_changers);
|
||||||
info!("==================================================");
|
println!("==================================================");
|
||||||
|
|
||||||
log::logger().flush();
|
log::logger().flush();
|
||||||
|
|
||||||
|
|||||||
@@ -288,6 +288,7 @@ impl IconDatabase {
|
|||||||
("Inventory/Banknote.png", "Inventory_Banknote"),
|
("Inventory/Banknote.png", "Inventory_Banknote"),
|
||||||
("Minimap/ShowCoordinates.png", "Minimap_ShowCoordinates"),
|
("Minimap/ShowCoordinates.png", "Minimap_ShowCoordinates"),
|
||||||
("SplashScreens/Olipa.png", "SplashScreens_Olipa"),
|
("SplashScreens/Olipa.png", "SplashScreens_Olipa"),
|
||||||
|
("ItemIcons/131.png", "SplashScreens_Olipa"),
|
||||||
];
|
];
|
||||||
|
|
||||||
for (file, name) in individual_files {
|
for (file, name) in individual_files {
|
||||||
|
|||||||
@@ -516,11 +516,18 @@ impl ItemDatabase {
|
|||||||
icon_base_path: &Path,
|
icon_base_path: &Path,
|
||||||
item_id: i32,
|
item_id: i32,
|
||||||
) -> (Option<Vec<u8>>, Option<Vec<u8>>, Option<Vec<u8>>) {
|
) -> (Option<Vec<u8>>, Option<Vec<u8>>, Option<Vec<u8>>) {
|
||||||
|
// Try both lowercase and uppercase extensions (Linux is case-sensitive)
|
||||||
let icon_file = icon_base_path.join(format!("{}.png", item_id));
|
let icon_file = icon_base_path.join(format!("{}.png", item_id));
|
||||||
|
let icon_file = if icon_file.exists() {
|
||||||
if !icon_file.exists() {
|
icon_file
|
||||||
return (None, None, None);
|
} else {
|
||||||
}
|
let uppercase = icon_base_path.join(format!("{}.PNG", item_id));
|
||||||
|
if uppercase.exists() {
|
||||||
|
uppercase
|
||||||
|
} else {
|
||||||
|
return (None, None, None);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// Process image at 3 sizes: 256, 64, 16
|
// Process image at 3 sizes: 256, 64, 16
|
||||||
match processor.process_image(&icon_file, &[256, 64, 16], None, None) {
|
match processor.process_image(&icon_file, &[256, 64, 16], None, None) {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
/// Interactable_TeleporterTeleporter component from Cursebreaker
|
/// Interactable_TeleporterDoor component from Cursebreaker
|
||||||
///
|
///
|
||||||
/// C# definition from Interactable_TeleporterTeleporter.cs:
|
/// C# definition from Interactable_TeleporterDoor.cs:
|
||||||
/// ```csharp
|
/// ```csharp
|
||||||
/// public class Interactable_TeleporterTeleporter : MonoBehaviour
|
/// public class Interactable_TeleporterDoor : MonoBehaviour
|
||||||
/// {
|
/// {
|
||||||
/// public Transform tpTransform;
|
/// public Transform tpTransform;
|
||||||
/// }
|
/// }
|
||||||
@@ -53,7 +53,7 @@ impl EcsInsertable for InteractableTeleporter {
|
|||||||
inventory::submit! {
|
inventory::submit! {
|
||||||
unity_parser::ComponentRegistration {
|
unity_parser::ComponentRegistration {
|
||||||
type_id: 114,
|
type_id: 114,
|
||||||
class_name: "Interactable_TeleporterTeleporter",
|
class_name: "Interactable_TeleporterDoorEditor",
|
||||||
parse_and_insert: |yaml, ctx, world, entity| {
|
parse_and_insert: |yaml, ctx, world, entity| {
|
||||||
<InteractableTeleporter as EcsInsertable>::parse_and_insert(yaml, ctx, world, entity)
|
<InteractableTeleporter as EcsInsertable>::parse_and_insert(yaml, ctx, world, entity)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
//! ECS world building from Unity documents
|
//! ECS world building from Unity documents
|
||||||
|
|
||||||
use log::{info, warn};
|
use log::{info, warn, debug};
|
||||||
|
|
||||||
use crate::model::RawDocument;
|
use crate::model::RawDocument;
|
||||||
use crate::parser::{GuidResolver, PrefabGuidResolver};
|
use crate::parser::{GuidResolver, PrefabGuidResolver};
|
||||||
@@ -150,7 +150,7 @@ pub fn build_world_from_documents(
|
|||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
// Soft failure - warn but continue
|
// Soft failure - warn but continue
|
||||||
warn!("Failed to instantiate prefab: {}", e);
|
debug!("Failed to instantiate prefab: {}", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user