Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/bevy_feathers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ bevy_platform = { path = "../bevy_platform", version = "0.20.0-dev" }
bevy_reflect = { path = "../bevy_reflect", version = "0.20.0-dev" }
bevy_render = { path = "../bevy_render", version = "0.20.0-dev" }
bevy_scene = { path = "../bevy_scene", version = "0.20.0-dev" }
bevy-settings = { path = "../bevy_settings", version = "0.20.0-dev" }
bevy_text = { path = "../bevy_text", version = "0.20.0-dev" }
bevy_ui = { path = "../bevy_ui", version = "0.20.0-dev", features = [
"bevy_picking",
Expand Down
17 changes: 11 additions & 6 deletions crates/bevy_feathers/src/controls/color_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use bevy_ecs::{
lifecycle::Despawn,
observer::On,
query::{Changed, With},
reflect::ReflectComponent,
reflect::{ReflectComponent, ReflectResource},
relationship::Relationship,
resource::Resource,
schedule::IntoScheduleConfigs,
Expand All @@ -28,6 +28,7 @@ use bevy_log::warn;
use bevy_math::{UVec2, Vec2, Vec3};
use bevy_reflect::{prelude::ReflectDefault, Reflect};
use bevy_scene::{prelude::*, Ready};
use bevy_settings::{ReflectSettingsGroup, SettingsGroup};
use bevy_text::{EditableText, FontSize, Justify, LineHeight, TextEdit, TextLayout};
use bevy_ui::{
prelude::AccessibleLabel, px, AlignItems, AlignSelf, Display, FlexDirection, GridPlacement,
Expand Down Expand Up @@ -84,8 +85,11 @@ pub enum ColorInputMode {
/// the picker will be in that mode. The assumption is that artists have a preferred mode and will
/// generally stick with it. (Also, we have no way to store the user's preference on a
/// per-attribute basis.)
#[derive(Resource, Default)]
// #[derive(SettingsGroup)] // TODO
///
/// These preferences can be saved along with the rest of the app's settings if the
/// app adds the `SettingsPlugin` and triggers a save, for example before exiting.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be useful to direct users to the settings example to see how that's done?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mnmaita Yes, that would be useful, I’ll add it to the PR. I noticed some files point to examples by name and others by link, which would you prefer?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alice-i-cecile is there any "official" preference here? Also, would it be desirable to open an issue and tackle the aforementioned discrepancies in doc comments?

#[derive(Resource, SettingsGroup, Reflect, Default, Clone, PartialEq)]
#[reflect(Resource, ReflectSettingsGroup, Default)]
pub struct ColorInputSettings {
/// Which color space we're editing
pub mode: ColorInputMode,
Expand Down Expand Up @@ -116,9 +120,10 @@ impl ColorInputSettings {
/// This is spawnable by inheriting it as a "scene component" with optional
/// [`FeathersColorInputProps`].
///
/// The picker contains a number of user preferences which are sticky, and which
/// are stored on the [`ColorInputSettings`] resource. If the bevy settings plugin in installed,
/// these user preferences will be saved along with the user's settings.
/// The picker has a number of sticky user preferences, stored on the
/// [`ColorInputSettings`] resource. These preferences can be saved along with the
/// rest of the app's settings if the app adds the `SettingsPlugin` and triggers a
/// save, for example before exiting.
#[derive(SceneComponent, Default, Clone, Reflect)]
#[reflect(Component, Clone, Default)]
#[scene(FeathersColorInputProps)]
Expand Down
Loading