Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:MapSetPinGutter

From RoR Wiki

UI Lua API · Map functions
Version: WAR 1.4.8

Turns the "gutter" setting on or off for one type of map pin in a map window.

MapSetPinGutter(mapDisplayName, pinType, enabled)

Arguments

mapDisplayName
string – Name of a MapDisplay window set up with CreateMapInstance.
pinType
number – Pin type, a SystemData.MapPips value. Must be 0–57.
enabled
boolean – The new gutter setting for this pin type.

Returns

Nothing.

Details

  • The setting is kept per map window and per pin type, next to the filter set by MapSetPinFilter.
  • The stock overhead map offers it as a second check box per pin group in its pin filter menu, saved in EA_Window_OverheadMap.Settings.mapPinGutters, and switches its border style depending on whether any gutters are enabled.
  • Pin types outside 0–57 and unknown window names are ignored without an error.
  • When the setting changes, the client updates the pins of that window.
  • enabled must be a real boolean. Passing nil or a number raises an Invalid Parameters error.
  • The function needs at least three arguments and only reads the last three.

Errors

None besides the generic Invalid Parameters message when an argument has the wrong type.

Example

From default/ea_overheadmapwindow/source/overheadmapwindow.lua:

function EA_Window_OverheadMap.ToggleMapPinGutter()
    local gutterPin    = ButtonGetPressedFlag(SystemData.ActiveWindow.name)
    local pinTypeIndex = WindowGetId(SystemData.ActiveWindow.name)
    local pinTypes     = EA_Window_OverheadMap.mapPinGutters[pinTypeIndex].pins

    for _, pinType in ipairs(pinTypes)
    do
        MapSetPinGutter("EA_Window_OverheadMapMapDisplay", pinType, gutterPin)
        EA_Window_OverheadMap.Settings.mapPinGutters[ pinType ] = gutterPin
    end
    ...

See also