Rename WidgetSystem::system to ::render

This commit is contained in:
Tobias Berger 2022-11-07 08:16:47 +01:00
parent 2ffdd87712
commit e09e75b6a9
Signed by: toby
GPG key ID: 2D05EFAB764D6A88
2 changed files with 3 additions and 3 deletions

View file

@ -14,7 +14,7 @@ use {
}; };
pub(crate) trait WidgetSystem: SystemParam { pub(crate) trait WidgetSystem: SystemParam {
fn system(world: &mut World, state: &mut SystemState<Self>, ui: &mut Ui, id: WidgetId); fn render(world: &mut World, state: &mut SystemState<Self>, ui: &mut Ui, id: WidgetId);
} }
pub(crate) fn widget<S: 'static + WidgetSystem>(world: &mut World, ui: &mut Ui, id: WidgetId) { pub(crate) fn widget<S: 'static + WidgetSystem>(world: &mut World, ui: &mut Ui, id: WidgetId) {
@ -36,7 +36,7 @@ pub(crate) fn widget<S: 'static + WidgetSystem>(world: &mut World, ui: &mut Ui,
_ = states.instances.insert(id, SystemState::new(world)); _ = states.instances.insert(id, SystemState::new(world));
} }
let cached_state = states.instances.get_mut(&id).unwrap(); let cached_state = states.instances.get_mut(&id).unwrap();
S::system(world, cached_state, ui, id); S::render(world, cached_state, ui, id);
cached_state.apply(world); cached_state.apply(world);
}); });
} }

View file

@ -170,7 +170,7 @@ pub(crate) struct ToolbarWidget<'w, 's> {
_phantom: PhantomData<(&'w (), &'s ())>, _phantom: PhantomData<(&'w (), &'s ())>,
} }
impl WidgetSystem for ToolbarWidget<'_, '_> { impl WidgetSystem for ToolbarWidget<'_, '_> {
fn system(world: &mut World, _state: &mut SystemState<Self>, ui: &mut Ui, _id: WidgetId) { fn render(world: &mut World, _state: &mut SystemState<Self>, ui: &mut Ui, _id: WidgetId) {
ui.with_layout( ui.with_layout(
Layout::left_to_right(bevy_egui::egui::Align::Center), Layout::left_to_right(bevy_egui::egui::Align::Center),
|ui| { |ui| {