undo egui upgrade try

This commit is contained in:
Marcel Märtens 2021-11-19 14:19:04 +01:00
parent e29ede7c97
commit 7200cc4ad7
6 changed files with 21 additions and 56 deletions

52
Cargo.lock generated
View File

@ -1468,18 +1468,7 @@ version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "788148861d80b87d28d64440a3d31cae190e50ccc3ea585597466d38428365d7" checksum = "788148861d80b87d28d64440a3d31cae190e50ccc3ea585597466d38428365d7"
dependencies = [ dependencies = [
"epaint 0.12.0", "epaint",
]
[[package]]
name = "egui"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c8d416a3343cbfc6f4d17bb1cba46b4d7efecb9ee541967763e0b5e04e5fae7"
dependencies = [
"ahash 0.7.6",
"epaint 0.15.0",
"nohash-hasher",
] ]
[[package]] [[package]]
@ -1494,11 +1483,11 @@ dependencies = [
[[package]] [[package]]
name = "egui_winit_platform" name = "egui_winit_platform"
version = "0.11.0" version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a0ae306ae9cd296ed3178d518fd0d9edf45f176cfdfe31ff77b7051c5f1d5278" checksum = "cd4cf17c0cd4dbcf2f8fef55a3592b9b7cfd970576c7302d8ba5c521b8560371"
dependencies = [ dependencies = [
"egui 0.15.0", "egui",
"winit", "winit",
] ]
@ -1514,12 +1503,6 @@ version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3e73d6c8c70eadb71756fbbc3c303ab25e163b46b656886dd250de5636efea12" checksum = "3e73d6c8c70eadb71756fbbc3c303ab25e163b46b656886dd250de5636efea12"
[[package]]
name = "emath"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24a1aaa922d55da6a2bf32957c3d153e7fb9d52ed8d69777a75092240172eb6e"
[[package]] [[package]]
name = "encoding_rs" name = "encoding_rs"
version = "0.8.29" version = "0.8.29"
@ -1597,31 +1580,18 @@ checksum = "80e2db640801230bdda80629bc3a063927a462f5eaf38a98da676954e78ccb99"
dependencies = [ dependencies = [
"ahash 0.7.6", "ahash 0.7.6",
"atomic_refcell", "atomic_refcell",
"emath 0.12.0", "emath",
"ordered-float 2.8.0", "ordered-float 2.8.0",
"rusttype 0.9.2", "rusttype 0.9.2",
] ]
[[package]]
name = "epaint"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16bb4d3b8bbbd132c99d2a5efec8567e8b6d09b742f758ae6cf1e4b104fe0231"
dependencies = [
"ab_glyph",
"ahash 0.7.6",
"atomic_refcell",
"emath 0.15.0",
"nohash-hasher",
]
[[package]] [[package]]
name = "epi" name = "epi"
version = "0.12.0" version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59c4f6cbede1fc8f836384f85295a59199a4825940abcc3a8a29cfe2e3c37583" checksum = "59c4f6cbede1fc8f836384f85295a59199a4825940abcc3a8a29cfe2e3c37583"
dependencies = [ dependencies = [
"egui 0.12.0", "egui",
] ]
[[package]] [[package]]
@ -3442,12 +3412,6 @@ dependencies = [
"memoffset 0.6.4", "memoffset 0.6.4",
] ]
[[package]]
name = "nohash-hasher"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451"
[[package]] [[package]]
name = "noise" name = "noise"
version = "0.7.0" version = "0.7.0"
@ -6408,7 +6372,7 @@ dependencies = [
"directories-next", "directories-next",
"dispatch 0.1.4", "dispatch 0.1.4",
"dot_vox", "dot_vox",
"egui 0.15.0", "egui",
"egui_wgpu_backend", "egui_wgpu_backend",
"egui_winit_platform", "egui_winit_platform",
"enum-iterator", "enum-iterator",
@ -6497,7 +6461,7 @@ dependencies = [
name = "veloren-voxygen-egui" name = "veloren-voxygen-egui"
version = "0.9.0" version = "0.9.0"
dependencies = [ dependencies = [
"egui 0.15.0", "egui",
"egui_winit_platform", "egui_winit_platform",
"lazy_static", "lazy_static",
"veloren-client", "veloren-client",

View File

@ -68,9 +68,9 @@ glyph_brush = "0.7.0"
keyboard-keynames = { git = "https://gitlab.com/Frinksy/keyboard-keynames.git", branch = "develop" } keyboard-keynames = { git = "https://gitlab.com/Frinksy/keyboard-keynames.git", branch = "develop" }
# EGUI # EGUI
egui = {version = "0.15", optional = true } egui = {version = "0.12", optional = true }
egui_wgpu_backend = {git = "https://github.com/hasenbanck/egui_wgpu_backend.git", rev = "63a002c6a9b6c016e45806dd065864431caab621", optional = true } egui_wgpu_backend = {git = "https://github.com/hasenbanck/egui_wgpu_backend.git", rev = "63a002c6a9b6c016e45806dd065864431caab621", optional = true }
egui_winit_platform = {version = "0.11", optional = true } egui_winit_platform = {version = "0.8", optional = true }
# ECS # ECS
specs = {git = "https://github.com/amethyst/specs.git", rev = "f985bec5d456f7b0dd8aae99848f9473c2cd9d46"} specs = {git = "https://github.com/amethyst/specs.git", rev = "f985bec5d456f7b0dd8aae99848f9473c2cd9d46"}

View File

@ -11,8 +11,8 @@ be-dyn-lib = []
[dependencies] [dependencies]
client = {package = "veloren-client", path = "../../client"} client = {package = "veloren-client", path = "../../client"}
common = {package = "veloren-common", path = "../../common"} common = {package = "veloren-common", path = "../../common"}
egui = "0.15" egui = "0.12"
egui_winit_platform = "0.11" egui_winit_platform = "0.8"
lazy_static = "1.4.0" lazy_static = "1.4.0"
voxygen-dynlib = {package = "veloren-voxygen-dynlib", path = "../dynlib", optional = true} voxygen-dynlib = {package = "veloren-voxygen-dynlib", path = "../dynlib", optional = true}

View File

@ -14,7 +14,8 @@ use common::{
}; };
use core::mem; use core::mem;
use egui::{ use egui::{
plot::{Line, Plot, Value, Values}, plot::{Plot, Value},
widgets::plot::Curve,
CollapsingHeader, Color32, Grid, Pos2, ScrollArea, Slider, Ui, Window, CollapsingHeader, Color32, Grid, Pos2, ScrollArea, Slider, Ui, Window,
}; };
@ -261,13 +262,13 @@ pub fn maintain_egui_inner(
Window::new("🔧 Settings") Window::new("🔧 Settings")
.open(&mut windows.egui_settings) .open(&mut windows.egui_settings)
.vscroll(true) .scroll(true)
.show(ctx, |ui| { .show(ctx, |ui| {
ctx.settings_ui(ui); ctx.settings_ui(ui);
}); });
Window::new("🔍 Inspection") Window::new("🔍 Inspection")
.open(&mut windows.egui_inspection) .open(&mut windows.egui_inspection)
.vscroll(true) .scroll(true)
.show(ctx, |ui| { .show(ctx, |ui| {
ctx.inspection_ui(ui); ctx.inspection_ui(ui);
}); });
@ -284,13 +285,13 @@ pub fn maintain_egui_inner(
.default_width(200.0) .default_width(200.0)
.default_height(200.0) .default_height(200.0)
.show(ctx, |ui| { .show(ctx, |ui| {
let plot = Plot::new("Frame Time").line(Line::new(Values::from_values_iter( let plot = Plot::new("Frame Time").curve(Curve::from_values_iter(
egui_state egui_state
.frame_times .frame_times
.iter() .iter()
.enumerate() .enumerate()
.map(|(i, x)| Value::new(i as f64, *x)), .map(|(i, x)| Value::new(i as f64, *x)),
))); ));
ui.add(plot); ui.add(plot);
}); });
@ -320,7 +321,7 @@ pub fn maintain_egui_inner(
.text("Cylinder height"), .text("Cylinder height"),
); );
let scroll_area = ScrollArea::vertical().max_height(800.0); let scroll_area = ScrollArea::from_max_height(800.0);
let (_current_scroll, _max_scroll) = scroll_area.show(ui, |ui| { let (_current_scroll, _max_scroll) = scroll_area.show(ui, |ui| {
Grid::new("entities_grid") Grid::new("entities_grid")
.spacing([40.0, 4.0]) .spacing([40.0, 4.0])

View File

@ -6,7 +6,7 @@ pub(crate) fn filterable_list(
search_text: &str, search_text: &str,
selected_index: &mut usize, selected_index: &mut usize,
) { ) {
let scroll_area = ScrollArea::vertical(); let scroll_area = ScrollArea::auto_sized();
scroll_area.show(ui, |ui| { scroll_area.show(ui, |ui| {
ui.spacing_mut().item_spacing = Vec2::new(0.0, 2.0); ui.spacing_mut().item_spacing = Vec2::new(0.0, 2.0);
let search_text = search_text.to_lowercase(); let search_text = search_text.to_lowercase();

View File

@ -367,7 +367,7 @@ impl<'frame> Drawer<'frame> {
pub fn draw_egui(&mut self, platform: &mut Platform, scale_factor: f32) { pub fn draw_egui(&mut self, platform: &mut Platform, scale_factor: f32) {
span!(guard, "Draw egui"); span!(guard, "Draw egui");
let (_output, paint_commands) = platform.end_frame(None); let (_output, paint_commands) = platform.end_frame();
let paint_jobs = platform.context().tessellate(paint_commands); let paint_jobs = platform.context().tessellate(paint_commands);