Commit 3961d781 authored by Simpy's avatar Simpy 🐹

12.13

parents 2e3ca891 2035fc9d
......@@ -2,7 +2,6 @@ local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, Private
local LSM = E.Libs.LSM
local _G = _G
local min, max = min, max
local strmatch = strmatch
local function SetFont(obj, font, size, style, sr, sg, sb, sa, sox, soy, r, g, b)
......@@ -24,10 +23,6 @@ local function SetFont(obj, font, size, style, sr, sg, sb, sa, sox, soy, r, g, b
end
end
local function GetSize(size)
return max(11, min(42, size))
end
local chatFontHeights = {6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}
function E:UpdateBlizzardFonts()
local NORMAL = E.media.normFont
......@@ -45,65 +40,64 @@ function E:UpdateBlizzardFonts()
_G.STANDARD_TEXT_FONT = NORMAL
--_G.NAMEPLATE_FONT = NAMEFONT
local size = E.db.general.fontSize
local enormous = GetSize(size * 2.00)
local mega = GetSize(size * 1.75)
local huge = GetSize(size * 1.50)
local large = GetSize(size * 1.25)
local medium = GetSize(size * 1.15)
local small = GetSize(size * 0.95)
local tiny = GetSize(size * 0.90)
local size = E.db.general.fontSize
local enormous = size * 1.9
local mega = size * 1.7
local huge = size * 1.5
local large = size * 1.3
local medium = size * 1.1
local small = size * 0.9
local tiny = size * 0.8
local unified = E.private.general.unifiedBlizzFonts and size
local s = not E.private.general.unifiedBlizzFonts
local mono = strmatch(E.db.general.fontStyle, 'MONOCHROME') and 'MONOCHROME' or ''
local thick, outline = mono..'THICKOUTLINE', mono..'OUTLINE'
SetFont(_G.ChatBubbleFont, BUBBLE, E.private.general.chatBubbleFontSize, E.private.general.chatBubbleFontOutline) -- 13
SetFont(_G.AchievementFont_Small, NORMAL, unified or small) -- 10 Achiev dates
SetFont(_G.BossEmoteNormalHuge, NORMAL, 25) -- Talent Title
SetFont(_G.CoreAbilityFont, NORMAL, 26) -- 32 Core abilities(title)
SetFont(_G.DestinyFontHuge, NORMAL, 32) -- Garrison Mission Report
SetFont(_G.DestinyFontMed, NORMAL, 14) -- Added in 7.3.5 used for ?
SetFont(_G.Fancy12Font, NORMAL, 12) -- Added in 7.3.5 used for ?
SetFont(_G.Fancy14Font, NORMAL, 14) -- Added in 7.3.5 used for ?
SetFont(_G.Fancy22Font, NORMAL, 22) -- Talking frame Title font
SetFont(_G.Fancy24Font, NORMAL, 24) -- Artifact frame - weapon name
SetFont(_G.AchievementFont_Small, NORMAL, s and small or size) -- 10 Achiev dates
SetFont(_G.BossEmoteNormalHuge, NORMAL, 24) -- Talent Title
SetFont(_G.CoreAbilityFont, NORMAL, 26) -- 32 Core abilities(title)
SetFont(_G.DestinyFontHuge, NORMAL, 32) -- Garrison Mission Report
SetFont(_G.DestinyFontMed, NORMAL, 14) -- Added in 7.3.5 used for ?
SetFont(_G.Fancy12Font, NORMAL, 12) -- Added in 7.3.5 used for ?
SetFont(_G.Fancy14Font, NORMAL, 14) -- Added in 7.3.5 used for ?
SetFont(_G.Fancy22Font, NORMAL, s and 22 or 20) -- Talking frame Title font
SetFont(_G.Fancy24Font, NORMAL, s and 24 or 20) -- Artifact frame - weapon name
SetFont(_G.FriendsFont_11, NORMAL, 11)
SetFont(_G.FriendsFont_Large, NORMAL, unified or large) -- 14
SetFont(_G.FriendsFont_Normal, NORMAL, unified or size) -- 12
SetFont(_G.FriendsFont_Small, NORMAL, unified or small) -- 10
SetFont(_G.FriendsFont_UserText, NORMAL, unified or size) -- 11
SetFont(_G.FriendsFont_Large, NORMAL, s and large or size) -- 14
SetFont(_G.FriendsFont_Normal, NORMAL, size) -- 12
SetFont(_G.FriendsFont_Small, NORMAL, s and small or size) -- 10
SetFont(_G.FriendsFont_UserText, NORMAL, size) -- 11
SetFont(_G.Game10Font_o1, NORMAL, 10, 'OUTLINE')
SetFont(_G.Game120Font, NORMAL, 120)
SetFont(_G.Game12Font, NORMAL, 12) -- PVP Stuff
SetFont(_G.Game13FontShadow, NORMAL, 13) -- InspectPvpFrame
SetFont(_G.Game15Font_o1, NORMAL, 15) -- CharacterStatsPane (ItemLevelFrame)
SetFont(_G.Game16Font, NORMAL, 16) -- Added in 7.3.5 used for ?
SetFont(_G.Game18Font, NORMAL, 18) -- MissionUI Bonus Chance
SetFont(_G.Game24Font, NORMAL, 24) -- Garrison Mission level (in detail frame)
SetFont(_G.Game30Font, NORMAL, 30) -- Mission Level
SetFont(_G.Game12Font, NORMAL, 12) -- PVP Stuff
SetFont(_G.Game13FontShadow, NORMAL, s and 13 or 14) -- InspectPvpFrame
SetFont(_G.Game15Font_o1, NORMAL, 15) -- CharacterStatsPane (ItemLevelFrame)
SetFont(_G.Game16Font, NORMAL, 16) -- Added in 7.3.5 used for ?
SetFont(_G.Game18Font, NORMAL, 18) -- MissionUI Bonus Chance
SetFont(_G.Game24Font, NORMAL, 24) -- Garrison Mission level (in detail frame)
SetFont(_G.Game30Font, NORMAL, 30) -- Mission Level
SetFont(_G.Game40Font, NORMAL, 40)
SetFont(_G.Game42Font, NORMAL, 42) -- PVP Stuff
SetFont(_G.Game46Font, NORMAL, 46) -- Added in 7.3.5 used for ?
SetFont(_G.Game42Font, NORMAL, 42) -- PVP Stuff
SetFont(_G.Game46Font, NORMAL, 46) -- Added in 7.3.5 used for ?
SetFont(_G.Game48Font, NORMAL, 48)
SetFont(_G.Game48FontShadow, NORMAL, 48)
SetFont(_G.Game60Font, NORMAL, 60)
SetFont(_G.Game72Font, NORMAL, 72)
SetFont(_G.GameFont_Gigantic, NORMAL, 32) -- Used at the install steps
SetFont(_G.GameFontHighlightMedium, NORMAL, unified and 15 or medium) -- 14 Fix QuestLog Title mouseover
SetFont(_G.GameFontHighlightSmall2, NORMAL, unified or small) -- 11 Skill or Recipe description on TradeSkill frame
SetFont(_G.GameFontHighlightSmall, NORMAL, unified or small) -- 10
SetFont(_G.GameFontNormalHuge2, NORMAL, unified and 24 or huge) -- 24 Mythic weekly best dungeon name
SetFont(_G.GameFontNormalLarge, NORMAL, unified and 16 or large) -- 16
SetFont(_G.GameFontNormalLarge2, NORMAL, unified and 15 or large) -- 18 Garrison Follower Names
SetFont(_G.GameFontNormalMed1, NORMAL, unified and 14 or medium) -- 13 WoW Token Info
SetFont(_G.GameFontNormalMed2, NORMAL, unified and 14 or medium) -- 14 Quest tracker
SetFont(_G.GameFontNormalMed3, NORMAL, unified and 15 or medium) -- 14
SetFont(_G.GameFontNormalSmall2, NORMAL, unified and 12 or small) -- 11 MissionUI Followers names
SetFont(_G.GameTooltipHeader, NORMAL, unified or size) -- 14
SetFont(_G.InvoiceFont_Med, NORMAL, unified and 12 or size) -- 12 Mail
SetFont(_G.InvoiceFont_Small, NORMAL, unified or small) -- 10 Mail
SetFont(_G.MailFont_Large, NORMAL, 14) -- Mail
SetFont(_G.GameFont_Gigantic, NORMAL, 32) -- Used at the install steps
SetFont(_G.GameFontHighlightMedium, NORMAL, s and medium or 15) -- 14 Fix QuestLog Title mouseover
SetFont(_G.GameFontHighlightSmall2, NORMAL, s and small or size) -- 11 Skill or Recipe description on TradeSkill frame
SetFont(_G.GameFontNormalHuge2, NORMAL, s and huge or 24) -- 24 Mythic weekly best dungeon name
SetFont(_G.GameFontNormalLarge, NORMAL, s and large or 16) -- 16
SetFont(_G.GameFontNormalLarge2, NORMAL, s and large or 15) -- 18 Garrison Follower Names
SetFont(_G.GameFontNormalMed1, NORMAL, s and medium or 14) -- 13 WoW Token Info
SetFont(_G.GameFontNormalMed2, NORMAL, s and medium or medium) -- 14 Quest tracker
SetFont(_G.GameFontNormalMed3, NORMAL, s and medium or 15) -- 14
SetFont(_G.GameFontNormalSmall2, NORMAL, s and small or 12) -- 11 MissionUI Followers names
SetFont(_G.GameTooltipHeader, NORMAL, size) -- 14
SetFont(_G.InvoiceFont_Med, NORMAL, s and size or 12) -- 12 Mail
SetFont(_G.InvoiceFont_Small, NORMAL, s and small or size) -- 10 Mail
SetFont(_G.MailFont_Large, NORMAL, 14) -- 10 Mail
SetFont(_G.Number11Font, NORMAL, 11)
SetFont(_G.Number11Font, NUMBER, 11)
SetFont(_G.Number12Font, NORMAL, 12)
......@@ -117,51 +111,51 @@ function E:UpdateBlizzardFonts()
SetFont(_G.Number15Font, NORMAL, 15)
SetFont(_G.Number18Font, NUMBER, 18)
SetFont(_G.Number18FontWhite, NUMBER, 18)
SetFont(_G.NumberFont_Outline_Huge, NUMBER, unified and 28 or huge, thick) -- 30
SetFont(_G.NumberFont_Outline_Large, NUMBER, unified and 15 or large, outline) -- 16
SetFont(_G.NumberFont_Outline_Med, NUMBER, unified and 14 or medium, 'OUTLINE') -- 14
SetFont(_G.NumberFont_OutlineThick_Mono_Small, NUMBER, unified or size, 'OUTLINE') -- 12
SetFont(_G.NumberFont_Shadow_Med, NORMAL, unified or medium) -- 14 Chat EditBox
SetFont(_G.NumberFont_Shadow_Small, NORMAL, unified or small) -- 12
SetFont(_G.NumberFontNormalSmall, NORMAL, unified and 11 or small, 'OUTLINE') -- 12 Calendar, EncounterJournal
SetFont(_G.PriceFont, NORMAL, 14)
SetFont(_G.NumberFont_Outline_Huge, NUMBER, s and huge or 28, thick) -- 30
SetFont(_G.NumberFont_Outline_Large, NUMBER, s and large or 15, outline) -- 16
SetFont(_G.NumberFont_Outline_Med, NUMBER, medium, 'OUTLINE') -- 14
SetFont(_G.NumberFont_OutlineThick_Mono_Small, NUMBER, size, 'OUTLINE') -- 12
SetFont(_G.NumberFont_Shadow_Med, NORMAL, s and medium or size) -- 14 Chat EditBox
SetFont(_G.NumberFont_Shadow_Small, NORMAL, s and small or size) -- 12
SetFont(_G.NumberFontNormalSmall, NORMAL, s and small or 11, 'OUTLINE') -- 12 Calendar, EncounterJournal
SetFont(_G.PriceFont, NORMAL, 13)
SetFont(_G.PVPArenaTextString, NORMAL, 22, outline)
SetFont(_G.PVPInfoTextString, NORMAL, 22, outline)
SetFont(_G.QuestFont, NORMAL, unified or size) -- 13
SetFont(_G.QuestFont_Enormous, NORMAL, unified and 24 or enormous) -- 30 Garrison Titles
SetFont(_G.QuestFont_Huge, NORMAL, unified and 15 or huge) -- 18 Quest rewards title(Rewards)
SetFont(_G.QuestFont_Large, NORMAL, unified and 14 or large) -- 14
SetFont(_G.QuestFont_Shadow_Huge, NORMAL, unified and 15 or huge) -- 18 Quest Title
SetFont(_G.QuestFont_Shadow_Small, NORMAL, unified and 14 or size) -- 14
SetFont(_G.QuestFont_Super_Huge, NORMAL, unified and 22 or mega) -- 24
SetFont(_G.ReputationDetailFont, NORMAL, unified or size) -- 10 Rep Desc when clicking a rep
SetFont(_G.QuestFont, NORMAL, size) -- 13
SetFont(_G.QuestFont_Enormous, NORMAL, s and enormous or 24) -- 30 Garrison Titles
SetFont(_G.QuestFont_Huge, NORMAL, s and huge or 15) -- 18 Quest rewards title(Rewards)
SetFont(_G.QuestFont_Large, NORMAL, s and large or 14) -- 14
SetFont(_G.QuestFont_Shadow_Huge, NORMAL, s and huge or 15) -- 18 Quest Title
SetFont(_G.QuestFont_Shadow_Small, NORMAL, s and size or 14) -- 14
SetFont(_G.QuestFont_Super_Huge, NORMAL, s and mega or 22) -- 24
SetFont(_G.ReputationDetailFont, NORMAL, size) -- 10 Rep Desc when clicking a rep
SetFont(_G.SpellFont_Small, NORMAL, 10)
SetFont(_G.SubSpellFont, NORMAL, 10) -- Spellbook Sub Names
SetFont(_G.SubZoneTextFont, NORMAL, 24, outline) -- 26 World Map(SubZone)
SetFont(_G.SubZoneTextString, NORMAL, 25, outline) -- 26
SetFont(_G.SystemFont_Huge1, NORMAL, 20) -- Garrison Mission XP
SetFont(_G.SystemFont_Huge1_Outline, NORMAL, 18, outline) -- 20 Garrison Mission Chance
SetFont(_G.SystemFont_Large, NORMAL, 16)
SetFont(_G.SystemFont_Med1, NORMAL, unified or size) -- 12
SetFont(_G.SystemFont_Med3, NORMAL, unified and 14 or medium) -- 14
SetFont(_G.SystemFont_Outline, NORMAL, unified and 13 or size, outline) -- 13 Pet level on World map
SetFont(_G.SystemFont_Outline_Small, NUMBER, unified or small, 'OUTLINE') -- 10
SetFont(_G.SystemFont_OutlineThick_Huge2, NORMAL, unified and 20 or huge, thick) -- 22
SetFont(_G.SystemFont_OutlineThick_WTF, NORMAL, unified and 32 or enormous, outline) -- 32 World Map
SetFont(_G.SystemFont_Shadow_Huge1, NORMAL, 20, outline) -- Raid Warning, Boss emote frame too
SetFont(_G.SystemFont_Shadow_Huge3, NORMAL, 24) -- 25 FlightMap
SetFont(_G.SubSpellFont, NORMAL, 10) -- Spellbook Sub Names
SetFont(_G.SubZoneTextFont, NORMAL, 24, outline) -- 26 World Map(SubZone)
SetFont(_G.SubZoneTextString, NORMAL, 25, outline) -- 26
SetFont(_G.SystemFont_Huge1, NORMAL, 20) -- Garrison Mission XP
SetFont(_G.SystemFont_Huge1_Outline, NORMAL, 18, outline) -- 20 Garrison Mission Chance
SetFont(_G.SystemFont_Large, NORMAL, s and 16 or 15)
SetFont(_G.SystemFont_Med1, NORMAL, size) -- 12
SetFont(_G.SystemFont_Med3, NORMAL, medium) -- 14
SetFont(_G.SystemFont_Outline, NORMAL, s and size or 13, outline) -- 13 Pet level on World map
SetFont(_G.SystemFont_Outline_Small, NUMBER, s and small or size, 'OUTLINE') -- 10
SetFont(_G.SystemFont_OutlineThick_Huge2, NORMAL, s and huge or 20, thick) -- 22
SetFont(_G.SystemFont_OutlineThick_WTF, NORMAL, s and enormous or 32, outline) -- 32 World Map
SetFont(_G.SystemFont_Shadow_Huge1, NORMAL, 20, outline) -- Raid Warning, Boss emote frame too
SetFont(_G.SystemFont_Shadow_Huge3, NORMAL, 22) -- 25 FlightMap
SetFont(_G.SystemFont_Shadow_Huge4, NORMAL, 27, nil, nil, nil, nil, nil, 1, -1)
SetFont(_G.SystemFont_Shadow_Large, NORMAL, 16)
SetFont(_G.SystemFont_Shadow_Large2, NORMAL, 18) -- Auction House ItemDisplay
SetFont(_G.SystemFont_Shadow_Large_Outline, NUMBER, 18, 'OUTLINE') -- 16
SetFont(_G.SystemFont_Shadow_Med1, NORMAL, unified or size) -- 12
SetFont(_G.SystemFont_Shadow_Med2, NORMAL, unified and 15 or medium) -- 14 Shows Order resourses on OrderHallTalentFrame
SetFont(_G.SystemFont_Shadow_Med3, NORMAL, unified and 15 or medium) -- 14
SetFont(_G.SystemFont_Shadow_Small, NORMAL, unified and 15 or small) -- 10
SetFont(_G.SystemFont_Small, NORMAL, unified and 13 or small) -- 10
SetFont(_G.SystemFont_Tiny, NORMAL, unified or tiny) -- 09
SetFont(_G.Tooltip_Med, NORMAL, unified or size) -- 12
SetFont(_G.Tooltip_Small, NORMAL, unified or small) -- 10
SetFont(_G.ZoneTextString, NORMAL, unified and 32 or enormous, outline) -- 32
SetFont(_G.SystemFont_Shadow_Large, NORMAL, 15)
SetFont(_G.SystemFont_Shadow_Large2, NORMAL, 18) -- Auction House ItemDisplay
SetFont(_G.SystemFont_Shadow_Large_Outline, NUMBER, 20, 'OUTLINE') -- 16
SetFont(_G.SystemFont_Shadow_Med1, NORMAL, size) -- 12
SetFont(_G.SystemFont_Shadow_Med2, NORMAL, s and medium or 14.3) -- 14 Shows Order resourses on OrderHallTalentFrame
SetFont(_G.SystemFont_Shadow_Med3, NORMAL, medium) -- 14
SetFont(_G.SystemFont_Shadow_Small, NORMAL, small) -- 10
SetFont(_G.SystemFont_Small, NORMAL, s and small or size) -- 10
SetFont(_G.SystemFont_Tiny, NORMAL, s and tiny or size) -- 09
SetFont(_G.Tooltip_Med, NORMAL, size) -- 12
SetFont(_G.Tooltip_Small, NORMAL, s and small or size) -- 10
SetFont(_G.ZoneTextString, NORMAL, s and enormous or 32, outline) -- 32
end
end
......@@ -497,6 +497,9 @@ local function ResetAll()
_G.InstallSlider.Min:SetText('')
_G.InstallSlider.Max:SetText('')
_G.InstallSlider.Cur:SetText('')
_G.InstallSlider:SetScript('OnValueChanged', nil)
_G.InstallSlider:SetScript('OnMouseUp', nil)
ElvUIInstallFrame.SubTitle:SetText('')
ElvUIInstallFrame.Desc1:SetText('')
ElvUIInstallFrame.Desc2:SetText('')
......@@ -512,9 +515,6 @@ function E:SetPage(PageNum)
_G.InstallStatus.anim.progress:Play()
_G.InstallStatus.text:SetText(CURRENT_PAGE..' / '..MAX_PAGE)
local r, g, b = E:ColorGradient(CURRENT_PAGE / MAX_PAGE, 1, 0, 0, 1, 1, 0, 0, 1, 0)
ElvUIInstallFrame.Status:SetStatusBarColor(r, g, b)
if PageNum == MAX_PAGE then
_G.InstallNextButton:Disable()
else
......@@ -530,22 +530,30 @@ function E:SetPage(PageNum)
local InstallOption1Button = _G.InstallOption1Button
local InstallOption2Button = _G.InstallOption2Button
local InstallOption3Button = _G.InstallOption3Button
local InstallOption4Button = _G.InstallOption4Button
local InstallSlider = _G.InstallSlider
local f = ElvUIInstallFrame
local r, g, b = E:ColorGradient(CURRENT_PAGE / MAX_PAGE, 1, 0, 0, 1, 1, 0, 0, 1, 0)
f.Status:SetStatusBarColor(r, g, b)
f.Desc1:FontTemplate(nil, 16)
f.Desc2:FontTemplate(nil, 16)
f.Desc3:FontTemplate(nil, 16)
if PageNum == 1 then
f.SubTitle:SetFormattedText(L["Welcome to ElvUI version %s!"], E.version)
f.Desc1:SetText(L["This install process will help you learn some of the features in ElvUI has to offer and also prepare your user interface for usage."])
f.Desc2:SetText(L["The in-game configuration menu can be accessed by typing the /ec command. Press the button below if you wish to skip the installation process."])
f.Desc3:SetText(L["Please press the continue button to go onto the next step."])
InstallOption1Button:Show()
InstallOption1Button:SetScript('OnClick', InstallComplete)
InstallOption1Button:SetText(L["Skip Process"])
elseif PageNum == 2 then
f.SubTitle:SetText(L["CVars"])
f.Desc1:SetText(L["This part of the installation process sets up your World of Warcraft default options it is recommended you should do this step for everything to behave properly."])
f.Desc2:SetText(L["Please click the button below to setup your CVars."])
f.Desc3:SetText(L["Importance: |cffFF3333High|r"])
f.Desc3:FontTemplate(nil, 18)
InstallOption1Button:Show()
InstallOption1Button:SetScript('OnClick', function() E:SetupCVars() end)
InstallOption1Button:SetText(L["Setup CVars"])
......@@ -554,17 +562,23 @@ function E:SetPage(PageNum)
f.Desc1:SetText(L["This part of the installation process sets up your chat windows names, positions and colors."])
f.Desc2:SetText(L["The chat windows function the same as Blizzard standard chat windows, you can right click the tabs and drag them around, rename, etc. Please click the button below to setup your chat windows."])
f.Desc3:SetText(L["Importance: |cffD3CF00Medium|r"])
f.Desc2:FontTemplate(nil, 14)
f.Desc3:FontTemplate(nil, 18)
InstallOption1Button:Show()
InstallOption1Button:SetScript('OnClick', function() E:SetupChat() end)
InstallOption1Button:SetText(L["Setup Chat"])
elseif PageNum == 4 then
f.SubTitle:SetText(L["Profile Settings Setup"])
f.Desc1:SetText(L["Please click the button below to setup your Profile Settings."])
f.Desc2:SetText(L["New Profile will create a fresh profile for this character."] .. '\n' .. L["Shared Profile will select the default profile."])
InstallOption1Button:Show()
InstallOption1Button:SetScript('OnClick', function()
E.data:SetProfile('Default')
E:NextPage()
end)
InstallOption1Button:SetText(L["Shared Profile"])
InstallOption2Button:Show()
InstallOption2Button:SetScript('OnClick', function()
......@@ -577,6 +591,8 @@ function E:SetPage(PageNum)
f.Desc1:SetText(L["Choose a theme layout you wish to use for your initial setup."])
f.Desc2:SetText(L["You can always change fonts and colors of any element of ElvUI from the in-game configuration."])
f.Desc3:SetText(L["Importance: |cFF33FF33Low|r"])
f.Desc3:FontTemplate(nil, 18)
InstallOption1Button:Show()
InstallOption1Button:SetScript('OnClick', function() E:SetupTheme('classic') end)
InstallOption1Button:SetText(L["Classic"])
......@@ -587,8 +603,8 @@ function E:SetPage(PageNum)
InstallOption3Button:SetScript('OnClick', function() E:SetupTheme('class') end)
InstallOption3Button:SetText(CLASS)
elseif PageNum == 6 then
f.SubTitle:SetText(_G.UISCALE)
f.Desc1:SetFormattedText(L["Adjust the UI Scale to fit your screen, press the autoscale button to set the UI Scale automatically."])
f.SubTitle:SetText(L["UI Scale"])
f.Desc1:SetFormattedText(L["Adjust the UI Scale to fit your screen."])
InstallSlider:Show()
InstallSlider:SetValueStep(0.01)
InstallSlider:SetObeyStepOnDrag(true)
......@@ -597,54 +613,78 @@ function E:SetPage(PageNum)
local value = E.global.general.UIScale
InstallSlider:SetValue(value)
InstallSlider.Cur:SetText(value)
InstallSlider:SetScript('OnValueChanged', function(self)
local val = E:Round(self:GetValue(), 2)
InstallSlider:SetScript('OnMouseUp', function()
E:PixelScaleChanged()
end)
InstallSlider:SetScript('OnValueChanged', function(slider)
local val = E:Round(slider:GetValue(), 2)
E.global.general.UIScale = val
InstallSlider.Cur:SetText(val)
end)
InstallSlider.Min:SetText(0.4)
InstallSlider.Max:SetText(1.15)
InstallOption1Button:Show()
InstallOption1Button:SetText(_G.SMALL)
InstallOption1Button:SetScript('OnClick', function()
local scale = E:PixelBestSize()
E.global.general.UIScale = .6
InstallSlider.Cur:SetText(E.global.general.UIScale)
E.PixelScaleChanged()
end)
-- this is to just keep the slider in place, the values need updated again afterwards
InstallSlider:SetValue(scale)
InstallOption2Button:Show()
InstallOption2Button:SetText(_G.TIME_LEFT_MEDIUM)
InstallOption2Button:SetScript('OnClick', function()
E.global.general.UIScale = .7
InstallSlider.Cur:SetText(E.global.general.UIScale)
E.PixelScaleChanged()
end)
-- update the values with deeper accuracy
E.global.general.UIScale = scale
InstallOption3Button:Show()
InstallOption3Button:SetText(_G.LARGE)
InstallOption3Button:SetScript('OnClick', function()
E.global.general.UIScale = .8
InstallSlider.Cur:SetText(E.global.general.UIScale)
E.PixelScaleChanged()
end)
InstallOption1Button:SetText(L["Auto Scale"])
InstallOption2Button:Show()
InstallOption2Button:SetScript('OnClick', E.PixelScaleChanged)
InstallOption4Button:Show()
InstallOption4Button:SetText(L["Auto Scale"])
InstallOption4Button:SetScript('OnClick', function()
E.global.general.UIScale = E:PixelBestSize()
InstallSlider.Cur:SetText(E.global.general.UIScale)
E.PixelScaleChanged()
end)
InstallOption2Button:SetText(L["Preview"])
f.Desc3:SetText(L["Importance: |cffFF3333High|r"])
f.Desc3:SetText(L["Importance: |cffD3CF00Medium|r"])
f.Desc3:FontTemplate(nil, 18)
elseif PageNum == 7 then
f.SubTitle:SetText(L["Layout"])
f.Desc1:SetText(L["You can now choose what layout you wish to use based on your combat role."])
f.Desc2:SetText(L["This will change the layout of your unitframes and actionbars."])
f.Desc3:SetText(L["Importance: |cffD3CF00Medium|r"])
f.Desc3:FontTemplate(nil, 18)
InstallOption1Button:Show()
InstallOption1Button:SetScript('OnClick', function() E.db.layoutSet = nil; E:SetupLayout('tank') end)
InstallOption1Button:SetText(L["Tank / Physical DPS"])
InstallOption1Button:SetText(_G.STAT_CATEGORY_MELEE)
InstallOption2Button:Show()
InstallOption2Button:SetScript('OnClick', function() E.db.layoutSet = nil; E:SetupLayout('healer') end)
InstallOption2Button:SetText(L["Healer"])
InstallOption2Button:SetText(_G.CLUB_FINDER_HEALER)
InstallOption3Button:Show()
InstallOption3Button:SetScript('OnClick', function() E.db.layoutSet = nil; E:SetupLayout('dpsCaster') end)
InstallOption3Button:SetText(L["Caster DPS"])
InstallOption3Button:SetText(_G.STAT_CATEGORY_RANGED)
elseif PageNum == 8 then
f.SubTitle:SetText(L["Auras"])
f.Desc1:SetText(L["Select the type of aura system you want to use with ElvUI's unitframes. Set to Aura Bar & Icons to use both aura bars and icons, set to icons only to only see icons."])
f.Desc2:SetText(L["If you have an icon or aurabar that you don't want to display simply hold down shift and right click the icon for it to disapear."])
f.Desc3:SetText(L["Importance: |cffD3CF00Medium|r"])
f.Desc3:FontTemplate(nil, 18)
InstallOption1Button:Show()
InstallOption1Button:SetScript('OnClick', function() E:SetupAuras(true) end)
InstallOption1Button:SetText(L["Aura Bars & Icons"])
InstallOption1Button:SetText(L["Aura Bars"])
InstallOption2Button:Show()
InstallOption2Button:SetScript('OnClick', function() E:SetupAuras() end)
InstallOption2Button:SetText(L["Icons Only"])
......@@ -740,7 +780,7 @@ function E:Install()
f:SetScript('OnDragStop', function(frame) frame:StopMovingOrSizing() end)
f.Title = f:CreateFontString(nil, 'OVERLAY')
f.Title:FontTemplate(nil, 17, nil)
f.Title:FontTemplate(nil, 20)
f.Title:Point('TOP', 0, -5)
f.Title:SetText(L["ElvUI Installation"])
......@@ -796,7 +836,7 @@ function E:Install()
f.Slider.Max:Point('LEFT', f.Slider, 'RIGHT', 3, 0)
f.Slider.Cur = f.Slider:CreateFontString(nil, 'ARTWORK', 'GameFontHighlightSmall')
f.Slider.Cur:Point('BOTTOM', f.Slider, 'TOP', 0, 10)
f.Slider.Cur:FontTemplate(nil, 30, nil)
f.Slider.Cur:FontTemplate(nil, 22)
f.Option1 = CreateFrame('Button', 'InstallOption1Button', f, 'UIPanelButtonTemplate, BackdropTemplate')
f.Option1:Size(160, 30)
......@@ -840,21 +880,22 @@ function E:Install()
S:HandleButton(f.Option4, true)
f.SubTitle = f:CreateFontString(nil, 'OVERLAY')
f.SubTitle:FontTemplate(nil, 15, nil)
f.SubTitle:FontTemplate(nil, 20)
f.SubTitle:Point('TOP', 0, -40)
f.SubTitle:SetTextColor(unpack(E.media.rgbvaluecolor))
f.Desc1 = f:CreateFontString(nil, 'OVERLAY')
f.Desc1:FontTemplate()
f.Desc1:FontTemplate(nil, 16)
f.Desc1:Point('TOPLEFT', 20, -75)
f.Desc1:Width(f:GetWidth() - 40)
f.Desc2 = f:CreateFontString(nil, 'OVERLAY')
f.Desc2:FontTemplate()
f.Desc2:FontTemplate(nil, 16)
f.Desc2:Point('TOPLEFT', 20, -125)
f.Desc2:Width(f:GetWidth() - 40)
f.Desc3 = f:CreateFontString(nil, 'OVERLAY')
f.Desc3:FontTemplate()
f.Desc3:FontTemplate(nil, 16)
f.Desc3:Point('TOPLEFT', 20, -175)
f.Desc3:Width(f:GetWidth() - 40)
......
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local min, max, floor, format = min, max, floor, format
local min, max, format = min, max, format
local UIParent = UIParent
local InCombatLockdown = InCombatLockdown
......@@ -34,33 +34,25 @@ function E:IsUltrawide(width, height)
end
end
function E:UIScale(init)
local scale = E.global.general.UIScale
-- `init` will be the `event` if its triggered after combat
function E:UIScale(init) -- `init` will be the `event` if its triggered after combat
if init == true then -- E.OnInitialize
--Set variables for pixel scaling
local pixel, ratio = 1, 768 / E.screenheight
E.mult = (pixel / scale) - ((pixel - ratio) / scale)
E.mult = (768 / E.screenheight) / E.global.general.UIScale
elseif InCombatLockdown() then
E:RegisterEventForObject('PLAYER_REGEN_ENABLED', E.UIScale, E.UIScale)
else -- E.Initialize
UIParent:SetScale(scale)
UIParent:SetScale(E.global.general.UIScale)
local width, height = E.screenwidth, E.screenheight
E.eyefinity = E:IsEyefinity(width, height)
E.ultrawide = E:IsUltrawide(width, height)
local newWidth = E.eyefinity or E.ultrawide
--Resize E.UIParent if Eyefinity or UltraWide is on.
local testingResize = false
if testingResize then
local testing, newWidth = false, E.eyefinity or E.ultrawide
if testing then -- Resize E.UIParent if Eyefinity or UltraWide is on.
-- Eyefinity / UltraWide Test: Resize the E.UIParent to be smaller than it should be, all objects inside should relocate.
-- Dragging moveable frames outside the box and reloading the UI ensures that they are saving position correctly.
local uiWidth, uiHeight = UIParent:GetSize()
width, height = uiWidth-250, uiHeight-250
elseif newWidth then
-- Center E.UIParent
elseif newWidth then -- Center E.UIParent
local uiHeight = UIParent:GetHeight()
width, height = newWidth / (height / uiHeight), uiHeight
else
......@@ -86,12 +78,15 @@ function E:PixelScaleChanged(event)
E.resolution = format('%dx%d', E.screenwidth, E.screenheight)
end
E:UIScale(true) --Repopulate variables
E:UIScale() --Setup the scale
E:UIScale(true) -- Repopulate variables
E:UIScale() -- Setup the scale
E:Config_UpdateSize(true) --Reposition config
E:Config_UpdateSize(true) -- Reposition config
end
function E:Scale(x)
return E.mult * floor(x / E.mult + 0.5)
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(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
......@@ -6,7 +6,7 @@ local next, pairs, tinsert = next, pairs, tinsert
local CreateFrame = CreateFrame
local GetAddOnInfo = GetAddOnInfo
local GetCVar = GetCVar
local GetCVarBool = GetCVarBool
local GetLocale = GetLocale
local GetNumAddOns = GetNumAddOns
local GetRealZoneText = GetRealZoneText
......@@ -28,8 +28,7 @@ function E:AreOtherAddOnsEnabled()
end