-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add egui integration, use single struct for status
- Loading branch information
Frederik Terstappen
committed
Apr 25, 2024
1 parent
702763a
commit 770e914
Showing
14 changed files
with
333 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
[graph] | ||
# targets = [] # Disables all not explicitly listed targets | ||
# exclude = [] # Also removes dependencies of package if not otherwise connected | ||
all-features = true | ||
no-default-features = false | ||
# features = [] # We use all-features | ||
exclude-dev = false | ||
|
||
[output] | ||
feature-depth = 1 | ||
|
||
[advisories] | ||
version = 2 | ||
# db-path = "$CARGO_HOME/advisory-dbs" | ||
# db-urls = ["https://github.com/rustsec/advisory-db"] | ||
# ignore = [] | ||
git-fetch-with-cli = false # False = use build in git library | ||
yanked = "deny" | ||
|
||
[licenses] | ||
version = 2 | ||
allow = [ | ||
"Apache-2.0", # https://tldrlegal.com/license/apache-license-2.0-(apache-2.0) | ||
"BSD-2-Clause", # https://tldrlegal.com/license/bsd-2-clause-license-(freebsd) | ||
"BSD-3-Clause", # https://tldrlegal.com/license/bsd-3-clause-license-(revised) | ||
"CC0-1.0", # https://creativecommons.org/publicdomain/zero/1.0/ | ||
"ISC", # https://tldrlegal.com/license/-isc-license | ||
"LicenseRef-UFL-1.0", # https://tldrlegal.com/license/ubuntu-font-license,-1.0 | ||
"MIT", # https://tldrlegal.com/license/mit-license | ||
"OFL-1.1", # https://spdx.org/licenses/OFL-1.1.html | ||
"Unicode-DFS-2016", # https://spdx.org/licenses/Unicode-DFS-2016.html | ||
"Zlib", # https://tldrlegal.com/license/zlib-libpng-license-(zlib) | ||
"MIT-0", | ||
"0BSD", | ||
] | ||
confidence-threshold = 0.93 | ||
# exceptions = [] | ||
include-dev = true | ||
unused-allowed-license = "warn" | ||
|
||
[bans] | ||
multiple-versions = "deny" | ||
multiple-versions-include-dev = false | ||
wildcards = "deny" | ||
highlight = "all" | ||
workspace-default-features = "allow" | ||
external-default-features = "allow" | ||
# allow = [] # Whitelist if one or more entries | ||
# deny = [] | ||
skip = [ | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected] ", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
{ crate = "[email protected]", reason = "Old version used by other dependency" }, | ||
] # Only for duplicate detection | ||
# skip-tree = [] | ||
|
||
[sources] | ||
unknown-registry = "deny" | ||
unknown-git = "deny" | ||
allow-registry = ["https://github.com/rust-lang/crates.io-index"] | ||
allow-git = [] | ||
required-git-spec = "rev" | ||
# private = [] | ||
|
||
# [sources.allow-org] | ||
# github = [] | ||
# gitlab = [] | ||
# bitbucket = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"cSpell.words": [ | ||
"egui", | ||
"getresuid", | ||
"landlock", | ||
"Lockdown", | ||
|
@@ -10,4 +11,4 @@ | |
"setresuid", | ||
"unistd" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ name = "bevy_mod_lockdown" | |
description = "bevy_mod_lockdown is a library to reduce the attack surface your application offers." | ||
categories = ["game-development"] | ||
keywords = ["bevy", "gamedev"] | ||
version = "0.1.0" | ||
version = "0.2.0" | ||
license = "MIT OR Apache-2.0" | ||
authors = ["Frederik Terstappen <[email protected]>"] | ||
repository = "https://github.com/FrTerstappen/bevy_mod_lockdown" | ||
|
@@ -28,9 +28,11 @@ privilege = [ | |
"nix?/user", | ||
] | ||
system_call = [] | ||
egui = ["dep:egui"] | ||
|
||
[dependencies] | ||
bevy = { version = "0.13.2", default-features = false } | ||
egui = { version = "0.27.2", default-features = false, optional = true } | ||
|
||
[target.'cfg(target_os = "android")'.dependencies] | ||
|
||
|
@@ -47,8 +49,20 @@ nix = { version = "0.28.0", optional = true } | |
[target.'cfg(target_family = "wasm")'.dependencies] | ||
|
||
[target.'cfg(target_os = "windows")'.dependencies] | ||
# To avoid duplication, limited by usage of sysinfo in bevy | ||
windows = { version = "0.52.0", optional = true } | ||
windows = { version = "0.56.0", optional = true } | ||
|
||
[dev-dependencies] | ||
bevy = { version = "0.13.2", default-features = true } | ||
bevy_egui = { version = "0.27.0", default-features = false, features = [ | ||
"default_fonts", | ||
"render", | ||
] } | ||
|
||
[[example]] | ||
name = "egui" | ||
path = "examples/egui.rs" | ||
required-features = ["egui"] | ||
|
||
|
||
[lints] | ||
# Rust | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use bevy::{ | ||
prelude::*, | ||
window::PrimaryWindow, | ||
}; | ||
use bevy_egui::{ | ||
egui, | ||
EguiContext, | ||
EguiPlugin, | ||
}; | ||
use bevy_mod_lockdown::LockdownAdjustments; | ||
|
||
fn main() { | ||
let mut app = App::new(); | ||
app.add_plugins(DefaultPlugins); | ||
app.add_plugins(EguiPlugin); | ||
app.add_plugins(bevy_mod_lockdown::LockdownPlugin); | ||
app.add_systems(Update, display_adjustment_status); | ||
app.run(); | ||
} | ||
|
||
fn display_adjustment_status( | ||
mut egui_ctx: Query<&mut EguiContext, With<PrimaryWindow>>, | ||
lockdown_adjustments: Res<'_, LockdownAdjustments>, | ||
) { | ||
egui::Window::new("Example window").show(egui_ctx.single_mut().get_mut(), |ui| { | ||
bevy_mod_lockdown::egui::ui_for_adjustment(ui, &lockdown_adjustments, true); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
[toolchain] | ||
channel = "nightly" | ||
components = [ | ||
"rustc", | ||
"cargo", | ||
"rustfmt", | ||
"rust-std", | ||
"clippy", | ||
"miri", | ||
"rust-src", | ||
] | ||
targets = [ | ||
# WASM | ||
"wasm32-unknown-unknown", | ||
|
||
# Linux | ||
"x86_64-unknown-linux-gnu", | ||
|
||
# Mac | ||
"aarch64-apple-darwin", | ||
|
||
# iOS | ||
"aarch64-apple-ios", | ||
|
||
# Windows | ||
"x86_64-pc-windows-gnu", | ||
|
||
# Android | ||
"aarch64-linux-android", | ||
] | ||
profile = "default" |
Oops, something went wrong.