Is there any public way to do custom error checking (with visual feedback) in custom Tasks? (similar to Playmaker’s ErrorCheck() override)
I noticed that in Task.cs, there’s the virtual method GetWarningOrError(), that does exactly what I want if I override it. (for example, to display a custom warning in the node, if some task validation fails)
But that method’s access modifier is defined as “internal”, so I can’t override it from custom Tasks in other assemblies (outside of the ParadoxNotion assembly).
Shouldn’t GetWarningOrError() be defined as virtual protected/public, instead?
Or is there any other way to do my custom warnings in the node/task GUI?
Right now there is only the [RequiredField] attribute which checks for whether or not a field is null (or string.Empty). With that said however, I went ahead and added your request by adding a new virtual method named “OnErrorCheck” that you can override to achieve what you are after.
Please open up Task.cs and add the following in GetWarningOrError method:
1
2
3
4
varuserError=OnErrorCheck();
if(userError!=null){returnuserError;}
Then of course, also add this somewhere in the same class:
1
2
3
4
/// Override and return anything but null to mark the task has an error