mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Core - Fix node script and pin bugs found by the tests (#911)
* Core - Keep nodes of missing plugins and the connection an input reads from in node scripts - Saving a script keeps nodes whose plugin is missing, and their connections, so they come back once the plugin is available again - Loading keeps the first connection of an input, the one it reads from - Disabling a node provider only removes the nodes it created, not those of another provider registering the same type - RemoveNode only raises NodeRemoved for nodes that were in the script * Core - Fix pin connections, null values and failing nodes - Connecting pins that are already connected no longer adds a second connection - Untyped pins turn null into the default value for value types, as intended - A new InputPin<T> reads its connection right away instead of after its first reset - Matching a specific enum to a pin of any enum now depends on forgivingEnumMatching - A node that fails to evaluate sets its outputs to their default values, so it is evaluated once per run and old values don't flow on * Core - Round Numeric to long and clamp it to the range of an sbyte
This commit is contained in:
1 parent
83cf6da830
commit
5ddd50b4a8
12 files changed
+118
-92
No files matched your search
@@ -385,7 +385,13 @@ public abstract class Node : BreakableModel, INode
|
||||
/// <inheritdoc />
|
||||
public void TryEvaluate()
|
||||
{
|
||||
TryOrBreak(Evaluate, "Failed to evaluate");
|
||||
if (TryOrBreak(Evaluate, "Failed to evaluate"))
|
||||
return;
|
||||
|
||||
// Don't let the values of the last successful run flow on, and don't try again for every pin that reads from this
|
||||
// node. Setting a value marks the pin as evaluated until the next run
|
||||
foreach (Pin pin in Pins.Concat(PinCollections.SelectMany(c => c)).OfType<Pin>().Where(p => p.Direction == PinDirection.Output))
|
||||
pin.SetDefaultValue();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in new issue
Block a user