| 406 | } |
| 407 | |
| 408 | void VisualScriptExecutor::ProcessGroupFunction(Box* boxBase, Node* node, Value& value) |
| 409 | { |
| 410 | switch (node->TypeID) |
| 411 | { |
| 412 | // Method Override |
| 413 | case 3: |
| 414 | { |
| 415 | if (boxBase->ID == 0) |
| 416 | { |
| 417 | // Call graph further |
| 418 | if (boxBase->HasConnection()) |
| 419 | eatBox(node, boxBase->FirstConnection()); |
| 420 | } |
| 421 | else |
| 422 | { |
| 423 | // Evaluate overriden method parameter value from the current scope |
| 424 | auto& scope = ThreadStacks.Get().Stack->Scope; |
| 425 | value = scope->Parameters[boxBase->ID - 1]; |
| 426 | } |
| 427 | break; |
| 428 | } |
| 429 | // Invoke Method |
| 430 | case 4: |
| 431 | { |
| 432 | // Call Impulse or Pure Method |
| 433 | if (boxBase->ID == 0 || (bool)node->Values[3]) |
| 434 | { |
| 435 | auto& cache = node->Data.InvokeMethod; |
| 436 | if (!cache.Method) |
| 437 | { |
| 438 | // Load method signature |
| 439 | const auto typeName = (StringView)node->Values[0]; |
| 440 | const auto methodName = (StringView)node->Values[1]; |
| 441 | const StringAsANSI<100> typeNameAnsi(typeName.Get(), typeName.Length()); |
| 442 | const StringAsANSI<60> methodNameAnsi(methodName.Get(), methodName.Length()); |
| 443 | ScriptingTypeMethodSignature signature; |
| 444 | signature.Name = StringAnsiView(methodNameAnsi.Get(), methodName.Length()); |
| 445 | auto& signatureCache = node->Values[4]; |
| 446 | if (signatureCache.Type.Type != VariantType::Blob) |
| 447 | { |
| 448 | LOG(Error, "Missing method '{0}::{1}' signature data", typeName, methodName); |
| 449 | PrintStack(LogType::Error); |
| 450 | return; |
| 451 | } |
| 452 | MemoryReadStream stream((byte*)signatureCache.AsBlob.Data, signatureCache.AsBlob.Length); |
| 453 | const byte version = stream.ReadByte(); |
| 454 | if (version == 4) |
| 455 | { |
| 456 | signature.IsStatic = stream.ReadBool(); |
| 457 | stream.Read(signature.ReturnType); |
| 458 | int32 signatureParamsCount; |
| 459 | stream.ReadInt32(&signatureParamsCount); |
| 460 | signature.Params.Resize(signatureParamsCount); |
| 461 | for (int32 i = 0; i < signatureParamsCount; i++) |
| 462 | { |
| 463 | auto& param = signature.Params[i]; |
| 464 | int32 parameterNameLength; |
| 465 | stream.ReadInt32(¶meterNameLength); |
nothing calls this directly
no test coverage detected