/// <inheritdoc /> public CollisionDataWindow(Editor editor, AssetItem item) : base(editor, item) { // Toolstrip _toolstrip.AddSeparator(); _toolstrip.AddButton(editor.Icons.Docs32, () => Platform.StartProcess(Utilities.Constants.DocsUrl + "manual/physics/colliders/collision-data.html")).LinkTooltip("See documentation to learn more"); // Split Panel _split = new SplitPanel(Orientation.Horizontal, ScrollBars.None, ScrollBars.Vertical) { DockStyle = DockStyle.Fill, SplitterValue = 0.7f, Parent = this }; // Model preview _preview = new ModelPreview(true) { ViewportCamera = new FPSCamera(), Parent = _split.Panel1 }; // Asset properties _propertiesPresenter = new CustomEditorPresenter(null); _propertiesPresenter.Panel.Parent = _split.Panel2; _properties = new PropertiesProxy(); _propertiesPresenter.Select(_properties); }
/// <inheritdoc /> public AudioClipWindow(Editor editor, AssetItem item) : base(editor, item) { // Split Panel _split = new SplitPanel(Orientation.Horizontal, ScrollBars.None, ScrollBars.Vertical) { DockStyle = DockStyle.Fill, SplitterValue = 0.7f, Parent = this }; // AudioClip preview _preview = new AudioClipPreview() { Parent = _split.Panel1 }; // AudioClip properties editor _propertiesEditor = new CustomEditorPresenter(null); _propertiesEditor.Panel.Parent = _split.Panel2; _properties = new PropertiesProxy(); _propertiesEditor.Select(_properties); // Toolstrip _toolstrip.AddButton(Editor.UI.GetIcon("Import32"), () => Editor.ContentImporting.Reimport((BinaryAssetItem)Item)).LinkTooltip("Reimport"); }
/// <inheritdoc /> public GameplayGlobalsWindow(Editor editor, AssetItem item) : base(editor, item) { _undo = new Undo(); _undo.ActionDone += OnUndo; _undo.UndoDone += OnUndo; _undo.RedoDone += OnUndo; var panel = new Panel(ScrollBars.Vertical) { AnchorPreset = AnchorPresets.StretchAll, Offsets = new Margin(0, 0, _toolstrip.Bottom, 0), Parent = this, }; _propertiesEditor = new CustomEditorPresenter(_undo); _propertiesEditor.Panel.Parent = panel; _propertiesEditor.Modified += OnPropertiesEditorModified; _proxy = new PropertiesProxy(); _propertiesEditor.Select(_proxy); _saveButton = (ToolStripButton)_toolstrip.AddButton(editor.Icons.Save32, Save).LinkTooltip("Save asset"); _toolstrip.AddSeparator(); _undoButton = (ToolStripButton)_toolstrip.AddButton(Editor.Icons.Undo32, _undo.PerformUndo).LinkTooltip("Undo (Ctrl+Z)"); _redoButton = (ToolStripButton)_toolstrip.AddButton(Editor.Icons.Redo32, _undo.PerformRedo).LinkTooltip("Redo (Ctrl+Y)"); _toolstrip.AddSeparator(); _resetButton = (ToolStripButton)_toolstrip.AddButton(editor.Icons.Rotate32, Reset).LinkTooltip("Resets the variables values to the default values"); InputActions.Add(options => options.Save, Save); InputActions.Add(options => options.Undo, _undo.PerformUndo); InputActions.Add(options => options.Redo, _undo.PerformRedo); }
/// <inheritdoc /> public TextureWindow(Editor editor, AssetItem item) : base(editor, item) { // Toolstrip _toolstrip.AddButton(1, Editor.UI.GetIcon("Save32")).LinkTooltip("Save"); _toolstrip.AddButton(2, Editor.UI.GetIcon("Import32")).LinkTooltip("Reimport"); _toolstrip.AddSeparator(); _toolstrip.AddButton(5, Editor.UI.GetIcon("PageScale32")).LinkTooltip("Center view"); // Split Panel var splitPanel = new SplitPanel(Orientation.Horizontal, ScrollBars.None, ScrollBars.Vertical) { DockStyle = DockStyle.Fill, SplitterValue = 0.7f, Parent = this }; // Texture preview _preview = new TexturePreview(true) { Parent = splitPanel.Panel1 }; // Texture properties editor _propertiesEditor = new CustomEditorPresenter(null); _propertiesEditor.Panel.Parent = splitPanel.Panel2; _properties = new PropertiesProxy(); _propertiesEditor.Select(_properties); }
/// <inheritdoc /> public TextureWindow(Editor editor, AssetItem item) : base(editor, item) { // Split Panel _split = new SplitPanel(Orientation.Horizontal, ScrollBars.None, ScrollBars.Vertical) { DockStyle = DockStyle.Fill, SplitterValue = 0.7f, Parent = this }; // Texture preview _preview = new TexturePreview(true) { Parent = _split.Panel1 }; // Texture properties editor _propertiesEditor = new CustomEditorPresenter(null); _propertiesEditor.Panel.Parent = _split.Panel2; _properties = new PropertiesProxy(); _propertiesEditor.Select(_properties); // Toolstrip _toolstrip.AddButton(Editor.Icons.Import32, () => Editor.ContentImporting.Reimport((BinaryAssetItem)Item)).LinkTooltip("Reimport"); _toolstrip.AddSeparator(); _toolstrip.AddButton(Editor.Icons.PageScale32, _preview.CenterView).LinkTooltip("Center view"); _toolstrip.AddSeparator(); _toolstrip.AddButton(editor.Icons.Docs32, () => Platform.StartProcess(Utilities.Constants.DocsUrl + "manual/graphics/textures/index.html")).LinkTooltip("See documentation to learn more"); }
/// <inheritdoc /> public AudioClipWindow(Editor editor, AssetItem item) : base(editor, item) { // Split Panel _split = new SplitPanel(Orientation.Horizontal, ScrollBars.None, ScrollBars.Vertical) { AnchorPreset = AnchorPresets.StretchAll, Offsets = new Margin(0, 0, _toolstrip.Bottom, 0), SplitterValue = 0.7f, Parent = this }; // Preview _preview = new AudioClipPreview { DrawMode = AudioClipPreview.DrawModes.Fill, AnchorPreset = AnchorPresets.StretchAll, Offsets = Margin.Zero, Parent = _split.Panel1 }; // Properties editor _propertiesEditor = new CustomEditorPresenter(null); _propertiesEditor.Panel.Parent = _split.Panel2; _properties = new PropertiesProxy(); _propertiesEditor.Select(_properties); // Toolstrip _toolstrip.AddButton(Editor.Icons.Import64, () => Editor.ContentImporting.Reimport((BinaryAssetItem)Item)).LinkTooltip("Reimport"); _toolstrip.AddSeparator(); _playButton = (ToolStripButton)_toolstrip.AddButton(Editor.Icons.Play64, OnPlay).LinkTooltip("Play/stop audio"); _pauseButton = (ToolStripButton)_toolstrip.AddButton(Editor.Icons.Pause64, OnPause).LinkTooltip("Pause audio"); _toolstrip.AddSeparator(); _toolstrip.AddButton(editor.Icons.Docs64, () => Platform.OpenUrl(Utilities.Constants.DocsUrl + "manual/audio/audio-clip.html")).LinkTooltip("See documentation to learn more"); }
/// <inheritdoc /> public TextureWindow(Editor editor, AssetItem item) : base(editor, item) { // Split Panel _split = new SplitPanel(Orientation.Horizontal, ScrollBars.None, ScrollBars.Vertical) { AnchorPreset = AnchorPresets.StretchAll, Offsets = new Margin(0, 0, _toolstrip.Bottom, 0), SplitterValue = 0.7f, Parent = this }; // Texture preview _preview = new TexturePreview(true) { Parent = _split.Panel1 }; // Texture properties editor _propertiesEditor = new CustomEditorPresenter(null); _propertiesEditor.Panel.Parent = _split.Panel2; _properties = new PropertiesProxy(); _propertiesEditor.Select(_properties); // Toolstrip _saveButton = (ToolStripButton)_toolstrip.AddButton(Editor.Icons.Save64, Save).LinkTooltip("Save"); _toolstrip.AddButton(Editor.Icons.Import64, () => Editor.ContentImporting.Reimport((BinaryAssetItem)Item)).LinkTooltip("Reimport"); _toolstrip.AddSeparator(); _toolstrip.AddButton(Editor.Icons.CenterView64, _preview.CenterView).LinkTooltip("Center view"); _toolstrip.AddSeparator(); _toolstrip.AddButton(editor.Icons.Docs64, () => Platform.OpenUrl(Utilities.Constants.DocsUrl + "manual/graphics/textures/index.html")).LinkTooltip("See documentation to learn more"); }
/// <inheritdoc /> public AudioClipWindow(Editor editor, AssetItem item) : base(editor, item) { // Split Panel _split = new SplitPanel(Orientation.Horizontal, ScrollBars.None, ScrollBars.Vertical) { DockStyle = DockStyle.Fill, SplitterValue = 0.7f, Parent = this }; // AudioClip preview _preview = new AudioClipPreview { DrawMode = AudioClipPreview.DrawModes.Fill, DockStyle = DockStyle.Fill, Parent = _split.Panel1 }; // AudioClip properties editor _propertiesEditor = new CustomEditorPresenter(null); _propertiesEditor.Panel.Parent = _split.Panel2; _properties = new PropertiesProxy(); _propertiesEditor.Select(_properties); // Toolstrip _toolstrip.AddButton(Editor.Icons.Import32, () => Editor.ContentImporting.Reimport((BinaryAssetItem)Item)).LinkTooltip("Reimport"); _toolstrip.AddSeparator(); _toolstrip.AddButton(editor.Icons.Docs32, () => Platform.StartProcess(Utilities.Constants.DocsUrl + "manual/audio/audio-clip.html")).LinkTooltip("See documentation to learn more"); }
public override void Initialize(LayoutElementsContainer layout) { _proxy = (PropertiesProxy)Values[0]; if (_proxy?.DefaultValues == null) { layout.Label("Loading...", TextAlignment.Center); return; } var isPlayModeActive = _proxy.Window.Editor.StateMachine.IsPlayMode; if (isPlayModeActive) { layout.Label("Play mode is active. Editing runtime values.", TextAlignment.Center); layout.Space(10); foreach (var e in _proxy.DefaultValues) { var name = e.Key; var value = _proxy.Asset.GetValue(name); var valueContainer = new VariableValueContainer(_proxy, name, value, false); var propertyLabel = new PropertyNameLabel(name) { Tag = name, }; string tooltip = null; if (_proxy.DefaultValues.TryGetValue(name, out var defaultValue)) { tooltip = "Default value: " + defaultValue; } layout.Object(propertyLabel, valueContainer, null, tooltip); } } else { foreach (var e in _proxy.DefaultValues) { var name = e.Key; var value = e.Value; var valueContainer = new VariableValueContainer(_proxy, name, value, true); var propertyLabel = new ClickablePropertyNameLabel(name) { Tag = name, }; propertyLabel.MouseLeftDoubleClick += (label, location) => StartParameterRenaming(name, label); propertyLabel.SetupContextMenu += OnPropertyLabelSetupContextMenu; layout.Object(propertyLabel, valueContainer, null, "Type: " + CustomEditorsUtil.GetTypeNameUI(value.GetType())); } // TODO: improve the UI layout.Space(40); var addParamType = layout.ComboBox().ComboBox; addParamType.Items = AllowedTypes.Select(CustomEditorsUtil.GetTypeNameUI).ToList(); addParamType.SelectedIndex = 0; _addParamType = addParamType; var addParamButton = layout.Button("Add").Button; addParamButton.Clicked += OnAddParamButtonClicked; } }
public VariableValueContainer(PropertiesProxy proxy, string name, object value, bool isDefault) : base(ScriptMemberInfo.Null, new ScriptType(value.GetType())) { _proxy = proxy; _name = name; _isDefault = isDefault; Add(value); }
public VariableValueContainer(PropertiesProxy proxy, string name, object value, bool isDefault) : base(null, value.GetType()) { _proxy = proxy; _name = name; _isDefault = isDefault; Add(value); }
/// <inheritdoc /> public override void OnDestroy() { base.OnDestroy(); _inputText = null; _textPreview = null; _propertiesEditor = null; _proxy = null; _saveButton = null; }
public CookData(PropertiesProxy proxy, string resultUrl, CollisionDataType type, Model model, int modelLodIndex, ConvexMeshGenerationFlags convexFlags, int convexVertexLimit) : base("Collision Data", resultUrl) { Proxy = proxy; Type = type; Model = model; ModelLodIndex = modelLodIndex; ConvexFlags = convexFlags; ConvexVertexLimit = convexVertexLimit; }
/// <inheritdoc /> public override void OnDestroy() { base.OnDestroy(); _undo = null; _propertiesEditor = null; _proxy = null; _saveButton = null; _undoButton = null; _redoButton = null; _resetButton = null; }
/// <inheritdoc /> public MaterialWindow(Editor editor, AssetItem item) : base(editor, item) { // Split Panel 1 _split1 = new SplitPanel(Orientation.Horizontal, ScrollBars.None, ScrollBars.None) { DockStyle = DockStyle.Fill, SplitterValue = 0.7f, Parent = this }; // Split Panel 2 _split2 = new SplitPanel(Orientation.Vertical, ScrollBars.None, ScrollBars.Vertical) { DockStyle = DockStyle.Fill, SplitterValue = 0.4f, Parent = _split1.Panel2 }; // Material preview _preview = new MaterialPreview(true) { Parent = _split2.Panel1 }; // Material properties editor var propertiesEditor = new CustomEditorPresenter(null); propertiesEditor.Panel.Parent = _split2.Panel2; _properties = new PropertiesProxy(); propertiesEditor.Select(_properties); propertiesEditor.Modified += OnMaterialPropertyEdited; // Surface _surface = new MaterialSurface(this, Save) { Parent = _split1.Panel1, Enabled = false }; // Toolstrip _saveButton = (ToolStripButton)_toolstrip.AddButton(Editor.Icons.Save32, Save).LinkTooltip("Save"); _toolstrip.AddSeparator(); _toolstrip.AddButton(editor.Icons.PageScale32, _surface.ShowWholeGraph).LinkTooltip("Show whole graph"); _toolstrip.AddSeparator(); _toolstrip.AddButton(editor.Icons.BracketsSlash32, () => ShowSourceCode(_asset)).LinkTooltip("Show generated shader source code"); _toolstrip.AddButton(editor.Icons.Docs32, () => Application.StartProcess(Utilities.Constants.DocsUrl + "manual/graphics/materials/index.html")).LinkTooltip("See documentation to learn more"); }
/// <inheritdoc /> public AnimationWindow(Editor editor, AssetItem item) : base(editor, item) { _panel = new Panel(ScrollBars.Vertical) { DockStyle = DockStyle.Fill, Parent = this }; // Asset properties _propertiesPresenter = new CustomEditorPresenter(null); _propertiesPresenter.Panel.Parent = _panel; _properties = new PropertiesProxy(); _propertiesPresenter.Select(_properties); _propertiesPresenter.Modified += MarkAsEdited; }
/// <inheritdoc /> public AnimationWindow(Editor editor, AssetItem item) : base(editor, item) { // Undo _undo = new Undo(); _undo.UndoDone += OnUndoRedo; _undo.RedoDone += OnUndoRedo; _undo.ActionDone += OnUndoRedo; // Main panel _panel = new SplitPanel(Orientation.Horizontal, ScrollBars.None, ScrollBars.Vertical) { AnchorPreset = AnchorPresets.StretchAll, SplitterValue = 0.8f, Offsets = new Margin(0, 0, _toolstrip.Bottom, 0), Parent = this }; // Timeline _timeline = new AnimationTimeline(_undo) { AnchorPreset = AnchorPresets.StretchAll, Offsets = Margin.Zero, Parent = _panel.Panel1, Enabled = false }; _timeline.Modified += MarkAsEdited; // Asset properties _propertiesPresenter = new CustomEditorPresenter(null); _propertiesPresenter.Panel.Parent = _panel.Panel2; _properties = new PropertiesProxy(); _propertiesPresenter.Select(_properties); _propertiesPresenter.Modified += MarkAsEdited; // Toolstrip _saveButton = (ToolStripButton)_toolstrip.AddButton(Editor.Icons.Save32, Save).LinkTooltip("Save"); _toolstrip.AddSeparator(); _undoButton = (ToolStripButton)_toolstrip.AddButton(Editor.Icons.Undo32, _undo.PerformUndo).LinkTooltip("Undo (Ctrl+Z)"); _redoButton = (ToolStripButton)_toolstrip.AddButton(Editor.Icons.Redo32, _undo.PerformRedo).LinkTooltip("Redo (Ctrl+Y)"); _toolstrip.AddSeparator(); _toolstrip.AddButton(editor.Icons.Docs32, () => Platform.OpenUrl(Utilities.Constants.DocsUrl + "manual/animation/animation/index.html")).LinkTooltip("See documentation to learn more"); // Setup input actions InputActions.Add(options => options.Undo, _undo.PerformUndo); InputActions.Add(options => options.Redo, _undo.PerformRedo); }
/// <inheritdoc /> public AnimationWindow(Editor editor, AssetItem item) : base(editor, item) { _panel = new Panel(ScrollBars.Vertical) { AnchorPreset = AnchorPresets.StretchAll, Offsets = new Margin(0, 0, _toolstrip.Bottom, 0), Parent = this }; // Asset properties _propertiesPresenter = new CustomEditorPresenter(null); _propertiesPresenter.Panel.Parent = _panel; _properties = new PropertiesProxy(); _propertiesPresenter.Select(_properties); _propertiesPresenter.Modified += MarkAsEdited; }
/// <inheritdoc /> public FontAssetWindow(Editor editor, AssetItem item) : base(editor, item) { var panel1 = new SplitPanel(Orientation.Horizontal, ScrollBars.Vertical) { AnchorPreset = AnchorPresets.StretchAll, Offsets = new Margin(0, 0, _toolstrip.Bottom, 0), SplitterValue = 0.7f, Parent = this }; var panel2 = new SplitPanel(Orientation.Vertical, ScrollBars.Vertical) { AnchorPreset = AnchorPresets.StretchAll, Offsets = Margin.Zero, SplitterValue = 0.2f, Parent = panel1.Panel1 }; // Text preview _inputText = new TextBox(true, 0, 0) { AnchorPreset = AnchorPresets.StretchAll, Parent = panel2.Panel1 }; _inputText.TextChanged += OnTextChanged; _textPreview = new Label { AnchorPreset = AnchorPresets.StretchAll, Offsets = Margin.Zero, Margin = new Margin(4), Wrapping = TextWrapping.WrapWords, HorizontalAlignment = TextAlignment.Near, VerticalAlignment = TextAlignment.Near, Parent = panel2.Panel2 }; // Font asset properties _propertiesEditor = new CustomEditorPresenter(null); _propertiesEditor.Panel.Parent = panel1.Panel2; _propertiesEditor.Modified += OnPropertyEdited; _proxy = new PropertiesProxy(); _propertiesEditor.Select(_proxy); // Toolstrip _saveButton = (ToolStripButton)_toolstrip.AddButton(editor.Icons.Save32, Save).LinkTooltip("Save"); }
/// <inheritdoc /> public MaterialWindow(Editor editor, AssetItem item) : base(editor, item) { // Split Panel 1 _split1 = new SplitPanel(Orientation.Horizontal, ScrollBars.None, ScrollBars.None) { DockStyle = DockStyle.Fill, SplitterValue = 0.7f, Parent = this }; // Split Panel 2 _split2 = new SplitPanel(Orientation.Vertical, ScrollBars.None, ScrollBars.Vertical) { DockStyle = DockStyle.Fill, SplitterValue = 0.4f, Parent = _split1.Panel2 }; // Material preview _preview = new MaterialPreview(true) { Parent = _split2.Panel1 }; // Material properties editor var propertiesEditor = new CustomEditorPresenter(null); propertiesEditor.Panel.Parent = _split2.Panel2; _properties = new PropertiesProxy(); propertiesEditor.Select(_properties); propertiesEditor.Modified += OnMaterialPropertyEdited; // Surface _surface = new VisjectSurface(this, SurfaceType.Material) { Parent = _split1.Panel1, Enabled = false }; // Toolstrip _saveButton = (ToolStripButton)_toolstrip.AddButton(Editor.UI.GetIcon("Save32"), Save).LinkTooltip("Save"); _toolstrip.AddSeparator(); _toolstrip.AddButton(editor.UI.GetIcon("PageScale32"), _surface.ShowWholeGraph).LinkTooltip("Show whole graph"); }
/// <inheritdoc /> public override void OnDestroy() { if (_undo != null) { _undo.Enabled = false; _undo.Clear(); _undo = null; } _timeline = null; _propertiesPresenter = null; _properties = null; _panel = null; _saveButton = null; _undoButton = null; _redoButton = null; base.OnDestroy(); }
/// <inheritdoc /> public CollisionDataWindow(Editor editor, AssetItem item) : base(editor, item) { // Split Panel var splitPanel = new SplitPanel(Orientation.Horizontal, ScrollBars.None, ScrollBars.Vertical) { DockStyle = DockStyle.Fill, SplitterValue = 0.7f, Parent = this }; // Model preview _preview = new ModelPreview(true) { Parent = splitPanel.Panel1 }; // Asset properties _propertiesPresenter = new CustomEditorPresenter(null); _propertiesPresenter.Panel.Parent = splitPanel.Panel2; _properties = new PropertiesProxy(); _propertiesPresenter.Select(_properties); }
/// <inheritdoc /> public void Dispose() { DefaultValue = null; Proxy = null; }