diff --git a/README.md b/README.md index 7a4e62f..36ce13a 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,20 @@ # UnityExtractor +
+ +![LOGO](./src-tauri/icons/128x128.png) + A Unity asset extractor base on `Tauri` + `Vue` + `Vuetify` -Make All Asset Extract action in **ONE** App +Making All Asset Extract action in **ONE** App +
## App current appearance -![Main Page](./preview/preview-main.png) -![Preview Page](./preview/preview-preview.png) +| MainPage | Preview | +| :------: | :-----: | +| ![Main Page](./preview/preview-main.png) | ![Preview Page](./preview/preview-preview.png) | ## Feature diff --git a/description.md b/description.md index 23dc38d..8a1a452 100644 --- a/description.md +++ b/description.md @@ -1,5 +1,6 @@ -## UnityExtractor v0.1.2 +# UnityExtractor v0.1.3 -## :bug: Bug Fix +## :sparkles: What's new -- fix: preview image overflow \ No newline at end of file +- using New Logo +- support drag file to loading (only load file) \ No newline at end of file diff --git a/package.json b/package.json index b5f8a7a..ee87597 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "unity-extractor", - "version": "0.1.2", + "version": "0.1.3", "private": true, "scripts": { "serve": "vite preview", diff --git a/preview/preview-main.png b/preview/preview-main.png index 139bc32..2f08601 100644 Binary files a/preview/preview-main.png and b/preview/preview-main.png differ diff --git a/preview/preview-preview.png b/preview/preview-preview.png index 363adc3..9aee212 100644 Binary files a/preview/preview-preview.png and b/preview/preview-preview.png differ diff --git a/rust-unity.svg b/rust-unity.svg new file mode 100644 index 0000000..02a7ed6 --- /dev/null +++ b/rust-unity.svg @@ -0,0 +1,185 @@ + + diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 13d0cb4..6dd383e 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -3582,7 +3582,7 @@ checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unity-extractor" -version = "0.1.2" +version = "0.1.3" dependencies = [ "base64 0.21.2", "bytes", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 7eeb7cf..7f7e83a 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "unity-extractor" -version = "0.1.2" +version = "0.1.3" description = "A Tauri App" authors = ["FrozenString"] license-file = "../LICENSE" diff --git a/src-tauri/icons/128x128.png b/src-tauri/icons/128x128.png index 6be5e50..53a9b71 100644 Binary files a/src-tauri/icons/128x128.png and b/src-tauri/icons/128x128.png differ diff --git a/src-tauri/icons/128x128@2x.png b/src-tauri/icons/128x128@2x.png index e81bece..848ec90 100644 Binary files a/src-tauri/icons/128x128@2x.png and b/src-tauri/icons/128x128@2x.png differ diff --git a/src-tauri/icons/32x32.png b/src-tauri/icons/32x32.png index a437dd5..3ad74e9 100644 Binary files a/src-tauri/icons/32x32.png and b/src-tauri/icons/32x32.png differ diff --git a/src-tauri/icons/Square107x107Logo.png b/src-tauri/icons/Square107x107Logo.png index 0ca4f27..e4eba15 100644 Binary files a/src-tauri/icons/Square107x107Logo.png and b/src-tauri/icons/Square107x107Logo.png differ diff --git a/src-tauri/icons/Square142x142Logo.png b/src-tauri/icons/Square142x142Logo.png index b81f820..6c01dd5 100644 Binary files a/src-tauri/icons/Square142x142Logo.png and b/src-tauri/icons/Square142x142Logo.png differ diff --git a/src-tauri/icons/Square150x150Logo.png b/src-tauri/icons/Square150x150Logo.png index 624c7bf..74dd3a9 100644 Binary files a/src-tauri/icons/Square150x150Logo.png and b/src-tauri/icons/Square150x150Logo.png differ diff --git a/src-tauri/icons/Square284x284Logo.png b/src-tauri/icons/Square284x284Logo.png index c021d2b..c241a8c 100644 Binary files a/src-tauri/icons/Square284x284Logo.png and b/src-tauri/icons/Square284x284Logo.png differ diff --git a/src-tauri/icons/Square30x30Logo.png b/src-tauri/icons/Square30x30Logo.png index 6219700..eee0b81 100644 Binary files a/src-tauri/icons/Square30x30Logo.png and b/src-tauri/icons/Square30x30Logo.png differ diff --git a/src-tauri/icons/Square310x310Logo.png b/src-tauri/icons/Square310x310Logo.png index f9bc048..8afab49 100644 Binary files a/src-tauri/icons/Square310x310Logo.png and b/src-tauri/icons/Square310x310Logo.png differ diff --git a/src-tauri/icons/Square44x44Logo.png b/src-tauri/icons/Square44x44Logo.png index d5fbfb2..6c50184 100644 Binary files a/src-tauri/icons/Square44x44Logo.png and b/src-tauri/icons/Square44x44Logo.png differ diff --git a/src-tauri/icons/Square71x71Logo.png b/src-tauri/icons/Square71x71Logo.png index 63440d7..2681642 100644 Binary files a/src-tauri/icons/Square71x71Logo.png and b/src-tauri/icons/Square71x71Logo.png differ diff --git a/src-tauri/icons/Square89x89Logo.png b/src-tauri/icons/Square89x89Logo.png index f3f705a..1e28509 100644 Binary files a/src-tauri/icons/Square89x89Logo.png and b/src-tauri/icons/Square89x89Logo.png differ diff --git a/src-tauri/icons/StoreLogo.png b/src-tauri/icons/StoreLogo.png index 4556388..87fdf9a 100644 Binary files a/src-tauri/icons/StoreLogo.png and b/src-tauri/icons/StoreLogo.png differ diff --git a/src-tauri/icons/icon.icns b/src-tauri/icons/icon.icns index 12a5bce..6efa370 100644 Binary files a/src-tauri/icons/icon.icns and b/src-tauri/icons/icon.icns differ diff --git a/src-tauri/icons/icon.ico b/src-tauri/icons/icon.ico index b3636e4..6841188 100644 Binary files a/src-tauri/icons/icon.ico and b/src-tauri/icons/icon.ico differ diff --git a/src-tauri/icons/icon.png b/src-tauri/icons/icon.png index e1cd261..c94bbe8 100644 Binary files a/src-tauri/icons/icon.png and b/src-tauri/icons/icon.png differ diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index e94e8ea..9d88655 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -4,7 +4,7 @@ mod preview; mod unity; -use tauri::{AppHandle, Manager, WindowEvent::CloseRequested}; +use tauri::{AppHandle, Manager, WindowEvent::{CloseRequested, self}, async_runtime}; // Learn more about Tauri commands at https://tauri.app/v1/guides/features/command #[tauri::command] @@ -12,7 +12,7 @@ fn greet(name: &str) -> String { format!("Hello, {}! You've been greeted from Rust!", name) } use preview::{preview_image, preview_text}; -use unity::{load_unity_asset, preview_object}; +use unity::{load_unity_asset, preview_object, dropped_unity_asset}; use crate::unity::{export_bundle, export_file_type, export_object, sync_loaded_asset}; @@ -33,9 +33,15 @@ fn main() { let windows = app.get_window("main").expect("Main windows not found"); let app_handle = app.app_handle(); windows.on_window_event(move |event| { - if let CloseRequested { api, .. } = event { - api.prevent_close(); - app_handle.exit(0) + match event { + CloseRequested { api, .. } => { + api.prevent_close(); + app_handle.exit(0) + } + WindowEvent::FileDrop(tauri::FileDropEvent::Dropped(paths)) => { + async_runtime::spawn(dropped_unity_asset(app_handle.clone(), paths.clone())); + }, + _ => (), } }); #[cfg(debug_assertions)] diff --git a/src-tauri/src/unity.rs b/src-tauri/src/unity.rs index 1073d9f..c80c666 100644 --- a/src-tauri/src/unity.rs +++ b/src-tauri/src/unity.rs @@ -21,5 +21,5 @@ fn get_opened_unity_asset() -> &'static DashMap { pub use commands::{ export_bundle, export_file_type, export_object, load_unity_asset, preview_object, - sync_loaded_asset, + sync_loaded_asset,dropped_unity_asset }; diff --git a/src-tauri/src/unity/commands.rs b/src-tauri/src/unity/commands.rs index 7135023..4ef1a2b 100644 --- a/src-tauri/src/unity/commands.rs +++ b/src-tauri/src/unity/commands.rs @@ -4,5 +4,5 @@ mod import; mod preview; pub use export::{export_bundle, export_file_type, export_object}; -pub use import::{load_unity_asset, sync_loaded_asset}; +pub use import::{load_unity_asset, sync_loaded_asset,dropped_unity_asset}; pub use preview::preview_object; diff --git a/src-tauri/src/unity/commands/import.rs b/src-tauri/src/unity/commands/import.rs index fcfed2d..06ab2a3 100644 --- a/src-tauri/src/unity/commands/import.rs +++ b/src-tauri/src/unity/commands/import.rs @@ -1,6 +1,6 @@ use std::path::PathBuf; -use tauri::{command, AppHandle}; +use tauri::{command, AppHandle, Manager}; use uuid::Uuid; use crate::{ @@ -12,6 +12,8 @@ use crate::{ }, }; +const LOAD_ASSET_DONE: &str = "unity-bundle-load-done"; + #[command(async)] pub async fn load_unity_asset(app: AppHandle, path: String) -> UnityResult { let key = Uuid::new_v5(&Uuid::NAMESPACE_OID, path.as_bytes()); @@ -33,6 +35,22 @@ pub async fn load_unity_asset(app: AppHandle, path: String) -> UnityResult) -> UnityResult<()> { + app.emit_all("loading", true)?; + let mut result = Vec::new(); + for path in paths.into_iter().filter(|path| path.is_file()) { + let Some(path) = path.as_os_str().to_str() else{ + continue; + }; + if let Ok(ua) = load_unity_asset(app.clone(), path.to_string()).await { + result.push(ua) + } + } + app.emit_to("main", LOAD_ASSET_DONE, result)?; + Ok(()) +} + #[command] pub fn sync_loaded_asset() -> Vec { get_opened_unity_asset() diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 022becf..ea65919 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -7,8 +7,8 @@ "withGlobalTauri": false }, "package": { - "productName": "unity-extractor", - "version": "0.1.2" + "productName": "UnityExtractor", + "version": "0.1.3" }, "tauri": { "allowlist": { diff --git a/src/components/MainPage.vue b/src/components/MainPage.vue index a21ad63..7d39aa6 100644 --- a/src/components/MainPage.vue +++ b/src/components/MainPage.vue @@ -14,7 +14,7 @@ import { ref } from "vue"; import { BtnDefine } from "../tauri_pack/pack.ts"; import TopBtnBar from "./TopBtnBar.vue"; import ExpandableList from "./ExpandableList.vue"; -import { openOneFile } from "../tauri_pack/pack"; +import { loadDone, openOneFile } from "../tauri_pack/pack"; import { loadUnityAsset, syncLoadedAsset, @@ -76,6 +76,7 @@ const buttons: BtnDefine[] = [ ]; const unliten = ref(); +const unLitenAsset = ref(); onMounted(async () => { unliten.value = await listen( "loading", @@ -83,12 +84,30 @@ onMounted(async () => { loading.value = payload; } ); + + unLitenAsset.value = await listen( + "unity-bundle-load-done", + ({ payload }: { payload: UnityAsset[] }) => { + payload.forEach((element) => { + let idx = unityAsset.value.findIndex( + (value: UnityAsset) => value.id == element.id + ); + if (idx == -1) { + unityAsset.value.push(element); + } + }); + loadDone(); + } + ); }); onUnmounted(() => { if (unliten.value) { unliten.value(); } + if (unLitenAsset.value) { + unLitenAsset.value(); + } });