View Single Post
09/30/16, 04:48 PM   #4
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
Originally Posted by ZOS_ChipHilseberg View Post
  1. Added as ZO_WorldMap_GetPinManager() and ZO_WorldMap_GetPanAndZoom().
  2. Not sure what the problem is with it without an example and some investigation. This is less likely though since it's old code that we don't use.
  3. That function just returns the empty space in the stock gamepad map UI that the world map can fill so it's particular to that.
  4. Added.
Great

Thank you!

To point 2: It has to do with "my" mini map . Once the mode switch "keepSquare" is false, and the mini map isn't square the player pin drifts out of the center (even out of view) depending on the ratio of height/width.
For example in ZO_MapPanAndZoom:Update(currentTime) you use ZO_WorldMapScroll:GetHeight() only. Assuming the width will be the same.

If you use the mini map and search for
Code:
	myMode.mapSize = 2
and change it to:
Code:
	myMode.mapSize = 2
	myMode.keepSquare = false
and resize it, you will see.

To point 3: This function resizes the mini map, too. Therefore I can not add gamepad support. (very low prio)

/edit: to be more precise: The caller of that function will change given width & height for mini map, too:
Code:
local function SetMapWindowSize(newWidth, newHeight)
    if(IsInGamepadPreferredMode()) then
        newWidth, newHeight = GetGamepadAdjustedMapDimensions()
    end
/edit 2:
I may be wrong, because I can not test it, of course. But I think it should be removed from SetMapWindowSize and inserted here:
Code:
local function ResizeAndReanchorMap()
...
    local newMapWidth, newMapHeight
    if(g_modeData.mapSize == CONSTANTS.WORLDMAP_SIZE_FULLSCREEN) then
        if(IsInGamepadPreferredMode()) then
            newMapWidth, newMapHeight = GetGamepadAdjustedMapDimensions()
        else
            newMapWidth, newMapHeight = GetFullscreenMapWindowDimensions()
        end
    else
        if(g_modeData.keepSquare) then
            newMapWidth, newMapHeight = GetSquareMapWindowDimensions(oldMapWidth, CONSTANTS.WORLDMAP_RESIZE_WIDTH_DRIVEN)
        else
            newMapWidth, newMapHeight = zo_min(oldMapWidth, UIWidth), zo_min(oldMapHeight, UIHeight)
        end
    end
    SetMapWindowSize(newMapWidth, newMapHeight)
...
end

Last edited by votan : 10/01/16 at 03:15 AM.