Support Bevy 0.17 (#11)

* update: modify for 0.17

* update: enhance webview functionality and improve plugin implementation

* update: refactor webview system and improve binding group usage

* update: refactor command triggering for webview events and enhance Receive struct

* update: refactor command triggering for webview dev tools

* update: refactor render process handler and improve webview handling

* update: refactor webview browser handling and improve IME caret management

* clippy

* fmt

* update: improve README formatting and clarify version compatibility

* update: support Bevy 0.17 and enhance permissions in settings

* update: enhance CI configuration by adding Wayland and XKB dependencies

* delete: settings.json

* update: refactor shader imports and improve binding group definitions

* update: refactor devtool command triggers for improved clarity

* update: modify LibraryLoader initialization for improved path handling on macOS

* fmt

---------

Co-authored-by: not-elm <elmgameinfo@gmail.com>
This commit is contained in:
elm
2025-10-26 16:55:03 +09:00
committed by GitHub
parent 0bb9b58fae
commit edf9e064b9
35 changed files with 1753 additions and 1189 deletions

View File

@@ -80,6 +80,6 @@ fn show_devtool(
}
*initialized = true;
for webview in webviews.iter() {
commands.entity(webview).trigger(RequestShowDevTool);
commands.trigger(RequestShowDevTool { webview });
}
}

View File

@@ -4,7 +4,8 @@
use bevy::pbr::MaterialExtension;
use bevy::prelude::*;
use bevy::render::render_resource::{AsBindGroup, ShaderRef};
use bevy::render::render_resource::AsBindGroup;
use bevy::shader::ShaderRef;
use bevy_cef::prelude::*;
fn main() {

View File

@@ -63,13 +63,13 @@ fn spawn_webview(
}
fn show_devtool(mut commands: Commands, webviews: Query<Entity, With<DebugWebview>>) {
commands
.entity(webviews.single().unwrap())
.trigger(RequestShowDevTool);
commands.trigger(RequestShowDevTool {
webview: webviews.single().unwrap(),
});
}
fn close_devtool(mut commands: Commands, webviews: Query<Entity, With<DebugWebview>>) {
commands
.entity(webviews.single().unwrap())
.trigger(RequestCloseDevtool);
commands.trigger(RequestCloseDevtool {
webview: webviews.single().unwrap(),
});
}

View File

@@ -52,7 +52,9 @@ fn emit_count(
webviews: Query<Entity, With<DebugWebview>>,
) {
*count += 1;
commands
.entity(webviews.single().unwrap())
.trigger(HostEmitEvent::new("count", &*count));
commands.trigger(HostEmitEvent::new(
webviews.single().unwrap(),
"count",
&*count,
));
}

View File

@@ -19,12 +19,12 @@ fn main() {
.run();
}
#[derive(Event, Deserialize)]
#[derive(Deserialize)]
struct Message {
count: u32,
}
fn apply_receive_message(trigger: Trigger<Message>) {
fn apply_receive_message(trigger: On<Receive<Message>>) {
info!("Received: {:?}", trigger.count);
}

View File

@@ -58,12 +58,12 @@ fn spawn_webview(
fn request_go_back(mut commands: Commands, webviews: Query<Entity, With<DebugWebview>>) {
for webview in webviews.iter() {
commands.entity(webview).trigger(RequestGoBack);
commands.trigger(RequestGoBack { webview });
}
}
fn request_go_forward(mut commands: Commands, webviews: Query<Entity, With<DebugWebview>>) {
for webview in webviews.iter() {
commands.entity(webview).trigger(RequestGoForward);
commands.trigger(RequestGoForward { webview });
}
}

View File

@@ -41,7 +41,7 @@ fn spawn_webview(
));
}
fn change_zoom_level(mut er: EventReader<MouseWheel>, mut webviews: Query<&mut ZoomLevel>) {
fn change_zoom_level(mut er: MessageReader<MouseWheel>, mut webviews: Query<&mut ZoomLevel>) {
for event in er.read() {
webviews.par_iter_mut().for_each(|mut level| {
if event.y > 0.0 {