Skip to content
Browse files

加入 arena frame

  • Loading branch information...
1 parent 583f146 commit 875b3db08bf1baf2446fc7e399281a107c711b9f @Paojy committed
Showing with 52 additions and 12 deletions.
  1. +25 −6 core/core.lua
  2. +3 −0 db.lua
  3. +6 −0 gui.lua
  4. +5 −2 locales/chinese.lua
  5. +5 −2 locales/english.lua
  6. +3 −0 locales/french.lua
  7. +5 −2 locales/twchinese.lua
View
31 core/core.lua
@@ -533,7 +533,7 @@ end
local CreateAuras = function(self, unit)
local u = unit:match("[^%d]+")
- if multicheck(u, "target", "focus", "boss", "player", "pet") then
+ if multicheck(u, "target", "focus", "boss", "arena", "player", "pet") then
local Auras = CreateFrame("Frame", nil, self)
Auras:SetHeight(oUF_MlightDB.height*2)
Auras:SetWidth(oUF_MlightDB.width-2)
@@ -582,6 +582,13 @@ local CreateAuras = function(self, unit)
Auras.numDebuffs = 6
Auras.numBuffs = 3
Auras.CustomFilter = BossAuraFilter
+ elseif u == "arena" then
+ Auras:SetPoint("BOTTOMLEFT", self, "TOPLEFT", 1, 12)
+ Auras.initialAnchor = "BOTTOMLEFT"
+ Auras["growth-x"] = "RIGHT"
+ Auras["growth-y"] = "UP"
+ Auras.numDebuffs = ceil(oUF_MlightDB.widthboss/((oUF_MlightDB.width+3)/oUF_MlightDB.auraperrow-3))-1
+ Auras.numBuffs = ceil(oUF_MlightDB.widthboss/((oUF_MlightDB.width+3)/oUF_MlightDB.auraperrow-3))-1
end
self.Auras = Auras
end
@@ -619,7 +626,7 @@ local func = function(self, unit)
-- height, width and scale --
if multicheck(u, "targettarget", "focustarget", "pet") then
self:SetSize(oUF_MlightDB.widthpet, oUF_MlightDB.height)
- elseif u == "boss" then
+ elseif u == "boss" or u == "arena" then
self:SetSize(oUF_MlightDB.widthboss, oUF_MlightDB.height)
else
self:SetSize(oUF_MlightDB.width, oUF_MlightDB.height)
@@ -662,7 +669,7 @@ local func = function(self, unit)
tinsert(self.mouseovers, self.Health)
-- portrait --
- if oUF_MlightDB.portrait and multicheck(u, "player", "target", "focus", "boss") then
+ if oUF_MlightDB.portrait and multicheck(u, "player", "target", "focus", "boss", "arena") then
local Portrait = CreateFrame('PlayerModel', nil, self)
if oUF_MlightDB.transparentmode then
Portrait:SetFrameLevel(1) -- below hp
@@ -689,7 +696,7 @@ local func = function(self, unit)
pp.bd = createBackdrop(pp, pp, 1)
-- power text --
- if not multicheck(u, "pet", "boss") then
+ if not multicheck(u, "pet", "boss", "arena") then
pp.value = createFont(pp, "OVERLAY", oUF_MlightDB.fontfile, oUF_MlightDB.fontsize, 1, 1, 1)
pp.value:SetPoint("BOTTOMLEFT", self, 4, -5)
end
@@ -702,7 +709,7 @@ local func = function(self, unit)
-- altpower bar --
if multicheck(u, "player", "boss", "pet") then
local altpp = createStatusbar(self, texture, "ARTWORK", 5, nil, 1, 1, 0, 1)
- if unit == pet then
+ if unit == "pet" then
altpp:SetPoint("TOPLEFT", self.Power, "BOTTOMLEFT", 0, -5)
altpp:SetPoint("TOPRIGHT", self.Power, "BOTTOMRIGHT", 0, -5)
else
@@ -744,7 +751,7 @@ local func = function(self, unit)
name:SetPoint("TOPLEFT", self.Health, "TOPLEFT", 3, 9)
if unit == "player" or unit == "pet" then
name:Hide()
- elseif multicheck(u, "targettarget", "focustarget", "boss") then
+ elseif multicheck(u, "targettarget", "focustarget", "boss", "arena") then
if oUF_MlightDB.nameclasscolormode then
self:Tag(name, "[Mlight:color][Mlight:shortname]")
else
@@ -952,6 +959,13 @@ local UnitSpecific = {
boss = function(self, ...)
func(self, ...)
end,
+
+ --========================--
+ -- Arena
+ --========================--
+ arena = function(self, ...)
+ func(self, ...)
+ end,
}
local EventFrame = CreateFrame("Frame", nil, UIParent)
@@ -998,6 +1012,11 @@ function EventFrame:ADDON_LOADED(arg1)
spawnHelper(self,"boss" .. i, "TOPRIGHT","UIParent","TOPRIGHT", -10, -260-60*i)
end
end
+ if oUF_MlightDB.arenaframs then
+ for i = 1, 5 do
+ spawnHelper(self,"arena" .. i, "TOPRIGHT","UIParent","TOPRIGHT", -10, -260-60*i)
+ end
+ end
end)
end
View
3 db.lua
@@ -382,6 +382,9 @@ local default_Settings = {
-- show/hide boss
bossframes = true,
+ -- show/hide arena
+ arenaframs = true,
+
-- show pvp timer
pvpicon = false,
View
6 gui.lua
@@ -387,6 +387,12 @@ bosstext:SetPoint("TOPLEFT", 16, 3-43*30)
bosstext:SetText(L["bossframe"])
local bossframesbu = createcheckbutton(scrollFrame.Anchor, 44, L["bossframes"], "bossframes", L["bossframes2"])
+
+local arenatext = scrollFrame.Anchor:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge")
+arenatext:SetPoint("TOPLEFT", 16, 3-45*30)
+arenatext:SetText(L["arenaframe"])
+
+local arenaframesbu = createcheckbutton(scrollFrame.Anchor, 46, L["arenaframes"], "arenaframes", L["arenaframes2"])
--====================================================--
--[[ -- Raid -- ]]--
--====================================================--
View
7 locales/chinese.lua
@@ -41,8 +41,8 @@ ns.L["width"] = "框体宽度"
ns.L["width2"] = "玩家,目标和焦点框体的宽度。"
ns.L["widthpet"] = "宠物框体宽度"
ns.L["widthpet2"] = "宠物框体宽度"
-ns.L["widthboss"] = "首领框体宽度"
-ns.L["widthboss2"] = "首领框体宽度"
+ns.L["widthboss"] = "首领框体和PVP框体的宽度"
+ns.L["widthboss2"] = "首领框体和PVP框体的宽度"
ns.L["scale"] = "框体尺寸"
ns.L["scale2"] = "框体尺寸"
ns.L["hpheight"] = "生命条高度比"
@@ -79,6 +79,9 @@ ns.L["pvpicon2"] = "建议在PvE服务器使用。"
ns.L["bossframe"] = "首领框体"
ns.L["bossframes"] = "启用首领框体"
ns.L["bossframes2"] = "启用首领框体"
+ns.L["arenaframe"] = "PVP框体"
+ns.L["arenaframes"] = "启用PVP框体"
+ns.L["arenaframes2"] = "启用PVP框体"
ns.L["raidshare"] = "通用设置"
ns.L["enableraid"] = "启用团队框架"
ns.L["enableraid2"] = "启用团队框架"
View
7 locales/english.lua
@@ -42,8 +42,8 @@ ns.L["width"] = "Frame Width"
ns.L["width2"] = "The width for player, target and focus frame"
ns.L["widthpet"] = "Pet Frame Width"
ns.L["widthpet2"] = "The width for pet frame"
-ns.L["widthboss"] = "Boss Frame Width"
-ns.L["widthboss2"] = "The width for boss frames"
+ns.L["widthboss"] = "Boss Frame/Arena Frame Width"
+ns.L["widthboss2"] = "The width for boss frames and arena frames"
ns.L["scale"] = "Frame Scale"
ns.L["scale2"] = "Frame Scale"
ns.L["hpheight"] = "Heathbar Height Ratio"
@@ -80,6 +80,9 @@ ns.L["pvpicon2"] = "Recommand in a PvE Server"
ns.L["bossframe"] = "Bossframe"
ns.L["bossframes"] = "Enable Bossframes"
ns.L["bossframes2"] = "Enable bossframes"
+ns.L["arenaframe"] = "Arenaframe"
+ns.L["arenaframes"] = "Enable Arenaframes"
+ns.L["arenaframes2"] = "Enable arenaframes"
ns.L["raidshare"] = "Share Settings"
ns.L["enableraid"] = "Enable Raid Frames"
ns.L["enableraid2"] = "Enable raid frames"
View
3 locales/french.lua
@@ -79,6 +79,9 @@ ns.L["pvpicon2"] = "Recommand in a PvE Server"
ns.L["bossframe"] = "Cadre Boss"
ns.L["bossframes"] = "Activé les cadres de Boss"
ns.L["bossframes2"] = "Activé les cadres de Boss"
+ns.L["arenaframe"] = "Arenaframe"
+ns.L["arenaframes"] = "Enable Arenaframes"
+ns.L["arenaframes2"] = "Enable arenaframes"
ns.L["raidshare"] = "Partager les paramètres"
ns.L["enableraid"] = "Activé les cadres de Raid"
ns.L["enableraid2"] = "Activé les cadres de Raid"
View
7 locales/twchinese.lua
@@ -41,8 +41,8 @@ ns.L["width"] = "框體寬度"
ns.L["width2"] = "玩家,目標和焦點框體的寬度。"
ns.L["widthpet"] = "寵物框體寬度"
ns.L["widthpet2"] = "寵物框體寬度"
-ns.L["widthboss"] = "首領框體寬度"
-ns.L["widthboss2"] = "首領框體寬度"
+ns.L["widthboss"] = "首領框體和PVP框體寬度"
+ns.L["widthboss2"] = "首領框體和PVP框體寬度"
ns.L["scale"] = "框體尺寸"
ns.L["scale2"] = "框體尺寸"
ns.L["hpheight"] = "生命條高度比"
@@ -79,6 +79,9 @@ ns.L["pvpicon2"] = "建議PvE伺服器使用。"
ns.L["bossframe"] = "首領框體"
ns.L["bossframes"] = "啓用首領框體"
ns.L["bossframes2"] = "啓用首領框體"
+ns.L["arenaframe"] = "PVP框體"
+ns.L["arenaframes"] = "启用PVP框體"
+ns.L["arenaframes2"] = "启用PVP框體"
ns.L["raidshare"] = "通用設置"
ns.L["enableraid"] = "啓用團隊框架"
ns.L["enableraid2"] = "啓用團隊框架"

0 comments on commit 875b3db

Please sign in to comment.
Something went wrong with that request. Please try again.