mirror of
https://github.com/FyroxEngine/Fyrox.git
synced 2026-10-12 02:02:20 +00:00
process file system events on every frame
- fixes a lot of broken functionality in the asset browser
This commit is contained in:
@@ -2967,15 +2967,6 @@ impl Editor {
|
||||
self.engine.destroy_graphics_context().unwrap();
|
||||
}
|
||||
|
||||
fn on_focus_changed(&mut self) {
|
||||
if self.focused {
|
||||
self.engine
|
||||
.resource_manager
|
||||
.state()
|
||||
.process_filesystem_events();
|
||||
}
|
||||
}
|
||||
|
||||
pub fn run(mut self, event_loop: EventLoop<()>) {
|
||||
Log::info("Initializing resource registry.");
|
||||
self.engine.resource_manager.update_or_load_registry();
|
||||
@@ -3056,7 +3047,6 @@ impl Editor {
|
||||
}
|
||||
WindowEvent::Focused(focused) => {
|
||||
self.focused = *focused;
|
||||
self.on_focus_changed();
|
||||
}
|
||||
WindowEvent::Moved(new_position) => {
|
||||
// Allow the window to go outside the screen bounds by a little. This
|
||||
|
||||
@@ -376,9 +376,6 @@ fn run_normal(
|
||||
}
|
||||
Event::WindowEvent { event, .. } => {
|
||||
match event {
|
||||
WindowEvent::Focused(true) => {
|
||||
engine.resource_manager.state().process_filesystem_events();
|
||||
}
|
||||
WindowEvent::CloseRequested => active_event_loop.exit(),
|
||||
WindowEvent::Resized(size) => {
|
||||
if let Err(e) = engine.set_frame_size(size.into()) {
|
||||
|
||||
@@ -1243,6 +1243,7 @@ impl ResourceManagerState {
|
||||
true
|
||||
}
|
||||
});
|
||||
self.process_filesystem_events();
|
||||
}
|
||||
|
||||
fn add_resource_and_notify(&mut self, resource: UntypedResource) {
|
||||
|
||||
Reference in New Issue
Block a user