Arma Reforger Script API
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
SCR_MapEntity Interface Reference

Map entity. More...

Inheritance diagram for SCR_MapEntity:
[legend]

Public Member Functions

MapConfiguration GetMapConfig ()
 Get map config.
 
bool IsOpen ()
 Check if the map is opened.
 
int GetMapSizeX ()
 Get map sizeX in meters.
 
int GetMapSizeY ()
 Get map sizeY in meters.
 
float GetMaxZoom ()
 Get maximal zoom.
 
float GetMinZoom ()
 Get minimal zoom.
 
float GetTargetZoomPPU ()
 Get target zoom in the form of PixelPerUnit value, which is different from current zoom if interpolation is ongoing.
 
bool IsZooming ()
 Get whether zoom interpolation is ongoing.
 
vector GetCurrentPan ()
 Get current DPIScaled pan offsets.
 
CanvasWidget GetMapWidget ()
 Get map widget.
 
Widget GetMapMenuRoot ()
 Get map menu root widget.
 
void SetMapWidget (Widget mapW)
 Set map widget.
 
MapItem GetHoveredItem ()
 Get hovered item.
 
void GetMapVisibleFrame (out vector min, out vector max)
 Return visible frame in the form of min and max point, used to ignore update of f.e. icons when they are not visible.
 
float GetCurrentZoom ()
 Get how much pixels per unit(meter) are currently visible on screen.
 
void GetMapCursorWorldPosition (out float worldX, out float worldY)
 Get map cursor world position.
 
void GetMapCenterWorldPosition (out float worldX, out float worldY)
 Get map center of screen world position.
 
SCR_MapModuleBase GetMapModule (TypeName moduleType)
 Get a specific map module.
 
SCR_MapUIBaseComponent GetMapUIComponent (TypeName componentType)
 Get a specific map UI component.
 
void OpenMap (MapConfiguration config)
 Open the map.
 
void CloseMap ()
 Close the map.
 
MapConfiguration SetupMapConfig (EMapEntityMode mapMode, ResourceName configPath, Widget rootWidget)
 Prepare MapConfiguration object from provided map config.
 
void CenterMap ()
 Center the map.
 
void ZoomOut ()
 Set minimal zoom and center the map.
 
void ShowScriptDebug ()
 Show/hide debug info table.
 
void SetZoom (float targetPPU, bool instant=false)
 Set zoom value.
 
void ZoomSmooth (float targetPixPerUnit, float zoomTime=0.25, bool zoomToCenter=true, bool reinitZoom=false)
 Interpolated zoom.
 
void ZoomPanSmooth (float targetPixPerUnit, float worldX, float worldY, float zoomTime=0.25)
 Interpolated zoom with custom pan target for simultaneous use of zoom+pan.
 
void SetPan (float x, float y, bool isPanEnd=true, bool center=true)
 Pan the map to target position, all of scripted panning is called through this.
 
void Pan (EMapPanMode panMode, float panValue=0)
 Pan the map by px amount.
 
void PanSmooth (float panX, float panY, float panTime=0.25)
 Interpolated pan.
 
void InvokeOnSelect (vector selectionPos)
 Triggers OnSelection event.
 
void SelectItem (MapItem item)
 Select target MapItem.
 
void HoverItem (MapItem item)
 Set hover mode to target MapItem.
 
void ClearSelection ()
 Clear selected items.
 
void ClearHover ()
 Clear hover state.
 
void WorldToScreen (float worldX, float worldY, out int screenPosX, out int screenPosY, bool withPan=false)
 Use canvas world coords to get DPIscaled screen coords, flips the y-axis.
 
void WorldToScreenCustom (float worldX, float worldY, out int screenPosX, out int screenPosY, float targetPPU, bool withPan=false)
 Use canvas world coords and defined pixel per unit to get DPIscaled screen coords, flips the y-axis.
 
void ScreenToWorld (int screenPosX, int screenPosY, out float worldX, out float worldY)
 Use scaled screen coords to get canvas world coords, flips the y-axis.
 
void ScreenToWorldNoFlip (int screenPosX, int screenPosY, out float worldX, out float worldY)
 Use scaled screen coords to get canvas world coords without flipping the y-axis.
 
bool UpdateZoomBounds ()
 Calculate zoom min/max.
 
void DeactivateModule (SCR_MapModuleBase module)
 Deactivate module, removing it from loadable list until config is reloaded.
 
void DeactivateComponent (SCR_MapUIBaseComponent component)
 Deactivate UI component, removing it from loadable list until config is reloaded.
 
void UpdateViewPort ()
 Updates view port.
 
override void EOnFrame (IEntity owner, float timeSlice)
 
override void EOnInit (IEntity owner)
 
void SCR_MapEntity (IEntitySource src, IEntity parent)
 
void ~SCR_MapEntity ()
 
- Public Member Functions inherited from MapEntity
proto external void UpdateTexts ()
 
