diff --git a/src/common.rs b/src/common.rs index 12c47b4..43e9dd3 100644 --- a/src/common.rs +++ b/src/common.rs @@ -17,6 +17,7 @@ pub use std::f32::consts::PI as PI32; pub use std::f64::consts::PI; pub const WINDOW_TITLE: &str = "OutFly"; +pub const CONF_FILE: &str = "outfly.toml"; pub const FONT: &str = "fonts/Yupiter-Regular.ttf"; pub const EPSILON32: f32 = 1e-9; diff --git a/src/var.rs b/src/var.rs index f909207..da8aa5e 100644 --- a/src/var.rs +++ b/src/var.rs @@ -11,6 +11,7 @@ // This module manages variables, settings, as well as evaluating // "if"-conditions in chats. +use crate::prelude::*; use bevy::window::WindowMode; use bevy::prelude::*; use std::collections::HashMap; @@ -317,17 +318,17 @@ fn file_is_readable(file_path: &str) -> bool { } fn get_prefs_path() -> Option { - let test = "outfly.toml"; + let test = CONF_FILE; if file_is_readable(test) { return Some(test.to_string()); } if let Ok(basedir) = env::var("XDG_CONFIG_HOME") { - let test = basedir.to_string() + "/outfly/outfly.toml"; + let test = basedir.to_string() + "/outfly/" + CONF_FILE; if file_is_readable(test.as_str()) { return Some(test); } } else if let Ok(basedir) = env::var("HOME") { - let test = basedir.to_string() + ".config/outfly/outfly.toml"; + let test = basedir.to_string() + ".config/outfly/" + CONF_FILE; if file_is_readable(test.as_str()) { return Some(test); }