Upgrade to Bevy 0.19 and harden editor workflows
CI / Format, lint, test, build (push) Has been cancelled
CI / Format, lint, test, build (push) Has been cancelled
This commit is contained in:
1 parent
3f85d25cc7
commit
b5e561904c
204 files changed
+6972
-29907
No files matched your search
@@ -15,7 +15,7 @@ use crate::render_target::ViewportRenderTarget;
|
||||
use crate::selection::ViewportClick;
|
||||
use crate::state::PlayPossession;
|
||||
use crate::viewport::actor_icons::ActorIconSettings;
|
||||
use crate::viewport::brush_edit::BrushEditMode;
|
||||
use crate::viewport::brush_edit::{BrushEditMode, BrushElementSelection};
|
||||
use crate::viewport::brush_tool::{BrushToolPhase, BrushToolState};
|
||||
use crate::viewport::{
|
||||
snap_translation, viewport_ground_position, EditorViewportMode, ViewportDisplayMode,
|
||||
@@ -36,6 +36,10 @@ pub struct ViewportUiState {
|
||||
|
||||
const VIEWPORT_TOOLTIP: &str = "RMB + WASD/QE: fly | MMB: pan | Scroll: dolly\nW/E/R: gizmo | X: world/local | F: focus | G: game view | Ctrl+G: grid\nTab: cycle overlapping picks | Play/Pause/Stop: main toolbar (F5 / F6)";
|
||||
|
||||
#[expect(
|
||||
clippy::too_many_arguments,
|
||||
reason = "viewport tab rendering keeps immediate-mode UI inputs explicit"
|
||||
)]
|
||||
pub fn viewport_tab_ui(
|
||||
world: &mut World,
|
||||
ui: &mut egui::Ui,
|
||||
@@ -161,20 +165,58 @@ fn scene_view_brush_mode_badge(world: &World, ctx: &egui::Context, scene_rect: e
|
||||
if !mode.is_element_mode() {
|
||||
return;
|
||||
}
|
||||
let selected_count = world
|
||||
.get_resource::<BrushElementSelection>()
|
||||
.map(|selection| selection.elements.len())
|
||||
.unwrap_or(0);
|
||||
egui::Area::new(egui::Id::new("scene_view_brush_mode_badge"))
|
||||
.fixed_pos(scene_rect.right_bottom() + egui::vec2(-150.0, -22.0))
|
||||
.fixed_pos(scene_rect.left_top() + egui::vec2(8.0, 52.0))
|
||||
.interactable(false)
|
||||
.show(ctx, |ui| {
|
||||
egui::Frame::new()
|
||||
.fill(egui::Color32::from_rgba_unmultiplied(35, 44, 50, 220))
|
||||
.corner_radius(egui::CornerRadius::same(3))
|
||||
.inner_margin(egui::Margin::symmetric(6, 2))
|
||||
.fill(egui::Color32::from_rgba_unmultiplied(20, 18, 28, 230))
|
||||
.stroke(egui::Stroke::new(
|
||||
1.0,
|
||||
egui::Color32::from_rgba_unmultiplied(210, 140, 255, 210),
|
||||
))
|
||||
.corner_radius(egui::CornerRadius::same(4))
|
||||
.inner_margin(egui::Margin::symmetric(8, 6))
|
||||
.show(ui, |ui| {
|
||||
ui.label(
|
||||
egui::RichText::new(format!("Brush: {}", mode.label()))
|
||||
.color(egui::Color32::from_rgb(170, 220, 255))
|
||||
.small(),
|
||||
);
|
||||
ui.horizontal(|ui| {
|
||||
ui.label(
|
||||
egui::RichText::new(format!("Brush {}", mode.label()))
|
||||
.color(egui::Color32::from_rgb(230, 190, 255))
|
||||
.strong(),
|
||||
);
|
||||
ui.label(
|
||||
egui::RichText::new(format!("{selected_count} selected"))
|
||||
.color(egui::Color32::from_rgb(205, 200, 215))
|
||||
.small(),
|
||||
);
|
||||
ui.label(
|
||||
egui::RichText::new("Element gizmo")
|
||||
.color(egui::Color32::from_rgb(255, 190, 120))
|
||||
.small(),
|
||||
);
|
||||
});
|
||||
ui.add_space(4.0);
|
||||
ui.horizontal_wrapped(|ui| {
|
||||
match mode {
|
||||
BrushEditMode::Vertex => key_hint(ui, "LMB", "Select vertex"),
|
||||
BrushEditMode::Edge => key_hint(ui, "LMB", "Select edge"),
|
||||
BrushEditMode::Face => key_hint(ui, "LMB", "Select face"),
|
||||
BrushEditMode::Clip => key_hint(ui, "LMB", "Select face"),
|
||||
BrushEditMode::Object => {}
|
||||
}
|
||||
if !matches!(mode, BrushEditMode::Clip) {
|
||||
key_hint(ui, "W/E/R", "Move/rotate/scale");
|
||||
}
|
||||
if matches!(mode, BrushEditMode::Clip) {
|
||||
key_hint(ui, "Enter", "Clip");
|
||||
}
|
||||
key_hint(ui, "Shift+LMB", "Multi");
|
||||
key_hint(ui, "Esc", "Object");
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user