Skip to content

Commit

Permalink
feat: support ElvUI
Browse files Browse the repository at this point in the history
  • Loading branch information
DengSir committed Apr 12, 2024
1 parent df872aa commit b118643
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion API.lua
Original file line number Diff line number Diff line change
Expand Up @@ -279,4 +279,5 @@ ns.SELL_HOURS = {[1] = AUCTION_DURATION_ONE, [2] = AUCTION_DURATION_TWO, [3] = A
ns.SELL_HOURS = {[1] = '2' .. HOURS, [2] = '8' .. HOURS, [3] = '24' .. HOURS}
-- @end-classic@

ns.isZH = GetLocale() == 'zhCN' or GetLocale() == 'zhTW'
ns.ZH = (GetLocale() == 'zhCN' or GetLocale() == 'zhTW')
ns.NARROW_FILTER = ns.ZH and not ElvUI
6 changes: 3 additions & 3 deletions Addon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ local DEFAULT_PROFILE = { --
},
buy = { --
quickBuy = true,
hiddenColumns = {Seller = true, UnitBid = not ns.isZH or nil},
hiddenColumns = {Seller = true, UnitBid = not ns.ZH or nil},
},
}

Expand Down Expand Up @@ -228,10 +228,10 @@ function Addon:SetupBackground()
end
end

T('TopLeft', ns.isZH and 'Browse-zh' or 'Browse', 'Bid', 'Auction')
T('TopLeft', ns.NARROW_FILTER and 'Browse-zh' or 'Browse', 'Bid', 'Auction')
T('Top', 'Browse', 'Auction', 'Auction')
T('TopRight', 'Browse', 'Auction', 'Auction')
T('BotLeft', ns.isZH and 'Browse-zh' or 'Browse', 'Bid', 'Auction')
T('BotLeft', ns.NARROW_FILTER and 'Browse-zh' or 'Browse', 'Bid', 'Auction')
T('Bot', 'Auction', 'Auction', 'Auction')
T('BotRight', 'Bid', 'Bid', 'Auction')
end
Expand Down
6 changes: 3 additions & 3 deletions UI/Browse.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ local ripairs = ipairs_reverse or ripairs
local L = ns.L

local BUTTON_HEIGHT = 18
local FILTER_FRAME_SHORT = ns.isZH and 48 or 0
local CONTROL_LABEL_SPACING = ns.isZH and 0 or -3
local FILTER_FRAME_SHORT = ns.NARROW_FILTER and 48 or 0
local CONTROL_LABEL_SPACING = ns.NARROW_FILTER and 0 or -3

local BUTTON_WIDTH_WITHSCROLL = 608 + FILTER_FRAME_SHORT
local BUTTON_WIDTH_NOSCROLL = BUTTON_WIDTH_WITHSCROLL + 28
Expand Down Expand Up @@ -146,7 +146,7 @@ function Browse:LayoutBlizzard()
parent(self.SearchButton)
parent(self.ResetButton)

if ns.isZH then
if ns.NARROW_FILTER then
local function SetWidth(button, width, our)
if our then
return
Expand Down
2 changes: 1 addition & 1 deletion UI/ElvUI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ hook(ns.Addon, 'SetupUI', function(o, self)
point(Browse.NextPageButton, 'TOPRIGHT', 70, -58)
point(Browse.SearchCountText, 'BOTTOMLEFT', 190, 12)
point(BrowseBidPrice, 'BOTTOM', 115, 8)
point(BrowseBidText, 'RIGHT', BrowseBidPrice, 'LEFT', -5, 0)
-- point(BrowseBidText, 'RIGHT', BrowseBidPrice, 'LEFT', -5, 0)

S:HandleScrollBar(Browse.BuyFrame.ScrollFrame.scrollBar)
S:HandleCheckBox(Browse.ExactCheckButton)
Expand Down

0 comments on commit b118643

Please sign in to comment.