Skip to content

Commit

Permalink
compensate for fullscreen shenanigans
Browse files Browse the repository at this point in the history
  • Loading branch information
bananaturtlesandwich committed Jul 20, 2023
1 parent 4b20975 commit 673f77c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ authors = ["spuds"]
repository = "https://github.com/bananaturtlesandwich/stove"
description = "an editor for cooked unreal engine 4 map files"
readme = "README.md"
version = "0.7.3"
version = "0.8.0"
edition = "2021"

[dependencies]
Expand Down
12 changes: 10 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ pub struct Stove {
paks: Vec<String>,
distance: f32,
fullscreen: bool,
size: (f32, f32),
aes: String,
use_cache: bool,
script: String,
Expand Down Expand Up @@ -236,6 +237,7 @@ impl Stove {
paks,
distance,
fullscreen: false,
size: ctx.screen_size(),
aes,
use_cache,
script,
Expand Down Expand Up @@ -516,7 +518,7 @@ impl EventHandler for Stove {
ui.heading("viewport");
ui.end_row();
binding(ui, "exit", "escape");
binding(ui, "toggle fullscreen", "t");
binding(ui, "toggle fullscreen", "alt + enter");
binding(ui, "hide ui", "h");
binding(ui, "select", "left-click");
binding(ui, "transplant", "ctrl + t");
Expand Down Expand Up @@ -892,9 +894,15 @@ impl EventHandler for Stove {
true => self.open_save_dialog(),
false => self.save(),
},
KeyCode::T => {
KeyCode::Enter if keymods.alt => {
if !self.fullscreen {
self.size = ctx.screen_size();
}
self.fullscreen = !self.fullscreen;
ctx.set_fullscreen(self.fullscreen);
if !self.fullscreen {
ctx.set_window_size(self.size.0 as u32, self.size.1 as u32)
}
}
_ => (),
}
Expand Down

0 comments on commit 673f77c

Please sign in to comment.