Arma Reforger Script API
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
SCR_NearbyContextDisplay Interface Reference
Inheritance diagram for SCR_NearbyContextDisplay:
[legend]

Public Member Functions

void ~SCR_NearbyContextDisplay ()
 Performs cleanup.
 
override void DisplayStartDraw (IEntity owner)
 
override void DisplayInit (IEntity owner)
 
override void DisplayStopDraw (IEntity owner)
 
override void DisplayUpdate (IEntity owner, float timeSlice)
 
void CacheWidget (ResourceName layout, int amount, bool returnWidget=false, Widget widgetToReturn=null)
 Create a certain amount of given Widgets to cache.
 
- Public Member Functions inherited from SCR_InfoDisplayExtended
void SetEnabled (bool isEnabled)
 
override void Show (bool show, float speed=UIConstants.FADE_RATE_INSTANT, EAnimationCurve curve=EAnimationCurve.LINEAR)
 Show/hide InfoDisplay properly, not breaking other systems like AdaptiveOpacity or ConditionalVisibility.
 
- Public Member Functions inherited from SCR_InfoDisplay
SCR_InfoDisplayHandler GetHandler (TypeName handlerType)
 
SCR_InfoDisplayInvoker GetOnStart ()
 
SCR_InfoDisplayInvoker GetOnStop ()
 
IEntity GetOwnerEntity ()
 
Widget GetContentWidget ()
 
string GetContentWidgetName ()
 
void SetRootWidget (notnull Widget root)
 
void SetContentWidget (notnull Widget content)
 
void Show (bool show, float speed=UIConstants.FADE_RATE_INSTANT, EAnimationCurve curve=EAnimationCurve.LINEAR)
 Show/hide InfoDisplay properly, not breaking other systems like AdaptiveOpacity or ConditionalVisibility.
 
bool IsShown ()
 
Widget GetRootWidget ()
 
bool GetDimensions (out float width, out float height, bool addSafezones=true)
 Get width and height of the InfoDisplay element, optionally with safezones adjustments.
 
bool GetAnchorPosition (out float x, out float y, EWidgetAnchor anchor=EWidgetAnchor.TOPLEFT, bool addSafezones=true)
 Get width and height of the InfoDisplay element, optionally with safezones adjustments.
 
void RegisterToHudManager ()
 
- Public Member Functions inherited from GroupInfoDisplay
proto external int GetInfoDisplays (out notnull array< BaseInfoDisplay > outInfoDisplays)
 
- Public Member Functions inherited from BaseInfoDisplay
proto external GenericComponent FindComponentInParentContainer (TypeName typeName)
 

Public Attributes

ResourceName m_sIconLayoutPath
 
ResourceName m_sDefaultInteractionLayoutPath
 
- Public Attributes inherited from SCR_InfoDisplay
ResourceName m_LayoutPath
 
EHudLayers m_eLayer
 
int m_iOverrideZOrder
 

Protected Member Functions

void ClearCachedWidgets ()
 Check every Cached Widget array and check if the array holds more widgets then the cap allows If there are too many cached Widgets, delete Widgets until its below the cap.
 
bool IsObstructed (vector contextPos, vector cameraPos, BaseWorld world)
 Use a Raycast to check if the givin position is in line of sight.
 
void SetVisibleWidgets ()
 Iterates through available precached widgets and leaves only provided count enabled.
 
void SetWidgetAlpha (Widget widget, float distance, float limit)
 Set the Widget alpha based on the distance of the Context it's attached to to the Camera.
 
bool GetWorldToScreenPosition (BaseWorld world, int cameraIndex, vector worldPosition, out float posX, out float posY)
 Recalculates worldPosition to screen space and applies it to widget.
 
bool IsInLineOfSight (vector point, vector transform[4], float val)
 Performs a dot product check against threshold whether point is in line of sight of provided transformation.
 
bool IsOnScreen (float resX, float resY, float posX, float posY)
 Checks is the given screenposition is within the resolution and not outside of the screen.
 
float GetDistanceFromScreenCenter (float resX, float resY, float posX, float posY)
 Gets the distance from givin point to screen center by taking the X & Y position an calcualting the distance between them.
 
- Protected Member Functions inherited from SCR_InfoDisplayExtended
bool DisplayStartDrawInit (IEntity owner)
 
void DisplayStartDraw (IEntity owner)
 
void DisplayStopDraw (IEntity owner)
 
void DisplayInit (IEntity owner)
 
void DisplayUpdate (IEntity owner, float timeSlice)
 
void DisplayControlledEntityChanged (IEntity from, IEntity to)
 
void DisplayConsciousnessChanged (bool conscious, bool init=false)
 
void DisplayOnSuspended ()
 Called when GUI is temporarily suspended due to visibility flags; e.g. GM entered and GUI marked as not to show in GM.
 
void DisplayOnResumed ()
 
void InitializeInterfaceSettings ()
 
void OnSettingsChanged ()
 
- Protected Member Functions inherited from SCR_InfoDisplay
void OnShownFinished (Widget w, float targetOpacity, WidgetAnimationOpacity anim=null)
 
override void OnStartDraw (IEntity owner)
 
void AdaptiveOpacity_Update (float opacity, float sceneBrightness, bool init=false)
 
override void OnStopDraw (IEntity owner)
 
override void UpdateValues (IEntity owner, float timeSlice)
 
override void OnInit (IEntity owner)
 
void OnInit (IEntity owner)
 
void UpdateValues (IEntity owner, float timeSlice)
 
void OnStartDraw (IEntity owner)
 
void OnStopDraw (IEntity owner)
 

Static Protected Member Functions

static bool IsCharacter (notnull IEntity entity)
 Callback method for TraceMove, to check if hit entity is a Character.
 

Protected Attributes

int m_iMaxPrecachedWidgets
 
ResourceName m_sDefaultIconImage
 
ResourceName m_sCachingConfigResource
 
float m_fMinWidgetAlpha
 
ref SCR_NearbyContextCachingConfig m_CachingConfig
 
SCR_InteractionHandlerComponent m_InteractionHandlerComponent
 Interaction handler attached to parent entity.
 
ChimeraCharacter m_Character
 
float m_fInteractionDistance
 Distance in meters in which a context can be interacted with. Defined in 'InteractionHandlerComponent' on DefaultPlayerController entity.
 
float m_fContextCollectDistance
 Distnace in meters in which contexts will be collected and visible to indicate a possible interaction. Defined in 'InteractionHandlerComponent' on DefaultPlayerController entity.
 
bool m_bIsInitialized
 
string m_sDefaultMapKey
 
ref array< Widget > m_aCurrentlyUsedWidgets = {}
 
ref array< SCR_NearbyContextCachingDatam_aConfigLayouts = {}
 
ref map< string, ref array< Widget > > m_mCachedWidgets = new map<string, ref array<Widget>>()
 Holds all the different cached Widgets with the Layout GUID as key.
 
ref TraceParam m_RaycastParam = new TraceParam()
 
- Protected Attributes inherited from SCR_InfoDisplayExtended
bool m_bIsEnabled
 
string m_sInterfaceSettingName
 
SCR_PlayerController m_PlayerController
 
SCR_CharacterControllerComponent m_CharacterController
 
SCR_CharacterCameraHandlerComponent m_CameraHandler
 
MenuManager m_MenuManager
 
EventHandlerManagerComponent m_EventHandlerManager
 
SCR_EditorManagerEntity m_EditorManager
 
bool m_bAttachedToPlayerController
 
bool m_bInThirdPerson
 
bool m_bInADS
 
bool m_bIsUnconscious
 
bool m_bInPauseMenu
 
bool m_bInEditor
 
bool m_bCanShow
 
bool m_bIsEnabledInSettings = true
 
bool m_bShowInAllCameras = true
 
- Protected Attributes inherited from SCR_InfoDisplay
string m_sParentSlot
 
string m_sContentWidget
 
int m_iContentWidthAdjustment
 
int m_iContentHeightAdjustment
 
string m_sAdaptiveOpacityWidgetName
 
ref array< ref SCR_InfoDisplayHandlerm_aHandlers
 
bool m_bShown
 
Widget m_wRoot
 
Widget m_wContent
 
Widget m_wSlot
 
SCR_HUDManagerComponent m_HUDManager
 
int m_iChildDisplays = 0
 
ref array< BaseInfoDisplaym_aChildDisplays = new array<BaseInfoDisplay>
 
SCR_InfoDisplay m_pParentDisplay
 
bool m_bRegistered = false
 
IEntity m_OwnerEntity
 
ref array< ref SCR_InfoDisplayHandlerm_aUpdatableHandlers = {}
 
ref SCR_InfoDisplayInvoker m_OnStart = new SCR_InfoDisplayInvoker()
 
ref SCR_InfoDisplayInvoker m_OnStop = new SCR_InfoDisplayInvoker()
 

Constructor & Destructor Documentation

◆ ~SCR_NearbyContextDisplay()

void SCR_NearbyContextDisplay.~SCR_NearbyContextDisplay ( )

Performs cleanup.

Member Function Documentation

◆ CacheWidget()

void SCR_NearbyContextDisplay.CacheWidget ( ResourceName  layout,
int  amount,
bool  returnWidget = false,
Widget  widgetToReturn = null 
)

Create a certain amount of given Widgets to cache.

Parameters
[in]layoutLayout that will be created and cached
[in]intAmount of Widgets you want to cache
[in]boolIf true a Widget must be provided that will be used imideatly after caching
[in]widgetIf returnWidget is true a Widget must be defined to where the newly created one should be used

◆ ClearCachedWidgets()

void SCR_NearbyContextDisplay.ClearCachedWidgets ( )
protected

Check every Cached Widget array and check if the array holds more widgets then the cap allows If there are too many cached Widgets, delete Widgets until its below the cap.

◆ DisplayInit()

override void SCR_NearbyContextDisplay.DisplayInit ( IEntity  owner)

◆ DisplayStartDraw()

override void SCR_NearbyContextDisplay.DisplayStartDraw ( IEntity  owner)

◆ DisplayStopDraw()

override void SCR_NearbyContextDisplay.DisplayStopDraw ( IEntity  owner)

◆ DisplayUpdate()

override void SCR_NearbyContextDisplay.DisplayUpdate ( IEntity  owner,
float  timeSlice 
)

If there is no widget available create a new one and use that

If there is no widget available create a new one and use that

Implements SCR_InfoDisplayExtended.

◆ GetDistanceFromScreenCenter()

float SCR_NearbyContextDisplay.GetDistanceFromScreenCenter ( float  resX,
float  resY,
float  posX,
float  posY 
)
protected

Gets the distance from givin point to screen center by taking the X & Y position an calcualting the distance between them.

Parameters
[in]floatScreenresolutionX
[in]floatScreenresolutionY
[in]floatX position on the screen
[in]floatY position on the screen
Returns
Distance between posX & posY. 0 = Center. >0 further from center

◆ GetWorldToScreenPosition()

bool SCR_NearbyContextDisplay.GetWorldToScreenPosition ( BaseWorld  world,
int  cameraIndex,
vector  worldPosition,
out float  posX,
out float  posY 
)
protected

Recalculates worldPosition to screen space and applies it to widget.

Parameters
[in]worldPosition
[in]intCamera thats being used
[in]vectorPosition in world space
[out]posXX Position on the screen
[out]posYY Position on the screen

◆ IsCharacter()

static bool SCR_NearbyContextDisplay.IsCharacter ( notnull IEntity  entity)
staticprotected

Callback method for TraceMove, to check if hit entity is a Character.

Parameters
entity
Returns
true if entity is a character, false otherwise

◆ IsInLineOfSight()

bool SCR_NearbyContextDisplay.IsInLineOfSight ( vector  point,
vector  transform[4],
float  val 
)
protected

Performs a dot product check against threshold whether point is in line of sight of provided transformation.

Parameters
[in]vectorpoint Point to perform check for
[in]vector[4]transform Reference matrix checked against
[in]floatthreshold01 Dot product result is compared against this value, higher values result in more narrow arc.
Returns
true if is in line of sight, flase otherwise

◆ IsObstructed()

bool SCR_NearbyContextDisplay.IsObstructed ( vector  contextPos,
vector  cameraPos,
BaseWorld  world 
)
protected

Use a Raycast to check if the givin position is in line of sight.

Parameters
[in]Positionto which we cast the raycast
[in]Positionwhere the raycast should start
[in]currentworld
Returns
true if raycast collided with something, false otherwise

◆ IsOnScreen()

bool SCR_NearbyContextDisplay.IsOnScreen ( float  resX,
float  resY,
float  posX,
float  posY 
)
protected

Checks is the given screenposition is within the resolution and not outside of the screen.

Parameters
[in]floatScreenresolutionX
[in]floatScreenresolutionY
[in]floatX position on the screen
[in]floatY position on the screen
Returns
true if the position is on the screen. False if the position it outside of the screen

◆ SetVisibleWidgets()

void SCR_NearbyContextDisplay.SetVisibleWidgets ( )
protected

Iterates through available precached widgets and leaves only provided count enabled.

◆ SetWidgetAlpha()

void SCR_NearbyContextDisplay.SetWidgetAlpha ( Widget  widget,
float  distance,
float  limit 
)
protected

Set the Widget alpha based on the distance of the Context it's attached to to the Camera.

Parameters
[in]Widgetto which the alpha will be applied
[in]Distancefrom camera to context in world space
[in]Maxdistance until the alpha will be 0

Member Data Documentation

◆ m_aConfigLayouts

ref array<SCR_NearbyContextCachingData> SCR_NearbyContextDisplay.m_aConfigLayouts = {}
protected

◆ m_aCurrentlyUsedWidgets

ref array<Widget> SCR_NearbyContextDisplay.m_aCurrentlyUsedWidgets = {}
protected

◆ m_bIsInitialized

bool SCR_NearbyContextDisplay.m_bIsInitialized
protected

◆ m_CachingConfig

ref SCR_NearbyContextCachingConfig SCR_NearbyContextDisplay.m_CachingConfig
protected

◆ m_Character

ChimeraCharacter SCR_NearbyContextDisplay.m_Character
protected

◆ m_fContextCollectDistance

float SCR_NearbyContextDisplay.m_fContextCollectDistance
protected

Distnace in meters in which contexts will be collected and visible to indicate a possible interaction. Defined in 'InteractionHandlerComponent' on DefaultPlayerController entity.

◆ m_fInteractionDistance

float SCR_NearbyContextDisplay.m_fInteractionDistance
protected

Distance in meters in which a context can be interacted with. Defined in 'InteractionHandlerComponent' on DefaultPlayerController entity.

◆ m_fMinWidgetAlpha

float SCR_NearbyContextDisplay.m_fMinWidgetAlpha
protected

◆ m_iMaxPrecachedWidgets

int SCR_NearbyContextDisplay.m_iMaxPrecachedWidgets
protected

◆ m_InteractionHandlerComponent

SCR_InteractionHandlerComponent SCR_NearbyContextDisplay.m_InteractionHandlerComponent
protected

Interaction handler attached to parent entity.

◆ m_mCachedWidgets

ref map<string, ref array<Widget> > SCR_NearbyContextDisplay.m_mCachedWidgets = new map<string, ref array<Widget>>()
protected

Holds all the different cached Widgets with the Layout GUID as key.

◆ m_RaycastParam

ref TraceParam SCR_NearbyContextDisplay.m_RaycastParam = new TraceParam()
protected

◆ m_sCachingConfigResource

ResourceName SCR_NearbyContextDisplay.m_sCachingConfigResource
protected

◆ m_sDefaultIconImage

ResourceName SCR_NearbyContextDisplay.m_sDefaultIconImage
protected

◆ m_sDefaultInteractionLayoutPath

ResourceName SCR_NearbyContextDisplay.m_sDefaultInteractionLayoutPath

◆ m_sDefaultMapKey

string SCR_NearbyContextDisplay.m_sDefaultMapKey
protected

◆ m_sIconLayoutPath

ResourceName SCR_NearbyContextDisplay.m_sIconLayoutPath

The documentation for this interface was generated from the following file: