283{
285 {
286 }
287
289 {
290 m_InfoData =
new ActionInfoDataConstructionImpossible();
291 }
292
294 {
297 }
298
300 {
301 return false;
302 }
303
305 {
306 return true;
307 }
308
310 {
313 if (part)
314 {
316 if (overrideText ==
string.
Empty)
318 else
320
321 #ifdef DIAG_DEVELOPER
323 {
325 }
326 #endif
327 }
328
329 }
330
332 {
335 return false;
336
337 if (player.IsPlacingLocal() || player.IsPlacingServer())
338 return false;
339
340
341 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
342 return false;
343
344 if (!ent.CanUseConstruction() || !ent.CanUseConstructionBuild())
345 return false;
346
347 if ((!
GetGame().IsDedicatedServer()))
348 {
350 {
352 }
353 }
354
355 return false;
356 }
357
359 {
360 return false;
361 }
362
364 {
366
369 {
370 ActionInfoDataConstructionImpossible info = ActionInfoDataConstructionImpossible.Cast(
m_InfoData);
374 construction.CanBuildPartEx(part.
GetPartName(), item, info.m_InfoContextMask);
375 info.SetConstructionPart(part);
376 info.SetTool(item);
377
378 #ifdef DIAG_DEVELOPER
380 DbgPrint(construction, info, target.GetComponentIndex());
381 #endif
382
385
386 return info.CanDisplayInfo();
387 }
388
389 return false;
390 }
391
392 #ifdef DIAG_DEVELOPER
393 void DbgPrint(notnull
ConstructionBase construction, ActionInfoDataConstructionBase info,
int componentIdx)
394 {
395 int failureMask = info.m_InfoContextMask;
398
399 if (failureMask == 0)
400 {
401 ConstructionDebug.RemoveBuildPartInfoData(partName);
402 }
403 else
404 {
405 string conflictingPart;
407 construction.HasConflictPart(partName, conflictingPart);
408
409 string missingSlot;
410 float missingQty;
412 construction.HasMaterialsEx(partName, false, missingSlot, missingQty);
413
415 string badToolType = "hands";
417 badToolType = tool.GetType();
418
419 ActionInfoDebugData data = new ActionInfoDebugData();
420 data.partName = partName;
421 data.componentIdx = componentIdx;
422 data.failureMask = failureMask;
423 data.conflictingPart = conflictingPart;
424 data.missingSlot = missingSlot;
425 data.missingQty = missingQty;
426 data.badToolType = badToolType;
427
428 ConstructionDebug.AddBuildPartInfoData(data);
429 }
430 }
431 #endif
432
435 {
441
442 if (!part)
443 {
446 }
447 else
448 {
451 return false;
452
453 if (!construction.ConstructionDirectionCheck(player, part, EConstructionDirCheckType.INDOORS))
454 return false;
455 if (!construction.ConstructionInsiderBoxCheck(player, part))
456 return false;
457 if (player.GetInputController().CameraIsFreeLook())
458 return false;
459
460 if (baseBuilding)
461 {
462 bool boo;
464 return false;
465 }
466
467 if (player.IsPlacingLocal() || player.IsPlacingServer())
468 return false;
469
472
473 return !construction.IsCollidingEx(checkData);
474 }
475
476 return false;
477 }
478}
479
480
482{
484 {
485 return ContinuousInteractActionInput;
486 }
487}
489
491{
493
495 {
497 }
498
500 {
501 return true;
502 }
503}
504
507{
510
512 {
514 }
515
517 {
519 }
520
522 {
524 }
525
527 {
529 }
530}
531
534{
535}
536
538class ActionInfoDataConstructionImpossible: ActionInfoDataConstructionBase
539{
541 {
542 bool forceHide = false;
547 bool show = true;
548
549
550
551 return super.CanDisplayInfo() && !forceHide && show;
552 }
553}
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.