proto external void AbsorbData ()
 Absorb world data and create precalculated form for visualisation.
 
proto external vector Offset ()
 Starting offset of the map.
 
proto external vector Size ()
 Terrain dimensions (x, height = maxElevation-minElevation, z)
 
proto external float TerrainUnitScale ()
 Terrain unit scale.
 
proto external void SetSelection (vector start, vector end)
 Set selection to visualise (from -> to)
 
proto external void ResetSelection ()
 Reset selection to visualise (from -> to)
 
proto external void SetFrame (vector start, vector end)
 Set frame to visualise (from -> to)
 
proto external void ZoomChange (float level)
 Set new zoom.
 
proto external void PosChange (float x, float y)
 Set new pos of map.
 
proto external void CursorChange (float x, float y)
 Set new pos of cursor.
 
proto external float MinElevation ()
 Minimal map elevation.
 
proto external float MaxElevation ()
 Maximal map elevation.
 
proto external float ElevationAt (vector pos)
 Get elevation at coords.
 
proto external void ShowDiag (bool bEnable)
 Show/ Hide diag.
 
proto external MapItem CreateCustomMapItem ()
 Create custom representation from script This representation has no entity and you have to support position and orientation yourself (watch MapItem Api)
 
proto external int CountOfVisible ()
 Count of visible.
 
proto external MapItem GetVisible (int iIndex)
 Visible by index.
 
proto external int GetVisibleAll (out notnull array< MapItem > outItems)
 Gets all the visible map entities in the current view.
 
proto external int GetInsideRect (out notnull array< MapItem > outItems, vector from, vector to)
 Get entities in rectangle. Flips the screen y-axis before performing its operation.
 
proto external int GetInsideCircle (out notnull array< MapItem > outItems, vector origin, float range)
 Get entities in circle. Flips the screen y-axis before performing its operation.
 
proto external MapItem GetClose (vector origin, float range)
 Get entities in rectangle. Flips the screen y-axis before performing its operation.
 
proto external int GetSelected (out notnull array< MapItem > outItems)
 Get all selected entities.
 
proto external int GetByType (out notnull array< MapItem > outItems, int type)
 Get entities by descriptor type.
 
proto external void ResetSelected ()
 Reset all entity selection.
 
proto external void ResetHovering ()
 Reset all entity hovering tag.
 
proto external void ResetHighlighted ()
 Reset all entity highlighted tag.
 
proto external void ShowMultiple (int type, bool bEnable)
 Show/ hide multiple items by type (EMapDescriptorType) of item.
 
proto external void ShowEditor (bool bEnable)
 Show/ hide editor items.
 
proto external void ShowDebug (bool bEnable)
 Show/ hide debug items (camera, map sizes)
 
proto external void EnableVisualisation (bool bValue)
 Enable/ Disable visualisation.
 
proto external void EnableGrid (bool bValue)
 Enable/ Disable grid visibility.
 
proto external void EnableOverlay (bool bValue)
 Enable/ Disable overlay.
 
proto external void InitializeLayers (int count, int factionSize=4)
 Clear layer setup + set new layer count.
 
proto external int LayerCount ()
 Get layer count.
 
proto external MapLayer GetLayer (int index)
 Get layer by Index.
 
proto external void SetLayer (int index)
 Set active layer.
 
proto external int GetLayerIndex ()
 Returns -1 if no valid index previously set.
 
proto external void SetImagesetMapping (notnull array< int > values)
 Sets corresponding multiple imageset indices for MapDescriptors usage.
 

Static Public Member Functions

static ScriptInvokerBase< MapConfigurationInvoker > GetOnMapInit ()
 Get on map init invoker, caution: called during the first frame of opening the map when widget related stuff is not initialized yet.
 
static ScriptInvokerBase< MapConfigurationInvoker > GetOnMapOpen ()
 Get on map open invoker.
 
static ScriptInvokerBase< MapConfigurationInvoker > GetOnMapClose ()
 Get on map close invoker.
 
static ScriptInvokerBase< ScriptInvokerFloat2Bool > GetOnMapPan ()
 Get on map pan invoker.
 
static ScriptInvokerFloat2 GetOnMapPanEnd ()
 Get on map pan interpolated end invoker.
 
static ScriptInvokerFloat GetOnMapZoom ()
 Get on map zoom invoker.
 
static ScriptInvokerFloat GetOnMapZoomEnd ()
 Get on map zoom interpolated end invoker.
 
static ScriptInvokerBase< MapItemInvoker > GetOnSelectionChanged ()
 Get on selection changed invoker.
 
static ScriptInvokerVector GetOnSelection ()
 Get on selection invoker.
 
static ScriptInvokerBase< MapItemInvoker > GetOnHoverItem ()
 Get on hover item invoker.
 
static ScriptInvokerBase< MapItemInvoker > GetOnHoverEnd ()
 Get on hover end invoker.
 
static ScriptInvokerInt GetOnLayerChanged ()
 Get on layer changed invoker.
 
static SCR_MapEntity GetMapInstance ()
 Get map entity instance.
 
static string GetGridLabel (vector pos, int resMin=2, int resMax=4, string delimiter=" ")
 Get grid coordinates for given position.
 
static void GetGridPos (vector pos, out int gridX, out int gridZ, int resMin=2, int resMax=4)
 Get grid coordinates for given position.
 

Static Public Attributes

const int FRAME_DELAY = 1
 

Protected Member Functions

void OnMapOpen (MapConfiguration config)
 Map open event.
 
void OnMapClose ()
 Map close event.
 
void OnLifeStateChanged (ECharacterLifeState previousLifeState, ECharacterLifeState newLifeState)
 SCR_CharacterControllerComponent event Called only in case of a fullscreen map.
 
void OnPlayerDeleted (int playerId, IEntity player)
 SCR_BaseGameMode event Called only in case of a fullscreen map.
 
void OnUserSettingsChanged ()
 Game event.
 
void OnWindowResized (int width, int heigth, bool windowed)
 Game event.
 
void SetupLayersAndProps (inout MapConfiguration configObject, SCR_MapConfig mapCfg)
 Layer and map properties config setup, if missing creates a default one.
 
void SetupDescriptorTypes (SCR_MapDescriptorDefaults descriptorDefaultsConfig)
 Map properties config setup, matches imageset indices defined in map layout (MapWidget) to descriptor types.
 
bool FitPanBounds (inout float panX, inout float panY, bool center)
 Adjust provided pan values by pan bounds conditions.
 
void AssignViewLayer (bool isInit)
 Checks whether layer should change based on current zoom.
 
void InitLayers (MapConfiguration mapConfig)
 Initialize layers from config.
 
void InitDescriptors (int layerID, MapLayer layer, SCR_LayerConfiguration layerConfig, MapConfiguration mapConfig)
 Init visibility and default config values for descriptors based on type.
 
void ActivateModules (array< ref SCR_MapModuleBase > modules)
 Activate modules.
 
void ActivateComponents (array< ref SCR_MapUIBaseComponent > components)
 Activate UI components.
 
void ActivateOtherComponents (EMapOtherComponents componentFlags)
 Activate other components.
 
void Cleanup ()
 Map close cleanup.
 
void PanUpdate (float timeSlice)
 Interpolated pan update.
 
void ZoomUpdate (float timeSlice)
 Interpolated zoom update.
 
void UpdateDebug ()
 Update map debug table.
 
void UpdateMap (float timeSlice)
 Handle update of modules, components and pan/zoom interpolation.
 
- Protected Member Functions inherited from MapEntity
proto external void EnableLegend (bool bValue)
 Enable/ Disable legend.
 

Protected Attributes

int m_iDelayCounter = FRAME_DELAY
 
bool m_bIsOpen
 
bool m_bDoReload
 
bool m_bDoUpdate
 
bool m_bIsDebugMode
 
int m_iMapSizeX
 
int m_iMapSizeY
 
int m_iMapOffsetX
 
int m_iMapOffsetY
 
vector m_vVisibleFrameMin
 
vector m_vVisibleFrameMax
 
EMapEntityMode m_eLastMapMode
 
Widget m_wMapRoot
 
CanvasWidget m_MapWidget
 
WorkspaceWidget m_Workspace
 
ref MapConfiguration m_ActiveMapCfg
 
MapItem m_HoveredMapItem
 
bool m_bIsZoomInterp
 
float m_fZoomPPU = 1
 
float m_fStartPPU
 
float m_fTargetPPU = 1
 
float m_fZoomTimeModif
 
float m_fZoomSlice
 
float m_fMinZoom = 1
 
float m_fMaxZoom
 
bool m_bIsPanInterp
 
int m_iPanX = 0
 
int m_iPanY = 0
 
int m_aStartPan [2]
 
int m_aTargetPan [2]
 
float m_fPanTimeModif
 
float m_fPanSlice
 
ref array< ref SCR_MapModuleBasem_aActiveModules = {}
 
ref array< ref SCR_MapModuleBasem_aLoadedModules = {}
 
ref array< ref SCR_MapUIBaseComponentm_aActiveComponents = {}
 
ref array< ref SCR_MapUIBaseComponentm_aLoadedComponents = {}
 

Static Protected Attributes

static SCR_MapEntity s_MapInstance
 
static ref ScriptInvokerBase< MapConfigurationInvoker > s_OnMapInit = new ScriptInvokerBase<MapConfigurationInvoker>()
 
static ref ScriptInvokerBase< MapConfigurationInvoker > s_OnMapOpen = new ScriptInvokerBase<MapConfigurationInvoker>()
 
static ref ScriptInvokerBase< MapConfigurationInvoker > s_OnMapClose = new ScriptInvokerBase<MapConfigurationInvoker>()
 
