Format code in Visject

This commit is contained in:
Wojtek Figat
2024-05-30 12:20:40 +02:00
parent 390f574662
commit 3f3df090f4
6 changed files with 21 additions and 21 deletions

View File

@@ -60,7 +60,7 @@ namespace FlaxEditor.Surface.Archetypes
Op1(1, "Boolean NOT", "Negates the boolean value", new[] { "!", "~" }), Op1(1, "Boolean NOT", "Negates the boolean value", new[] { "!", "~" }),
Op2(2, "Boolean AND", "Performs a logical conjunction on two values", new[] { "&&" }), Op2(2, "Boolean AND", "Performs a logical conjunction on two values", new[] { "&&" }),
Op2(3, "Boolean OR", "Returns true if either (or both) of its operands is true", new[] { "||" }), Op2(3, "Boolean OR", "Returns true if either (or both) of its operands is true", new[] { "||" }),
Op2(4, "Boolean XOR", "", new [] { "^" } ), Op2(4, "Boolean XOR", "", new[] { "^" }),
Op2(5, "Boolean NOR", ""), Op2(5, "Boolean NOR", ""),
Op2(6, "Boolean NAND", ""), Op2(6, "Boolean NAND", ""),
}; };

View File

@@ -114,10 +114,10 @@ namespace FlaxEditor.Surface.Archetypes
Op1(13, "Round", "Rounds A to the nearest integer"), Op1(13, "Round", "Rounds A to the nearest integer"),
Op1(14, "Saturate", "Clamps A to the range [0, 1]"), Op1(14, "Saturate", "Clamps A to the range [0, 1]"),
Op1(15, "Sine", "Returns sine of A"), Op1(15, "Sine", "Returns sine of A"),
Op1(16, "Sqrt", "Returns square root of A", new [] { "Square Root", "Square", "Root" }), Op1(16, "Sqrt", "Returns square root of A", new[] { "Square Root", "Square", "Root" }),
Op1(17, "Tangent", "Returns tangent of A"), Op1(17, "Tangent", "Returns tangent of A"),
Op2(18, "Cross", "Returns the cross product of A and B", ConnectionsHint.None, typeof(Float3)), Op2(18, "Cross", "Returns the cross product of A and B", ConnectionsHint.None, typeof(Float3)),
Op2(19, "Distance", "Returns a distance scalar between A and B", new [] { "Magnitude", "Mag", "Length" }, ConnectionsHint.Vector, null, typeof(float), false), Op2(19, "Distance", "Returns a distance scalar between A and B", new[] { "Magnitude", "Mag", "Length" }, ConnectionsHint.Vector, null, typeof(float), false),
Op2(20, "Dot", "Returns the dot product of A and B", ConnectionsHint.Vector, null, typeof(float), false), Op2(20, "Dot", "Returns the dot product of A and B", ConnectionsHint.Vector, null, typeof(float), false),
Op2(21, "Max", "Selects the greater of A and B"), Op2(21, "Max", "Selects the greater of A and B"),
Op2(22, "Min", "Selects the lesser of A and B"), Op2(22, "Min", "Selects the lesser of A and B"),
@@ -192,7 +192,7 @@ namespace FlaxEditor.Surface.Archetypes
} }
}, },
// //
Op1(27, "Negate", "Returns opposite value", new [] { "Invert" }), Op1(27, "Negate", "Returns opposite value", new[] { "Invert" }),
Op1(28, "One Minus", "Returns 1 - value"), Op1(28, "One Minus", "Returns 1 - value"),
// //
new NodeArchetype new NodeArchetype
@@ -232,7 +232,7 @@ namespace FlaxEditor.Surface.Archetypes
{ {
TypeID = 31, TypeID = 31,
Title = "Mad", Title = "Mad",
AlternativeTitles = new [] { "Multiply", "Add", "*+" }, AlternativeTitles = new[] { "Multiply", "Add", "*+" },
Description = "Performs value multiplication and addition at once", Description = "Performs value multiplication and addition at once",
Flags = NodeFlags.AllGraphs, Flags = NodeFlags.AllGraphs,
Size = new Float2(160, 60), Size = new Float2(160, 60),

View File

@@ -1193,7 +1193,7 @@ namespace FlaxEditor.Surface.Archetypes
_isMouseInConnectingBounds = false; _isMouseInConnectingBounds = false;
Cursor = CursorType.Default; Cursor = CursorType.Default;
base.OnMouseLeave(); base.OnMouseLeave();
} }
@@ -1494,7 +1494,7 @@ namespace FlaxEditor.Surface.Archetypes
{ {
TypeID = 11, TypeID = 11,
Title = "Comment", Title = "Comment",
AlternativeTitles = new[] { "//" , "Group" }, AlternativeTitles = new[] { "//", "Group" },
TryParseText = (string filterText, out object[] data) => TryParseText = (string filterText, out object[] data) =>
{ {
data = null; data = null;
@@ -1650,7 +1650,7 @@ namespace FlaxEditor.Surface.Archetypes
{ {
TypeID = 22, TypeID = 22,
Title = "As", Title = "As",
AlternativeTitles = new [] { "Cast" }, AlternativeTitles = new[] { "Cast" },
Create = (id, context, arch, groupArch) => new AsNode(id, context, arch, groupArch), Create = (id, context, arch, groupArch) => new AsNode(id, context, arch, groupArch),
Description = "Casts the object to a different type. Returns null if cast fails.", Description = "Casts the object to a different type. Returns null if cast fails.",
Flags = NodeFlags.VisualScriptGraph | NodeFlags.AnimGraph, Flags = NodeFlags.VisualScriptGraph | NodeFlags.AnimGraph,

View File

@@ -307,7 +307,7 @@ namespace FlaxEditor.Surface.ContextMenu
if (!IsLayoutLocked) if (!IsLayoutLocked)
{ {
group.UnlockChildrenRecursive(); group.UnlockChildrenRecursive();
if(_contextSensitiveSearchEnabled && _selectedBox != null) if (_contextSensitiveSearchEnabled && _selectedBox != null)
UpdateFilters(); UpdateFilters();
else else
SortGroups(); SortGroups();
@@ -370,7 +370,7 @@ namespace FlaxEditor.Surface.ContextMenu
if (!isLayoutLocked) if (!isLayoutLocked)
{ {
if(_contextSensitiveSearchEnabled && _selectedBox != null) if (_contextSensitiveSearchEnabled && _selectedBox != null)
UpdateFilters(); UpdateFilters();
else else
SortGroups(); SortGroups();
@@ -567,7 +567,7 @@ namespace FlaxEditor.Surface.ContextMenu
} }
UnlockChildrenRecursive(); UnlockChildrenRecursive();
if(_contextSensitiveSearchEnabled && _selectedBox != null) if (_contextSensitiveSearchEnabled && _selectedBox != null)
UpdateFilters(); UpdateFilters();
else else
SortGroups(); SortGroups();

View File

@@ -219,7 +219,7 @@ namespace FlaxEditor.Surface.ContextMenu
} }
// Check archetype synonyms // Check archetype synonyms
if (_archetype.AlternativeTitles!= null && _archetype.AlternativeTitles.Any(altTitle => QueryFilterHelper.Match(filterText, altTitle, out ranges))) if (_archetype.AlternativeTitles != null && _archetype.AlternativeTitles.Any(altTitle => QueryFilterHelper.Match(filterText, altTitle, out ranges)))
{ {
// Update highlights // Update highlights
if (_highlights == null) if (_highlights == null)

View File

@@ -69,7 +69,7 @@ namespace FlaxEditor.Surface
public SurfaceComment(uint id, VisjectSurfaceContext context, NodeArchetype nodeArch, GroupArchetype groupArch) public SurfaceComment(uint id, VisjectSurfaceContext context, NodeArchetype nodeArch, GroupArchetype groupArch)
: base(id, context, nodeArch, groupArch) : base(id, context, nodeArch, groupArch)
{ {
_renameTextBox = new TextBox(false, 0,0, Width) _renameTextBox = new TextBox(false, 0, 0, Width)
{ {
Height = Constants.NodeHeaderSize, Height = Constants.NodeHeaderSize,
Visible = false, Visible = false,
@@ -96,7 +96,7 @@ namespace FlaxEditor.Surface
IndexInParent = 0; IndexInParent = 0;
OrderValue = IndexInParent; OrderValue = IndexInParent;
} }
else if(OrderValue != -1) else if (OrderValue != -1)
{ {
IndexInParent = OrderValue; IndexInParent = OrderValue;
} }
@@ -110,7 +110,7 @@ namespace FlaxEditor.Surface
// Randomize color // Randomize color
Color = ColorValue = Color.FromHSV(new Random().NextFloat(0, 360), 0.7f, 0.25f, 0.8f); Color = ColorValue = Color.FromHSV(new Random().NextFloat(0, 360), 0.7f, 0.25f, 0.8f);
if(OrderValue == -1) if (OrderValue == -1)
OrderValue = Context.CommentCount - 1; OrderValue = Context.CommentCount - 1;
IndexInParent = OrderValue; IndexInParent = OrderValue;
} }
@@ -196,7 +196,7 @@ namespace FlaxEditor.Surface
// Header // Header
Render2D.FillRectangle(_headerRect, headerColor); Render2D.FillRectangle(_headerRect, headerColor);
if(!_isRenaming) if (!_isRenaming)
Render2D.DrawText(style.FontLarge, Title, _headerRect, style.Foreground, TextAlignment.Center, TextAlignment.Center); Render2D.DrawText(style.FontLarge, Title, _headerRect, style.Foreground, TextAlignment.Center, TextAlignment.Center);
// Close button // Close button
@@ -344,7 +344,7 @@ namespace FlaxEditor.Surface
private void Rename(string newTitle) private void Rename(string newTitle)
{ {
if(string.Equals(Title, newTitle, StringComparison.Ordinal)) if (string.Equals(Title, newTitle, StringComparison.Ordinal))
return; return;
Title = TitleValue = newTitle; Title = TitleValue = newTitle;
@@ -361,7 +361,7 @@ namespace FlaxEditor.Surface
return true; return true;
} }
if(key == KeyboardKeys.Escape) if (key == KeyboardKeys.Escape)
{ {
StopRenaming(); StopRenaming();
return true; return true;
@@ -415,18 +415,18 @@ namespace FlaxEditor.Surface
{ {
cmOrder.ContextMenu.AddButton("Bring Forward", () => cmOrder.ContextMenu.AddButton("Bring Forward", () =>
{ {
if(IndexInParent < Context.CommentCount-1) if (IndexInParent < Context.CommentCount - 1)
IndexInParent++; IndexInParent++;
OrderValue = IndexInParent; OrderValue = IndexInParent;
}); });
cmOrder.ContextMenu.AddButton("Bring to Front", () => cmOrder.ContextMenu.AddButton("Bring to Front", () =>
{ {
IndexInParent = Context.CommentCount-1; IndexInParent = Context.CommentCount - 1;
OrderValue = IndexInParent; OrderValue = IndexInParent;
}); });
cmOrder.ContextMenu.AddButton("Send Backward", () => cmOrder.ContextMenu.AddButton("Send Backward", () =>
{ {
if(IndexInParent > 0) if (IndexInParent > 0)
IndexInParent--; IndexInParent--;
OrderValue = IndexInParent; OrderValue = IndexInParent;
}); });