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

Protected 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 ()
void GetMapCursorWorldPosition (out float worldX, out float worldY)
void GetMapCenterWorldPosition (out float worldX, out float worldY)
SCR_MapModuleBase GetMapModule (typename moduleType)
SCR_MapUIBaseComponent GetMapUIComponent (typename componentType)
void OpenMap (MapConfiguration config)
void CloseMap ()
 Close the map.
void OnMapOpen (MapConfiguration config)
void OnMapClose ()
 Map close event.
void OnLifeStateChanged (ECharacterLifeState previousLifeState, ECharacterLifeState newLifeState)
void OnPlayerDeleted (int playerId, IEntity player)
void OnUserSettingsChanged ()
 Game event.
void OnWindowResized (int width, int height, bool windowed)
 Game event.
MapConfiguration SetupMapConfig (EMapEntityMode mapMode, ResourceName configPath, Widget rootWidget)
void SetupLayersAndProps (inout MapConfiguration configObject, SCR_MapConfig mapCfg)
void SetupDescriptorTypes (SCR_MapDescriptorDefaults descriptorDefaultsConfig)
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)
void ZoomSmooth (float targetPixPerUnit, float zoomTime=0.25, bool zoomToCenter=true, bool reinitZoom=false)
void ZoomPanSmooth (float targetPixPerUnit, float worldX, float worldY, float zoomTime=0.25)
void SetPan (float x, float y, bool isPanEnd=true, bool center=true, bool updatingPan=false)
void Pan (EMapPanMode panMode, float panValue=0)
void PanSmooth (float panX, float panY, float panTime=0.25)
void InvokeOnSelect (vector selectionPos)
void SelectItem (MapItem item)
void HoverItem (MapItem item)
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 FitPanBounds (inout float panX, inout float panY, bool center)
bool UpdateZoomBounds ()
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)
void ActivateModules (array< ref SCR_MapModuleBase > modules)
void ActivateComponents (array< ref SCR_MapUIBaseComponent > components)
void ActivateOtherComponents (EMapOtherComponents componentFlags)
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 Cleanup ()
 Map close cleanup.
void UpdateViewPort ()
 Updates view port.
void PanUpdate (float timeSlice)
void ZoomUpdate (float timeSlice)
void UpdateDebug ()
 Update map debug table.
void UpdateMap (float timeSlice)
override void EOnFrame (IEntity owner, float timeSlice)
override void EOnInit (IEntity owner)
void SCR_MapEntity (IEntitySource src, IEntity parent)
void ~SCR_MapEntity ()

Static Protected Member Functions

static ScriptInvokerBase< MapConfigurationInvokerGetOnMapInit ()
 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< MapConfigurationInvokerGetOnMapOpen ()
 Get on map open invoker.
static ScriptInvokerBase< MapConfigurationInvokerGetOnMapOpenComplete ()
 Get on map open complete invoker.
static ScriptInvokerBase< MapConfigurationInvokerGetOnMapClose ()
 Get on map close invoker.
static ScriptInvokerBase< ScriptInvokerFloat2BoolGetOnMapPan ()
 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< MapItemInvokerGetOnSelectionChanged ()
 Get on selection changed invoker.
static ScriptInvokerVector GetOnSelection ()
 Get on selection invoker.
static ScriptInvokerBase< MapItemInvokerGetOnHoverItem ()
 Get on hover item invoker.
static ScriptInvokerBase< MapItemInvokerGetOnHoverEnd ()
 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=" ")
static void GetGridPos (vector pos, out int gridX, out int gridZ, int resMin=2, int resMax=4)

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< MapConfigurationInvokers_OnMapInit = new ScriptInvokerBase<MapConfigurationInvoker>()
static ref ScriptInvokerBase< MapConfigurationInvokers_OnMapOpen = new ScriptInvokerBase<MapConfigurationInvoker>()
static ref ScriptInvokerBase< MapConfigurationInvokers_OnMapOpenComplete = new ScriptInvokerBase<MapConfigurationInvoker>()
static ref ScriptInvokerBase< MapConfigurationInvokers_OnMapClose = new ScriptInvokerBase<MapConfigurationInvoker>()
static ref ScriptInvokerBase< ScriptInvokerFloat2Bools_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< MapItemInvokers_OnSelectionChanged = new ScriptInvokerBase<MapItemInvoker>()
static ref ScriptInvokerBase< MapItemInvokers_OnHoverItem = new ScriptInvokerBase<MapItemInvoker>()
static ref ScriptInvokerBase< MapItemInvokers_OnHoverEnd = new ScriptInvokerBase<MapItemInvoker>()

Detailed Description

Definition at line 17 of file SCR_MapEntity.c.

Constructor & Destructor Documentation

◆ SCR_MapEntity()

void SCR_MapEntity::SCR_MapEntity ( IEntitySource src,
IEntity parent )
inlineprotected

Definition at line 1546 of file SCR_MapEntity.c.

◆ ~SCR_MapEntity()

void SCR_MapEntity::~SCR_MapEntity ( )
inlineprotected

Definition at line 1559 of file SCR_MapEntity.c.

Member Function Documentation

◆ ActivateComponents()

void SCR_MapEntity::ActivateComponents ( array< ref SCR_MapUIBaseComponent > components)
inlineprotected

Activate UI components

Parameters
modulesis an array of module typenames

Definition at line 1272 of file SCR_MapEntity.c.

◆ ActivateModules()

void SCR_MapEntity::ActivateModules ( array< ref SCR_MapModuleBase > modules)
inlineprotected

Activate modules

Parameters
modulesis an array of modules to activate

Definition at line 1223 of file SCR_MapEntity.c.

◆ ActivateOtherComponents()

void SCR_MapEntity::ActivateOtherComponents ( EMapOtherComponents componentFlags)
inlineprotected

Activate other components

Parameters
modulesis an array of component names

Definition at line 1322 of file SCR_MapEntity.c.

◆ AssignViewLayer()

void SCR_MapEntity::AssignViewLayer ( bool isInit)
inlineprotected

Checks whether layer should change based on current zoom.

Definition at line 1092 of file SCR_MapEntity.c.

◆ CenterMap()

void SCR_MapEntity::CenterMap ( )
inlineprotected

Center the map.

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

Definition at line 585 of file SCR_MapEntity.c.

◆ Cleanup()

void SCR_MapEntity::Cleanup ( )
inlineprotected

Map close cleanup.

Definition at line 1354 of file SCR_MapEntity.c.

◆ ClearHover()

void SCR_MapEntity::ClearHover ( )
inlineprotected

Clear hover state.

Definition at line 882 of file SCR_MapEntity.c.

◆ ClearSelection()

void SCR_MapEntity::ClearSelection ( )
inlineprotected

Clear selected items.

Definition at line 872 of file SCR_MapEntity.c.

◆ CloseMap()

void SCR_MapEntity::CloseMap ( )
inlineprotected

Close the map.

Definition at line 324 of file SCR_MapEntity.c.

◆ DeactivateComponent()

void SCR_MapEntity::DeactivateComponent ( SCR_MapUIBaseComponent component)
inlineprotected

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

Definition at line 1346 of file SCR_MapEntity.c.

◆ DeactivateModule()

void SCR_MapEntity::DeactivateModule ( SCR_MapModuleBase module)
inlineprotected

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

Definition at line 1338 of file SCR_MapEntity.c.

◆ EOnFrame()

override void SCR_MapEntity::EOnFrame ( IEntity owner,
float timeSlice )
inlineprotected

Definition at line 1495 of file SCR_MapEntity.c.

◆ EOnInit()

override void SCR_MapEntity::EOnInit ( IEntity owner)
inlineprotected

Definition at line 1524 of file SCR_MapEntity.c.

◆ FitPanBounds()

bool SCR_MapEntity::FitPanBounds ( inout float panX,
inout float panY,
bool center )
inlineprotected

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

Definition at line 1012 of file SCR_MapEntity.c.

◆ GetCurrentPan()

vector SCR_MapEntity::GetCurrentPan ( )
inlineprotected

Get current DPIScaled pan offsets.

Definition at line 172 of file SCR_MapEntity.c.

◆ GetCurrentZoom()

float SCR_MapEntity::GetCurrentZoom ( )
inlineprotected

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

Definition at line 216 of file SCR_MapEntity.c.

◆ GetGridLabel()

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

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

Definition at line 973 of file SCR_MapEntity.c.

◆ GetGridPos()

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

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

Definition at line 987 of file SCR_MapEntity.c.

◆ GetHoveredItem()

