278{
280 {
281 }
282
284 {
285 m_InfoData =
new ActionInfoDataConstructionImpossible();
286 }
287
289 {
292 }
293
295 {
296 return false;
297 }
298
300 {
301 return true;
302 }
303
305 {
308 if (part)
309 {
311 if (overrideText ==
string.
Empty)
313 else
315
316 #ifdef DIAG_DEVELOPER
318 {
320 }
321 #endif
322 }
323
324 }
325
327 {
330 return false;
331
332 if (player.IsPlacingLocal() || player.IsPlacingServer())
333 return false;
334
335
336 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
337 return false;
338
339 if (!ent.CanUseConstruction() || !ent.CanUseConstructionBuild())
340 return false;
341
342 if ((!
GetGame().IsDedicatedServer()))
343 {
345 {
347 }
348 }
349
350 return false;
351 }
352
354 {
355 return false;
356 }
357
359 {
361
364 {
365 ActionInfoDataConstructionImpossible info = ActionInfoDataConstructionImpossible.Cast(
m_InfoData);
369 construction.CanBuildPartEx(part.
GetPartName(), item, info.m_InfoContextMask);
370 info.SetConstructionPart(part);
371 info.SetTool(item);
372
373 #ifdef DIAG_DEVELOPER
375 DbgPrint(construction, info, target.GetComponentIndex());
376 #endif
377
380
381 return info.CanDisplayInfo();
382 }
383
384 return false;
385 }
386
387 #ifdef DIAG_DEVELOPER
388 void DbgPrint(notnull
ConstructionBase construction, ActionInfoDataConstructionBase info,
int componentIdx)
389 {
390 int failureMask = info.m_InfoContextMask;
393
394 if (failureMask == 0)
395 {
396 ConstructionDebug.RemoveBuildPartInfoData(partName);
397 }
398 else
399 {
400 string conflictingPart;
402 construction.HasConflictPart(partName, conflictingPart);
403
404 string missingSlot;
405 float missingQty;
407 construction.HasMaterialsEx(partName, false, missingSlot, missingQty);
408
410 string badToolType = "hands";
412 badToolType = tool.GetType();
413
414 ActionInfoDebugData data = new ActionInfoDebugData();
415 data.partName = partName;
416 data.componentIdx = componentIdx;
417 data.failureMask = failureMask;
418 data.conflictingPart = conflictingPart;
419 data.missingSlot = missingSlot;
420 data.missingQty = missingQty;
421 data.badToolType = badToolType;
422
423 ConstructionDebug.AddBuildPartInfoData(data);
424 }
425 }
426 #endif
427
430 {
436
437 if (!part)
438 {
441 }
442 else
443 {
446 return false;
447
448 if (!construction.ConstructionDirectionCheck(player, part, EConstructionDirCheckType.INDOORS))
449 return false;
450 if (!construction.ConstructionInsiderBoxCheck(player, part))
451 return false;
452 if (player.GetInputController().CameraIsFreeLook())
453 return false;
454
455 if (baseBuilding)
456 {
457 bool boo;
459 return false;
460 }
461
462 if (player.IsPlacingLocal() || player.IsPlacingServer())
463 return false;
464
467
468 return !construction.IsCollidingEx(checkData);
469 }
470
471 return false;
472 }
473}
474
475
477{
479 {
480 return ContinuousInteractActionInput;
481 }
482}
484
486{
488
490 {
492 }
493
495 {
496 return true;
497 }
498}
499
502{
505
507 {
509 }
510
512 {
514 }
515
517 {
519 }
520
522 {
524 }
525}
526
529{
530}
531
533class ActionInfoDataConstructionImpossible: ActionInfoDataConstructionBase
534{
536 {
537 bool forceHide = false;
542 bool show = true;
543
544
545
546 return super.CanDisplayInfo() && !forceHide && show;
547 }
548}
ref ActionInfoDataBase m_InfoData
ref CCIBase m_ConditionItem
ref CCTBase m_ConditionTarget
void SetConstructionPart(ConstructionPart part)
ActionInfoDataConstructionPossible ActionInfoDataConstructionBase CanDisplayInfo()
visible only under specific conditions
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
class ActionInfoDataBase m_Tool
not intended for direct use
override bool ActionConditionContinue(ActionData action_data)
void SetTool(ItemBase tool)
override bool CanBeStarted()
bool GatherInfoData(PlayerBase player, ActionTarget target, ItemBase item)
override void CreateConditionComponents()
override void OnActionInfoUpdate(PlayerBase player, ActionTarget target, ItemBase item)
bool SimplifiedCollisionInfoCheck(PlayerBase player, ActionTarget target, ItemBase item)
'ComplexBuildCollideCheckClient' not suitable for this, due to missing context (looks into wrong vari...
override void InitInfoData()
ConstructionPart GetConstructionPart()
void ActionConstructionPartInfoContinuous()
void ActionTarget(Object object, Object parent, int componentIndex, vector cursorHitPos, float utility, string surfaceName="")
void ConstructionBase(EntityAI parent)
void CollisionCheckData()
EConstructionInfoCategories
void ConstructionPart(string name, string part_name, string main_part_name, int id, bool is_built, bool is_base, bool is_gate, array< string > required_parts)
class GP5GasMask extends MaskBase ItemBase
void ActionInfoDataBase()
override bool PerformRoofCheckForBase(string partName, PlayerBase player, out bool result)
override bool MustBeBuiltFromOutside()
Super root of all classes in Enforce script.
ConstructionPart GetBuildPartInfoAtIndex(int idx)
void SetTarget(Object target)
string GetBuildTextOverride()
Instanced construction part data classes for dynamic data, statics now stored on EntityType level in ...
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.