Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ tauri-plugin-fs = "2"
tauri-plugin-updater = "2"
tauri-plugin-process = "2"

ltk_modpkg = { version = "0.2", git = "https://github.com/LeagueToolkit/league-mod", features = ["project"] }
ltk_mod_project = { version = "0.2", git = "https://github.com/LeagueToolkit/league-mod" }
ltk_modpkg = { version = "0.3", git = "https://github.com/LeagueToolkit/league-mod", features = ["project"] }
ltk_mod_project = { version = "0.3", git = "https://github.com/LeagueToolkit/league-mod" }
ltk_mod_core = { version = "0.1", git = "https://github.com/LeagueToolkit/league-mod" }
ltk_fantome = { version = "0.2", git = "https://github.com/LeagueToolkit/league-mod" }
ltk_overlay = { version = "0.1.1", git = "https://github.com/LeagueToolkit/league-mod" }
ltk_fantome = { version = "0.3", git = "https://github.com/LeagueToolkit/league-mod" }
ltk_overlay = { version = "0.1.2", git = "https://github.com/LeagueToolkit/league-mod" }
ltk_wad = "0.2.12"
ltk_file = "0.2.8"

Expand Down
11 changes: 10 additions & 1 deletion src-tauri/src/mods/library.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::error::{AppError, AppResult};
use crate::state::Settings;
use chrono::Utc;
use ltk_mod_project::{ModProject, ModProjectLayer};
use ltk_mod_project::{ModMap, ModProject, ModProjectLayer, ModTag};
use ltk_modpkg::Modpkg;
use std::fs;
use std::path::{Path, PathBuf};
Expand Down Expand Up @@ -460,6 +460,9 @@ fn read_installed_mod(
enabled,
installed_at: entry.installed_at,
layers,
tags: project.tags.iter().map(|t| t.to_string()).collect(),
champions: project.champions.clone(),
maps: project.maps.iter().map(|m| m.to_string()).collect(),
mod_dir: mod_dir.display().to_string(),
})
}
Expand Down Expand Up @@ -551,6 +554,9 @@ fn extract_fantome_metadata(file_path: &Path, metadata_dir: &Path) -> AppResult<
description: info.description,
authors: vec![ltk_mod_project::ModProjectAuthor::Name(info.author)],
license: None,
tags: info.tags.into_iter().map(ModTag::from).collect(),
champions: info.champions,
maps: info.maps.into_iter().map(ModMap::from).collect(),
transformers: Vec::new(),
layers,
thumbnail: None,
Expand Down Expand Up @@ -626,6 +632,9 @@ fn extract_modpkg_metadata(file_path: &Path, metadata_dir: &Path) -> AppResult<(
.map(|a| ltk_mod_project::ModProjectAuthor::Name(a.name))
.collect(),
license: None,
tags: metadata.tags.into_iter().map(ModTag::from).collect(),
champions: metadata.champions,
maps: metadata.maps.into_iter().map(ModMap::from).collect(),
transformers: Vec::new(),
layers,
thumbnail: None,
Expand Down
3 changes: 3 additions & 0 deletions src-tauri/src/mods/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ pub struct InstalledMod {
pub enabled: bool,
pub installed_at: DateTime<Utc>,
pub layers: Vec<ModLayer>,
pub tags: Vec<String>,
pub champions: Vec<String>,
pub maps: Vec<String>,
/// Directory where the mod is installed
pub mod_dir: String,
}
Expand Down
3 changes: 3 additions & 0 deletions src-tauri/src/overlay/fantome_content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ impl<R: Read + Seek + Send> ModContentProvider for FantomeContent<R> {
description: info.description,
authors: vec![ModProjectAuthor::Name(info.author)],
license: None,
tags: Vec::new(),
champions: Vec::new(),
maps: Vec::new(),
transformers: Vec::new(),
layers: default_layers(),
thumbnail: None,
Expand Down
3 changes: 3 additions & 0 deletions src-tauri/src/overlay/modpkg_content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ impl<R: Read + Seek + Send> ModContentProvider for ModpkgContent<R> {
.map(|a| ModProjectAuthor::Name(a.name))
.collect(),
license: None,
tags: Vec::new(),
champions: Vec::new(),
maps: Vec::new(),
transformers: Vec::new(),
layers,
thumbnail: None,
Expand Down
16 changes: 16 additions & 0 deletions src-tauri/src/workshop/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ pub struct WorkshopProject {
pub description: String,
/// List of authors
pub authors: Vec<WorkshopAuthor>,
/// Categorization tags
pub tags: Vec<String>,
/// Champion names this mod applies to
pub champions: Vec<String>,
/// Map identifiers this mod applies to
pub maps: Vec<String>,
/// Project layers
pub layers: Vec<WorkshopLayer>,
/// Path to thumbnail image if exists
Expand Down Expand Up @@ -100,6 +106,9 @@ pub struct SaveProjectConfigArgs {
pub version: String,
pub description: String,
pub authors: Vec<WorkshopAuthor>,
pub tags: Vec<String>,
pub champions: Vec<String>,
pub maps: Vec<String>,
}

/// Arguments for packing a project.
Expand Down Expand Up @@ -215,13 +224,20 @@ pub(crate) fn load_workshop_project(project_dir: &Path) -> AppResult<WorkshopPro
})
.collect();

let tags = mod_project.tags.iter().map(|t| t.to_string()).collect();
let champions = mod_project.champions.clone();
let maps = mod_project.maps.iter().map(|m| m.to_string()).collect();

Ok(WorkshopProject {
path: project_dir.display().to_string(),
name: mod_project.name,
display_name: mod_project.display_name,
version: mod_project.version,
description: mod_project.description,
authors,
tags,
champions,
maps,
layers,
thumbnail_path,
last_modified,
Expand Down
21 changes: 20 additions & 1 deletion src-tauri/src/workshop/projects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ use super::{
};
use crate::error::{AppError, AppResult};
use crate::state::Settings;
use ltk_mod_project::{default_layers, ModProject, ModProjectAuthor, ModProjectLayer};
use ltk_mod_project::{
default_layers, ModMap, ModProject, ModProjectAuthor, ModProjectLayer, ModTag,
};
use std::fs;
use std::path::PathBuf;

Expand Down Expand Up @@ -82,6 +84,9 @@ impl Workshop {
description: args.description,
authors,
license: None,
tags: Vec::new(),
champions: Vec::new(),
maps: Vec::new(),
transformers: Vec::new(),
layers: default_layers(),
thumbnail: None,
Expand Down Expand Up @@ -131,6 +136,9 @@ impl Workshop {
None => ModProjectAuthor::Name(a.name),
})
.collect();
mod_project.tags = args.tags.into_iter().map(ModTag::from).collect();
mod_project.champions = args.champions;
mod_project.maps = args.maps.into_iter().map(ModMap::from).collect();

let json_config_path = path.join("mod.config.json");
let config_content = serde_json::to_string_pretty(&mod_project)?;
Expand Down Expand Up @@ -275,6 +283,17 @@ impl Workshop {
.map(|a| ModProjectAuthor::Name(a.name))
.collect(),
license: None,
tags: metadata
.tags
.into_iter()
.map(ltk_mod_project::ModTag::from)
.collect(),
champions: metadata.champions,
maps: metadata
.maps
.into_iter()
.map(ltk_mod_project::ModMap::from)
.collect(),
transformers: Vec::new(),
layers,
thumbnail: None,
Expand Down
Loading