MapItem SCR_MapEntity::GetHoveredItem ( )
inlineprotected

Get hovered item.

Definition at line 200 of file SCR_MapEntity.c.

◆ GetMapCenterWorldPosition()

void SCR_MapEntity::GetMapCenterWorldPosition ( out float worldX,
out float worldY )
inlineprotected

Get map center of screen world position

Parameters
worldXis x coord
worldYis y coord

Definition at line 234 of file SCR_MapEntity.c.

◆ GetMapConfig()

MapConfiguration SCR_MapEntity::GetMapConfig ( )
inlineprotected

Get map config.

Definition at line 116 of file SCR_MapEntity.c.

◆ GetMapCursorWorldPosition()

void SCR_MapEntity::GetMapCursorWorldPosition ( out float worldX,
out float worldY )
inlineprotected

Get map cursor world position

Parameters
worldXis x coord
worldYis y coord

Definition at line 225 of file SCR_MapEntity.c.

◆ GetMapInstance()

SCR_MapEntity SCR_MapEntity::GetMapInstance ( )
inlinestaticprotected

Get map entity instance.

Definition at line 112 of file SCR_MapEntity.c.

◆ GetMapMenuRoot()

Widget SCR_MapEntity::GetMapMenuRoot ( )
inlineprotected

Get map menu root widget.

Definition at line 186 of file SCR_MapEntity.c.

◆ GetMapModule()

SCR_MapModuleBase SCR_MapEntity::GetMapModule ( typename moduleType )
inlineprotected

Get a specific map module

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

Definition at line 246 of file SCR_MapEntity.c.

◆ GetMapSizeX()

int SCR_MapEntity::GetMapSizeX ( )
inlineprotected

Get map sizeX in meters.

Definition at line 130 of file SCR_MapEntity.c.

◆ GetMapSizeY()

int SCR_MapEntity::GetMapSizeY ( )
inlineprotected

Get map sizeY in meters.

Definition at line 137 of file SCR_MapEntity.c.

◆ GetMapUIComponent()

SCR_MapUIBaseComponent SCR_MapEntity::GetMapUIComponent ( typename componentType )
inlineprotected

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

Definition at line 261 of file SCR_MapEntity.c.

◆ GetMapVisibleFrame()

void SCR_MapEntity::GetMapVisibleFrame ( out vector min,
out vector max )
inlineprotected

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

Definition at line 207 of file SCR_MapEntity.c.

◆ GetMapWidget()

CanvasWidget SCR_MapEntity::GetMapWidget ( )
inlineprotected

Get map widget.

Definition at line 179 of file SCR_MapEntity.c.

◆ GetMaxZoom()

float SCR_MapEntity::GetMaxZoom ( )
inlineprotected

Get maximal zoom.

Definition at line 144 of file SCR_MapEntity.c.

◆ GetMinZoom()

float SCR_MapEntity::GetMinZoom ( )
inlineprotected

Get minimal zoom.

Definition at line 151 of file SCR_MapEntity.c.

◆ GetOnHoverEnd()

ScriptInvokerBase< MapItemInvoker > SCR_MapEntity::GetOnHoverEnd ( )
inlinestaticprotected

Get on hover end invoker.

Definition at line 108 of file SCR_MapEntity.c.

◆ GetOnHoverItem()

ScriptInvokerBase< MapItemInvoker > SCR_MapEntity::GetOnHoverItem ( )
inlinestaticprotected

Get on hover item invoker.

Definition at line 106 of file SCR_MapEntity.c.

◆ GetOnLayerChanged()

ScriptInvokerInt SCR_MapEntity::GetOnLayerChanged ( )
inlinestaticprotected

Get on layer changed invoker.

Definition at line 110 of file SCR_MapEntity.c.

◆ GetOnMapClose()

ScriptInvokerBase< MapConfigurationInvoker > SCR_MapEntity::GetOnMapClose ( )
inlinestaticprotected

Get on map close invoker.

Definition at line 92 of file SCR_MapEntity.c.

◆ GetOnMapInit()

ScriptInvokerBase< MapConfigurationInvoker > SCR_MapEntity::GetOnMapInit ( )
inlinestaticprotected

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

Definition at line 86 of file SCR_MapEntity.c.

◆ GetOnMapOpen()

ScriptInvokerBase< MapConfigurationInvoker > SCR_MapEntity::GetOnMapOpen ( )
inlinestaticprotected

