Skip to content

Commit

Permalink
Make args defaults easier to work with for the deck
Browse files Browse the repository at this point in the history
  • Loading branch information
haihala committed Dec 26, 2023
1 parent f5bb4d7 commit ae8674b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion client/Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ args = ["run", "--", "--dev", "mizku", "mizku"]
[tasks.prod]
workspace = false
command = "cargo"
args = ["run", "--", "--fullscreen", "mizku", "mizku"]
args = ["run", "--", "mizku", "mizku"]
6 changes: 3 additions & 3 deletions client/main/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ fn main() {
})
.set(WindowPlugin {
primary_window: Some(Window {
mode: if args.fullscreen {
WindowMode::BorderlessFullscreen
} else {
mode: if args.dev {
WindowMode::Windowed
} else {
WindowMode::BorderlessFullscreen
},
resizable: false,
..default()
Expand Down
4 changes: 2 additions & 2 deletions client/wag_core/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ pub struct WagArgs {
/// Dev mode (shows hitboxes and dev binds)
#[arg(short, long, default_value_t = false)]
pub dev: bool,
#[arg(short, long, default_value_t = false)]
pub fullscreen: bool,
#[arg(default_value_t = CharacterId::Mizku)]
pub character1: CharacterId,
#[arg(default_value_t = CharacterId::Mizku)]
pub character2: CharacterId,
}
impl WagArgs {
Expand Down
8 changes: 8 additions & 0 deletions client/wag_core/src/character_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,11 @@ impl FromStr for CharacterId {
}
}
}
impl std::fmt::Display for CharacterId {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
CharacterId::Dummy => write!(f, "dummy"),
CharacterId::Mizku => write!(f, "mizku"),
}
}
}

0 comments on commit ae8674b

Please sign in to comment.