Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

Commit

Permalink
Don't show COMFY ENGINE in title outside of dev builds
Browse files Browse the repository at this point in the history
  • Loading branch information
darthdeus committed Oct 23, 2023
1 parent 2c943ea commit 036a3be
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 17 deletions.
9 changes: 4 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# v0.3.0

- Added `game_config().comfy_in_title` which controls whether the window title
contains `(COMFY ENGINE)` suffix. As a small sidenote, one might want to keep
this enabled to allow e.g. tiling window manager rules like `for_window
[title=".*COMFY ENGINE.*"] floating enable` in e.g. i3 and only disable it in
release builds. Or just disable it altogether :)
- Removed `(COMFY ENGINE)` from the title. This is now only shown in `--features dev`
where `(Comfy Engine DEV BUILD)` is appended to the title. This can be useful for tiling
window managers like i3 to automatically float windows with this title, e.g.
`for_window [title=".*Comfy Engine DEV BUIL:D.*"] floating enable`.
- Notable upgrades: `wgpu 0.16.3 -> 0.17.1`, `egui 0.22.0 -> 0.23.0`. The
`egui` upgrade is somewhat important, as `egui::plot` got moved into a
separate `egui_plot` crate that Comfy now re-exports.
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# EXAMPLE=animated_shapes
# EXAMPLE=animated_text
# EXAMPLE=animated_sprites
EXAMPLE=animated_sprites
# EXAMPLE=blood_canvas
# EXAMPLE=bloom
# EXAMPLE=custom_config
# EXAMPLE=cooldowns
# EXAMPLE=custom_fonts
EXAMPLE=circle
# EXAMPLE=circle
# EXAMPLE=colors
# EXAMPLE=ecs_sprite
# EXAMPLE=ecs_topdown_game
Expand All @@ -33,7 +33,7 @@ EXAMPLE=circle
default: example
# default: test

FLAGS=--features=blobs,git-version
FLAGS=--features=blobs,git-version,dev
ENV_VARS=RUST_LOG=warn,wgpu=info,symphonia=warn,naga=warn RUST_BACKTRACE=1

bitmob:
Expand Down
2 changes: 2 additions & 0 deletions comfy-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ repository = "https://github.com/darthdeus/comfy"

[features]
default = []

dev = []
ci-release = ["file_logger"]

file_logger = ["log4rs", "chrono"]
Expand Down
2 changes: 0 additions & 2 deletions comfy-core/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ pub fn game_config_mut() -> AtomicRefMut<'static, GameConfig> {
pub struct GameConfig {
pub game_name: String,
pub version: &'static str,
pub comfy_in_title: bool,

pub resolution: ResolutionConfig,
pub min_resolution: ResolutionConfig,
Expand Down Expand Up @@ -115,7 +114,6 @@ impl Default for GameConfig {
Self {
game_name: "TODO_GAME_NAME".to_string(),
version: "TODO_VERSION",
comfy_in_title: true,

resolution,
min_resolution,
Expand Down
2 changes: 1 addition & 1 deletion comfy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ repository = "https://github.com/darthdeus/comfy"
[features]
default = ["color-backtrace", "quick-exit"]

dev = ["comfy-core/dev"]
blobs = []

memory-stats = ["comfy-core/memory-stats"]
Expand All @@ -21,7 +22,6 @@ exit-after-startup = []
git-version = ["comfy-core/git-version"]

demo = []
dev = []
embedded-assets = []
quick-exit = []
ci-release = ["comfy-core/ci-release", "comfy-wgpu/ci-release", "wayland"]
Expand Down
12 changes: 6 additions & 6 deletions comfy/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,12 @@ impl EngineState {
}

pub fn title(&self) -> String {
let config = game_config();

if config.comfy_in_title {
format!("{} (COMFY ENGINE)", game_config().game_name)
} else {
config.game_name.clone()
cfg_if! {
if #[cfg(feature = "dev")] {
format!("{} (Comfy Engine DEV BUILD)", game_config().game_name)
} else {
config.game_name.clone()
}
}
}
}

0 comments on commit 036a3be

Please sign in to comment.