Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_CampaignBuildingGadgetToolComponent.c File Reference

Go to the source code of this file.

Classes

class  SCR_CampaignBuildingGadgetToolComponentClass

Functions

SCR_CampaignBuildingGadgetToolComponentClass SCR_GadgetComponentClass Attribute (defvalue:"25", desc:"Max distance at which the ghost preview is shown.")
override void Update (float timeSlice)
override void OnToggleActive (bool state)
override EGadgetType GetType ()
override void ModeSwitch (EGadgetMode mode, IEntity charOwner)
void ToolToHand ()
 Building tool taken to hand - show preview etc.
void OnPossessed (int playerID, bool isPossessing, RplId mainEntityID)
void ToolToInventory ()
 Building tool out of hands - show preview.
SCR_EditorModeEntity GetBuildingModeEntity ()
void RemovePreviews ()
void OnEditorOpened ()
 Method called when character has a shovel in hands and any editor mode is opned.
void OnEditorClosed ()
 Method called when character has a shovel in hands and any editor mode is closed.
void OnConsciousnessChanged (bool conscious)
 Will be called when the consciousness of the character changes.
void RemoveOnConsciousnessChanged ()
bool TraceCompositionToShowPreview ()
bool EvaluatePreviewEntity (IEntity ent)
int GetToolConstructionValue ()
SCR_CharacterControllerComponent GetCharacterControllerComponent ()
void RemoveEventHandlers ()
bool GetCanEnterPlacementMode ()
bool HasMoreItemsToPlace ()
bool HasMoreVariants ()
bool GetIsPlacementModeEnabled ()
SCR_MultiPartDeployableItemComponent GetCurrentlyHandledComponent ()
int FindDeployableItems (IEntity ignoredItem=null, bool skipUniqueCountCheck=false)
void ActivateAction ()
 Action listener callback.
void ModeClear (EGadgetMode mode)
void SetPlacementMode (bool newState)
void CycleItems (float value=0.0, EActionTrigger reason=0, string actionName=string.Empty)
void CycleVariants (float value=0.0, EActionTrigger reason=0, string actionName=string.Empty)
float GetMaxAllowedTilt ()
bool ValidateSurface (notnull SCR_ItemPlacementComponent caller, out ENotification cantPlaceReason, IEntity surfaceEnt, vector worldPosition, vector surfaceNorm, int nodeIndex, int colliderIndex, SurfaceProperties surfaceProps, string surfaceMaterial, string colliderName)
bool ValidateSpace (notnull SCR_ItemPlacementComponent caller, inout vector transform[4], out ENotification cantPlaceReason)
void OverridePreviewTransform (notnull SCR_ItemPlacementComponent caller, inout vector transform[4])
void OnItemPlacementStart (notnull SCR_ItemPlacementComponent caller)
void OnAfterItemPlaced (notnull SCR_ItemPlacementComponent caller, notnull IEntity item, bool success, bool equipNext)
bool SelectNextVariant ()
void SelectNextPlaceableItem (notnull SCR_ItemPlacementComponent placementComp)
void EnablePreview (bool enabled, notnull SCR_ItemPlacementComponent placementComp)

Variables

ref array< SCR_CampaignBuildingLayoutComponent > m_aShownPreviewOld = {}
bool m_bToolActiveWhenEditorOpen
ref array< IEntitym_aFoundDeployables
SCR_MultiPartDeployableItemComponent m_CurrentlyHandledComponent
int m_iCurrentVariant = -1
bool m_bPlacementModeEnabled
bool m_bCanEnterPlacementMode
bool m_bHasMoreItemsToPlace
bool m_bHasMoreVariantsToChoose

Function Documentation

◆ ActivateAction()

void ActivateAction ( )
protected

Action listener callback.

Definition at line 503 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ Attribute()

SCR_CampaignBuildingGadgetToolComponentClass SCR_GadgetComponentClass Attribute ( defvalue:"25" ,
desc:"Max distance at which the ghost preview is shown."  )

Definition at line 1 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ CycleItems()

void CycleItems ( float value = 0.0,
EActionTrigger reason = 0,
string actionName = string.Empty )
protected

Callback method used to cycle between all unique deployable items

