Skip to content

OverrideConfig values being ignored by GetFrameBR() and GetFrameCenterOffset() #161

@niondevi

Description

@niondevi

Hey I was working on a mod that re-positions the minimap and noticed something.

It seems that MinimapAPI:GetFrameBR() and MinimapAPI:GetFrameCenterOffset() don't use MinimapAPI:GetConfig() to reference the MapFrameHeight and MapFrameWidth values. Instead they reference them directly, ignoring the OverrideConfig values for MapFrameHeight and MapFrameWidth.

i.e. these:

function MinimapAPI:GetFrameBR()
    return Vector(MinimapAPI.Config.MapFrameWidth, MinimapAPI.Config.MapFrameHeight)
end

function MinimapAPI:GetFrameCenterOffset()
    return Vector(MinimapAPI.Config.MapFrameWidth + 1, MinimapAPI.Config.MapFrameHeight + 1) / 2
end  

should be:

function MinimapAPI:GetFrameBR()
    return Vector(MinimapAPI:GetConfig("MapFrameWidth"), MinimapAPI:GetConfig("MapFrameHeight"))
end

function MinimapAPI:GetFrameCenterOffset()
    return Vector(MinimapAPI:GetConfig("MapFrameWidth") + 1, MinimapAPI:GetConfig("MapFrameHeight") + 1) / 2
end

I've live patched these in my mod and they seem to work great. Otherwise I can't really use MinimapAPI.OverrideConfig to override MapFrameHeight or MapFrameWidth without weird rendering issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions