diff --git a/src/scripts/kirikiri/scn.rs b/src/scripts/kirikiri/scn.rs index 79a8275..ff22937 100644 --- a/src/scripts/kirikiri/scn.rs +++ b/src/scripts/kirikiri/scn.rs @@ -73,7 +73,7 @@ impl ScriptBuilder for ScnScriptBuilder { } fn extensions(&self) -> &'static [&'static str] { - &["scn"] + &["ks.scn"] } fn script_type(&self) -> &'static ScriptType { diff --git a/src/utils/files.rs b/src/utils/files.rs index 02b7c9b..35e3352 100644 --- a/src/utils/files.rs +++ b/src/utils/files.rs @@ -15,8 +15,16 @@ pub fn find_files(path: &str, recursive: bool, no_ext_filter: bool) -> io::Resul if path.is_file() && (no_ext_filter - || path.extension().map_or(true, |ext| { - ALL_EXTS.contains(&ext.to_string_lossy().to_lowercase()) + || path.file_name().map_or(false, |file| { + path.extension().map_or(true, |_| { + let file = file.to_string_lossy().to_lowercase(); + for ext in ALL_EXTS.iter() { + if file.ends_with(&format!(".{}", ext)) { + return true; + } + } + false + }) })) { if let Some(path_str) = path.to_str() { @@ -45,8 +53,16 @@ pub fn find_arc_files(path: &str, recursive: bool) -> io::Result> { let path = entry.path(); if path.is_file() - && path.extension().map_or(false, |ext| { - ARCHIVE_EXTS.contains(&ext.to_string_lossy().to_lowercase()) + && path.file_name().map_or(false, |file| { + path.extension().map_or(true, |_| { + let file = file.to_string_lossy().to_lowercase(); + for ext in ARCHIVE_EXTS.iter() { + if file.ends_with(&format!(".{}", ext)) { + return true; + } + } + false + }) }) { if let Some(path_str) = path.to_str() {