Cleanup 6
This commit is contained in:
@@ -173,7 +173,7 @@ namespace FlaxEditor
|
||||
/// <summary>
|
||||
/// Gets the main transform gizmo used by the <see cref="SceneEditorWindow"/>.
|
||||
/// </summary>
|
||||
public Gizmo.TransformGizmo MainTransformGizmo => Windows.EditWin.Viewport.TransformGizmo;
|
||||
public Gizmo.TransformGizmoBase MainTransformGizmo => Windows.EditWin.Viewport.TransformGizmo;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this Editor is running in `headless` mode. No windows or popups should be shown. Used in CL environment (without a graphical user interface).
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace FlaxEditor.Gizmo
|
||||
/// </summary>
|
||||
/// <seealso cref="TransformGizmoBase" />
|
||||
[HideInEditor]
|
||||
public class TransformGizmo : TransformGizmoBase
|
||||
public class TransformGizmoBase : TransformGizmoBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Applies scale to the selected objects pool.
|
||||
@@ -42,10 +42,10 @@ namespace FlaxEditor.Gizmo
|
||||
public List<SceneGraphNode> SelectedParents => _selectionParents;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="TransformGizmo" /> class.
|
||||
/// Initializes a new instance of the <see cref="TransformGizmoBase" /> class.
|
||||
/// </summary>
|
||||
/// <param name="owner">The gizmos owner.</param>
|
||||
public TransformGizmo(IGizmoOwner owner)
|
||||
public TransformGizmoBase(IGizmoOwner owner)
|
||||
: base(owner)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace FlaxEditor
|
||||
/// <summary>
|
||||
/// Implementation of <see cref="IUndoAction"/> used to transform a selection of <see cref="SceneGraphNode"/>.
|
||||
/// The same logic could be achieved using <see cref="UndoMultiBlock"/> but it would be slower.
|
||||
/// Since we use this kind of action very ofter (for <see cref="FlaxEditor.Gizmo.TransformGizmo"/> operations) it's better to provide faster implementation.
|
||||
/// Since we use this kind of action very ofter (for <see cref="FlaxEditor.Gizmo.TransformGizmoBase"/> operations) it's better to provide faster implementation.
|
||||
/// </summary>
|
||||
/// <seealso cref="FlaxEditor.IUndoAction" />
|
||||
[Serializable]
|
||||
|
||||
@@ -161,7 +161,7 @@ namespace FlaxEditor.Viewport.Cameras
|
||||
Viewport.GetInput(out var input);
|
||||
Viewport.GetPrevInput(out var prevInput);
|
||||
var mainViewport = Viewport as MainEditorGizmoViewport;
|
||||
bool isUsingGizmo = mainViewport != null && mainViewport.TransformGizmo.ActiveAxis != TransformGizmo.Axis.None;
|
||||
bool isUsingGizmo = mainViewport != null && mainViewport.TransformGizmo.ActiveAxis != TransformGizmoBase.Axis.None;
|
||||
|
||||
// Get current view properties
|
||||
float yaw = Viewport.Yaw;
|
||||
@@ -177,8 +177,7 @@ namespace FlaxEditor.Viewport.Cameras
|
||||
// Dolly
|
||||
if (input.IsPanning || input.IsMoving || input.IsRotating)
|
||||
{
|
||||
Vector3 move;
|
||||
Vector3.Transform(ref moveDelta, ref rotation, out move);
|
||||
Vector3.Transform(ref moveDelta, ref rotation, out Vector3 move);
|
||||
position += move;
|
||||
}
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ namespace FlaxEditor.Viewport
|
||||
/// <summary>
|
||||
/// The transform gizmo.
|
||||
/// </summary>
|
||||
public readonly TransformGizmo TransformGizmo;
|
||||
public readonly TransformGizmoBase TransformGizmo;
|
||||
|
||||
/// <summary>
|
||||
/// The grid gizmo.
|
||||
@@ -196,7 +196,7 @@ namespace FlaxEditor.Viewport
|
||||
Task.CustomPostFx.Add(_editorSpritesRenderer);
|
||||
|
||||
// Add transformation gizmo
|
||||
TransformGizmo = new TransformGizmo(this);
|
||||
TransformGizmo = new TransformGizmoBase(this);
|
||||
TransformGizmo.ApplyTransformation += ApplyTransform;
|
||||
TransformGizmo.ModeChanged += OnGizmoModeChanged;
|
||||
TransformGizmo.Duplicate += Editor.Instance.SceneEditing.Duplicate;
|
||||
@@ -833,8 +833,7 @@ namespace FlaxEditor.Viewport
|
||||
|
||||
private Vector3 PostProcessSpawnedActorLocation(Actor actor, ref Vector3 hitLocation)
|
||||
{
|
||||
BoundingBox box;
|
||||
Editor.GetActorEditorBox(actor, out box);
|
||||
Editor.GetActorEditorBox(actor, out BoundingBox box);
|
||||
|
||||
// Place the object
|
||||
//var location = hitLocation - (box.Size.Length * 0.5f) * ViewDirection;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace FlaxEditor.Viewport.Modes
|
||||
{
|
||||
/// <summary>
|
||||
/// The default editor mode that uses <see cref="FlaxEditor.Gizmo.TransformGizmo"/> for objects transforming.
|
||||
/// The default editor mode that uses <see cref="FlaxEditor.Gizmo.TransformGizmoBase"/> for objects transforming.
|
||||
/// </summary>
|
||||
/// <seealso cref="FlaxEditor.Viewport.Modes.EditorGizmoMode" />
|
||||
public class TransformGizmoMode : EditorGizmoMode
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace FlaxEditor.Viewport
|
||||
/// <summary>
|
||||
/// The transform gizmo.
|
||||
/// </summary>
|
||||
public readonly TransformGizmo TransformGizmo;
|
||||
public readonly TransformGizmoBase TransformGizmo;
|
||||
|
||||
/// <summary>
|
||||
/// The selection outline postFx.
|
||||
@@ -82,7 +82,7 @@ namespace FlaxEditor.Viewport
|
||||
Task.CustomPostFx.Add(EditorPrimitives);
|
||||
|
||||
// Add transformation gizmo
|
||||
TransformGizmo = new TransformGizmo(this);
|
||||
TransformGizmo = new TransformGizmoBase(this);
|
||||
TransformGizmo.ApplyTransformation += ApplyTransform;
|
||||
TransformGizmo.ModeChanged += OnGizmoModeChanged;
|
||||
TransformGizmo.Duplicate += _window.Duplicate;
|
||||
@@ -92,7 +92,7 @@ namespace FlaxEditor.Viewport
|
||||
var transformSpaceWidget = new ViewportWidgetsContainer(ViewportWidgetLocation.UpperRight);
|
||||
var transformSpaceToggle = new ViewportWidgetButton(string.Empty, window.Editor.Icons.World16, null, true)
|
||||
{
|
||||
Checked = TransformGizmo.ActiveTransformSpace == TransformGizmo.TransformSpace.World,
|
||||
Checked = TransformGizmo.ActiveTransformSpace == TransformGizmoBase.TransformSpace.World,
|
||||
TooltipText = "Gizmo transform space (world or local)",
|
||||
Parent = transformSpaceWidget
|
||||
};
|
||||
@@ -184,7 +184,7 @@ namespace FlaxEditor.Viewport
|
||||
var gizmoMode = new ViewportWidgetsContainer(ViewportWidgetLocation.UpperRight);
|
||||
_gizmoModeTranslate = new ViewportWidgetButton(string.Empty, window.Editor.Icons.Translate16, null, true)
|
||||
{
|
||||
Tag = TransformGizmo.Mode.Translate,
|
||||
Tag = TransformGizmoBase.Mode.Translate,
|
||||
TooltipText = "Translate gizmo mode",
|
||||
Checked = true,
|
||||
Parent = gizmoMode
|
||||
@@ -192,14 +192,14 @@ namespace FlaxEditor.Viewport
|
||||
_gizmoModeTranslate.Toggled += OnGizmoModeToggle;
|
||||
_gizmoModeRotate = new ViewportWidgetButton(string.Empty, window.Editor.Icons.Rotate16, null, true)
|
||||
{
|
||||
Tag = TransformGizmo.Mode.Rotate,
|
||||
Tag = TransformGizmoBase.Mode.Rotate,
|
||||
TooltipText = "Rotate gizmo mode",
|
||||
Parent = gizmoMode
|
||||
};
|
||||
_gizmoModeRotate.Toggled += OnGizmoModeToggle;
|
||||
_gizmoModeScale = new ViewportWidgetButton(string.Empty, window.Editor.Icons.Scale16, null, true)
|
||||
{
|
||||
Tag = TransformGizmo.Mode.Scale,
|
||||
Tag = TransformGizmoBase.Mode.Scale,
|
||||
TooltipText = "Scale gizmo mode",
|
||||
Parent = gizmoMode
|
||||
};
|
||||
@@ -300,7 +300,7 @@ namespace FlaxEditor.Viewport
|
||||
|
||||
private void OnGizmoModeToggle(ViewportWidgetButton button)
|
||||
{
|
||||
TransformGizmo.ActiveMode = (TransformGizmo.Mode)(int)button.Tag;
|
||||
TransformGizmo.ActiveMode = (TransformGizmoBase.Mode)(int)button.Tag;
|
||||
}
|
||||
|
||||
private void OnTranslateSnappingToggle(ViewportWidgetButton button)
|
||||
@@ -327,9 +327,9 @@ namespace FlaxEditor.Viewport
|
||||
{
|
||||
// Update all viewport widgets status
|
||||
var mode = TransformGizmo.ActiveMode;
|
||||
_gizmoModeTranslate.Checked = mode == TransformGizmo.Mode.Translate;
|
||||
_gizmoModeRotate.Checked = mode == TransformGizmo.Mode.Rotate;
|
||||
_gizmoModeScale.Checked = mode == TransformGizmo.Mode.Scale;
|
||||
_gizmoModeTranslate.Checked = mode == TransformGizmoBase.Mode.Translate;
|
||||
_gizmoModeRotate.Checked = mode == TransformGizmoBase.Mode.Rotate;
|
||||
_gizmoModeScale.Checked = mode == TransformGizmoBase.Mode.Scale;
|
||||
}
|
||||
|
||||
private static readonly float[] EditorViewportScaleSnapValues =
|
||||
@@ -458,7 +458,7 @@ namespace FlaxEditor.Viewport
|
||||
public void ApplyTransform(List<SceneGraphNode> selection, ref Vector3 translationDelta, ref Quaternion rotationDelta, ref Vector3 scaleDelta)
|
||||
{
|
||||
bool applyRotation = !rotationDelta.IsIdentity;
|
||||
bool useObjCenter = TransformGizmo.ActivePivot == TransformGizmo.PivotType.ObjectCenter;
|
||||
bool useObjCenter = TransformGizmo.ActivePivot == TransformGizmoBase.PivotType.ObjectCenter;
|
||||
Vector3 gizmoPosition = TransformGizmo.Position;
|
||||
|
||||
// Transform selected objects
|
||||
@@ -524,7 +524,7 @@ namespace FlaxEditor.Viewport
|
||||
if (TransformGizmo.IsActive)
|
||||
{
|
||||
// Ensure player is not moving objects
|
||||
if (TransformGizmo.ActiveAxis != TransformGizmo.Axis.None)
|
||||
if (TransformGizmo.ActiveAxis != TransformGizmoBase.Axis.None)
|
||||
return;
|
||||
}
|
||||
else
|
||||
@@ -645,8 +645,7 @@ namespace FlaxEditor.Viewport
|
||||
|
||||
private Vector3 PostProcessSpawnedActorLocation(Actor actor, ref Vector3 hitLocation)
|
||||
{
|
||||
BoundingBox box;
|
||||
Editor.GetActorEditorBox(actor, out box);
|
||||
Editor.GetActorEditorBox(actor, out BoundingBox box);
|
||||
|
||||
// Place the object
|
||||
var location = hitLocation - (box.Size.Length * 0.5f) * ViewDirection;
|
||||
|
||||
@@ -260,15 +260,13 @@ namespace FlaxEditor.Windows.Assets
|
||||
/// <inheritdoc />
|
||||
public override void OnLayoutDeserialize(XmlElement node)
|
||||
{
|
||||
float value1;
|
||||
Timeline.TimeShowModes value2;
|
||||
bool value3;
|
||||
|
||||
if (float.TryParse(node.GetAttribute("TimelineSplitter"), out value1))
|
||||
if (float.TryParse(node.GetAttribute("TimelineSplitter"), out float value1))
|
||||
_timeline.Splitter.SplitterValue = value1;
|
||||
if (Enum.TryParse(node.GetAttribute("TimeShowMode"), out value2))
|
||||
|
||||
if (Enum.TryParse(node.GetAttribute("TimeShowMode"), out Timeline.TimeShowModes value2))
|
||||
_timeline.TimeShowMode = value2;
|
||||
if (bool.TryParse(node.GetAttribute("ShowPreviewValues"), out value3))
|
||||
|
||||
if (bool.TryParse(node.GetAttribute("ShowPreviewValues"), out bool value3))
|
||||
_timeline.ShowPreviewValues = value3;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,8 +44,7 @@ namespace FlaxEditor.Windows.Assets
|
||||
{
|
||||
var audio = window.Asset;
|
||||
AudioDataInfo info = audio.Info;
|
||||
int originalSize, importedSize;
|
||||
Editor.Internal_GetAudioClipMetadata(FlaxEngine.Object.GetUnmanagedPtr(audio), out originalSize, out importedSize);
|
||||
Editor.Internal_GetAudioClipMetadata(FlaxEngine.Object.GetUnmanagedPtr(audio), out int originalSize, out int importedSize);
|
||||
|
||||
var group = layout.Group("General");
|
||||
group.Label("Format: " + audio.Format);
|
||||
@@ -220,9 +219,7 @@ namespace FlaxEditor.Windows.Assets
|
||||
/// <inheritdoc />
|
||||
public override void OnLayoutDeserialize(XmlElement node)
|
||||
{
|
||||
float value1;
|
||||
|
||||
if (float.TryParse(node.GetAttribute("Split"), out value1))
|
||||
if (float.TryParse(node.GetAttribute("Split"), out float value1))
|
||||
_split.SplitterValue = value1;
|
||||
}
|
||||
|
||||
|
||||
@@ -305,9 +305,7 @@ namespace FlaxEditor.Windows.Assets
|
||||
/// <inheritdoc />
|
||||
public override void OnLayoutDeserialize(XmlElement node)
|
||||
{
|
||||
float value1;
|
||||
|
||||
if (float.TryParse(node.GetAttribute("Split"), out value1))
|
||||
if (float.TryParse(node.GetAttribute("Split"), out float value1))
|
||||
_split.SplitterValue = value1;
|
||||
}
|
||||
|
||||
|
||||
@@ -212,9 +212,7 @@ namespace FlaxEditor.Windows.Assets
|
||||
/// <inheritdoc />
|
||||
public override void OnLayoutDeserialize(XmlElement node)
|
||||
{
|
||||
float value1;
|
||||
|
||||
if (float.TryParse(node.GetAttribute("Split"), out value1))
|
||||
if (float.TryParse(node.GetAttribute("Split"), out float value1))
|
||||
_split.SplitterValue = value1;
|
||||
}
|
||||
|
||||
|
||||
@@ -509,9 +509,7 @@ namespace FlaxEditor.Windows.Assets
|
||||
/// <inheritdoc />
|
||||
public override void OnLayoutDeserialize(XmlElement node)
|
||||
{
|
||||
float value1;
|
||||
|
||||
if (float.TryParse(node.GetAttribute("Split"), out value1))
|
||||
if (float.TryParse(node.GetAttribute("Split"), out float value1))
|
||||
_split.SplitterValue = value1;
|
||||
}
|
||||
|
||||
|
||||
@@ -193,9 +193,7 @@ namespace FlaxEditor.Windows.Assets
|
||||
/// <inheritdoc />
|
||||
public override void OnLayoutDeserialize(XmlElement node)
|
||||
{
|
||||
float value1;
|
||||
|
||||
if (float.TryParse(node.GetAttribute("Split"), out value1))
|
||||
if (float.TryParse(node.GetAttribute("Split"), out float value1))
|
||||
_split.SplitterValue = value1;
|
||||
}
|
||||
|
||||
|
||||
@@ -557,12 +557,12 @@ namespace FlaxEditor.Windows.Assets
|
||||
/// <inheritdoc />
|
||||
public override void OnLayoutDeserialize(XmlElement node)
|
||||
{
|
||||
float value1;
|
||||
|
||||
if (float.TryParse(node.GetAttribute("Split1"), out value1))
|
||||
if (float.TryParse(node.GetAttribute("Split1"), out float value1))
|
||||
_split1.SplitterValue = value1;
|
||||
|
||||
if (float.TryParse(node.GetAttribute("Split2"), out value1))
|
||||
_split2.SplitterValue = value1;
|
||||
|
||||
if (float.TryParse(node.GetAttribute("Split3"), out value1))
|
||||
_timeline.Splitter.SplitterValue = value1;
|
||||
}
|
||||
|
||||
@@ -158,9 +158,9 @@ namespace FlaxEditor.Windows.Assets
|
||||
_toolStripUndo = (ToolStripButton)_toolstrip.AddButton(Editor.Icons.Undo32, _undo.PerformUndo).LinkTooltip("Undo (Ctrl+Z)");
|
||||
_toolStripRedo = (ToolStripButton)_toolstrip.AddButton(Editor.Icons.Redo32, _undo.PerformRedo).LinkTooltip("Redo (Ctrl+Y)");
|
||||
_toolstrip.AddSeparator();
|
||||
_toolStripTranslate = (ToolStripButton)_toolstrip.AddButton(Editor.Icons.Translate32, () => _viewport.TransformGizmo.ActiveMode = TransformGizmo.Mode.Translate).LinkTooltip("Change Gizmo tool mode to Translate (1)");
|
||||
_toolStripRotate = (ToolStripButton)_toolstrip.AddButton(Editor.Icons.Rotate32, () => _viewport.TransformGizmo.ActiveMode = TransformGizmo.Mode.Rotate).LinkTooltip("Change Gizmo tool mode to Rotate (2)");
|
||||
_toolStripScale = (ToolStripButton)_toolstrip.AddButton(Editor.Icons.Scale32, () => _viewport.TransformGizmo.ActiveMode = TransformGizmo.Mode.Scale).LinkTooltip("Change Gizmo tool mode to Scale (3)");
|
||||
_toolStripTranslate = (ToolStripButton)_toolstrip.AddButton(Editor.Icons.Translate32, () => _viewport.TransformGizmo.ActiveMode = TransformGizmoBase.Mode.Translate).LinkTooltip("Change Gizmo tool mode to Translate (1)");
|
||||
_toolStripRotate = (ToolStripButton)_toolstrip.AddButton(Editor.Icons.Rotate32, () => _viewport.TransformGizmo.ActiveMode = TransformGizmoBase.Mode.Rotate).LinkTooltip("Change Gizmo tool mode to Rotate (2)");
|
||||
_toolStripScale = (ToolStripButton)_toolstrip.AddButton(Editor.Icons.Scale32, () => _viewport.TransformGizmo.ActiveMode = TransformGizmoBase.Mode.Scale).LinkTooltip("Change Gizmo tool mode to Scale (3)");
|
||||
_toolstrip.AddSeparator();
|
||||
_toolStripLiveReload = (ToolStripButton)_toolstrip.AddButton(Editor.Icons.Reload32, () => LiveReload = !LiveReload).SetChecked(true).SetAutoCheck(true).LinkTooltip("Live changes preview (applies prefab changes on modification by auto)");
|
||||
|
||||
@@ -311,9 +311,9 @@ namespace FlaxEditor.Windows.Assets
|
||||
_toolStripRedo.Enabled = undoRedo.CanRedo;
|
||||
//
|
||||
var gizmoMode = gizmo.ActiveMode;
|
||||
_toolStripTranslate.Checked = gizmoMode == TransformGizmo.Mode.Translate;
|
||||
_toolStripRotate.Checked = gizmoMode == TransformGizmo.Mode.Rotate;
|
||||
_toolStripScale.Checked = gizmoMode == TransformGizmo.Mode.Scale;
|
||||
_toolStripTranslate.Checked = gizmoMode == TransformGizmoBase.Mode.Translate;
|
||||
_toolStripRotate.Checked = gizmoMode == TransformGizmoBase.Mode.Rotate;
|
||||
_toolStripScale.Checked = gizmoMode == TransformGizmoBase.Mode.Scale;
|
||||
//
|
||||
_toolStripLiveReload.Checked = _liveReload;
|
||||
|
||||
@@ -401,8 +401,7 @@ namespace FlaxEditor.Windows.Assets
|
||||
{
|
||||
_focusCamera = false;
|
||||
|
||||
BoundingSphere bounds;
|
||||
Editor.GetActorEditorSphere(_viewport.Instance, out bounds);
|
||||
Editor.GetActorEditorSphere(_viewport.Instance, out BoundingSphere bounds);
|
||||
_viewport.ViewPosition = bounds.Center - _viewport.ViewDirection * (bounds.Radius * 1.2f);
|
||||
}
|
||||
|
||||
@@ -428,20 +427,17 @@ namespace FlaxEditor.Windows.Assets
|
||||
/// <inheritdoc />
|
||||
public override void OnLayoutDeserialize(XmlElement node)
|
||||
{
|
||||
float value1;
|
||||
|
||||
if (float.TryParse(node.GetAttribute("Split1"), out value1))
|
||||
if (float.TryParse(node.GetAttribute("Split1"), out float value1))
|
||||
_split1.SplitterValue = value1;
|
||||
|
||||
if (float.TryParse(node.GetAttribute("Split2"), out value1))
|
||||
_split2.SplitterValue = value1;
|
||||
|
||||
bool value2;
|
||||
|
||||
if (bool.TryParse(node.GetAttribute("LiveReload"), out value2))
|
||||
if (bool.TryParse(node.GetAttribute("LiveReload"), out bool value2))
|
||||
LiveReload = value2;
|
||||
|
||||
TransformGizmo.Mode value3;
|
||||
if (Enum.TryParse(node.GetAttribute("GizmoMode"), out value3))
|
||||
if (Enum.TryParse(node.GetAttribute("GizmoMode"), out TransformGizmoBase.Mode value3))
|
||||
Viewport.TransformGizmo.ActiveMode = value3;
|
||||
}
|
||||
|
||||
|
||||
@@ -890,19 +890,18 @@ namespace FlaxEditor.Windows.Assets
|
||||
/// <inheritdoc />
|
||||
public override void OnLayoutDeserialize(XmlElement node)
|
||||
{
|
||||
float value1;
|
||||
Guid value2;
|
||||
Timeline.TimeShowModes value3;
|
||||
bool value4;
|
||||
|
||||
if (float.TryParse(node.GetAttribute("TimelineSplitter"), out value1))
|
||||
if (float.TryParse(node.GetAttribute("TimelineSplitter"), out float value1))
|
||||
_timeline.Splitter.SplitterValue = value1;
|
||||
if (Guid.TryParse(node.GetAttribute("SelectedPlayer"), out value2))
|
||||
|
||||
if (Guid.TryParse(node.GetAttribute("SelectedPlayer"), out Guid value2))
|
||||
_cachedPlayerId = value2;
|
||||
if (Enum.TryParse(node.GetAttribute("TimeShowMode"), out value3))
|
||||
|
||||
if (Enum.TryParse(node.GetAttribute("TimeShowMode"), out Timeline.TimeShowModes value3))
|
||||
_timeline.TimeShowMode = value3;
|
||||
if (bool.TryParse(node.GetAttribute("ShowPreviewValues"), out value4))
|
||||
|
||||
if (bool.TryParse(node.GetAttribute("ShowPreviewValues"), out bool value4))
|
||||
_timeline.ShowPreviewValues = value4;
|
||||
|
||||
if (bool.TryParse(node.GetAttribute("ShowSelected3dTrack"), out value4))
|
||||
_timeline.ShowSelected3dTrack = value4;
|
||||
}
|
||||
|
||||
@@ -296,9 +296,7 @@ namespace FlaxEditor.Windows.Assets
|
||||
/// <inheritdoc />
|
||||
public override void OnLayoutDeserialize(XmlElement node)
|
||||
{
|
||||
float value1;
|
||||
|
||||
if (float.TryParse(node.GetAttribute("Split"), out value1))
|
||||
if (float.TryParse(node.GetAttribute("Split"), out float value1))
|
||||
_split.SplitterValue = value1;
|
||||
}
|
||||
|
||||
|
||||
@@ -163,8 +163,7 @@ namespace FlaxEditor.Windows.Assets
|
||||
UpdateSprites();
|
||||
|
||||
// Try to restore target asset texture import options (useful for fast reimport)
|
||||
TextureImportSettings.InternalOptions options;
|
||||
if (TextureImportEntry.Internal_GetTextureImportOptions(win.Item.Path, out options))
|
||||
if (TextureImportEntry.Internal_GetTextureImportOptions(win.Item.Path, out TextureImportSettings.InternalOptions options))
|
||||
{
|
||||
// Restore settings
|
||||
ImportSettings.FromInternal(ref options);
|
||||
@@ -352,9 +351,7 @@ namespace FlaxEditor.Windows.Assets
|
||||
/// <inheritdoc />
|
||||
public override void OnLayoutDeserialize(XmlElement node)
|
||||
{
|
||||
float value1;
|
||||
|
||||
if (float.TryParse(node.GetAttribute("Split"), out value1))
|
||||
if (float.TryParse(node.GetAttribute("Split"), out float value1))
|
||||
_split.SplitterValue = value1;
|
||||
}
|
||||
|
||||
|
||||
@@ -214,9 +214,7 @@ namespace FlaxEditor.Windows.Assets
|
||||
/// <inheritdoc />
|
||||
public override void OnLayoutDeserialize(XmlElement node)
|
||||
{
|
||||
float value1;
|
||||
|
||||
if (float.TryParse(node.GetAttribute("Split"), out value1))
|
||||
if (float.TryParse(node.GetAttribute("Split"), out float value1))
|
||||
_split.SplitterValue = value1;
|
||||
}
|
||||
|
||||
|
||||
@@ -1107,9 +1107,7 @@ namespace FlaxEditor.Windows.Assets
|
||||
/// <inheritdoc />
|
||||
public override void OnLayoutDeserialize(XmlElement node)
|
||||
{
|
||||
float value1;
|
||||
|
||||
if (float.TryParse(node.GetAttribute("Split"), out value1))
|
||||
if (float.TryParse(node.GetAttribute("Split"), out float value1))
|
||||
_split.SplitterValue = value1;
|
||||
}
|
||||
|
||||
|
||||
@@ -79,8 +79,7 @@ namespace FlaxEditor.Windows
|
||||
|
||||
if (item is BinaryAssetItem binaryAsset)
|
||||
{
|
||||
string importPath;
|
||||
if (!binaryAsset.GetImportPath(out importPath))
|
||||
if (!binaryAsset.GetImportPath(out string importPath))
|
||||
{
|
||||
string importLocation = System.IO.Path.GetDirectoryName(importPath);
|
||||
if (!string.IsNullOrEmpty(importLocation) && System.IO.Directory.Exists(importLocation))
|
||||
|
||||
@@ -862,15 +862,15 @@ namespace FlaxEditor.Windows
|
||||
/// <inheritdoc />
|
||||
public override void OnLayoutDeserialize(XmlElement node)
|
||||
{
|
||||
float value1;
|
||||
bool value2;
|
||||
|
||||
if (float.TryParse(node.GetAttribute("Split"), out value1))
|
||||
if (float.TryParse(node.GetAttribute("Split"), out float value1))
|
||||
_split.SplitterValue = value1;
|
||||
|
||||
if (float.TryParse(node.GetAttribute("Scale"), out value1))
|
||||
_view.ViewScale = value1;
|
||||
if (bool.TryParse(node.GetAttribute("ShowFileExtensions"), out value2))
|
||||
|
||||
if (bool.TryParse(node.GetAttribute("ShowFileExtensions"), out bool value2))
|
||||
_view.ShowFileExtensions = value2;
|
||||
|
||||
if (Enum.TryParse(node.GetAttribute("ViewType"), out ContentViewType viewType))
|
||||
_view.ViewType = viewType;
|
||||
}
|
||||
|
||||
@@ -592,9 +592,7 @@ namespace FlaxEditor.Windows
|
||||
/// <inheritdoc />
|
||||
public override void OnLayoutDeserialize(XmlElement node)
|
||||
{
|
||||
float value1;
|
||||
|
||||
if (float.TryParse(node.GetAttribute("Split"), out value1))
|
||||
if (float.TryParse(node.GetAttribute("Split"), out float value1))
|
||||
_split.SplitterValue = value1;
|
||||
}
|
||||
|
||||
|
||||
@@ -434,29 +434,34 @@ namespace FlaxEditor.Windows
|
||||
/// <inheritdoc />
|
||||
public override void OnLayoutDeserialize(XmlElement node)
|
||||
{
|
||||
bool value1;
|
||||
float value2;
|
||||
long value3;
|
||||
|
||||
if (bool.TryParse(node.GetAttribute("GridEnabled"), out value1))
|
||||
if (bool.TryParse(node.GetAttribute("GridEnabled"), out bool value1))
|
||||
Viewport.Grid.Enabled = value1;
|
||||
|
||||
if (bool.TryParse(node.GetAttribute("ShowFpsCounter"), out value1))
|
||||
Viewport.ShowFpsCounter = value1;
|
||||
|
||||
if (bool.TryParse(node.GetAttribute("ShowNavigation"), out value1))
|
||||
Viewport.ShowNavigation = value1;
|
||||
if (float.TryParse(node.GetAttribute("NearPlane"), out value2))
|
||||
|
||||
if (float.TryParse(node.GetAttribute("NearPlane"), out float value2))
|
||||
Viewport.NearPlane = value2;
|
||||
|
||||
if (float.TryParse(node.GetAttribute("FarPlane"), out value2))
|
||||
Viewport.FarPlane = value2;
|
||||
|
||||
if (float.TryParse(node.GetAttribute("FieldOfView"), out value2))
|
||||
Viewport.FieldOfView = value2;
|
||||
|
||||
if (float.TryParse(node.GetAttribute("MovementSpeed"), out value2))
|
||||
Viewport.MovementSpeed = value2;
|
||||
|
||||
if (float.TryParse(node.GetAttribute("OrthographicScale"), out value2))
|
||||
Viewport.OrthographicScale = value2;
|
||||
|
||||
if (bool.TryParse(node.GetAttribute("UseOrthographicProjection"), out value1))
|
||||
Viewport.UseOrthographicProjection = value1;
|
||||
if (long.TryParse(node.GetAttribute("ViewFlags"), out value3))
|
||||
|
||||
if (long.TryParse(node.GetAttribute("ViewFlags"), out long value3))
|
||||
Viewport.Task.ViewFlags = (ViewFlags)value3;
|
||||
|
||||
// Reset view flags if opening with different engine version (ViewFlags enum could be modified)
|
||||
|
||||
Reference in New Issue
Block a user