完成多出修改

修复拾取界面点击无效问题
修复宠物训练界面不显示训练点问题
新增天赋分享到聊天界面
修复飞行界面无法关闭问题
修复术士宠物的显示问题
为天赋界面添加默认数据库支持
框架现在也可自主选择是否启用
玩家框架和目标框架可取消显示3D头像以及透明度修改
背包和银行也添加透明度自定义支持
优化tooltip性能和背包物品显示方式
修复布局模式在ui缩放后不能正常定位的问题
添加硬核模式危险和死亡的工会通报
添加拾取和已拾取的框体
等等
This commit is contained in:
rucky
2026-03-23 10:25:25 +08:00
parent 63337b14d2
commit ec9e3c29d6
34 changed files with 13897 additions and 578 deletions

View File

@@ -81,6 +81,25 @@ local REP_STANDING = {
[5] = "友善", [6] = "尊敬", [7] = "崇敬", [8] = "崇拜",
}
local PET_TAB_INDEX = nil
local PET_FOOD_MAP = {
["Meat"] = "肉类", ["Fish"] = "鱼类", ["Cheese"] = "奶酪",
["Bread"] = "面包", ["Fungus"] = "蘑菇", ["Fruit"] = "水果",
["Raw Meat"] = "生肉", ["Raw Fish"] = "生鱼",
["Cooked Meat"] = "熟肉", ["Cooked Fish"] = "熟鱼",
}
local PET_HAPPINESS = {
[1] = { text = "不高兴", color = { 0.9, 0.2, 0.2 } },
[2] = { text = "满足", color = { 0.9, 0.75, 0.2 } },
[3] = { text = "高兴", color = { 0.2, 0.9, 0.2 } },
}
local BEAST_TRAINING_NAMES = {
["Beast Training"] = true, ["训练野兽"] = true,
}
--------------------------------------------------------------------------------
-- EP Stat Weights per class (Turtle WoW)
-- Physical DPS: 1 AP = 1 EP; Caster DPS: 1 SP = 1 EP
@@ -716,19 +735,45 @@ end
--------------------------------------------------------------------------------
-- Main Frame
--------------------------------------------------------------------------------
local function SaveCharPanelPosition()
if not (panel and SFramesDB) then return end
if not SFramesDB.charPanel then SFramesDB.charPanel = {} end
local point, _, relPoint, x, y = panel:GetPoint()
if not point or not relPoint then return end
SFramesDB.charPanel.position = {
point = point,
relPoint = relPoint,
x = x or 0,
y = y or 0,
}
end
local function ApplyCharPanelPosition(f)
f:ClearAllPoints()
local pos = SFramesDB and SFramesDB.charPanel and SFramesDB.charPanel.position
if pos and pos.point and pos.relPoint and type(pos.x) == "number" and type(pos.y) == "number" then
f:SetPoint(pos.point, UIParent, pos.relPoint, pos.x, pos.y)
else
f:SetPoint("LEFT", UIParent, "LEFT", 20, 0)
end
end
local function CreateMainFrame()
if panel then return panel end
local f = CreateFrame("Frame", "SFramesCharacterPanel", UIParent)
f:SetWidth(FRAME_W)
f:SetHeight(FRAME_H)
f:SetPoint("CENTER", UIParent, "CENTER", 0, 0)
ApplyCharPanelPosition(f)
f:SetFrameStrata("HIGH")
f:EnableMouse(true)
f:SetMovable(true)
f:RegisterForDrag("LeftButton")
f:SetScript("OnDragStart", function() this:StartMoving() end)
f:SetScript("OnDragStop", function() this:StopMovingOrSizing() end)
f:SetScript("OnDragStop", function()
this:StopMovingOrSizing()
SaveCharPanelPosition()
end)
f:SetClampedToScreen(true)
SetRoundBackdrop(f, T.bg, T.border)
CreateShadow(f, 4)
@@ -868,6 +913,12 @@ local function CreateMainFrame()
MakeSep(f, 6, -HEADER_H, -6, -HEADER_H)
local _, playerClass = UnitClass("player")
if (playerClass == "HUNTER" or playerClass == "WARLOCK") and not PET_TAB_INDEX then
table.insert(TAB_NAMES, "宠物")
PET_TAB_INDEX = table.getn(TAB_NAMES)
end
-- Tab bar
tabs = {}
pages = {}
@@ -1048,6 +1099,7 @@ function CP:UpdateCurrentTab()
elseif tab == 2 then self:UpdateReputation()
elseif tab == 3 then self:UpdateSkills()
elseif tab == 4 then self:UpdateHonor()
elseif PET_TAB_INDEX and tab == PET_TAB_INDEX then self:UpdatePet()
end
end
@@ -1229,6 +1281,7 @@ function CP:BuildAllPages()
self:BuildReputationPage()
self:BuildSkillsPage()
self:BuildHonorPage()
if PET_TAB_INDEX then self:BuildPetPage() end
end
--------------------------------------------------------------------------------
@@ -2645,7 +2698,13 @@ function CP:ShowSwapPopup(slot)
hl:SetAllPoints(row)
row:SetScript("OnClick", function()
UseContainerItem(this.itemBag, this.itemSlot)
local targetID = popup.anchorSlot and popup.anchorSlot.slotID
if targetID then
PickupContainerItem(this.itemBag, this.itemSlot)
PickupInventoryItem(targetID)
else
UseContainerItem(this.itemBag, this.itemSlot)
end
popup:Hide()
CP:ScheduleEquipUpdate()
end)
@@ -3233,6 +3292,29 @@ do
end)
end
if BEAST_TRAINING_NAMES[sn] then
local tp = 0
if GetPetTrainingPoints then
local ok2, total, spent = pcall(GetPetTrainingPoints)
if ok2 then tp = (total or 0) - (spent or 0) end
end
local tpFs = MakeFS(sf, 8, "LEFT", { 0.55, 0.85, 0.4 })
tpFs:SetPoint("TOPLEFT", nfs, "BOTTOMLEFT", 0, -1)
tpFs:SetText("可用训练点数: " .. tostring(tp))
sf:EnableMouse(true)
sf.skillName = sn
sf:SetScript("OnEnter", function()
GameTooltip:SetOwner(this, "ANCHOR_RIGHT")
GameTooltip:AddLine(this.skillName or "Beast Training", 1, 0.82, 0)
GameTooltip:AddLine("打开训练野兽窗口,教授宠物技能", 0.7, 0.7, 0.7)
GameTooltip:AddLine("消耗训练点数来教授宠物各种技能", 0.7, 0.7, 0.7)
GameTooltip:Show()
end)
sf:SetScript("OnLeave", function() GameTooltip:Hide() end)
sf:SetHeight(rowH + 12)
y = y - 12
end
table.insert(page.skillRows, { frame = sf })
y = y - rowH
end
@@ -3324,6 +3406,432 @@ function CP:UpdateHonor()
end
end
--------------------------------------------------------------------------------
-- Tab 5: Pet (Hunter)
--------------------------------------------------------------------------------
function CP:BuildPetPage()
if not PET_TAB_INDEX then return end
local page = pages[PET_TAB_INDEX]
if not page or page.built then return end
page.built = true
local cw = CONTENT_W
local contentH = FRAME_H - (HEADER_H + TAB_BAR_H) - INNER_PAD - 4
local pad = 8
local pc = CreateFrame("Frame", nil, page)
pc:SetAllPoints(page)
page.petContent = pc
page.noPetText = MakeFS(page, 12, "CENTER", T.dimText)
page.noPetText:SetPoint("CENTER", page, "CENTER", 0, 0)
page.noPetText:SetText("当前没有宠物")
page.noPetText:Hide()
-- 3D Model
local modelH = 180
local modelW = cw - 8
local modelBg = CreateFrame("Frame", nil, pc)
modelBg:SetWidth(modelW)
modelBg:SetHeight(modelH)
modelBg:SetPoint("TOP", pc, "TOP", 0, -2)
SetRoundBackdrop(modelBg, T.modelBg, T.modelBorder)
page.modelBgFrame = modelBg
local modelFrame = CreateFrame("Frame", nil, pc)
modelFrame:SetWidth(modelW - 8)
modelFrame:SetHeight(modelH - 8)
modelFrame:SetPoint("CENTER", modelBg, "CENTER", 0, 0)
modelFrame:SetFrameLevel(pc:GetFrameLevel() + 5)
local model = CreateFrame("PlayerModel", NextName("PetModel"), modelFrame)
model:SetAllPoints(modelFrame)
page.model = model
page.modelFrame = modelFrame
model:EnableMouse(true)
model:EnableMouseWheel(1)
model.rotating = false
model.curFacing = 0.4
model.curScale = 0.55
model.posX = 0
model.posY = -0.5
model:SetScript("OnMouseDown", function()
if arg1 == "LeftButton" then
this.rotating = true
this.startX = GetCursorPosition()
this.startFacing = this.curFacing or 0
elseif arg1 == "RightButton" then
this.panning = true
local cx, cy = GetCursorPosition()
this.panStartX = cx
this.panStartY = cy
this.panOriginX = this.posX or 0
this.panOriginY = this.posY or 0
end
end)
model:SetScript("OnMouseUp", function()
if arg1 == "LeftButton" then this.rotating = false
elseif arg1 == "RightButton" then this.panning = false end
end)
model:SetScript("OnMouseWheel", function()
local ns = (this.curScale or 1) + arg1 * 0.1
if ns < 0.3 then ns = 0.3 end
if ns > 3.0 then ns = 3.0 end
this.curScale = ns
this:SetModelScale(ns)
end)
model:SetScript("OnUpdate", function()
if this.rotating then
local cx = GetCursorPosition()
local diff = (cx - (this.startX or cx)) * 0.01
this.curFacing = (this.startFacing or 0) + diff
this:SetFacing(this.curFacing)
elseif this.panning then
local cx, cy = GetCursorPosition()
local es = this:GetEffectiveScale()
if es < 0.01 then es = 1 end
local dx = (cx - (this.panStartX or cx)) / (es * 35)
local dy = (cy - (this.panStartY or cy)) / (es * 35)
this.posX = (this.panOriginX or 0) + dx
this.posY = (this.panOriginY or 0) + dy
this:SetPosition(this.posY, 0, this.posX)
end
end)
-- Name overlay at bottom of model
page.petNameText = MakeFS(pc, 12, "LEFT", T.gold)
page.petNameText:SetPoint("BOTTOMLEFT", modelBg, "BOTTOMLEFT", 8, 4)
page.petFamilyText = MakeFS(pc, 9, "RIGHT", T.dimText)
page.petFamilyText:SetPoint("BOTTOMRIGHT", modelBg, "BOTTOMRIGHT", -8, 4)
-- Scrollable stats area below model
local statsTop = -(modelH + 6)
local statsH = contentH - modelH - 6
local scrollArea = CreateScrollFrame(pc, cw, statsH)
scrollArea:SetPoint("TOPLEFT", pc, "TOPLEFT", 0, statsTop)
page.scrollArea = scrollArea
local child = scrollArea.child
local sY = -4
-- Info line: happiness, loyalty, training points
page.happyLabel = MakeFS(child, 9, "LEFT", T.labelText)
page.happyLabel:SetPoint("TOPLEFT", child, "TOPLEFT", pad, sY)
page.happyLabel:SetText("心情:")
page.happyValue = MakeFS(child, 9, "LEFT", T.valueText)
page.happyValue:SetPoint("LEFT", page.happyLabel, "RIGHT", 2, 0)
page.loyalLabel = MakeFS(child, 9, "LEFT", T.labelText)
page.loyalLabel:SetPoint("LEFT", page.happyValue, "RIGHT", 10, 0)
page.loyalLabel:SetText("忠诚度:")
page.loyalValue = MakeFS(child, 9, "LEFT", T.valueText)
page.loyalValue:SetPoint("LEFT", page.loyalLabel, "RIGHT", 2, 0)
page.tpLabel = MakeFS(child, 9, "LEFT", T.labelText)
page.tpLabel:SetPoint("LEFT", page.loyalValue, "RIGHT", 10, 0)
page.tpLabel:SetText("训练点:")
page.tpValue = MakeFS(child, 9, "LEFT", { 0.55, 0.85, 0.4 })
page.tpValue:SetPoint("LEFT", page.tpLabel, "RIGHT", 2, 0)
sY = sY - 16
-- XP bar
page.xpSectionLabel = MakeFS(child, 9, "LEFT", T.sectionTitle)
page.xpSectionLabel:SetPoint("TOPLEFT", child, "TOPLEFT", pad, sY)
page.xpSectionLabel:SetText("经验值")
sY = sY - 12
local xpBf = CreateFrame("Frame", nil, child)
xpBf:SetHeight(8)
xpBf:SetPoint("TOPLEFT", child, "TOPLEFT", pad, sY)
xpBf:SetPoint("TOPRIGHT", child, "TOPRIGHT", -pad, sY)
SetPixelBackdrop(xpBf, T.barBg, { 0.15, 0.15, 0.18, 0.5 })
page.xpBarFrame = xpBf
local xpFill = xpBf:CreateTexture(nil, "ARTWORK")
xpFill:SetTexture(SFrames:GetTexture())
xpFill:SetVertexColor(0.4, 0.65, 0.85, 0.9)
xpFill:SetPoint("TOPLEFT", xpBf, "TOPLEFT", 1, -1)
xpFill:SetPoint("BOTTOMLEFT", xpBf, "BOTTOMLEFT", 1, 1)
xpFill:SetWidth(1)
page.xpBarFill = xpFill
page.xpBarText = MakeFS(xpBf, 7, "CENTER", { 1, 1, 1 })
page.xpBarText:SetPoint("CENTER", xpBf, "CENTER", 0, 0)
sY = sY - 14
-- Stats dual-column section
sY = self:CreateStatSection(child, "属性与攻防", sY)
local leftLabels = { "力量", "敏捷", "耐力", "智力", "精神" }
local rightLabels = { "攻击", "强度", "伤害", "防御", "护甲" }
page.petStatLeft = {}
page.petStatRight = {}
for idx = 1, 5 do
local row1 = {}
row1.label = MakeFS(child, 9, "LEFT", T.labelText)
row1.label:SetPoint("TOPLEFT", child, "TOPLEFT", 14, sY)
row1.label:SetText(leftLabels[idx] .. ":")
row1.value = MakeFS(child, 9, "RIGHT", T.valueText)
row1.value:SetPoint("TOPLEFT", child, "TOPLEFT", 56, sY)
row1.value:SetWidth(80)
row1.value:SetJustifyH("RIGHT")
table.insert(page.petStatLeft, row1)
local row2 = {}
row2.label = MakeFS(child, 9, "LEFT", T.labelText)
row2.label:SetPoint("TOPLEFT", child, "TOPLEFT", 160, sY)
row2.label:SetText(rightLabels[idx] .. ":")
row2.value = MakeFS(child, 9, "RIGHT", T.valueText)
row2.value:SetPoint("TOPRIGHT", child, "TOPRIGHT", -14, sY)
row2.value:SetWidth(80)
row2.value:SetJustifyH("RIGHT")
table.insert(page.petStatRight, row2)
sY = sY - 14
end
-- Resistances
sY = sY - 4
sY = self:CreateStatSection(child, "抗性", sY)
page.resStats = {}
local resSchools = { 2, 3, 4, 5, 6 }
local resPerRow = 3
local resColW = math.floor((cw - 28) / resPerRow)
for idx = 1, 5 do
local col = math.mod(idx - 1, resPerRow)
local rowOff = math.floor((idx - 1) / resPerRow)
local rx = 14 + col * resColW
local ry = sY - rowOff * 14
local row = {}
local school = resSchools[idx]
local rc = T.resistColors[school] or T.labelText
row.label = MakeFS(child, 9, "LEFT", rc)
row.label:SetPoint("TOPLEFT", child, "TOPLEFT", rx, ry)
row.label:SetText(RESIST_NAMES[school] .. ":")
row.value = MakeFS(child, 9, "LEFT", T.valueText)
row.value:SetPoint("LEFT", row.label, "RIGHT", 2, 0)
row.school = school
table.insert(page.resStats, row)
end
sY = sY - math.ceil(5 / resPerRow) * 14
-- Food (manually created so we can show/hide for warlock)
sY = sY - 4
local foodHeader = MakeFS(child, 11, "LEFT", T.sectionTitle)
foodHeader:SetPoint("TOPLEFT", child, "TOPLEFT", 8, sY)
foodHeader:SetText("喜好食物")
local foodSep = child:CreateTexture(nil, "ARTWORK")
foodSep:SetTexture("Interface\\Buttons\\WHITE8X8")
foodSep:SetVertexColor(T.sepColor[1], T.sepColor[2], T.sepColor[3], T.sepColor[4])
foodSep:SetHeight(1)
foodSep:SetPoint("TOPLEFT", child, "TOPLEFT", 8, sY - 14)
foodSep:SetPoint("TOPRIGHT", child, "TOPRIGHT", -8, sY - 14)
sY = sY - 18
page.foodHeader = foodHeader
page.foodSep = foodSep
page.foodText = MakeFS(child, 9, "LEFT", T.valueText)
page.foodText:SetPoint("TOPLEFT", child, "TOPLEFT", 14, sY)
page.foodText:SetWidth(cw - 28)
sY = sY - 16
page.fullContentH = math.abs(sY) + 8
scrollArea:SetContentHeight(page.fullContentH)
end
function CP:UpdatePet()
if not PET_TAB_INDEX then return end
local page = pages[PET_TAB_INDEX]
if not page or not page.built then return end
local hasPetUI = HasPetUI and HasPetUI()
local hasPet = UnitExists("pet") and hasPetUI
if not hasPet then
page.petContent:Hide()
page.noPetText:Show()
return
end
page.petContent:Show()
page.noPetText:Hide()
-- Detect hunter pet vs warlock demon
local _, isHunterPet = HasPetUI()
-- Set 3D model (only reload when pet identity changes to avoid animation reset)
if page.model then
local petKey = (UnitName("pet") or "") .. ":" .. (UnitLevel("pet") or 0)
if page.model.lastPetKey ~= petKey then
page.model.lastPetKey = petKey
page.model.curFacing = 0.4
page.model.curScale = 0.55
page.model.posX = 0
page.model.posY = -0.5
page.model:SetUnit("pet")
page.model:SetFacing(0.4)
page.model:SetModelScale(0.55)
page.model:SetPosition(-0.5, 0, 0)
end
end
local petName = UnitName("pet") or "未知"
local petLevel = UnitLevel("pet") or 0
page.petNameText:SetText(petName .. " |cff88bbddLv." .. petLevel .. "|r")
local family = ""
if UnitCreatureFamily then
local ok, val = pcall(UnitCreatureFamily, "pet")
if ok and val then family = val end
end
page.petFamilyText:SetText(family)
-- Hunter-only: happiness, loyalty, training points, XP, food
if isHunterPet then
page.happyLabel:Show(); page.happyValue:Show()
page.loyalLabel:Show(); page.loyalValue:Show()
page.tpLabel:Show(); page.tpValue:Show()
if page.xpSectionLabel then page.xpSectionLabel:Show() end
page.xpBarFrame:Show()
if page.foodHeader then page.foodHeader:Show() end
if page.foodSep then page.foodSep:Show() end
page.foodText:Show()
local happiness = 0
if GetPetHappiness then
local ok, val = pcall(GetPetHappiness)
if ok and val then happiness = val end
end
local hData = PET_HAPPINESS[happiness]
if hData then
page.happyValue:SetText(hData.text)
page.happyValue:SetTextColor(hData.color[1], hData.color[2], hData.color[3])
else
page.happyValue:SetText("--")
page.happyValue:SetTextColor(T.dimText[1], T.dimText[2], T.dimText[3])
end
local loyalty = "--"
if GetPetLoyalty then
local ok, val = pcall(GetPetLoyalty)
if ok and val then loyalty = val end
end
page.loyalValue:SetText(tostring(loyalty))
local tp = 0
if GetPetTrainingPoints then
local ok, total, spent = pcall(GetPetTrainingPoints)
if ok then tp = (total or 0) - (spent or 0) end
end
page.tpValue:SetText(tostring(tp))
local curXP, maxXP = 0, 1
if GetPetExperience then
local ok, cx, mx = pcall(GetPetExperience)
if ok then curXP = cx or 0; maxXP = mx or 1 end
end
if maxXP == 0 then maxXP = 1 end
local xpPct = curXP / maxXP
local bw = page.xpBarFrame:GetWidth() - 2
if bw < 1 then bw = 1 end
page.xpBarFill:SetWidth(math.max(bw * xpPct, 1))
page.xpBarText:SetText(curXP .. " / " .. maxXP)
else
page.happyLabel:Hide(); page.happyValue:Hide()
page.loyalLabel:Hide(); page.loyalValue:Hide()
page.tpLabel:Hide(); page.tpValue:Hide()
if page.xpSectionLabel then page.xpSectionLabel:Hide() end
page.xpBarFrame:Hide()
if page.foodHeader then page.foodHeader:Hide() end
if page.foodSep then page.foodSep:Hide() end
page.foodText:Hide()
end
-- Base stats (UnitStat returns base, effective in vanilla; use first non-nil)
local statLabels = { "力量", "敏捷", "耐力", "智力", "精神" }
for i, r in ipairs(page.petStatLeft) do
local base, eff = UnitStat("pet", i)
local val = eff or base or 0
r.label:SetText(statLabels[i] .. ":")
r.value:SetText(tostring(val))
end
-- Combat stats
local mainBase, mainMod = 0, 0
if UnitAttack then
local ok, b, m = pcall(UnitAttack, "pet")
if ok then mainBase = b or 0; mainMod = m or 0 end
end
local apBase, apPos, apNeg = 0, 0, 0
if UnitAttackPower then
local ok, b, p, n = pcall(UnitAttackPower, "pet")
if ok then apBase = b or 0; apPos = p or 0; apNeg = n or 0 end
end
local ap = apBase + apPos + apNeg
local minDmg, maxDmg = 0, 0
if UnitDamage then
local ok, d1, d2 = pcall(UnitDamage, "pet")
if ok then minDmg = d1 or 0; maxDmg = d2 or 0 end
end
local defBase, defMod = 0, 0
if UnitDefense then
local ok, b, m = pcall(UnitDefense, "pet")
if ok then defBase = b or 0; defMod = m or 0 end
end
local armorBase, armorEff = 0, 0
if UnitArmor then
local ok, b, e = pcall(UnitArmor, "pet")
if ok then armorBase = b or 0; armorEff = e or 0 end
end
local combatLabels = { "攻击:", "强度:", "伤害:", "防御:", "护甲:" }
local combatVals = {
tostring(mainBase + mainMod),
tostring(ap),
string.format("%d-%d", math.floor(minDmg), math.floor(maxDmg)),
tostring(defBase + defMod),
tostring(armorEff > 0 and armorEff or armorBase),
}
for i, r in ipairs(page.petStatRight) do
r.label:SetText(combatLabels[i])
r.value:SetText(combatVals[i] or "0")
end
for _, r in ipairs(page.resStats) do
local base, bonus = 0, 0
if UnitResistance then
local ok, b, bn = pcall(UnitResistance, "pet", r.school)
if ok then base = b or 0; bonus = bn or 0 end
end
r.label:SetText(RESIST_NAMES[r.school] .. ":")
r.value:SetText(tostring(base + bonus))
end
if isHunterPet then
local foodStr = ""
if GetPetFoodTypes then
local ok, r1, r2, r3, r4, r5, r6 = pcall(GetPetFoodTypes)
if ok then
local foods = {}
if r1 and r1 ~= "" then table.insert(foods, PET_FOOD_MAP[r1] or r1) end
if r2 and r2 ~= "" then table.insert(foods, PET_FOOD_MAP[r2] or r2) end
if r3 and r3 ~= "" then table.insert(foods, PET_FOOD_MAP[r3] or r3) end
if r4 and r4 ~= "" then table.insert(foods, PET_FOOD_MAP[r4] or r4) end
if r5 and r5 ~= "" then table.insert(foods, PET_FOOD_MAP[r5] or r5) end
if r6 and r6 ~= "" then table.insert(foods, PET_FOOD_MAP[r6] or r6) end
foodStr = table.concat(foods, "")
end
end
page.foodText:SetText(foodStr)
page.scrollArea:SetContentHeight(page.fullContentH)
else
page.scrollArea:SetContentHeight(page.fullContentH)
end
end
--------------------------------------------------------------------------------
-- Events
--------------------------------------------------------------------------------
@@ -3336,6 +3844,8 @@ local cpEvents = {
"UNIT_ATTACK", "UNIT_DEFENSE", "UNIT_RESISTANCES",
"CHAT_MSG_SKILL", "CHAT_MSG_COMBAT_HONOR_GAIN",
"CHARACTER_POINTS_CHANGED", "PLAYER_ENTERING_WORLD",
"UNIT_PET", "PET_UI_UPDATE", "PET_BAR_UPDATE",
"UNIT_PET_EXPERIENCE", "PET_UI_CLOSE", "UNIT_HAPPINESS",
}
for _, ev in ipairs(cpEvents) do
pcall(function() eventFrame:RegisterEvent(ev) end)
@@ -3372,12 +3882,16 @@ ToggleCharacter = function(tab)
end
return
end
if tab == "PetPaperDollFrame" then
CreateMainFrame()
CP:Toggle(PET_TAB_INDEX or 1)
return
end
local tabMap = {
["PaperDollFrame"] = 1,
["ReputationFrame"] = 2,
["SkillFrame"] = 3,
["HonorFrame"] = 4,
["PetPaperDollFrame"] = 1,
}
CP:Toggle(tabMap[tab] or 1)
end