Revert "Merge pull request #78 from me0wg4ming/revert-77-sp-haste-display"

This reverts commit 791feed6d0, reversing
changes made to 054149f0e2.
This commit is contained in:
Meow
2026-03-01 02:13:25 +01:00
parent 791feed6d0
commit b0f6984f22
13 changed files with 237 additions and 11 deletions
+9 -4
View File
@@ -307,10 +307,15 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("unitframes", nil, "clickcast5_alt", "")
pfUI:UpdateConfig("unitframes", nil, "clickcast5_ctrl", "")
pfUI:UpdateConfig("unitframes", "player", "showPVPMinimap", "0")
pfUI:UpdateConfig("unitframes", "player", "showRest", "0")
pfUI:UpdateConfig("unitframes", "player", "energy", "1")
pfUI:UpdateConfig("unitframes", "player", "manatick", "0")
pfUI:UpdateConfig("unitframes", "player", "showPVPMinimap", "0")
pfUI:UpdateConfig("unitframes", "player", "showRest", "0")
pfUI:UpdateConfig("unitframes", "player", "energy", "1")
pfUI:UpdateConfig("unitframes", "player", "manatick", "0")
pfUI:UpdateConfig("unitframes", "player", "display_haste", "0")
pfUI:UpdateConfig("unitframes", "player", "display_haste_color", "1,1,1,1")
pfUI:UpdateConfig("unitframes", "player", "display_spellpower", "1")
pfUI:UpdateConfig("unitframes", "player", "display_sp_color_override", "0")
pfUI:UpdateConfig("unitframes", "player", "display_sp_color", "")
pfUI:UpdateConfig("unitframes", "focus", "width", "120")
pfUI:UpdateConfig("unitframes", "focus", "height", "34")
+8
View File
@@ -222,6 +222,7 @@ pfUI_translation["deDE"] = {
["Display Frame"] = nil,
["Display Mode"] = nil,
["Display Overheal"] = nil,
["Display Spell Power"] = nil,
["Dock"] = nil,
["Dodge"] = nil,
["Donate"] = nil,
@@ -235,6 +236,7 @@ pfUI_translation["deDE"] = {
["Draw Glow Around Target Nameplate"] = nil,
["Druid Mana Bar Height"] = nil,
["Druid Mana Bar Text"] = nil,
["Effective Haste (Haste * cast time reduction)"] = nil,
["Elastic Zoom"] = nil,
["Elysium Based Core"] = nil,
["Enable"] = nil,
@@ -361,6 +363,9 @@ pfUI_translation["deDE"] = {
["Gryphons"] = nil,
["Guild Online"] = nil,
["Happiness Icon Size"] = nil,
["Haste (cast speed increase)"] = nil,
["Haste Display"] = nil,
["Haste Display Color"] = nil,
["Heal Color"] = nil,
["Health"] = nil,
["Health - Auto"] = nil,
@@ -578,6 +583,7 @@ pfUI_translation["deDE"] = {
["Player Buff Bar"] = nil,
["Player Castbar"] = nil,
["Player Debuff Bar"] = nil,
["Player SP/Haste Display"] = nil,
["Player Unitframe"] = nil,
["Please enter a name for the new profile."] = nil,
["Please enter a name for the new profile.\nExisting profiles sharing the same name will be overwritten."] = nil,
@@ -755,6 +761,7 @@ pfUI_translation["deDE"] = {
["Soulshards"] = nil,
["Spacing"] = nil,
["Special Recipient"] = nil,
["Spell Power Color"] = nil,
["Square"] = nil,
["Stance Bar 1"] = nil,
["Stance Bar 2"] = nil,
@@ -840,6 +847,7 @@ pfUI_translation["deDE"] = {
["Use Custom Color On Full Health"] = nil,
["Use Custom Color Power Bar Background"] = nil,
["Use Custom Font Settings"] = nil,
["Use Custom Spell Power Color (unchecked = biggest school color)"] = nil,
["Use Dynamic Font Size"] = nil,
["Use Item Rarity Color For Loot-Roll Timer"] = nil,
["Use Original Game Fonts"] = nil,
+8
View File
@@ -222,6 +222,7 @@ pfUI_translation["enUS"] = {
["Display Frame"] = nil,
["Display Mode"] = nil,
["Display Overheal"] = nil,
["Display Spell Power"] = nil,
["Dock"] = nil,
["Dodge"] = nil,
["Donate"] = nil,
@@ -235,6 +236,7 @@ pfUI_translation["enUS"] = {
["Draw Glow Around Target Nameplate"] = nil,
["Druid Mana Bar Height"] = nil,
["Druid Mana Bar Text"] = nil,
["Effective Haste (Haste * cast time reduction)"] = nil,
["Elastic Zoom"] = nil,
["Elysium Based Core"] = nil,
["Enable"] = nil,
@@ -361,6 +363,9 @@ pfUI_translation["enUS"] = {
["Gryphons"] = nil,
["Guild Online"] = nil,
["Happiness Icon Size"] = nil,
["Haste (cast speed increase)"] = nil,
["Haste Display"] = nil,
["Haste Display Color"] = nil,
["Heal Color"] = nil,
["Health"] = nil,
["Health - Auto"] = nil,
@@ -578,6 +583,7 @@ pfUI_translation["enUS"] = {
["Player Buff Bar"] = nil,
["Player Castbar"] = nil,
["Player Debuff Bar"] = nil,
["Player SP/Haste Display"] = nil,
["Player Unitframe"] = nil,
["Please enter a name for the new profile."] = nil,
["Please enter a name for the new profile.\nExisting profiles sharing the same name will be overwritten."] = nil,
@@ -755,6 +761,7 @@ pfUI_translation["enUS"] = {
["Soulshards"] = nil,
["Spacing"] = nil,
["Special Recipient"] = nil,
["Spell Power Color"] = nil,
["Square"] = nil,
["Stance Bar 1"] = nil,
["Stance Bar 2"] = nil,
@@ -840,6 +847,7 @@ pfUI_translation["enUS"] = {
["Use Custom Color On Full Health"] = nil,
["Use Custom Color Power Bar Background"] = nil,
["Use Custom Font Settings"] = nil,
["Use Custom Spell Power Color (unchecked = biggest school color)"] = nil,
["Use Dynamic Font Size"] = nil,
["Use Item Rarity Color For Loot-Roll Timer"] = nil,
["Use Original Game Fonts"] = nil,
+8
View File
@@ -222,6 +222,7 @@ pfUI_translation["esES"] = {
["Display Frame"] = "Mostrar marco",
["Display Mode"] = "Modo de mostrar",
["Display Overheal"] = "Mostrar Sobresanación",
["Display Spell Power"] = nil,
["Dock"] = "Acoplar",
["Dodge"] = "Esquivar",
["Donate"] = nil,
@@ -235,6 +236,7 @@ pfUI_translation["esES"] = {
["Draw Glow Around Target Nameplate"] = "Brillar alrededor de la placa identificativa del objetivo",
["Druid Mana Bar Height"] = nil,
["Druid Mana Bar Text"] = nil,
["Effective Haste (Haste * cast time reduction)"] = nil,
["Elastic Zoom"] = "Acerca elástico",
["Elysium Based Core"] = "Núcleo basado en Elysium",
["Enable"] = "Activar",
@@ -361,6 +363,9 @@ pfUI_translation["esES"] = {
["Gryphons"] = nil,
["Guild Online"] = "Conectados en hermandad",
["Happiness Icon Size"] = "Tamaño del icono de felicidad",
["Haste (cast speed increase)"] = nil,
["Haste Display"] = nil,
["Haste Display Color"] = nil,
["Heal Color"] = "Color de curación",
["Health"] = "Salud",
["Health - Auto"] = "Salud - Auto",
@@ -578,6 +583,7 @@ pfUI_translation["esES"] = {
["Player Buff Bar"] = "Barra de beneficios del jugador",
["Player Castbar"] = "Barra de lanzamiento del jugador",
["Player Debuff Bar"] = "Barra de perjuicios del jugador",
["Player SP/Haste Display"] = nil,
["Player Unitframe"] = "Marco del jugador",
["Please enter a name for the new profile."] = "Mete un nombre para el nuevo perfil.",
["Please enter a name for the new profile.\nExisting profiles sharing the same name will be overwritten."] = "Mete un nombre para el nuevo perfil.\nSi ya existe un perfil con el mismo nombre, este será sobrescrito.",
@@ -755,6 +761,7 @@ pfUI_translation["esES"] = {
["Soulshards"] = "Fragmentos de alma",
["Spacing"] = "Espaciado",
["Special Recipient"] = "Destinatario especial",
["Spell Power Color"] = nil,
["Square"] = "Cuadrado",
["Stance Bar 1"] = "Barra de actitud 1",
["Stance Bar 2"] = "Barra de actitud 2",
@@ -840,6 +847,7 @@ pfUI_translation["esES"] = {
["Use Custom Color On Full Health"] = "Usar color personalizado en plena salud",
["Use Custom Color Power Bar Background"] = "Usar un color personalizado para el fondo de la barra de poder",
["Use Custom Font Settings"] = "Usar las opciones de fuente personalizada",
["Use Custom Spell Power Color (unchecked = biggest school color)"] = nil,
["Use Dynamic Font Size"] = "Usar un tamaño de fuente dinámico",
["Use Item Rarity Color For Loot-Roll Timer"] = "Usar el color de la rareza del objeto para el temporizador de tirar los dados",
["Use Original Game Fonts"] = nil,
+8
View File
@@ -222,6 +222,7 @@ pfUI_translation["frFR"] = {
["Display Frame"] = "Montre le cadre",
["Display Mode"] = nil,
["Display Overheal"] = "Montre le Overheal",
["Display Spell Power"] = nil,
["Dock"] = "Accroche",
["Dodge"] = "Esquive",
["Donate"] = nil,
@@ -235,6 +236,7 @@ pfUI_translation["frFR"] = {
["Draw Glow Around Target Nameplate"] = "Dessiner une lueur autour des barres de vie flottantes de la cible",
["Druid Mana Bar Height"] = nil,
["Druid Mana Bar Text"] = nil,
["Effective Haste (Haste * cast time reduction)"] = nil,
["Elastic Zoom"] = "Zoom élastique",
["Elysium Based Core"] = "Basé sur le core d'Elysium",
["Enable"] = "Activer",
@@ -361,6 +363,9 @@ pfUI_translation["frFR"] = {
["Gryphons"] = nil,
["Guild Online"] = "Membres de guilde connectés",
["Happiness Icon Size"] = nil,
["Haste (cast speed increase)"] = nil,
["Haste Display"] = nil,
["Haste Display Color"] = nil,
["Heal Color"] = nil,
["Health"] = "Point de vie",
["Health - Auto"] = "Points de vie - Automatique",
@@ -578,6 +583,7 @@ pfUI_translation["frFR"] = {
["Player Buff Bar"] = "Barre des Améliorations du Joueur",
["Player Castbar"] = "Barre d'incantation du Joueur",
["Player Debuff Bar"] = "Barre des Affaiblissements du Joueur",
["Player SP/Haste Display"] = nil,
["Player Unitframe"] = "Cadre du Joueur",
["Please enter a name for the new profile."] = "Entrez un nom pour le nouveau profil",
["Please enter a name for the new profile.\nExisting profiles sharing the same name will be overwritten."] = "Entrez un nom pour le nouveau profil.\nUn profil existant du même nom sera écrasé.",
@@ -755,6 +761,7 @@ pfUI_translation["frFR"] = {
["Soulshards"] = "Pierre d'âme",
["Spacing"] = "Espacement",
["Special Recipient"] = "Recipient spécial",
["Spell Power Color"] = nil,
["Square"] = "Carré",
["Stance Bar 1"] = "Barre de posture 1",
["Stance Bar 2"] = "Barre de posture 2",
@@ -840,6 +847,7 @@ pfUI_translation["frFR"] = {
["Use Custom Color On Full Health"] = "Utiliser une couleur personnalisée la vie est pleine",
["Use Custom Color Power Bar Background"] = "Utiliser l'arrière-plan de la barre d'alimentation de couleur personnalisée",
["Use Custom Font Settings"] = nil,
["Use Custom Spell Power Color (unchecked = biggest school color)"] = nil,
["Use Dynamic Font Size"] = "Utiliser la taille de police dynamique",
["Use Item Rarity Color For Loot-Roll Timer"] = "Utiliser la couleur de la rareté de l'objet pour la minuterie du lancer de dés",
["Use Original Game Fonts"] = nil,
+8
View File
@@ -222,6 +222,7 @@ pfUI_translation["koKR"] = {
["Display Frame"] = nil,
["Display Mode"] = nil,
["Display Overheal"] = nil,
["Display Spell Power"] = nil,
["Dock"] = "독",
["Dodge"] = "우측 챗팅창 위",
["Donate"] = nil,
@@ -235,6 +236,7 @@ pfUI_translation["koKR"] = {
["Draw Glow Around Target Nameplate"] = nil,
["Druid Mana Bar Height"] = nil,
["Druid Mana Bar Text"] = nil,
["Effective Haste (Haste * cast time reduction)"] = nil,
["Elastic Zoom"] = nil,
["Elysium Based Core"] = "엘리시움 기반 코어",
["Enable"] = nil,
@@ -361,6 +363,9 @@ pfUI_translation["koKR"] = {
["Gryphons"] = nil,
["Guild Online"] = "접속중인 길드원",
["Happiness Icon Size"] = nil,
["Haste (cast speed increase)"] = nil,
["Haste Display"] = nil,
["Haste Display Color"] = nil,
["Heal Color"] = nil,
["Health"] = nil,
["Health - Auto"] = "체력-자동",
@@ -578,6 +583,7 @@ pfUI_translation["koKR"] = {
["Player Buff Bar"] = nil,
["Player Castbar"] = nil,
["Player Debuff Bar"] = nil,
["Player SP/Haste Display"] = nil,
["Player Unitframe"] = nil,
["Please enter a name for the new profile."] = nil,
["Please enter a name for the new profile.\nExisting profiles sharing the same name will be overwritten."] = "새 프로필의 이름을 입력하십시오.\n동일한 이름을 작성하면 기존 프로파일을 덮어 씁니다.",
@@ -755,6 +761,7 @@ pfUI_translation["koKR"] = {
["Soulshards"] = "영혼의 조각",
["Spacing"] = nil,
["Special Recipient"] = nil,
["Spell Power Color"] = nil,
["Square"] = nil,
["Stance Bar 1"] = nil,
["Stance Bar 2"] = nil,
@@ -840,6 +847,7 @@ pfUI_translation["koKR"] = {
["Use Custom Color On Full Health"] = nil,
["Use Custom Color Power Bar Background"] = nil,
["Use Custom Font Settings"] = nil,
["Use Custom Spell Power Color (unchecked = biggest school color)"] = nil,
["Use Dynamic Font Size"] = nil,
["Use Item Rarity Color For Loot-Roll Timer"] = nil,
["Use Original Game Fonts"] = nil,
+8
View File
@@ -222,6 +222,7 @@ pfUI_translation["ruRU"] = {
["Display Frame"] = "Отобразить рамку",
["Display Mode"] = "Режим отображения",
["Display Overheal"] = "Отобразить избыточное исцеление",
["Display Spell Power"] = nil,
["Dock"] = "панель",
["Dodge"] = "Над окном чата справа",
["Donate"] = "Пожертвовать",
@@ -235,6 +236,7 @@ pfUI_translation["ruRU"] = {
["Draw Glow Around Target Nameplate"] = "Сияние вокруг индикатора здоровья цели",
["Druid Mana Bar Height"] = nil,
["Druid Mana Bar Text"] = nil,
["Effective Haste (Haste * cast time reduction)"] = nil,
["Elastic Zoom"] = "Эластичное увеличение",
["Elysium Based Core"] = "Ядро на основе Elysium",
["Enable"] = "Включить",
@@ -361,6 +363,9 @@ pfUI_translation["ruRU"] = {
["Gryphons"] = nil,
["Guild Online"] = "Члены гильдии в сети",
["Happiness Icon Size"] = "Размер значка счастья",
["Haste (cast speed increase)"] = nil,
["Haste Display"] = nil,
["Haste Display Color"] = nil,
["Heal Color"] = "Цвет исцеления",
["Health"] = "Здоровье",
["Health - Auto"] = "Здоровье - автоматически",
@@ -578,6 +583,7 @@ pfUI_translation["ruRU"] = {
["Player Buff Bar"] = "Панель баффов игрока",
["Player Castbar"] = "Панель применения игрока",
["Player Debuff Bar"] = "Панель дебаффов игрока",
["Player SP/Haste Display"] = nil,
["Player Unitframe"] = "Окно юнита Игрок",
["Please enter a name for the new profile."] = "Пожалуйста введите имя для нового профиля.",
["Please enter a name for the new profile.\nExisting profiles sharing the same name will be overwritten."] = "Пожалуйста введите имя для нового профиля. Существующие профили, имеющие одно и то же имя, будут перезаписаны.",
@@ -755,6 +761,7 @@ pfUI_translation["ruRU"] = {
["Soulshards"] = "Камни душ",
["Spacing"] = "Расстояние",
["Special Recipient"] = "Конкретный получатель",
["Spell Power Color"] = nil,
["Square"] = "Квадрат",
["Stance Bar 1"] = "Панель 1-ой стойки",
["Stance Bar 2"] = "Панель 2-ой стойки",
@@ -840,6 +847,7 @@ pfUI_translation["ruRU"] = {
["Use Custom Color On Full Health"] = "Использовать пользовательский цвет при полном здоровье",
["Use Custom Color Power Bar Background"] = "Использовать пользовательский цвет фона панели силы",
["Use Custom Font Settings"] = "Использовать пользовательские настройки шрифта",
["Use Custom Spell Power Color (unchecked = biggest school color)"] = nil,
["Use Dynamic Font Size"] = "Использовать динамический размер шрифта",
["Use Item Rarity Color For Loot-Roll Timer"] = "Использовать цвет качества предмета для таймера распределения добычи",
["Use Original Game Fonts"] = "Использовать оригинальные игровые шрифты",
+8
View File
@@ -222,6 +222,7 @@ pfUI_translation["zhCN"] = {
["Display Frame"] = "显示框架",
["Display Mode"] = "显示模式",
["Display Overheal"] = "显示过量治疗",
["Display Spell Power"] = nil,
["Dock"] = "停靠",
["Dodge"] = "聊天框顶部",
["Donate"] = "捐赠",
@@ -235,6 +236,7 @@ pfUI_translation["zhCN"] = {
["Draw Glow Around Target Nameplate"] = "目标姓名板周围显示光晕",
["Druid Mana Bar Height"] = "德鲁伊法力条高度",
["Druid Mana Bar Text"] = "德鲁伊法力条字体",
["Effective Haste (Haste * cast time reduction)"] = nil,
["Elastic Zoom"] = "弹性变焦",
["Elysium Based Core"] = "Elysium 基础核心",
["Enable"] = "启用",
@@ -361,6 +363,9 @@ pfUI_translation["zhCN"] = {
["Gryphons"] = "狮鹫(多个)",
["Guild Online"] = "公会在线",
["Happiness Icon Size"] = "高兴值图标大小",
["Haste (cast speed increase)"] = nil,
["Haste Display"] = nil,
["Haste Display Color"] = nil,
["Heal Color"] = "治疗颜色",
["Health"] = "生命值",
["Health - Auto"] = "动态生命值和百分比",
@@ -578,6 +583,7 @@ pfUI_translation["zhCN"] = {
["Player Buff Bar"] = "玩家Buffs条",
["Player Castbar"] = "玩家施法条",
["Player Debuff Bar"] = "玩家Debuffs条",
["Player SP/Haste Display"] = nil,
["Player Unitframe"] = "玩家单位框架",
["Please enter a name for the new profile."] = "请输入新配置文件的名称",
["Please enter a name for the new profile.\nExisting profiles sharing the same name will be overwritten."] = "请输入新配置文件的名称。\n如果你创建具有相同名称的配置文件将覆盖现有的配置文件。",
@@ -756,6 +762,7 @@ pfUI_translation["zhCN"] = {
["Soulshards"] = "灵魂碎片",
["Spacing"] = "间距",
["Special Recipient"] = "特殊指定角色",
["Spell Power Color"] = nil,
["Square"] = "方块",
["Stance Bar 1"] = "姿态动作条 1",
["Stance Bar 2"] = "姿态动作条 2",
@@ -841,6 +848,7 @@ pfUI_translation["zhCN"] = {
["Use Custom Color On Full Health"] = "在生命值满时使用自定义颜色",
["Use Custom Color Power Bar Background"] = "使用自定义颜色显示能量值背景",
["Use Custom Font Settings"] = "使用自定义字体设置",
["Use Custom Spell Power Color (unchecked = biggest school color)"] = nil,
["Use Dynamic Font Size"] = "使用动态字体大小",
["Use Item Rarity Color For Loot-Roll Timer"] = "为战利品Roll点计时框启用物品稀有颜色",
["Use Original Game Fonts"] = "使用游戏原始字体",
+8
View File
@@ -222,6 +222,7 @@ pfUI_translation["zhTW"] = {
["Display Frame"] = "顯示框架",
["Display Mode"] = nil,
["Display Overheal"] = nil,
["Display Spell Power"] = nil,
["Dock"] = "停靠",
["Dodge"] = "聊天框頂部",
["Donate"] = nil,
@@ -235,6 +236,7 @@ pfUI_translation["zhTW"] = {
["Draw Glow Around Target Nameplate"] = nil,
["Druid Mana Bar Height"] = nil,
["Druid Mana Bar Text"] = nil,
["Effective Haste (Haste * cast time reduction)"] = nil,
["Elastic Zoom"] = nil,
["Elysium Based Core"] = "Elysium Based Core",
["Enable"] = nil,
@@ -361,6 +363,9 @@ pfUI_translation["zhTW"] = {
["Gryphons"] = nil,
["Guild Online"] = "公會線上",
["Happiness Icon Size"] = nil,
["Haste (cast speed increase)"] = nil,
["Haste Display"] = nil,
["Haste Display Color"] = nil,
["Heal Color"] = nil,
["Health"] = nil,
["Health - Auto"] = "動態生命值和百分比",
@@ -578,6 +583,7 @@ pfUI_translation["zhTW"] = {
["Player Buff Bar"] = nil,
["Player Castbar"] = nil,
["Player Debuff Bar"] = nil,
["Player SP/Haste Display"] = nil,
["Player Unitframe"] = nil,
["Please enter a name for the new profile."] = "請輸入新設定檔的名稱",
["Please enter a name for the new profile.\nExisting profiles sharing the same name will be overwritten."] = "請輸入新設定檔的名稱。\n如果你創建具有相同名稱的設定檔將覆蓋現有的設定檔。",
@@ -755,6 +761,7 @@ pfUI_translation["zhTW"] = {
["Soulshards"] = "靈魂碎片",
["Spacing"] = nil,
["Special Recipient"] = "特殊指定角色",
["Spell Power Color"] = nil,
["Square"] = "方形",
["Stance Bar 1"] = nil,
["Stance Bar 2"] = nil,
@@ -840,6 +847,7 @@ pfUI_translation["zhTW"] = {
["Use Custom Color On Full Health"] = nil,
["Use Custom Color Power Bar Background"] = nil,
["Use Custom Font Settings"] = nil,
["Use Custom Spell Power Color (unchecked = biggest school color)"] = nil,
["Use Dynamic Font Size"] = nil,
["Use Item Rarity Color For Loot-Roll Timer"] = "為戰利品Roll點計時框啟用物品稀有顏色",
["Use Original Game Fonts"] = nil,
+3 -3
View File
@@ -80,8 +80,8 @@ pfUI:RegisterModule("castbar", "vanilla", function ()
cb:SetScript("OnUpdate", function()
-- Throttle for performance
if (this.tick or 0) > GetTime() then return end
this.tick = GetTime() + 0.020 -- ~60 FPS for smooth castbar
this.tick = GetTime() + 0.020 -- ~50 FPS for smooth castbar
if this.drag and this.drag:IsShown() then
this:SetAlpha(1)
return
@@ -385,4 +385,4 @@ pfUI:RegisterModule("castbar", "vanilla", function ()
UpdateMovable(pfUI.castbar.focus)
end
end)
end)
+1 -1
View File
@@ -84,7 +84,7 @@ pfUI:RegisterModule("energytick", "vanilla:tbc", function()
if (this.tick or 0) > GetTime() then
return
end
this.tick = GetTime() + 0.020
this.tick = GetTime() + 0.020 -- ~50 FPS
if this.target then
this.start, this.max = GetTime(), this.target
+14 -1
View File
@@ -2264,6 +2264,19 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
CreateConfig(U[c], T["Rage Color"], C.unitframes[c], "ragecolor", "color")
CreateConfig(U[c], T["Energy Color"], C.unitframes[c], "energycolor", "color")
CreateConfig(U[c], T["Focus Color"], C.unitframes[c], "focuscolor", "color")
if c == "player" then
CreateConfig(U[c], T["Player SP/Haste Display"], nil, nil, "header")
CreateConfig(U[c], T["Haste Display"], C.unitframes[c], "display_haste", "dropdown", {
"0:"..T["None"],
"1:"..T["Haste (cast speed increase)"],
"2:"..T["Effective Haste (Haste * cast time reduction)"], -- Only affects mages/warlocks I believe
})
CreateConfig(U[c], T["Haste Display Color"], C.unitframes[c], "display_haste_color", "color")
CreateConfig(U[c], T["Display Spell Power"], C.unitframes[c], "display_spellpower", "checkbox")
CreateConfig(U[c], T["Use Custom Spell Power Color (unchecked = biggest school color)"], C.unitframes[c], "display_sp_color_override", "checkbox")
CreateConfig(U[c], T["Spell Power Color"], C.unitframes[c], "display_sp_color", "color")
end
end)
end
@@ -2839,4 +2852,4 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
end
end)
end
end)
end)
+146 -2
View File
@@ -11,9 +11,153 @@ pfUI:RegisterModule("player", "vanilla:tbc", function ()
pfUI.uf.player:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOM", -75, 125)
UpdateMovable(pfUI.uf.player)
-- infoTopCenterText: used to display haste / spell power above health bar
local playerFrame = pfUI.uf.player
if not playerFrame.infoTopCenterText then
playerFrame.infoTopCenterText = playerFrame.texts:CreateFontString(nil, "OVERLAY")
playerFrame.infoTopCenterText:SetFontObject(GameFontWhite)
local cfg = playerFrame.config
local fontname, fontsize, fontstyle
if cfg.customfont == "1" then
fontname = pfUI.media[cfg.customfont_name]
fontsize = tonumber(cfg.customfont_size)
fontstyle = cfg.customfont_style
else
fontname = pfUI.font_unit
fontsize = tonumber(C.global.font_unit_size)
fontstyle = C.global.font_unit_style
end
playerFrame.infoTopCenterText:SetFont(fontname, fontsize, fontstyle)
playerFrame.infoTopCenterText:SetJustifyH("CENTER")
playerFrame.infoTopCenterText:SetPoint("TOPLEFT", playerFrame.hp.bar, "TOPLEFT", 0, 0)
playerFrame.infoTopCenterText:SetPoint("TOPRIGHT", playerFrame.hp.bar, "TOPRIGHT", 0, 0)
playerFrame.infoTopCenterText:SetHeight(14)
end
local _, myclass = UnitClass("player")
playerFrame.myclass = myclass
playerFrame.isSpellCaster = myclass ~= "WARRIOR" and myclass ~= "ROGUE" and myclass ~= "HUNTER"
-- Compute class-based casting speed modifier and cache on the frame.
-- This is re-evaluated on LEARNED_SPELL_IN_TAB (with 1s delay) so talent changes are handled.
-- Not sure if there are any other effects that give % cast reduction time
local function UpdatePlayerModCastingTime()
playerFrame.modCastingTime = 1
if myclass == "MAGE" then
local _, _, _, _, acceleratedArcana = GetTalentInfo(1, 16)
if acceleratedArcana and acceleratedArcana > 0 then
playerFrame.modCastingTime = 0.95
end
elseif myclass == "WARLOCK" then
local _, _, _, _, rapidDeter = GetTalentInfo(1, 14)
if rapidDeter and rapidDeter > 0 then
playerFrame.modCastingTime = 1 - (rapidDeter * 0.03)
end
end
end
local talentFrame = CreateFrame("Frame")
talentFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
talentFrame:RegisterEvent("LEARNED_SPELL_IN_TAB")
talentFrame:SetScript("OnEvent", function()
-- Delay 1s for both PLAYER_ENTERING_WORLD and LEARNED_SPELL_IN_TAB
local checkAt = GetTime() + 1
talentFrame:SetScript("OnUpdate", function()
if GetTime() >= checkAt then
talentFrame:SetScript("OnUpdate", nil)
UpdatePlayerModCastingTime()
end
end)
end)
-- Convert "r,g,b,a" config color string to a 6-char hex string, or nil if unset
local function cfgColorToHex(colorStr)
if not colorStr or colorStr == "" then return nil end
local r, g, b = strsplit(",", colorStr)
r, g, b = tonumber(r), tonumber(g), tonumber(b)
if not r or not g or not b then return nil end
return string.format("%02X%02X%02X", r * 255, g * 255, b * 255)
end
-- SP school colors indexed by GetSpellPower("net") return order
-- (1=phys, 2=holy, 3=fire, 4=nature, 5=frost, 6=shadow, 7=arcane)
local spColors = { "FFFFFF", "FFFF80", "FF8000", "4DFF4D", "80FFFF", "9482C9", "FFFFFF" }
-- Default SP school per class used as tiebreaker when multiple schools are equal
local spDefaultSchool = {
PALADIN = 2, PRIEST = 2,
SHAMAN = 4, DRUID = 4,
MAGE = 7, WARLOCK = 6,
}
-- Compute and cache the haste/SP text; called from OnUpdate, throttled to 0.25s
local function UpdateInfoText()
local cfg = playerFrame.config
if not cfg then
return
end
local hasteMode = cfg.display_haste -- "0"=none, "1"=modCastSpeed, "2"=modCastSpeed*modCastingTime
local showSP = cfg.display_spellpower == "1"
local isSpellCaster = playerFrame.isSpellCaster
if (hasteMode == "0" or not isSpellCaster) and not showSP then
playerFrame.infoTopCenterText:SetText("")
return
end
local haste = GetUnitField("player", "modCastSpeed")
local modCastingTime = playerFrame.modCastingTime or 1
local text = ""
if isSpellCaster and haste then
local hasteHex = cfgColorToHex(cfg.display_haste_color) or "FFFFFF"
if hasteMode == "1" then
text = string.format("|cff%s%.1f%%|r", hasteHex, (1 / haste - 1) * 100)
elseif hasteMode == "2" then
text = string.format("|cff%s%.1f%%|r", hasteHex, (1 / (haste * modCastingTime) - 1) * 100)
end
end
if showSP and isSpellCaster then
local schools = { GetSpellPower("net") }
local defSchool = spDefaultSchool[myclass] or 2
local maxSP = schools[defSchool] or 0
local maxColor = spColors[defSchool]
for i = 2, 7 do -- skip physical (1)
local v = schools[i] or 0
if v > maxSP then
maxSP = v
maxColor = spColors[i]
end
end
if maxSP > 0 then
local spHex = (cfg.display_sp_color_override == "1" and cfgColorToHex(cfg.display_sp_color)) or maxColor
if text ~= "" then text = text .. " " end
text = text .. string.format("|cff%s+%d SP|r", spHex, maxSP)
end
end
playerFrame.infoTopCenterText:SetText(text)
end
function playerFrame:UpdateConfig()
UpdateInfoText()
end
-- Add throttle to player frame OnUpdate
if pfUI.uf.player:GetScript("OnUpdate") then
pfUI.uf.player:SetScript("OnUpdate", pfUI.uf.player:GetScript("OnUpdate"))
local originalOnUpdate = pfUI.uf.player:GetScript("OnUpdate")
pfUI.uf.player:SetScript("OnUpdate", function()
if (this.throttleTick or 0) > GetTime() then
return
end
this.throttleTick = GetTime() + 0.05 -- Default: 20 FPS
originalOnUpdate()
if (this.infoTextTick or 0) <= GetTime() then
this.infoTextTick = GetTime() + 0.25 -- Don't need to update haste/SP text as often
UpdateInfoText()
end
end)
end
-- Replace default's RESET_INSTANCES button with an always working one
@@ -30,4 +174,4 @@ pfUI:RegisterModule("player", "vanilla:tbc", function ()
StaticPopup_Show("CONFIRM_RESET_INSTANCES")
end
end)
end)
end)