static ref ScriptInvokerBase< ScriptInvokerFloat2Bool > s_OnMapPan = new ScriptInvokerBase<ScriptInvokerFloat2Bool>
 
static ref ScriptInvokerFloat2 s_OnMapPanEnd = new ScriptInvokerFloat2()
 
static ref ScriptInvokerFloat s_OnMapZoom = new ScriptInvokerFloat()
 
static ref ScriptInvokerFloat s_OnMapZoomEnd = new ScriptInvokerFloat()
 
static ref ScriptInvokerVector s_OnSelection = new ScriptInvokerVector()
 
static ref ScriptInvokerInt s_OnLayerChanged = new ScriptInvokerInt()
 
static ref ScriptInvokerBase< MapItemInvoker > s_OnSelectionChanged = new ScriptInvokerBase<MapItemInvoker>()
 
static ref ScriptInvokerBase< MapItemInvoker > s_OnHoverItem = new ScriptInvokerBase<MapItemInvoker>()
 
static ref ScriptInvokerBase< MapItemInvoker > s_OnHoverEnd = new ScriptInvokerBase<MapItemInvoker>()
 

Detailed Description

Map entity.

Constructor & Destructor Documentation

◆ SCR_MapEntity()

void SCR_MapEntity.SCR_MapEntity ( IEntitySource  src,
IEntity  parent 
)

◆ ~SCR_MapEntity()

void SCR_MapEntity.~SCR_MapEntity ( )

Member Function Documentation

◆ ActivateComponents()

void SCR_MapEntity.ActivateComponents ( array< ref SCR_MapUIBaseComponent components)
protected

Activate UI components.

Parameters
modulesis an array of module typenames

◆ ActivateModules()

void SCR_MapEntity.ActivateModules ( array< ref SCR_MapModuleBase modules)
protected

Activate modules.

Parameters
modulesis an array of modules to activate

◆ ActivateOtherComponents()

void SCR_MapEntity.ActivateOtherComponents ( EMapOtherComponents  componentFlags)
protected

Activate other components.

Parameters
modulesis an array of component names

◆ AssignViewLayer()

void SCR_MapEntity.AssignViewLayer ( bool  isInit)
protected

Checks whether layer should change based on current zoom.

◆ CenterMap()

void SCR_MapEntity.CenterMap ( )

Center the map.

get current size of map(includes zoom level) in screen space

◆ Cleanup()

void SCR_MapEntity.Cleanup ( )
protected

Map close cleanup.

◆ ClearHover()

void SCR_MapEntity.ClearHover ( )

Clear hover state.

◆ ClearSelection()

void SCR_MapEntity.ClearSelection ( )

Clear selected items.

◆ CloseMap()

void SCR_MapEntity.CloseMap ( )

Close the map.

◆ DeactivateComponent()

void SCR_MapEntity.DeactivateComponent ( SCR_MapUIBaseComponent  component)

Deactivate UI component, removing it from loadable list until config is reloaded.

◆ DeactivateModule()

void SCR_MapEntity.DeactivateModule ( SCR_MapModuleBase  module)

Deactivate module, removing it from loadable list until config is reloaded.

◆ EOnFrame()

override void SCR_MapEntity.EOnFrame ( IEntity  owner,
float  timeSlice 
)

◆ EOnInit()

override void SCR_MapEntity.EOnInit ( IEntity  owner)

◆ FitPanBounds()

bool SCR_MapEntity.FitPanBounds ( inout float  panX,
inout float  panY,
bool  center 
)
protected

Adjust provided pan values by pan bounds conditions.

Parameters
panXis UNSCALED pan offset x in px
panYis UNSCALED pan offset y in px
Returns
false if pan had to be adjusted to fit the pan rules

◆ GetCurrentPan()

vector SCR_MapEntity.GetCurrentPan ( )

Get current DPIScaled pan offsets.

◆ GetCurrentZoom()

float SCR_MapEntity.GetCurrentZoom ( )

Get how much pixels per unit(meter) are currently visible on screen.

If this value is 1 and resolution is 1920x1080, then 1920 units(meters) of map will be visible

Returns
Current pixel per unit value

◆ GetGridLabel()

static string SCR_MapEntity.GetGridLabel ( vector  pos,
int  resMin = 2,
int  resMax = 4,
string  delimiter = " " 
)
static

Get grid coordinates for given position.

Parameters
posWorld position
resMinMinimum grid resolution as 10^x, e.g., 2 = 100, 3 = 1000, etc.
resMaxMaximum grid resolution as 10^x
delimiterString added between horizontal and vertical coordinate
Returns
Grid coordinates

◆ GetGridPos()

static void SCR_MapEntity.GetGridPos ( vector  pos,
out int  gridX,
out int  gridZ,
int  resMin = 2,
int  resMax = 4 
)
static

