Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_NearbyContextDisplay Class Reference
Inheritance diagram for SCR_NearbyContextDisplay:

Protected 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)
void ClearCachedWidgets ()
bool IsObstructed (vector contextPos, vector cameraPos, BaseWorld world, notnull IEntity entAction)
void SetVisibleWidgets ()
 Iterates through available precached widgets and leaves only provided count enabled.
void SetWidgetAlpha (Widget widget, float distance, float limit)
bool GetWorldToScreenPosition (BaseWorld world, int cameraIndex, vector worldPosition, out float posX, out float posY)
bool IsInLineOfSight (vector point, vector transform[4], float val)
bool IsOnScreen (float resX, float resY, float posX, float posY)
float GetDistanceFromScreenCenter (float resX, float resY, float posX, float posY)

Static Protected Member Functions

static bool IsCharacter (notnull IEntity entity)

Protected Attributes

int m_iMaxPrecachedWidgets
ResourceName m_sIconLayoutPath
ResourceName m_sDefaultIconImage
ResourceName m_sCachingConfigResource
float m_fMinWidgetAlpha
ref array< ref SCR_NearbyContextColorsComponentInteract > m_aNearbyWidgetColors
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< Widgetm_aCurrentlyUsedWidgets = {}
ref array< SCR_NearbyContextCachingData > m_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 map< SCR_ENearbyInteractionContextColors, ref SCR_NearbyContextColorsComponentInteract > m_mCachedActionColors
 Holds all the different cached id with the enum as key.
ref TraceParam m_RaycastParam = new TraceParam()

Detailed Description

Definition at line 3 of file SCR_NearbyContextDisplay.c.

Constructor & Destructor Documentation

◆ ~SCR_NearbyContextDisplay()

void SCR_NearbyContextDisplay::~SCR_NearbyContextDisplay ( )
inlineprotected

Performs cleanup.

Definition at line 60 of file SCR_NearbyContextDisplay.c.

Member Function Documentation

◆ CacheWidget()

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

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

Definition at line 413 of file SCR_NearbyContextDisplay.c.

◆ ClearCachedWidgets()

void SCR_NearbyContextDisplay::ClearCachedWidgets ( )
inlineprotected

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 it is below the cap.

Definition at line 457 of file SCR_NearbyContextDisplay.c.

◆ DisplayInit()

override void SCR_NearbyContextDisplay::DisplayInit ( IEntity owner)
inlineprotected

Definition at line 98 of file SCR_NearbyContextDisplay.c.

◆ DisplayStartDraw()

override void SCR_NearbyContextDisplay::DisplayStartDraw ( IEntity owner)
inlineprotected

Definition at line 73 of file SCR_NearbyContextDisplay.c.

◆ DisplayStopDraw()

override void SCR_NearbyContextDisplay::DisplayStopDraw ( IEntity owner)
inlineprotected

Definition at line 150 of file SCR_NearbyContextDisplay.c.

◆ DisplayUpdate()

override void SCR_NearbyContextDisplay::DisplayUpdate ( IEntity owner,
float timeSlice )
inlineprotected

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

Definition at line 165 of file SCR_NearbyContextDisplay.c.

◆ GetDistanceFromScreenCenter()

float SCR_NearbyContextDisplay::GetDistanceFromScreenCenter ( float resX,
float resY,
float posX,
float posY )
inlineprotected

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

Definition at line 612 of file SCR_NearbyContextDisplay.c.

◆ GetWorldToScreenPosition()

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

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

Definition at line 563 of file SCR_NearbyContextDisplay.c.

◆ IsCharacter()

bool SCR_NearbyContextDisplay::IsCharacter ( notnull IEntity entity)
inlinestaticprotected

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

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

Definition at line 522 of file SCR_NearbyContextDisplay.c.

◆ IsInLineOfSight()

bool SCR_NearbyContextDisplay::IsInLineOfSight ( vector point,
vector transform[4],
float val )
inlineprotected

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]-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

Definition at line 578 of file SCR_NearbyContextDisplay.c.

◆ IsObstructed()

bool SCR_NearbyContextDisplay::IsObstructed ( vector contextPos,
vector cameraPos,
BaseWorld world,
notnull IEntity entAction )
inlineprotected

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
[in]EntityOwner of the Action
Returns
true if raycast collided with something, false otherwise

Definition at line 498 of file SCR_NearbyContextDisplay.c.

◆ IsOnScreen()

bool SCR_NearbyContextDisplay::IsOnScreen ( float resX,
float resY,
float posX,
float posY )
inlineprotected

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

Definition at line 597 of file SCR_NearbyContextDisplay.c.

◆ SetVisibleWidgets()

void SCR_NearbyContextDisplay::SetVisibleWidgets ( )
inlineprotected

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

Definition at line 529 of file SCR_NearbyContextDisplay.c.

◆ SetWidgetAlpha()

void SCR_NearbyContextDisplay::SetWidgetAlpha ( Widget widget,
float distance,
float limit )
inlineprotected

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

Definition at line 546 of file SCR_NearbyContextDisplay.c.

Member Data Documentation

◆ m_aConfigLayouts

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

Definition at line 48 of file SCR_NearbyContextDisplay.c.

◆ m_aCurrentlyUsedWidgets

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

Definition at line 46 of file SCR_NearbyContextDisplay.c.

◆ m_aNearbyWidgetColors

ref array<ref SCR_NearbyContextColorsComponentInteract> SCR_NearbyContextDisplay::m_aNearbyWidgetColors
protected

Definition at line 21 of file SCR_NearbyContextDisplay.c.

◆ m_bIsInitialized

bool SCR_NearbyContextDisplay::m_bIsInitialized
protected

Definition at line 43 of file SCR_NearbyContextDisplay.c.

◆ m_CachingConfig

ref SCR_NearbyContextCachingConfig SCR_NearbyContextDisplay::m_CachingConfig
protected

Definition at line 23 of file SCR_NearbyContextDisplay.c.

◆ m_Character

ChimeraCharacter SCR_NearbyContextDisplay::m_Character
protected

Definition at line 28 of file SCR_NearbyContextDisplay.c.

◆ 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.

Definition at line 41 of file SCR_NearbyContextDisplay.c.

◆ 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.

Definition at line 39 of file SCR_NearbyContextDisplay.c.

◆ m_fMinWidgetAlpha

float SCR_NearbyContextDisplay::m_fMinWidgetAlpha
protected

Definition at line 18 of file SCR_NearbyContextDisplay.c.

◆ m_iMaxPrecachedWidgets

int SCR_NearbyContextDisplay::m_iMaxPrecachedWidgets
protected

Definition at line 6 of file SCR_NearbyContextDisplay.c.

◆ m_InteractionHandlerComponent

SCR_InteractionHandlerComponent SCR_NearbyContextDisplay::m_InteractionHandlerComponent
protected

Interaction handler attached to parent entity.

Definition at line 26 of file SCR_NearbyContextDisplay.c.

◆ m_mCachedActionColors

ref map<SCR_ENearbyInteractionContextColors, ref SCR_NearbyContextColorsComponentInteract> SCR_NearbyContextDisplay::m_mCachedActionColors
protected

Holds all the different cached id with the enum as key.

Definition at line 54 of file SCR_NearbyContextDisplay.c.

◆ 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.

Definition at line 51 of file SCR_NearbyContextDisplay.c.

◆ m_RaycastParam

ref TraceParam SCR_NearbyContextDisplay::m_RaycastParam = new TraceParam()
protected

Definition at line 56 of file SCR_NearbyContextDisplay.c.

◆ m_sCachingConfigResource

ResourceName SCR_NearbyContextDisplay::m_sCachingConfigResource
protected

Definition at line 15 of file SCR_NearbyContextDisplay.c.

◆ m_sDefaultIconImage

ResourceName SCR_NearbyContextDisplay::m_sDefaultIconImage
protected

Definition at line 12 of file SCR_NearbyContextDisplay.c.

◆ m_sDefaultMapKey

string SCR_NearbyContextDisplay::m_sDefaultMapKey
protected

Definition at line 45 of file SCR_NearbyContextDisplay.c.

◆ m_sIconLayoutPath

ResourceName SCR_NearbyContextDisplay::m_sIconLayoutPath
protected

Definition at line 9 of file SCR_NearbyContextDisplay.c.


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