Compare commits
No commits in common. "46f8831c7b4b810d2387969dfe71b5d80627ef85" and "1bbfaceeb47c6a1e0e8c07b0859fe35479d0ec5a" have entirely different histories.
46f8831c7b
...
1bbfaceeb4
|
@ -27,7 +27,6 @@ pub enum Error {
|
|||
Dialogue,
|
||||
Ending,
|
||||
Exit,
|
||||
Font,
|
||||
Game {
|
||||
missing: NotFound,
|
||||
},
|
||||
|
|
|
@ -255,7 +255,7 @@ impl Game {
|
|||
}
|
||||
|
||||
if ! avatar_exists {
|
||||
warnings.push(crate::Error::Game { missing: NotFound::Avatar });
|
||||
warnings.push(crate::Error::Game { missing: NotFound::Avatar});
|
||||
}
|
||||
|
||||
Ok(
|
||||
|
|
|
@ -51,7 +51,9 @@ impl Sprite {
|
|||
format!("\n{}", lines.join("\n"))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
impl Sprite {
|
||||
pub fn from_str(str: &str) -> Result<Sprite, crate::Error> {
|
||||
let mut lines: Vec<&str> = str.lines().collect();
|
||||
|
||||
|
|
14
src/text.rs
14
src/text.rs
|
@ -13,19 +13,19 @@ impl Font {
|
|||
match str {
|
||||
"unicode_european_small" => Font::UnicodeEuropeanSmall,
|
||||
"unicode_european_large" => Font::UnicodeEuropeanLarge,
|
||||
"unicode_asian" => Font::UnicodeAsian,
|
||||
"arabic" => Font::Arabic,
|
||||
_ => Font::Custom,
|
||||
"unicode_asian" => Font::UnicodeAsian,
|
||||
"arabic" => Font::Arabic,
|
||||
_ => Font::Custom,
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn to_string(&self) -> Result<String, crate::Error> {
|
||||
pub(crate) fn to_string(&self) -> Result<String, &'static str> {
|
||||
match &self {
|
||||
Font::UnicodeEuropeanSmall => Ok("unicode_european_small".to_string()),
|
||||
Font::UnicodeEuropeanLarge => Ok("unicode_european_large".to_string()),
|
||||
Font::UnicodeAsian => Ok("unicode_asian".to_string()),
|
||||
Font::Arabic => Ok("arabic".to_string()),
|
||||
_ => Err(crate::Error::Font),
|
||||
Font::UnicodeAsian => Ok("unicode_asian".to_string()),
|
||||
Font::Arabic => Ok("arabic".to_string()),
|
||||
_ => Err("No string available for this Font"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue