Skip to content

Commit

Permalink
#[derive(Reflect)] on EguiSettings (#195)
Browse files Browse the repository at this point in the history
Co-authored-by: mvlabat <[email protected]>
  • Loading branch information
SludgePhD and vladbat00 authored Oct 7, 2023
1 parent b2e85a6 commit 9a6b7af
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ use bevy::{
Added, Commands, Component, Deref, DerefMut, Entity, IntoSystemConfigs, Query, Resource,
Shader, SystemSet, With, Without,
},
reflect::Reflect,
render::{
extract_component::{ExtractComponent, ExtractComponentPlugin},
extract_resource::{ExtractResource, ExtractResourcePlugin},
Expand All @@ -102,7 +103,7 @@ use thread_local::ThreadLocal;
pub struct EguiPlugin;

/// A resource for storing global UI settings.
#[derive(Clone, Debug, Resource, ExtractResource)]
#[derive(Clone, Debug, Resource, ExtractResource, Reflect)]
pub struct EguiSettings {
/// Global scale factor for Egui widgets (`1.0` by default).
///
Expand All @@ -124,6 +125,7 @@ pub struct EguiSettings {
pub default_open_url_target: Option<String>,
/// Used to change sampler properties
/// Defaults to linear and clamped to edge
#[reflect(ignore)]
pub sampler_descriptor: ImageSampler,
}

Expand Down Expand Up @@ -571,6 +573,8 @@ pub enum EguiSet {

impl Plugin for EguiPlugin {
fn build(&self, app: &mut App) {
app.register_type::<EguiSettings>();

let world = &mut app.world;
world.init_resource::<EguiSettings>();
world.init_resource::<EguiManagedTextures>();
Expand Down

0 comments on commit 9a6b7af

Please sign in to comment.