redo ending transformations

This commit is contained in:
2020-04-29 21:17:29 +01:00
parent e760027ae4
commit e9f1a1afcf
2 changed files with 22 additions and 10 deletions

View File

@@ -1,6 +1,7 @@
use crate::{Dialogue, Ending, Font, Item, Palette, Room, Sprite, TextDirection, Tile, ToBase36, Variable, transform_line_endings, segments_from_string, is_string_numeric};
use std::error::Error;
use loe::TransformMode;
use std::str::FromStr;
/// in very early versions of Bitsy, room tiles were defined as single characters
/// so, only 36 tiles total. later versions are comma-separated
@@ -169,7 +170,10 @@ impl Game {
} else if segment.starts_with("DLG ") {
dialogues.push(Dialogue::from(segment));
} else if segment.starts_with("END ") {
endings.push(Ending::from(segment));
let ending = Ending::from_str(&segment);
if ending.is_ok() {
endings.push(ending.unwrap());
}
} else if segment.starts_with("VAR ") {
variables.push(Variable::from(segment));
} else if segment.starts_with("FONT ") {