mirror of
https://github.com/FyroxEngine/Fyrox.git
synced 2026-10-12 02:02:20 +00:00
merged TypeUuidProvider trait into Reflect
This commit is contained in:
@@ -24,7 +24,7 @@ use crate::{
|
||||
manager::ResourceManager,
|
||||
untyped::{ResourceKind, UntypedResource},
|
||||
},
|
||||
core::{log::Log, make_pretty_type_name, pool::Handle, SafeLock, Uuid},
|
||||
core::{log::Log, make_pretty_type_name, pool::Handle, SafeLock},
|
||||
engine::Engine,
|
||||
gui::{
|
||||
button::{ButtonBuilder, ButtonMessage},
|
||||
@@ -43,6 +43,7 @@ use crate::{
|
||||
message::MessageSender,
|
||||
Message,
|
||||
};
|
||||
use fyrox::core::uuid::Uuid;
|
||||
use fyrox::gui::button::Button;
|
||||
use fyrox::gui::list_view::ListView;
|
||||
use fyrox::gui::text_box::TextBox;
|
||||
|
||||
@@ -26,8 +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::*, uuid_provider,
|
||||
visitor::prelude::*,
|
||||
parking_lot::lock_api::Mutex, pool::Handle, reflect::prelude::*, visitor::prelude::*,
|
||||
},
|
||||
graph::SceneGraph,
|
||||
gui::{
|
||||
@@ -81,7 +80,10 @@ impl MessageData for AssetItemMessage {}
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[derive(Debug, Clone, Visit, Reflect)]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "54f7d9c1-e707-4c8c-a5c9-3fc5cc80b545"
|
||||
)]
|
||||
pub struct AssetItem {
|
||||
widget: Widget,
|
||||
pub path: PathBuf,
|
||||
@@ -254,8 +256,6 @@ impl DerefMut for AssetItem {
|
||||
}
|
||||
}
|
||||
|
||||
uuid_provider!(AssetItem = "54f7d9c1-e707-4c8c-a5c9-3fc5cc80b545");
|
||||
|
||||
impl Control for AssetItem {
|
||||
fn draw(&self, drawing_context: &mut DrawingContext) {
|
||||
drawing_context.push_rect_filled(&self.bounding_rect(), None);
|
||||
|
||||
@@ -24,8 +24,7 @@ use crate::{
|
||||
asset::manager::ResourceManager,
|
||||
core::{
|
||||
futures::executor::block_on, log::Log, ok_or_return, pool::Handle,
|
||||
pool::HandlesVecExtension, reflect::prelude::*, type_traits::prelude::*,
|
||||
visitor::prelude::*, SafeLock,
|
||||
pool::HandlesVecExtension, reflect::prelude::*, visitor::prelude::*, SafeLock,
|
||||
},
|
||||
engine::Engine,
|
||||
graph::SceneGraph,
|
||||
@@ -62,9 +61,9 @@ use std::{
|
||||
path::PathBuf,
|
||||
};
|
||||
|
||||
#[derive(Clone, Visit, Reflect, Debug, TypeUuidProvider)]
|
||||
#[derive(Clone, Visit, Reflect, Debug)]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
#[type_uuid(id = "8c9934ad-b4e1-4c68-9876-f253e34c6667")]
|
||||
#[reflect(type_uuid = "8c9934ad-b4e1-4c68-9876-f253e34c6667")]
|
||||
struct AssetRenameDialog {
|
||||
window: Window,
|
||||
name_field: Handle<TextBox>,
|
||||
@@ -437,18 +436,18 @@ impl AssetItemContextMenu {
|
||||
let loaders = engine.resource_manager.state().loaders.clone();
|
||||
let loaders = loaders.lock();
|
||||
|
||||
if let Some(loader) =
|
||||
loaders.loader_for_data_type(data.type_uuid())
|
||||
{
|
||||
if let Some(loader) = loaders.loader_for_data_type(
|
||||
data.inner_ref().type_info_ref().type_uuid,
|
||||
) {
|
||||
if let Some(extension) = loader.extensions().first() {
|
||||
if data.can_be_saved() {
|
||||
if data.inner_ref().can_be_saved() {
|
||||
let final_copy_path = asset::make_unique_path(
|
||||
®istry_path,
|
||||
path.to_str().unwrap(),
|
||||
extension,
|
||||
);
|
||||
drop(loaders);
|
||||
if data.save(&final_copy_path).is_ok() {
|
||||
if data.inner_mut().save(&final_copy_path).is_ok() {
|
||||
engine
|
||||
.resource_manager
|
||||
.request_untyped(&final_copy_path);
|
||||
|
||||
@@ -25,7 +25,7 @@ use crate::{
|
||||
},
|
||||
fyrox::{
|
||||
asset::untyped::UntypedResource,
|
||||
core::{futures::executor::block_on, parking_lot::Mutex, pool::Handle, SafeLock, Uuid},
|
||||
core::{futures::executor::block_on, parking_lot::Mutex, pool::Handle, SafeLock},
|
||||
engine::Engine,
|
||||
fxhash::FxHashMap,
|
||||
gui::UiNode,
|
||||
@@ -33,6 +33,7 @@ use crate::{
|
||||
load_image,
|
||||
};
|
||||
use fyrox::core::pool::ObjectOrVariant;
|
||||
use fyrox::core::uuid::Uuid;
|
||||
use std::{
|
||||
collections::VecDeque,
|
||||
sync::{mpsc::Receiver, Arc},
|
||||
|
||||
@@ -29,7 +29,6 @@ use crate::{
|
||||
color::Color,
|
||||
pool::Handle,
|
||||
uuid::Uuid,
|
||||
TypeUuidProvider,
|
||||
},
|
||||
engine::{Engine, GraphicsContext},
|
||||
fxhash::FxHashMap,
|
||||
@@ -63,6 +62,7 @@ use crate::{
|
||||
},
|
||||
load_image,
|
||||
};
|
||||
use fyrox::core::reflect::prelude::*;
|
||||
use fyrox::renderer::ui_renderer::UiRenderInfo;
|
||||
use image::{ColorType, GenericImage, Rgba};
|
||||
|
||||
@@ -74,16 +74,16 @@ pub struct AssetPreviewGeneratorsCollection {
|
||||
impl AssetPreviewGeneratorsCollection {
|
||||
pub fn new() -> Self {
|
||||
let mut this = Self::default();
|
||||
this.add(Texture::type_uuid(), TexturePreview);
|
||||
this.add(Model::type_uuid(), ModelPreview);
|
||||
this.add(SoundBuffer::type_uuid(), SoundPreview);
|
||||
this.add(Shader::type_uuid(), ShaderPreview);
|
||||
this.add(Material::type_uuid(), MaterialPreview);
|
||||
this.add(HrirSphereResourceData::type_uuid(), HrirPreview);
|
||||
this.add(CurveResourceState::type_uuid(), CurvePreview);
|
||||
this.add(Font::type_uuid(), FontPreview);
|
||||
this.add(UserInterface::type_uuid(), UserInterfacePreview);
|
||||
this.add(SurfaceData::type_uuid(), SurfaceDataPreview);
|
||||
this.add(Texture::type_info().type_uuid, TexturePreview);
|
||||
this.add(Model::type_info().type_uuid, ModelPreview);
|
||||
this.add(SoundBuffer::type_info().type_uuid, SoundPreview);
|
||||
this.add(Shader::type_info().type_uuid, ShaderPreview);
|
||||
this.add(Material::type_info().type_uuid, MaterialPreview);
|
||||
this.add(HrirSphereResourceData::type_info().type_uuid, HrirPreview);
|
||||
this.add(CurveResourceState::type_info().type_uuid, CurvePreview);
|
||||
this.add(Font::type_info().type_uuid, FontPreview);
|
||||
this.add(UserInterface::type_info().type_uuid, UserInterfacePreview);
|
||||
this.add(SurfaceData::type_info().type_uuid, SurfaceDataPreview);
|
||||
this
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ impl SaveResourceCommand {
|
||||
fn save(&self) {
|
||||
let mut guard = self.resource.lock();
|
||||
if let Some(data) = guard.state.data_mut() {
|
||||
Log::verify(data.save(&self.path));
|
||||
Log::verify(data.inner_mut().save(&self.path));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -218,7 +218,7 @@ impl SelectionContainer for AssetSelection {
|
||||
if !self.resource_manager.is_built_in_resource(&resource) {
|
||||
if let Some(command) = make_command(args, move |_| {
|
||||
let mut guard = resource.lock();
|
||||
let data = &mut **guard.state.data_mut()?;
|
||||
let data = guard.state.data_mut()?.inner_mut();
|
||||
// SAFETY: This is safe, because the closure owns its own copy of
|
||||
// resource strong ref, and the entity getter is used only once per
|
||||
// do/undo/redo calls.
|
||||
@@ -277,7 +277,7 @@ impl SelectionContainer for AssetSelection {
|
||||
value,
|
||||
move |_| {
|
||||
let mut guard = resource.lock();
|
||||
let data = &mut **guard.state.data_mut()?;
|
||||
let data = guard.state.data_mut()?.inner_mut();
|
||||
// SAFETY: This is safe, because the closure owns its own copy of
|
||||
// resource strong ref, and the entity getter is used only once per
|
||||
// do/undo/redo calls.
|
||||
|
||||
@@ -31,7 +31,6 @@ use crate::{
|
||||
pool::{Handle, HandlesVecExtension},
|
||||
reflect::prelude::*,
|
||||
some_or_continue,
|
||||
type_traits::prelude::*,
|
||||
visitor::prelude::*,
|
||||
PhantomDataSendSync, SafeLock,
|
||||
},
|
||||
@@ -79,8 +78,8 @@ pub enum AssetSelectorMessage {
|
||||
}
|
||||
impl MessageData for AssetSelectorMessage {}
|
||||
|
||||
#[derive(Clone, Debug, Reflect, Visit, TypeUuidProvider)]
|
||||
#[type_uuid(id = "aa4f0726-8d25-4c90-add1-92ba392310c6")]
|
||||
#[derive(Clone, Debug, Reflect, Visit)]
|
||||
#[reflect(type_uuid = "aa4f0726-8d25-4c90-add1-92ba392310c6")]
|
||||
struct Item {
|
||||
pub widget: Widget,
|
||||
image: Handle<Image>,
|
||||
@@ -230,8 +229,8 @@ impl ItemBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Reflect, Visit, TypeUuidProvider)]
|
||||
#[type_uuid(id = "970bb83b-51e8-48e7-8050-f97bf0ac470b")]
|
||||
#[derive(Clone, Debug, Reflect, Visit)]
|
||||
#[reflect(type_uuid = "970bb83b-51e8-48e7-8050-f97bf0ac470b")]
|
||||
pub struct AssetSelector {
|
||||
pub widget: Widget,
|
||||
list_view: Handle<ListView>,
|
||||
@@ -321,10 +320,14 @@ impl<'a> AssetSelectorBuilder<'a> {
|
||||
|
||||
supported_resource_paths.extend(state.built_in_resources.values().filter_map(|res| {
|
||||
let resource_state = res.resource.lock();
|
||||
if self
|
||||
.asset_types
|
||||
.contains(&resource_state.state.data_ref()?.type_uuid())
|
||||
{
|
||||
if self.asset_types.contains(
|
||||
&resource_state
|
||||
.state
|
||||
.data_ref()?
|
||||
.inner_ref()
|
||||
.type_info_ref()
|
||||
.type_uuid,
|
||||
) {
|
||||
Some(res.id.clone())
|
||||
} else {
|
||||
None
|
||||
@@ -384,8 +387,8 @@ impl<'a> AssetSelectorBuilder<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Reflect, Visit, TypeUuidProvider)]
|
||||
#[type_uuid(id = "c348ad3d-52a6-40ad-a5e4-bf63fefe1906")]
|
||||
#[derive(Clone, Debug, Reflect, Visit)]
|
||||
#[reflect(type_uuid = "c348ad3d-52a6-40ad-a5e4-bf63fefe1906")]
|
||||
pub struct AssetSelectorWindow {
|
||||
pub window: Window,
|
||||
selector: Handle<AssetSelector>,
|
||||
@@ -571,7 +574,7 @@ impl<'a> AssetSelectorWindowBuilder<'a> {
|
||||
.unwrap_or_default()
|
||||
.into(),
|
||||
)
|
||||
.with_asset_types(vec![<T as TypeUuidProvider>::type_uuid()])
|
||||
.with_asset_types(vec![<T as Reflect>::type_info().type_uuid])
|
||||
.build(icon_request_sender, resource_manager, &mut ui.build_ctx());
|
||||
|
||||
ui.send(
|
||||
@@ -588,6 +591,7 @@ impl<'a> AssetSelectorWindowBuilder<'a> {
|
||||
}
|
||||
|
||||
#[derive(Reflect, Visit, Debug)]
|
||||
#[reflect(type_uuid = "7839eb64-1e6e-4e40-a8fb-53c9d0945b16")]
|
||||
pub struct AssetSelectorMixin<T: TypedResourceData> {
|
||||
pub selector: Cell<Handle<AssetSelectorWindow>>,
|
||||
pub select: Handle<Button>,
|
||||
|
||||
+11
-16
@@ -19,30 +19,24 @@
|
||||
// SOFTWARE.
|
||||
|
||||
use crate::fyrox::{
|
||||
core::{pool::Handle, reflect::prelude::*, uuid_provider, visitor::prelude::*},
|
||||
core::{pool::Handle, reflect::prelude::*, visitor::prelude::*},
|
||||
gui::{
|
||||
border::BorderBuilder,
|
||||
decorator::DecoratorBuilder,
|
||||
define_widget_deref,
|
||||
dropdown_list::{DropdownListBuilder, DropdownListMessage},
|
||||
dropdown_list::{DropdownList, DropdownListBuilder, DropdownListMessage},
|
||||
grid::{Column, GridBuilder, Row},
|
||||
list_view::{ListViewBuilder, ListViewMessage},
|
||||
message::UiMessage,
|
||||
text::{TextBuilder, TextMessage},
|
||||
utils::make_simple_tooltip,
|
||||
list_view::{ListView, ListViewBuilder, ListViewMessage},
|
||||
message::{MessageData, UiMessage},
|
||||
style::{resource::StyleResourceExt, Style},
|
||||
text::{Text, TextBuilder, TextMessage},
|
||||
utils::{make_dropdown_list_option, make_simple_tooltip},
|
||||
widget::{Widget, WidgetBuilder},
|
||||
BuildContext, Control, HorizontalAlignment, Thickness, UiNode, UserInterface,
|
||||
VerticalAlignment,
|
||||
},
|
||||
scene::sound::{AudioBus, AudioBusGraph},
|
||||
};
|
||||
use fyrox::gui::dropdown_list::DropdownList;
|
||||
use fyrox::gui::list_view::ListView;
|
||||
use fyrox::gui::message::MessageData;
|
||||
use fyrox::gui::style::resource::StyleResourceExt;
|
||||
use fyrox::gui::style::Style;
|
||||
use fyrox::gui::text::Text;
|
||||
use fyrox::gui::utils::make_dropdown_list_option;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum AudioBusViewMessage {
|
||||
@@ -54,7 +48,10 @@ pub enum AudioBusViewMessage {
|
||||
impl MessageData for AudioBusViewMessage {}
|
||||
|
||||
#[derive(Clone, Visit, Reflect, Debug)]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "5439e3a9-096a-4155-922c-ed57a76a46f3"
|
||||
)]
|
||||
pub struct AudioBusView {
|
||||
widget: Widget,
|
||||
pub bus: Handle<AudioBus>,
|
||||
@@ -66,8 +63,6 @@ pub struct AudioBusView {
|
||||
|
||||
define_widget_deref!(AudioBusView);
|
||||
|
||||
uuid_provider!(AudioBusView = "5439e3a9-096a-4155-922c-ed57a76a46f3");
|
||||
|
||||
impl Control for AudioBusView {
|
||||
fn handle_routed_message(&mut self, ui: &mut UserInterface, message: &mut UiMessage) {
|
||||
self.widget.handle_routed_message(ui, message);
|
||||
|
||||
@@ -47,10 +47,13 @@ use crate::{
|
||||
settings::Settings,
|
||||
Engine,
|
||||
};
|
||||
use fyrox::core::reflect::prelude::*;
|
||||
use fyrox::scene::camera::Camera;
|
||||
use fyrox::scene::mesh::Mesh;
|
||||
use fyrox::scene::pivot::Pivot;
|
||||
|
||||
#[derive(Reflect, Debug, Clone)]
|
||||
#[reflect(type_uuid = "060abe31-ce96-4696-aa5d-e44e9639df0e")]
|
||||
pub struct MoveGizmo {
|
||||
pub origin: Handle<Pivot>,
|
||||
smart_dot: Handle<Mesh>,
|
||||
|
||||
@@ -46,16 +46,21 @@ use crate::{
|
||||
settings::Settings,
|
||||
Engine,
|
||||
};
|
||||
use fyrox::core::reflect::prelude::*;
|
||||
use fyrox::scene::camera::Camera;
|
||||
use fyrox::scene::mesh::Mesh;
|
||||
use fyrox::scene::pivot::Pivot;
|
||||
|
||||
#[derive(Reflect, Debug)]
|
||||
#[reflect(non_cloneable, type_uuid = "5ef2c27b-18af-458d-9549-1395f0869551")]
|
||||
pub enum RotateGizmoMode {
|
||||
Pitch,
|
||||
Yaw,
|
||||
Roll,
|
||||
}
|
||||
|
||||
#[derive(Reflect, Debug)]
|
||||
#[reflect(non_cloneable, type_uuid = "36fc1ea4-33cd-4108-ae61-bab544f8ac02")]
|
||||
pub struct RotationGizmo {
|
||||
mode: RotateGizmoMode,
|
||||
pub origin: Handle<Pivot>,
|
||||
|
||||
@@ -45,9 +45,12 @@ use crate::{
|
||||
settings::Settings,
|
||||
Engine,
|
||||
};
|
||||
use fyrox::core::reflect::prelude::*;
|
||||
use fyrox::scene::camera::Camera;
|
||||
use fyrox::scene::mesh::Mesh;
|
||||
|
||||
#[derive(Reflect, Debug)]
|
||||
#[reflect(non_cloneable, type_uuid = "0555e074-bbd8-4753-a2ab-56d7092251c1")]
|
||||
pub enum ScaleGizmoMode {
|
||||
None,
|
||||
X,
|
||||
@@ -56,6 +59,8 @@ pub enum ScaleGizmoMode {
|
||||
Uniform,
|
||||
}
|
||||
|
||||
#[derive(Reflect, Debug)]
|
||||
#[reflect(non_cloneable, type_uuid = "c8827bb2-1aac-41e7-b2c1-ba04e0dc59e0")]
|
||||
pub struct ScaleGizmo {
|
||||
mode: ScaleGizmoMode,
|
||||
pub origin: Handle<Mesh>,
|
||||
|
||||
@@ -23,8 +23,8 @@ use crate::{
|
||||
core::{
|
||||
algebra::{Vector2, Vector3},
|
||||
pool::Handle,
|
||||
reflect::prelude::*,
|
||||
uuid::Uuid,
|
||||
TypeUuidProvider,
|
||||
},
|
||||
gui::{
|
||||
border::BorderBuilder,
|
||||
@@ -62,7 +62,7 @@ pub mod terrain;
|
||||
|
||||
define_as_any_trait!(InteractionModeAsAny => InteractionMode);
|
||||
|
||||
pub trait InteractionMode: InteractionModeAsAny {
|
||||
pub trait InteractionMode: Reflect + InteractionModeAsAny {
|
||||
fn on_left_mouse_button_down(
|
||||
&mut self,
|
||||
editor_selection: &Selection,
|
||||
@@ -302,8 +302,8 @@ impl InteractionModeContainer {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn remove_typed<T: InteractionMode + TypeUuidProvider>(&mut self) -> Option<Box<T>> {
|
||||
self.remove(&T::type_uuid())
|
||||
pub fn remove_typed<T: InteractionMode>(&mut self) -> Option<Box<T>> {
|
||||
self.remove(&T::type_info().type_uuid)
|
||||
.and_then(|mode| mode.into_any().downcast::<T>().ok())
|
||||
}
|
||||
|
||||
@@ -325,13 +325,13 @@ impl InteractionModeContainer {
|
||||
.map(|mode| &mut **mode)
|
||||
}
|
||||
|
||||
pub fn of_type<T: InteractionMode + TypeUuidProvider>(&self) -> Option<&T> {
|
||||
self.get(&T::type_uuid())
|
||||
pub fn of_type<T: InteractionMode>(&self) -> Option<&T> {
|
||||
self.get(&T::type_info().type_uuid)
|
||||
.and_then(|mode| mode.as_any().downcast_ref())
|
||||
}
|
||||
|
||||
pub fn of_type_mut<T: InteractionMode + TypeUuidProvider>(&mut self) -> Option<&mut T> {
|
||||
self.get_mut(&T::type_uuid())
|
||||
pub fn of_type_mut<T: InteractionMode>(&mut self) -> Option<&mut T> {
|
||||
self.get_mut(&T::type_info().type_uuid)
|
||||
.and_then(|mode| mode.as_any_mut().downcast_mut())
|
||||
}
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@ use crate::{
|
||||
algebra::{Matrix4, Point3, Vector2, Vector3},
|
||||
math::plane::Plane,
|
||||
pool::Handle,
|
||||
reflect::prelude::*,
|
||||
uuid::{uuid, Uuid},
|
||||
TypeUuidProvider,
|
||||
},
|
||||
fxhash::FxHashSet,
|
||||
graph::SceneGraph,
|
||||
@@ -52,6 +52,8 @@ use crate::{
|
||||
use fyrox::core::some_or_return;
|
||||
use fyrox::gui::button::Button;
|
||||
|
||||
#[derive(Reflect, Debug, Clone)]
|
||||
#[reflect(type_uuid = "067c67e2-865b-4112-8d60-133ee1e1883a")]
|
||||
struct Entry {
|
||||
node: Handle<Node>,
|
||||
initial_offset_gizmo_space: Vector3<f32>,
|
||||
@@ -60,7 +62,10 @@ struct Entry {
|
||||
new_local_position: Vector3<f32>,
|
||||
}
|
||||
|
||||
#[derive(Reflect, Debug, Clone)]
|
||||
#[reflect(type_uuid = "f50af953-308e-40e8-85ae-48c905ba5f46")]
|
||||
struct MoveContext {
|
||||
#[reflect(hidden)]
|
||||
plane: Option<Plane>,
|
||||
objects: Vec<Entry>,
|
||||
plane_kind: PlaneKind,
|
||||
@@ -275,6 +280,8 @@ impl MoveContext {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Reflect, Debug, Clone)]
|
||||
#[reflect(type_uuid = "067c67e2-865b-4112-8d60-133ee1e1883a")]
|
||||
pub struct MoveInteractionMode {
|
||||
move_context: Option<MoveContext>,
|
||||
move_gizmo: MoveGizmo,
|
||||
@@ -291,12 +298,6 @@ impl MoveInteractionMode {
|
||||
}
|
||||
}
|
||||
|
||||
impl TypeUuidProvider for MoveInteractionMode {
|
||||
fn type_uuid() -> Uuid {
|
||||
uuid!("067c67e2-865b-4112-8d60-133ee1e1883a")
|
||||
}
|
||||
}
|
||||
|
||||
impl InteractionMode for MoveInteractionMode {
|
||||
fn on_left_mouse_button_down(
|
||||
&mut self,
|
||||
@@ -517,6 +518,6 @@ impl InteractionMode for MoveInteractionMode {
|
||||
}
|
||||
|
||||
fn uuid(&self) -> Uuid {
|
||||
Self::type_uuid()
|
||||
Self::type_info().type_uuid
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,8 +27,8 @@ use crate::{
|
||||
color::Color,
|
||||
math::{ray::CylinderKind, TriangleEdge},
|
||||
pool::Handle,
|
||||
reflect::prelude::*,
|
||||
uuid::{uuid, Uuid},
|
||||
TypeUuidProvider,
|
||||
},
|
||||
engine::Engine,
|
||||
graph::SceneGraph,
|
||||
@@ -198,6 +198,12 @@ impl NavmeshPanel {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Reflect, Debug)]
|
||||
#[reflect(
|
||||
non_cloneable,
|
||||
type_uuid = "986eb5f1-5f17-4373-bffb-1e213e7c97e5",
|
||||
hide_all
|
||||
)]
|
||||
enum DragContext {
|
||||
MoveSelection {
|
||||
initial_positions: HashMap<usize, Vector3<f32>>,
|
||||
@@ -214,9 +220,12 @@ impl DragContext {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Reflect, Debug)]
|
||||
#[reflect(non_cloneable, type_uuid = "a8ed875d-0932-400d-b5b0-e0dcfb78c6c1")]
|
||||
pub struct EditNavmeshMode {
|
||||
move_gizmo: MoveGizmo,
|
||||
message_sender: MessageSender,
|
||||
#[reflect(hidden)]
|
||||
drag_context: Option<DragContext>,
|
||||
plane_kind: PlaneKind,
|
||||
}
|
||||
@@ -232,12 +241,6 @@ impl EditNavmeshMode {
|
||||
}
|
||||
}
|
||||
|
||||
impl TypeUuidProvider for EditNavmeshMode {
|
||||
fn type_uuid() -> Uuid {
|
||||
uuid!("a8ed875d-0932-400d-b5b0-e0dcfb78c6c1")
|
||||
}
|
||||
}
|
||||
|
||||
impl InteractionMode for EditNavmeshMode {
|
||||
fn on_left_mouse_button_down(
|
||||
&mut self,
|
||||
@@ -693,6 +696,6 @@ impl InteractionMode for EditNavmeshMode {
|
||||
}
|
||||
|
||||
fn uuid(&self) -> Uuid {
|
||||
Self::type_uuid()
|
||||
Self::type_info().type_uuid
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,9 +19,11 @@
|
||||
// SOFTWARE.
|
||||
|
||||
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)]
|
||||
#[derive(Copy, Clone, Debug, EnumIter, Reflect)]
|
||||
#[reflect(type_uuid = "f50af953-308e-40e8-85ae-48c905ba5f46")]
|
||||
pub enum PlaneKind {
|
||||
X,
|
||||
Y,
|
||||
|
||||
@@ -26,9 +26,9 @@ use crate::{
|
||||
algebra::{UnitQuaternion, Vector2},
|
||||
math::round_to_step,
|
||||
pool::Handle,
|
||||
reflect::prelude::*,
|
||||
some_or_return,
|
||||
uuid::{uuid, Uuid},
|
||||
TypeUuidProvider,
|
||||
},
|
||||
gui::BuildContext,
|
||||
},
|
||||
@@ -47,6 +47,8 @@ use crate::{
|
||||
};
|
||||
use fyrox::gui::button::Button;
|
||||
|
||||
#[derive(Reflect, Debug)]
|
||||
#[reflect(non_cloneable, type_uuid = "37f20364-feb5-4731-8c19-c3df922818d6")]
|
||||
pub struct RotateInteractionMode {
|
||||
initial_rotations: Vec<UnitQuaternion<f32>>,
|
||||
rotation_gizmo: RotationGizmo,
|
||||
@@ -65,12 +67,6 @@ impl RotateInteractionMode {
|
||||
}
|
||||
}
|
||||
|
||||
impl TypeUuidProvider for RotateInteractionMode {
|
||||
fn type_uuid() -> Uuid {
|
||||
uuid!("37f20364-feb5-4731-8c19-c3df922818d6")
|
||||
}
|
||||
}
|
||||
|
||||
impl InteractionMode for RotateInteractionMode {
|
||||
fn on_left_mouse_button_down(
|
||||
&mut self,
|
||||
@@ -304,6 +300,6 @@ impl InteractionMode for RotateInteractionMode {
|
||||
}
|
||||
|
||||
fn uuid(&self) -> Uuid {
|
||||
Self::type_uuid()
|
||||
Self::type_info().type_uuid
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,9 +25,9 @@ use crate::{
|
||||
core::{
|
||||
algebra::{Vector2, Vector3},
|
||||
pool::Handle,
|
||||
reflect::prelude::*,
|
||||
some_or_return,
|
||||
uuid::{uuid, Uuid},
|
||||
TypeUuidProvider,
|
||||
},
|
||||
gui::BuildContext,
|
||||
},
|
||||
@@ -44,6 +44,8 @@ use crate::{
|
||||
};
|
||||
use fyrox::gui::button::Button;
|
||||
|
||||
#[derive(Reflect, Debug)]
|
||||
#[reflect(non_cloneable, type_uuid = "64b4da1a-5d0f-49e1-9f48-011165cd1ec5")]
|
||||
pub struct ScaleInteractionMode {
|
||||
initial_scales: Vec<Vector3<f32>>,
|
||||
scale_gizmo: ScaleGizmo,
|
||||
@@ -62,12 +64,6 @@ impl ScaleInteractionMode {
|
||||
}
|
||||
}
|
||||
|
||||
impl TypeUuidProvider for ScaleInteractionMode {
|
||||
fn type_uuid() -> Uuid {
|
||||
uuid!("64b4da1a-5d0f-49e1-9f48-011165cd1ec5")
|
||||
}
|
||||
}
|
||||
|
||||
impl InteractionMode for ScaleInteractionMode {
|
||||
fn on_left_mouse_button_down(
|
||||
&mut self,
|
||||
@@ -279,6 +275,6 @@ impl InteractionMode for ScaleInteractionMode {
|
||||
}
|
||||
|
||||
fn uuid(&self) -> Uuid {
|
||||
Self::type_uuid()
|
||||
Self::type_info().type_uuid
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ use crate::{
|
||||
core::{
|
||||
algebra::Vector2,
|
||||
pool::Handle,
|
||||
reflect::prelude::*,
|
||||
uuid::{uuid, Uuid},
|
||||
TypeUuidProvider,
|
||||
},
|
||||
gui::BuildContext,
|
||||
scene::node::Node,
|
||||
@@ -41,6 +41,8 @@ use fyrox::gui::button::Button;
|
||||
use fyrox::gui::image::Image;
|
||||
use fyrox::gui::widget::WidgetMessage;
|
||||
|
||||
#[derive(Reflect, Debug)]
|
||||
#[reflect(non_cloneable, type_uuid = "bab9ce8c-d679-4c49-beb9-f5a8482e0678")]
|
||||
pub struct SelectInteractionMode {
|
||||
preview: Handle<Image>,
|
||||
selection_frame: Handle<Border>,
|
||||
@@ -65,12 +67,6 @@ impl SelectInteractionMode {
|
||||
}
|
||||
}
|
||||
|
||||
impl TypeUuidProvider for SelectInteractionMode {
|
||||
fn type_uuid() -> Uuid {
|
||||
uuid!("bab9ce8c-d679-4c49-beb9-f5a8482e0678")
|
||||
}
|
||||
}
|
||||
|
||||
impl InteractionMode for SelectInteractionMode {
|
||||
fn on_left_mouse_button_down(
|
||||
&mut self,
|
||||
@@ -209,6 +205,6 @@ impl InteractionMode for SelectInteractionMode {
|
||||
}
|
||||
|
||||
fn uuid(&self) -> Uuid {
|
||||
Self::type_uuid()
|
||||
Self::type_info().type_uuid
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
// SOFTWARE.
|
||||
|
||||
use fyrox::scene::terrain::brushstroke::{BrushSender, BrushThreadMessage, UndoData};
|
||||
use std::fmt::{Debug, Formatter};
|
||||
|
||||
use crate::{
|
||||
fyrox::{
|
||||
@@ -29,8 +30,8 @@ use crate::{
|
||||
log::{Log, MessageKind},
|
||||
math::vector_to_quat,
|
||||
pool::Handle,
|
||||
reflect::prelude::*,
|
||||
uuid::{uuid, Uuid},
|
||||
TypeUuidProvider,
|
||||
},
|
||||
engine::Engine,
|
||||
graph::SceneGraph,
|
||||
@@ -105,6 +106,12 @@ fn handle_undo_chunks(undo_chunks: UndoData, sender: &MessageSender) {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Reflect)]
|
||||
#[reflect(
|
||||
non_cloneable,
|
||||
type_uuid = "bc19eff3-3e3a-49c0-9a9d-17d36fccc34e",
|
||||
hide_all
|
||||
)]
|
||||
pub struct TerrainInteractionMode {
|
||||
message_sender: MessageSender,
|
||||
brush_sender: Option<BrushSender>,
|
||||
@@ -118,6 +125,12 @@ pub struct TerrainInteractionMode {
|
||||
scene_viewer_frame: Handle<Image>,
|
||||
}
|
||||
|
||||
impl Debug for TerrainInteractionMode {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "TerrainInteractionMode")
|
||||
}
|
||||
}
|
||||
|
||||
impl TerrainInteractionMode {
|
||||
pub fn new(
|
||||
game_scene: &GameScene,
|
||||
@@ -263,12 +276,6 @@ impl BrushGizmo {
|
||||
}
|
||||
}
|
||||
|
||||
impl TypeUuidProvider for TerrainInteractionMode {
|
||||
fn type_uuid() -> Uuid {
|
||||
uuid!("bc19eff3-3e3a-49c0-9a9d-17d36fccc34e")
|
||||
}
|
||||
}
|
||||
|
||||
impl InteractionMode for TerrainInteractionMode {
|
||||
fn on_left_mouse_button_down(
|
||||
&mut self,
|
||||
@@ -547,7 +554,7 @@ impl InteractionMode for TerrainInteractionMode {
|
||||
}
|
||||
|
||||
fn uuid(&self) -> Uuid {
|
||||
Self::type_uuid()
|
||||
Self::type_info().type_uuid
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+14
-8
@@ -68,6 +68,7 @@ use crate::{
|
||||
export::ExportWindow,
|
||||
fyrox::{
|
||||
asset::{io::FsResourceIo, manager::ResourceManager, untyped::ResourceKind},
|
||||
core::info,
|
||||
core::{
|
||||
algebra::{Matrix3, Vector2},
|
||||
color::Color,
|
||||
@@ -75,12 +76,12 @@ use crate::{
|
||||
make_relative_path,
|
||||
parking_lot::Mutex,
|
||||
pool::Handle,
|
||||
reflect::prelude::*,
|
||||
task::TaskPool,
|
||||
uuid::Uuid,
|
||||
watcher::FileSystemWatcher,
|
||||
SafeLock, TypeUuidProvider,
|
||||
SafeLock,
|
||||
},
|
||||
core::{info, uuid},
|
||||
dpi::{PhysicalPosition, PhysicalSize},
|
||||
engine::GraphicsContext,
|
||||
engine::{
|
||||
@@ -183,6 +184,7 @@ use crate::{
|
||||
utils::doc::DocWindow,
|
||||
world::{graph::EditorSceneWrapper, menu::SceneNodeContextMenu, WorldViewer},
|
||||
};
|
||||
use fyrox::core::uuid::uuid;
|
||||
use fyrox_build_tools::{build::BuildWindow, CommandDescriptor};
|
||||
pub use message::Message;
|
||||
use plugins::inspector::InspectorPlugin;
|
||||
@@ -1228,23 +1230,27 @@ impl Editor {
|
||||
sender.send(Message::UndoCurrentSceneCommand);
|
||||
} else if hot_key == key_bindings.enable_select_mode {
|
||||
sender.send(Message::SetInteractionMode(
|
||||
SelectInteractionMode::type_uuid(),
|
||||
SelectInteractionMode::type_info().type_uuid,
|
||||
));
|
||||
} else if hot_key == key_bindings.enable_move_mode {
|
||||
sender.send(Message::SetInteractionMode(MoveInteractionMode::type_uuid()));
|
||||
sender.send(Message::SetInteractionMode(
|
||||
MoveInteractionMode::type_info().type_uuid,
|
||||
));
|
||||
} else if hot_key == key_bindings.enable_rotate_mode {
|
||||
sender.send(Message::SetInteractionMode(
|
||||
RotateInteractionMode::type_uuid(),
|
||||
RotateInteractionMode::type_info().type_uuid,
|
||||
));
|
||||
} else if hot_key == key_bindings.enable_scale_mode {
|
||||
sender.send(Message::SetInteractionMode(
|
||||
ScaleInteractionMode::type_uuid(),
|
||||
ScaleInteractionMode::type_info().type_uuid,
|
||||
));
|
||||
} else if hot_key == key_bindings.enable_navmesh_mode {
|
||||
sender.send(Message::SetInteractionMode(EditNavmeshMode::type_uuid()));
|
||||
sender.send(Message::SetInteractionMode(
|
||||
EditNavmeshMode::type_info().type_uuid,
|
||||
));
|
||||
} else if hot_key == key_bindings.enable_terrain_mode {
|
||||
sender.send(Message::SetInteractionMode(
|
||||
TerrainInteractionMode::type_uuid(),
|
||||
TerrainInteractionMode::type_info().type_uuid,
|
||||
));
|
||||
} else if hot_key == key_bindings.load_scene {
|
||||
sender.send(Message::OpenLoadSceneDialog);
|
||||
|
||||
@@ -56,6 +56,7 @@ use std::{
|
||||
};
|
||||
|
||||
#[derive(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
|
||||
/// that will receive the light map.
|
||||
|
||||
@@ -41,7 +41,7 @@ use crate::{
|
||||
Mode,
|
||||
};
|
||||
use fyrox::core::log::Log;
|
||||
use fyrox::core::{uuid, Uuid};
|
||||
use fyrox::core::uuid::{uuid, Uuid};
|
||||
use fyrox::graph::constructor::{VariantConstructor, VariantResult};
|
||||
use fyrox::gui::constructor::WidgetConstructorContainer;
|
||||
use fyrox::gui::menu::{MenuItem, SortingPredicate};
|
||||
|
||||
@@ -33,7 +33,7 @@ use crate::{
|
||||
scene::{commands::PasteCommand, GameScene, Selection},
|
||||
Engine, Message, Mode,
|
||||
};
|
||||
use fyrox::core::{uuid, Uuid};
|
||||
use fyrox::core::uuid::{uuid, Uuid};
|
||||
use fyrox::gui::menu;
|
||||
use fyrox::gui::menu::MenuItem;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ use crate::{
|
||||
export::ExportWindow,
|
||||
fyrox::{
|
||||
asset::manager::ResourceManager,
|
||||
core::{pool::Handle, uuid, Uuid},
|
||||
core::pool::Handle,
|
||||
gui::{
|
||||
file_browser::{FileSelectorBuilder, FileSelectorMessage, FileType, PathFilter},
|
||||
menu::{self, MenuItemMessage},
|
||||
@@ -42,6 +42,7 @@ use crate::{
|
||||
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;
|
||||
|
||||
@@ -23,7 +23,7 @@ use crate::fyrox::{
|
||||
gui::{menu::MenuItemMessage, message::UiMessage, BuildContext},
|
||||
};
|
||||
use crate::menu::{create_menu_item, create_root_menu_item};
|
||||
use fyrox::core::{uuid, Uuid};
|
||||
use fyrox::core::uuid::{uuid, Uuid};
|
||||
use fyrox::gui::menu::MenuItem;
|
||||
|
||||
pub struct HelpMenu {
|
||||
|
||||
@@ -41,7 +41,7 @@ use crate::{
|
||||
Engine, Mode, SceneSettingsWindow,
|
||||
};
|
||||
use fyrox::asset::manager::ResourceManager;
|
||||
use fyrox::core::Uuid;
|
||||
use fyrox::core::uuid::Uuid;
|
||||
use fyrox::gui::file_browser::FileType;
|
||||
use fyrox::gui::image::{Image, ImageBuilder};
|
||||
use fyrox::gui::menu::MenuItem;
|
||||
|
||||
@@ -33,7 +33,7 @@ use crate::{
|
||||
scene::Selection,
|
||||
ui_scene::{commands::graph::AddWidgetCommand, UiScene},
|
||||
};
|
||||
use fyrox::core::{uuid, Uuid};
|
||||
use fyrox::core::uuid::{uuid, Uuid};
|
||||
use fyrox::gui::menu::{MenuItem, SortingPredicate};
|
||||
|
||||
pub struct UiMenu {
|
||||
|
||||
@@ -26,7 +26,7 @@ use crate::{
|
||||
menu::{create_menu_item, create_root_menu_item, Panels},
|
||||
stats::StatisticsWindow,
|
||||
};
|
||||
use fyrox::core::{uuid, Uuid};
|
||||
use fyrox::core::uuid::{uuid, Uuid};
|
||||
use fyrox::gui::menu::MenuItem;
|
||||
|
||||
pub struct UtilsMenu {
|
||||
|
||||
@@ -32,7 +32,7 @@ use crate::{
|
||||
message::MessageSender,
|
||||
Message,
|
||||
};
|
||||
use fyrox::core::{uuid, Uuid};
|
||||
use fyrox::core::uuid::{uuid, Uuid};
|
||||
use fyrox::gui::menu::MenuItem;
|
||||
use fyrox::gui::window::{Window, WindowAlignment};
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ pub enum Message {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Reflect)]
|
||||
#[reflect(hide_all)]
|
||||
#[reflect(hide_all, type_uuid = "86eed637-0d96-4ad2-9566-a451f0b00237")]
|
||||
pub struct MessageSender(pub Sender<Message>);
|
||||
|
||||
impl Default for MessageSender {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
use crate::{
|
||||
fyrox::{
|
||||
asset::untyped::ResourceKind,
|
||||
core::{algebra::Matrix4, math::Matrix4Ext, pool::Handle, sstorage::ImmutableString, Uuid},
|
||||
core::{algebra::Matrix4, math::Matrix4Ext, pool::Handle, sstorage::ImmutableString},
|
||||
graphics::{
|
||||
buffer::BufferUsage, error::FrameworkError, geometry_buffer::GpuGeometryBuffer,
|
||||
server::GraphicsServer,
|
||||
@@ -41,6 +41,7 @@ use crate::{
|
||||
},
|
||||
Editor,
|
||||
};
|
||||
use fyrox::core::uuid::Uuid;
|
||||
use std::{any::TypeId, cell::RefCell, rc::Rc};
|
||||
|
||||
pub struct OverlayRenderPass {
|
||||
|
||||
@@ -25,8 +25,6 @@ use crate::fyrox::{
|
||||
math::{Rect, TriangleDefinition},
|
||||
pool::Handle,
|
||||
reflect::prelude::*,
|
||||
type_traits::prelude::*,
|
||||
uuid_provider,
|
||||
visitor::prelude::*,
|
||||
},
|
||||
generic_animation::machine::{
|
||||
@@ -92,6 +90,7 @@ impl MessageData for BlendSpaceFieldMessage {
|
||||
}
|
||||
|
||||
#[derive(Clone, Visit, Reflect, Debug)]
|
||||
#[reflect(type_uuid = "5cdb0ab3-b6fd-41c3-a6c4-d1178346eb81")]
|
||||
struct ContextMenu {
|
||||
#[visit(skip)]
|
||||
#[reflect(hidden)]
|
||||
@@ -109,7 +108,10 @@ enum DragContext {
|
||||
}
|
||||
|
||||
#[derive(Clone, Visit, Reflect)]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "854a7c2d-3ccd-4331-95e1-956a3a035bd0"
|
||||
)]
|
||||
struct BlendSpaceField {
|
||||
widget: Widget,
|
||||
points: Vec<Handle<BlendSpaceFieldPoint>>,
|
||||
@@ -180,8 +182,6 @@ fn make_points<P: Iterator<Item = Vector2<f32>>>(
|
||||
.collect()
|
||||
}
|
||||
|
||||
uuid_provider!(BlendSpaceField = "854a7c2d-3ccd-4331-95e1-956a3a035bd0");
|
||||
|
||||
impl Control for BlendSpaceField {
|
||||
fn measure_override(&self, ui: &UserInterface, _available_size: Vector2<f32>) -> Vector2<f32> {
|
||||
let size_for_child = Vector2::new(f32::INFINITY, f32::INFINITY);
|
||||
@@ -558,7 +558,10 @@ pub enum BlendSpaceFieldPointMessage {
|
||||
impl MessageData for BlendSpaceFieldPointMessage {}
|
||||
|
||||
#[derive(Clone, Visit, Reflect, Debug)]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "22c215c1-ff23-4a64-9aa7-640b5014a78b"
|
||||
)]
|
||||
struct BlendSpaceFieldPoint {
|
||||
widget: Widget,
|
||||
selected: bool,
|
||||
@@ -566,8 +569,6 @@ struct BlendSpaceFieldPoint {
|
||||
|
||||
define_widget_deref!(BlendSpaceFieldPoint);
|
||||
|
||||
uuid_provider!(BlendSpaceFieldPoint = "22c215c1-ff23-4a64-9aa7-640b5014a78b");
|
||||
|
||||
impl Control for BlendSpaceFieldPoint {
|
||||
fn draw(&self, drawing_context: &mut DrawingContext) {
|
||||
drawing_context.push_circle_filled(
|
||||
|
||||
@@ -25,7 +25,6 @@ use crate::fyrox::{
|
||||
math::Rect,
|
||||
pool::Handle,
|
||||
reflect::prelude::*,
|
||||
uuid_provider,
|
||||
visitor::prelude::*,
|
||||
},
|
||||
graph::SceneGraph,
|
||||
@@ -52,18 +51,21 @@ use fyrox::gui::message::MessageData;
|
||||
use std::cell::Cell;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Visit, Reflect, Default)]
|
||||
#[reflect(type_uuid = "d5425ec9-e945-4452-af2a-743147518eb6")]
|
||||
pub(crate) struct Entry {
|
||||
pub node: Handle<UiNode>,
|
||||
pub initial_position: Vector2<f32>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Visit, Reflect, Default)]
|
||||
#[reflect(type_uuid = "575d4cac-5456-42db-bed1-36c627bc44c0")]
|
||||
pub(crate) struct DragContext {
|
||||
initial_cursor_position: Vector2<f32>,
|
||||
entries: Vec<Entry>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Visit, Reflect)]
|
||||
#[reflect(type_uuid = "488b0b46-11ed-4eef-b58b-a52f3a71dd84")]
|
||||
pub(crate) enum Mode {
|
||||
Normal,
|
||||
Drag {
|
||||
@@ -112,7 +114,10 @@ impl MessageData for AbsmCanvasMessage {
|
||||
}
|
||||
|
||||
#[derive(Clone, Visit, Reflect, Debug)]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "100b1c33-d017-4fe6-95e7-e1daf310ef27"
|
||||
)]
|
||||
pub struct AbsmCanvas {
|
||||
widget: Widget,
|
||||
selection: Vec<Handle<UiNode>>,
|
||||
@@ -303,8 +308,6 @@ impl AbsmCanvas {
|
||||
}
|
||||
}
|
||||
|
||||
uuid_provider!(AbsmCanvas = "100b1c33-d017-4fe6-95e7-e1daf310ef27");
|
||||
|
||||
impl Control for AbsmCanvas {
|
||||
fn draw(&self, ctx: &mut DrawingContext) {
|
||||
let grid_size = 9999.0;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
use crate::fyrox::{
|
||||
core::{
|
||||
algebra::Vector2, color::Color, math::Rect, pool::Handle, reflect::prelude::*,
|
||||
uuid_provider, visitor::prelude::*,
|
||||
visitor::prelude::*,
|
||||
},
|
||||
gui::{
|
||||
brush::Brush,
|
||||
@@ -44,7 +44,10 @@ 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)]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "c802b6fa-a5ef-4464-a097-749c731ffde0"
|
||||
)]
|
||||
pub struct Connection {
|
||||
widget: Widget,
|
||||
pub segment: Segment,
|
||||
@@ -74,8 +77,6 @@ pub fn draw_connection(
|
||||
drawing_context.commit(clip_bounds, brush, CommandTexture::None, material, None);
|
||||
}
|
||||
|
||||
uuid_provider!(Connection = "c802b6fa-a5ef-4464-a097-749c731ffde0");
|
||||
|
||||
impl Control for Connection {
|
||||
fn draw(&self, drawing_context: &mut DrawingContext) {
|
||||
draw_connection(
|
||||
|
||||
@@ -23,9 +23,8 @@ use crate::{
|
||||
core::{
|
||||
pool::{ErasedHandle, Handle},
|
||||
reflect::Reflect,
|
||||
some_or_return, uuid,
|
||||
some_or_return,
|
||||
variable::InheritableVariable,
|
||||
Uuid,
|
||||
},
|
||||
engine::ApplicationLoopController,
|
||||
fxhash::FxHashSet,
|
||||
@@ -71,6 +70,7 @@ use crate::{
|
||||
};
|
||||
use fyrox::core::err;
|
||||
use fyrox::core::pool::ObjectOrVariantHelper;
|
||||
use fyrox::core::uuid::{uuid, Uuid};
|
||||
use fyrox::gui::UiNode;
|
||||
use fyrox::resource::model::Model;
|
||||
use fyrox::scene::graph::Graph;
|
||||
|
||||
@@ -19,10 +19,7 @@
|
||||
// SOFTWARE.
|
||||
|
||||
use crate::fyrox::{
|
||||
core::{
|
||||
color::Color, pool::Handle, reflect::prelude::*, type_traits::prelude::*, uuid::uuid,
|
||||
visitor::prelude::*,
|
||||
},
|
||||
core::{color::Color, pool::Handle, reflect::prelude::*, uuid::uuid, visitor::prelude::*},
|
||||
gui::{
|
||||
border::{BorderBuilder, BorderMessage},
|
||||
brush::Brush,
|
||||
@@ -52,13 +49,17 @@ use std::{
|
||||
};
|
||||
|
||||
#[derive(Clone, Debug, Visit, Reflect)]
|
||||
#[reflect(type_uuid = "1a5d0042-3607-4fcb-88c6-025a0bce6111")]
|
||||
pub struct AbsmBaseNode {
|
||||
pub input_sockets: Vec<Handle<Socket>>,
|
||||
pub output_socket: Handle<Socket>,
|
||||
}
|
||||
|
||||
#[derive(Visit, Reflect)]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "15bc1a7e-a385-46e0-a65c-7e9c014b4a1d"
|
||||
)]
|
||||
pub struct AbsmNode<T>
|
||||
where
|
||||
T: Reflect,
|
||||
@@ -154,12 +155,6 @@ pub enum AbsmNodeMessage {
|
||||
}
|
||||
impl MessageData for AbsmNodeMessage {}
|
||||
|
||||
impl<T: Reflect> TypeUuidProvider for AbsmNode<T> {
|
||||
fn type_uuid() -> Uuid {
|
||||
uuid!("15bc1a7e-a385-46e0-a65c-7e9c014b4a1d")
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Control for AbsmNode<T>
|
||||
where
|
||||
T: Reflect,
|
||||
|
||||
@@ -32,6 +32,7 @@ pub enum SegmentMessage {
|
||||
impl MessageData for SegmentMessage {}
|
||||
|
||||
#[derive(Debug, Clone, Reflect, Visit)]
|
||||
#[reflect(type_uuid = "fda5a731-e927-40e5-9d96-e19104fbb63e")]
|
||||
pub struct Segment {
|
||||
pub source: Handle<UiNode>,
|
||||
pub source_pos: Vector2<f32>,
|
||||
|
||||
@@ -36,6 +36,7 @@ pub enum SelectableMessage {
|
||||
impl MessageData for SelectableMessage {}
|
||||
|
||||
#[derive(Default, Clone, Debug, PartialEq, Eq, Visit, Reflect)]
|
||||
#[reflect(type_uuid = "5a49c5e4-8b2f-4631-8c83-7cc1eb0b2754")]
|
||||
pub struct Selectable {
|
||||
pub selected: bool,
|
||||
}
|
||||
|
||||
@@ -20,9 +20,7 @@
|
||||
|
||||
use crate::fyrox::core::pool::ErasedHandle;
|
||||
use crate::fyrox::{
|
||||
core::{
|
||||
algebra::Vector2, pool::Handle, reflect::prelude::*, uuid_provider, visitor::prelude::*,
|
||||
},
|
||||
core::{algebra::Vector2, pool::Handle, reflect::prelude::*, visitor::prelude::*},
|
||||
gui::{
|
||||
define_widget_deref,
|
||||
grid::{Column, GridBuilder, Row},
|
||||
@@ -48,6 +46,7 @@ pub enum SocketMessage {
|
||||
impl MessageData for SocketMessage {}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Hash, Debug, Eq, Visit, Reflect, Default)]
|
||||
#[reflect(type_uuid = "c77c74cf-d055-4ab3-8d20-67749e276169")]
|
||||
pub enum SocketDirection {
|
||||
#[default]
|
||||
Input,
|
||||
@@ -55,7 +54,10 @@ pub enum SocketDirection {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Visit, Reflect)]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "a6c0473e-7073-4e91-a681-cf88795af52a"
|
||||
)]
|
||||
pub struct Socket {
|
||||
widget: Widget,
|
||||
click_position: Option<Vector2<f32>>,
|
||||
@@ -71,8 +73,6 @@ define_widget_deref!(Socket);
|
||||
|
||||
const RADIUS: f32 = 8.0;
|
||||
|
||||
uuid_provider!(Socket = "a6c0473e-7073-4e91-a681-cf88795af52a");
|
||||
|
||||
impl Control for Socket {
|
||||
fn handle_routed_message(&mut self, ui: &mut UserInterface, message: &mut UiMessage) {
|
||||
self.widget.handle_routed_message(ui, message);
|
||||
|
||||
@@ -51,7 +51,7 @@ use crate::{
|
||||
|
||||
use fyrox::core::pool::HandlesArrayExtension;
|
||||
use fyrox::core::reflect::Reflect;
|
||||
use fyrox::core::{uuid, Uuid};
|
||||
use fyrox::core::uuid::{uuid, Uuid};
|
||||
use fyrox::gui::menu::{ContextMenuBuilder, MenuItem};
|
||||
|
||||
pub struct CanvasContextMenu {
|
||||
|
||||
@@ -54,7 +54,7 @@ use crate::{
|
||||
message::MessageSender,
|
||||
scene::{commands::ChangeSelectionCommand, Selection},
|
||||
};
|
||||
use fyrox::core::{uuid, Uuid};
|
||||
use fyrox::core::uuid::{uuid, Uuid};
|
||||
use fyrox::gui::menu::{ContextMenuBuilder, MenuItem};
|
||||
|
||||
pub struct CanvasContextMenu {
|
||||
|
||||
@@ -26,7 +26,6 @@ use crate::fyrox::{
|
||||
math::Rect,
|
||||
pool::Handle,
|
||||
reflect::prelude::*,
|
||||
uuid_provider,
|
||||
visitor::prelude::*,
|
||||
},
|
||||
gui::{
|
||||
@@ -56,7 +55,10 @@ pub enum TransitionMessage {
|
||||
impl MessageData for TransitionMessage {}
|
||||
|
||||
#[derive(Clone, Debug, Visit, Reflect)]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "01798aee-8fe5-4480-a69d-8e5b95c3cc96"
|
||||
)]
|
||||
pub struct TransitionView {
|
||||
widget: Widget,
|
||||
pub segment: Segment,
|
||||
@@ -105,8 +107,6 @@ pub fn draw_transition(
|
||||
drawing_context.commit(clip_bounds, brush, CommandTexture::None, material, None);
|
||||
}
|
||||
|
||||
uuid_provider!(TransitionView = "01798aee-8fe5-4480-a69d-8e5b95c3cc96");
|
||||
|
||||
impl Control for TransitionView {
|
||||
fn draw(&self, drawing_context: &mut DrawingContext) {
|
||||
let brush = if let Brush::Solid(color) = self.foreground() {
|
||||
|
||||
@@ -24,7 +24,7 @@ use crate::{
|
||||
asset::manager::ResourceManager,
|
||||
core::{
|
||||
algebra::Vector2, color::Color, log::Log, math::curve::Curve, math::Rect,
|
||||
pool::ErasedHandle, pool::Handle, reflect::Reflect, some_or_return, uuid, uuid::Uuid,
|
||||
pool::ErasedHandle, pool::Handle, reflect::Reflect, some_or_return, uuid::Uuid,
|
||||
variable::InheritableVariable,
|
||||
},
|
||||
engine::ApplicationLoopController,
|
||||
@@ -65,6 +65,7 @@ use crate::{
|
||||
ui_scene::UiScene,
|
||||
Editor, Message,
|
||||
};
|
||||
use fyrox::core::uuid::uuid;
|
||||
use fyrox::gui::UiNode;
|
||||
use fyrox::scene::node::Node;
|
||||
use std::any::Any;
|
||||
|
||||
@@ -25,8 +25,6 @@ use crate::fyrox::{
|
||||
math::Rect,
|
||||
pool::Handle,
|
||||
reflect::prelude::*,
|
||||
type_traits::prelude::*,
|
||||
uuid_provider,
|
||||
visitor::prelude::*,
|
||||
},
|
||||
gui::{
|
||||
@@ -162,7 +160,10 @@ struct DragContext {
|
||||
}
|
||||
|
||||
#[derive(Clone, Visit, Reflect)]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "98655c9b-428f-4977-a478-ad3674cc66d4"
|
||||
)]
|
||||
pub struct Ruler {
|
||||
widget: Widget,
|
||||
#[visit(skip)]
|
||||
@@ -215,8 +216,6 @@ impl Ruler {
|
||||
}
|
||||
}
|
||||
|
||||
uuid_provider!(Ruler = "98655c9b-428f-4977-a478-ad3674cc66d4");
|
||||
|
||||
impl Control for Ruler {
|
||||
fn draw(&self, ctx: &mut DrawingContext) {
|
||||
self.transform.set_bounds(self.screen_bounds());
|
||||
|
||||
@@ -27,7 +27,6 @@ use crate::fyrox::{
|
||||
algebra::{Point2, Vector2},
|
||||
pool::Handle,
|
||||
reflect::prelude::*,
|
||||
uuid_provider,
|
||||
visitor::prelude::*,
|
||||
},
|
||||
gui::{
|
||||
@@ -53,7 +52,10 @@ pub enum ThumbMessage {
|
||||
impl MessageData for ThumbMessage {}
|
||||
|
||||
#[derive(Clone, Visit, Reflect, Debug)]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "820ba009-54e0-4050-ba7e-28f1f5b40429"
|
||||
)]
|
||||
pub struct Thumb {
|
||||
widget: Widget,
|
||||
#[visit(skip)]
|
||||
@@ -73,8 +75,6 @@ impl Thumb {
|
||||
}
|
||||
}
|
||||
|
||||
uuid_provider!(Thumb = "820ba009-54e0-4050-ba7e-28f1f5b40429");
|
||||
|
||||
impl Control for Thumb {
|
||||
fn draw(&self, ctx: &mut DrawingContext) {
|
||||
self.transform.set_bounds(self.screen_bounds());
|
||||
|
||||
@@ -35,8 +35,6 @@ use crate::{
|
||||
pool::{ErasedHandle, Handle},
|
||||
reflect::{prelude::*, Reflect},
|
||||
some_or_return,
|
||||
type_traits::prelude::*,
|
||||
uuid_provider,
|
||||
variable::InheritableVariable,
|
||||
visitor::prelude::*,
|
||||
},
|
||||
@@ -349,7 +347,10 @@ pub enum TrackViewMessage {
|
||||
impl MessageData for TrackViewMessage {}
|
||||
|
||||
#[derive(Clone, Debug, Reflect, Visit)]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "c1e930da-d55d-492e-b87b-16c1adf03319"
|
||||
)]
|
||||
struct TrackView {
|
||||
pub tree: Tree,
|
||||
id: Uuid,
|
||||
@@ -373,8 +374,6 @@ impl DerefMut for TrackView {
|
||||
}
|
||||
}
|
||||
|
||||
uuid_provider!(TrackView = "c1e930da-d55d-492e-b87b-16c1adf03319");
|
||||
|
||||
impl Control for TrackView {
|
||||
fn on_remove(&self, sender: &Sender<UiMessage>) {
|
||||
self.tree.on_remove(sender)
|
||||
|
||||
@@ -35,8 +35,6 @@ mod segment2d;
|
||||
mod triangle;
|
||||
mod triangle2d;
|
||||
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use super::inspector::InspectorPlugin;
|
||||
use crate::{
|
||||
camera::PickingOptions,
|
||||
@@ -47,10 +45,8 @@ use crate::{
|
||||
color::Color,
|
||||
math::{plane::Plane, Matrix4Ext},
|
||||
pool::Handle,
|
||||
reflect::Reflect,
|
||||
reflect::prelude::*,
|
||||
some_or_return,
|
||||
type_traits::prelude::*,
|
||||
Uuid,
|
||||
},
|
||||
engine::Engine,
|
||||
graph::{SceneGraph, SceneGraphNode},
|
||||
@@ -87,10 +83,13 @@ use crate::{
|
||||
settings::Settings,
|
||||
Editor, Message,
|
||||
};
|
||||
use fyrox::core::uuid::Uuid;
|
||||
use fyrox::gui::button::Button;
|
||||
use fyrox::gui::widget::WidgetMessage;
|
||||
use fyrox::scene::camera::Camera;
|
||||
use fyrox::scene::pivot::Pivot;
|
||||
use std::fmt::{Debug, Formatter};
|
||||
use std::sync::LazyLock;
|
||||
|
||||
fn try_get_collider_shape(collider: Handle<Node>, scene: &Scene) -> Option<ColliderShape> {
|
||||
scene
|
||||
@@ -299,7 +298,8 @@ fn make_handle(scene: &mut Scene, root: Handle<Pivot>, visible: bool) -> Handle<
|
||||
handle
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
#[derive(Copy, Clone, Reflect, Debug)]
|
||||
#[reflect(non_cloneable, type_uuid = "42b19406-299d-4c3d-a7e3-77b41817ae71")]
|
||||
enum ShapeHandleValue {
|
||||
Scalar(f32),
|
||||
Vector(Vector3<f32>),
|
||||
@@ -323,15 +323,19 @@ impl ShapeHandleValue {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, Reflect, Debug)]
|
||||
#[reflect(non_cloneable, type_uuid = "70d6130f-da5d-4f14-bbfd-0744927053a0")]
|
||||
enum ColliderInitialShape {
|
||||
TwoD(dim2::collider::ColliderShape),
|
||||
ThreeD(ColliderShape),
|
||||
}
|
||||
|
||||
#[derive(Reflect, Debug)]
|
||||
#[reflect(non_cloneable, type_uuid = "e9aac4a5-0755-4d94-94ff-dfa37b40d5ca")]
|
||||
struct DragContext {
|
||||
handle: Handle<Sprite>,
|
||||
initial_handle_position: Vector3<f32>,
|
||||
#[reflect(hidden)]
|
||||
plane: Plane,
|
||||
initial_value: ShapeHandleValue,
|
||||
handle_major_axis: Option<Vector3<f32>>,
|
||||
@@ -339,17 +343,25 @@ struct DragContext {
|
||||
initial_shape: ColliderInitialShape,
|
||||
}
|
||||
|
||||
#[derive(TypeUuidProvider)]
|
||||
#[type_uuid(id = "a012dd4c-ce6d-4e7e-8879-fd8eddaa9677")]
|
||||
#[derive(Reflect)]
|
||||
#[reflect(non_cloneable, type_uuid = "a012dd4c-ce6d-4e7e-8879-fd8eddaa9677")]
|
||||
pub struct ColliderShapeInteractionMode {
|
||||
collider: Handle<Node>,
|
||||
#[reflect(hidden)]
|
||||
shape_gizmo: Box<dyn ShapeGizmoTrait>,
|
||||
move_gizmo: MoveGizmo,
|
||||
#[reflect(hidden)]
|
||||
drag_context: Option<DragContext>,
|
||||
selected_handle: Handle<Sprite>,
|
||||
message_sender: MessageSender,
|
||||
}
|
||||
|
||||
impl Debug for ColliderShapeInteractionMode {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "ColliderShapeInteractionMode")
|
||||
}
|
||||
}
|
||||
|
||||
impl ColliderShapeInteractionMode {
|
||||
fn set_visibility(
|
||||
&mut self,
|
||||
@@ -674,7 +686,7 @@ impl InteractionMode for ColliderShapeInteractionMode {
|
||||
}
|
||||
|
||||
fn uuid(&self) -> Uuid {
|
||||
Self::type_uuid()
|
||||
Self::type_info().type_uuid
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
use crate::{
|
||||
command::{Command, CommandGroup, SetPropertyCommand},
|
||||
fyrox::{
|
||||
core::{algebra::Vector3, pool::Handle, reflect::Reflect, TypeUuidProvider},
|
||||
core::{algebra::Vector3, pool::Handle, reflect::Reflect},
|
||||
engine::Engine,
|
||||
graph::SceneGraph,
|
||||
gui::{
|
||||
@@ -237,7 +237,7 @@ impl ColliderControlPanel {
|
||||
}
|
||||
} else if message.destination() == self.edit {
|
||||
sender.send(Message::SetInteractionMode(
|
||||
ColliderShapeInteractionMode::type_uuid(),
|
||||
ColliderShapeInteractionMode::type_info().type_uuid,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ use crate::{
|
||||
asset::Resource,
|
||||
core::{
|
||||
futures::executor::block_on, math::curve::Curve, pool::Handle, reflect::prelude::*,
|
||||
some_or_return, type_traits::prelude::*, visitor::prelude::*,
|
||||
some_or_return, visitor::prelude::*,
|
||||
},
|
||||
engine::Engine,
|
||||
gui::{
|
||||
@@ -62,6 +62,7 @@ use crate::{
|
||||
use std::{fmt::Debug, path::PathBuf};
|
||||
|
||||
#[derive(Reflect, Clone, Debug)]
|
||||
#[reflect(type_uuid = "f29aa9c7-e0c4-4602-8588-3e8a20ab7cdc")]
|
||||
pub struct CurveEditorContext {}
|
||||
|
||||
impl CommandContext for CurveEditorContext {}
|
||||
|
||||
@@ -23,10 +23,7 @@ use crate::{
|
||||
core::dyntype::{DynTypeConstructorContainer, DynTypeContainer},
|
||||
graph::SceneGraph,
|
||||
gui::{
|
||||
core::{
|
||||
parking_lot::Mutex, pool::Handle, reflect::prelude::*, type_traits::prelude::*,
|
||||
uuid_provider, visitor::prelude::*,
|
||||
},
|
||||
core::{parking_lot::Mutex, pool::Handle, reflect::prelude::*, visitor::prelude::*},
|
||||
dropdown_list::{DropdownList, DropdownListBuilder, DropdownListMessage},
|
||||
grid::{GridBuilder, GridDimension},
|
||||
inspector::InspectorContextArgs,
|
||||
@@ -65,7 +62,10 @@ pub enum DynTypePropertyEditorMessage {
|
||||
impl MessageData for DynTypePropertyEditorMessage {}
|
||||
|
||||
#[derive(Clone, Debug, Visit, Reflect)]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "f43c3bfb-8b39-4cc0-be77-04141a45822e"
|
||||
)]
|
||||
pub struct DynTypePropertyEditor {
|
||||
widget: Widget,
|
||||
inspector: Handle<Inspector>,
|
||||
@@ -88,8 +88,6 @@ impl DerefMut for DynTypePropertyEditor {
|
||||
}
|
||||
}
|
||||
|
||||
uuid_provider!(DynTypePropertyEditor = "f43c3bfb-8b39-4cc0-be77-04141a45822e");
|
||||
|
||||
impl Control for DynTypePropertyEditor {
|
||||
fn handle_routed_message(&mut self, ui: &mut UserInterface, message: &mut UiMessage) {
|
||||
self.widget.handle_routed_message(ui, message);
|
||||
|
||||
@@ -22,8 +22,7 @@ use crate::{
|
||||
asset::item::AssetItem,
|
||||
fyrox::{
|
||||
core::{
|
||||
algebra::Vector2, color::Color, pool::Handle, reflect::prelude::*, uuid_provider,
|
||||
visitor::prelude::*,
|
||||
algebra::Vector2, color::Color, pool::Handle, reflect::prelude::*, visitor::prelude::*,
|
||||
},
|
||||
graph::SceneGraph,
|
||||
gui::{
|
||||
@@ -56,7 +55,10 @@ use std::{
|
||||
};
|
||||
|
||||
#[derive(Clone, Visit, Reflect)]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "5db49479-ff89-49b8-a038-0766253d6493"
|
||||
)]
|
||||
pub struct FontField {
|
||||
widget: Widget,
|
||||
text_preview: Handle<Text>,
|
||||
@@ -92,8 +94,6 @@ pub enum FontFieldMessage {
|
||||
}
|
||||
impl MessageData for FontFieldMessage {}
|
||||
|
||||
uuid_provider!(FontField = "5db49479-ff89-49b8-a038-0766253d6493");
|
||||
|
||||
impl Control for FontField {
|
||||
fn draw(&self, drawing_context: &mut DrawingContext) {
|
||||
// Emit transparent geometry for the field to be able to catch mouse events without precise pointing at the
|
||||
|
||||
@@ -23,7 +23,7 @@ use crate::{
|
||||
fyrox::{
|
||||
core::{
|
||||
color::Color, pool::ErasedHandle, pool::Handle, reflect::prelude::*,
|
||||
type_traits::prelude::*, visitor::prelude::*, SafeLock,
|
||||
visitor::prelude::*, SafeLock,
|
||||
},
|
||||
graph::SceneGraph,
|
||||
gui::{
|
||||
@@ -104,8 +104,8 @@ impl MessageData for HandlePropertyEditorNameMessage {}
|
||||
pub struct HandlePropertyEditorHierarchyMessage(pub HierarchyNode);
|
||||
impl MessageData for HandlePropertyEditorHierarchyMessage {}
|
||||
|
||||
#[derive(Visit, Reflect, TypeUuidProvider)]
|
||||
#[type_uuid(id = "3ceca8c1-c365-4f03-a413-062f8f3cd685")]
|
||||
#[derive(Visit, Reflect)]
|
||||
#[reflect(type_uuid = "3ceca8c1-c365-4f03-a413-062f8f3cd685")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
pub struct HandlePropertyEditor<T: Reflect> {
|
||||
widget: Widget,
|
||||
|
||||
@@ -27,7 +27,7 @@ use crate::{
|
||||
asset::{manager::ResourceManager, state::LoadError, Resource, TypedResourceData},
|
||||
core::{
|
||||
color::Color, log::Log, parking_lot::Mutex, pool::Handle, reflect::prelude::*,
|
||||
type_traits::prelude::*, uuid::uuid, visitor::prelude::*, PhantomDataSendSync,
|
||||
uuid::uuid, visitor::prelude::*, PhantomDataSendSync,
|
||||
},
|
||||
graph::SceneGraph,
|
||||
gui::{
|
||||
@@ -115,7 +115,10 @@ pub type ResourceLoaderCallback<T> = Arc<
|
||||
>;
|
||||
|
||||
#[derive(Visit, Reflect)]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "5179b3b9-855f-43a6-b23a-831129fee1cf"
|
||||
)]
|
||||
pub struct ResourceField<T>
|
||||
where
|
||||
T: TypedResourceData,
|
||||
@@ -181,12 +184,6 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: TypedResourceData> TypeUuidProvider for ResourceField<T> {
|
||||
fn type_uuid() -> Uuid {
|
||||
uuid!("5179b3b9-855f-43a6-b23a-831129fee1cf")
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Control for ResourceField<T>
|
||||
where
|
||||
T: TypedResourceData,
|
||||
|
||||
@@ -19,10 +19,7 @@
|
||||
// SOFTWARE.
|
||||
|
||||
use crate::fyrox::{
|
||||
core::{
|
||||
log::Log, parking_lot::Mutex, pool::Handle, reflect::prelude::*, type_traits::prelude::*,
|
||||
uuid_provider, visitor::prelude::*,
|
||||
},
|
||||
core::{log::Log, parking_lot::Mutex, pool::Handle, reflect::prelude::*, visitor::prelude::*},
|
||||
engine::SerializationContext,
|
||||
graph::SceneGraph,
|
||||
gui::{
|
||||
@@ -73,7 +70,10 @@ pub enum ScriptPropertyEditorMessage {
|
||||
impl MessageData for ScriptPropertyEditorMessage {}
|
||||
|
||||
#[derive(Clone, Debug, Visit, Reflect)]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "f43c3bfb-8b39-4cc0-be77-04141a45822e"
|
||||
)]
|
||||
pub struct ScriptPropertyEditor {
|
||||
widget: Widget,
|
||||
inspector: Handle<Inspector>,
|
||||
@@ -97,8 +97,6 @@ impl DerefMut for ScriptPropertyEditor {
|
||||
}
|
||||
}
|
||||
|
||||
uuid_provider!(ScriptPropertyEditor = "f43c3bfb-8b39-4cc0-be77-04141a45822e");
|
||||
|
||||
impl Control for ScriptPropertyEditor {
|
||||
fn handle_routed_message(&mut self, ui: &mut UserInterface, message: &mut UiMessage) {
|
||||
self.widget.handle_routed_message(ui, message);
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
use crate::{
|
||||
fyrox::{
|
||||
core::{pool::Handle, reflect::prelude::*, type_traits::prelude::*, visitor::prelude::*},
|
||||
core::{pool::Handle, reflect::prelude::*, visitor::prelude::*},
|
||||
gui::{
|
||||
button::{ButtonBuilder, ButtonMessage},
|
||||
define_widget_deref_proxy,
|
||||
@@ -45,8 +45,8 @@ use crate::{
|
||||
use fyrox::gui::button::Button;
|
||||
use std::{any::TypeId, cell::RefCell};
|
||||
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug, TypeUuidProvider)]
|
||||
#[type_uuid(id = "f2024683-812e-4e0d-8065-7d168a82cce6")]
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[reflect(type_uuid = "f2024683-812e-4e0d-8065-7d168a82cce6")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
pub struct ShaderSourceCodeEditorField {
|
||||
widget: Widget,
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
// SOFTWARE.
|
||||
|
||||
use fyrox::{
|
||||
core::{pool::Handle, reflect::prelude::*, type_traits::prelude::*, visitor::prelude::*},
|
||||
core::{pool::Handle, reflect::prelude::*, visitor::prelude::*},
|
||||
gui::{
|
||||
control_trait_proxy_impls, define_widget_deref_proxy,
|
||||
formatted_text::WrapMode,
|
||||
@@ -42,8 +42,8 @@ pub enum ShaderSourceCodeEditorMessage {
|
||||
}
|
||||
impl MessageData for ShaderSourceCodeEditorMessage {}
|
||||
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug, TypeUuidProvider)]
|
||||
#[type_uuid(id = "c2e0bdcc-28a6-4141-93b5-5dad50c8b29c")]
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[reflect(type_uuid = "c2e0bdcc-28a6-4141-93b5-5dad50c8b29c")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
pub struct ShaderSourceCodeEditor {
|
||||
window: Window,
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
// SOFTWARE.
|
||||
|
||||
use crate::fyrox::{
|
||||
core::{pool::Handle, reflect::prelude::*, uuid_provider, visitor::prelude::*},
|
||||
core::{pool::Handle, reflect::prelude::*, visitor::prelude::*},
|
||||
gui::{
|
||||
button::{ButtonBuilder, ButtonMessage},
|
||||
define_widget_deref,
|
||||
@@ -58,7 +58,10 @@ pub enum SpriteSheetFramesPropertyEditorMessage {
|
||||
impl MessageData for SpriteSheetFramesPropertyEditorMessage {}
|
||||
|
||||
#[derive(Clone, Debug, Reflect, Visit)]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "8994228d-6106-4e41-872c-5191840badcc"
|
||||
)]
|
||||
pub struct SpriteSheetFramesPropertyEditor {
|
||||
widget: Widget,
|
||||
edit_button: Handle<Button>,
|
||||
@@ -67,8 +70,6 @@ pub struct SpriteSheetFramesPropertyEditor {
|
||||
|
||||
define_widget_deref!(SpriteSheetFramesPropertyEditor);
|
||||
|
||||
uuid_provider!(SpriteSheetFramesPropertyEditor = "8994228d-6106-4e41-872c-5191840badcc");
|
||||
|
||||
impl Control for SpriteSheetFramesPropertyEditor {
|
||||
fn handle_routed_message(&mut self, ui: &mut UserInterface, message: &mut UiMessage) {
|
||||
self.widget.handle_routed_message(ui, message);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
use crate::fyrox::graph::SceneGraph;
|
||||
use crate::fyrox::{
|
||||
core::{
|
||||
algebra::Vector2, parking_lot::Mutex, pool::Handle, reflect::prelude::*, uuid_provider,
|
||||
algebra::Vector2, parking_lot::Mutex, pool::Handle, reflect::prelude::*,
|
||||
visitor::prelude::*,
|
||||
},
|
||||
gui::{
|
||||
@@ -60,7 +60,10 @@ use std::{
|
||||
};
|
||||
|
||||
#[derive(Clone, Visit, Reflect, Debug)]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "55607fe0-2996-418d-ad31-a5b96fdfa4b7"
|
||||
)]
|
||||
pub struct SpriteSheetFramesEditorWindow {
|
||||
window: Window,
|
||||
editor: Handle<UiNode>,
|
||||
@@ -89,8 +92,6 @@ impl DerefMut for SpriteSheetFramesEditorWindow {
|
||||
}
|
||||
}
|
||||
|
||||
uuid_provider!(SpriteSheetFramesEditorWindow = "55607fe0-2996-418d-ad31-a5b96fdfa4b7");
|
||||
|
||||
impl Control for SpriteSheetFramesEditorWindow {
|
||||
fn on_remove(&self, sender: &Sender<UiMessage>) {
|
||||
self.window.on_remove(sender);
|
||||
|
||||
@@ -28,7 +28,7 @@ use crate::{
|
||||
asset::manager::ResourceManager,
|
||||
core::{
|
||||
futures::executor::block_on, log::Log, make_relative_path, pool::Handle,
|
||||
reflect::prelude::*, type_traits::prelude::*, visitor::prelude::*,
|
||||
reflect::prelude::*, visitor::prelude::*,
|
||||
},
|
||||
graph::SceneGraph,
|
||||
gui::{
|
||||
@@ -67,8 +67,8 @@ pub enum SurfaceDataPropertyEditorMessage {
|
||||
}
|
||||
impl MessageData for SurfaceDataPropertyEditorMessage {}
|
||||
|
||||
#[derive(Clone, Visit, Reflect, Debug, TypeUuidProvider)]
|
||||
#[type_uuid(id = "8461a183-4fd4-4f74-a4f4-7fd8e84bf423")]
|
||||
#[derive(Clone, Visit, Reflect, Debug)]
|
||||
#[reflect(type_uuid = "8461a183-4fd4-4f74-a4f4-7fd8e84bf423")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
#[allow(dead_code)]
|
||||
pub struct SurfaceDataPropertyEditor {
|
||||
|
||||
@@ -24,7 +24,7 @@ use crate::{
|
||||
asset::{manager::ResourceManager, untyped::UntypedResource},
|
||||
core::{
|
||||
algebra::Vector2, color::Color, make_relative_path, pool::Handle, reflect::prelude::*,
|
||||
uuid_provider, visitor::prelude::*,
|
||||
visitor::prelude::*,
|
||||
},
|
||||
graph::SceneGraph,
|
||||
gui::{
|
||||
@@ -59,7 +59,10 @@ use std::{
|
||||
};
|
||||
|
||||
#[derive(Clone, Visit, Reflect)]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "5db49479-ff89-49b8-a038-0766253d6493"
|
||||
)]
|
||||
pub struct TextureEditor {
|
||||
widget: Widget,
|
||||
image: Handle<Image>,
|
||||
@@ -99,8 +102,6 @@ pub enum TextureEditorMessage {
|
||||
}
|
||||
impl MessageData for TextureEditorMessage {}
|
||||
|
||||
uuid_provider!(TextureEditor = "5db49479-ff89-49b8-a038-0766253d6493");
|
||||
|
||||
fn texture_name(texture: Option<&TextureResource>, resource_manager: &ResourceManager) -> String {
|
||||
match texture.and_then(|tex| resource_manager.resource_path(tex.as_ref())) {
|
||||
None => "Unassigned".to_string(),
|
||||
|
||||
@@ -68,13 +68,14 @@ pub mod editors;
|
||||
pub mod handlers;
|
||||
|
||||
#[derive(Clone, Reflect, Debug)]
|
||||
#[reflect(type_uuid = "e617f0b6-fb5f-4e41-85c2-9dbb1869af30")]
|
||||
pub struct AnimationDefinition {
|
||||
name: String,
|
||||
handle: ErasedHandle,
|
||||
}
|
||||
|
||||
#[derive(Reflect, Clone, Debug)]
|
||||
#[reflect(non_cloneable)]
|
||||
#[reflect(non_cloneable, type_uuid = "ff4bc6f3-a735-47d8-b455-f9fd6354bd5f")]
|
||||
pub struct EditorEnvironment {
|
||||
pub resource_manager: ResourceManager,
|
||||
#[reflect(hidden)]
|
||||
|
||||
@@ -27,8 +27,8 @@ use crate::{
|
||||
fyrox::{
|
||||
asset::{core::pool::Handle, manager::ResourceManager, state::ResourceState},
|
||||
core::{
|
||||
color::Color, log::Log, parking_lot::Mutex, reflect::prelude::*, uuid_provider,
|
||||
visitor::prelude::*, SafeLock,
|
||||
color::Color, log::Log, parking_lot::Mutex, reflect::prelude::*, visitor::prelude::*,
|
||||
SafeLock,
|
||||
},
|
||||
graph::SceneGraph,
|
||||
gui::{
|
||||
@@ -72,7 +72,10 @@ pub enum MaterialFieldMessage {
|
||||
impl MessageData for MaterialFieldMessage {}
|
||||
|
||||
#[derive(Clone, Visit, Reflect)]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "d3fa0a7c-52d6-4cca-885e-0db8b18542e2"
|
||||
)]
|
||||
pub struct MaterialFieldEditor {
|
||||
widget: Widget,
|
||||
#[visit(skip)]
|
||||
@@ -108,8 +111,6 @@ impl DerefMut for MaterialFieldEditor {
|
||||
}
|
||||
}
|
||||
|
||||
uuid_provider!(MaterialFieldEditor = "d3fa0a7c-52d6-4cca-885e-0db8b18542e2");
|
||||
|
||||
impl Control for MaterialFieldEditor {
|
||||
fn draw(&self, drawing_context: &mut DrawingContext) {
|
||||
// Emit transparent geometry for the field to be able to catch mouse events without precise
|
||||
|
||||
@@ -25,9 +25,8 @@ use crate::{
|
||||
core::{
|
||||
algebra::{Vector2, Vector3},
|
||||
pool::Handle,
|
||||
reflect::prelude::*,
|
||||
some_or_return,
|
||||
type_traits::prelude::*,
|
||||
Uuid,
|
||||
},
|
||||
engine::Engine,
|
||||
graph::SceneGraph,
|
||||
@@ -52,6 +51,7 @@ use crate::{
|
||||
Editor, Message,
|
||||
};
|
||||
use fyrox::core::reflect::Reflect;
|
||||
use fyrox::core::uuid::Uuid;
|
||||
use fyrox::gui::button::Button;
|
||||
use fyrox::gui::grid::Grid;
|
||||
|
||||
@@ -126,7 +126,7 @@ impl ReflectionProbePreviewControlPanel {
|
||||
}
|
||||
} else if message.destination == self.adjust {
|
||||
sender.send(Message::SetInteractionMode(
|
||||
ReflectionProbeInteractionMode::type_uuid(),
|
||||
ReflectionProbeInteractionMode::type_info().type_uuid,
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -138,17 +138,20 @@ impl ReflectionProbePreviewControlPanel {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Reflect, Debug)]
|
||||
#[reflect(non_cloneable, type_uuid = "9a535782-87a9-4407-8d12-a723d67e179d")]
|
||||
struct DragContext {
|
||||
new_position: Vector3<f32>,
|
||||
plane_kind: PlaneKind,
|
||||
}
|
||||
|
||||
#[derive(TypeUuidProvider)]
|
||||
#[type_uuid(id = "d8fd164c-523c-447a-93ab-e86f2d71eed6")]
|
||||
#[derive(Reflect, Debug)]
|
||||
#[reflect(non_cloneable, type_uuid = "d8fd164c-523c-447a-93ab-e86f2d71eed6")]
|
||||
pub struct ReflectionProbeInteractionMode {
|
||||
probe: Handle<ReflectionProbe>,
|
||||
move_gizmo: MoveGizmo,
|
||||
message_sender: MessageSender,
|
||||
#[reflect(hidden)]
|
||||
drag_context: Option<DragContext>,
|
||||
}
|
||||
|
||||
@@ -313,7 +316,7 @@ impl InteractionMode for ReflectionProbeInteractionMode {
|
||||
}
|
||||
|
||||
fn uuid(&self) -> Uuid {
|
||||
Self::type_uuid()
|
||||
<Self as Reflect>::type_info().type_uuid
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ use crate::{
|
||||
math::Matrix4Ext,
|
||||
pool::Handle,
|
||||
reflect::prelude::*,
|
||||
some_or_return, uuid, Uuid,
|
||||
some_or_return,
|
||||
},
|
||||
graph::SceneGraph,
|
||||
gui::{
|
||||
@@ -75,6 +75,7 @@ use fyrox::scene::ragdoll::Ragdoll;
|
||||
use std::{ops::Range, sync::Arc};
|
||||
|
||||
#[derive(Reflect, Clone, Debug)]
|
||||
#[reflect(type_uuid = "07d73807-1716-4ea6-bef4-91903c214f7e")]
|
||||
pub struct RagdollPreset {
|
||||
/// A handle of a hips (pelvis) bone.
|
||||
hips: Handle<Node>,
|
||||
|
||||
@@ -51,7 +51,8 @@ use crate::{
|
||||
settings::Settings,
|
||||
Editor,
|
||||
};
|
||||
use fyrox::core::{ok_or_return, uuid, Uuid};
|
||||
use fyrox::core::ok_or_return;
|
||||
use fyrox::core::uuid::{uuid, Uuid};
|
||||
use fyrox::engine::GraphicsContext;
|
||||
use fyrox::gui::button::Button;
|
||||
use fyrox::gui::dock::DockingManager;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
use crate::{
|
||||
fyrox::{
|
||||
core::{pool::Handle, uuid, Uuid},
|
||||
core::pool::Handle,
|
||||
engine::ApplicationLoopController,
|
||||
gui::{
|
||||
menu::{MenuItem, MenuItemMessage},
|
||||
@@ -36,6 +36,7 @@ use crate::{
|
||||
plugin::EditorPlugin,
|
||||
Editor,
|
||||
};
|
||||
use fyrox::core::uuid::{uuid, Uuid};
|
||||
|
||||
/// Editor statistics, useful to track number of active widgets, memory consumption, and other
|
||||
/// various useful information.
|
||||
|
||||
@@ -117,6 +117,7 @@ pub struct AutoTileMacro {
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, Reflect)]
|
||||
#[reflect(type_uuid = "e50fa366-145d-4491-8126-acdd162031ea")]
|
||||
struct CellData {
|
||||
terrain_id: TileTerrainId,
|
||||
#[reflect(hidden)]
|
||||
@@ -137,8 +138,8 @@ impl Visit for CellData {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Clone, Visit, Reflect, TypeUuidProvider)]
|
||||
#[type_uuid(id = "b320543d-3df0-43fd-b0d9-60a398f49853")]
|
||||
#[derive(Debug, Default, Clone, Visit, Reflect)]
|
||||
#[reflect(type_uuid = "b320543d-3df0-43fd-b0d9-60a398f49853")]
|
||||
pub(super) struct AutoTileInstance {
|
||||
frequency_property: Option<TileSetPropertyF32>,
|
||||
pattern_property: Option<TileSetPropertyNine>,
|
||||
@@ -159,10 +160,6 @@ struct InstanceCellWidgets {
|
||||
}
|
||||
|
||||
impl ResourceData for AutoTileInstance {
|
||||
fn type_uuid(&self) -> Uuid {
|
||||
<Self as TypeUuidProvider>::type_uuid()
|
||||
}
|
||||
|
||||
fn save(&mut self, _path: &std::path::Path) -> Result<(), Box<dyn std::error::Error>> {
|
||||
Err("Saving is not supported!".to_string().into())
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ impl BrushMacroInstance {
|
||||
/// A typed reference to the configuration resource.
|
||||
pub fn settings<T>(&self) -> Option<Resource<T>>
|
||||
where
|
||||
T: ResourceData + Default + TypeUuidProvider,
|
||||
T: ResourceData + Default,
|
||||
{
|
||||
self.settings.as_ref()?.try_cast()
|
||||
}
|
||||
@@ -211,7 +211,7 @@ impl BrushMacroCellContext {
|
||||
/// A typed reference to the configuration resource.
|
||||
pub fn settings<T>(&self) -> Option<Resource<T>>
|
||||
where
|
||||
T: ResourceData + Default + TypeUuidProvider,
|
||||
T: ResourceData + Default,
|
||||
{
|
||||
self.settings.as_ref()?.try_cast()
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ use fyrox::gui::text::Text;
|
||||
use fyrox::gui::text_box::TextBox;
|
||||
use fyrox::{
|
||||
asset::Resource,
|
||||
core::{algebra::Vector2, color::Color, pool::Handle, type_traits::prelude::*},
|
||||
core::{algebra::Vector2, color::Color, pool::Handle},
|
||||
gui::{
|
||||
border::BorderBuilder,
|
||||
brush::Brush,
|
||||
|
||||
@@ -20,10 +20,15 @@
|
||||
|
||||
//! Commands that allow modifications to tile maps, tile sets, and brushes.
|
||||
|
||||
use crate::{
|
||||
command::{CommandContext, CommandTrait},
|
||||
scene::commands::GameSceneContext,
|
||||
};
|
||||
use fyrox::core::uuid::Uuid;
|
||||
use fyrox::{
|
||||
core::{
|
||||
algebra::Vector2, color::Color, log::Log, pool::Handle, swap_hash_map_entry,
|
||||
ImmutableString, Uuid,
|
||||
ImmutableString,
|
||||
},
|
||||
fxhash::FxHashMap,
|
||||
material::MaterialResource,
|
||||
@@ -42,11 +47,6 @@ use fyrox::{
|
||||
},
|
||||
};
|
||||
|
||||
use crate::{
|
||||
command::{CommandContext, CommandTrait},
|
||||
scene::commands::GameSceneContext,
|
||||
};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct SetColliderLayerNameCommand {
|
||||
pub tile_set: TileSetResource,
|
||||
|
||||
@@ -28,10 +28,7 @@ use fyrox::gui::inspector::FieldAction;
|
||||
use fyrox::gui::message::MessageData;
|
||||
use fyrox::gui::text_box::TextBox;
|
||||
use fyrox::{
|
||||
core::{
|
||||
color::Color, pool::Handle, reflect::prelude::*, type_traits::prelude::*,
|
||||
visitor::prelude::*,
|
||||
},
|
||||
core::{color::Color, pool::Handle, reflect::prelude::*, visitor::prelude::*},
|
||||
gui::{
|
||||
brush::Brush,
|
||||
button::{ButtonBuilder, ButtonMessage},
|
||||
@@ -79,9 +76,9 @@ impl MessageData for TileDefinitionHandleEditorMessage {}
|
||||
/// pair is the page coordinates and the second pair is the tile coordinates.
|
||||
/// When editing the handle, one need merely type four integers. Whatever
|
||||
/// characters separate the integers are ignored, so "1 2 3 4" would be accepted.
|
||||
#[derive(Clone, Debug, Visit, Reflect, TypeUuidProvider)]
|
||||
#[derive(Clone, Debug, Visit, Reflect)]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
#[type_uuid(id = "60146cf0-33e3-4757-8e66-e7196324271f")]
|
||||
#[reflect(type_uuid = "60146cf0-33e3-4757-8e66-e7196324271f")]
|
||||
pub struct TileDefinitionHandleEditor {
|
||||
widget: Widget,
|
||||
field: Handle<TextBox>,
|
||||
|
||||
@@ -53,8 +53,8 @@ impl MessageData for TileHandleEditorMessage {}
|
||||
/// pair is the page coordinates and the second pair is the tile coordinates.
|
||||
/// When editing the handle, one need merely type four integers. Whatever
|
||||
/// characters separate the integers are ignored, so "1 2 3 4" would be accepted.
|
||||
#[derive(Debug, Default, Clone, Visit, Reflect, TypeUuidProvider)]
|
||||
#[type_uuid(id = "86513074-461d-4583-a214-fb84f5aacac1")]
|
||||
#[derive(Debug, Default, Clone, Visit, Reflect)]
|
||||
#[reflect(type_uuid = "86513074-461d-4583-a214-fb84f5aacac1")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
pub struct TileHandleField {
|
||||
widget: Widget,
|
||||
|
||||
@@ -28,6 +28,7 @@ use commands::{MoveMapTileCommand, SetMapTilesCommand};
|
||||
use fyrox::gui::button::Button;
|
||||
use fyrox::{
|
||||
asset::untyped::UntypedResource,
|
||||
core::reflect::prelude::*,
|
||||
core::SafeLock,
|
||||
fxhash::FxHashMap,
|
||||
scene::tilemap::{
|
||||
@@ -38,6 +39,7 @@ use fyrox::{
|
||||
TransTilesUpdate,
|
||||
},
|
||||
};
|
||||
use std::fmt::Formatter;
|
||||
|
||||
use super::*;
|
||||
|
||||
@@ -59,8 +61,12 @@ enum MouseMode {
|
||||
Drawing,
|
||||
}
|
||||
|
||||
#[derive(TypeUuidProvider)]
|
||||
#[type_uuid(id = "33fa8ef9-a29c-45d4-a493-79571edd870a")]
|
||||
#[derive(Reflect)]
|
||||
#[reflect(
|
||||
non_cloneable,
|
||||
type_uuid = "33fa8ef9-a29c-45d4-a493-79571edd870a",
|
||||
hide_all
|
||||
)]
|
||||
pub struct TileMapInteractionMode {
|
||||
tile_map: Handle<Node>,
|
||||
/// The state that is shared between this interaction mode and the
|
||||
@@ -105,6 +111,12 @@ pub struct TileMapInteractionMode {
|
||||
update_effect: Arc<Mutex<TileUpdateEffect>>,
|
||||
}
|
||||
|
||||
impl Debug for TileMapInteractionMode {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "TileMapInteractionMode")
|
||||
}
|
||||
}
|
||||
|
||||
impl TileMapInteractionMode {
|
||||
pub fn new(
|
||||
tile_map: Handle<Node>,
|
||||
@@ -823,7 +835,7 @@ impl InteractionMode for TileMapInteractionMode {
|
||||
}
|
||||
|
||||
fn uuid(&self) -> Uuid {
|
||||
Self::type_uuid()
|
||||
Self::type_info().type_uuid
|
||||
}
|
||||
|
||||
fn on_hot_key_pressed(
|
||||
|
||||
@@ -40,6 +40,7 @@ const CELL_WITH_MACRO_COLOR: Color = Color::DARK_SLATE_BLUE;
|
||||
const CELL_WITHOUT_MACRO_COLOR: Color = Color::opaque(50, 50, 50);
|
||||
|
||||
#[derive(Visit, Clone, Reflect)]
|
||||
#[reflect(type_uuid = "b003f118-4dda-4529-a791-ad20860c124d")]
|
||||
pub struct MacroInspector {
|
||||
handle: Handle<UiNode>,
|
||||
content: Handle<UiNode>,
|
||||
|
||||
@@ -82,9 +82,7 @@ use crate::fyrox::{
|
||||
parking_lot::{Mutex, MutexGuard},
|
||||
pool::Handle,
|
||||
reflect::prelude::*,
|
||||
type_traits::prelude::*,
|
||||
visitor::prelude::*,
|
||||
Uuid,
|
||||
},
|
||||
engine::Engine,
|
||||
fxhash::FxHashSet,
|
||||
@@ -283,6 +281,7 @@ fn make_drawing_mode_button(
|
||||
|
||||
/// The possible drawing mode when the user is editing tiles.
|
||||
#[derive(Default, Clone, Copy, Debug, PartialEq, Eq, Visit, Reflect)]
|
||||
#[reflect(type_uuid = "07ae3005-13ee-46b6-aad5-b7a5bb3e1e8c")]
|
||||
pub enum DrawingMode {
|
||||
/// Paste the currently selected tiles as a stamp wherever the user clicks or drags the mouse.
|
||||
#[default]
|
||||
@@ -720,7 +719,7 @@ impl EditorPlugin for TileMapEditorPlugin {
|
||||
editor
|
||||
.asset_browser
|
||||
.preview_generators
|
||||
.add(TileSet::type_uuid(), TileSetPreview);
|
||||
.add(TileSet::type_info().type_uuid, TileSetPreview);
|
||||
let state = editor.engine.resource_manager.state();
|
||||
state.constructors_container.add::<AutoTileInstance>();
|
||||
state.constructors_container.add::<WfcInstance>();
|
||||
@@ -858,7 +857,7 @@ impl EditorPlugin for TileMapEditorPlugin {
|
||||
}
|
||||
|
||||
if let Message::SetInteractionMode(uuid) = message {
|
||||
if *uuid == TileMapInteractionMode::type_uuid() && self.panel.is_none() {
|
||||
if *uuid == TileMapInteractionMode::type_info().type_uuid && self.panel.is_none() {
|
||||
if let Some(tile_map) = self.get_tile_map_mut(editor) {
|
||||
let resource = if let Some(brush) = tile_map.active_brush() {
|
||||
TileBook::Brush(brush.clone())
|
||||
|
||||
@@ -33,7 +33,6 @@ use crate::{
|
||||
math::Rect,
|
||||
pool::Handle,
|
||||
reflect::prelude::*,
|
||||
type_traits::prelude::*,
|
||||
visitor::prelude::*,
|
||||
SafeLock,
|
||||
},
|
||||
@@ -165,8 +164,8 @@ fn calc_slice_coord(position: f32, step: f32) -> usize {
|
||||
|
||||
/// Displays a scrollable grid of till cells, with options to allow the tiles
|
||||
/// to be selected, dragged, and edits in various ways.
|
||||
#[derive(Clone, Visit, Reflect, TypeUuidProvider)]
|
||||
#[type_uuid(id = "5356a864-c026-4bd7-a4b1-30bacf77d8fa")]
|
||||
#[derive(Clone, Visit, Reflect)]
|
||||
#[reflect(type_uuid = "5356a864-c026-4bd7-a4b1-30bacf77d8fa")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
pub struct PaletteWidget {
|
||||
widget: Widget,
|
||||
|
||||
@@ -29,7 +29,6 @@ use crate::fyrox::{
|
||||
math::Rect,
|
||||
pool::Handle,
|
||||
reflect::prelude::*,
|
||||
type_traits::prelude::*,
|
||||
visitor::prelude::*,
|
||||
},
|
||||
gui::formatted_text::{FormattedText, FormattedTextBuilder},
|
||||
@@ -50,8 +49,8 @@ use fyrox::material::MaterialResource;
|
||||
/// The preview widget of the tile map control panel. This allows the user to see the
|
||||
/// currently selected tile stamp, including whatever transformations have been applied
|
||||
/// to the stamp.
|
||||
#[derive(Clone, Debug, Visit, Reflect, TypeUuidProvider)]
|
||||
#[type_uuid(id = "5356a864-c026-4bd7-a4b1-30bacf77d8fa")]
|
||||
#[derive(Clone, Debug, Visit, Reflect)]
|
||||
#[reflect(type_uuid = "5356a864-c026-4bd7-a4b1-30bacf77d8fa")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
pub struct PanelPreview {
|
||||
widget: Widget,
|
||||
|
||||
@@ -23,7 +23,7 @@ use super::*;
|
||||
use fyrox::gui::grid::Grid;
|
||||
use fyrox::gui::vec::VecEditor;
|
||||
use fyrox::{
|
||||
core::{pool::Handle, reflect::prelude::*, type_traits::prelude::*, visitor::prelude::*},
|
||||
core::{pool::Handle, reflect::prelude::*, visitor::prelude::*},
|
||||
gui::{
|
||||
button::ButtonMessage,
|
||||
define_widget_deref,
|
||||
@@ -46,8 +46,8 @@ pub enum TileBoundsMessage {
|
||||
}
|
||||
impl MessageData for TileBoundsMessage {}
|
||||
|
||||
#[derive(Clone, Default, Debug, Visit, Reflect, TypeUuidProvider)]
|
||||
#[type_uuid(id = "1e600103-6516-4c5a-a30b-f90f64fc9623")]
|
||||
#[derive(Clone, Default, Debug, Visit, Reflect)]
|
||||
#[reflect(type_uuid = "1e600103-6516-4c5a-a30b-f90f64fc9623")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
pub struct TileBoundsEditor {
|
||||
widget: Widget,
|
||||
|
||||
@@ -30,10 +30,7 @@ use crate::{
|
||||
};
|
||||
use fyrox::{
|
||||
asset::ResourceDataRef,
|
||||
core::{
|
||||
algebra::Vector2, pool::Handle, reflect::prelude::*, type_traits::prelude::*,
|
||||
visitor::prelude::*, SafeLock,
|
||||
},
|
||||
core::{algebra::Vector2, pool::Handle, reflect::prelude::*, visitor::prelude::*, SafeLock},
|
||||
gui::{
|
||||
button::{Button, ButtonMessage},
|
||||
decorator::DecoratorMessage,
|
||||
@@ -548,6 +545,7 @@ fn find_collider_value(
|
||||
}
|
||||
|
||||
#[derive(Clone, Default, Debug, Visit, Reflect)]
|
||||
#[reflect(type_uuid = "9c65682b-0160-443c-95fc-0b88f86a497b")]
|
||||
struct InspectorField {
|
||||
handle: Handle<Grid>,
|
||||
field: Handle<UiNode>,
|
||||
@@ -574,6 +572,7 @@ impl InspectorField {
|
||||
|
||||
/// Object that keeps track of the editors for all the property layers.
|
||||
#[derive(Clone, Default, Visit, Reflect)]
|
||||
#[reflect(type_uuid = "89171a35-a7e7-4ce7-a017-124e8eec5746")]
|
||||
struct PropertyEditors {
|
||||
handle: Handle<UiNode>,
|
||||
content: Handle<UiNode>,
|
||||
@@ -647,6 +646,7 @@ impl PropertyEditors {
|
||||
|
||||
/// Object that keeps track of the editors for all the collider layers.
|
||||
#[derive(Clone, Default, Visit, Reflect)]
|
||||
#[reflect(type_uuid = "97acc27d-c6fc-491b-9faa-6ad2f124f126")]
|
||||
struct ColliderEditors {
|
||||
handle: Handle<UiNode>,
|
||||
content: Handle<UiNode>,
|
||||
@@ -719,6 +719,7 @@ impl ColliderEditors {
|
||||
}
|
||||
|
||||
#[derive(Visit, Reflect, Clone)]
|
||||
#[reflect(type_uuid = "cd0f6716-3d7c-4c39-a2aa-98274ca6efa2")]
|
||||
pub struct TileInspector {
|
||||
handle: Handle<UiNode>,
|
||||
/// The shared state that represents the user's currently selected tool and tiles.
|
||||
|
||||
@@ -30,9 +30,7 @@ use fyrox::gui::dropdown_list::DropdownList;
|
||||
use fyrox::gui::grid::Grid;
|
||||
use fyrox::gui::text::Text;
|
||||
use fyrox::{
|
||||
core::{
|
||||
algebra::Vector2, color::Color, pool::Handle, type_traits::prelude::*, ImmutableString,
|
||||
},
|
||||
core::{algebra::Vector2, color::Color, pool::Handle, ImmutableString},
|
||||
fxhash::FxHashMap,
|
||||
gui::{
|
||||
border::BorderBuilder,
|
||||
@@ -58,6 +56,7 @@ use palette::Subposition;
|
||||
use super::*;
|
||||
|
||||
#[derive(Debug, Clone, Visit, Reflect, PartialEq)]
|
||||
#[reflect(type_uuid = "d10c7388-94a8-41fa-870c-304e7f2805cc")]
|
||||
enum DrawValue {
|
||||
I8(i8),
|
||||
I32(i32),
|
||||
|
||||
@@ -71,8 +71,8 @@ pub struct WfcMacro {
|
||||
current_terrain: TileTerrainId,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Visit, Reflect, TypeUuidProvider)]
|
||||
#[type_uuid(id = "24f9947e-f58b-4623-ad14-cb21cd09297e")]
|
||||
#[derive(Debug, Clone, Visit, Reflect)]
|
||||
#[reflect(type_uuid = "24f9947e-f58b-4623-ad14-cb21cd09297e")]
|
||||
pub(super) struct WfcInstance {
|
||||
frequency_property: Option<TileSetPropertyF32>,
|
||||
pattern_property: Option<TileSetPropertyNine>,
|
||||
@@ -238,10 +238,6 @@ impl WfcInstance {
|
||||
}
|
||||
|
||||
impl ResourceData for WfcInstance {
|
||||
fn type_uuid(&self) -> Uuid {
|
||||
<Self as TypeUuidProvider>::type_uuid()
|
||||
}
|
||||
|
||||
fn save(&mut self, _path: &std::path::Path) -> Result<(), Box<dyn std::error::Error>> {
|
||||
Err("Saving is not supported!".to_string().into())
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ pub struct Clipboard {
|
||||
}
|
||||
|
||||
impl Reflect for &'static mut Clipboard {
|
||||
blank_reflect_ref!();
|
||||
blank_reflect_ref!("ab09394a-ad19-477b-85cb-5dccf7401c80");
|
||||
}
|
||||
|
||||
impl Default for Clipboard {
|
||||
|
||||
@@ -47,6 +47,7 @@ pub mod terrain;
|
||||
|
||||
#[derive(Reflect, Debug)]
|
||||
#[reflect(non_cloneable)]
|
||||
#[reflect(type_uuid = "4dd03d8c-b0c9-43a2-871c-55e5fd603afd")]
|
||||
pub struct GameSceneContext {
|
||||
pub selection: &'static mut Selection,
|
||||
pub scene: &'static mut Scene,
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
use crate::command::CommandStack;
|
||||
use crate::fyrox::{
|
||||
core::{algebra::Vector2, math::Rect, pool::Handle, uuid::Uuid, TypeUuidProvider},
|
||||
core::{algebra::Vector2, math::Rect, pool::Handle, reflect::prelude::*, uuid::Uuid},
|
||||
engine::Engine,
|
||||
gui::{
|
||||
message::{KeyCode, MouseButton},
|
||||
@@ -154,7 +154,7 @@ impl EditorSceneEntry {
|
||||
command_stack: CommandStack::new(false, settings.general.max_history_entries),
|
||||
};
|
||||
|
||||
entry.set_interaction_mode(engine, Some(MoveInteractionMode::type_uuid()));
|
||||
entry.set_interaction_mode(engine, Some(MoveInteractionMode::type_info().type_uuid));
|
||||
|
||||
entry
|
||||
}
|
||||
@@ -190,7 +190,7 @@ impl EditorSceneEntry {
|
||||
command_stack: CommandStack::new(false, settings.general.max_history_entries),
|
||||
};
|
||||
|
||||
entry.set_interaction_mode(engine, Some(UiSelectInteractionMode::type_uuid()));
|
||||
entry.set_interaction_mode(engine, Some(UiSelectInteractionMode::type_info().type_uuid));
|
||||
|
||||
entry
|
||||
}
|
||||
|
||||
@@ -35,7 +35,6 @@ use crate::{
|
||||
pool::{ErasedHandle, Handle},
|
||||
reflect::Reflect,
|
||||
visitor::Visitor,
|
||||
Uuid,
|
||||
},
|
||||
engine::{Engine, SerializationContext},
|
||||
fxhash::FxHashSet,
|
||||
@@ -97,6 +96,7 @@ use crate::{
|
||||
Message, Settings,
|
||||
};
|
||||
use fyrox::core::blank_reflect_ref;
|
||||
use fyrox::core::uuid::Uuid;
|
||||
use fyrox::engine::GraphicsContext;
|
||||
use fyrox::gui::file_browser::FileType;
|
||||
use fyrox::scene::collider::BitMask;
|
||||
@@ -1207,7 +1207,7 @@ impl dyn SelectionContainer {
|
||||
pub struct Selection(pub Option<Box<dyn SelectionContainer>>);
|
||||
|
||||
impl Reflect for &'static mut Selection {
|
||||
blank_reflect_ref!();
|
||||
blank_reflect_ref!("f740f60a-ade1-4357-ac6f-7088e9189518");
|
||||
}
|
||||
|
||||
impl PartialEq for Selection {
|
||||
|
||||
@@ -31,6 +31,7 @@ use super::*;
|
||||
/// null scene.
|
||||
#[derive(Reflect, Debug)]
|
||||
#[reflect(non_cloneable)]
|
||||
#[reflect(type_uuid = "09ba866d-db75-46fb-938b-b3cc583f4469")]
|
||||
pub struct NullSceneContext {
|
||||
pub selection: &'static mut Selection,
|
||||
pub message_sender: MessageSender,
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
use crate::fyrox::{
|
||||
core::{
|
||||
make_pretty_type_name, parking_lot::Mutex, pool::Handle, reflect::prelude::*,
|
||||
sstorage::ImmutableString, uuid_provider, visitor::prelude::*,
|
||||
sstorage::ImmutableString, visitor::prelude::*,
|
||||
},
|
||||
fxhash::FxHashSet,
|
||||
graph::SceneGraph,
|
||||
@@ -291,7 +291,10 @@ where
|
||||
}
|
||||
|
||||
#[derive(Clone, Visit, Reflect, Debug)]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "8e58e123-48a1-4e18-9e90-fd35a1669bdc"
|
||||
)]
|
||||
pub struct PropertySelector {
|
||||
widget: Widget,
|
||||
#[reflect(hidden)]
|
||||
@@ -304,8 +307,6 @@ pub struct PropertySelector {
|
||||
|
||||
define_widget_deref!(PropertySelector);
|
||||
|
||||
uuid_provider!(PropertySelector = "8e58e123-48a1-4e18-9e90-fd35a1669bdc");
|
||||
|
||||
impl PropertySelector {
|
||||
fn find_selected_tree_items(&self, ui: &UserInterface) -> Vec<Handle<Tree>> {
|
||||
let mut stack = vec![self.tree_root.to_base()];
|
||||
@@ -480,7 +481,10 @@ impl PropertySelectorBuilder {
|
||||
}
|
||||
|
||||
#[derive(Clone, Visit, Reflect, Debug)]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "725e4a10-eca6-4345-9833-d54dae2f20f2"
|
||||
)]
|
||||
pub struct PropertySelectorWindow {
|
||||
window: Window,
|
||||
selector: Handle<PropertySelector>,
|
||||
@@ -515,8 +519,6 @@ impl PropertySelectorWindow {
|
||||
}
|
||||
}
|
||||
|
||||
uuid_provider!(PropertySelectorWindow = "725e4a10-eca6-4345-9833-d54dae2f20f2");
|
||||
|
||||
impl Control for PropertySelectorWindow {
|
||||
control_trait_proxy_impls!(window);
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ use crate::{
|
||||
fyrox::{
|
||||
core::{
|
||||
parking_lot::Mutex, pool::ErasedHandle, pool::Handle, reflect::prelude::*,
|
||||
type_traits::prelude::*, visitor::prelude::*,
|
||||
visitor::prelude::*,
|
||||
},
|
||||
fxhash::FxHashSet,
|
||||
graph::{SceneGraph, SceneGraphNode},
|
||||
@@ -159,6 +159,7 @@ impl HierarchyNode {
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Visit, Reflect)]
|
||||
#[reflect(type_uuid = "760fdb9d-45f6-4fc1-9fa0-86a802a40a1f")]
|
||||
pub struct SelectedHandle {
|
||||
#[visit(skip)]
|
||||
#[reflect(hidden)]
|
||||
@@ -206,9 +207,9 @@ struct TreeData {
|
||||
pub derived_type_ids: Vec<TypeId>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Visit, Reflect, TypeUuidProvider)]
|
||||
#[derive(Debug, Clone, Visit, Reflect)]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
#[type_uuid(id = "1d718f90-323c-492d-b057-98d47495900a")]
|
||||
#[reflect(type_uuid = "1d718f90-323c-492d-b057-98d47495900a")]
|
||||
pub struct NodeSelector {
|
||||
widget: Widget,
|
||||
tree_root: Handle<TreeRoot>,
|
||||
@@ -427,8 +428,8 @@ impl NodeSelectorBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Visit, Reflect, TypeUuidProvider)]
|
||||
#[type_uuid(id = "5bb00f15-d6ec-4f0e-af7e-9472b0e290b4")]
|
||||
#[derive(Debug, Clone, Visit, Reflect)]
|
||||
#[reflect(type_uuid = "5bb00f15-d6ec-4f0e-af7e-9472b0e290b4")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
pub struct NodeSelectorWindow {
|
||||
window: Window,
|
||||
|
||||
@@ -23,6 +23,7 @@ use fyrox_build_tools::BuildProfile;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Deserialize, Serialize, PartialEq, Clone, Debug, Reflect)]
|
||||
#[reflect(type_uuid = "09af1ddc-e918-47a9-af8a-0261927ff022")]
|
||||
pub struct BuildSettings {
|
||||
#[reflect(hidden)]
|
||||
pub selected_profile: usize,
|
||||
|
||||
@@ -36,6 +36,7 @@ fn default_zoom_range() -> Range<f32> {
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, PartialEq, Clone, Debug, Reflect)]
|
||||
#[reflect(type_uuid = "f468bb97-6017-4b43-b369-94374ecc4239")]
|
||||
pub struct CameraSettings {
|
||||
#[serde(default)]
|
||||
pub speed: f32,
|
||||
|
||||
@@ -22,6 +22,7 @@ use crate::fyrox::core::reflect::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Deserialize, Serialize, PartialEq, Clone, Debug, Reflect)]
|
||||
#[reflect(type_uuid = "7bfe6c22-7113-41df-b5d9-ec1215a724eb")]
|
||||
pub struct DebuggingSettings {
|
||||
pub show_physics: bool,
|
||||
pub show_bounds: bool,
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
use crate::fyrox::core::{reflect::prelude::*, type_traits::prelude::*, uuid_provider};
|
||||
use crate::fyrox::core::reflect::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use strum_macros::{AsRefStr, EnumString, VariantNames};
|
||||
|
||||
@@ -37,15 +37,15 @@ use strum_macros::{AsRefStr, EnumString, VariantNames};
|
||||
AsRefStr,
|
||||
EnumString,
|
||||
VariantNames,
|
||||
TypeUuidProvider,
|
||||
)]
|
||||
#[type_uuid(id = "35e8d30d-1213-4d87-905e-19d48550e6d5")]
|
||||
#[reflect(type_uuid = "35e8d30d-1213-4d87-905e-19d48550e6d5")]
|
||||
pub enum EditorStyle {
|
||||
Dark,
|
||||
Light,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, PartialEq, Clone, Debug, Reflect)]
|
||||
#[reflect(type_uuid = "9f97ae95-85bd-4fe8-9b80-7d45417df7c8")]
|
||||
pub struct GeneralSettings {
|
||||
/// Defines whether the editor checks for references to an object that is about to be deleted or not.
|
||||
pub show_node_removal_dialog: bool,
|
||||
@@ -123,6 +123,7 @@ fn default_generate_previews() -> bool {
|
||||
EnumString,
|
||||
VariantNames,
|
||||
)]
|
||||
#[reflect(type_uuid = "d0c942e8-24e4-40f2-ad2e-1b9f189d3ca2")]
|
||||
pub enum ScriptEditor {
|
||||
SystemDefault,
|
||||
VSCode,
|
||||
@@ -131,8 +132,6 @@ pub enum ScriptEditor {
|
||||
Zed,
|
||||
}
|
||||
|
||||
uuid_provider!(ScriptEditor = "d0c942e8-24e4-40f2-ad2e-1b9f189d3ca2");
|
||||
|
||||
impl Default for GeneralSettings {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
|
||||
@@ -22,6 +22,7 @@ use crate::fyrox::{core::reflect::prelude::*, renderer::QualitySettings};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Deserialize, Serialize, PartialEq, Debug, Clone, Reflect)]
|
||||
#[reflect(type_uuid = "e748b2e7-9d51-4c9b-bb88-ada78bcfa447")]
|
||||
pub struct GraphicsSettings {
|
||||
pub quality: QualitySettings,
|
||||
pub z_near: f32,
|
||||
|
||||
@@ -29,6 +29,7 @@ use fyrox::gui::message::KeyboardModifiers;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Deserialize, Serialize, PartialEq, Clone, Debug, Reflect)]
|
||||
#[reflect(type_uuid = "fbcdc91c-ba63-4d24-b604-c8ffd58834bf")]
|
||||
pub struct TerrainKeyBindings {
|
||||
pub modify_height_map_mode: HotKey,
|
||||
pub draw_on_mask_mode: HotKey,
|
||||
@@ -42,6 +43,7 @@ pub struct TerrainKeyBindings {
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, PartialEq, Clone, Debug, Reflect)]
|
||||
#[reflect(type_uuid = "82d67946-8b7b-41f0-9520-5d4a927aa68f")]
|
||||
pub struct KeyBindings {
|
||||
pub move_forward: KeyBinding,
|
||||
pub move_back: KeyBinding,
|
||||
|
||||
@@ -22,6 +22,7 @@ use crate::fyrox::core::reflect::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Deserialize, Serialize, PartialEq, Debug, Clone, Reflect)]
|
||||
#[reflect(type_uuid = "e7c93c38-c6aa-4be3-ab9c-85666b976763")]
|
||||
pub struct LogSettings {
|
||||
pub log_info: bool,
|
||||
pub log_warning: bool,
|
||||
|
||||
@@ -57,6 +57,7 @@ pub mod selection;
|
||||
pub mod windows;
|
||||
|
||||
#[derive(Deserialize, Serialize, PartialEq, Clone, Default, Debug, Reflect)]
|
||||
#[reflect(type_uuid = "8b5064fc-e25b-442c-af34-67b12b6f9e66")]
|
||||
pub struct SettingsData {
|
||||
#[reflect(tag = "Group.Selection")]
|
||||
pub selection: SelectionSettings,
|
||||
|
||||
@@ -22,6 +22,7 @@ use crate::fyrox::core::{algebra::Vector3, reflect::prelude::*};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Deserialize, Serialize, PartialEq, Clone, Debug, Reflect)]
|
||||
#[reflect(type_uuid = "126ee9c2-3b75-4fcf-ba25-dcb6c3a0d158")]
|
||||
pub struct ModelSettings {
|
||||
/// Initial scale the root of the instance will have after instantiation. Useful when you have
|
||||
/// lots of huge models and don't want to rescale them manually.
|
||||
|
||||
@@ -22,6 +22,7 @@ use crate::fyrox::core::{algebra::Vector3, math, reflect::prelude::*};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Deserialize, Serialize, PartialEq, Debug, Clone, Reflect)]
|
||||
#[reflect(type_uuid = "cb860a68-31ca-4327-8769-082b97a200c1")]
|
||||
pub struct MoveInteractionModeSettings {
|
||||
pub grid_snapping: bool,
|
||||
pub x_snap_step: f32,
|
||||
|
||||
@@ -22,6 +22,7 @@ use crate::fyrox::core::reflect::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Deserialize, Serialize, PartialEq, Clone, Debug, Reflect)]
|
||||
#[reflect(type_uuid = "e2432bfe-3204-48e3-9cab-607443246e10")]
|
||||
pub struct NavmeshSettings {
|
||||
/// Show all navigational meshes in scene. With this function turned off, only currently edited
|
||||
/// navmesh will be shown.
|
||||
|
||||
@@ -22,6 +22,7 @@ use crate::fyrox::core::reflect::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Deserialize, Serialize, PartialEq, Debug, Clone, Reflect)]
|
||||
#[reflect(type_uuid = "dd762679-f378-4e0f-9957-cb57277537d6")]
|
||||
pub struct RotateInteractionModeSettings {
|
||||
pub angle_snapping: bool,
|
||||
pub x_snap_step: f32,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user