Skip to content

Commit

Permalink
Use specific font for chinese playernames
Browse files Browse the repository at this point in the history
  • Loading branch information
Slivo-fr committed Jul 1, 2020
1 parent 2a4a3e5 commit 81f292c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/frames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function TranqRotate:createHunterFrame(hunter, parentFrame)

-- Set Text
hunter.frame.text = hunter.frame:CreateFontString(nil, "ARTWORK")
hunter.frame.text:SetFont("Fonts\\ARIALN.ttf", 12)
hunter.frame.text:SetFont(TranqRotate:getPlayerNameFont(), 12)
hunter.frame.text:SetPoint("LEFT",5,0)
hunter.frame.text:SetText(hunter.name)

Expand Down
8 changes: 8 additions & 0 deletions src/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,12 @@ end
-- Checks if a hunter is in a PvE raid
function TranqRotate:isInPveRaid()
return IsInRaid() and not TranqRotate:isPlayerInBattleground()
end

function TranqRotate:getPlayerNameFont()
if (GetLocale() == "zhCN" or GetLocale() == "zhTW") then
return "Fonts\\ARHei.ttf"
end

return "Fonts\\ARIALN.ttf"
end

0 comments on commit 81f292c

Please sign in to comment.