feat: initial chunithm support

This commit is contained in:
2025-03-19 17:39:12 +00:00
parent 1191cdd95c
commit 8ac45df3e1
31 changed files with 1368 additions and 884 deletions

View File

@ -1,7 +1,7 @@
use std::hash::{DefaultHasher, Hash, Hasher};
use crate::model::config::GlobalConfig;
use crate::pkg::{Feature, Status};
use crate::profiles::AnyProfile;
use crate::profiles::Profile;
use crate::{model::misc::Game, pkg::PkgKey};
use crate::pkg_store::PackageStore;
use crate::util;
@ -13,7 +13,7 @@ pub struct GlobalState {
}
pub struct AppData {
pub profile: Option<AnyProfile>,
pub profile: Option<Profile>,
pub pkgs: PackageStore,
pub cfg: GlobalConfig,
pub state: GlobalState,
@ -33,7 +33,7 @@ impl AppData {
.unwrap_or_default();
let profile = match cfg.recent_profile {
Some((ref game, ref name)) => AnyProfile::load(game.clone(), name.clone()).ok(),
Some((game, ref name)) => Profile::load(game, name.clone()).ok(),
None => None
};
@ -52,7 +52,7 @@ impl AppData {
}
pub fn switch_profile(&mut self, game: Game, name: String) -> Result<()> {
match AnyProfile::load(game.clone(), name.clone()) {
match Profile::load(game.clone(), name.clone()) {
Ok(profile) => {
self.profile = Some(profile);
self.cfg.recent_profile = Some((game, name));
@ -103,7 +103,7 @@ impl AppData {
Ok(())
}
pub fn sum_packages(&self, p: &AnyProfile) -> String {
pub fn sum_packages(&self, p: &Profile) -> String {
let mut hasher = DefaultHasher::new();
for key in p.mod_pkgs().into_iter() {
if let Ok(pkg) = self.pkgs.get(&key) {