Get grid coordinates for given position.

Parameters
posWorld position
resMinMinimum grid resolution as 10^x, e.g., 2 = 100, 3 = 1000, etc.
resMaxMaximum grid resolution as 10^x
Returns
gridX, gridZ coordinates

◆ GetHoveredItem()

MapItem SCR_MapEntity.GetHoveredItem ( )

Get hovered item.

◆ GetMapCenterWorldPosition()

void SCR_MapEntity.GetMapCenterWorldPosition ( out float  worldX,
out float  worldY 
)

Get map center of screen world position.

Parameters
worldXis x coord
worldYis y coord

◆ GetMapConfig()

MapConfiguration SCR_MapEntity.GetMapConfig ( )

Get map config.

◆ GetMapCursorWorldPosition()

void SCR_MapEntity.GetMapCursorWorldPosition ( out float  worldX,
out float  worldY 
)

Get map cursor world position.

Parameters
worldXis x coord
worldYis y coord

◆ GetMapInstance()

static SCR_MapEntity SCR_MapEntity.GetMapInstance ( )
static

Get map entity instance.

◆ GetMapMenuRoot()

Widget SCR_MapEntity.GetMapMenuRoot ( )

Get map menu root widget.

◆ GetMapModule()

SCR_MapModuleBase SCR_MapEntity.GetMapModule ( TypeName  moduleType)

Get a specific map module.

Parameters
moduleTypeis a typename of the wanted module
Returns
Returns requested module or null if not found

◆ GetMapSizeX()

int SCR_MapEntity.GetMapSizeX ( )

Get map sizeX in meters.

◆ GetMapSizeY()

int SCR_MapEntity.GetMapSizeY ( )

Get map sizeY in meters.

◆ GetMapUIComponent()

SCR_MapUIBaseComponent SCR_MapEntity.GetMapUIComponent ( TypeName  componentType)

Get a specific map UI component.

Parameters
moduleTypeis a typename of the wanted UI component
Returns
Returns requested UI component or null if not found

◆ GetMapVisibleFrame()

void SCR_MapEntity.GetMapVisibleFrame ( out vector  min,
out vector  max 
)

Return visible frame in the form of min and max point, used to ignore update of f.e. icons when they are not visible.

◆ GetMapWidget()

CanvasWidget SCR_MapEntity.GetMapWidget ( )

Get map widget.

◆ GetMaxZoom()

float SCR_MapEntity.GetMaxZoom ( )

Get maximal zoom.

◆ GetMinZoom()

float SCR_MapEntity.GetMinZoom ( )

Get minimal zoom.

◆ GetOnHoverEnd()

static ScriptInvokerBase< MapItemInvoker > SCR_MapEntity.GetOnHoverEnd ( )
static

Get on hover end invoker.

◆ GetOnHoverItem()

static ScriptInvokerBase< MapItemInvoker > SCR_MapEntity.GetOnHoverItem ( )
static

Get on hover item invoker.

◆ GetOnLayerChanged()

static ScriptInvokerInt SCR_MapEntity.GetOnLayerChanged ( )
static

Get on layer changed invoker.

◆ GetOnMapClose()

static ScriptInvokerBase< MapConfigurationInvoker > SCR_MapEntity.GetOnMapClose ( )
static

Get on map close invoker.

◆ GetOnMapInit()

static ScriptInvokerBase< MapConfigurationInvoker > SCR_MapEntity.GetOnMapInit ( )
static

Get on map init invoker, caution: called during the first frame of opening the map when widget related stuff is not initialized yet.

◆ GetOnMapOpen()

static ScriptInvokerBase< MapConfigurationInvoker > SCR_MapEntity.GetOnMapOpen ( )
static

Get on map open invoker.

◆ GetOnMapPan()

static ScriptInvokerBase< ScriptInvokerFloat2Bool > SCR_MapEntity.GetOnMapPan ( )
static

Get on map pan invoker.

◆ GetOnMapPanEnd()

static ScriptInvokerFloat2 SCR_MapEntity.GetOnMapPanEnd ( )
static

Get on map pan interpolated end invoker.

◆ GetOnMapZoom()

static ScriptInvokerFloat SCR_MapEntity.GetOnMapZoom ( )
static

Get on map zoom invoker.

◆ GetOnMapZoomEnd()

static ScriptInvokerFloat SCR_MapEntity.GetOnMapZoomEnd ( )
static

Get on map zoom interpolated end invoker.

◆ GetOnSelection()

static ScriptInvokerVector SCR_MapEntity.GetOnSelection ( )
static

Get on selection invoker.

◆ GetOnSelectionChanged()

static ScriptInvokerBase< MapItemInvoker > SCR_MapEntity.GetOnSelectionChanged ( )
static

Get on selection changed invoker.

◆ GetTargetZoomPPU()

float SCR_MapEntity.GetTargetZoomPPU ( )