Parameters
[in]value
[in]reason
[in]actionName

Definition at line 574 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ CycleVariants()

void CycleVariants ( float value = 0.0,
EActionTrigger reason = 0,
string actionName = string.Empty )
protected

Callback method used to cycle between all available variants for currently used deployable

Parameters
[in]value
[in]reason
[in]actionName

Definition at line 593 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ EnablePreview()

void EnablePreview ( bool enabled,
notnull SCR_ItemPlacementComponent placementComp )
protected
Parameters
[in]enabled
[in]placementComp

Definition at line 931 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ EvaluatePreviewEntity()

bool EvaluatePreviewEntity ( IEntity ent)
protected

Definition at line 342 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ FindDeployableItems()

int FindDeployableItems ( IEntity ignoredItem = null,
bool skipUniqueCountCheck = false )
protected

Searches the inventory for compatible deployable items

Parameters
[in]ignoredItem
[in]skipUniqueCountChecktrue if game should not try validate if player can cycle between available deployable items
Returns
number of found items

Definition at line 458 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ GetBuildingModeEntity()

SCR_EditorModeEntity GetBuildingModeEntity ( )
protected

Search for an editor mode entity (exists only when the player is in editor mode)

Returns

Definition at line 181 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ GetCanEnterPlacementMode()

bool GetCanEnterPlacementMode ( )
protected

Definition at line 420 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ GetCharacterControllerComponent()

SCR_CharacterControllerComponent GetCharacterControllerComponent ( )
protected
Returns

Definition at line 365 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ GetCurrentlyHandledComponent()

SCR_MultiPartDeployableItemComponent GetCurrentlyHandledComponent ( )
protected

Definition at line 448 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ GetIsPlacementModeEnabled()

bool GetIsPlacementModeEnabled ( )
protected

Definition at line 441 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ GetMaxAllowedTilt()

float GetMaxAllowedTilt ( )
protected
Returns
currently placed deployable max allowed tilt, and if such data is not available then it will return -1

Definition at line 616 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ GetToolConstructionValue()

int GetToolConstructionValue ( )
protected
Returns
the value how much this tool adds to a building value with one action

Definition at line 358 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ GetType()

override EGadgetType GetType ( )
protected

Definition at line 60 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ HasMoreItemsToPlace()

bool HasMoreItemsToPlace ( )
protected

Definition at line 427 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ HasMoreVariants()

bool HasMoreVariants ( )
protected

Definition at line 434 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ ModeClear()

void ModeClear ( EGadgetMode mode)
protected

Definition at line 509 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ ModeSwitch()

override void ModeSwitch ( EGadgetMode mode,
IEntity charOwner )
protected

Triggered when an operation with gadget is performed - picked up, taken into hands, back to backpack etc.

Parameters
[in]mode
[in]charOwnermust have a GadgetManager component

Definition at line 76 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ OnAfterItemPlaced()

void OnAfterItemPlaced ( notnull SCR_ItemPlacementComponent caller,
notnull IEntity item,
bool success,
bool equipNext )
protected
Parameters
[in]caller
[in]item
[in]succes
[in]equipNext

Definition at line 714 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ OnEditorClosed()

void OnEditorClosed ( )
protected

Method called when character has a shovel in hands and any editor mode is closed.

Definition at line 232 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ OnEditorOpened()

void OnEditorOpened ( )
protected

Method called when character has a shovel in hands and any editor mode is opned.

Definition at line 208 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ OnItemPlacementStart()

void OnItemPlacementStart ( notnull SCR_ItemPlacementComponent caller)
protected
Parameters
[in]caller

Definition at line 703 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ OnPossessed()

void OnPossessed ( int playerID,
bool isPossessing,
RplId mainEntityID )
protected
Parameters
[in]playerID
[in]isPossessing
[in]mainEntityID

Definition at line 129 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ OnToggleActive()

override void OnToggleActive ( bool state)
protected

Definition at line 49 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ OverridePreviewTransform()

void OverridePreviewTransform ( notnull SCR_ItemPlacementComponent caller,
inout vector transform[4] )
protected

Method used to override the position and rotation of the preview

