GuimDev / ProvisionsTeamFormation

TeamFormation is a user Interface for The Elder Scrolls Online, designed to show the positions and health of your teammates, like a radar.
0 stars 1 forks source link

Improve main loop (player loop) #35

Closed GuimDev closed 6 years ago

GuimDev commented 6 years ago

http://esodata.uesp.net/current/src/ingame/map/worldmap.lua.html#5759

Improve function check :

function ZO_WorldMap_RefreshGroupPins()
    g_mapPinManager:RemovePins("group")
    ZO_ClearTable(g_activeGroupPins)
    if ZO_WorldMap_IsPinGroupShown(MAP_FILTER_GROUP_MEMBERS) then
        for i = 1, GROUP_SIZE_MAX do
            local groupTag = ZO_Group_GetUnitTagForGroupIndex(i)
            local shouldShowOnCurrentMap = false
            if DoesCurrentMapMatchMapForPlayerLocation() then
                if IsGroupMemberInSameInstanceAsPlayer(groupTag) then
                    shouldShowOnCurrentMap = true
                else
                    -- Show if in a house and house we are in doesn't have it's own (dungeon) map
                    if GetCurrentZoneHouseId() and GetMapContentType() ~= MAP_CONTENT_DUNGEON then
                        shouldShowOnCurrentMap = true
                    end
                end
            else
                shouldShowOnCurrentMap = true
            end
            if DoesUnitExist(groupTag) and IsUnitOnline(groupTag) and not AreUnitsEqual("player", groupTag) and shouldShowOnCurrentMap then
                local isLeader = IsUnitGroupLeader(groupTag)
                local tagData = groupTag
                if IsUnitWorldMapPositionBreadcrumbed(groupTag) then
                    tagData = {
                        groupTag = groupTag,
                        isBreadcrumb = true
                    }
                end
                -- Do what do you want here.
            end
        end
    end
end
GuimDev commented 6 years ago

https://github.com/esoui/esoui/blob/9467824ca1e63596496d85bfbc7f12ef42d7078c/esoui/ingame/map/worldmap.lua#L5759-L5798

GuimDev commented 6 years ago

REMOVE if ZO_WorldMap_IsPinGroupShown(MAP_FILTER_GROUP_MEMBERS) then lol