Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User-friendly message about missing assets directory #32

Closed
ozkriff opened this issue Jul 17, 2017 · 1 comment
Closed

User-friendly message about missing assets directory #32

ozkriff opened this issue Jul 17, 2017 · 1 comment

Comments

@ozkriff
Copy link
Owner

ozkriff commented Jul 17, 2017

See ozkriff/zoc#211

@ozkriff ozkriff added this to the 0.2: Basic gameplay milestone Jul 17, 2017
@ozkriff ozkriff moved this from To Do to In Progress in v0.4: Abilities and lasting effects Jul 23, 2017
@ozkriff ozkriff moved this from In Progress to To Do in v0.4: Abilities and lasting effects Aug 7, 2017
@ozkriff ozkriff moved this from To Do to In Progress in v0.4: Abilities and lasting effects Aug 23, 2017
@ozkriff
Copy link
Owner Author

ozkriff commented Aug 24, 2017

Actually, it is checked in Visualizer::new:

#[cfg(not(target_os = "android"))]
fn check_assets_dir() {
use std::fs;
use std::process;
// TODO: check assets version
if let Err(e) = fs::metadata("assets") {
println!("Can`t find 'assets' dir: {}", e);
println!("Note: see 'Assets' section of README.rst");
process::exit(1);
}
}
#[cfg(target_os = "android")]
fn check_assets_dir() {}

impl Visualizer {
pub fn new(settings: Settings) -> Self {
check_assets_dir();

The problem is that

let settings = ron::de::from_str(&hate::fs::load_as_string("settings.ron")).unwrap();

is called before Visualizer::new.

@ozkriff ozkriff removed this from In Progress in v0.4: Abilities and lasting effects Aug 25, 2017
@ozkriff ozkriff added the häte label Sep 7, 2017
@ozkriff ozkriff removed this from the v0.5: Battle math milestone Dec 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant