start dev mode only when run with cargo. remove "mute_music" feature

This commit is contained in:
yuni 2024-05-01 05:01:11 +02:00
parent b00c583d4d
commit cfadb5e2bf
3 changed files with 4 additions and 5 deletions

View file

@ -47,9 +47,8 @@ embed-resource = "1.6.3" # embedding of .exe metadata
[features]
default = ["x11", "embed_assets"]
mute_music = []
dev_mode = []
dev = ["dev_mode", "mute_music", "bevy/dynamic_linking", "bevy/file_watcher"]
dev = ["dev_mode", "bevy/dynamic_linking", "bevy/file_watcher"]
release_linux = ["x11", "wayland", "embed_assets"]
release_windows = ["embed_assets"]
wasm = ["bevy/webgl2"]

View file

@ -6,7 +6,7 @@ For development, it's recommended to use `--features dev`:
cargo [run|build] --features dev
```
This enables the following:
This enables the following, but ONLY if you run it with `cargo run`:
- Mutes music by default (you can still unmute it)
- Enables "dev mode", which changes the game slightly:

View file

@ -128,9 +128,9 @@ pub struct Settings {
impl Default for Settings {
fn default() -> Self {
let dev_mode = cfg!(feature = "dev_mode");
let dev_mode = cfg!(feature = "dev_mode") && env::var("CARGO").is_ok();
let default_mute_sfx = false;
let default_mute_music = cfg!(feature = "mute_music");
let default_mute_music = dev_mode;
let version = if let Some(version) = option_env!("CARGO_PKG_VERSION") {
version.to_string()
} else {