Get target zoom in the form of PixelPerUnit value, which is different from current zoom if interpolation is ongoing.

◆ HoverItem()

void SCR_MapEntity.HoverItem ( MapItem  item)

Set hover mode to target MapItem.

Parameters
MapItemis the target

◆ InitDescriptors()

void SCR_MapEntity.InitDescriptors ( int  layerID,
MapLayer  layer,
SCR_LayerConfiguration  layerConfig,
MapConfiguration  mapConfig 
)
protected

Init visibility and default config values for descriptors based on type.

Parameters
layerIDis id of the layer
layeris the map layer
layerConfigis the config for the layer

◆ InitLayers()

void SCR_MapEntity.InitLayers ( MapConfiguration  mapConfig)
protected

Initialize layers from config.

◆ InvokeOnSelect()

void SCR_MapEntity.InvokeOnSelect ( vector  selectionPos)

Triggers OnSelection event.

Parameters
selectionPosthe selection (click) position in scaled screen coordinates

◆ IsOpen()

bool SCR_MapEntity.IsOpen ( )

Check if the map is opened.

◆ IsZooming()

bool SCR_MapEntity.IsZooming ( )

Get whether zoom interpolation is ongoing.

◆ OnLifeStateChanged()

void SCR_MapEntity.OnLifeStateChanged ( ECharacterLifeState  previousLifeState,
ECharacterLifeState  newLifeState 
)
protected

SCR_CharacterControllerComponent event Called only in case of a fullscreen map.

◆ OnMapClose()

void SCR_MapEntity.OnMapClose ( )
protected

Map close event.

◆ OnMapOpen()

void SCR_MapEntity.OnMapOpen ( MapConfiguration  config)
protected

Map open event.

Parameters
configis the configuration object

◆ OnPlayerDeleted()

void SCR_MapEntity.OnPlayerDeleted ( int  playerId,
IEntity  player 
)
protected

SCR_BaseGameMode event Called only in case of a fullscreen map.

◆ OnUserSettingsChanged()

void SCR_MapEntity.OnUserSettingsChanged ( )
protected

Game event.

◆ OnWindowResized()

void SCR_MapEntity.OnWindowResized ( int  width,
int  heigth,
bool  windowed 
)
protected

Game event.

◆ OpenMap()

void SCR_MapEntity.OpenMap ( MapConfiguration  config)

Open the map.

Parameters
configis the configuration object

◆ Pan()

void SCR_MapEntity.Pan ( EMapPanMode  panMode,
float  panValue = 0 
)

Pan the map by px amount.

Parameters
panModeis mode of panning
panValueis amount of pixels to pan

◆ PanSmooth()

void SCR_MapEntity.PanSmooth ( float  panX,
float  panY,
float  panTime = 0::25 
)

Interpolated pan.

Parameters
panXis x target screen coordinate in DPIScaled px
panYis y target screen coordinate in DPIScaled px
panTimeis interpolation duration

◆ PanUpdate()

void SCR_MapEntity.PanUpdate ( float  timeSlice)
protected

Interpolated pan update.

Parameters
timeSliceis frame timeSlice

◆ ScreenToWorld()

void SCR_MapEntity.ScreenToWorld ( int  screenPosX,
int  screenPosY,
out float  worldX,
out float  worldY 
)

Use scaled screen coords to get canvas world coords, flips the y-axis.

◆ ScreenToWorldNoFlip()

void SCR_MapEntity.ScreenToWorldNoFlip ( int  screenPosX,
int  screenPosY,
out float  worldX,
out float  worldY 
)

Use scaled screen coords to get canvas world coords without flipping the y-axis.

◆ SelectItem()

void SCR_MapEntity.SelectItem ( MapItem  item)

Select target MapItem.

Parameters
MapItemis the target

◆ SetMapWidget()

void SCR_MapEntity.SetMapWidget ( Widget  mapW)

Set map widget.

◆ SetPan()

void SCR_MapEntity.SetPan ( float  x,
float  y,
bool  isPanEnd = true,
bool  center = true 
)

Pan the map to target position, all of scripted panning is called through this.

Parameters
xis horizontal screen UNSCALED coordinate
yis vertical screen UNSCALED coordinate
centerdetermines whether the map should center to the supplied coordinates
IsPanEnddetermines whether this is also the end of panning operation, resetting the start pos for drag pannning

◆ SetupDescriptorTypes()

void SCR_MapEntity.SetupDescriptorTypes ( SCR_MapDescriptorDefaults  descriptorDefaultsConfig)
protected

Map properties config setup, matches imageset indices defined in map layout (MapWidget) to descriptor types.

Parameters
configObjectis a config object created for map init
mapCfgis the provided map config

◆ SetupLayersAndProps()

void SCR_MapEntity.SetupLayersAndProps ( inout MapConfiguration  configObject,
SCR_MapConfig  mapCfg 
)
protected

Layer and map properties config setup, if missing creates a default one.

