Originally Posted by merlight
Anyway, I forgot to add that if you guys decide to use the library, please wait until AGS is ready for it. The search box location must be sorted out first. Perhaps it would suffice if AGS didn't move the search box and just let the lib do it. I'm going to test, but tonight we've got troube with electricity due to a windstorm, can't run ESO on battery
|
It looks like it has been added to AGS, but the search box location problem looks like it still exists.
It looks like we need something like this to move the search box anchor for AGS and move it back when the trading house (AGS) is done with it:
Warning: Spoiler
Lua Code:
-- Save/Initialize the default anchor for PlayerInventorySearchBox
libCIF.searchBoxAnchor = {
point = TOPRIGHT,
relativeTo = nil,
relativePoint = TOPRIGHT,
offsetX = -26,
offsetY = 68,
}
-- Saves the current search box anchor, before moving it for AGS
-- This is done in case AGS is used in combination with another addon that
-- moves the search box in any other layout
local function SaveSearchBoxAnchor()
local isValidAnchor, point, relativeTo, relativePoint, offsetX, offsetY = ZO_PlayerInventorySearchBox:GetAnchor(0)
libCIF.searchBoxAnchor = {
point = point,
relativeTo = relativeTo,
relativePoint = relativePoint,
offsetX = offsetX,
offsetY = offsetY,
}
end
-- Restore the search box anchor after trading house is done with it
local function RestoreSearchBoxAnchor()
local anchor = libCIF.searchBoxAnchor
ZO_PlayerInventorySearchBox:ClearAnchors()
ZO_PlayerInventorySearchBox:SetAnchor(anchor.point, anchor.relativeTo, anchor.relativePoint, anchor.offsetX, anchor.offsetY)
end
function PLAYER_INVENTORY:SetTradingHouseModeEnabled(enabled)
libCIF._tradingHouseModeEnabled = enabled
ZO_PlayerInventorySearchBox:SetHidden(not enabled and libCIF._searchBoxesDisabled)
ZO_PlayerInventoryTabs:SetHidden(enabled and libCIF._guildStoreSellFiltersDisabled)
-- This is only used by AGS right?
if libCIF._guildStoreSellFiltersDisabled then
if enabled then
-- Reanchor for AGS
SaveSearchBoxAnchor()
ZO_PlayerInventorySearchBox:ClearAnchors()
ZO_PlayerInventorySearchBox:SetAnchor(BOTTOMLEFT, nil, TOPLEFT, 36, -8)
else
-- Restore position when AGS is done with it
RestoreSearchBoxAnchor()
end
end
end
Does the search box need to be hidden when AGS is done with it & the trading house closes? Is it supposed to remain visible on other layouts if the user is only using AGS & not FilterIt or Advanced Filters?