Get on map open invoker.

Definition at line 88 of file SCR_MapEntity.c.

◆ GetOnMapOpenComplete()

ScriptInvokerBase< MapConfigurationInvoker > SCR_MapEntity::GetOnMapOpenComplete ( )
inlinestaticprotected

Get on map open complete invoker.

Definition at line 90 of file SCR_MapEntity.c.

◆ GetOnMapPan()

ScriptInvokerBase< ScriptInvokerFloat2Bool > SCR_MapEntity::GetOnMapPan ( )
inlinestaticprotected

Get on map pan invoker.

Definition at line 94 of file SCR_MapEntity.c.

◆ GetOnMapPanEnd()

ScriptInvokerFloat2 SCR_MapEntity::GetOnMapPanEnd ( )
inlinestaticprotected

Get on map pan interpolated end invoker.

Definition at line 96 of file SCR_MapEntity.c.

◆ GetOnMapZoom()

ScriptInvokerFloat SCR_MapEntity::GetOnMapZoom ( )
inlinestaticprotected

Get on map zoom invoker.

Definition at line 98 of file SCR_MapEntity.c.

◆ GetOnMapZoomEnd()

ScriptInvokerFloat SCR_MapEntity::GetOnMapZoomEnd ( )
inlinestaticprotected

Get on map zoom interpolated end invoker.

Definition at line 100 of file SCR_MapEntity.c.

◆ GetOnSelection()

ScriptInvokerVector SCR_MapEntity::GetOnSelection ( )
inlinestaticprotected

Get on selection invoker.

Definition at line 104 of file SCR_MapEntity.c.

◆ GetOnSelectionChanged()

ScriptInvokerBase< MapItemInvoker > SCR_MapEntity::GetOnSelectionChanged ( )
inlinestaticprotected

Get on selection changed invoker.

Definition at line 102 of file SCR_MapEntity.c.

◆ GetTargetZoomPPU()

float SCR_MapEntity::GetTargetZoomPPU ( )
inlineprotected

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

Definition at line 158 of file SCR_MapEntity.c.

◆ HoverItem()

void SCR_MapEntity::HoverItem ( MapItem item)
inlineprotected

Set hover mode to target MapItem

Parameters
MapItemis the target

Definition at line 862 of file SCR_MapEntity.c.

◆ InitDescriptors()

void SCR_MapEntity::InitDescriptors ( int layerID,
MapLayer layer,
SCR_LayerConfiguration layerConfig,
MapConfiguration mapConfig )
inlineprotected

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

Definition at line 1152 of file SCR_MapEntity.c.

◆ InitLayers()

void SCR_MapEntity::InitLayers ( MapConfiguration mapConfig)
inlineprotected

Initialize layers from config.

Definition at line 1117 of file SCR_MapEntity.c.

◆ InvokeOnSelect()

void SCR_MapEntity::InvokeOnSelect ( vector selectionPos)
inlineprotected

Triggers OnSelection event

Parameters
selectionPosthe selection (click) position in scaled screen coordinates

Definition at line 844 of file SCR_MapEntity.c.

◆ IsOpen()

bool SCR_MapEntity::IsOpen ( )
inlineprotected

Check if the map is opened.

Definition at line 123 of file SCR_MapEntity.c.

◆ IsZooming()

bool SCR_MapEntity::IsZooming ( )
inlineprotected

Get whether zoom interpolation is ongoing.

Definition at line 165 of file SCR_MapEntity.c.

◆ OnLifeStateChanged()

void SCR_MapEntity::OnLifeStateChanged ( ECharacterLifeState previousLifeState,
ECharacterLifeState newLifeState )
inlineprotected

SCR_CharacterControllerComponent event Called only in case of a fullscreen map

Definition at line 409 of file SCR_MapEntity.c.

◆ OnMapClose()

void SCR_MapEntity::OnMapClose ( )
inlineprotected

Map close event.

Definition at line 376 of file SCR_MapEntity.c.

◆ OnMapOpen()

void SCR_MapEntity::OnMapOpen ( MapConfiguration config)
inlineprotected

Map open event

Parameters
configis the configuration object

Definition at line 341 of file SCR_MapEntity.c.

◆ OnPlayerDeleted()

void SCR_MapEntity::OnPlayerDeleted ( int playerId,
IEntity player )
inlineprotected

SCR_BaseGameMode event Called only in case of a fullscreen map

Definition at line 429 of file SCR_MapEntity.c.

◆ OnUserSettingsChanged()

void SCR_MapEntity::OnUserSettingsChanged ( )
inlineprotected

Game event.

Definition at line 440 of file SCR_MapEntity.c.

◆ OnWindowResized()

void SCR_MapEntity::OnWindowResized ( int width,
int height,
bool windowed )
inlineprotected

Game event.

Definition at line 457 of file SCR_MapEntity.c.

◆ OpenMap()

void SCR_MapEntity::OpenMap ( MapConfiguration config)
inlineprotected

Open the map

Parameters
configis the configuration object

Definition at line 277 of file SCR_MapEntity.c.

◆ Pan()

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

Pan the map by px amount

Parameters
panModeis mode of panning
panValueis amount of pixels to pan

Definition at line 771 of file SCR_MapEntity.c.

◆ PanSmooth()

void SCR_MapEntity::PanSmooth ( float panX,
float panY,
float panTime = 0.25 )
inlineprotected

Interpolated pan

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

Definition at line 819 of file SCR_MapEntity.c.

◆ PanUpdate()

void SCR_MapEntity::PanUpdate ( float timeSlice)
inlineprotected

Interpolated pan update

Parameters
timeSliceis frame timeSlice

Definition at line 1395 of file SCR_MapEntity.c.

◆ ScreenToWorld()

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

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

Definition at line 945 of file SCR_MapEntity.c.

◆ ScreenToWorldNoFlip()

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

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

Definition at line 958 of file SCR_MapEntity.c.

◆ SelectItem()

void SCR_MapEntity::SelectItem ( MapItem item)
inlineprotected

Select target MapItem

Parameters
MapItemis the target

Definition at line 851 of file SCR_MapEntity.c.

◆ SetMapWidget()

void SCR_MapEntity::SetMapWidget ( Widget mapW)
inlineprotected

Set map widget.

Definition at line 193 of file SCR_MapEntity.c.

◆ SetPan()

void SCR_MapEntity::SetPan ( float x,
float y,
bool isPanEnd = true,
bool center = true,
bool updatingPan = false )
inlineprotected

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

Definition at line 729 of file SCR_MapEntity.c.

◆ SetupDescriptorTypes()

void SCR_MapEntity::SetupDescriptorTypes ( SCR_MapDescriptorDefaults descriptorDefaultsConfig)
inlineprotected

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

Definition at line 561 of file SCR_MapEntity.c.

◆ SetupLayersAndProps()

void SCR_MapEntity::SetupLayersAndProps ( inout MapConfiguration configObject,
SCR_MapConfig mapCfg )
inlineprotected

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

Definition at line 513 of file SCR_MapEntity.c.

◆ SetupMapConfig()

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

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

Definition at line 469 of file SCR_MapEntity.c.

◆ SetZoom()

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

Set zoom value

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

Definition at line 619 of file SCR_MapEntity.c.

◆ ShowScriptDebug()

void SCR_MapEntity::ShowScriptDebug ( )
inlineprotected

Show/hide debug info table.

Definition at line 610 of file SCR_MapEntity.c.

◆ UpdateDebug()

void SCR_MapEntity::UpdateDebug ( )
inlineprotected

Update map debug table.

Definition at line 1437 of file SCR_MapEntity.c.

◆ UpdateMap()

void SCR_MapEntity::UpdateMap ( float timeSlice)
inlineprotected

Handle update of modules, components and pan/zoom interpolation

Parameters
timeSliceis frame timeSlice

Definition at line 1471 of file SCR_MapEntity.c.

◆ UpdateViewPort()

void SCR_MapEntity::UpdateViewPort ( )
inlineprotected

Updates view port.

Definition at line 1377 of file SCR_MapEntity.c.

◆ UpdateZoomBounds()

bool SCR_MapEntity::UpdateZoomBounds ( )
inlineprotected

Calculate zoom min/max

Returns
true if successful

Definition at line 1078 of file SCR_MapEntity.c.

◆ WorldToScreen()

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

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

Definition at line 899 of file SCR_MapEntity.c.

◆ WorldToScreenCustom()

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

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

Definition at line 923 of file SCR_MapEntity.c.

◆ ZoomOut()

void SCR_MapEntity::ZoomOut ( )
inlineprotected

Set minimal zoom and center the map.

Definition at line 602 of file SCR_MapEntity.c.

◆ ZoomPanSmooth()

void SCR_MapEntity::ZoomPanSmooth ( float targetPixPerUnit,
float worldX,
float worldY,
float zoomTime = 0.25 )
inlineprotected

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

Definition at line 694 of file SCR_MapEntity.c.

◆ ZoomSmooth()

void SCR_MapEntity::ZoomSmooth ( float targetPixPerUnit,
float zoomTime = 0.25,
bool zoomToCenter = true,
bool reinitZoom = false )
inlineprotected

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)

Definition at line 645 of file SCR_MapEntity.c.

◆ ZoomUpdate()

void SCR_MapEntity::ZoomUpdate ( float timeSlice)
inlineprotected

Interpolated zoom update

Parameters
timeSliceis frame timeSlice

Definition at line 1417 of file SCR_MapEntity.c.

Member Data Documentation

◆ m_aActiveComponents

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

Definition at line 64 of file SCR_MapEntity.c.

◆ m_aActiveModules

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

Definition at line 62 of file SCR_MapEntity.c.

◆ m_ActiveMapCfg

ref MapConfiguration SCR_MapEntity::m_ActiveMapCfg
protected

Definition at line 37 of file SCR_MapEntity.c.

◆ m_aLoadedComponents

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

Definition at line 65 of file SCR_MapEntity.c.

◆ m_aLoadedModules

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

Definition at line 63 of file SCR_MapEntity.c.

◆ m_aStartPan

int SCR_MapEntity::m_aStartPan[2]
protected

Definition at line 56 of file SCR_MapEntity.c.

◆ m_aTargetPan

int SCR_MapEntity::m_aTargetPan[2]
protected

Definition at line 57 of file SCR_MapEntity.c.

◆ m_bDoReload

bool SCR_MapEntity::m_bDoReload
protected

Definition at line 24 of file SCR_MapEntity.c.

◆ m_bDoUpdate

bool SCR_MapEntity::m_bDoUpdate
protected

Definition at line 25 of file SCR_MapEntity.c.

◆ m_bIsDebugMode

bool SCR_MapEntity::m_bIsDebugMode
protected

Definition at line 26 of file SCR_MapEntity.c.

◆ m_bIsOpen

bool SCR_MapEntity::m_bIsOpen
protected

Definition at line 23 of file SCR_MapEntity.c.

◆ m_bIsPanInterp

bool SCR_MapEntity::m_bIsPanInterp
protected

Definition at line 53 of file SCR_MapEntity.c.

◆ m_bIsZoomInterp

bool SCR_MapEntity::m_bIsZoomInterp
protected

Definition at line 43 of file SCR_MapEntity.c.

◆ m_eLastMapMode

EMapEntityMode SCR_MapEntity::m_eLastMapMode
protected

Definition at line 33 of file SCR_MapEntity.c.

◆ m_fMaxZoom

float SCR_MapEntity::m_fMaxZoom
protected

Definition at line 50 of file SCR_MapEntity.c.

◆ m_fMinZoom

float SCR_MapEntity::m_fMinZoom = 1
protected

Definition at line 49 of file SCR_MapEntity.c.

◆ m_fPanSlice

float SCR_MapEntity::m_fPanSlice
protected

Definition at line 59 of file SCR_MapEntity.c.

◆ m_fPanTimeModif

float SCR_MapEntity::m_fPanTimeModif
protected

Definition at line 58 of file SCR_MapEntity.c.

◆ m_fStartPPU

float SCR_MapEntity::m_fStartPPU
protected

Definition at line 45 of file SCR_MapEntity.c.

◆ m_fTargetPPU

float SCR_MapEntity::m_fTargetPPU = 1
protected

Definition at line 46 of file SCR_MapEntity.c.

◆ m_fZoomPPU

float SCR_MapEntity::m_fZoomPPU = 1
protected

Definition at line 44 of file SCR_MapEntity.c.

◆ m_fZoomSlice

float SCR_MapEntity::m_fZoomSlice
protected

Definition at line 48 of file SCR_MapEntity.c.

◆ m_fZoomTimeModif

float SCR_MapEntity::m_fZoomTimeModif
protected

Definition at line 47 of file SCR_MapEntity.c.

◆ m_HoveredMapItem

MapItem SCR_MapEntity::m_HoveredMapItem
protected

Definition at line 40 of file SCR_MapEntity.c.

◆ m_iDelayCounter

int SCR_MapEntity::m_iDelayCounter = FRAME_DELAY
protected

Definition at line 20 of file SCR_MapEntity.c.

◆ m_iMapOffsetX

int SCR_MapEntity::m_iMapOffsetX
protected

Definition at line 29 of file SCR_MapEntity.c.

◆ m_iMapOffsetY

int SCR_MapEntity::m_iMapOffsetY
protected

Definition at line 30 of file SCR_MapEntity.c.

◆ m_iMapSizeX

int SCR_MapEntity::m_iMapSizeX
protected

Definition at line 27 of file SCR_MapEntity.c.

◆ m_iMapSizeY

int SCR_MapEntity::m_iMapSizeY
protected

Definition at line 28 of file SCR_MapEntity.c.

◆ m_iPanX

int SCR_MapEntity::m_iPanX = 0
protected

Definition at line 54 of file SCR_MapEntity.c.

◆ m_iPanY

int SCR_MapEntity::m_iPanY = 0
protected

Definition at line 55 of file SCR_MapEntity.c.

◆ m_MapWidget

CanvasWidget SCR_MapEntity::m_MapWidget
protected

Definition at line 35 of file SCR_MapEntity.c.

◆ m_vVisibleFrameMax

vector SCR_MapEntity::m_vVisibleFrameMax
protected

Definition at line 32 of file SCR_MapEntity.c.

◆ m_vVisibleFrameMin

vector SCR_MapEntity::m_vVisibleFrameMin
protected

Definition at line 31 of file SCR_MapEntity.c.

◆ m_wMapRoot

Widget SCR_MapEntity::m_wMapRoot
protected

Definition at line 34 of file SCR_MapEntity.c.

◆ m_Workspace

WorkspaceWidget SCR_MapEntity::m_Workspace
protected

Definition at line 36 of file SCR_MapEntity.c.

◆ s_MapInstance

SCR_MapEntity SCR_MapEntity::s_MapInstance
staticprotected

Definition at line 38 of file SCR_MapEntity.c.

◆ s_OnHoverEnd

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

Definition at line 80 of file SCR_MapEntity.c.

◆ s_OnHoverItem

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

Definition at line 79 of file SCR_MapEntity.c.

◆ s_OnLayerChanged

ref ScriptInvokerInt SCR_MapEntity::s_OnLayerChanged = new ScriptInvokerInt()
staticprotected

Definition at line 77 of file SCR_MapEntity.c.

◆ s_OnMapClose

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

Definition at line 71 of file SCR_MapEntity.c.

◆ s_OnMapInit

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

Definition at line 68 of file SCR_MapEntity.c.

◆ s_OnMapOpen

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

Definition at line 69 of file SCR_MapEntity.c.

◆ s_OnMapOpenComplete

ref ScriptInvokerBase<MapConfigurationInvoker> SCR_MapEntity::s_OnMapOpenComplete = new ScriptInvokerBase<MapConfigurationInvoker>()
staticprotected

Definition at line 70 of file SCR_MapEntity.c.

◆ s_OnMapPan

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

Definition at line 72 of file SCR_MapEntity.c.

◆ s_OnMapPanEnd

ref ScriptInvokerFloat2 SCR_MapEntity::s_OnMapPanEnd = new ScriptInvokerFloat2()
staticprotected

Definition at line 73 of file SCR_MapEntity.c.

◆ s_OnMapZoom

ref ScriptInvokerFloat SCR_MapEntity::s_OnMapZoom = new ScriptInvokerFloat()
staticprotected

Definition at line 74 of file SCR_MapEntity.c.

◆ s_OnMapZoomEnd

ref ScriptInvokerFloat SCR_MapEntity::s_OnMapZoomEnd = new ScriptInvokerFloat()
staticprotected

Definition at line 75 of file SCR_MapEntity.c.

◆ s_OnSelection

ref ScriptInvokerVector SCR_MapEntity::s_OnSelection = new ScriptInvokerVector()
staticprotected

Definition at line 76 of file SCR_MapEntity.c.

◆ s_OnSelectionChanged

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

Definition at line 78 of file SCR_MapEntity.c.


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