Parameters
configObjectis a config object created for map init
mapCfgis the provided map config

◆ SetupMapConfig()

MapConfiguration SCR_MapEntity.SetupMapConfig ( EMapEntityMode  mapMode,
ResourceName  configPath,
Widget  rootWidget 
)

Prepare MapConfiguration object from provided map config.

Parameters
mapModeis the last map mode opened, if its the same we do not need to setup new config
configPathis the path to the map config resource
rootWidgetis the root widget of the layout used to display map

◆ SetZoom()

void SCR_MapEntity.SetZoom ( float  targetPPU,
bool  instant = false 
)

Set zoom value.

Parameters
targetPPUis wanted pixel per unit (zoom) value
instantdetermines whether it is a one time zoom or an animation

◆ ShowScriptDebug()

void SCR_MapEntity.ShowScriptDebug ( )

Show/hide debug info table.

◆ UpdateDebug()

void SCR_MapEntity.UpdateDebug ( )
protected

Update map debug table.

◆ UpdateMap()

void SCR_MapEntity.UpdateMap ( float  timeSlice)
protected

Handle update of modules, components and pan/zoom interpolation.

Parameters
timeSliceis frame timeSlice

◆ UpdateViewPort()

void SCR_MapEntity.UpdateViewPort ( )

Updates view port.

◆ UpdateZoomBounds()

bool SCR_MapEntity.UpdateZoomBounds ( )

Calculate zoom min/max.

Returns
true if successful

◆ WorldToScreen()

void SCR_MapEntity.WorldToScreen ( float  worldX,
float  worldY,
out int  screenPosX,
out int  screenPosY,
bool  withPan = false 
)

Use canvas world coords to get DPIscaled screen coords, flips the y-axis.

◆ WorldToScreenCustom()

void SCR_MapEntity.WorldToScreenCustom ( float  worldX,
float  worldY,
out int  screenPosX,
out int  screenPosY,
float  targetPPU,
bool  withPan = false 
)

Use canvas world coords and defined pixel per unit to get DPIscaled screen coords, flips the y-axis.

◆ ZoomOut()

void SCR_MapEntity.ZoomOut ( )

Set minimal zoom and center the map.

◆ ZoomPanSmooth()

void SCR_MapEntity.ZoomPanSmooth ( float  targetPixPerUnit,
float  worldX,
float  worldY,
float  zoomTime = 0::25 
)

Interpolated zoom with custom pan target for simultaneous use of zoom+pan.

Parameters
targetPixPerUnitis the target pixel per unit value
worldXis world pos X panning target
worldYis world pos Y panning target
zoomTimeis interpolation duration

◆ ZoomSmooth()

void SCR_MapEntity.ZoomSmooth ( float  targetPixPerUnit,
float  zoomTime = 0::25,
bool  zoomToCenter = true,
bool  reinitZoom = false 
)

Interpolated zoom.

Parameters
targetPixPerUnitis the target pixel per unit value
zoomTimeis interpolation duration
zoomToCenterdetermines whether zoom target is screen center (true) or relative position of mouse within window (false)
reinitZoomdetermines whether the condition blocking zooming to the same PPU value is ignored (f.e. when changing resolution)

◆ ZoomUpdate()

void SCR_MapEntity.ZoomUpdate ( float  timeSlice)
protected

Interpolated zoom update.

Parameters
timeSliceis frame timeSlice

Member Data Documentation

◆ FRAME_DELAY

const int SCR_MapEntity.FRAME_DELAY = 1
static

◆ m_aActiveComponents

ref array<ref SCR_MapUIBaseComponent> SCR_MapEntity.m_aActiveComponents = {}
protected

◆ m_aActiveModules

ref array<ref SCR_MapModuleBase> SCR_MapEntity.m_aActiveModules = {}
protected

◆ m_ActiveMapCfg

ref MapConfiguration SCR_MapEntity.m_ActiveMapCfg
protected

◆ m_aLoadedComponents

ref array<ref SCR_MapUIBaseComponent> SCR_MapEntity.m_aLoadedComponents = {}
protected

◆ m_aLoadedModules

ref array<ref SCR_MapModuleBase> SCR_MapEntity.m_aLoadedModules = {}
protected

◆ m_aStartPan

int SCR_MapEntity.m_aStartPan[2]
protected

◆ m_aTargetPan

int SCR_MapEntity.m_aTargetPan[2]
protected

◆ m_bDoReload

bool SCR_MapEntity.m_bDoReload
protected

◆ m_bDoUpdate

bool SCR_MapEntity.m_bDoUpdate
protected

◆ m_bIsDebugMode

bool SCR_MapEntity.m_bIsDebugMode
protected

◆ m_bIsOpen

bool SCR_MapEntity.m_bIsOpen
protected

◆ m_bIsPanInterp

bool SCR_MapEntity.m_bIsPanInterp
protected

