mirror of
https://github.com/an-anime-team/sleepy-launcher.git
synced 2025-03-15 06:28:27 +03:00
feat(ui): shrinked wine/dxvk lists to 12 versions
This commit is contained in:
parent
2a83423a62
commit
c220c74d5d
2 changed files with 33 additions and 3 deletions
|
@ -36,7 +36,7 @@ impl From<wine::Group> for ComponentsListGroup {
|
|||
impl From<dxvk::Group> for ComponentsListGroup {
|
||||
fn from(group: dxvk::Group) -> Self {
|
||||
Self {
|
||||
title: group.name,
|
||||
title: group.title,
|
||||
versions: group.versions.into_iter().map(|version| version.into()).collect()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -542,7 +542,22 @@ impl SimpleAsyncComponent for GeneralApp {
|
|||
.launch(ComponentsListInit {
|
||||
pattern: ComponentsListPattern {
|
||||
download_folder: CONFIG.game.wine.builds.clone(),
|
||||
groups: wine::get_groups(&CONFIG.components.path).unwrap_or_default().into_iter().map(|group| group.into()).collect()
|
||||
groups: wine::get_groups(&CONFIG.components.path).unwrap_or_default()
|
||||
.into_iter()
|
||||
.map(|mut group| {
|
||||
group.versions = group.versions.into_iter().take(12).collect();
|
||||
|
||||
let mut group: ComponentsListGroup = group.into();
|
||||
|
||||
if group.versions.len() > 6 {
|
||||
for i in 6..group.versions.len() {
|
||||
group.versions[i].recommended = false;
|
||||
}
|
||||
}
|
||||
|
||||
group
|
||||
})
|
||||
.collect()
|
||||
},
|
||||
on_downloaded: Some(GeneralAppMsg::UpdateDownloadedWine),
|
||||
on_deleted: Some(GeneralAppMsg::UpdateDownloadedWine)
|
||||
|
@ -553,7 +568,22 @@ impl SimpleAsyncComponent for GeneralApp {
|
|||
.launch(ComponentsListInit {
|
||||
pattern: ComponentsListPattern {
|
||||
download_folder: CONFIG.game.dxvk.builds.clone(),
|
||||
groups: dxvk::get_groups(&CONFIG.components.path).unwrap_or_default().into_iter().map(|group| group.into()).collect()
|
||||
groups: dxvk::get_groups(&CONFIG.components.path).unwrap_or_default()
|
||||
.into_iter()
|
||||
.map(|mut group| {
|
||||
group.versions = group.versions.into_iter().take(12).collect();
|
||||
|
||||
let mut group: ComponentsListGroup = group.into();
|
||||
|
||||
if group.versions.len() > 6 {
|
||||
for i in 6..group.versions.len() {
|
||||
group.versions[i].recommended = false;
|
||||
}
|
||||
}
|
||||
|
||||
group
|
||||
})
|
||||
.collect()
|
||||
},
|
||||
on_downloaded: Some(GeneralAppMsg::UpdateDownloadedDxvk),
|
||||
on_deleted: Some(GeneralAppMsg::UpdateDownloadedDxvk)
|
||||
|
|
Loading…
Add table
Reference in a new issue