From ffb7baaaa1fae76b2821b1888d0924023f1d079f Mon Sep 17 00:00:00 2001 From: Piotr Siuszko Date: Sat, 24 Sep 2022 19:07:43 +0200 Subject: [PATCH] Working egui client --- egui_client/Cargo.lock | 329 +++++++++++++++++++++++++++++++-- egui_client/Cargo.toml | 3 +- egui_client/src/main.rs | 47 ++++- rusty_hub/src/hub.rs | 24 ++- rusty_hub/src/lib.rs | 8 + rusty_hub/src/main.rs | 14 -- rusty_hub/src/unity_project.rs | 12 +- 7 files changed, 383 insertions(+), 54 deletions(-) create mode 100644 rusty_hub/src/lib.rs delete mode 100644 rusty_hub/src/main.rs diff --git a/egui_client/Cargo.lock b/egui_client/Cargo.lock index 0b23f98..bf8d4df 100644 --- a/egui_client/Cargo.lock +++ b/egui_client/Cargo.lock @@ -30,12 +30,21 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57e6e951cfbb2db8de1828d49073a113a29fd7117b1596caa781a258c7e38d72" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "getrandom", "once_cell", "version_check", ] +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "arboard" version = "2.1.1" @@ -89,6 +98,15 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + [[package]] name = "bumpalo" version = "3.11.0" @@ -115,6 +133,12 @@ dependencies = [ "syn", ] +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + [[package]] name = "bytes" version = "1.2.1" @@ -146,6 +170,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + [[package]] name = "cfg-if" version = "1.0.0" @@ -161,6 +191,21 @@ dependencies = [ "libc", ] +[[package]] +name = "chrono" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" +dependencies = [ + "iana-time-zone", + "js-sys", + "num-integer", + "num-traits", + "time", + "wasm-bindgen", + "winapi", +] + [[package]] name = "clipboard-win" version = "4.4.2" @@ -222,6 +267,18 @@ dependencies = [ "memchr", ] +[[package]] +name = "confy" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5069e3065d9ad485706017d12bb4b4318170b8087358c163c2dfce50b6b38275" +dependencies = [ + "directories", + "serde", + "thiserror", + "toml", +] + [[package]] name = "core-foundation" version = "0.9.3" @@ -275,13 +332,22 @@ dependencies = [ "libc", ] +[[package]] +name = "cpufeatures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] @@ -348,6 +414,36 @@ dependencies = [ "syn", ] +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "directories" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "551a778172a450d7fc12e629ca3b0428d00f6afa9a43da1b630d54604e97371c" +dependencies = [ + "cfg-if 0.1.10", + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + [[package]] name = "dispatch" version = "0.2.0" @@ -481,6 +577,24 @@ dependencies = [ "str-buf", ] +[[package]] +name = "exe" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2327a5b94310f33654812ff74ec7cd226a89eb430c46d4e1308c7e895da12f19" +dependencies = [ + "bitflags", + "byteorder", + "chrono", + "hex", + "md-5", + "num-traits", + "pkbuffer", + "sha-1", + "sha2", + "widestring 0.4.3", +] + [[package]] name = "expat-sys" version = "2.1.6" @@ -580,6 +694,16 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "generic-array" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +dependencies = [ + "typenum", + "version_check", +] + [[package]] name = "gethostname" version = "0.2.3" @@ -596,10 +720,10 @@ version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "js-sys", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "wasm-bindgen", ] @@ -691,6 +815,25 @@ dependencies = [ "gl_generator", ] +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "iana-time-zone" +version = "0.1.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd911b35d940d2bd0bea0f9100068e5b97b51a1cbe13d13382f132e0365257a0" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "js-sys", + "wasm-bindgen", + "winapi", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -713,7 +856,7 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "js-sys", "wasm-bindgen", "web-sys", @@ -772,7 +915,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "winapi", ] @@ -792,7 +935,7 @@ version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] @@ -804,6 +947,17 @@ dependencies = [ "libc", ] +[[package]] +name = "md-5" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5a279bb9607f9f53c22d496eade00d138d1bdcccd07d74650387cf94942a15" +dependencies = [ + "block-buffer", + "digest", + "opaque-debug", +] + [[package]] name = "memchr" version = "2.5.0" @@ -851,7 +1005,7 @@ checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" dependencies = [ "libc", "log", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys", ] @@ -958,7 +1112,7 @@ checksum = "e4916f159ed8e5de0082076562152a76b7a1f64a01fd9d1e0fea002c37624faf" dependencies = [ "bitflags", "cc", - "cfg-if", + "cfg-if 1.0.0", "libc", "memoffset", ] @@ -970,7 +1124,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "195cdbc1741b8134346d515b3a56a1c94b0912758009cfd53f99ea0f57b065fc" dependencies = [ "bitflags", - "cfg-if", + "cfg-if 1.0.0", "libc", "memoffset", ] @@ -991,6 +1145,25 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + [[package]] name = "num_enum" version = "0.5.7" @@ -1047,6 +1220,12 @@ version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + [[package]] name = "osmesa-sys" version = "0.1.2" @@ -1081,7 +1260,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", "redox_syscall", "smallvec", @@ -1100,6 +1279,26 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +[[package]] +name = "pkbuffer" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c63758cdd196779b1d782c6c5f568cbd6b412eb3c51eab711f08e83cd57edef" +dependencies = [ + "pkbuffer_derive", +] + +[[package]] +name = "pkbuffer_derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c86ad26b9715c9c1664b79f6e5c44baf38fb87a5133bdd7ec90baff7b71d155" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "pkg-config" version = "0.3.25" @@ -1174,11 +1373,48 @@ dependencies = [ "bitflags", ] +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom", + "redox_syscall", + "thiserror", +] + +[[package]] +name = "registry" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83e4b158bf49b0d000013487636c92268de4cfd26cdbb629f020a612749f12c4" +dependencies = [ + "bitflags", + "log", + "thiserror", + "utfx", + "winapi", +] + +[[package]] +name = "rusty_hub" +version = "0.1.0" +dependencies = [ + "confy", + "exe", + "registry", + "serde", + "serde_derive", + "walkdir", +] + [[package]] name = "rusty_hub_egui" version = "0.1.0" dependencies = [ "eframe", + "rusty_hub", ] [[package]] @@ -1261,6 +1497,32 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "sha-1" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" +dependencies = [ + "block-buffer", + "cfg-if 1.0.0", + "cpufeatures", + "digest", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer", + "cfg-if 1.0.0", + "cpufeatures", + "digest", + "opaque-debug", +] + [[package]] name = "shared_library" version = "0.1.9" @@ -1358,6 +1620,17 @@ dependencies = [ "syn", ] +[[package]] +name = "time" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", +] + [[package]] name = "tiny-skia" version = "0.7.0" @@ -1367,7 +1640,7 @@ dependencies = [ "arrayref", "arrayvec", "bytemuck", - "cfg-if", + "cfg-if 1.0.0", "png", "safe_arch", "tiny-skia-path", @@ -1413,7 +1686,7 @@ version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "pin-project-lite", "tracing-core", ] @@ -1433,6 +1706,12 @@ version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b3e06c9b9d80ed6b745c7159c40b311ad2916abb34a49e9be2653b90db0d8dd" +[[package]] +name = "typenum" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" + [[package]] name = "unicode-bidi" version = "0.3.8" @@ -1465,6 +1744,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "utfx" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "133bf74f01486773317ddfcde8e2e20d2933cc3b68ab797e5d718bef996a81de" + [[package]] name = "vec_map" version = "0.8.2" @@ -1488,6 +1773,12 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -1500,7 +1791,7 @@ version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "wasm-bindgen-macro", ] @@ -1525,7 +1816,7 @@ version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "js-sys", "wasm-bindgen", "web-sys", @@ -1663,10 +1954,16 @@ dependencies = [ "ndk-glue 0.6.2", "url", "web-sys", - "widestring", + "widestring 0.5.1", "winapi", ] +[[package]] +name = "widestring" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c168940144dd21fd8046987c16a46a33d5fc84eec29ef9dcddc2ac9e31526b7c" + [[package]] name = "widestring" version = "0.5.1" diff --git a/egui_client/Cargo.toml b/egui_client/Cargo.toml index bceb3b2..c2a0ca9 100644 --- a/egui_client/Cargo.toml +++ b/egui_client/Cargo.toml @@ -14,4 +14,5 @@ opt-level = 2 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -eframe = "0.19.0" \ No newline at end of file +eframe = "0.19.0" +rusty_hub = { path="../rusty_hub" } \ No newline at end of file diff --git a/egui_client/src/main.rs b/egui_client/src/main.rs index 984f969..35f99cd 100644 --- a/egui_client/src/main.rs +++ b/egui_client/src/main.rs @@ -1,6 +1,7 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release use eframe::egui; +use rusty_hub::hub::Hub; fn main() { let options = eframe::NativeOptions::default(); @@ -19,9 +20,7 @@ fn setup_custom_fonts(ctx: &egui::Context) { // .ttf and .otf files supported. fonts.font_data.insert( "my_font".to_owned(), - egui::FontData::from_static(include_bytes!( - "../static/FiraCode-VF.ttf" - )), + egui::FontData::from_static(include_bytes!("../static/FiraCode-VF.ttf")), ); // Put my font first (highest priority) for proportional text: @@ -44,6 +43,7 @@ fn setup_custom_fonts(ctx: &egui::Context) { struct MyApp { text: String, + hub: Hub, } impl MyApp { @@ -51,6 +51,7 @@ impl MyApp { setup_custom_fonts(&cc.egui_ctx); Self { text: "Edit this text field if you want".to_owned(), + hub: Hub::default(), } } } @@ -58,8 +59,42 @@ impl MyApp { impl eframe::App for MyApp { fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) { egui::CentralPanel::default().show(ctx, |ui| { - ui.heading("egui using custom fonts"); - ui.text_edit_multiline(&mut self.text); + egui::Grid::new("some_unique_id") + .striped(true) + .min_row_height(30.0) + .max_col_width(500.0) + .show(ui, |ui| { + let mut index: usize = 0; + for project in &self.hub.projects { + if self.hub.editor_for_project(project).is_some() { + if ui.button("run").clicked() { + self.hub.run_project_nr(index); + } + } + ui.label(&project.title); + let version_response = + ui.add(egui::Label::new(&project.version).sense(egui::Sense::click())); + version_response.context_menu(|ui| { + for editor in &self.hub.config.editors_configurations { + if ui.button(format!("Open in {}", editor.version)).clicked() { + Hub::run_project(&editor, &project); + ui.close_menu(); + } + } + }); + let path_response = + ui.add(egui::Label::new(&project.path).sense(egui::Sense::click())); + path_response.context_menu(|ui| { + if ui.button("Open directory").clicked() { + use std::process::Command; + Command::new("explorer").arg(&project.path).spawn().unwrap(); + ui.close_menu(); + } + }); + ui.end_row(); + index = index + 1; + } + }); }); } -} \ No newline at end of file +} diff --git a/rusty_hub/src/hub.rs b/rusty_hub/src/hub.rs index 6794428..eaafbab 100644 --- a/rusty_hub/src/hub.rs +++ b/rusty_hub/src/hub.rs @@ -1,6 +1,6 @@ use std::process::Command; -use crate::{config::Configuration, unity_project::UnityProject}; +use crate::{config::Configuration, unity_project::UnityProject, unity_editor::UnityEditor}; #[derive(Debug, Serialize, Deserialize, Clone)] pub struct Hub { @@ -15,22 +15,30 @@ impl Hub { pub fn run_project_nr(&self, nr: usize) { let project = self.projects[nr].clone(); - let project_version = project.version; + + if let Some(editor) = self.editor_for_project(&project) { + Hub::run_project(&editor, &project); + } + } + + pub fn editor_for_project(&self, project: &UnityProject) -> Option { let editor_option = self .config .editors_configurations .clone() .into_iter() - .find(|editor| editor.version.contains(&project_version)); + .find(|editor| editor.version.contains(&project.version)); - if let Some(editor) = editor_option { - println!("{} -projectpath {}", editor.exe_path, project.path); - Command::new(editor.exe_path) + editor_option + } + + pub fn run_project(editor: &UnityEditor, project: &UnityProject) { + println!("{} -projectpath {}", editor.exe_path, project.path); + Command::new(&editor.exe_path) .arg("-projectpath") - .arg(project.path) + .arg(&project.path) .spawn() .expect("Failed to run project"); - } } } impl Default for Hub { diff --git a/rusty_hub/src/lib.rs b/rusty_hub/src/lib.rs new file mode 100644 index 0000000..379f6fb --- /dev/null +++ b/rusty_hub/src/lib.rs @@ -0,0 +1,8 @@ +#[macro_use] +extern crate serde_derive; +extern crate confy; + +pub mod config; +pub mod hub; +pub mod unity_editor; +pub mod unity_project; diff --git a/rusty_hub/src/main.rs b/rusty_hub/src/main.rs deleted file mode 100644 index 4516fb4..0000000 --- a/rusty_hub/src/main.rs +++ /dev/null @@ -1,14 +0,0 @@ -#[macro_use] -extern crate serde_derive; -extern crate confy; - -mod config; -mod hub; -mod unity_editor; -mod unity_project; - -fn main() { - let hub = self::hub::Hub::default(); - println!("{:#?}", hub); - // hub.run_project_nr(0); -} diff --git a/rusty_hub/src/unity_project.rs b/rusty_hub/src/unity_project.rs index 9505f84..ab19d29 100644 --- a/rusty_hub/src/unity_project.rs +++ b/rusty_hub/src/unity_project.rs @@ -42,19 +42,13 @@ impl UnityProject { } fn get_project_at_path(path: &str) -> Option { - let path = path.trim_matches(char::from(0)); - let second_path = Path::new(&path.replace("/", "\\")).join("ProjectSettings"); + let path = path.trim_matches(char::from(0)).replace("/", "\\"); + let second_path = Path::new(&path).join("ProjectSettings"); if std::fs::metadata(&second_path).is_err() { - println!( - "DUPA: {:#?}, {:#?}", - second_path.display(), - std::fs::metadata(&second_path).err() - ); return None; } let project_version_file = std::fs::read_to_string(second_path.join("ProjectVersion.txt")); if project_version_file.is_err() { - println!("DUPA2"); return None; } let project_version_file = project_version_file.unwrap(); @@ -64,7 +58,7 @@ impl UnityProject { Some(UnityProject { path: path.to_string(), - title: path.to_string(), + title: path.split("\\").last().unwrap().to_string(), version: project_version, }) }