Created
January 31, 2019 07:44
-
-
Save Wetxius/a10f5c8b1377c09a3eb0d8ddf041415c to your computer and use it in GitHub Desktop.
ShestakUI\Core\PixelPerfect.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local T, C, L, _ = unpack(select(2, ...)) | |
---------------------------------------------------------------------------------------- | |
-- Pixel perfect script of custom ui Scale | |
---------------------------------------------------------------------------------------- | |
T.UIScale = function() | |
if T.getscreenwidth <= 1440 then | |
T.low_resolution = true | |
else | |
T.low_resolution = false | |
end | |
if C.general.auto_scale == true then | |
C.general.uiscale = UIParent:GetEffectiveScale() | |
end | |
end | |
T.UIScale() | |
local mult = 768 / string.match(T.resolution, "%d+x(%d+)") / C.general.uiscale | |
local Scale = function(x) | |
return mult * math.floor(x / mult + 0.5) | |
end | |
T.Scale = function(x) return Scale(x) end | |
T.mult = mult | |
T.noscalemult = T.mult * C.general.uiscale | |
---------------------------------------------------------------------------------------- | |
-- Pixel perfect fonts function | |
---------------------------------------------------------------------------------------- | |
if T.getscreenheight <= 1200 then return end | |
C.media.pixel_font_size = C.media.pixel_font_size * mult | |
C.font.chat_tabs_font_size = C.font.chat_tabs_font_size * mult | |
C.font.action_bars_font_size = C.font.action_bars_font_size * mult | |
C.font.threat_meter_font_size = C.font.threat_meter_font_size * mult | |
C.font.raid_cooldowns_font_size = C.font.raid_cooldowns_font_size * mult | |
C.font.unit_frames_font_size = C.font.unit_frames_font_size * mult | |
C.font.auras_font_size = C.font.auras_font_size * mult | |
C.font.filger_font_size = C.font.filger_font_size * mult | |
C.font.bags_font_size = C.font.bags_font_size * mult | |
C.font.loot_font_size = C.font.loot_font_size * mult | |
C.font.combat_text_font_size = C.font.combat_text_font_size * mult | |
C.font.stats_font_size = C.font.stats_font_size * mult | |
C.font.stylization_font_size = C.font.stylization_font_size * mult | |
C.font.cooldown_timers_font_size = C.font.cooldown_timers_font_size * mult |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment