DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ WriteToContext()

void WriteToContext ( ParamsWriteContext ctx,
ActionData action_data )
protected

get proxy bone idx from parent and selection we are looking at ID is used for synchronisation to server where it's translated back to object

См. определение в файле ActionBase.c строка 464

465 {
466#ifdef ENABLE_LOGGING
468 {
469 Debug.ActionLog("STS = " + action_data.m_Player.GetSimulationTimeStamp(), this.ToString() , "n/a", "WriteToContext", action_data.m_Player.ToString() );
470 }
471#endif
472 int componentIndex = -1;
473 int proxyBoneIdx = -1;
474 vector cursorHitPos = vector.Zero;
475
476 array<string> selectionNames = new array<string>();
477
478 Object targetObject = null;
479 Object targetParent = null;
480
481 if (UseMainItem())
482 {
483 ctx.Write(action_data.m_MainItem);
484 }
485
486 if (HasTarget() && !IsUsingProxies())
487 {
488 // callback data
489 targetObject = action_data.m_Target.GetObject();
490 ctx.Write(targetObject);
491 targetParent = action_data.m_Target.GetParent();
492 ctx.Write(targetParent);
493 componentIndex = action_data.m_Target.GetComponentIndex();
494 ctx.Write(componentIndex);
495 cursorHitPos = action_data.m_Target.GetCursorHitPos();
496 ctx.Write(cursorHitPos);
497 }
498 else if( HasTarget() && IsUsingProxies() )
499 {
502 Entity entParent = Entity.Cast(action_data.m_Target.GetParent());
503 if (entParent)
504 {
505 action_data.m_Target.GetObject().GetActionComponentNameList(action_data.m_Target.GetComponentIndex(), selectionNames);
506 for (int s = 0; s < selectionNames.Count(); s++)
507 {
508 proxyBoneIdx = entParent.GetBoneIndex(selectionNames[s]);
509 if( proxyBoneIdx > -1 )
510 {
511 break;
512 }
513 }
514 }
515
516 ctx.Write(proxyBoneIdx);
517 targetParent = action_data.m_Target.GetParent();
518 ctx.Write(targetParent);
519 componentIndex = action_data.m_Target.GetComponentIndex();
520 ctx.Write(componentIndex);
521 cursorHitPos = action_data.m_Target.GetCursorHitPos();
522 ctx.Write(cursorHitPos);
523 }
524 }
bool HasTarget()
Определения ActionBase.c:259
bool IsUsingProxies()
not using plane object - it's using multiple proxies
Определения ActionBase.c:300
bool UseMainItem()
Определения ActionBase.c:417
PlayerBase m_Player
Определения ActionBase.c:40
ref ActionTarget m_Target
Определения ActionBase.c:39
ItemBase m_MainItem
Определения ActionBase.c:35
static void ActionLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Определения 3_Game/DayZ/tools/Debug.c:188
Определения 3_Game/DayZ/tools/Debug.c:2
Определения Camera.c:2
static bool IsActionLogEnable()
Определения 3_Game/DayZ/tools/Debug.c:749
Определения ObjectTyped.c:2
proto bool Write(void value_out)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static const vector Zero
Определения EnConvert.c:123
Определения EnConvert.c:119

Перекрестные ссылки Debug::ActionLog(), HasTarget(), LogManager::IsActionLogEnable(), IsUsingProxies(), ActionData::m_MainItem, ActionData::m_Player, ActionData::m_Target, UseMainItem(), Serializer::Write() и vector::Zero.