Merge branch 'hotfix-2.0.0'
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
use crate::AmongUsVersion;
|
||||||
use crate::AppData;
|
use crate::AppData;
|
||||||
use druid::{
|
use druid::{
|
||||||
widget::*, BoxConstraints, Env, Event, EventCtx, FileDialogOptions, LayoutCtx, LifeCycle,
|
widget::*, BoxConstraints, Env, Event, EventCtx, FileDialogOptions, LayoutCtx, LifeCycle,
|
||||||
@@ -56,36 +57,42 @@ impl AmongUsLauncherWidget {
|
|||||||
// Iterate first to find labels:
|
// Iterate first to find labels:
|
||||||
|
|
||||||
let mut flexbox_array: Vec<druid::widget::Flex<AppData>> = Vec::new();
|
let mut flexbox_array: Vec<druid::widget::Flex<AppData>> = Vec::new();
|
||||||
let mut auv_array: Vec<String> = Vec::new();
|
let mut auv_array: Vec<AmongUsVersion> = Vec::new();
|
||||||
|
|
||||||
for i in &collection {
|
for i in &collection {
|
||||||
let existing_ver_smash = i.as_ref().unwrap().file_name();
|
let existing_ver_smash = i.as_ref().unwrap().file_name();
|
||||||
let mut ver_smash_split = existing_ver_smash.to_str().unwrap().split('-');
|
let mut ver_smash_split = existing_ver_smash.to_str().unwrap().split('-');
|
||||||
let auv = ver_smash_split.next().unwrap();
|
let among_us_version = AmongUsVersion::from(ver_smash_split.next().unwrap());
|
||||||
if !auv_array.contains(&auv.to_string()) {
|
if !auv_array.contains(&among_us_version) {
|
||||||
let label_text = format!("Among Us {}", auv);
|
auv_array.push(among_us_version);
|
||||||
let flex: druid::widget::Flex<AppData> = druid::widget::Flex::column()
|
|
||||||
.with_flex_child(
|
|
||||||
druid::widget::Label::new(label_text.as_str()).with_text_size(24.0),
|
|
||||||
1.0,
|
|
||||||
)
|
|
||||||
.with_default_spacer();
|
|
||||||
flexbox_array.push(flex);
|
|
||||||
auv_array.push(auv.to_string());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auv_array.sort();
|
||||||
|
|
||||||
|
for among_us_version in &auv_array {
|
||||||
|
println!("{}", among_us_version);
|
||||||
|
let label_text = format!("Among Us {}", among_us_version);
|
||||||
|
let flex: druid::widget::Flex<AppData> = druid::widget::Flex::column()
|
||||||
|
.with_flex_child(
|
||||||
|
druid::widget::Label::new(label_text.as_str()).with_text_size(24.0),
|
||||||
|
1.0,
|
||||||
|
)
|
||||||
|
.with_default_spacer();
|
||||||
|
flexbox_array.push(flex);
|
||||||
|
}
|
||||||
|
|
||||||
println!("Installs list:");
|
println!("Installs list:");
|
||||||
|
|
||||||
for i in collection {
|
for i in collection {
|
||||||
let existing_ver_smash = i.unwrap().file_name();
|
let existing_ver_smash = i.unwrap().file_name();
|
||||||
let mut ver_smash_split = existing_ver_smash.to_str().unwrap().split('-');
|
let mut ver_smash_split = existing_ver_smash.to_str().unwrap().split('-');
|
||||||
let auv = ver_smash_split.next().unwrap();
|
let among_us_version = AmongUsVersion::from(ver_smash_split.next().unwrap());
|
||||||
let button_string: String =
|
let button_string: String =
|
||||||
format!("Town of Us {}", ver_smash_split.next().unwrap());
|
format!("Town of Us {}", ver_smash_split.next().unwrap());
|
||||||
|
|
||||||
for (index, j) in auv_array.iter().enumerate() {
|
for (index, j) in auv_array.iter().enumerate() {
|
||||||
if j == auv {
|
if j == &among_us_version {
|
||||||
let mut clone: PathBuf = PathBuf::from(data.installs_path.clone());
|
let mut clone: PathBuf = PathBuf::from(data.installs_path.clone());
|
||||||
clone.push(existing_ver_smash.clone());
|
clone.push(existing_ver_smash.clone());
|
||||||
|
|
||||||
@@ -118,6 +125,8 @@ impl AmongUsLauncherWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
flexbox_array.reverse();
|
||||||
|
|
||||||
for i in flexbox_array {
|
for i in flexbox_array {
|
||||||
flex.add_flex_child(i, 1.0);
|
flex.add_flex_child(i, 1.0);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user