Parameters
[in]caller
[in,out]transformpointer containing rotation and position at which item preivew will be shown, and from which the space validation will be done

Definition at line 692 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ RemoveEventHandlers()

void RemoveEventHandlers ( )
protected

Definition at line 402 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ RemoveOnConsciousnessChanged()

void RemoveOnConsciousnessChanged ( )
protected

Definition at line 265 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ RemovePreviews()

void RemovePreviews ( )
protected

Definition at line 195 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ SelectNextPlaceableItem()

void SelectNextPlaceableItem ( notnull SCR_ItemPlacementComponent placementComp)
protected
Parameters
[in]placementComp

Definition at line 837 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ SelectNextVariant()

bool SelectNextVariant ( )
protected
Returns

Definition at line 777 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ SetPlacementMode()

void SetPlacementMode ( bool newState)
protected
Parameters
[in]newState

Definition at line 519 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ ToolToHand()

void ToolToHand ( )
protected

Building tool taken to hand - show preview etc.

Definition at line 100 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ ToolToInventory()

void ToolToInventory ( )
protected

Building tool out of hands - show preview.

Definition at line 164 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ TraceCompositionToShowPreview()

bool TraceCompositionToShowPreview ( )
protected

Trace the possible previews

Returns

Definition at line 308 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ Update()

override void Update ( float timeSlice)
protected
Parameters
[in]timeSlice

Definition at line 36 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ ValidateSpace()

bool ValidateSpace ( notnull SCR_ItemPlacementComponent caller,
inout vector transform[4],
out ENotification cantPlaceReason )
protected

Method used to check if there is enough space for currently handled deployable variant

Parameters
[in]caller
[in,out]transformof the position for which validation should be performed. This position has already applied offset of 1% of its up vector (1cm)
[out]cantPlaceReason
Returns

Definition at line 667 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ ValidateSurface()

bool ValidateSurface ( notnull SCR_ItemPlacementComponent caller,
out ENotification cantPlaceReason,
IEntity surfaceEnt,
vector worldPosition,
vector surfaceNorm,
int nodeIndex,
int colliderIndex,
SurfaceProperties surfaceProps,
string surfaceMaterial,
string colliderName )
protected

Method used to execute custom validation of the surface entity

Parameters
[in]caller
[out]cantPlaceReason
[in]surfaceEntentity on which the item is going to be deployed
[in]worldPositionposition in world space
[in]surfaceNormnormal of the face on which the item is going to be deployed
[in]nodeIndexbone id to which is attached the collider on which the item is going to be deployed
[in]colliderIndexcollider id on which the item is going to be deployed
[in]surfacePropsproperties of the surface on which the item is going to be deployed
[in]surfaceMaterialname of the material of the surface on which the item is going to be deployed
[in]colliderNamename of the collider on which the item is going to be deployed
Returns
true if custom space validation was performed, otherwise false

Definition at line 645 of file SCR_CampaignBuildingGadgetToolComponent.c.

Variable Documentation

◆ m_aFoundDeployables

ref array<IEntity> m_aFoundDeployables
protected

Definition at line 25 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ m_aShownPreviewOld

ref array<SCR_CampaignBuildingLayoutComponent> m_aShownPreviewOld = {}
protected

Definition at line 21 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ m_bCanEnterPlacementMode

bool m_bCanEnterPlacementMode
protected

Definition at line 29 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ m_bHasMoreItemsToPlace

bool m_bHasMoreItemsToPlace
protected

Definition at line 30 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ m_bHasMoreVariantsToChoose

bool m_bHasMoreVariantsToChoose
protected

Definition at line 31 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ m_bPlacementModeEnabled

bool m_bPlacementModeEnabled
protected

Definition at line 28 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ m_bToolActiveWhenEditorOpen

bool m_bToolActiveWhenEditorOpen
protected

Definition at line 23 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ m_CurrentlyHandledComponent

SCR_MultiPartDeployableItemComponent m_CurrentlyHandledComponent
protected

Definition at line 26 of file SCR_CampaignBuildingGadgetToolComponent.c.

◆ m_iCurrentVariant

int m_iCurrentVariant = -1
protected

Definition at line 27 of file SCR_CampaignBuildingGadgetToolComponent.c.