forked from akanyan/STARTLINER
feat: initial chunithm support
This commit is contained in:
@ -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) {
|
||||
|
Reference in New Issue
Block a user