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
@@ -1,6 +1,6 @@
|
||||
//! Dock tab open/focus helpers and default panel node placement.
|
||||
|
||||
use egui_dock::{DockState, Node, NodeIndex, SurfaceIndex, TabIndex, Tree};
|
||||
use egui_dock::{DockState, Node, NodeIndex, NodePath, SurfaceIndex, TabIndex, TabPath, Tree};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use super::EditorTab;
|
||||
@@ -43,15 +43,15 @@ impl PanelNodes {
|
||||
/// Scan the main surface for open tabs and refresh node indices (handles user drag/split).
|
||||
pub fn discover(dock: &DockState<EditorTab>, fallback: Self) -> Self {
|
||||
let mut nodes = fallback;
|
||||
for ((surface, node_idx), tab) in dock.iter_all_tabs() {
|
||||
if surface != SurfaceIndex::main() {
|
||||
for (path, tab) in dock.iter_all_tabs() {
|
||||
if path.surface != SurfaceIndex::main() {
|
||||
continue;
|
||||
}
|
||||
match tab {
|
||||
EditorTab::Viewport | EditorTab::GameView => nodes.main_view = node_idx.0,
|
||||
EditorTab::Hierarchy => nodes.hierarchy = node_idx.0,
|
||||
EditorTab::Inspector => nodes.inspector = node_idx.0,
|
||||
EditorTab::AssetBrowser | EditorTab::Toolbar => nodes.bottom = node_idx.0,
|
||||
EditorTab::Viewport | EditorTab::GameView => nodes.main_view = path.node.0,
|
||||
EditorTab::Hierarchy => nodes.hierarchy = path.node.0,
|
||||
EditorTab::Inspector => nodes.inspector = path.node.0,
|
||||
EditorTab::AssetBrowser | EditorTab::Toolbar => nodes.bottom = path.node.0,
|
||||
}
|
||||
}
|
||||
nodes
|
||||
@@ -93,8 +93,9 @@ pub fn open_and_focus_tab(
|
||||
let tab_idx = push_tab_to_node(tree, node, tab);
|
||||
(node, tab_idx)
|
||||
};
|
||||
dock.set_active_tab((SurfaceIndex::main(), node, tab_idx));
|
||||
dock.set_focused_node_and_surface((SurfaceIndex::main(), node));
|
||||
let node_path = NodePath::new(SurfaceIndex::main(), node);
|
||||
let _ = dock.set_active_tab(TabPath::new(SurfaceIndex::main(), node, tab_idx));
|
||||
dock.set_focused_node_and_surface(node_path);
|
||||
(node, tab_idx)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user