local GlobalAddonName, ExRT = ...

-- https://github.com/aleksandyr/AddOns/blob/master/!BlizzBugsSuck/BlizzBugsSuck.lua
-- Fix an issue where the "DEATH" StaticPopup is wrongly shown when reloading the
-- UI.  The cause of the problem is in UIParent.lua around line 889 it seems
-- GetReleaseTimeRemaining is wrongly returning a non-zero value on the first
-- PLAYER_ENTERING_WORLD event.
hooksecurefunc("StaticPopup_Show", function(which)
	if which == "DEATH" and not UnitIsDead("player") then
		StaticPopup_Hide("DEATH")
	end
end)

-- RELOAD UI short command
SLASH_RELOADUI1 = "/rl"
SlashCmdList["RELOADUI"] = ReloadUI


-- Beta enUS & cyrillic fix
if ExRT.BETA and ExRT.locale:find("^en") and ExRT.EnableCyrillic then
	GameFontHighlightSmall:SetFont("Fonts\\FRIZQT___CYR.TTF",select(2,GameFontHighlightSmall:GetFont()))
	GameFontNormalSmall:SetFont("Fonts\\FRIZQT___CYR.TTF",select(2,GameFontNormalSmall:GetFont()))
	GameFontNormal:SetFont("Fonts\\FRIZQT___CYR.TTF",select(2,GameFontNormalSmall:GetFont()))
	ChatFontNormal:SetFont("Fonts\\FRIZQT___CYR.TTF",select(2,ChatFontNormal:GetFont()))
end


-- Languages fix
if ExRT.locale:find("^zh") then
	ExRTFontNormal:SetFont("Fonts\\ARHei.ttf",select(2,ExRTFontNormal:GetFont()))
elseif ExRT.locale == "koKR" then
	ExRTFontNormal:SetFont("Fonts\\2002.ttf",select(2,ExRTFontNormal:GetFont()))
end