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

Comments

@ozkriff
Copy link
Owner

commented Jul 17, 2017

@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

This comment has been minimized.

Copy link
Owner Author

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 added a commit that referenced this issue Aug 25, 2017

@ozkriff ozkriff closed this in #87 Aug 25, 2017

@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
Projects
None yet
1 participant
You can’t perform that action at this time.