API:CreateMapInstance
From RoR Wiki
UI Lua API · Interface functions
Version: WAR 1.4.8
Turns a MapDisplay window into a working map of the given type.
CreateMapInstance(windowName, mapType)
Arguments
- windowName
string– Name of a MapDisplay window.- mapType
number– Kind of map, a value fromSystemData.MapTypes(NORMAL,OVERHEAD,MAINMAP,RVRTRACKER, ...).
Returns
Nothing.
Details
- The client creates map data of the requested type for the window. Afterwards MapSetMapView can choose what the window shows.
- If
windowNameis empty, or the client's map data is not loaded, the call does nothing. - If the window does not exist, both errors below are logged.
- The function needs at least two arguments and only reads the last two.
Errors
These are written to the UI log; the call returns normally.
Error in function call 'CreateMapInstance': Display Window %s does not existError in function call 'CreateMapInstance': Display Window %s is not a MapDisplay
Example
From ea_overheadmapwindow/source/overheadmapwindow.lua:
CreateMapInstance( "EA_Window_OverheadMapMapDisplay", SystemData.MapTypes.OVERHEAD )
From ea_worldmapwindow/source/zoneview.lua:
CreateMapInstance( "EA_Window_WorldMapZoneViewMapDisplay", SystemData.MapTypes.MAINMAP )
