protected override void ClientItemUseStart(ClientItemData data) { DeconstructionSystem.ClientTryStartAction(); }
protected override bool ClientItemUseFinish(ClientItemData data) { DeconstructionSystem.ClientTryAbortAction(); // never play crowbar "use" sound return(false); }
protected override void ClientInteractFinish(ClientObjectData data) { DeconstructionSystem.ClientTryAbortAction(); }
protected override void ClientInteractStart(ClientObjectData data) { DeconstructionSystem.ClientTryStartAction(); }
private static void Update() { if (LoadingSplashScreenManager.Instance.CurrentState != LoadingSplashScreenState.Hidden) { return; } IStaticWorldObject worldObject = null; IProtoObjectStructure protoStructure = null; var selectedProtoItem = ClientHotbarSelectedItemManager.SelectedItem?.ProtoItem; if (selectedProtoItem is IProtoItemToolToolbox || selectedProtoItem is IProtoItemToolCrowbar) { worldObject = ClientComponentObjectInteractionHelper.MouseOverObject as IStaticWorldObject; protoStructure = worldObject?.ProtoGameObject as IProtoObjectStructure; } if (currentTooltipsWorldObject != worldObject) { tooltipBuildOrRepair?.Destroy(); tooltipBuildOrRepair = null; tooltipRelocate?.Destroy(); tooltipRelocate = null; tooltipDeconstruct?.Destroy(); tooltipDeconstruct = null; currentTooltipsWorldObject = worldObject; } if (protoStructure is null) { return; } // process structure repair tooltip var isBuildTooltipRequired = selectedProtoItem is IProtoItemToolToolbox && protoStructure.ClientIsConstructionOrRepairRequirementsTooltipShouldBeDisplayed(worldObject); if (tooltipBuildOrRepair is null) { if (isBuildTooltipRequired) { tooltipBuildOrRepair = ConstructionOrRepairRequirementsTooltip.CreateAndAttach(worldObject); } } else if (!isBuildTooltipRequired) { tooltipBuildOrRepair.Destroy(); tooltipBuildOrRepair = null; } // process structure relocation tooltip var canRelocate = selectedProtoItem is IProtoItemToolToolbox && !ConstructionRelocationSystem.IsInObjectPlacementMode && ConstructionRelocationSystem.SharedIsRelocatable(worldObject); if (tooltipRelocate is null) { if (canRelocate) { tooltipRelocate = ConstructionRelocationTooltip.CreateAndAttach(worldObject); } } else if (!canRelocate) { tooltipRelocate.Destroy(); tooltipRelocate = null; } // process structure deconstruction tooltip var canDeconstruct = selectedProtoItem is IProtoItemToolCrowbar && DeconstructionSystem.SharedIsDeconstructable(protoStructure); if (tooltipDeconstruct is null) { if (canDeconstruct) { tooltipDeconstruct = ConstructionDeconstructTooltip.CreateAndAttach(worldObject); } } else if (!canDeconstruct) { tooltipDeconstruct.Destroy(); tooltipDeconstruct = null; } }