UI image selection (#97)

This commit is contained in:
Philip Kristoffersen
2022-04-23 20:33:16 +02:00
committed by GitHub
parent 91782b74eb
commit e77f2b5f31
49 changed files with 1368 additions and 801 deletions
+8 -8
View File
@@ -1,16 +1,16 @@
use super::lutris_game::LutrisGame;
pub fn parse_lutris_games<'a>(input: &'a str) -> Vec<LutrisGame> {
pub fn parse_lutris_games(input: &str) -> Vec<LutrisGame> {
input
.split("\n")
.split('\n')
.into_iter()
.filter(|s| !s.is_empty())
.filter_map(parse_line)
.collect()
}
fn parse_line<'a>(input: &'a str) -> Option<LutrisGame> {
let mut sections = input.split("|");
fn parse_line(input: &str) -> Option<LutrisGame> {
let mut sections = input.split('|');
if sections.clone().count() < 4 {
return None;
}
@@ -20,10 +20,10 @@ fn parse_line<'a>(input: &'a str) -> Option<LutrisGame> {
let platform = sections.next().unwrap().trim();
Some(LutrisGame {
id:id.to_string(),
index:index.to_string(),
name:name.to_string(),
platform:platform.to_string(),
id: id.to_string(),
index: index.to_string(),
name: name.to_string(),
platform: platform.to_string(),
})
}
+1 -1
View File
@@ -18,7 +18,7 @@ impl From<LutrisGame> for ShortcutOwned {
"",
"",
"",
&options.as_str(),
options.as_str(),
)
.to_owned()
}
+1 -1
View File
@@ -53,6 +53,6 @@ impl Platform<LutrisGame, Box<dyn Error>> for LutrisPlatform {
}
fn needs_proton(&self, _input: &LutrisGame) -> bool {
return false;
false
}
}
+3 -3
View File
@@ -1,7 +1,7 @@
use serde::{Serialize,Deserialize};
use serde::{Deserialize, Serialize};
#[derive(Debug, Deserialize, Serialize,Clone)]
#[derive(Debug, Deserialize, Serialize, Clone)]
pub struct LutrisSettings {
pub enabled: bool,
pub executable: Option<String>,
}
}