Skip to content
Merged
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
8 changes: 4 additions & 4 deletions editor/src/asset/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use crate::{
asset::{manager::ResourceManager, untyped::UntypedResource, Resource, TypedResourceData},
core::{
algebra::Vector2, color::Color, futures::executor::block_on, make_relative_path,
parking_lot::lock_api::Mutex, pool::Handle, reflect::prelude::*, visitor::prelude::*,
pool::Handle, reflect::prelude::*, visitor::prelude::*,
},
graph::SceneGraph,
gui::{
Expand Down Expand Up @@ -54,10 +54,10 @@ use fyrox::core::ok_or_return;
use fyrox::gui::border::Border;
use fyrox::gui::image::Image;
use fyrox::gui::message::MessageData;
use fyrox::gui::widget::UserData;
use std::{
ops::{Deref, DerefMut},
path::{Path, PathBuf},
sync::Arc,
};

pub const DEFAULT_SIZE: f32 = 60.0;
Expand All @@ -79,7 +79,7 @@ pub enum AssetItemMessage {
impl MessageData for AssetItemMessage {}

#[allow(dead_code)]
#[derive(Debug, Clone, Visit, Reflect)]
#[derive(Debug, Clone, Visit, PartialEq, Reflect)]
#[reflect(
derived_type = "UiNode",
type_uuid = "54f7d9c1-e707-4c8c-a5c9-3fc5cc80b545"
Expand Down Expand Up @@ -432,7 +432,7 @@ impl AssetItemBuilder {
let item = AssetItem {
widget: self
.widget_builder
.with_user_data(Arc::new(Mutex::new(self.path.clone())))
.with_user_data(UserData::new(self.path.clone()))
.with_margin(Thickness::uniform(1.0))
.with_allow_drag(true)
.with_allow_drop(true)
Expand Down
2 changes: 1 addition & 1 deletion editor/src/asset/menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ use std::{
path::PathBuf,
};

#[derive(Clone, Visit, Reflect, Debug)]
#[derive(Clone, Visit, PartialEq, Reflect, Debug)]
#[reflect(derived_type = "UiNode")]
#[reflect(type_uuid = "8c9934ad-b4e1-4c68-9876-f253e34c6667")]
struct AssetRenameDialog {
Expand Down
8 changes: 4 additions & 4 deletions editor/src/asset/selector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub enum AssetSelectorMessage {
impl MessageData for AssetSelectorMessage {}

#[derive(Clone, Debug, Reflect, Visit)]
#[reflect(type_uuid = "aa4f0726-8d25-4c90-add1-92ba392310c6")]
#[reflect(type_uuid = "aa4f0726-8d25-4c90-add1-92ba392310c6", non_comparable)]
struct Item {
pub widget: Widget,
image: Handle<Image>,
Expand Down Expand Up @@ -229,7 +229,7 @@ impl ItemBuilder {
}
}

#[derive(Clone, Debug, Reflect, Visit)]
#[derive(Clone, Debug, PartialEq, Reflect, Visit)]
#[reflect(type_uuid = "970bb83b-51e8-48e7-8050-f97bf0ac470b")]
pub struct AssetSelector {
pub widget: Widget,
Expand Down Expand Up @@ -387,7 +387,7 @@ impl<'a> AssetSelectorBuilder<'a> {
}
}

#[derive(Clone, Debug, Reflect, Visit)]
#[derive(Clone, Debug, PartialEq, Reflect, Visit)]
#[reflect(type_uuid = "c348ad3d-52a6-40ad-a5e4-bf63fefe1906")]
pub struct AssetSelectorWindow {
pub window: Window,
Expand Down Expand Up @@ -591,7 +591,7 @@ impl<'a> AssetSelectorWindowBuilder<'a> {
}

#[derive(Reflect, Visit, Debug)]
#[reflect(type_uuid = "7839eb64-1e6e-4e40-a8fb-53c9d0945b16")]
#[reflect(type_uuid = "7839eb64-1e6e-4e40-a8fb-53c9d0945b16", non_comparable)]
pub struct AssetSelectorMixin<T: TypedResourceData> {
pub selector: Cell<Handle<AssetSelectorWindow>>,
pub select: Handle<Button>,
Expand Down
2 changes: 1 addition & 1 deletion editor/src/audio/bus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub enum AudioBusViewMessage {
}
impl MessageData for AudioBusViewMessage {}

#[derive(Clone, Visit, Reflect, Debug)]
#[derive(Clone, Visit, PartialEq, Reflect, Debug)]
#[reflect(
derived_type = "UiNode",
type_uuid = "5439e3a9-096a-4155-922c-ed57a76a46f3"
Expand Down
2 changes: 1 addition & 1 deletion editor/src/interaction/gizmo/move_gizmo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ use fyrox::scene::camera::Camera;
use fyrox::scene::mesh::Mesh;
use fyrox::scene::pivot::Pivot;

#[derive(Reflect, Debug, Clone)]
#[derive(PartialEq, Reflect, Debug, Clone)]
#[reflect(type_uuid = "060abe31-ce96-4696-aa5d-e44e9639df0e")]
pub struct MoveGizmo {
pub origin: Handle<Pivot>,
Expand Down
4 changes: 2 additions & 2 deletions editor/src/interaction/gizmo/rotate_gizmo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ use fyrox::scene::camera::Camera;
use fyrox::scene::mesh::Mesh;
use fyrox::scene::pivot::Pivot;

#[derive(Reflect, Debug)]
#[derive(PartialEq, Reflect, Debug)]
#[reflect(non_cloneable, type_uuid = "5ef2c27b-18af-458d-9549-1395f0869551")]
pub enum RotateGizmoMode {
Pitch,
Yaw,
Roll,
}

#[derive(Reflect, Debug)]
#[derive(PartialEq, Reflect, Debug)]
#[reflect(non_cloneable, type_uuid = "36fc1ea4-33cd-4108-ae61-bab544f8ac02")]
pub struct RotationGizmo {
mode: RotateGizmoMode,
Expand Down
4 changes: 2 additions & 2 deletions editor/src/interaction/gizmo/scale_gizmo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ use fyrox::core::reflect::prelude::*;
use fyrox::scene::camera::Camera;
use fyrox::scene::mesh::Mesh;

#[derive(Reflect, Debug)]
#[derive(PartialEq, Reflect, Debug)]
#[reflect(non_cloneable, type_uuid = "0555e074-bbd8-4753-a2ab-56d7092251c1")]
pub enum ScaleGizmoMode {
None,
Expand All @@ -59,7 +59,7 @@ pub enum ScaleGizmoMode {
Uniform,
}

#[derive(Reflect, Debug)]
#[derive(PartialEq, Reflect, Debug)]
#[reflect(non_cloneable, type_uuid = "c8827bb2-1aac-41e7-b2c1-ba04e0dc59e0")]
pub struct ScaleGizmo {
mode: ScaleGizmoMode,
Expand Down
6 changes: 3 additions & 3 deletions editor/src/interaction/move_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ use crate::{
use fyrox::core::some_or_return;
use fyrox::gui::button::Button;

#[derive(Reflect, Debug, Clone)]
#[derive(PartialEq, Reflect, Debug, Clone)]
#[reflect(type_uuid = "067c67e2-865b-4112-8d60-133ee1e1883a")]
struct Entry {
node: Handle<Node>,
Expand All @@ -62,7 +62,7 @@ struct Entry {
new_local_position: Vector3<f32>,
}

#[derive(Reflect, Debug, Clone)]
#[derive(PartialEq, Reflect, Debug, Clone)]
#[reflect(type_uuid = "f50af953-308e-40e8-85ae-48c905ba5f46")]
struct MoveContext {
#[reflect(hidden)]
Expand Down Expand Up @@ -280,7 +280,7 @@ impl MoveContext {
}
}

#[derive(Reflect, Debug, Clone)]
#[derive(PartialEq, Reflect, Debug, Clone)]
#[reflect(type_uuid = "067c67e2-865b-4112-8d60-133ee1e1883a")]
pub struct MoveInteractionMode {
move_context: Option<MoveContext>,
Expand Down
4 changes: 2 additions & 2 deletions editor/src/interaction/navmesh/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ impl NavmeshPanel {
}
}

#[derive(Reflect, Debug)]
#[derive(PartialEq, Reflect, Debug)]
#[reflect(
non_cloneable,
type_uuid = "986eb5f1-5f17-4373-bffb-1e213e7c97e5",
Expand All @@ -220,7 +220,7 @@ impl DragContext {
}
}

#[derive(Reflect, Debug)]
#[derive(PartialEq, Reflect, Debug)]
#[reflect(non_cloneable, type_uuid = "a8ed875d-0932-400d-b5b0-e0dcfb78c6c1")]
pub struct EditNavmeshMode {
move_gizmo: MoveGizmo,
Expand Down
2 changes: 1 addition & 1 deletion editor/src/interaction/plane.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use crate::fyrox::core::{algebra::Vector3, math::plane::Plane, num_traits::Zero}
use fyrox::core::reflect::prelude::*;
use strum_macros::EnumIter;

#[derive(Copy, Clone, Debug, EnumIter, Reflect)]
#[derive(Copy, Clone, PartialEq, Debug, EnumIter, Reflect)]
#[reflect(type_uuid = "f50af953-308e-40e8-85ae-48c905ba5f46")]
pub enum PlaneKind {
X,
Expand Down
2 changes: 1 addition & 1 deletion editor/src/interaction/rotate_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ use crate::{
};
use fyrox::gui::button::Button;

#[derive(Reflect, Debug)]
#[derive(PartialEq, Reflect, Debug)]
#[reflect(non_cloneable, type_uuid = "37f20364-feb5-4731-8c19-c3df922818d6")]
pub struct RotateInteractionMode {
initial_rotations: Vec<UnitQuaternion<f32>>,
Expand Down
2 changes: 1 addition & 1 deletion editor/src/interaction/scale_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ use crate::{
};
use fyrox::gui::button::Button;

#[derive(Reflect, Debug)]
#[derive(PartialEq, Reflect, Debug)]
#[reflect(non_cloneable, type_uuid = "64b4da1a-5d0f-49e1-9f48-011165cd1ec5")]
pub struct ScaleInteractionMode {
initial_scales: Vec<Vector3<f32>>,
Expand Down
2 changes: 1 addition & 1 deletion editor/src/interaction/select_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ use fyrox::gui::button::Button;
use fyrox::gui::image::Image;
use fyrox::gui::widget::WidgetMessage;

#[derive(Reflect, Debug)]
#[derive(PartialEq, Reflect, Debug)]
#[reflect(non_cloneable, type_uuid = "bab9ce8c-d679-4c49-beb9-f5a8482e0678")]
pub struct SelectInteractionMode {
preview: Handle<Image>,
Expand Down
4 changes: 3 additions & 1 deletion editor/src/interaction/terrain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ fn handle_undo_chunks(undo_chunks: UndoData, sender: &MessageSender) {
}
}

#[derive(Reflect)]
#[derive(PartialEq, Reflect)]
#[reflect(
non_cloneable,
type_uuid = "bc19eff3-3e3a-49c0-9a9d-17d36fccc34e",
Expand Down Expand Up @@ -243,6 +243,7 @@ impl TerrainInteractionMode {
}
}

#[derive(PartialEq)]
pub struct BrushGizmo {
brush: Handle<Mesh>,
}
Expand Down Expand Up @@ -558,6 +559,7 @@ impl InteractionMode for TerrainInteractionMode {
}
}

#[derive(PartialEq)]
struct BrushPanel {
window: Handle<Window>,
inspector: Handle<Inspector>,
Expand Down
2 changes: 1 addition & 1 deletion editor/src/light.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ use std::{
},
};

#[derive(Reflect, Clone, Debug)]
#[derive(PartialEq, Reflect, Clone, Debug)]
#[reflect(type_uuid = "86eed637-0d96-4ad2-9566-a451f0b00237")]
struct LightmapperSettings {
/// Name of the property in a material that will be modified in all materials for all surfaces
Expand Down
5 changes: 2 additions & 3 deletions editor/src/menu/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,12 @@ use crate::{
settings::{recent::RecentFiles, Settings},
Engine, Message, Mode, Panels, SaveSceneConfirmationDialogAction,
};
use fyrox::core::parking_lot::Mutex;
use fyrox::core::uuid::{uuid, Uuid};
use fyrox::graph::SceneGraph;
use fyrox::gui::file_browser::FileSelector;
use fyrox::gui::menu::MenuItem;
use fyrox::gui::messagebox::MessageBox;
use std::sync::Arc;
use fyrox::gui::widget::UserData;
use std::{path::PathBuf, sync::mpsc::Sender};

pub struct FileMenu {
Expand Down Expand Up @@ -82,7 +81,7 @@ fn make_recent_files_items(
.iter()
.map(|f| {
let item = create_menu_item(f.to_string_lossy().as_ref(), Uuid::new_v4(), vec![], ctx);
ctx[item].user_data = Some(Arc::new(Mutex::new(RecentFile(f.to_path_buf()))));
ctx[item].user_data = Some(UserData::new(RecentFile(f.to_path_buf())));
item
})
.collect::<Vec<_>>()
Expand Down
6 changes: 6 additions & 0 deletions editor/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ pub enum Message {
#[reflect(hide_all, type_uuid = "86eed637-0d96-4ad2-9566-a451f0b00237")]
pub struct MessageSender(pub Sender<Message>);

impl PartialEq for MessageSender {
fn eq(&self, _other: &Self) -> bool {
true
}
}

impl Default for MessageSender {
fn default() -> Self {
let (rx, _) = channel();
Expand Down
8 changes: 4 additions & 4 deletions editor/src/plugins/absm/blendspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl MessageData for BlendSpaceFieldMessage {
}
}

#[derive(Clone, Visit, Reflect, Debug)]
#[derive(Clone, Visit, PartialEq, Reflect, Debug)]
#[reflect(type_uuid = "5cdb0ab3-b6fd-41c3-a6c4-d1178346eb81")]
struct ContextMenu {
#[visit(skip)]
Expand All @@ -101,13 +101,13 @@ struct ContextMenu {
remove_point: Handle<MenuItem>,
}

#[derive(Clone)]
#[derive(PartialEq, Clone)]
enum DragContext {
SamplingPoint,
Point { point: usize },
}

#[derive(Clone, Visit, Reflect)]
#[derive(Clone, Visit, PartialEq, Reflect)]
#[reflect(
derived_type = "UiNode",
type_uuid = "854a7c2d-3ccd-4331-95e1-956a3a035bd0"
Expand Down Expand Up @@ -557,7 +557,7 @@ pub enum BlendSpaceFieldPointMessage {
}
impl MessageData for BlendSpaceFieldPointMessage {}

#[derive(Clone, Visit, Reflect, Debug)]
#[derive(Clone, Visit, PartialEq, Reflect, Debug)]
#[reflect(
derived_type = "UiNode",
type_uuid = "22c215c1-ff23-4a64-9aa7-640b5014a78b"
Expand Down
2 changes: 1 addition & 1 deletion editor/src/plugins/absm/canvas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl MessageData for AbsmCanvasMessage {
}
}

#[derive(Clone, Visit, Reflect, Debug)]
#[derive(Clone, Visit, PartialEq, Reflect, Debug)]
#[reflect(
derived_type = "UiNode",
type_uuid = "100b1c33-d017-4fe6-95e7-e1daf310ef27"
Expand Down
2 changes: 1 addition & 1 deletion editor/src/plugins/absm/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ use fyrox::material::MaterialResource;
const PICKED_BRUSH: Brush = Brush::Solid(Color::opaque(100, 100, 100));
const NORMAL_BRUSH: Brush = Brush::Solid(Color::opaque(80, 80, 80));

#[derive(Debug, Clone, Visit, Reflect)]
#[derive(Debug, Clone, Visit, PartialEq, Reflect)]
#[reflect(
derived_type = "UiNode",
type_uuid = "c802b6fa-a5ef-4464-a097-749c731ffde0"
Expand Down
5 changes: 3 additions & 2 deletions editor/src/plugins/absm/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ use std::{
ops::{Deref, DerefMut},
};

#[derive(Clone, Debug, Visit, Reflect)]
#[derive(Clone, Debug, Visit, PartialEq, Reflect)]
#[reflect(type_uuid = "1a5d0042-3607-4fcb-88c6-025a0bce6111")]
pub struct AbsmBaseNode {
pub input_sockets: Vec<Handle<Socket>>,
Expand All @@ -58,7 +58,8 @@ pub struct AbsmBaseNode {
#[derive(Visit, Reflect)]
#[reflect(
derived_type = "UiNode",
type_uuid = "15bc1a7e-a385-46e0-a65c-7e9c014b4a1d"
type_uuid = "15bc1a7e-a385-46e0-a65c-7e9c014b4a1d",
non_comparable
)]
pub struct AbsmNode<T>
where
Expand Down
2 changes: 1 addition & 1 deletion editor/src/plugins/absm/segment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub enum SegmentMessage {
}
impl MessageData for SegmentMessage {}

#[derive(Debug, Clone, Reflect, Visit)]
#[derive(Debug, Clone, Reflect, PartialEq, Visit)]
#[reflect(type_uuid = "fda5a731-e927-40e5-9d96-e19104fbb63e")]
pub struct Segment {
pub source: Handle<UiNode>,
Expand Down
2 changes: 1 addition & 1 deletion editor/src/plugins/absm/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub enum SocketDirection {
Output,
}

#[derive(Clone, Debug, Visit, Reflect)]
#[derive(Clone, Debug, Visit, PartialEq, Reflect)]
#[reflect(
derived_type = "UiNode",
type_uuid = "a6c0473e-7073-4e91-a681-cf88795af52a"
Expand Down
2 changes: 1 addition & 1 deletion editor/src/plugins/absm/transition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub enum TransitionMessage {
}
impl MessageData for TransitionMessage {}

#[derive(Clone, Debug, Visit, Reflect)]
#[derive(Clone, Debug, Visit, PartialEq, Reflect)]
#[reflect(
derived_type = "UiNode",
type_uuid = "01798aee-8fe5-4480-a69d-8e5b95c3cc96"
Expand Down
Loading
Loading