Verified Commit 7098d068 authored by Merathilis's avatar Merathilis
Browse files

Merge branch 'development' into beta

parents ed2f8a0f f1cbb97b
......@@ -628,7 +628,7 @@ function E:SetPage(PageNum)
InstallOption1Button:Show()
InstallOption1Button:SetText(_G.SMALL)
InstallOption1Button:SetScript('OnClick', function()
E.global.general.UIScale = .60
E.global.general.UIScale = .6
InstallSlider.Cur:SetText(E.global.general.UIScale)
E.PixelScaleChanged()
end)
......@@ -636,7 +636,7 @@ function E:SetPage(PageNum)
InstallOption2Button:Show()
InstallOption2Button:SetText(_G.TIME_LEFT_MEDIUM)
InstallOption2Button:SetScript('OnClick', function()
E.global.general.UIScale = .65
E.global.general.UIScale = .7
InstallSlider.Cur:SetText(E.global.general.UIScale)
E.PixelScaleChanged()
end)
......@@ -644,7 +644,7 @@ function E:SetPage(PageNum)
InstallOption3Button:Show()
InstallOption3Button:SetText(_G.LARGE)
InstallOption3Button:SetScript('OnClick', function()
E.global.general.UIScale = .70
E.global.general.UIScale = .8
InstallSlider.Cur:SetText(E.global.general.UIScale)
E.PixelScaleChanged()
end)
......
......@@ -86,12 +86,7 @@ end
local trunc = function(s) return s >= 0 and s-s%01 or s-s%-1 end
local round = function(s) return s >= 0 and s-s%-1 or s-s%01 end
function E:Scale(num)
if E.mult == 1 then
return num
elseif E.mult < 1 then
return trunc(num/E.mult) * E.mult
else
return round(num/E.mult) * E.mult
end
function E:Scale(n)
local m = E.mult
return (m == 1 or n == 0) and n or ((m < 1 and trunc(n/m) or round(n/m)) * m)
end
......@@ -165,22 +165,23 @@ function LO:RefreshChatMovers()
local showRightPanel = E.db.datatexts.panels.RightChatDataPanel.enable
local showLeftPanel = E.db.datatexts.panels.LeftChatDataPanel.enable
if not showLeftPanel or E.db.chat.LeftChatDataPanelAnchor == 'ABOVE_CHAT' then
LeftChatPanel:SetPoint(Left, LeftChatMover, 0, 0)
LeftChatPanel:Point(Left, LeftChatMover, 0, 0)
elseif showLeftPanel then
LeftChatPanel:SetPoint(Left, LeftChatMover, 0, barHeight)
LeftChatPanel:Point(Left, LeftChatMover, 0, barHeight)
end
if not showRightPanel or E.db.chat.RightChatDataPanelAnchor == 'ABOVE_CHAT' then
RightChatPanel:SetPoint(Right, RightChatMover, 0, 0)
RightChatPanel:Point(Right, RightChatMover, 0, 0)
elseif showRightPanel then
RightChatPanel:SetPoint(Right, RightChatMover, 0, barHeight)
RightChatPanel:Point(Right, RightChatMover, 0, barHeight)
end
-- mover sizes: same as in CH.PositionChats for panels but including the datatext bar height
LeftChatMover:SetSize(E.db.chat.panelWidth, E.db.chat.panelHeight + (showLeftPanel and barHeight or 0))
local panelWidth, panelHeight = E:Scale(E.db.chat.panelWidth), E:Scale(E.db.chat.panelHeight)
LeftChatMover:SetSize(panelWidth, panelHeight + (showLeftPanel and barHeight or 0))
if E.db.chat.separateSizes then
RightChatMover:SetSize(E.db.chat.panelWidthRight, E.db.chat.panelHeightRight + (showRightPanel and barHeight or 0))
RightChatMover:SetSize(E:Scale(E.db.chat.panelWidthRight), E:Scale(E.db.chat.panelHeightRight) + E:Scale(showRightPanel and barHeight or 0))
else
RightChatMover:SetSize(E.db.chat.panelWidth, E.db.chat.panelHeight + (showRightPanel and barHeight or 0))
RightChatMover:SetSize(panelWidth, panelHeight + E:Scale(showRightPanel and barHeight or 0))
end
end
......
......@@ -1187,11 +1187,11 @@ function CH:PositionChat(chat)
end
function CH:PositionChats()
_G.LeftChatPanel:SetSize(CH.db.panelWidth, CH.db.panelHeight)
_G.LeftChatPanel:Size(CH.db.panelWidth, CH.db.panelHeight)
if CH.db.separateSizes then
_G.RightChatPanel:SetSize(CH.db.panelWidthRight, CH.db.panelHeightRight)
_G.RightChatPanel:Size(CH.db.panelWidthRight, CH.db.panelHeightRight)
else
_G.RightChatPanel:SetSize(CH.db.panelWidth, CH.db.panelHeight)
_G.RightChatPanel:Size(CH.db.panelWidth, CH.db.panelHeight)
end
LO:RepositionChatDataPanels()
......
......@@ -89,9 +89,9 @@ function DB:UpdateAll()
for _, bar in pairs(DB.StatusBars) do
bar.holder.db = bar.db
bar.holder:SetSize(bar.db.width, bar.db.height)
bar.holder:EnableMouse(not bar.db.clickThrough)
bar.holder:Size(bar.db.width, bar.db.height)
bar.holder:SetTemplate(DB.db.transparent and 'Transparent')
bar.holder:EnableMouse(not bar.db.clickThrough)
bar.text:FontTemplate(LSM:Fetch('font', bar.db.font), bar.db.fontSize, bar.db.fontOutline)
bar:SetStatusBarTexture(texture)
bar:SetReverseFill(bar.db.reverseFill)
......
......@@ -249,15 +249,16 @@ function M:UpdateSettings()
local MinimapPanel, MMHolder = _G.MinimapPanel, _G.MMHolder
MinimapPanel:SetShown(E.db.datatexts.panels.MinimapPanel.enable)
local borderWidth, borderHeight = E.PixelMode and 2 or 6, E.PixelMode and 2 or 8
local panelSize, joinPanel = (MinimapPanel:IsShown() and MinimapPanel:GetHeight()) or (E.PixelMode and 1 or -1), 1
local height, width = E.MinimapSize + (panelSize - joinPanel), E.MinimapSize
MMHolder:SetSize(width + borderWidth, height + borderHeight)
local mmOffset = E.PixelMode and 1 or 3
Minimap:ClearAllPoints()
Minimap:SetPoint('TOPRIGHT', MMHolder, 'TOPRIGHT', -mmOffset, -mmOffset)
Minimap:SetSize(E.MinimapSize, E.MinimapSize)
Minimap:Point('TOPRIGHT', MMHolder, 'TOPRIGHT', -mmOffset, -mmOffset)
Minimap:Size(E.MinimapSize, E.MinimapSize)
local mWidth, mHeight = Minimap:GetSize()
local bWidth, bHeight = E:Scale(E.PixelMode and 2 or 6), E:Scale(E.PixelMode and 2 or 8)
local panelSize, joinPanel = (MinimapPanel:IsShown() and MinimapPanel:GetHeight()) or E:Scale(E.PixelMode and 1 or -1), E:Scale(1)
local HEIGHT, WIDTH = mHeight + (panelSize - joinPanel), mWidth
MMHolder:SetSize(WIDTH + bWidth, HEIGHT + bHeight)
Minimap.location:Width(E.MinimapSize)
if E.db.general.minimap.locationText ~= 'SHOW' then
......
......@@ -239,7 +239,7 @@ E.Options.args.general = {
name = _G.SMALL,
customWidth = 100,
func = function()
E.global.general.UIScale = .60
E.global.general.UIScale = .6
E:PixelScaleChanged()
E:StaticPopup_Show('PRIVATE_RL')
end,
......@@ -250,7 +250,7 @@ E.Options.args.general = {
name = _G.TIME_LEFT_MEDIUM,
customWidth = 100,
func = function()
E.global.general.UIScale = .65
E.global.general.UIScale = .7
E:PixelScaleChanged()
E:StaticPopup_Show('PRIVATE_RL')
end,
......@@ -261,7 +261,7 @@ E.Options.args.general = {
name = _G.LARGE,
customWidth = 100,
func = function()
E.global.general.UIScale = .70
E.global.general.UIScale = .8
E:PixelScaleChanged()
E:StaticPopup_Show('PRIVATE_RL')
end,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment