Codestyle fix
This commit is contained in:
@@ -36,7 +36,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
return;
|
||||
var gizmos = gizmoOwner.Gizmos;
|
||||
_gizmoMode = new ClothPaintingGizmoMode();
|
||||
|
||||
|
||||
var projectCache = Editor.Instance.ProjectCache;
|
||||
if (projectCache.TryGetCustomData("ClothGizmoPaintValue", out var cachedPaintValue))
|
||||
_gizmoMode.PaintValue = JsonSerializer.Deserialize<float>(cachedPaintValue);
|
||||
@@ -48,7 +48,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
_gizmoMode.BrushSize = JsonSerializer.Deserialize<float>(cachedBrushSize);
|
||||
if (projectCache.TryGetCustomData("ClothGizmoBrushStrength", out var cachedBrushStrength))
|
||||
_gizmoMode.BrushStrength = JsonSerializer.Deserialize<float>(cachedBrushStrength);
|
||||
|
||||
|
||||
gizmos.AddMode(_gizmoMode);
|
||||
_prevMode = gizmos.ActiveMode;
|
||||
gizmos.ActiveMode = _gizmoMode;
|
||||
|
||||
@@ -364,7 +364,7 @@ namespace FlaxEditor
|
||||
{
|
||||
foreach (var preview in activePreviews)
|
||||
{
|
||||
if (preview == loadingPreview ||
|
||||
if (preview == loadingPreview ||
|
||||
(preview.Instance != null && (preview.Instance == control || preview.Instance.HasActorInHierarchy(control))))
|
||||
{
|
||||
// Link it to the prefab preview to see it in the editor
|
||||
|
||||
@@ -482,8 +482,8 @@ namespace FlaxEditor.GUI
|
||||
Focus();
|
||||
});
|
||||
if (_selected != null)
|
||||
{
|
||||
var selectedAssetName = Path.GetFileNameWithoutExtension(_selected.Path);
|
||||
{
|
||||
var selectedAssetName = Path.GetFileNameWithoutExtension(_selected.Path);
|
||||
popup.ScrollToAndHighlightItemByName(selectedAssetName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace FlaxEditor.GUI.ContextMenu
|
||||
// Hide parent CM popups and set itself as child
|
||||
parentContextMenu.ShowChild(ContextMenu, PointToParent(ParentContextMenu, new Float2(Width, 0)));
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool OnMouseUp(Float2 location, MouseButton button)
|
||||
{
|
||||
|
||||
@@ -293,7 +293,7 @@ namespace FlaxEditor.GUI.Dialogs
|
||||
if (Root != null)
|
||||
{
|
||||
bool shiftDown = Root.GetKey(KeyboardKeys.Shift);
|
||||
Root.Navigate(shiftDown ? NavDirection.Previous : NavDirection.Next);
|
||||
Root.Navigate(shiftDown ? NavDirection.Previous : NavDirection.Next);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace FlaxEditor.GUI.Input
|
||||
: this(false, 0, 0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Init search box
|
||||
/// </summary>
|
||||
@@ -28,7 +28,7 @@ namespace FlaxEditor.GUI.Input
|
||||
: base(isMultiline, x, y, width)
|
||||
{
|
||||
WatermarkText = "Search...";
|
||||
|
||||
|
||||
ClearSearchButton = new Button
|
||||
{
|
||||
Parent = this,
|
||||
|
||||
@@ -241,7 +241,7 @@ namespace FlaxEditor.GUI
|
||||
{
|
||||
DoubleClick?.Invoke();
|
||||
RowDoubleClick?.Invoke(this);
|
||||
|
||||
|
||||
return base.OnMouseDoubleClick(location, button);
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace FlaxEditor.Modules
|
||||
hint = "Too long name.";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (item.IsFolder && shortName.EndsWith("."))
|
||||
{
|
||||
hint = "Name cannot end with '.'";
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace FlaxEditor.Modules
|
||||
return;
|
||||
var actorsList = new List<Actor>();
|
||||
Utilities.Utils.GetActorsTree(actorsList, actor);
|
||||
|
||||
|
||||
var actions = new IUndoAction[actorsList.Count];
|
||||
for (int i = 0; i < actorsList.Count; i++)
|
||||
actions[i] = BreakPrefabLinkAction.Linked(actorsList[i]);
|
||||
|
||||
@@ -453,7 +453,7 @@ namespace FlaxEditor.Modules
|
||||
{
|
||||
Editor.Windows.SceneWin.Focus();
|
||||
}
|
||||
|
||||
|
||||
// fix scene window layout
|
||||
Editor.Windows.SceneWin.PerformLayout();
|
||||
Editor.Windows.SceneWin.PerformLayout();
|
||||
@@ -520,7 +520,7 @@ namespace FlaxEditor.Modules
|
||||
Undo.AddAction(new MultiUndoAction(pasteAction, selectAction));
|
||||
OnSelectionChanged();
|
||||
}
|
||||
|
||||
|
||||
// Scroll to new selected node while pasting
|
||||
Editor.Windows.SceneWin.ScrollToSelectedNode();
|
||||
}
|
||||
@@ -620,7 +620,7 @@ namespace FlaxEditor.Modules
|
||||
Undo.AddAction(new MultiUndoAction(undoActions));
|
||||
OnSelectionChanged();
|
||||
}
|
||||
|
||||
|
||||
// Scroll to new selected node while duplicating
|
||||
Editor.Windows.SceneWin.ScrollToSelectedNode();
|
||||
}
|
||||
|
||||
@@ -332,7 +332,7 @@ namespace FlaxEditor.Modules
|
||||
continue;
|
||||
scenes.Add(s);
|
||||
}
|
||||
|
||||
|
||||
// In play-mode Editor mocks the level streaming script
|
||||
if (Editor.IsPlayMode)
|
||||
{
|
||||
|
||||
@@ -29,10 +29,10 @@ namespace FlaxEditor.Modules.SourceCodeEditing
|
||||
|
||||
private static bool CheckFunc(ScriptType scriptType)
|
||||
{
|
||||
if (scriptType.IsStatic ||
|
||||
scriptType.IsGenericType ||
|
||||
!scriptType.IsPublic ||
|
||||
scriptType.HasAttribute(typeof(HideInEditorAttribute), true) ||
|
||||
if (scriptType.IsStatic ||
|
||||
scriptType.IsGenericType ||
|
||||
!scriptType.IsPublic ||
|
||||
scriptType.HasAttribute(typeof(HideInEditorAttribute), true) ||
|
||||
scriptType.HasAttribute(typeof(System.Runtime.CompilerServices.CompilerGeneratedAttribute), false))
|
||||
return false;
|
||||
var managedType = TypeUtils.GetType(scriptType);
|
||||
|
||||
@@ -299,7 +299,7 @@ namespace FlaxEditor.Modules
|
||||
else
|
||||
text = "Ready";
|
||||
|
||||
if(ProgressVisible)
|
||||
if (ProgressVisible)
|
||||
{
|
||||
color = Style.Current.Statusbar.Loading;
|
||||
}
|
||||
@@ -402,7 +402,7 @@ namespace FlaxEditor.Modules
|
||||
{
|
||||
UpdateStatusBar();
|
||||
}
|
||||
else if(ProgressVisible)
|
||||
else if (ProgressVisible)
|
||||
{
|
||||
UpdateStatusBar();
|
||||
}
|
||||
@@ -557,7 +557,7 @@ namespace FlaxEditor.Modules
|
||||
cm.AddButton("Game Settings", () =>
|
||||
{
|
||||
var item = Editor.ContentDatabase.Find(GameSettings.GameSettingsAssetPath);
|
||||
if(item != null)
|
||||
if (item != null)
|
||||
Editor.ContentEditing.Open(item);
|
||||
});
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace FlaxEditor.Progress
|
||||
/// </summary>
|
||||
/// <param name="handler">The calling handler.</param>
|
||||
public delegate void ProgressDelegate(ProgressHandler handler);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Progress failed handler event delegate
|
||||
/// </summary>
|
||||
@@ -127,7 +127,7 @@ namespace FlaxEditor.Progress
|
||||
{
|
||||
if (!_isActive)
|
||||
throw new InvalidOperationException("Already ended.");
|
||||
|
||||
|
||||
_isActive = false;
|
||||
_progress = 0;
|
||||
_infoText = string.Empty;
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
{
|
||||
base.ConnectionTick(box);
|
||||
|
||||
if(box.ID != _assetBox.ID)
|
||||
if (box.ID != _assetBox.ID)
|
||||
return;
|
||||
|
||||
_assetSelect.Visible = !box.HasAnyConnection;
|
||||
|
||||
@@ -510,7 +510,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
|
||||
for (var i = 0; i < elements.Length; i++)
|
||||
{
|
||||
if(elements[i].Type != NodeElementType.Output)
|
||||
if (elements[i].Type != NodeElementType.Output)
|
||||
continue;
|
||||
|
||||
if (VisjectSurface.FullCastCheck(elements[i].ConnectionsType, inputType, hint))
|
||||
@@ -533,7 +533,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
|
||||
for (var i = 0; i < elements.Length; i++)
|
||||
{
|
||||
if(elements[i].Type != NodeElementType.Input)
|
||||
if (elements[i].Type != NodeElementType.Input)
|
||||
continue;
|
||||
if (VisjectSurface.FullCastCheck(elements[i].ConnectionsType, outputType, hint))
|
||||
return true;
|
||||
@@ -725,7 +725,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override bool UseNormalMaps => false;
|
||||
|
||||
|
||||
internal new static bool IsOutputCompatible(NodeArchetype nodeArch, ScriptType inputType, ConnectionsHint hint, VisjectSurfaceContext context)
|
||||
{
|
||||
if (inputType == ScriptType.Object)
|
||||
@@ -743,7 +743,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
|
||||
for (var i = 0; i < elements.Length; i++)
|
||||
{
|
||||
if(elements[i].Type != NodeElementType.Output)
|
||||
if (elements[i].Type != NodeElementType.Output)
|
||||
continue;
|
||||
if (VisjectSurface.FullCastCheck(elements[i].ConnectionsType, inputType, hint))
|
||||
return true;
|
||||
@@ -765,7 +765,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
|
||||
for (var i = 0; i < elements.Length; i++)
|
||||
{
|
||||
if(elements[i].Type != NodeElementType.Input)
|
||||
if (elements[i].Type != NodeElementType.Input)
|
||||
continue;
|
||||
if (VisjectSurface.FullCastCheck(elements[i].ConnectionsType, outputType, hint))
|
||||
return true;
|
||||
@@ -789,7 +789,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override bool UseNormalMaps => false;
|
||||
|
||||
|
||||
internal new static bool IsOutputCompatible(NodeArchetype nodeArch, ScriptType inputType, ConnectionsHint hint, VisjectSurfaceContext context)
|
||||
{
|
||||
if (inputType == ScriptType.Object)
|
||||
@@ -987,7 +987,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
_combobox.Width = Width - 50;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
internal static bool IsOutputCompatible(NodeArchetype nodeArch, ScriptType inputType, ConnectionsHint hint, VisjectSurfaceContext context)
|
||||
{
|
||||
return inputType == ScriptType.Void;
|
||||
@@ -997,7 +997,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
{
|
||||
if (outputType == ScriptType.Void)
|
||||
return true;
|
||||
|
||||
|
||||
SurfaceParameter parameter = context.GetParameter((Guid)nodeArch.DefaultValues[0]);
|
||||
ScriptType type = parameter?.Type ?? ScriptType.Null;
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ namespace FlaxEditor.Surface
|
||||
|
||||
if (_connectionInstigator is Archetypes.Tools.RerouteNode)
|
||||
{
|
||||
if (endPos.X < startPos.X && _lastInstigatorUnderMouse is null or Box { IsOutput: true})
|
||||
if (endPos.X < startPos.X && _lastInstigatorUnderMouse is null or Box { IsOutput: true })
|
||||
{
|
||||
actualStartPos = endPos;
|
||||
actualEndPos = startPos;
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace FlaxEditor
|
||||
if (_highlightMaterial == null
|
||||
|| (_highlights.Count == 0 && _highlightTriangles.Count == 0)
|
||||
|| renderContext.View.Pass == DrawPass.Depth
|
||||
)
|
||||
)
|
||||
return;
|
||||
Profiler.BeginEvent("ViewportDebugDrawData.OnDraw");
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace FlaxEditor.Windows.Assets
|
||||
{
|
||||
OnPasteAction(pasteAction);
|
||||
}
|
||||
|
||||
|
||||
// Scroll to new selected node
|
||||
ScrollToSelectedNode();
|
||||
}
|
||||
@@ -183,7 +183,7 @@ namespace FlaxEditor.Windows.Assets
|
||||
{
|
||||
OnPasteAction(pasteAction);
|
||||
}
|
||||
|
||||
|
||||
// Scroll to new selected node
|
||||
ScrollToSelectedNode();
|
||||
}
|
||||
@@ -334,7 +334,7 @@ namespace FlaxEditor.Windows.Assets
|
||||
}, action2.ActionString);
|
||||
action.Do();
|
||||
Undo.AddAction(action);
|
||||
|
||||
|
||||
_treePanel.PerformLayout();
|
||||
_treePanel.PerformLayout();
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ namespace FlaxEditor.Windows.Assets
|
||||
InputActions.Add(options => options.Rename, Rename);
|
||||
InputActions.Add(options => options.FocusSelection, _viewport.FocusSelection);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Enables or disables vertical and horizontal scrolling on the tree panel.
|
||||
/// </summary>
|
||||
@@ -257,7 +257,7 @@ namespace FlaxEditor.Windows.Assets
|
||||
{
|
||||
if (base.OnMouseUp(location, button))
|
||||
return true;
|
||||
|
||||
|
||||
if (button == MouseButton.Right && _treePanel.ContainsPoint(ref location))
|
||||
{
|
||||
_tree.Deselect();
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace FlaxEditor.Windows.Profiler
|
||||
_tableRep.IsLayoutLocked = true;
|
||||
RecycleTableRows(_tableRpc, _tableRowsCache);
|
||||
RecycleTableRows(_tableRep, _tableRowsCache);
|
||||
|
||||
|
||||
var events = _events.Get(selectedFrame);
|
||||
var rowCount = Int2.Zero;
|
||||
if (events != null && events.Length != 0)
|
||||
@@ -186,7 +186,7 @@ namespace FlaxEditor.Windows.Profiler
|
||||
_tableRep.Visible = rowCount.Y != 0;
|
||||
_tableRpc.Children.Sort(SortRows);
|
||||
_tableRep.Children.Sort(SortRows);
|
||||
|
||||
|
||||
_tableRpc.UnlockChildrenRecursive();
|
||||
_tableRpc.PerformLayout();
|
||||
_tableRep.UnlockChildrenRecursive();
|
||||
|
||||
@@ -530,7 +530,7 @@ void AnimGraphExecutor::UpdateStateTransitions(AnimGraphContext& context, const
|
||||
transitionData.Position = 0;
|
||||
transitionData.Length = ZeroTolerance;
|
||||
}
|
||||
|
||||
|
||||
const bool useDefaultRule = EnumHasAnyFlags(transition.Flags, AnimGraphStateTransition::FlagTypes::UseDefaultRule);
|
||||
if (transition.RuleGraph && !useDefaultRule)
|
||||
{
|
||||
@@ -765,10 +765,10 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu
|
||||
|
||||
// Override animation when animation reference box is connected
|
||||
auto animationAssetBox = node->GetBox(8);
|
||||
if(animationAssetBox->HasConnection())
|
||||
if (animationAssetBox->HasConnection())
|
||||
{
|
||||
const Value assetBoxValue = tryGetValue(animationAssetBox, Value::Null);
|
||||
if(assetBoxValue != Value::Null)
|
||||
if (assetBoxValue != Value::Null)
|
||||
anim = (Animation*)assetBoxValue.AsAsset;
|
||||
else
|
||||
anim = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user