multi-board files
This commit is contained in:
@@ -19,7 +19,7 @@ mod input;
|
||||
|
||||
use kiln_core::game::GameState;
|
||||
use kiln_core::log::LogLine;
|
||||
use kiln_core::map_file;
|
||||
use kiln_core::world;
|
||||
use ratatui::Frame;
|
||||
use ratatui::crossterm::event::{
|
||||
self, DisableMouseCapture, EnableMouseCapture, Event, KeyEventKind,
|
||||
@@ -49,8 +49,14 @@ fn main() -> ExitCode {
|
||||
};
|
||||
|
||||
// Load before touching the terminal so load errors print to a normal screen.
|
||||
let board = match map_file::load(&path) {
|
||||
Ok(board) => board,
|
||||
let board = match world::load(&path) {
|
||||
Ok(mut w) => match w.boards.remove(&w.start) {
|
||||
Some(b) => b,
|
||||
None => {
|
||||
eprintln!("error: start board '{}' not found", w.start);
|
||||
return ExitCode::FAILURE;
|
||||
}
|
||||
},
|
||||
Err(e) => {
|
||||
eprintln!("error loading {path}: {e}");
|
||||
return ExitCode::FAILURE;
|
||||
|
||||
Reference in New Issue
Block a user