Compare commits
No commits in common. "4bec7d8198426f5d2e13589edc6265b61a1c82cb" and "98dbd192a1908b96a884b3e3c676f38f53daa04f" have entirely different histories.
4bec7d8198
...
98dbd192a1
|
@ -491,7 +491,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "geezshade"
|
name = "geezshade"
|
||||||
version = "0.2.1"
|
version = "0.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"copypasta",
|
"copypasta",
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
name = "geezshade"
|
name = "geezshade"
|
||||||
description = "Automated ReShade setup for FFXIV with GShade presets"
|
description = "Automated ReShade setup for FFXIV with GShade presets"
|
||||||
authors = ["NotNite <hi@notnite.com>"]
|
authors = ["NotNite <hi@notnite.com>"]
|
||||||
version = "0.2.1"
|
version = "0.2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
35
src/main.rs
35
src/main.rs
|
@ -65,35 +65,18 @@ fn get_gshade_presets(xiv_install: PathBuf, config: GeezShadeConfig) -> anyhow::
|
||||||
let shaders_zip = zip::ZipArchive::new(Cursor::new(gshade_shaders))?;
|
let shaders_zip = zip::ZipArchive::new(Cursor::new(gshade_shaders))?;
|
||||||
let presets_zip = zip::ZipArchive::new(Cursor::new(gshade_presets))?;
|
let presets_zip = zip::ZipArchive::new(Cursor::new(gshade_presets))?;
|
||||||
|
|
||||||
let shaders_folder_name = shaders_zip
|
let shaders_folders = vec![
|
||||||
.file_names()
|
"GShade-master/Textures",
|
||||||
.next()
|
"GShade-master/Shaders",
|
||||||
.unwrap()
|
"GShade-master/ComputeShaders",
|
||||||
.split('/')
|
];
|
||||||
.next()
|
let presets_folders = vec!["GShade-Presets-master/FFXIV"];
|
||||||
.unwrap()
|
|
||||||
.to_string();
|
|
||||||
|
|
||||||
let presets_folder_name = presets_zip
|
|
||||||
.file_names()
|
|
||||||
.next()
|
|
||||||
.unwrap()
|
|
||||||
.split('/')
|
|
||||||
.next()
|
|
||||||
.unwrap()
|
|
||||||
.to_string();
|
|
||||||
|
|
||||||
let shaders_folders = vec!["Textures", "Shaders", "ComputeShaders"]
|
|
||||||
.iter()
|
|
||||||
.map(|x| format!("{}/{}", shaders_folder_name, x))
|
|
||||||
.collect::<Vec<String>>();
|
|
||||||
let presets_folders = vec![format!("{}/FFXIV", presets_folder_name)];
|
|
||||||
|
|
||||||
let dir = xiv_install.join("reshade-shaders");
|
let dir = xiv_install.join("reshade-shaders");
|
||||||
|
|
||||||
println!("extracting presets");
|
println!("extracting presets");
|
||||||
extract(dir.clone(), shaders_zip, shaders_folders)?;
|
extract(dir.clone(), shaders_zip, shaders_folders.clone())?;
|
||||||
extract(dir, presets_zip, presets_folders)?;
|
extract(dir, presets_zip, presets_folders.clone())?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
@ -101,7 +84,7 @@ fn get_gshade_presets(xiv_install: PathBuf, config: GeezShadeConfig) -> anyhow::
|
||||||
fn extract(
|
fn extract(
|
||||||
dir: PathBuf,
|
dir: PathBuf,
|
||||||
presets_zip: ZipArchive<Cursor<Vec<u8>>>,
|
presets_zip: ZipArchive<Cursor<Vec<u8>>>,
|
||||||
presets_folders: Vec<String>,
|
presets_folders: Vec<&str>,
|
||||||
) -> anyhow::Result<()> {
|
) -> anyhow::Result<()> {
|
||||||
for filename in presets_zip.file_names() {
|
for filename in presets_zip.file_names() {
|
||||||
for folder in &presets_folders {
|
for folder in &presets_folders {
|
||||||
|
|
Loading…
Reference in New Issue