◆ m_bIsZoomInterp

bool SCR_MapEntity.m_bIsZoomInterp
protected

◆ m_eLastMapMode

EMapEntityMode SCR_MapEntity.m_eLastMapMode
protected

◆ m_fMaxZoom

float SCR_MapEntity.m_fMaxZoom
protected

◆ m_fMinZoom

float SCR_MapEntity.m_fMinZoom = 1
protected

◆ m_fPanSlice

float SCR_MapEntity.m_fPanSlice
protected

◆ m_fPanTimeModif

float SCR_MapEntity.m_fPanTimeModif
protected

◆ m_fStartPPU

float SCR_MapEntity.m_fStartPPU
protected

◆ m_fTargetPPU

float SCR_MapEntity.m_fTargetPPU = 1
protected

◆ m_fZoomPPU

float SCR_MapEntity.m_fZoomPPU = 1
protected

◆ m_fZoomSlice

float SCR_MapEntity.m_fZoomSlice
protected

◆ m_fZoomTimeModif

float SCR_MapEntity.m_fZoomTimeModif
protected

◆ m_HoveredMapItem

MapItem SCR_MapEntity.m_HoveredMapItem
protected

◆ m_iDelayCounter

int SCR_MapEntity.m_iDelayCounter = FRAME_DELAY
protected

◆ m_iMapOffsetX

int SCR_MapEntity.m_iMapOffsetX
protected

◆ m_iMapOffsetY

int SCR_MapEntity.m_iMapOffsetY
protected

◆ m_iMapSizeX

int SCR_MapEntity.m_iMapSizeX
protected

◆ m_iMapSizeY

int SCR_MapEntity.m_iMapSizeY
protected

◆ m_iPanX

int SCR_MapEntity.m_iPanX = 0
protected

◆ m_iPanY

int SCR_MapEntity.m_iPanY = 0
protected

◆ m_MapWidget

CanvasWidget SCR_MapEntity.m_MapWidget
protected

◆ m_vVisibleFrameMax

vector SCR_MapEntity.m_vVisibleFrameMax
protected

◆ m_vVisibleFrameMin

vector SCR_MapEntity.m_vVisibleFrameMin
protected

◆ m_wMapRoot

Widget SCR_MapEntity.m_wMapRoot
protected

◆ m_Workspace

WorkspaceWidget SCR_MapEntity.m_Workspace
protected

◆ s_MapInstance

SCR_MapEntity SCR_MapEntity.s_MapInstance
staticprotected

◆ s_OnHoverEnd

ref ScriptInvokerBase<MapItemInvoker> SCR_MapEntity.s_OnHoverEnd = new ScriptInvokerBase<MapItemInvoker>()
staticprotected

◆ s_OnHoverItem

ref ScriptInvokerBase<MapItemInvoker> SCR_MapEntity.s_OnHoverItem = new ScriptInvokerBase<MapItemInvoker>()
staticprotected

◆ s_OnLayerChanged

ref ScriptInvokerInt SCR_MapEntity.s_OnLayerChanged = new ScriptInvokerInt()
staticprotected

◆ s_OnMapClose

ref ScriptInvokerBase<MapConfigurationInvoker> SCR_MapEntity.s_OnMapClose = new ScriptInvokerBase<MapConfigurationInvoker>()
staticprotected

◆ s_OnMapInit

ref ScriptInvokerBase<MapConfigurationInvoker> SCR_MapEntity.s_OnMapInit = new ScriptInvokerBase<MapConfigurationInvoker>()
staticprotected

◆ s_OnMapOpen

ref ScriptInvokerBase<MapConfigurationInvoker> SCR_MapEntity.s_OnMapOpen = new ScriptInvokerBase<MapConfigurationInvoker>()
staticprotected

◆ s_OnMapPan

ref ScriptInvokerBase<ScriptInvokerFloat2Bool> SCR_MapEntity.s_OnMapPan = new ScriptInvokerBase<ScriptInvokerFloat2Bool>
staticprotected

◆ s_OnMapPanEnd

ref ScriptInvokerFloat2 SCR_MapEntity.s_OnMapPanEnd = new ScriptInvokerFloat2()
staticprotected

◆ s_OnMapZoom

ref ScriptInvokerFloat SCR_MapEntity.s_OnMapZoom = new ScriptInvokerFloat()
staticprotected

◆ s_OnMapZoomEnd

ref ScriptInvokerFloat SCR_MapEntity.s_OnMapZoomEnd = new ScriptInvokerFloat()
staticprotected

◆ s_OnSelection

ref ScriptInvokerVector SCR_MapEntity.s_OnSelection = new ScriptInvokerVector()
staticprotected

◆ s_OnSelectionChanged

ref ScriptInvokerBase<MapItemInvoker> SCR_MapEntity.s_OnSelectionChanged = new ScriptInvokerBase<MapItemInvoker>()
staticprotected

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