performance update

performance update
This commit is contained in:
Meow
2026-01-03 12:58:31 +01:00
parent b2f6df84a9
commit 5d0e195d1e
116 changed files with 3980 additions and 4105 deletions
-2
View File
@@ -1,2 +0,0 @@
github: [shagu]
ko_fi: shagu
-24
View File
@@ -1,24 +0,0 @@
name: Close inactive issues
on:
workflow_dispatch:
schedule:
- cron: "30 1 * * *"
jobs:
close-issues:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v5
with:
operations-per-run: 100
days-before-issue-stale: 30
days-before-issue-close: 14
stale-issue-label: "stale"
stale-issue-message: "This issue is stale because it has been open for 30 days with no activity."
close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale."
days-before-pr-stale: -1
days-before-pr-close: -1
repo-token: ${{ secrets.GITHUB_TOKEN }}
+119 -94
View File
@@ -1,121 +1,146 @@
# pfUI
pfUI performance updates, use on own risk.
An AddOn for World of Warcraft: Vanilla (1.12.1) and The Burning Crusade (2.4.3), which aims to be a full replacement for the original interface. The design is inspired by several screenshots I've seen from TukUI, ElvUI and others. This addon delivers modern features and a minimalistic style that's easy to use right from the start. It is entirely written from scratch without any inclusion of third-party addons or libraries.
## DLL Integrations
This is **not** an addon-pack like [ShaguUI](http://shagu.org/ShaguUI/), however, there is support for external addons like MobHealth3, DPSMate and others, but they will never be shipped within the package.
pfUI includes optional integration modules for client DLLs that provide enhanced functionality beyond what the standard WoW 1.12 client supports. These features are only enabled when the corresponding DLL is installed.
**Please do not re-upload or distribute outdated versions of this project. However, you are more than welcome to fork or link to the official github page.**
---
## Screenshots
### SuperWoW
<img src="https://raw.githubusercontent.com/shagu/ShaguAddons/master/_img/pfUI/config.jpg" align="right" width="48.5%">
<img src="https://raw.githubusercontent.com/shagu/ShaguAddons/master/_img/pfUI/unlock.jpg" width="48.5%">
<img src="https://raw.githubusercontent.com/shagu/ShaguAddons/master/_img/pfUI/contrib.jpg" align="right" width="48.5%">
<img src="https://raw.githubusercontent.com/shagu/ShaguAddons/master/_img/pfUI/maraudon.jpg" width="48.5%">
**Repository:** https://github.com/balakethelock/SuperWoW
## Installation (Vanilla)
1. Download **[Latest Version](https://github.com/shagu/pfUI/archive/master.zip)**
2. Unpack the Zip file
3. Rename the folder "pfUI-master" to "pfUI"
4. Copy "pfUI" into Wow-Directory\Interface\AddOns
5. Restart Wow
SuperWoW provides GUID-based unit tracking, spell information APIs, and various client enhancements.
## Installation (The Burning Crusade)
1. Download **[Latest Version](https://github.com/shagu/pfUI/archive/master.zip)**
2. Unpack the Zip file
3. Rename the folder "pfUI-master" to "pfUI-tbc"
4. Copy "pfUI-tbc" into Wow-Directory\Interface\AddOns
5. Restart Wow
#### Features
## Commands
- **GUID-Based Focus Frame** - Focus frame uses actual unit GUIDs instead of name-based emulation
- **Native Mouseover Casting** - `/pfcast` supports true mouseover targeting via `CastSpellByName(spell, unit)`
- **Druid Mana Bar** - Shows mana while in feral forms (requires `unitframes.druidmanabar` config)
- **Enhanced Cast Bars** - Uses `UNIT_CASTEVENT` for accurate cast/channel tracking with spell IDs
- **Enhanced Debuff Tracking** - Accurate debuff application via `UNIT_CASTEVENT` with caster info
- **Group Minimap Tracking** - Track party/raid members on minimap via `TrackUnit()` API
- **Raid Marker Targeting** - Target units by raid marker (`mark1` to `mark8`)
- **Clickthrough Mode** - Click through corpses to loot underneath (`/clickthrough` or `/ct`)
- **Config Import/Export** - Save and load pfUI configs via `/pfexport` and `/pfimport`
- **Local Raid Markers** - Set raid markers visible only to yourself
- **Enchanting Link Fixes** - Converts enchant links for compatibility with non-SuperWoW clients
/pfui Open the configuration GUI
/share Open the configuration import/export dialog
/gm Open the ticket Dialog
/rl Reload the whole UI
/farm Toggles the Farm-Mode
/pfcast Same as /cast but for mouseover units
/focus Creates a Focus-Frame for the current target
/castfocus Same as /cast but for focus frame
/clearfocus Clears the Focus-Frame
/swapfocus Toggle Focus and Target-Frame
/pftest Toggle pfUI Unitframe Test Mode
/abp Addon Button Panel
#### API Functions
## Languages
pfUI supports and contains language specific code for the following gameclients.
* English (enUS)
* Korean (koKR)
* French (frFR)
* German (deDE)
* Chinese (zhCN)
* Spanish (esES)
* Russian (ruRU)
| Function | Description |
|----------|-------------|
| `pfUI.api.GetMarkedUnit(index)` | Get unit ID for raid marker 1-8 |
| `pfUI.api.TargetMark(index)` | Target unit with raid marker |
| `pfUI.api.GetUnitOwner(unit)` | Get owner of pet/totem |
| `pfUI.api.GetSpellInfo(spellId)` | Get spell name, rank, texture, range |
| `pfUI.api.SetClickthrough(enabled)` | Enable/disable clickthrough |
| `pfUI.api.ToggleClickthrough()` | Toggle clickthrough mode |
| `pfUI.api.SetAutoloot(enabled)` | Enable/disable autoloot |
| `pfUI.api.ExportConfig(filename)` | Export config to file |
| `pfUI.api.ImportConfig(filename)` | Import config from file |
| `pfUI.api.GetPlayerBuffSpellId(index)` | Get spell ID for player buff |
| `pfUI.api.LogToCombatLog(text)` | Add text to combat log |
| `pfUI.api.SetLocalRaidTarget(unit, index)` | Set local-only raid marker |
| `pfUI.api.GetItemCharges(bag, slot)` | Get item charges (returns positive) |
| `pfUI.api.GetUnitWeaponEnchants(unit)` | Get weapon enchant info |
## Recommended Addons
* [pfQuest](https://shagu.org/pfQuest) A simple database and quest helper
* [WIM](http://addons.us.to/addon/wim), [WIM (continued)](https://github.com/shirsig/WIM) Give whispers an instant messenger feel
---
## Plugins
* [pfUI-eliteoverlay](https://shagu.org/pfUI-eliteoverlay) Add elite dragons to unitframes
* [pfUI-fonts](https://shagu.org/pfUI-fonts) Additional fonts for pfUI
* [pfUI-CustomMedia](https://github.com/mrrosh/pfUI-CustomMedia) Additional textures for pfUI
* [pfUI-Gryphons](https://github.com/mrrosh/pfUI-Gryphons) Add back the gryphons to your actionbars
### Nampower
## FAQ
**What does "pfUI" stand for?**
The term "*pfui!*" is german and simply stands for "*pooh!*", because I'm not a
big fan of creating configuration UI's, especially not via the Wow-API
(you might have noticed that in ShaguUI).
**Repository:** https://gitea.com/avitasia/nampower
**How can I donate?**
You can donate via [GitHub](https://github.com/sponsors/shagu) or [Ko-fi](https://ko-fi.com/shagu)
Nampower provides spell queuing, precise cooldown tracking, and detailed aura/buff information.
**How do I report a Bug?**
Please provide as much information as possible in the [Bugtracker](https://github.com/shagu/pfUI/issues).
If there is an error message, provide the full content of it. Just telling that "there is an error" won't help any of us.
Please consider adding additional information such as: since when did you got the error,
does it still happen using a clean configuration, what other addons are loaded and which version you're running.
When playing with a non-english client, the language might be relevant too. If possible, explain how people can reproduce the issue.
#### Features
**How can I contribute?**
Report errors and issues in the [Bugtracker](https://github.com/shagu/pfUI/issues).
Please make sure to have the latest version installed and check for conflicting addons beforehand.
- **Spell Queue Indicator** - Shows queued spell icon near castbar (requires `unitframes.spellqueue` config)
- **Reactive Spell Indicator** - Highlights when Overpower, Revenge, Execute, Riposte, etc. are usable (requires `unitframes.reactive_indicator`)
- **Enhanced Debuff Tracking** - GUID-based debuff tracking via `DEBUFF_ADDED/REMOVED` events
- **Enhanced Buff Tracking** - GUID-based buff tracking via `BUFF_ADDED/REMOVED` events (requires `unitframes.nampower_buffs`)
- **Swing Timer** - Track main-hand and off-hand auto-attack timers
- **Disenchant All** - `/disenchantall` or `/dea` to disenchant eligible items
**I have bad performance, what can I do?**
There's only one known performance issue: that is while using "Frame Shadows". Make sure to disable those
in the pfUI settings (Settings -> Appearance -> Enable Frame Shadows). If you still have a low performance,
it's most likely a combination with another addon. Disable all AddOns but pfUI and then enable one-by-one,
till the performance problem occurs again. Make sure to report the identified AddOn and what you did to reproduce
via the [Bugtracker](https://github.com/shagu/pfUI/issues).
#### API Functions
**Where is the happiness indicator for pets?**
The pet happiness is shown as the color of your pet's frame. Depending on your skin, this can either be the text or the background color of your pet's healthbar:
| Function | Description |
|----------|-------------|
| `pfUI.api.GetUnitAuras(unit)` | Get all buffs/debuffs with spell IDs via `GetUnitField` |
| `pfUI.api.UnitHasAura(unit, spellId)` | Check if unit has specific aura |
| `pfUI.api.GetUnitResistances(unit)` | Get unit's resistances (armor, fire, frost, etc.) |
| `pfUI.api.GetPreciseCooldown(spellId)` | Get precise cooldown info (remaining ms, GCD state) |
| `pfUI.api.GetPreciseItemCooldown(itemId)` | Get precise item cooldown |
| `pfUI.api.GetEquippedTrinkets()` | Get equipped trinket info |
| `pfUI.api.GetTrinketCooldown(slot)` | Get trinket cooldown |
| `pfUI.api.UseTrinket(slot, target)` | Use trinket |
| `pfUI.api.GetNampowerItemStats(itemId)` | Get item stats |
| `pfUI.api.GetNampowerItemLevel(itemId)` | Get item level |
| `pfUI.api.GetSpellBonus(spellId, modType)` | Get spell modifiers (damage, crit, cost) |
| `pfUI.api.GetSpellDamageBonus(spellId)` | Get spell damage bonus |
| `pfUI.api.GetSpellCritBonus(spellId)` | Get spell crit bonus |
| `pfUI.api.GetSpellCostReduction(spellId)` | Get spell cost reduction |
| `pfUI.api.GetAllBagItems()` | Get all bag items |
| `pfUI.api.FindItem(itemIdOrName)` | Find item in bags |
| `pfUI.api.UseItem(itemIdOrName, target)` | Use item |
| `pfUI.api.GetPlayerEquipment()` | Get player's equipped items |
| `pfUI.api.GetTargetEquipment()` | Get target's equipped items |
| `pfUI.api.GetMaxRankSpellId(spellName)` | Get spell ID for max rank |
| `pfUI.api.GetSpellSlotInfo(spellName)` | Get spell slot/book info |
| `pfUI.api.QueueLuaScript(script, priority)` | Queue Lua script for execution |
| `pfUI.api.QueueSpell(spellName)` | Queue spell by name |
| `pfUI.api.StopChannelNextTick()` | Stop channeling next tick |
| `pfUI.api.GetSpellRecord(spellId)` | Get full spell database record |
| `pfUI.api.GetSpellSchool(spellId)` | Get spell school (Fire, Frost, etc.) |
| `pfUI.api.GetSwingTimers()` | Get auto-attack swing timers |
| `pfUI.api.libdebuff_nampower(unit, id)` | Enhanced UnitDebuff with Nampower data |
- Green = Happy
- Yellow = Content
- Red = Unhappy
---
Since version 4.0.7 there is also an additional icon that can be enabled from the pet unit frame options.
### UnitXP_SP3
**Can I use Clique with pfUI?**
This addon already includes support for clickcasting. If you still want to make use of clique, all pfUI's unitframes are already compatible to Clique-TBC. For Vanilla, a pfUI compatible version can be found [Here](https://github.com/shagu/Clique/archive/master.zip). If you want to keep your current version of Clique, you'll have to apply this [Patch](https://github.com/shagu/Clique/commit/a5ee56c3f803afbdda07bae9cd330e0d4a75d75a).
**Repository:** https://github.com/allfoxwy/UnitXP_SP3
**Where is the Experience Bar?**
The experience bar shows up on mouseover and whenever you gain experience, next to left chatframe by default. There's also an option to make it stay visible all the time.
UnitXP provides line-of-sight checks, positional information, precise distances, and OS-level notifications.
**How do I show the Damage- and Threatmeter Dock?**
If you enabled the "dock"-feature for your external (third-party) meters such as DPSMate or KTM, then you'll be able to toggle between them and the Right Chat by clicking on the ">" symbol on the bottom-right panel.
#### Features
**Why is my chat always resetting to only 3 lines of text?**
This happens if "Simple Chat" is enabled in blizzards interface settings (Advanced Options).
Paste the following command into your chat to disable that option: `/run SIMPLE_CHAT="0"; pfUI.chat.SetupPositions(); ReloadUI()`
- **Line of Sight Indicator** - Shows "NO LOS" text on target frame when target is obstructed (requires `unitframes.los_indicator`)
- **Behind Indicator** - Shows "BEHIND" text on target frame when positioned behind target (requires `unitframes.behind_indicator`)
- **OS Notifications** - Flashes taskbar and plays system sound on whispers, ready checks, BG queue pops (requires `unitframes.unitxp_notify`)
- **Precise Distance** - Exact yard distance between units
- **Smart Targeting** - Target nearest enemy, highest HP, cycle through enemies
**How can I enable mouseover cast?**
On Vanilla, create a macro with "/pfcast SPELLNAME". If you also want to see the cooldown, You might want to add "/run if nil then CastSpellByName("SPELLNAME") end" on top of the macro. For The Burning Crusade, just use the regular mouseover macros.
#### API Functions
**Will there be pfUI for Activision's "Classic" remakes?**
No, it would require an entire rewrite of the AddOn since the game is now a different one. The AddOn-API has evolved during the last 15 years and the new "Classic" versions are based on a current retail gameclient. I don't plan to play any of those new versions, so I won't be porting any of my addons to it.
| Function | Description |
|----------|-------------|
| `pfUI.api.GetPreciseDistance(unit1, unit2)` | Get exact distance in yards |
| `pfUI.api.IsInMeleeRange(unit)` | Check if unit is in melee range |
| `pfUI.api.GetAoEDistance(unit1, unit2)` | Get distance for AoE calculations |
| `pfUI.api.TargetNearestEnemy()` | Target nearest hostile unit |
| `pfUI.api.TargetHighestHP()` | Target enemy with most HP |
| `pfUI.api.TargetNextEnemy()` | Cycle to next enemy |
| `pfUI.api.TargetPreviousEnemy()` | Cycle to previous enemy |
| `pfUI.api.TargetNextMarked(order)` | Target next marked enemy in order |
| `pfUI.api.UnitInLineOfSight(unit1, unit2)` | Check line of sight between units |
| `pfUI.api.UnitIsBehind(unit1, unit2)` | Check if unit1 is behind unit2 |
**Everything from scratch?! Are you insane?**
Most probably, yes.
---
### Configuration Options
These DLL features can be enabled/disabled via `/pfui` settings under Unit Frames:
| Setting | DLL | Description |
|---------|-----|-------------|
| `unitframes.druidmanabar` | SuperWoW | Show mana bar while shapeshifted |
| `unitframes.track_group` | SuperWoW | Track group members on minimap |
| `unitframes.spellqueue` | Nampower | Show spell queue indicator |
| `unitframes.spellqueuesize` | Nampower | Spell queue icon size |
| `unitframes.reactive_indicator` | Nampower | Show reactive ability procs |
| `unitframes.reactive_size` | Nampower | Reactive indicator icon size |
| `unitframes.nampower_buffs` | Nampower | Enhanced buff tracking |
| `unitframes.los_indicator` | UnitXP | Show line of sight indicator |
| `unitframes.behind_indicator` | UnitXP | Show behind indicator |
| `unitframes.unitxp_notify` | UnitXP | Enable OS notifications |
+76
View File
@@ -7,6 +7,82 @@ setfenv(1, pfUI:GetEnvironment())
gfind = string.gmatch or string.gfind
mod = math.mod or mod
-- [ DLL Detection Helpers ]
-- Detects presence of various DLL extensions for enhanced functionality
-- [ HasSuperWoW ]
-- Returns true if SuperWoW DLL is active
-- SuperWoW provides: UNIT_CASTEVENT, UnitPosition, SetMouseoverUnit, SpellInfo, etc.
function pfUI.api.HasSuperWoW()
return SUPERWOW_VERSION or (SetAutoloot and SpellInfo)
end
-- [ HasUnitXP ]
-- Returns true if UnitXP_SP3 DLL is active
-- UnitXP provides: distance, line of sight, behind detection, targeting helpers
function pfUI.api.HasUnitXP()
local success = pcall(UnitXP, "nop", "nop")
return success
end
-- [ HasNampower ]
-- Returns true if Nampower DLL is active
-- Nampower provides: spell queuing, GetCastInfo, GetSpellIdCooldown, IsSpellInRange, etc.
function pfUI.api.HasNampower()
return GetNampowerVersion and true or false
end
-- [ GetUnitDistance ]
-- Returns distance to unit using best available method
-- 'unit1' [string] first unit (default: "player")
-- 'unit2' [string] second unit
-- returns: [number] distance in yards, or nil if unavailable
function pfUI.api.GetUnitDistance(unit1, unit2)
if not unit2 then
unit2 = unit1
unit1 = "player"
end
if not UnitExists(unit2) then return nil end
-- Try UnitXP first (most accurate)
if pfUI.api.HasUnitXP() then
local success, distance = pcall(UnitXP, "distanceBetween", unit1, unit2)
if success and distance then return distance end
end
-- Try SuperWoW UnitPosition
if pfUI.api.HasSuperWoW() and UnitPosition then
local x1, y1, z1 = UnitPosition(unit1)
local x2, y2, z2 = UnitPosition(unit2)
if x1 and y1 and z1 and x2 and y2 and z2 then
return ((x2 - x1)^2 + (y2 - y1)^2 + (z2 - z1)^2)^0.5
end
end
return nil
end
-- [ UnitInLineOfSight ]
-- Returns true if unit1 has line of sight to unit2
-- Requires UnitXP_SP3
function pfUI.api.UnitInLineOfSight(unit1, unit2)
if not pfUI.api.HasUnitXP() then return nil end
local success, inSight = pcall(UnitXP, "inSight", unit1, unit2)
if success then return inSight end
return nil
end
-- [ UnitIsBehind ]
-- Returns true if unit1 is behind unit2
-- Requires UnitXP_SP3
function pfUI.api.UnitIsBehind(unit1, unit2)
if not pfUI.api.HasUnitXP() then return nil end
local success, behind = pcall(UnitXP, "behind", unit1, unit2)
if success then return behind end
return nil
end
-- [ strsplit ]
-- Splits a string using a delimiter.
-- 'delimiter' [string] characters that will be interpreted as delimiter
+13
View File
@@ -221,6 +221,18 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("unitframes", nil, "druidmanabar", "1")
pfUI:UpdateConfig("unitframes", nil, "druidmanaheight", "2")
pfUI:UpdateConfig("unitframes", nil, "druidmanatext", "0")
pfUI:UpdateConfig("unitframes", nil, "spellqueue", "1")
pfUI:UpdateConfig("unitframes", nil, "spellqueuesize", "24")
pfUI:UpdateConfig("unitframes", nil, "gcd_indicator", "0")
pfUI:UpdateConfig("unitframes", nil, "gcd_size", "4")
pfUI:UpdateConfig("unitframes", nil, "nampower_buffs", "1")
pfUI:UpdateConfig("unitframes", nil, "reactive_indicator", "0")
pfUI:UpdateConfig("unitframes", nil, "reactive_size", "28")
pfUI:UpdateConfig("unitframes", nil, "damage_tracking", "0")
pfUI:UpdateConfig("unitframes", nil, "los_indicator", "0")
pfUI:UpdateConfig("unitframes", nil, "behind_indicator", "0")
pfUI:UpdateConfig("unitframes", nil, "unitxp_notify", "0")
pfUI:UpdateConfig("unitframes", nil, "track_group", "0")
pfUI:UpdateConfig("unitframes", nil, "rangechecki", "4")
pfUI:UpdateConfig("unitframes", nil, "combowidth", "6")
pfUI:UpdateConfig("unitframes", nil, "comboheight", "6")
@@ -713,6 +725,7 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("chat", "text", "playerlinks", "1")
pfUI:UpdateConfig("chat", "text", "detecturl", "1")
pfUI:UpdateConfig("chat", "text", "classcolor", "1")
pfUI:UpdateConfig("chat", "text", "playerlevel", "1")
pfUI:UpdateConfig("chat", "text", "whosearchunknown", "0")
pfUI:UpdateConfig("chat", "left", "width", "380")
pfUI:UpdateConfig("chat", "left", "height", "180")
+145 -82
View File
@@ -14,6 +14,79 @@ end)
pfUI.uf.frames = {}
pfUI.uf.delayed = {}
-- =====================================================
-- ZENTRALER EVENT-HANDLER für Raid/Party Performance
-- =====================================================
pfUI.uf.unitmap = {} -- Maps "raid1" -> frame, "party2" -> frame, etc.
pfUI.uf.RebuildUnitmap = function()
-- Clear old mappings
for k in pairs(pfUI.uf.unitmap) do
pfUI.uf.unitmap[k] = nil
end
-- Rebuild raid mappings
if pfUI.uf.raid then
for i = 1, 40 do
local frame = pfUI.uf.raid[i]
if frame and frame.id and frame.id ~= 0 then
pfUI.uf.unitmap["raid" .. frame.id] = frame
end
end
end
-- Rebuild party mappings
for i = 1, 4 do
local frame = _G["pfGroup" .. i]
if frame and frame.label == "party" then
pfUI.uf.unitmap["party" .. frame.id] = frame
end
end
end
pfUI.uf.eventframe = CreateFrame("Frame")
pfUI.uf.eventframe:RegisterEvent("UNIT_HEALTH")
pfUI.uf.eventframe:RegisterEvent("UNIT_MAXHEALTH")
pfUI.uf.eventframe:RegisterEvent("UNIT_MANA")
pfUI.uf.eventframe:RegisterEvent("UNIT_MAXMANA")
pfUI.uf.eventframe:RegisterEvent("UNIT_RAGE")
pfUI.uf.eventframe:RegisterEvent("UNIT_MAXRAGE")
pfUI.uf.eventframe:RegisterEvent("UNIT_ENERGY")
pfUI.uf.eventframe:RegisterEvent("UNIT_MAXENERGY")
pfUI.uf.eventframe:RegisterEvent("UNIT_AURA")
pfUI.uf.eventframe:RegisterEvent("UNIT_PORTRAIT_UPDATE")
pfUI.uf.eventframe:RegisterEvent("UNIT_MODEL_CHANGED")
pfUI.uf.eventframe:RegisterEvent("UNIT_DISPLAYPOWER")
pfUI.uf.eventframe:RegisterEvent("UNIT_FACTION")
pfUI.uf.eventframe:RegisterEvent("RAID_ROSTER_UPDATE")
pfUI.uf.eventframe:RegisterEvent("PARTY_MEMBERS_CHANGED")
pfUI.uf.eventframe:SetScript("OnEvent", function()
-- Unitmap neu aufbauen bei Roster-Änderungen
if event == "RAID_ROSTER_UPDATE" or event == "PARTY_MEMBERS_CHANGED" then
pfUI.uf.RebuildUnitmap()
return
end
if not arg1 then return end
-- Direkt den richtigen Frame finden
local frame = pfUI.uf.unitmap[arg1]
if not frame then return end
-- Event verarbeiten (gleiche Logik wie vorher)
if event == "UNIT_PORTRAIT_UPDATE" or event == "UNIT_MODEL_CHANGED" then
frame.update_portrait = true
elseif event == "UNIT_AURA" then
frame.update_aura = true
elseif event == "UNIT_FACTION" then
frame.update_pvp = true
else
frame.update_full = true
end
end)
-- =====================================================
-- slash command to toggle unitframe test mode
_G.SLASH_PFTEST1, _G.SLASH_PFTEST2 = "/pftest", "/pfuftest"
_G.SlashCmdList.PFTEST = function()
@@ -51,6 +124,9 @@ local function BuffOnUpdate()
end
local function TargetBuffOnUpdate()
-- throttle to 0.1s
if ( this.tick or .1) > GetTime() then return else this.tick = GetTime() + .1 end
local name, rank, icon, count, duration, timeleft = _G.UnitBuff("target", this.id)
if duration and timeleft then
CooldownFrame_SetTimer(this.cd, GetTime() + timeleft - duration, duration, 1)
@@ -344,21 +420,7 @@ function pfUI.uf:UpdateVisibility()
self.visible = nil
end
-- tbc visibility
if pfUI.client > 11200 then
self:SetAttribute("unit", unitstr)
-- update visibility condition on change
if self.visibilitycondition ~= visibility then
RegisterStateDriver(self, 'visibility', visibility)
self.visibilitycondition = visibility
self.visible = true
end
return
end
-- vanilla visibility
-- visibility
if self.unitname and self.unitname ~= "focus" and self.unitname ~= "focustarget" then
self:Show()
elseif visibility == "hide" then
@@ -790,8 +852,6 @@ function pfUI.uf:UpdateConfig()
if f:GetName() == "pfPlayer" then
f.buffs[i]:SetScript("OnUpdate", BuffOnUpdate)
elseif f:GetName() == "pfTarget" and pfUI.expansion == "tbc" then
f.buffs[i]:SetScript("OnUpdate", TargetBuffOnUpdate)
end
f.buffs[i]:SetScript("OnEnter", BuffOnEnter)
@@ -921,6 +981,13 @@ function pfUI.uf.OnUpdate()
-- update combat feedback
if this.feedbackText then CombatFeedback_OnUpdate(arg1) end
-- Throttle for raid/party frames: only process updates every 0.1s
-- This reduces OnUpdate calls from 5760/sec (40 frames * 144fps) to ~400/sec
if this.label == "raid" or this.label == "party" then
if (this.tick or 0) > GetTime() then return end
this.tick = GetTime() + 0.1
end
-- process indicator update events
if this.update_indicators then
pfUI.uf:RefreshIndicators(this)
@@ -1126,6 +1193,18 @@ end
function pfUI.uf.OnEnter()
if not this.label then return end
-- SuperWoW: Set native mouseover unit for macro/addon compatibility
if SetMouseoverUnit then
local unitstr = this.label .. this.id
-- For GUID-based frames (focus), use the GUID directly
if this.label and string.find(this.label, "^0x") then
SetMouseoverUnit(this.label)
elseif UnitExists(unitstr) then
SetMouseoverUnit(unitstr)
end
end
if this.config.showtooltip == "0" then return end
GameTooltip_SetDefaultAnchor(GameTooltip, this)
GameTooltip:SetUnit(this.label .. this.id)
@@ -1133,6 +1212,11 @@ function pfUI.uf.OnEnter()
end
function pfUI.uf.OnLeave()
-- SuperWoW: Clear native mouseover unit
if SetMouseoverUnit then
SetMouseoverUnit()
end
GameTooltip:FadeOut()
end
@@ -1164,33 +1248,49 @@ end
function pfUI.uf:EnableEvents()
local f = self
local unitstr = f.label .. f.id
f:RegisterEvent("PLAYER_ENTERING_WORLD")
f:RegisterEvent("UNIT_DISPLAYPOWER")
f:RegisterEvent("UNIT_HEALTH")
f:RegisterEvent("UNIT_MAXHEALTH")
f:RegisterEvent("UNIT_MANA")
f:RegisterEvent("UNIT_MAXMANA")
f:RegisterEvent("UNIT_RAGE")
f:RegisterEvent("UNIT_MAXRAGE")
f:RegisterEvent("UNIT_ENERGY")
f:RegisterEvent("UNIT_MAXENERGY")
f:RegisterEvent("UNIT_FOCUS")
f:RegisterEvent("UNIT_PORTRAIT_UPDATE")
f:RegisterEvent("UNIT_MODEL_CHANGED")
f:RegisterEvent("UNIT_FACTION")
f:RegisterEvent("UNIT_AURA") -- frame=buff, frame=debuff
f:RegisterEvent("PLAYER_AURAS_CHANGED") -- label=player && frame=buff
f:RegisterEvent("UNIT_INVENTORY_CHANGED") -- label=player && frame=buff
f:RegisterEvent("PARTY_MEMBERS_CHANGED") -- label=party, frame=leaderIcon
f:RegisterEvent("PARTY_LEADER_CHANGED") -- frame=leaderIcon
f:RegisterEvent("RAID_ROSTER_UPDATE") -- label=raidIcon
f:RegisterEvent("PLAYER_UPDATE_RESTING") -- label=restIcon
f:RegisterEvent("PLAYER_TARGET_CHANGED") -- label=target
f:RegisterEvent("PARTY_LOOT_METHOD_CHANGED") -- frame=lootIcon
f:RegisterEvent("RAID_TARGET_UPDATE") -- frame=raidIcon
f:RegisterEvent("UNIT_PET")
f:RegisterEvent("UNIT_HAPPINESS")
-- Raid/Party Frames: Registriere im zentralen Handler statt selbst
if f.label == "raid" or f.label == "party" then
-- Nur nicht-UNIT_* Events selbst registrieren
f:RegisterEvent("PLAYER_ENTERING_WORLD")
f:RegisterEvent("PARTY_MEMBERS_CHANGED")
f:RegisterEvent("PARTY_LEADER_CHANGED")
f:RegisterEvent("RAID_ROSTER_UPDATE")
f:RegisterEvent("PARTY_LOOT_METHOD_CHANGED")
f:RegisterEvent("RAID_TARGET_UPDATE")
-- Unitmap aktualisieren
pfUI.uf.RebuildUnitmap()
else
-- Alle anderen Frames: Normale Event-Registrierung
f:RegisterEvent("PLAYER_ENTERING_WORLD")
f:RegisterEvent("UNIT_DISPLAYPOWER")
f:RegisterEvent("UNIT_HEALTH")
f:RegisterEvent("UNIT_MAXHEALTH")
f:RegisterEvent("UNIT_MANA")
f:RegisterEvent("UNIT_MAXMANA")
f:RegisterEvent("UNIT_RAGE")
f:RegisterEvent("UNIT_MAXRAGE")
f:RegisterEvent("UNIT_ENERGY")
f:RegisterEvent("UNIT_MAXENERGY")
f:RegisterEvent("UNIT_FOCUS")
f:RegisterEvent("UNIT_PORTRAIT_UPDATE")
f:RegisterEvent("UNIT_MODEL_CHANGED")
f:RegisterEvent("UNIT_FACTION")
f:RegisterEvent("UNIT_AURA")
f:RegisterEvent("PLAYER_AURAS_CHANGED")
f:RegisterEvent("UNIT_INVENTORY_CHANGED")
f:RegisterEvent("PARTY_MEMBERS_CHANGED")
f:RegisterEvent("PARTY_LEADER_CHANGED")
f:RegisterEvent("RAID_ROSTER_UPDATE")
f:RegisterEvent("PLAYER_UPDATE_RESTING")
f:RegisterEvent("PLAYER_TARGET_CHANGED")
f:RegisterEvent("PARTY_LOOT_METHOD_CHANGED")
f:RegisterEvent("RAID_TARGET_UPDATE")
f:RegisterEvent("UNIT_PET")
f:RegisterEvent("UNIT_HAPPINESS")
end
f:RegisterForClicks('LeftButtonUp', 'RightButtonUp',
'MiddleButtonUp', 'Button4Up', 'Button5Up')
@@ -2040,33 +2140,8 @@ function pfUI.uf:EnableClickCast()
local bconf = bid == 1 and "" or bid
if pfUI_config.unitframes["clickcast"..bconf..mconf] ~= "" then
-- prepare click casting
if pfUI.client > 11200 then
-- set attributes for tbc+
local prefix = modifier == "" and "" or modifier .. "-"
-- check for "/" in the beginning of the string, to detect macros
if string.find(pfUI_config.unitframes["clickcast"..bconf..mconf], "^%/(.+)") then
self:SetAttribute(prefix.."type"..bid, "macro")
self:SetAttribute(prefix.."macrotext"..bid, pfUI_config.unitframes["clickcast"..bconf..mconf])
self:SetAttribute(prefix.."spell"..bid, nil)
elseif string.find(pfUI_config.unitframes["clickcast"..bconf..mconf], "^target") then
self:SetAttribute(prefix.."type"..bid, "target")
self:SetAttribute(prefix.."macrotext"..bid, nil)
self:SetAttribute(prefix.."spell"..bid, nil)
elseif string.find(pfUI_config.unitframes["clickcast"..bconf..mconf], "^menu") then
self:SetAttribute(prefix.."type"..bid, "showmenu")
self:SetAttribute(prefix.."macrotext"..bid, nil)
self:SetAttribute(prefix.."spell"..bid, nil)
else
self:SetAttribute(prefix.."type"..bid, "spell")
self:SetAttribute(prefix.."spell"..bid, pfUI_config.unitframes["clickcast"..bconf..mconf])
self:SetAttribute(prefix.."macro"..bid, nil)
end
else
-- fill clickaction table for vanillla
self.clickactions = self.clickactions or {}
self.clickactions[modifier..button] = pfUI_config.unitframes["clickcast"..bconf..mconf]
end
self.clickactions = self.clickactions or {}
self.clickactions[modifier..button] = pfUI_config.unitframes["clickcast"..bconf..mconf]
end
end
end
@@ -2328,8 +2403,6 @@ function pfUI.uf:SetupBuffIndicators(config)
if myclass == "WARRIOR" then
-- Battle Shout
table.insert(indicators, "interface\\icons\\ability_warrior_battleshout")
-- Commanding Shout (TBC)
table.insert(indicators, "interface\\icons\\ability_warrior_rallyingcry")
end
if myclass == "MAGE" then
@@ -2348,14 +2421,6 @@ function pfUI.uf:SetupBuffIndicators(config)
-- Aspect of the Pack
table.insert(indicators, "interface\\icons\\ability_mount_whitetiger")
-- Misdirection (TBC)
table.insert(indicators, "interface\\icons\\ability_hunter_misdirection")
end
if myclass == "SHAMAN" then
-- Earth Shield (TBC)
table.insert(indicators, "interface\\icons\\spell_nature_skinofearth")
end
end
@@ -2384,8 +2449,6 @@ function pfUI.uf:SetupBuffIndicators(config)
table.insert(indicators, "interface\\icons\\spell_holy_renew")
-- Power Word: Shield
table.insert(indicators, "interface\\icons\\spell_holy_powerwordshield")
-- Prayer of Mending (TBC)
table.insert(indicators, "interface\\icons\\spell_holy_prayerofmendingtga")
end
if myclass == "DRUID" or config.all_hots == "1" then
-1960
View File
File diff suppressed because it is too large Load Diff
-1
View File
@@ -1,4 +1,3 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Include file="..\compat\vanilla.lua"/>
<Include file="..\compat\tbc.lua"/>
</Ui>
+2 -2
View File
@@ -35,7 +35,6 @@
<Include file="..\modules\questitem.lua"/>
<Include file="..\modules\thirdparty.lua"/>
<Include file="..\modules\thirdparty-vanilla.lua"/>
<Include file="..\modules\thirdparty-tbc.lua"/>
<Include file="..\modules\buff.lua"/>
<Include file="..\modules\buffwatch.lua"/>
<Include file="..\modules\nameplates.lua"/>
@@ -66,10 +65,11 @@
<Include file="..\modules\afkcam.lua"/>
<Include file="..\modules\screenshot.lua"/>
<Include file="..\modules\addoncompat.lua"/>
<Include file="..\modules\combatlogfix.lua"/>
<Include file="..\modules\energytick.lua"/>
<Include file="..\modules\totems.lua"/>
<Include file="..\modules\macrotweak.lua"/>
<Include file="..\modules\turtle-wow.lua"/>
<Include file="..\modules\superwow.lua"/>
<Include file="..\modules\nampower.lua"/>
<Include file="..\modules\unitxp.lua"/>
</Ui>
-10
View File
@@ -26,7 +26,6 @@
<Include file="..\skins\blizzard\game_menu.lua"/>
<Include file="..\skins\blizzard\guild_registrar.lua"/>
<Include file="..\skins\blizzard\help.lua"/>
<Include file="..\skins\blizzard\options-interface.lua"/>
<Include file="..\skins\blizzard\options-sound.lua"/>
<Include file="..\skins\blizzard\options-video.lua"/>
<Include file="..\skins\blizzard\petition.lua"/>
@@ -34,13 +33,4 @@
<Include file="..\skins\blizzard\tooltips.lua"/>
<Include file="..\skins\blizzard\tabard.lua"/>
<Include file="..\skins\blizzard\itemtext.lua"/>
<!-- TBC -->
<Include file="..\skins\blizzard\tracking.lua"/>
<Include file="..\skins\blizzard\guildbank.lua"/>
<Include file="..\skins\blizzard\socket.lua"/>
<Include file="..\skins\blizzard\arena_registrar.lua"/>
<Include file="..\skins\blizzard\arena.lua"/>
<Include file="..\skins\blizzard\time_manager.lua"/>
<Include file="..\skins\blizzard\lfg.lua"/>
</Ui>
+106 -18
View File
@@ -53,14 +53,50 @@ local scanner = libtipscan:GetScanner("libcast")
local libcast = CreateFrame("Frame", "pfEnemyCast")
local player = UnitName("player")
UnitChannelInfo = _G.UnitChannelInfo or function(unit)
-- Store original SuperWoW UnitChannelInfo if it exists
local SuperWoW_UnitChannelInfo = _G.UnitChannelInfo
UnitChannelInfo = function(unit)
-- convert to name if unitstring was given
unit = pfValidUnits[unit] and UnitName(unit) or unit
local unitName = pfValidUnits[unit] and UnitName(unit) or unit
-- For player: ALWAYS use libcast.db because it handles channel updates correctly
local isPlayer = unit == "player" or unitName == player
if isPlayer then
local cast, nameSubtext, text, texture, startTime, endTime, isTradeSkill
local db = libcast.db[player]
if db and db.cast and db.start + db.casttime / 1000 > GetTime() then
if not db.channel then return end
cast = db.cast
nameSubtext = db.rank
text = ""
texture = db.icon
startTime = db.start * 1000
endTime = startTime + db.casttime
isTradeSkill = nil
elseif db then
db.cast = nil
db.rank = nil
db.start = nil
db.casttime = nil
db.icon = nil
db.channel = nil
end
return cast, nameSubtext, text, texture, startTime, endTime, isTradeSkill
end
-- For non-player units: use SuperWoW if available, otherwise use libcast.db
if SuperWoW_UnitChannelInfo then
return SuperWoW_UnitChannelInfo(unit)
end
-- Fallback to libcast.db for non-player units
local cast, nameSubtext, text, texture, startTime, endTime, isTradeSkill
local db = libcast.db[unit]
local db = libcast.db[unitName]
-- clean legacy values
if db and db.cast and db.start + db.casttime / 1000 > GetTime() then
if not db.channel then return end
cast = db.cast
@@ -71,7 +107,6 @@ UnitChannelInfo = _G.UnitChannelInfo or function(unit)
endTime = startTime + db.casttime
isTradeSkill = nil
elseif db then
-- remove cast action to the database
db.cast = nil
db.rank = nil
db.start = nil
@@ -83,14 +118,51 @@ UnitChannelInfo = _G.UnitChannelInfo or function(unit)
return cast, nameSubtext, text, texture, startTime, endTime, isTradeSkill
end
UnitCastingInfo = _G.UnitCastingInfo or function(unit)
-- Store original SuperWoW UnitCastingInfo if it exists
local SuperWoW_UnitCastingInfo = _G.UnitCastingInfo
UnitCastingInfo = function(unit)
-- convert to name if unitstring was given
unit = pfValidUnits[unit] and UnitName(unit) or unit
local unitName = pfValidUnits[unit] and UnitName(unit) or unit
-- For player: ALWAYS use libcast.db because it handles pushback correctly
-- SuperWoW's UnitCastingInfo doesn't track SPELLCAST_DELAYED events
local isPlayer = unit == "player" or unitName == player
if isPlayer then
local cast, nameSubtext, text, texture, startTime, endTime, isTradeSkill
local db = libcast.db[player]
if db and db.cast and db.start + db.casttime / 1000 > GetTime() then
if db.channel then return end
cast = db.cast
nameSubtext = db.rank or ""
text = ""
texture = db.icon
startTime = db.start * 1000
endTime = startTime + db.casttime
isTradeSkill = nil
elseif db then
db.cast = nil
db.rank = nil
db.start = nil
db.casttime = nil
db.icon = nil
db.channel = nil
end
return cast, nameSubtext, text, texture, startTime, endTime, isTradeSkill
end
-- For non-player units: use SuperWoW if available, otherwise use libcast.db
if SuperWoW_UnitCastingInfo then
return SuperWoW_UnitCastingInfo(unit)
end
-- Fallback to libcast.db for non-player units
local cast, nameSubtext, text, texture, startTime, endTime, isTradeSkill
local db = libcast.db[unit]
local db = libcast.db[unitName]
-- clean legacy values
if db and db.cast and db.start + db.casttime / 1000 > GetTime() then
if db.channel then return end
cast = db.cast
@@ -101,7 +173,6 @@ UnitCastingInfo = _G.UnitCastingInfo or function(unit)
endTime = startTime + db.casttime
isTradeSkill = nil
elseif db then
-- remove cast action to the database
db.cast = nil
db.rank = nil
db.start = nil
@@ -182,17 +253,31 @@ libcast:RegisterEvent("SPELLCAST_CHANNEL_STOP")
libcast:RegisterEvent("SPELLCAST_CHANNEL_UPDATE")
local mob, spell, icon, _
libcast:SetScript("OnEvent", function()
-- Fill database with player casts
if event == "SPELLCAST_START" then
icon = L["spells"][arg1] and L["spells"][arg1].icon and string.format("%s%s", "Interface\\Icons\\", L["spells"][arg1].icon) or lastcasttex
-- add cast action to the database
this.db[player].cast = arg1
this.db[player].rank = lastrank
this.db[player].start = GetTime()
this.db[player].casttime = arg2
this.db[player].icon = icon
this.db[player].channel = nil
-- Check if SuperWoW already set the cast data (with correct haste-adjusted casttime)
-- If so, only update icon if needed, don't overwrite casttime
local superWowAlreadySet = this.db[player].cast == arg1 and this.db[player].casttime and this.db[player].casttime > 0
if superWowAlreadySet then
-- SuperWoW already set correct casttime, only update icon if better
if icon and not this.db[player].icon then
this.db[player].icon = icon
end
else
-- No SuperWoW data, use SPELLCAST_START data
this.db[player].cast = arg1
this.db[player].rank = lastrank
this.db[player].start = GetTime()
this.db[player].casttime = arg2
this.db[player].icon = icon
this.db[player].channel = nil
end
if not L["spells"][arg1] or not L["spells"][arg1].icon or not L["spells"][arg1].t then
L["spells"][arg1] = L["spells"][arg1] or { }
L["spells"][arg1].icon = L["spells"][arg1].icon or icon
@@ -214,7 +299,9 @@ libcast:SetScript("OnEvent", function()
end
elseif event == "SPELLCAST_DELAYED" then
if this.db[player].cast then
this.db[player].start = this.db[player].start + arg1/1000
-- Pushback: increase casttime instead of shifting start
-- arg1 is the delay amount in milliseconds
this.db[player].casttime = this.db[player].casttime + arg1
end
elseif event == "SPELLCAST_CHANNEL_START" then
-- add cast action to the database
@@ -224,6 +311,7 @@ libcast:SetScript("OnEvent", function()
this.db[player].casttime = arg1
this.db[player].icon = L["spells"][arg2] and L["spells"][arg2].icon and string.format("%s%s", "Interface\\Icons\\", L["spells"][arg2].icon) or lastcasttex
this.db[player].channel = true
lastcasttex, lastrank = nil, nil
elseif event == "SPELLCAST_CHANNEL_STOP" then
if this.db[player] and this.db[player].channel then
+21 -60
View File
@@ -9,10 +9,9 @@ setfenv(1, pfUI:GetEnvironment())
-- UnitGetIncomingHeals(unit)
-- UnitHasIncomingResurrection(unit)
--
-- The library is able to receive and send compatible messages to HealComm (vanilla)
-- and HealComm (tbc) including the ressurections of both versions. It has an option
-- to disable the sending of those messages in case one of the mentioned libraries
-- is already active.
-- The library is able to receive and send compatible messages to HealComm
-- including resurrections. It has an option to disable the sending of those
-- messages in case HealComm is already active.
-- return instantly when another libpredict is already active
if pfUI.api.libpredict then return end
@@ -96,6 +95,10 @@ libpredict:SetScript("OnEvent", function()
end)
libpredict:SetScript("OnUpdate", function()
-- throttle cleanup to 0.1s - no need to check every frame
if (this.tick or 0) > GetTime() then return end
this.tick = GetTime() + 0.1
-- update on timeout events
for timestamp, targets in pairs(events) do
if GetTime() >= timestamp then
@@ -453,15 +456,6 @@ libpredict.sender:SetScript("OnUpdate", function()
end
end)
-- tbc
libpredict.sender:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
libpredict.sender:RegisterEvent("UNIT_SPELLCAST_START")
libpredict.sender:RegisterEvent("UNIT_SPELLCAST_STOP")
libpredict.sender:RegisterEvent("UNIT_SPELLCAST_FAILED")
libpredict.sender:RegisterEvent("UNIT_SPELLCAST_INTERRUPTED")
libpredict.sender:RegisterEvent("UNIT_SPELLCAST_SENT")
-- vanilla
libpredict.sender:RegisterEvent("CHAT_MSG_SPELL_SELF_BUFF")
libpredict.sender:RegisterEvent("SPELLCAST_START")
libpredict.sender:RegisterEvent("SPELLCAST_STOP")
@@ -498,24 +492,9 @@ libpredict.sender:SetScript("OnEvent", function()
if spell == spell_queue[1] then UpdateCache(spell_queue[2], heal, true) end
return
end
elseif event == "COMBAT_LOG_EVENT_UNFILTERED" and arg2 == "SPELL_HEAL" and arg4 == player then -- tbc
local spell, heal, crit = arg10, arg12, arg13
if spell and heal and crit then
if spell == spell_queue[1] then UpdateCache(spell_queue[2], heal, true) end
elseif spell and heal then
if spell == spell_queue[1] then UpdateCache(spell_queue[2], heal) end
end
elseif event == "UNIT_SPELLCAST_SENT" and arg4 then -- fix tbc mouseover macros
senttarget = arg4
elseif strfind(event, "SPELLCAST_START", 1) then
elseif event == "SPELLCAST_START" then
local spell, time = arg1, arg2
if strfind(event, "UNIT_", 1) then -- tbc
if arg1 ~= "player" then return end
local spellname, _, _, _, starttime, endtime = UnitCastingInfo("player")
spell, time = spellname, endtime - starttime
end
if spell_queue[1] == spell and cache[spell_queue[2]] then
local sender = player
local target = senttarget or spell_queue[3]
@@ -536,22 +515,14 @@ libpredict.sender:SetScript("OnEvent", function()
for i=1,4 do
if CheckInteractDistance("party"..i, 4) then
libpredict:Heal(player, UnitName("party"..i), amount, casttime)
if pfUI.client < 20000 then -- vanilla
libpredict.sender:SendHealCommMsg("Heal/" .. UnitName("party"..i) .. "/" .. amount .. "/" .. casttime .. "/")
else -- tbc
libpredict.sender:SendHealCommMsg(string.format("002%05d%s", math.min(amount, 99999), UnitName("party"..i)))
end
libpredict.sender:SendHealCommMsg("Heal/" .. UnitName("party"..i) .. "/" .. amount .. "/" .. casttime .. "/")
libpredict.sender.healing = true
end
end
end
libpredict:Heal(player, target, amount, casttime)
if pfUI.client < 20000 then -- vanilla
libpredict.sender:SendHealCommMsg("Heal/" .. target .. "/" .. amount .. "/" .. casttime .. "/")
else -- tbc
libpredict.sender:SendHealCommMsg(string.format("002%05d%s", math.min(amount, 99999), target))
end
libpredict.sender:SendHealCommMsg("Heal/" .. target .. "/" .. amount .. "/" .. casttime .. "/")
libpredict.sender.healing = true
elseif spell_queue[1] == spell and L["resurrections"][spell] then
@@ -561,15 +532,10 @@ libpredict.sender:SetScript("OnEvent", function()
libpredict.sender:SendResCommMsg("RES " .. target)
libpredict.sender.resurrecting = true
end
elseif strfind(event, "SPELLCAST_FAILED", 1) or strfind(event, "SPELLCAST_INTERRUPTED", 1) then
if strfind(event, "UNIT_", 1) and arg1 ~= "player" then return end
elseif event == "SPELLCAST_FAILED" or event == "SPELLCAST_INTERRUPTED" then
if libpredict.sender.healing then
libpredict:HealStop(player)
if pfUI.client < 20000 then -- vanilla
libpredict.sender:SendHealCommMsg("HealStop")
else -- tbc
libpredict.sender:SendHealCommMsg("001F")
end
libpredict.sender:SendHealCommMsg("HealStop")
libpredict.sender.healing = nil
elseif libpredict.sender.resurrecting then
local target = senttarget or spell_queue[3]
@@ -586,21 +552,16 @@ libpredict.sender:SetScript("OnEvent", function()
libpredict:HealDelay(player, arg1)
libpredict.sender:SendHealCommMsg("Healdelay/" .. arg1 .. "/")
end
elseif strfind(event, "SPELLCAST_STOP", 1) then
if strfind(event, "UNIT_", 1) and arg1 ~= "player" then return end
elseif event == "SPELLCAST_STOP" then
libpredict:HealStop(player)
if pfUI.client < 20000 then -- vanilla
if spell_queue[1] == REJUVENATION then
libpredict:Hot(player, spell_queue[3], "Reju", rejuvDuration)
libpredict.sender:SendHealCommMsg("Reju/"..spell_queue[3].."/"..rejuvDuration.."/")
elseif spell_queue[1] == RENEW then
libpredict:Hot(player, spell_queue[3], "Renew", renewDuration)
libpredict.sender:SendHealCommMsg("Renew/"..spell_queue[3].."/"..renewDuration.."/")
elseif spell_queue[1] == REGROWTH then
this.regrowth_timer = GetTime() + 0.1
end
else -- tbc
--todo
if spell_queue[1] == REJUVENATION then
libpredict:Hot(player, spell_queue[3], "Reju", rejuvDuration)
libpredict.sender:SendHealCommMsg("Reju/"..spell_queue[3].."/"..rejuvDuration.."/")
elseif spell_queue[1] == RENEW then
libpredict:Hot(player, spell_queue[3], "Renew", renewDuration)
libpredict.sender:SendHealCommMsg("Renew/"..spell_queue[3].."/"..renewDuration.."/")
elseif spell_queue[1] == REGROWTH then
this.regrowth_timer = GetTime() + 0.1
end
end
end)
+28 -12
View File
@@ -39,10 +39,10 @@ local spells = {
},
}
-- use native IsSpellInRange checker for tbc and skip
-- the whole targeting approach that is required for vanilla
if pfUI.expansion == "tbc" then
local spell
-- Use Nampower's IsSpellInRange if available (vanilla only)
-- This provides more accurate range checking without needing to find spell slots
local nampower_spell
if GetNampowerVersion then
librange:RegisterEvent("LEARNED_SPELL_IN_TAB")
librange:RegisterEvent("PLAYER_ENTERING_WORLD")
librange:SetScript("OnEvent", function()
@@ -53,12 +53,14 @@ if pfUI.expansion == "tbc" then
local _, _, offset, num = GetSpellTabInfo(i)
for id = offset + 1, offset + num do
local name, rank = GetSpellName(id, BOOKTYPE_SPELL)
local texture = GetSpellTexture(name)
local texture = GetSpellTexture(id, BOOKTYPE_SPELL)
for _, tex in pairs(spells[class]) do
if tex == texture then
spell = name
return
if texture then
for _, tex in pairs(spells[class]) do
if tex == texture then
nampower_spell = name
return
end
end
end
end
@@ -66,8 +68,12 @@ if pfUI.expansion == "tbc" then
end)
function librange:UnitInSpellRange(unit)
if not spell then return nil end
return IsSpellInRange(spell, unit) == 1 and true or nil
if not nampower_spell then return nil end
-- Nampower's IsSpellInRange returns 1 if in range, 0 if not, -1 if invalid
local result = IsSpellInRange(nampower_spell, unit)
if result == 1 then return 1
elseif result == 0 then return nil
else return nil end
end
-- add librange to pfUI API
@@ -161,7 +167,17 @@ librange:SetScript("OnUpdate", function()
if this.id <= numunits and librange.slot then
local unit = units[this.id]
if not UnitIsUnit("target", unit) then
-- try to read distance via superwow first
-- Try UnitXP_SP3 first (most accurate distance measurement)
local unitxp_success, unitxp_distance = pcall(function()
return UnitXP("distanceBetween", "player", unit)
end)
if unitxp_success and unitxp_distance then
unitdata[unit] = unitxp_distance < 45 and 1 or 0
this.id = this.id + 1
return
end
-- try to read distance via superwow second
if superwow_active then
local x1, y1, z1 = UnitPosition("player")
local x2, y2, z2 = UnitPosition(unit)
+98 -86
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
pfUI:RegisterModule("actionbar", "vanilla", function ()
local _, class = UnitClass("player")
local color = RAID_CLASS_COLORS[class]
local cr, cg, cb = color.r , color.g, color.b
@@ -395,14 +395,6 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
for line in gfind(body, "[^%\n]+") do
_, _, match = string.find(line, '^#showtooltip (.+)')
-- skip any further manual macro scanning on
-- gameclients with native macro spell detection
if pfUI.client > 11200 and match then
self.spellslot = nil
self.booktype = nil
return
end
-- allow the user to disable the scan
if match and strfind(match, "disable") then
return
@@ -912,24 +904,40 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
end
local cat, stealth
local function IsCatStealth()
local inCatForm = nil -- cached from buff scan
local prowlActive = nil -- tracks if prowl is active
-- Full scan for cat form and prowl (only on login/reload)
local function FullScan()
if class ~= "DRUID" then return nil end
cat, stealth = nil, nil
local foundCat, foundStealth = nil, nil
for i = 0, 31 do
local texture = GetPlayerBuffTexture(i)
if not texture then break end
-- catform icon detected
if strfind(texture, "Ability_Druid_CatForm") then
if stealth then return true end
cat = true
foundCat = true
end
-- stealth icon detected
if strfind(texture, "Ability_Ambush") then
if cat then return true end
stealth = true
foundStealth = true
end
end
inCatForm = foundCat
prowlActive = foundCat and foundStealth
return prowlActive
end
-- Quick scan only for prowl (when we know we're in cat form)
local function HasProwlBuff()
for i = 0, 31 do
local texture = GetPlayerBuffTexture(i)
if not texture then break end
if strfind(texture, "Ability_Ambush") then
return true
end
end
return nil
@@ -956,7 +964,59 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
end
-- setup page switch frame
local prowling = nil
local pageswitch = CreateFrame("Frame", "pfActionBarPageSwitch", UIParent)
pageswitch:RegisterEvent("PLAYER_AURAS_CHANGED")
pageswitch:RegisterEvent("PLAYER_ENTERING_WORLD")
pageswitch:RegisterEvent("UNIT_CASTEVENT")
pageswitch:SetScript("OnEvent", function()
if class ~= "DRUID" then return end
-- UNIT_CASTEVENT: detect Cat Form and Prowl cast instantly
-- Cat Form: 768 | Prowl: 5215 (R1), 6783 (R2), 9913 (R3)
if event == "UNIT_CASTEVENT" then
local guid, target, cEvent, spellId = arg1, arg2, arg3, arg4
local _, playerGuid = UnitExists("player")
if guid == playerGuid and cEvent == "CAST" then
if spellId == 5215 or spellId == 6783 or spellId == 9913 then
inCatForm = true
prowlActive = true
prowling = true
elseif spellId == 768 then
inCatForm = true
end
end
return
end
-- PLAYER_AURAS_CHANGED: smart scanning
if event == "PLAYER_AURAS_CHANGED" then
if prowlActive then
-- We were prowling, check if still prowling
if HasProwlBuff() then
prowling = true
else
-- Prowl ended
prowlActive = nil
prowling = nil
-- Also check if still in cat form
inCatForm = nil
for i = 0, 31 do
local texture = GetPlayerBuffTexture(i)
if not texture then break end
if strfind(texture, "Ability_Druid_CatForm") then
inCatForm = true
break
end
end
end
elseif not inCatForm then
-- Not in cat form, do a full scan (might have just shifted)
prowling = FullScan()
end
-- If inCatForm but not prowlActive, no scan needed (wait for UNIT_CASTEVENT)
end
end)
pageswitch:SetScript("OnUpdate", function()
-- switch actionbar page depending on meta key that is pressed
if C.bars.pagemastershift == "1" and IsShiftKeyDown() then
@@ -974,10 +1034,9 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
-- switch actionbar page if druid stealth is detected
if C.bars.druidstealth == "1" then
local stealth = IsCatStealth()
if stealth and _G.CURRENT_ACTIONBAR_PAGE == 1 then
if prowling and _G.CURRENT_ACTIONBAR_PAGE == 1 then
SwitchBar(prowl)
elseif not stealth and _G.CURRENT_ACTIONBAR_PAGE == 8 then
elseif not prowling and _G.CURRENT_ACTIONBAR_PAGE == 8 then
SwitchBar(default)
end
end
@@ -1109,39 +1168,6 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
buttoncache[id] = f
end
-- set required attributes for regular tbc buttons
if pfUI.client > 11200 then
if bar == 11 then
f:SetAttribute("type", "spell")
f:SetAttribute('spell', select(2, GetShapeshiftFormInfo(button)))
elseif bar == 12 then
f:SetAttribute("type1", "pet")
f:SetAttribute("action1", button)
f:SetAttribute("type2", "macro")
f:SetAttribute("macrotext2", "/click PetActionButton".. button .. " RightButton")
else
bars[bar]:SetAttribute("addchild", f)
f:SetAttribute("type", "action")
f:SetAttribute("action", id)
f:SetAttribute("checkselfcast", true)
f:SetAttribute("useparent-unit", true)
f:SetAttribute("useparent-statebutton", true)
for state = 0, 11 do -- add custom states
local action = ((state == 0 and bar or state)-1)*12+button
f:SetAttribute(string.format("*type-S%d", state), "action")
f:SetAttribute(string.format("*type-S%dRight", state), "action")
f:SetAttribute(string.format("*action-S%d", state), action)
f:SetAttribute(string.format("*action-S%dRight", state), action)
if C.bars.rightself == "1" then
f:SetAttribute(string.format("*unit-S%dRight", state), "player")
else
f:SetAttribute(string.format("*unit-S%dRight", state), nil)
end
end
end
end
-- set keydown option
if C.bars.keydown == "1" then
f:RegisterForClicks("LeftButtonDown", "RightButtonDown")
@@ -1268,40 +1294,26 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
if enable == "1" then
-- handle pet bar
if i == 12 then
if pfUI.client > 11200 then
if InCombatLockdown and InCombatLockdown() then
-- don't process those events during combat
else
-- set state driver for pet bars
bars[i]:SetAttribute("unit", "pet")
local visibility = pfUI.unlock and pfUI.unlock:IsShown() and "show" or petvisibility
if bars[i].visibility ~= visibility then
RegisterStateDriver(bars[i], 'visibility', visibility)
bars[i].visibility = visibility
end
end
-- only show when pet actions exists
if PetHasActionBar() or pfUI.unlock and pfUI.unlock:IsShown() then
bars[i]:Show()
else
-- only show when pet actions exists
if PetHasActionBar() or pfUI.unlock and pfUI.unlock:IsShown() then
bars[i]:Show()
else
bars[i]:Hide()
end
bars[i]:Hide()
end
-- show/hide petbar on petbar updates
if init then
bars[i]:RegisterEvent("PET_BAR_UPDATE")
bars[i]:SetScript("OnEvent", function()
-- hide obsolete buttons
for i=1, NUM_PET_ACTION_SLOTS do
if not PetHasActionBar() and bars[12][i] then
bars[12][i]:Hide()
end
end
-- refresh layout
CreateActionBar(12)
end)
end
-- show/hide petbar on petbar updates
if init then
bars[i]:RegisterEvent("PET_BAR_UPDATE")
bars[i]:SetScript("OnEvent", function()
-- hide obsolete buttons
for i=1, NUM_PET_ACTION_SLOTS do
if not PetHasActionBar() and bars[12][i] then
bars[12][i]:Hide()
end
end
-- refresh layout
CreateActionBar(12)
end)
end
-- handle shapeshift bar
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("addonbuttons", "vanilla:tbc", function ()
pfUI:RegisterModule("addonbuttons", "vanilla", function ()
if not pfUI.minimap then return end
if C.abuttons.enable == "0" then return end
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("addons", "vanilla:tbc", function ()
pfUI:RegisterModule("addons", "vanilla", function ()
local rawborder, border = GetBorderSize()
-- add main menu button
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("afkcam", "vanilla:tbc", function ()
pfUI:RegisterModule("afkcam", "vanilla", function ()
local MARKED_AFK_CAPTURE = SanitizePattern(MARKED_AFK_MESSAGE)
local social_chats = {
"CHAT_MSG_SAY",
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("autovendor", "vanilla:tbc", function ()
pfUI:RegisterModule("autovendor", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
local processed = {}
+3 -3
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("bags", "vanilla:tbc", function ()
pfUI:RegisterModule("bags", "vanilla", function ()
local rawborder, default_border = GetBorderSize("bags")
local knownInventorySpellTextures = {
@@ -573,8 +573,8 @@ pfUI:RegisterModule("bags", "vanilla:tbc", function ()
SlotLeave()
end)
-- On TBC, the OnEvent function of the template scans for framenames,
-- and obviously doesn't know the pf-Names. Therefore, triggering
-- The OnEvent function of the template scans for framenames,
-- and doesn't know the pf-Names. Therefore, triggering
-- the update function on each frame manually
if frame == pfUI.bag.left and BankFrameItemButton_Update then
local SlotUpdate = frame.bagslots.slots[slot].frame:GetScript("OnUpdate")
+60
View File
@@ -0,0 +1,60 @@
pfUI:RegisterModule("bgscore", "vanilla", function ()
local bgframe = WorldStateAlwaysUpFrame
if not bgframe then
bgframe = CreateFrame("Frame", "WorldStateAlwaysUpFrame", UIParent)
bgframe:SetWidth(200)
bgframe:SetHeight(25)
bgframe:SetPoint("TOP", UIParent, "TOP", 0, -100)
end
local mover = CreateFrame("Frame", "pfUIBGScoreMover", UIParent)
mover:SetWidth(220)
mover:SetHeight(30)
mover:SetPoint("TOP", UIParent, "TOP", 0, -100)
mover:SetFrameStrata("DIALOG")
mover:SetMovable(true)
mover:EnableMouse(true)
mover:RegisterForDrag("LeftButton")
mover:SetScript("OnDragStart", function() mover:StartMoving() end)
mover:SetScript("OnDragStop", function()
mover:StopMovingOrSizing()
local x = mover:GetLeft()
local y = mover:GetTop()
pfUI_config = pfUI_config or {}
pfUI_config.positions = pfUI_config.positions or {}
pfUI_config.positions["WorldStateAlwaysUpFrame"] = { x = x, y = y }
bgframe:ClearAllPoints()
bgframe:SetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", x, y)
DEFAULT_CHAT_FRAME:AddMessage("|cff33ffccBG Score Frame|r position saved.")
end)
mover:Hide()
pfUI.api.CreateBackdrop(mover, nil, nil, .8)
-- Title label
local title = mover:CreateFontString(nil, "OVERLAY")
title:SetFont("Fonts\\FRIZQT__.TTF", 14, "OUTLINE")
title:SetText("Battleground Frames")
title:SetPoint("TOP", mover, "TOP", 0, -2)
-- BG score preview text
local bgscore = mover:CreateFontString(nil, "OVERLAY")
bgscore:SetFont("Fonts\\FRIZQT__.TTF", 10, "OUTLINE")
bgscore:SetText("|cff3399ffAlliance: 123|r | |cffff4444Horde: 456|r")
bgscore:SetPoint("BOTTOM", mover, "BOTTOM", 0, 2)
mover.label = "BG Score"
pfUI.unlock.frames = pfUI.unlock.frames or {}
table.insert(pfUI.unlock.frames, mover)
local pos = pfUI_config and pfUI_config.positions and pfUI_config.positions["WorldStateAlwaysUpFrame"]
if pos then
bgframe:SetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", pos.x, pos.y)
mover:SetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", pos.x, pos.y)
end
local origShow = pfUI.unlock.Show
local origHide = pfUI.unlock.Hide
pfUI.unlock.Show = function(self) origShow(self); mover:Show() end
pfUI.unlock.Hide = function(self) origHide(self); mover:Hide(); bgframe:Show() end
end)
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("bubbles", "vanilla:tbc", function ()
pfUI:RegisterModule("bubbles", "vanilla", function ()
local alpha = tonumber(C.chat.bubbles.alpha)
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("buff", "vanilla:tbc", function ()
pfUI:RegisterModule("buff", "vanilla", function ()
-- Hide Blizz
BuffFrame:Hide()
BuffFrame:UnregisterAllEvents()
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("buffwatch", "vanilla:tbc", function ()
pfUI:RegisterModule("buffwatch", "vanilla", function ()
local rawborder, border = GetBorderSize("panels")
local scanner = libtipscan:GetScanner("buffwatch")
+15 -6
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("castbar", "vanilla:tbc", function ()
pfUI:RegisterModule("castbar", "vanilla", function ()
local font = C.castbar.use_unitfonts == "1" and pfUI.font_unit or pfUI.font_default
local font_size = C.castbar.use_unitfonts == "1" and C.global.font_unit_size or C.global.font_size
local rawborder, default_border = GetBorderSize("unitframes")
@@ -86,11 +86,20 @@ pfUI:RegisterModule("castbar", "vanilla:tbc", function ()
local query = this.unitstr ~= "" and this.unitstr or this.unitname
if not query then return end
-- transform all non player unitstrings to unit guids
if superwow_active and this.unitstr and not UnitIsUnit(this.unitstr, 'player') then
-- transform unitstrings to unit guids when SuperWoW is active
-- SuperWoW stores cast data by GUID for all units INCLUDING player
-- BUT: For player casts, we need to use libcast data because it handles pushback correctly
local useLibcastForPlayer = this.unitstr == "player"
if superwow_active and this.unitstr and not useLibcastForPlayer then
local _, guid = UnitExists(this.unitstr)
query = guid or query
end
-- For player: use player name to query libcast.db directly
if useLibcastForPlayer then
query = UnitName("player")
end
local cast, nameSubtext, text, texture, startTime, endTime, isTradeSkill = UnitCastingInfo(query)
if not cast then
@@ -149,10 +158,10 @@ pfUI:RegisterModule("castbar", "vanilla:tbc", function ()
if this.showtimer then
if this.delay and this.delay > 0 then
local delay = "|cffffaaaa" .. (channel and "-" or "+") .. round(this.delay,1) .. " |r "
this.bar.right:SetText(delay .. string.format("%.1f",cur) .. " / " .. round(max,1))
local delay = "|cffffaaaa" .. (channel and "-" or "+") .. round(this.delay,2) .. " |r "
this.bar.right:SetText(delay .. string.format("%.2f",cur) .. " / " .. round(max,2))
else
this.bar.right:SetText(string.format("%.1f",cur) .. " / " .. round(max,1))
this.bar.right:SetText(string.format("%.2f",cur) .. " / " .. round(max,2))
end
end
+25 -3
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("chat", "vanilla:tbc", function ()
pfUI:RegisterModule("chat", "vanilla", function ()
local panelfont = C.panel.use_unitfonts == "1" and pfUI.font_unit or pfUI.font_default
local panelfont_size = C.panel.use_unitfonts == "1" and C.global.font_unit_size or C.global.font_size
local rawborder, default_border = GetBorderSize("chat")
@@ -455,6 +455,8 @@ pfUI:RegisterModule("chat", "vanilla:tbc", function ()
if C.chat.global.tabmouse == "1" then
pfUI.chat.mouseovertab = CreateFrame("Frame")
pfUI.chat.mouseovertab:SetScript("OnUpdate", function()
-- throttle to 0.1s
if ( this.tick or .1) > GetTime() then return else this.tick = GetTime() + .1 end
if pfUI.chat.hideLock then return end
@@ -725,6 +727,12 @@ pfUI:RegisterModule("chat", "vanilla:tbc", function ()
end
end)
local function GetPlayerLevel(name)
if not pfUI_playerDB then return nil end
if not pfUI_playerDB[name] then return nil end
return pfUI_playerDB[name].level
end
local function ScanWhoName(name)
-- abort if another query is ongoing
if who_query.pending then return end
@@ -745,8 +753,7 @@ pfUI:RegisterModule("chat", "vanilla:tbc", function ()
end
-- Remove prat CLINKs
text = gsub(text, "{CLINK:(%x+):([%d-]-:[%d-]-:[%d-]-:[%d-]-:[%d-]-:[%d-]-:[%d-]-:[%d-]-):([^}]-)}", "|c%1|Hitem:%2|h[%3]|h|r") -- tbc
text = gsub(text, "{CLINK:(%x+):([%d-]-:[%d-]-:[%d-]-:[%d-]-):([^}]-)}", "|c%1|Hitem:%2|h[%3]|h|r") -- vanilla
text = gsub(text, "{CLINK:(%x+):([%d-]-:[%d-]-:[%d-]-:[%d-]-):([^}]-)}", "|c%1|Hitem:%2|h[%3]|h|r")
-- Remove chatter CLINKs
text = gsub(text, "{CLINK:item:(%x+):([%d-]-:[%d-]-:[%d-]-:[%d-]-:[%d-]-:[%d-]-:[%d-]-:[%d-]-):([^}]-)}", "|c%1|Hitem:%2|h[%3]|h|r")
@@ -783,6 +790,21 @@ pfUI:RegisterModule("chat", "vanilla:tbc", function ()
end
end
-- display player levels if available
if C.chat.text.playerlevel == "1" then
for name in gfind(text, "|Hplayer:(.-)|h") do
local real, _ = strsplit(":", name)
local level = GetPlayerLevel(real)
if level then
local levelcolor = rgbhex(GetDifficultyColor(level))
-- Add level after the player name, before the closing bracket
text = string.gsub(text, "(|Hplayer:" .. name .. "|h.-|h|r)" .. right,
"%1 " .. levelcolor .. level .. "|r" .. right)
end
end
end
-- reduce channel name to number
if C.chat.text.channelnumonly == "1" then
local channel = string.gsub(text, ".*%[(.-)%]%s+(.*|Hplayer).+", "%1")
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("chatcopy", "vanilla:tbc", function ()
pfUI:RegisterModule("chatcopy", "vanilla", function ()
local limit = 100
local f = CreateFrame("Frame")
f:RegisterEvent("PLAYER_ENTERING_WORLD")
-7
View File
@@ -1,7 +0,0 @@
pfUI:RegisterModule("combatlogfix", "tbc", function ()
-- Fixes the combatlog break bugs that exist since patch 2.4 by simply clearing the whole log
-- on every update. This is required in order to receive new log events. Otherwise, addons like
-- Omen or Recount won't work and simply don't receive any new data at a given time.
local combatlog = CreateFrame("Frame", "pfCombatLogFix", UIParent)
combatlog:SetScript("OnUpdate", CombatLogClearEntries)
end)
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("combopoints", "vanilla:tbc", function ()
pfUI:RegisterModule("combopoints", "vanilla", function ()
local rawborder, border = GetBorderSize()
-- Hide Blizzard combo point frame and unregister all events to prevent it from popping up again
+4 -11
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("cooldown", "vanilla:tbc", function ()
pfUI:RegisterModule("cooldown", "vanilla", function ()
-- cache values
local lowcolor = {strsplit(",", C.appearance.cd.lowcolor)}
local normalcolor = {strsplit(",", C.appearance.cd.normalcolor)}
@@ -134,14 +134,7 @@ pfUI:RegisterModule("cooldown", "vanilla:tbc", function ()
end
end
if pfUI.expansion == "vanilla" then
-- vanilla does not have a cooldown frame type, so we hook the
-- regular SetTimer function that each one is calling.
hooksecurefunc("CooldownFrame_SetTimer", SetCooldown)
else
-- tbc and later expansion have a cooldown frametype, so we can
-- hook directly into the frame creation and add our function there.
local methods = getmetatable(CreateFrame('Cooldown', nil, nil, 'CooldownFrameTemplate')).__index
hooksecurefunc(methods, 'SetCooldown', SetCooldown)
end
-- vanilla does not have a cooldown frame type, so we hook the
-- regular SetTimer function that each one is calling.
hooksecurefunc("CooldownFrame_SetTimer", SetCooldown)
end)
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("easteregg", "vanilla:tbc", function ()
pfUI:RegisterModule("easteregg", "vanilla", function ()
-- merry x-mas!
if date("%m%d") == "1224" or date("%m%d") == "1225" then
local title = (UnitFactionGroup("player") == "Horde") and PVP_RANK_18_0 or PVP_RANK_18_1
+17 -7
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("energytick", "vanilla:tbc", function ()
pfUI:RegisterModule("energytick", "vanilla", function ()
if not pfUI.uf or not pfUI.uf.player then return end
local energytick = CreateFrame("Frame", nil, pfUI.uf.player.power.bar)
@@ -7,6 +7,9 @@ pfUI:RegisterModule("energytick", "vanilla:tbc", function ()
energytick:RegisterEvent("UNIT_DISPLAYPOWER")
energytick:RegisterEvent("UNIT_ENERGY")
energytick:RegisterEvent("UNIT_MANA")
energytick:RegisterEvent("CHAT_MSG_SPELL_SELF_BUFF")
energytick:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_SELF_BUFFS")
energytick:SetScript("OnEvent", function()
if UnitPowerType("player") == 0 and C.unitframes.player.manatick == "1" then
this.mode = "MANA"
@@ -18,6 +21,14 @@ pfUI:RegisterModule("energytick", "vanilla:tbc", function ()
this:Hide()
end
-- Filter nur eigene Energy-Gewinne von Talents/Buffs
if event == "CHAT_MSG_SPELL_SELF_BUFF" or event == "CHAT_MSG_SPELL_PERIODIC_SELF_BUFFS" then
if string.find(arg1, "You gain") and string.find(arg1, "Energy from") then
this.ignoreNextGain = true
end
return
end
if event == "PLAYER_ENTERING_WORLD" then
this.lastMana = UnitMana("player")
end
@@ -38,7 +49,10 @@ pfUI:RegisterModule("energytick", "vanilla:tbc", function ()
this.badtick = diff
end
elseif this.mode == "ENERGY" and diff > 0 then
this.target = 2
if not this.ignoreNextGain then
this.target = 2
end
this.ignoreNextGain = false
end
this.lastMana = this.currentMana
end
@@ -69,14 +83,10 @@ pfUI:RegisterModule("energytick", "vanilla:tbc", function ()
energytick.spark:SetWidth(C.unitframes.player.pheight + 5)
energytick.spark:SetBlendMode('ADD')
-- update spark size on player frame changes
local hookUpdateConfig = pfUI.uf.player.UpdateConfig
function pfUI.uf.player.UpdateConfig()
-- update spark sizes
energytick.spark:SetHeight(C.unitframes.player.pheight + 15)
energytick.spark:SetWidth(C.unitframes.player.pheight + 5)
-- run default unitframe update function
hookUpdateConfig(pfUI.uf.player)
end
end)
end)
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("farmmode", "vanilla:tbc", function ()
pfUI:RegisterModule("farmmode", "vanilla", function ()
local function ToggleFarmMode()
if pfUI.farmmap:IsShown() then
pfUI.farmmap:Hide()
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("feigndeath", "vanilla:tbc", function ()
pfUI:RegisterModule("feigndeath", "vanilla", function ()
local cache = { }
local scanner = libtipscan:GetScanner("feigndeath")
local healthbar = scanner:GetChildren()
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("firstrun", "vanilla:tbc", function ()
pfUI:RegisterModule("firstrun", "vanilla", function ()
pfUI.firstrun = CreateFrame("Frame", "pfFirstRunWizard", UIParent)
pfUI.firstrun.steps = {}
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("focus", "vanilla:tbc", function ()
pfUI:RegisterModule("focus", "vanilla", function ()
-- do not go further on disabled UFs
if C.unitframes.disable == "1" then return end
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("group", "vanilla:tbc", function ()
pfUI:RegisterModule("group", "vanilla", function ()
-- do not go further on disabled UFs
if C.unitframes.disable == "1" then return end
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("gryphons", "vanilla:tbc", function ()
pfUI:RegisterModule("gryphons", "vanilla", function ()
pfUI.gryphons = {
frames = {
left = CreateFrame("Frame"),
+34 -30
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("gui", "vanilla:tbc", function ()
pfUI:RegisterModule("gui", "vanilla", function ()
local Reload, U, CreateConfig, CreateTabFrame, CreateArea, CreateGUIEntry, EntryUpdate
-- "searchDB" gets populated when CreateConfig is called. The table holds
@@ -1657,6 +1657,19 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
CreateConfig(nil, T["Show Druid Mana Bar"], C.unitframes, "druidmanabar", "checkbox", nil, nil, nil, nil, "vanilla" )
CreateConfig(nil, T["Druid Mana Bar Height"], C.unitframes, "druidmanaheight", nil, nil, nil, nil, nil, "vanilla" )
CreateConfig(nil, T["Druid Mana Bar Text"], C.unitframes, "druidmanatext", "checkbox", nil, nil, nil, nil, "vanilla" )
CreateConfig(nil, T["Track Group on Minimap"], C.unitframes, "track_group", "checkbox", nil, nil, nil, nil, "vanilla" )
CreateConfig(nil, T["Nampower Settings"], nil, nil, "header")
CreateConfig(nil, T["Show Spell Queue Indicator"], C.unitframes, "spellqueue", "checkbox", nil, nil, nil, nil, "vanilla" )
CreateConfig(nil, T["Spell Queue Icon Size"], C.unitframes, "spellqueuesize", nil, nil, nil, nil, nil, "vanilla" )
CreateConfig(nil, T["Show Reactive Spell Indicator"], C.unitframes, "reactive_indicator", "checkbox", nil, nil, nil, nil, "vanilla" )
CreateConfig(nil, T["Reactive Indicator Size"], C.unitframes, "reactive_size", nil, nil, nil, nil, nil, "vanilla" )
CreateConfig(nil, T["Enhanced Buff Tracking"], C.unitframes, "nampower_buffs", "checkbox", nil, nil, nil, nil, "vanilla" )
CreateConfig(nil, T["UnitXP Settings"], nil, nil, "header")
CreateConfig(nil, T["Show Line of Sight Indicator"], C.unitframes, "los_indicator", "checkbox", nil, nil, nil, nil, "vanilla" )
CreateConfig(nil, T["Show Behind Indicator"], C.unitframes, "behind_indicator", "checkbox", nil, nil, nil, nil, "vanilla" )
CreateConfig(nil, T["Enable OS Notifications"], C.unitframes, "unitxp_notify", "checkbox", nil, nil, nil, nil, "vanilla" )
end)
-- Shared Unit- and Groupframes
@@ -2263,6 +2276,7 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
CreateConfig(nil, T["Generate Playerlinks"], C.chat.text, "playerlinks", "checkbox")
CreateConfig(nil, T["Enable URL Detection"], C.chat.text, "detecturl", "checkbox")
CreateConfig(nil, T["Enable Class Colors"], C.chat.text, "classcolor", "checkbox")
CreateConfig(nil, T["Enable Player Levels"], C.chat.text, "playerlevel", "checkbox")
CreateConfig(nil, T["Who Search Unknown Classes (|cffffaaaaExperimental|r)"], C.chat.text, "whosearchunknown", "checkbox")
CreateConfig(nil, T["Colorize Unknown Classes"], C.chat.text, "tintunknown", "checkbox")
CreateConfig(nil, T["Unknown Class Color"], C.chat.text, "unknowncolor", "color")
@@ -2388,36 +2402,26 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
CreateConfig(nil, "ShaguDPS (" .. T["Dock"] .. ")", C.thirdparty.shagudps, "dock", "checkbox")
CreateConfig(nil, "DPSMate (" .. T["Skin"] .. ")", C.thirdparty.dpsmate, "skin", "checkbox")
CreateConfig(nil, "DPSMate (" .. T["Dock"] .. ")", C.thirdparty.dpsmate, "dock", "checkbox")
CreateConfig(nil, "Recount (" .. T["Skin"] .. ")", C.thirdparty.recount, "skin", "checkbox", nil, nil, nil, nil, "tbc")
CreateConfig(nil, "Recount (" .. T["Dock"] .. ")", C.thirdparty.recount, "dock", "checkbox", nil, nil, nil, nil, "tbc")
CreateConfig(nil, "Omen (" .. T["Skin"] .. ")", C.thirdparty.omen, "skin", "checkbox", nil, nil, nil, nil, "tbc")
CreateConfig(nil, "Omen (" .. T["Dock"] .. ")", C.thirdparty.omen, "dock", "checkbox", nil, nil, nil, nil, "tbc")
CreateConfig(nil, "SWStats (" .. T["Skin"] .. ")", C.thirdparty.swstats, "skin", "checkbox", nil, nil, nil, nil, "vanilla")
CreateConfig(nil, "SWStats (" .. T["Dock"] .. ")", C.thirdparty.swstats, "dock", "checkbox", nil, nil, nil, nil, "vanilla")
CreateConfig(nil, "KLH Threat Meter (" .. T["Skin"] .. ")", C.thirdparty.ktm, "skin", "checkbox", nil, nil, nil, nil, "vanilla")
CreateConfig(nil, "KLH Threat Meter (" .. T["Dock"] .. ")", C.thirdparty.ktm, "dock", "checkbox", nil, nil, nil, nil, "vanilla")
CreateConfig(nil, "TW Threatmeter (" .. T["Skin"] .. ")", C.thirdparty.twt, "skin", "checkbox", nil, nil, nil, nil, "vanilla")
CreateConfig(nil, "TW Threatmeter (" .. T["Dock"] .. ")", C.thirdparty.twt, "dock", "checkbox", nil, nil, nil, nil, "vanilla")
CreateConfig(nil, "WIM", C.thirdparty.wim, "enable", "checkbox", nil, nil, nil, nil, "vanilla")
CreateConfig(nil, "HealComm", C.thirdparty.healcomm, "enable", "checkbox", nil, nil, nil, nil, "vanilla")
CreateConfig(nil, "SortBags", C.thirdparty.sortbags, "enable", "checkbox", nil, nil, nil, nil, "vanilla")
CreateConfig(nil, "Bag_Sort", C.thirdparty.bag_sort, "enable", "checkbox", nil, nil, nil, nil, "tbc")
CreateConfig(nil, "SWStats (" .. T["Skin"] .. ")", C.thirdparty.swstats, "skin", "checkbox")
CreateConfig(nil, "SWStats (" .. T["Dock"] .. ")", C.thirdparty.swstats, "dock", "checkbox")
CreateConfig(nil, "KLH Threat Meter (" .. T["Skin"] .. ")", C.thirdparty.ktm, "skin", "checkbox")
CreateConfig(nil, "KLH Threat Meter (" .. T["Dock"] .. ")", C.thirdparty.ktm, "dock", "checkbox")
CreateConfig(nil, "TW Threatmeter (" .. T["Skin"] .. ")", C.thirdparty.twt, "skin", "checkbox")
CreateConfig(nil, "TW Threatmeter (" .. T["Dock"] .. ")", C.thirdparty.twt, "dock", "checkbox")
CreateConfig(nil, "WIM", C.thirdparty.wim, "enable", "checkbox")
CreateConfig(nil, "HealComm", C.thirdparty.healcomm, "enable", "checkbox")
CreateConfig(nil, "SortBags", C.thirdparty.sortbags, "enable", "checkbox")
CreateConfig(nil, "MrPlow", C.thirdparty.mrplow, "enable", "checkbox")
CreateConfig(nil, "BetterCharacterStats", C.thirdparty.bcs, "enable", "checkbox", nil, nil, nil, nil, "vanilla")
CreateConfig(nil, "Crafty", C.thirdparty.crafty, "enable", "checkbox", nil, nil, nil, nil, "vanilla")
CreateConfig(nil, "CleverMacro", C.thirdparty.clevermacro, "enable", "checkbox", nil, nil, nil, nil, "vanilla")
CreateConfig(nil, "AckisRecipeList", C.thirdparty.ackis, "enable", "checkbox", nil, nil, nil, nil, "tbc")
CreateConfig(nil, "SheepWatch", C.thirdparty.sheepwatch, "enable", "checkbox", nil, nil, nil, nil, "tbc")
CreateConfig(nil, "TotemTimers", C.thirdparty.totemtimers, "enable", "checkbox", nil, nil, nil, nil, "tbc")
CreateConfig(nil, "DruidBar", C.thirdparty.druidbar, "enable", "checkbox", nil, nil, nil, nil, "tbc")
CreateConfig(nil, "BCEPGP", C.thirdparty.bcepgp, "enable", "checkbox", nil, nil, nil, nil, "tbc")
CreateConfig(nil, "FlightMap", C.thirdparty.flightmap, "enable", "checkbox", nil, nil, nil, nil, "vanilla")
CreateConfig(nil, "TheoryCraft", C.thirdparty.theorycraft, "enable", "checkbox", nil, nil, nil, nil, "vanilla")
CreateConfig(nil, "SuperMacro", C.thirdparty.supermacro, "enable", "checkbox", nil, nil, nil, nil, "vanilla")
CreateConfig(nil, "AtlasLoot", C.thirdparty.atlasloot, "enable", "checkbox", nil, nil, nil, nil, "vanilla")
CreateConfig(nil, "MyRolePlay", C.thirdparty.myroleplay, "enable", "checkbox", nil, nil, nil, nil, "vanilla")
CreateConfig(nil, "DruidManaBar", C.thirdparty.druidmana, "enable", "checkbox", nil, nil, nil, nil, "vanilla")
CreateConfig(nil, "NoteIt", C.thirdparty.noteit, "enable", "checkbox", nil, nil, nil, nil, "vanilla")
CreateConfig(nil, "BetterCharacterStats", C.thirdparty.bcs, "enable", "checkbox")
CreateConfig(nil, "Crafty", C.thirdparty.crafty, "enable", "checkbox")
CreateConfig(nil, "CleverMacro", C.thirdparty.clevermacro, "enable", "checkbox")
CreateConfig(nil, "FlightMap", C.thirdparty.flightmap, "enable", "checkbox")
CreateConfig(nil, "TheoryCraft", C.thirdparty.theorycraft, "enable", "checkbox")
CreateConfig(nil, "SuperMacro", C.thirdparty.supermacro, "enable", "checkbox")
CreateConfig(nil, "AtlasLoot", C.thirdparty.atlasloot, "enable", "checkbox")
CreateConfig(nil, "MyRolePlay", C.thirdparty.myroleplay, "enable", "checkbox")
CreateConfig(nil, "DruidManaBar", C.thirdparty.druidmana, "enable", "checkbox")
CreateConfig(nil, "NoteIt", C.thirdparty.noteit, "enable", "checkbox")
end)
CreateGUIEntry(T["Components"], T["Modules"], function()
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("hoverbind", "vanilla:tbc", function ()
pfUI:RegisterModule("hoverbind", "vanilla", function ()
local keymap = {
-- buttons to binding association
["pfActionBarMainButton"] = "ACTIONBUTTON",
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("infight", "vanilla:tbc", function ()
pfUI:RegisterModule("infight", "vanilla", function ()
local function OnUpdate()
if not this.infight and not this.aggro and not this.health then return end
if ( this.tick or 1) > GetTime() then return else this.tick = GetTime() + .1 end
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("loot", "vanilla:tbc", function ()
pfUI:RegisterModule("loot", "vanilla", function ()
local rawborder, border = GetBorderSize()
pfUI.loot = CreateFrame("Frame", "pfLootFrame", UIParent)
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("map", "vanilla:tbc", function ()
pfUI:RegisterModule("map", "vanilla", function ()
table.insert(UISpecialFrames, "WorldMapFrame")
local function UpdateTooltipScale()
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("mapreveal", "vanilla:tbc", function ()
pfUI:RegisterModule("mapreveal", "vanilla", function ()
-- do not load if other map addon is loaded
if Cartographer then return end
if METAMAP_TITLE then return end
+2 -2
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("minimap", "vanilla:tbc", function ()
pfUI:RegisterModule("minimap", "vanilla", function ()
local rawborder, border = GetBorderSize()
local size = tonumber(C.appearance.minimap.size) or 140
@@ -39,7 +39,7 @@ pfUI:RegisterModule("minimap", "vanilla:tbc", function ()
Minimap:SetWidth(size)
Minimap:SetHeight(size)
-- vanilla+tbc: do the best to detect the minimap arrow
-- do the best to detect the minimap arrow
local arrowscale = tonumber(C.appearance.minimap.arrowscale)
local minimaparrow = ({Minimap:GetChildren()})[9]
for k, v in pairs({Minimap:GetChildren()}) do
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("mirrortimers", "vanilla:tbc", function ()
pfUI:RegisterModule("mirrortimers", "vanilla", function ()
local font = pfUI.font_default
local fontsize = tonumber(C.global.font_size)
local height = fontsize * 1.3
+4 -2
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
pfUI:RegisterModule("nameplates", "vanilla", function ()
-- disable original castbars
pcall(SetCVar, "ShowVKeyCastbar", 0)
@@ -321,6 +321,9 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
end)
nameplates:SetScript("OnUpdate", function()
-- throttle to 10 updates per second instead of every frame
if (this.tick or 0.1) > GetTime() then return else this.tick = GetTime() + 0.1 end
-- propagate events to all nameplates
if this.eventcache then
this.eventcache = nil
@@ -1112,7 +1115,6 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
if pfUI.client <= 11200 then
-- handle vanilla only settings
-- due to the secured lua api, those settings can't be applied to TBC and later.
local hookOnConfigChange = nameplates.OnConfigChange
nameplates.OnConfigChange = function(self)
hookOnConfigChange(self)
+743
View File
@@ -0,0 +1,743 @@
-- Nampower integration module
-- Provides spell queue indicator and enhanced cast information
-- Requires Nampower DLL: https://gitea.com/avitasia/nampower
pfUI:RegisterModule("nampower", "vanilla", function ()
-- Only load if Nampower is available
if not GetNampowerVersion then return end
local rawborder, border = GetBorderSize()
-- Spell Queue Indicator
-- Shows the currently queued spell icon near the castbar
if C.unitframes.spellqueue == "1" then
local size = tonumber(C.unitframes.spellqueuesize) or 32
pfUI.spellqueue = CreateFrame("Frame", "pfSpellQueue", UIParent)
pfUI.spellqueue:SetFrameStrata("HIGH")
pfUI.spellqueue:SetWidth(size)
pfUI.spellqueue:SetHeight(size)
pfUI.spellqueue:Hide()
-- Position near player castbar if available
if pfUI.castbar and pfUI.castbar.player then
pfUI.spellqueue:SetPoint("LEFT", pfUI.castbar.player, "RIGHT", border*3, 0)
else
pfUI.spellqueue:SetPoint("CENTER", UIParent, "CENTER", 100, -100)
end
pfUI.spellqueue.icon = pfUI.spellqueue:CreateTexture("OVERLAY")
pfUI.spellqueue.icon:SetAllPoints(pfUI.spellqueue)
pfUI.spellqueue.icon:SetTexCoord(.08, .92, .08, .92)
UpdateMovable(pfUI.spellqueue)
CreateBackdrop(pfUI.spellqueue)
CreateBackdropShadow(pfUI.spellqueue)
-- Event codes from Nampower
local ON_SWING_QUEUED = 0
local ON_SWING_QUEUE_POPPED = 1
local NORMAL_QUEUED = 2
local NORMAL_QUEUE_POPPED = 3
local NON_GCD_QUEUED = 4
local NON_GCD_QUEUE_POPPED = 5
local queue = CreateFrame("Frame")
queue:RegisterEvent("SPELL_QUEUE_EVENT")
queue:SetScript("OnEvent", function()
local eventCode = arg1
local spellId = arg2
if eventCode == NORMAL_QUEUED or eventCode == NON_GCD_QUEUED or eventCode == ON_SWING_QUEUED then
-- Get spell texture from SpellInfo (SuperWoW) or GetSpellTexture
local texture
if SpellInfo then
local _, _, tex = SpellInfo(spellId)
texture = tex
end
if texture then
pfUI.spellqueue.icon:SetTexture(texture)
pfUI.spellqueue:Show()
end
elseif eventCode == NORMAL_QUEUE_POPPED or eventCode == NON_GCD_QUEUE_POPPED or eventCode == ON_SWING_QUEUE_POPPED then
pfUI.spellqueue:Hide()
end
end)
end
-- Enhanced Debuff Tracking using Nampower events
-- DEBUFF_ADDED_OTHER/DEBUFF_REMOVED_OTHER provide accurate debuff tracking with spellId
if libdebuff then
-- Storage for GUID-based debuff tracking
pfUI.nampower_debuffs = pfUI.nampower_debuffs or {}
local debuffdb = pfUI.nampower_debuffs
-- Get player GUID for tracking own debuffs
local playerGuid
local debuffTracker = CreateFrame("Frame")
debuffTracker:RegisterEvent("PLAYER_ENTERING_WORLD")
debuffTracker:RegisterEvent("DEBUFF_ADDED_OTHER")
debuffTracker:RegisterEvent("DEBUFF_REMOVED_OTHER")
debuffTracker:RegisterEvent("DEBUFF_ADDED_SELF")
debuffTracker:RegisterEvent("DEBUFF_REMOVED_SELF")
debuffTracker:SetScript("OnEvent", function()
if event == "PLAYER_ENTERING_WORLD" then
-- Cache player GUID
if UnitExists then
local _, guid = UnitExists("player")
playerGuid = guid
end
return
end
-- DEBUFF events: arg1=guid, arg2=slot, arg3=spellId, arg4=stackCount, arg5=auraLevel
local guid = arg1
local slot = arg2
local spellId = arg3
local stackCount = arg4
local auraLevel = arg5
if not guid or not spellId then return end
if event == "DEBUFF_ADDED_OTHER" or event == "DEBUFF_ADDED_SELF" then
-- Initialize storage for this GUID
if not debuffdb[guid] then debuffdb[guid] = {} end
-- Get spell info
local spellName, spellRank, texture
if SpellInfo then
spellName, spellRank, texture = SpellInfo(spellId)
end
if GetSpellNameAndRankForId then
spellName, spellRank = GetSpellNameAndRankForId(spellId)
end
if spellName then
-- Get duration from libdebuff's duration table or GetSpellRec
local duration = 0
if libdebuff.GetDuration then
duration = libdebuff:GetDuration(spellName, spellRank)
end
-- Try GetSpellRec for duration if libdebuff doesn't have it
if duration == 0 and GetSpellRec then
local spellRec = GetSpellRec(spellId)
if spellRec and spellRec.durationIndex and spellRec.durationIndex > 0 then
-- Duration index maps to spell duration - common values:
-- This is a rough approximation since we don't have the duration table
duration = 30 -- Default fallback
end
end
-- Store debuff data
debuffdb[guid][spellId] = {
spellId = spellId,
name = spellName,
rank = spellRank,
texture = texture,
stacks = stackCount or 1,
start = GetTime(),
duration = duration,
slot = slot,
auraLevel = auraLevel,
caster = (event == "DEBUFF_ADDED_SELF" or guid == playerGuid) and "player" or nil
}
-- Also update libdebuff's internal tracking if we have unit info
local unitName = UnitName and guid and UnitName(guid)
local unitLevel = UnitLevel and guid and UnitLevel(guid)
if unitName and duration > 0 then
libdebuff:AddEffect(unitName, unitLevel or 0, spellName, duration, "player")
end
end
elseif event == "DEBUFF_REMOVED_OTHER" or event == "DEBUFF_REMOVED_SELF" then
-- Remove debuff from tracking
if debuffdb[guid] and debuffdb[guid][spellId] then
debuffdb[guid][spellId] = nil
end
end
end)
-- Enhanced UnitDebuff function that uses Nampower data
-- This provides more accurate debuff information when available
local originalUnitDebuff = libdebuff.UnitDebuff
function libdebuff:UnitDebuffNampower(unit, id)
-- First try the original method
local effect, rank, texture, stacks, dtype, duration, timeleft, caster = originalUnitDebuff(self, unit, id)
-- If we have Nampower data for this unit, try to enhance it
local _, guid = UnitExists(unit)
if guid and debuffdb[guid] then
-- Find the debuff by slot
for spellId, data in pairs(debuffdb[guid]) do
if data.slot == id then
-- Use Nampower data for more accurate timing
if data.duration and data.duration > 0 and data.start then
duration = data.duration
timeleft = data.duration + data.start - GetTime()
if timeleft < 0 then timeleft = 0 end
caster = data.caster
stacks = data.stacks or stacks
end
break
end
end
end
return effect, rank, texture, stacks, dtype, duration, timeleft, caster
end
-- Expose enhanced function
pfUI.api.libdebuff_nampower = libdebuff.UnitDebuffNampower
end
-- Enhanced buff tracking using BUFF events
if C.unitframes.nampower_buffs == "1" then
pfUI.nampower_buffs = pfUI.nampower_buffs or {}
local buffdb = pfUI.nampower_buffs
local buffTracker = CreateFrame("Frame")
buffTracker:RegisterEvent("BUFF_ADDED_OTHER")
buffTracker:RegisterEvent("BUFF_REMOVED_OTHER")
buffTracker:RegisterEvent("BUFF_ADDED_SELF")
buffTracker:RegisterEvent("BUFF_REMOVED_SELF")
buffTracker:SetScript("OnEvent", function()
local guid = arg1
local slot = arg2
local spellId = arg3
local stackCount = arg4
local auraLevel = arg5
if not guid or not spellId then return end
if event == "BUFF_ADDED_OTHER" or event == "BUFF_ADDED_SELF" then
if not buffdb[guid] then buffdb[guid] = {} end
local spellName, spellRank, texture
if SpellInfo then
spellName, spellRank, texture = SpellInfo(spellId)
end
if GetSpellNameAndRankForId then
spellName, spellRank = GetSpellNameAndRankForId(spellId)
end
buffdb[guid][spellId] = {
spellId = spellId,
name = spellName,
rank = spellRank,
texture = texture,
stacks = stackCount or 1,
start = GetTime(),
slot = slot,
auraLevel = auraLevel
}
elseif event == "BUFF_REMOVED_OTHER" or event == "BUFF_REMOVED_SELF" then
if buffdb[guid] and buffdb[guid][spellId] then
buffdb[guid][spellId] = nil
end
end
end)
end
-- Direct Aura Access API using GetUnitField
-- Much faster than tooltip scanning - reads aura arrays directly from unit fields
if GetUnitField then
pfUI.api.GetUnitAuras = function(unit)
local auras = GetUnitField(unit, "aura")
local auraLevels = GetUnitField(unit, "auraLevels")
local auraStacks = GetUnitField(unit, "auraApplications")
if not auras then return nil end
local result = {}
for i = 1, 48 do
local spellId = auras[i]
if spellId and spellId > 0 then
local name, rank, texture
if SpellInfo then
name, rank, texture = SpellInfo(spellId)
elseif GetSpellNameAndRankForId then
name, rank = GetSpellNameAndRankForId(spellId)
end
result[i] = {
spellId = spellId,
name = name,
rank = rank,
texture = texture,
level = auraLevels and auraLevels[i] or 0,
stacks = auraStacks and auraStacks[i] or 1,
isBuff = i <= 32, -- First 32 slots are buffs, rest are debuffs
}
end
end
return result
end
-- Quick check if unit has specific aura by spellId
pfUI.api.UnitHasAura = function(unit, spellId)
local auras = GetUnitField(unit, "aura")
if not auras then return false end
for i = 1, 48 do
if auras[i] == spellId then return true, i end
end
return false
end
-- Get unit resistances directly
pfUI.api.GetUnitResistances = function(unit)
local res = GetUnitField(unit, "resistances")
if not res then return nil end
return {
armor = res[1],
holy = res[2],
fire = res[3],
nature = res[4],
frost = res[5],
shadow = res[6],
arcane = res[7]
}
end
end
-- Reactive Spell Indicator using IsSpellUsable
-- Shows when reactive abilities like Overpower, Revenge, Execute are usable
if IsSpellUsable and C.unitframes.reactive_indicator == "1" then
local size = tonumber(C.unitframes.reactive_size) or 28
local _, class = UnitClass("player")
-- Reactive spells by class
local reactiveSpells = {
WARRIOR = {
{ name = "Overpower", texture = "Interface\\Icons\\Ability_MeleeDamage" },
{ name = "Revenge", texture = "Interface\\Icons\\Ability_Warrior_Revenge" },
{ name = "Execute", texture = "Interface\\Icons\\INV_Sword_48" },
},
ROGUE = {
{ name = "Riposte", texture = "Interface\\Icons\\Ability_Warrior_Challange" },
},
HUNTER = {
{ name = "Mongoose Bite", texture = "Interface\\Icons\\Ability_Hunter_SwiftStrike" },
{ name = "Counterattack", texture = "Interface\\Icons\\Ability_Warrior_Challange" },
},
}
local spells = reactiveSpells[class]
if spells then
pfUI.reactive = CreateFrame("Frame", "pfReactiveIndicator", UIParent)
pfUI.reactive:SetFrameStrata("HIGH")
local spellCount = table.getn(spells)
pfUI.reactive:SetWidth(size * spellCount + 4 * (spellCount - 1))
pfUI.reactive:SetHeight(size)
pfUI.reactive:SetPoint("CENTER", UIParent, "CENTER", 0, -200)
pfUI.reactive:Hide()
pfUI.reactive.icons = {}
for i, spell in ipairs(spells) do
local icon = CreateFrame("Frame", nil, pfUI.reactive)
icon:SetWidth(size)
icon:SetHeight(size)
icon:SetPoint("LEFT", pfUI.reactive, "LEFT", (i-1) * (size + 4), 0)
icon.texture = icon:CreateTexture(nil, "ARTWORK")
icon.texture:SetAllPoints(icon)
icon.texture:SetTexture(spell.texture)
icon.texture:SetTexCoord(.08, .92, .08, .92)
icon.glow = icon:CreateTexture(nil, "OVERLAY")
icon.glow:SetPoint("TOPLEFT", icon, "TOPLEFT", -4, 4)
icon.glow:SetPoint("BOTTOMRIGHT", icon, "BOTTOMRIGHT", 4, -4)
icon.glow:SetTexture(pfUI.media["img:glow"])
icon.glow:SetVertexColor(1, 1, 0, 0.8)
CreateBackdrop(icon)
icon:Hide()
icon.spellName = spell.name
pfUI.reactive.icons[i] = icon
end
UpdateMovable(pfUI.reactive)
pfUI.reactive:SetScript("OnUpdate", function()
local anyVisible = false
for _, icon in ipairs(this.icons) do
local usable = IsSpellUsable(icon.spellName)
if usable == 1 then
icon:Show()
anyVisible = true
else
icon:Hide()
end
end
if anyVisible then
this:Show()
else
this:Hide()
end
end)
end
end
-- Enhanced Cooldown Tracking API using GetSpellIdCooldown
if GetSpellIdCooldown then
pfUI.api.GetPreciseCooldown = function(spellId)
local cd = GetSpellIdCooldown(spellId)
if not cd then return nil end
return {
onCooldown = cd.isOnCooldown == 1,
remaining = cd.cooldownRemainingMs / 1000,
remainingMs = cd.cooldownRemainingMs,
gcdRemaining = cd.gcdCategoryRemainingMs / 1000,
gcdRemainingMs = cd.gcdCategoryRemainingMs,
individualRemaining = cd.individualRemainingMs / 1000,
categoryRemaining = cd.categoryRemainingMs / 1000,
}
end
-- Item cooldown helper
pfUI.api.GetPreciseItemCooldown = function(itemId)
if not GetItemIdCooldown then return nil end
local cd = GetItemIdCooldown(itemId)
if not cd then return nil end
return {
onCooldown = cd.isOnCooldown == 1,
remaining = cd.cooldownRemainingMs / 1000,
remainingMs = cd.cooldownRemainingMs,
}
end
end
-- UNIT_DIED event handling
-- Can be used to clear tracking data or trigger effects on unit death
local deathTracker = CreateFrame("Frame")
deathTracker:RegisterEvent("UNIT_DIED")
deathTracker:SetScript("OnEvent", function()
local guid = arg1
if not guid then return end
-- Clean up debuff tracking for dead units
if pfUI.nampower_debuffs and pfUI.nampower_debuffs[guid] then
pfUI.nampower_debuffs[guid] = nil
end
if pfUI.nampower_buffs and pfUI.nampower_buffs[guid] then
pfUI.nampower_buffs[guid] = nil
end
end)
-- Trinket Management API
if GetTrinkets then
pfUI.api.GetEquippedTrinkets = function()
local trinkets = GetTrinkets()
local equipped = {}
for _, trinket in pairs(trinkets) do
if trinket.bagIndex == nil then -- nil bagIndex = equipped
table.insert(equipped, trinket)
end
end
return equipped
end
pfUI.api.GetTrinketCooldown = function(slot)
if not GetTrinketCooldown then return nil end
local cd = GetTrinketCooldown(slot)
if cd == -1 then return nil end
return {
onCooldown = cd.isOnCooldown == 1,
remaining = cd.cooldownRemainingMs / 1000,
remainingMs = cd.cooldownRemainingMs,
}
end
pfUI.api.UseTrinket = function(slot, target)
if not UseTrinket then return false end
return UseTrinket(slot, target) == 1
end
end
-- Nampower Item Stats API (use distinct name to avoid conflicts)
if GetItemStats then
pfUI.api.GetNampowerItemStats = function(itemId)
local success, stats = pcall(GetItemStats, itemId, true)
if not success or not stats then return nil end
return stats
end
-- Quick item level lookup
pfUI.api.GetNampowerItemLevel = function(itemId)
if GetItemLevel then
return GetItemLevel(itemId)
end
local success, stats = pcall(GetItemStats, itemId, true)
if success and stats then
return stats.itemLevel
end
return nil
end
end
-- Spell Modifiers API for damage/heal predictions
if GetSpellModifiers then
pfUI.api.GetSpellBonus = function(spellId, modType)
-- modType: 0=DAMAGE, 1=DURATION, 6=RADIUS, 7=CRIT, 10=CAST_TIME, 14=COST, etc.
local flat, percent, hasmod = GetSpellModifiers(spellId, modType or 0)
return {
flat = flat or 0,
percent = percent or 0,
hasModifier = hasmod and hasmod ~= 0,
}
end
-- Common spell modifier lookups
pfUI.api.GetSpellDamageBonus = function(spellId)
return pfUI.api.GetSpellBonus(spellId, 0) -- DAMAGE
end
pfUI.api.GetSpellCritBonus = function(spellId)
return pfUI.api.GetSpellBonus(spellId, 7) -- CRITICAL_CHANCE
end
pfUI.api.GetSpellCostReduction = function(spellId)
return pfUI.api.GetSpellBonus(spellId, 14) -- COST
end
end
-- Inventory/Bag API
if GetBagItems then
pfUI.api.GetAllBagItems = function()
return GetBagItems()
end
pfUI.api.FindItem = function(itemIdOrName)
if FindPlayerItemSlot then
local bag, slot = FindPlayerItemSlot(itemIdOrName)
return bag, slot
end
return nil, nil
end
pfUI.api.UseItem = function(itemIdOrName, target)
if UseItemIdOrName then
return UseItemIdOrName(itemIdOrName, target) == 1
end
return false
end
end
-- Equipment Inspection API
if GetEquippedItems then
pfUI.api.GetPlayerEquipment = function()
return GetEquippedItems("player")
end
pfUI.api.GetTargetEquipment = function()
return GetEquippedItems("target")
end
pfUI.api.GetEquippedItemInfo = function(unit, slot)
if GetEquippedItem then
return GetEquippedItem(unit, slot)
end
return nil
end
end
-- Spell Lookup Helpers
if GetSpellIdForName then
pfUI.api.GetMaxRankSpellId = function(spellName)
return GetSpellIdForName(spellName)
end
end
if GetSpellSlotTypeIdForName then
pfUI.api.GetSpellSlotInfo = function(spellName)
local slot, bookType, spellId = GetSpellSlotTypeIdForName(spellName)
return {
slot = slot,
bookType = bookType,
spellId = spellId,
}
end
end
-- Queue Script API for advanced macro functionality
if QueueScript then
pfUI.api.QueueLuaScript = function(script, priority)
QueueScript(script, priority or 1)
end
end
if QueueSpellByName then
pfUI.api.QueueSpell = function(spellName)
QueueSpellByName(spellName)
end
end
-- Channel optimization
if ChannelStopCastingNextTick then
pfUI.api.StopChannelNextTick = function()
ChannelStopCastingNextTick()
end
end
-- Spell Database Access via GetSpellRec
if GetSpellRec then
pfUI.api.GetSpellRecord = function(spellId)
local rec = GetSpellRec(spellId)
if not rec then return nil end
return {
spellId = spellId,
name = rec.name,
rank = rec.rank,
description = rec.description,
manaCost = rec.manaCost,
baseLevel = rec.baseLevel,
spellLevel = rec.spellLevel,
maxLevel = rec.maxLevel,
maxTargetLevel = rec.maxTargetLevel,
maxTargets = rec.maxTargets,
durationIndex = rec.durationIndex,
powerType = rec.powerType,
rangeIndex = rec.rangeIndex,
speed = rec.speed,
schoolMask = rec.schoolMask,
runeCostID = rec.runeCostID,
spellMissileID = rec.spellMissileID,
iconID = rec.iconID,
activeIconID = rec.activeIconID,
nameSubtext = rec.nameSubtext,
castingTimeIndex = rec.castingTimeIndex,
categoryRecoveryTime = rec.categoryRecoveryTime,
recoveryTime = rec.recoveryTime,
startRecoveryCategory = rec.startRecoveryCategory,
startRecoveryTime = rec.startRecoveryTime,
}
end
-- Get spell school (fire, frost, nature, etc.)
pfUI.api.GetSpellSchool = function(spellId)
local rec = GetSpellRec(spellId)
if not rec then return nil end
local schools = {
[1] = "Physical",
[2] = "Holy",
[4] = "Fire",
[8] = "Nature",
[16] = "Frost",
[32] = "Shadow",
[64] = "Arcane",
}
return schools[rec.schoolMask] or "Unknown"
end
end
-- Disenchant All utility
if DisenchantAll then
pfUI.api.DisenchantAllItems = function()
DisenchantAll()
end
SLASH_PFDISENCHANTALL1 = "/disenchantall"
SLASH_PFDISENCHANTALL2 = "/dea"
SlashCmdList["PFDISENCHANTALL"] = function()
DisenchantAll()
DEFAULT_CHAT_FRAME:AddMessage("|cff33ffccpfUI|r: Disenchanting all eligible items...")
end
end
-- Enhanced Heal Prediction with AURA_CAST events
-- This helps libpredict detect HoT applications more accurately
if libpredict then
local auraCastFrame = CreateFrame("Frame")
auraCastFrame:RegisterEvent("AURA_CAST_ON_SELF")
auraCastFrame:RegisterEvent("AURA_CAST_ON_OTHER")
auraCastFrame:SetScript("OnEvent", function()
local casterGuid = arg1
local targetGuid = arg2
local spellId = arg3
if not spellId or not targetGuid then return end
-- Get spell name
local spellName
if SpellInfo then
spellName = SpellInfo(spellId)
elseif GetSpellNameAndRankForId then
spellName = GetSpellNameAndRankForId(spellId)
end
if not spellName then return end
-- Check if this is a HoT spell we care about
local hotSpells = {
["Rejuvenation"] = true,
["Renew"] = true,
["Regrowth"] = true,
["Verjüngung"] = true, -- German
["Erneuerung"] = true,
["Nachwachsen"] = true,
}
if hotSpells[spellName] then
-- Signal to libpredict that a HoT was applied
-- This can be used to update heal predictions
if pfUI.api.libpredict and pfUI.api.libpredict.OnHotApplied then
pfUI.api.libpredict:OnHotApplied(targetGuid, spellName, spellId)
end
end
end)
end
-- Swing Timer Integration
-- Track auto-attack swing timers for melee classes
local swingFrame = CreateFrame("Frame")
swingFrame.mainHand = { start = 0, speed = 0 }
swingFrame.offHand = { start = 0, speed = 0 }
swingFrame.ranged = { start = 0, speed = 0 }
swingFrame:RegisterEvent("PLAYER_ENTER_COMBAT")
swingFrame:RegisterEvent("PLAYER_LEAVE_COMBAT")
swingFrame:RegisterEvent("CHAT_MSG_COMBAT_SELF_HITS")
swingFrame:RegisterEvent("CHAT_MSG_COMBAT_SELF_MISSES")
swingFrame:SetScript("OnEvent", function()
if event == "PLAYER_ENTER_COMBAT" then
local mainSpeed, offSpeed = UnitAttackSpeed("player")
this.mainHand.speed = mainSpeed or 2
this.offHand.speed = offSpeed or 0
this.mainHand.start = GetTime()
if this.offHand.speed > 0 then
this.offHand.start = GetTime()
end
elseif event == "CHAT_MSG_COMBAT_SELF_HITS" or event == "CHAT_MSG_COMBAT_SELF_MISSES" then
-- Reset swing timer on hit/miss
local mainSpeed, offSpeed = UnitAttackSpeed("player")
this.mainHand.speed = mainSpeed or 2
this.mainHand.start = GetTime()
end
end)
pfUI.api.GetSwingTimers = function()
local now = GetTime()
local mainRemaining = swingFrame.mainHand.speed - (now - swingFrame.mainHand.start)
local offRemaining = swingFrame.offHand.speed > 0 and (swingFrame.offHand.speed - (now - swingFrame.offHand.start)) or 0
return {
mainHand = {
remaining = math.max(0, mainRemaining),
speed = swingFrame.mainHand.speed,
progress = swingFrame.mainHand.speed > 0 and (1 - math.max(0, mainRemaining) / swingFrame.mainHand.speed) or 0,
},
offHand = {
remaining = math.max(0, offRemaining),
speed = swingFrame.offHand.speed,
progress = swingFrame.offHand.speed > 0 and (1 - math.max(0, offRemaining) / swingFrame.offHand.speed) or 0,
},
}
end
end)
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("panel", "vanilla:tbc", function()
pfUI:RegisterModule("panel", "vanilla", function()
-- initialize gold cache if not yet happened
pfUI_cache["gold"] = pfUI_cache["gold"] or {}
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("pet", "vanilla:tbc", function ()
pfUI:RegisterModule("pet", "vanilla", function ()
-- do not go further on disabled UFs
if C.unitframes.disable == "1" then return end
pfUI.uf.pet = pfUI.uf:CreateUnitFrame("Pet", nil, C.unitframes.pet)
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("pettarget", "vanilla:tbc", function ()
pfUI:RegisterModule("pettarget", "vanilla", function ()
-- do not go further on disabled UFs
if C.unitframes.disable == "1" then return end
local rawborder, default_border = GetBorderSize("unitframes")
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("pixelperfect", "vanilla:tbc", function ()
pfUI:RegisterModule("pixelperfect", "vanilla", function ()
-- pre-calculated min values
local statics = {
[4] = 1.4222222222222,
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("player", "vanilla:tbc", function ()
pfUI:RegisterModule("player", "vanilla", function ()
-- do not go further on disabled UFs
if C.unitframes.disable == "1" then return end
+1 -5
View File
@@ -96,11 +96,7 @@ pfUI:RegisterModule("questitem", function ()
SelectQuestLogEntry(quest)
-- detect and ignore quest headers
if pfUI.client <= 11200 then -- vanilla
_, _, _, header = GetQuestLogTitle(quest)
elseif pfUI.client > 11200 then -- tbc
_, _, _, _, header = GetQuestLogTitle(quest)
end
_, _, _, header = GetQuestLogTitle(quest)
if not header then
text, objective = GetQuestLogQuestText()
+6 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("raid", "vanilla:tbc", function ()
pfUI:RegisterModule("raid", "vanilla", function ()
-- do not go further on disabled UFs
if C.unitframes.disable == "1" then return end
@@ -109,6 +109,11 @@ pfUI:RegisterModule("raid", "vanilla:tbc", function ()
end
end
-- rebuild unitmap after frame IDs are assigned
if pfUI.uf.RebuildUnitmap then
pfUI.uf.RebuildUnitmap()
end
this:Hide()
end)
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("roll", "vanilla:tbc", function ()
pfUI:RegisterModule("roll", "vanilla", function ()
pfUI.roll = CreateFrame("Frame", "pfLootRoll", UIParent)
pfUI.roll.frames = {}
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("screenshot", "vanilla:tbc", function ()
pfUI:RegisterModule("screenshot", "vanilla", function ()
if C.screenshot.interval == "0"
and C.screenshot.levelup == "0"
and C.screenshot.pvprank == "0"
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("sellvalue", "vanilla:tbc", function ()
pfUI:RegisterModule("sellvalue", "vanilla", function ()
local function AddVendorPrices(frame, id, count)
if pfSellData[id] then
local _, _, sell, buy = strfind(pfSellData[id], "(.*),(.*)")
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("share", "vanilla:tbc", function ()
pfUI:RegisterModule("share", "vanilla", function ()
local function serialize(tbl, comp, name, ignored, spacing)
local spacing = spacing or ""
local match = nil
+4 -1
View File
@@ -1,7 +1,10 @@
pfUI:RegisterModule("skin", "vanilla:tbc", function ()
pfUI:RegisterModule("skin", "vanilla", function ()
-- align UIParent panels
pfUI.panelalign = CreateFrame("Frame", "pfUIParentPanelAlign", UIParent)
pfUI.panelalign:SetScript("OnUpdate", function()
-- throttle to 5 updates per second instead of every frame
if (this.tick or 0.2) > GetTime() then return else this.tick = GetTime() + 0.2 end
local left = UIParent.left
local center = UIParent.center
local rbpos, ropos
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("socialmod", "vanilla:tbc", function ()
pfUI:RegisterModule("socialmod", "vanilla", function ()
local playerdb = _G.pfUI_playerDB
pfUI.socialmod = CreateFrame("Frame", "pfSocialMod", UIParent)
pfUI.socialmod:RegisterEvent("CHAT_MSG_SYSTEM")
+350 -29
View File
@@ -1,6 +1,82 @@
-- Compatibility layer to use castbars provided by SuperWoW:
-- https://github.com/balakethelock/SuperWoW
-- DLL Status Check Command (always available)
SLASH_PFDLLSTATUS1 = "/pfdll"
SlashCmdList["PFDLLSTATUS"] = function()
local chat = DEFAULT_CHAT_FRAME
chat:AddMessage("|cff33ffccpfUI|r: DLL Status Check")
-- SuperWoW
if SUPERWOW_VERSION then
chat:AddMessage(" |cff00ff00SuperWoW|r: v" .. tostring(SUPERWOW_VERSION))
elseif SpellInfo or SetAutoloot then
chat:AddMessage(" |cffffff00SuperWoW|r: Detected (old version)")
else
chat:AddMessage(" |cffff0000SuperWoW|r: Not detected")
end
-- Nampower
if GetNampowerVersion then
chat:AddMessage(" |cff00ff00Nampower|r: v" .. tostring(GetNampowerVersion()))
else
chat:AddMessage(" |cffff0000Nampower|r: Not detected")
end
-- UnitXP
local hasUnitXP = pcall(UnitXP, "nop", "nop")
if hasUnitXP then
chat:AddMessage(" |cff00ff00UnitXP_SP3|r: Detected")
else
chat:AddMessage(" |cffff0000UnitXP_SP3|r: Not detected")
end
-- Check if castbar exists for indicator positioning
if pfUI.castbar and pfUI.castbar.player then
chat:AddMessage(" |cff00ff00Castbar|r: Available for indicator anchoring")
else
chat:AddMessage(" |cffffff00Castbar|r: Not available (indicators use fallback position)")
end
-- Check indicator frames
if pfUI.uf and pfUI.uf.target then
chat:AddMessage(" |cff00ff00Target frame|r: exists")
if pfUI.uf.target.behindIndicator then
chat:AddMessage(" |cff00ff00Behind indicator|r: created")
else
chat:AddMessage(" |cffff0000Behind indicator|r: NOT created")
end
if pfUI.uf.target.losIndicator then
chat:AddMessage(" |cff00ff00LOS indicator|r: created")
else
chat:AddMessage(" |cffff0000LOS indicator|r: NOT created")
end
else
chat:AddMessage(" |cffff0000Target frame|r: NOT found")
end
end
-- UnitXP Behind/LOS test command
SLASH_PFBEHIND1 = "/pfbehind"
SlashCmdList["PFBEHIND"] = function()
local chat = DEFAULT_CHAT_FRAME
if not UnitExists("target") then
chat:AddMessage("|cff33ffccpfUI|r: No target")
return
end
local hasUnitXP = pcall(UnitXP, "nop", "nop")
if not hasUnitXP then
chat:AddMessage("|cff33ffccpfUI|r: UnitXP not available")
return
end
local successB, behind = pcall(UnitXP, "behind", "player", "target")
local successL, inSight = pcall(UnitXP, "inSight", "player", "target")
chat:AddMessage("|cff33ffccpfUI|r: Behind=" .. tostring(behind) .. " LOS=" .. tostring(inSight))
end
pfUI:RegisterModule("superwow", "vanilla", function ()
if SetAutoloot and SpellInfo and not SUPERWOW_VERSION then
-- Turn every enchanting link that we create in the enchanting frame,
@@ -248,12 +324,264 @@ pfUI:RegisterModule("superwow", "vanilla", function ()
libdebuff:AddEffect(unit, unitlevel, effect, duration, caster)
end)
-- Enhance libcast with SuperWoW data
-- TrackUnit API for adding group members to minimap
-- Tracks friendly units on the minimap for easier group coordination
if TrackUnit and C.unitframes.track_group == "1" then
local trackFrame = CreateFrame("Frame")
trackFrame:RegisterEvent("PARTY_MEMBERS_CHANGED")
trackFrame:RegisterEvent("RAID_ROSTER_UPDATE")
trackFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
trackFrame:SetScript("OnEvent", function()
-- Track party members
for i = 1, 4 do
local unit = "party" .. i
if UnitExists(unit) and UnitIsConnected(unit) then
pcall(TrackUnit, unit)
end
end
-- Track raid members
for i = 1, 40 do
local unit = "raid" .. i
if UnitExists(unit) and UnitIsConnected(unit) and not UnitIsUnit(unit, "player") then
pcall(TrackUnit, unit)
end
end
end)
end
-- Raid Marker Targeting API
-- Allows targeting units by raid marker ("mark1" to "mark8")
if SUPERWOW_VERSION then
pfUI.api.GetMarkedUnit = function(markIndex)
local markUnit = "mark" .. markIndex
if UnitExists(markUnit) then
return markUnit
end
return nil
end
pfUI.api.TargetMark = function(markIndex)
local markUnit = "mark" .. markIndex
if UnitExists(markUnit) then
TargetUnit(markUnit)
return true
end
return false
end
-- Get owner of pet/totem using "owner" suffix
pfUI.api.GetUnitOwner = function(unit)
local ownerUnit = unit .. "owner"
if UnitExists(ownerUnit) then
return UnitName(ownerUnit), ownerUnit
end
return nil
end
end
-- Enhanced SpellInfo API wrapper
if SpellInfo then
pfUI.api.GetSpellInfo = function(spellId)
local name, rank, texture, minRange, maxRange = SpellInfo(spellId)
return {
name = name,
rank = rank,
texture = texture,
minRange = minRange,
maxRange = maxRange,
spellId = spellId
}
end
end
-- Clickthrough Mode API
-- Allows clicking through corpses to loot underneath
if Clickthrough then
pfUI.api.SetClickthrough = function(enabled)
Clickthrough(enabled and 1 or 0)
end
pfUI.api.GetClickthrough = function()
return Clickthrough() == 1
end
pfUI.api.ToggleClickthrough = function()
local current = Clickthrough()
Clickthrough(current == 1 and 0 or 1)
return Clickthrough() == 1
end
-- Add slash command for clickthrough toggle
SLASH_PFCLICKTHROUGH1 = "/clickthrough"
SLASH_PFCLICKTHROUGH2 = "/ct"
SlashCmdList["PFCLICKTHROUGH"] = function()
local enabled = pfUI.api.ToggleClickthrough()
DEFAULT_CHAT_FRAME:AddMessage("|cff33ffccpfUI|r: Clickthrough mode " .. (enabled and "|cff00ff00enabled|r" or "|cffff0000disabled|r"))
end
end
-- Autoloot Control API
if SetAutoloot then
pfUI.api.SetAutoloot = function(enabled)
SetAutoloot(enabled and 1 or 0)
end
pfUI.api.GetAutoloot = function()
return SetAutoloot() == 1
end
pfUI.api.ToggleAutoloot = function()
local current = SetAutoloot()
SetAutoloot(current == 1 and 0 or 1)
return SetAutoloot() == 1
end
end
-- Config Import/Export API using ImportFile/ExportFile
if ImportFile and ExportFile then
pfUI.api.ExportConfig = function(filename)
filename = filename or "pfUI_config_backup.txt"
local configStr = ""
-- Serialize config to string
local function serialize(tbl, indent)
indent = indent or ""
local result = "{\n"
for k, v in pairs(tbl) do
local keyStr = type(k) == "string" and '["' .. k .. '"]' or "[" .. tostring(k) .. "]"
if type(v) == "table" then
result = result .. indent .. " " .. keyStr .. " = " .. serialize(v, indent .. " ") .. ",\n"
elseif type(v) == "string" then
result = result .. indent .. " " .. keyStr .. ' = "' .. v .. '",\n'
else
result = result .. indent .. " " .. keyStr .. " = " .. tostring(v) .. ",\n"
end
end
return result .. indent .. "}"
end
if pfUI_config then
configStr = "pfUI_config = " .. serialize(pfUI_config)
ExportFile(filename, configStr)
DEFAULT_CHAT_FRAME:AddMessage("|cff33ffccpfUI|r: Config exported to imports/" .. filename)
return true
end
return false
end
pfUI.api.ImportConfig = function(filename)
filename = filename or "pfUI_config_backup.txt"
local content = ImportFile(filename)
if content and content ~= "" then
-- Load the config string
local func, err = loadstring(content)
if func then
func()
DEFAULT_CHAT_FRAME:AddMessage("|cff33ffccpfUI|r: Config imported from imports/" .. filename)
DEFAULT_CHAT_FRAME:AddMessage("|cff33ffccpfUI|r: Please /reload to apply changes")
return true
else
DEFAULT_CHAT_FRAME:AddMessage("|cff33ffccpfUI|r: Error parsing config: " .. (err or "unknown"))
end
else
DEFAULT_CHAT_FRAME:AddMessage("|cff33ffccpfUI|r: Could not read imports/" .. filename)
end
return false
end
-- Slash commands for config backup
SLASH_PFEXPORT1 = "/pfexport"
SlashCmdList["PFEXPORT"] = function(msg)
pfUI.api.ExportConfig(msg ~= "" and msg or nil)
end
SLASH_PFIMPORT1 = "/pfimport"
SlashCmdList["PFIMPORT"] = function(msg)
pfUI.api.ImportConfig(msg ~= "" and msg or nil)
end
end
-- GetPlayerBuffID wrapper
if GetPlayerBuffID then
pfUI.api.GetPlayerBuffSpellId = function(buffIndex)
return GetPlayerBuffID(buffIndex)
end
end
-- CombatLogAdd wrapper for logging
if CombatLogAdd then
pfUI.api.LogToCombatLog = function(text, raw)
CombatLogAdd(text, raw and 1 or nil)
end
end
-- Local Raid Markers (marks only visible to self)
if SetRaidTarget then
local origSetRaidTarget = SetRaidTarget
pfUI.api.SetLocalRaidTarget = function(unit, index)
origSetRaidTarget(unit, index, "local")
end
end
-- Enhanced GetContainerItemInfo for charges
-- SuperWoW returns charges as negative numbers
pfUI.api.GetItemCharges = function(bag, slot)
local texture, count = GetContainerItemInfo(bag, slot)
if count and count < 0 then
return math.abs(count) -- Return positive charge count
end
return nil -- Not a charged item
end
-- Weapon Enchant Info on other players
if GetWeaponEnchantInfo then
local origGetWeaponEnchantInfo = GetWeaponEnchantInfo
pfUI.api.GetUnitWeaponEnchants = function(unit)
if unit and unit ~= "player" then
local mhName, ohName = GetWeaponEnchantInfo(unit)
return {
mainHand = mhName,
offHand = ohName,
}
else
local hasMainHandEnchant, mainHandExpiration, mainHandCharges, hasOffHandEnchant, offHandExpiration, offHandCharges = origGetWeaponEnchantInfo()
return {
mainHand = hasMainHandEnchant and true or false,
mainHandExpiration = mainHandExpiration,
mainHandCharges = mainHandCharges,
offHand = hasOffHandEnchant and true or false,
offHandExpiration = offHandExpiration,
offHandCharges = offHandCharges,
}
end
end
end
-- Enhance libcast with SuperWoW data for NPCs and other players only
-- Player casts use SPELLCAST_* events for proper pushback handling
local supercast = CreateFrame("Frame")
local playerGuid = nil
supercast:RegisterEvent("PLAYER_ENTERING_WORLD")
supercast:RegisterEvent("UNIT_CASTEVENT")
supercast:SetScript("OnEvent", function()
if not supercast.init then
-- disable combat parsing events in superwow mode
if event == "PLAYER_ENTERING_WORLD" then
-- Cache player GUID
if UnitExists then
local _, guid = UnitExists("player")
playerGuid = guid
end
return
end
local guid = arg1
local isPlayer = guid == playerGuid
-- For non-player units: disable combat parsing events (one-time init)
if not isPlayer and not supercast.init then
-- disable combat parsing events in superwow mode (for non-player units)
libcast:UnregisterEvent("CHAT_MSG_SPELL_SELF_DAMAGE")
libcast:UnregisterEvent("CHAT_MSG_SPELL_HOSTILEPLAYER_DAMAGE")
libcast:UnregisterEvent("CHAT_MSG_SPELL_HOSTILEPLAYER_BUFF")
@@ -276,13 +604,10 @@ pfUI:RegisterModule("superwow", "vanilla", function ()
end
if arg3 == "START" or arg3 == "CAST" or arg3 == "CHANNEL" then
-- human readable argument list
local guid = arg1
local target = arg2
local event_type = arg3
local spell_id = arg4
local timer = arg5
local start = GetTime()
-- get spell info from spell id
local spell, icon, _
@@ -297,35 +622,31 @@ pfUI:RegisterModule("superwow", "vanilla", function ()
-- skip on buff procs during cast
if event_type == "CAST" then
if not libcast.db[guid] or libcast.db[guid].cast ~= spell then
-- ignore casts without 'START' event, while there is already another cast.
-- those events can be for example a frost shield proc while casting frostbolt.
-- we want to keep the cast itself, so we simply skip those.
return
end
end
-- For player: store in libcast.db[playerName] so pushback tracking works
-- For others: store by GUID
local dbKey = isPlayer and UnitName("player") or guid
-- add cast action to the database
if not libcast.db[guid] then libcast.db[guid] = {} end
libcast.db[guid].cast = spell
libcast.db[guid].rank = nil
libcast.db[guid].start = GetTime()
libcast.db[guid].casttime = timer
libcast.db[guid].icon = icon
libcast.db[guid].channel = event_type == "CHANNEL" or false
-- write state variable
superwow_active = true
if not libcast.db[dbKey] then libcast.db[dbKey] = {} end
libcast.db[dbKey].cast = spell
libcast.db[dbKey].rank = nil
libcast.db[dbKey].start = GetTime()
libcast.db[dbKey].casttime = timer or 0
libcast.db[dbKey].icon = icon
libcast.db[dbKey].channel = event_type == "CHANNEL" or false
elseif arg3 == "FAIL" then
local guid = arg1
-- delete all cast entries of guid
if libcast.db[guid] then
libcast.db[guid].cast = nil
libcast.db[guid].rank = nil
libcast.db[guid].start = nil
libcast.db[guid].casttime = nil
libcast.db[guid].icon = nil
libcast.db[guid].channel = nil
local dbKey = isPlayer and UnitName("player") or guid
if libcast.db[dbKey] then
libcast.db[dbKey].cast = nil
libcast.db[dbKey].rank = nil
libcast.db[dbKey].start = nil
libcast.db[dbKey].casttime = nil
libcast.db[dbKey].icon = nil
libcast.db[dbKey].channel = nil
end
end
end)
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("target", "vanilla:tbc", function ()
pfUI:RegisterModule("target", "vanilla", function ()
-- do not go further on disabled UFs
if C.unitframes.disable == "1" then return end
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("targettarget", "vanilla:tbc", function ()
pfUI:RegisterModule("targettarget", "vanilla", function ()
-- do not go further on disabled UFs
if C.unitframes.disable == "1" then return end
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("targettargettarget", "vanilla:tbc", function ()
pfUI:RegisterModule("targettargettarget", "vanilla", function ()
-- do not go further on disabled UFs
if C.unitframes.disable == "1" then return end
-381
View File
@@ -1,381 +0,0 @@
pfUI:RegisterModule("thirdparty-tbc", "tbc", function ()
-- abort when thirdparty core module is not loaded
if not pfUI.thirdparty then return end
local rawborder, default_border = GetBorderSize()
HookAddonOrVariable("Omen", function()
local docktable = { "omen", "Omen", "OmenBarList",
function() -- single
Omen.BarList:ClearAllPoints()
Omen.BarList:SetPoint("TOPLEFT", pfUI.chat.right, "TOPLEFT", -5, 5)
Omen.BarList:SetPoint("BOTTOMRIGHT", pfUI.chat.right, "BOTTOMRIGHT", 5, pfUI.panel.right:GetHeight()-5)
Omen.BarList:SetWidth(pfUI.chat.right:GetWidth() + 7)
-- backdrop adjustments
if Omen.BarList.backdrop then
Omen.BarList.backdrop:SetPoint("TOPLEFT", -default_border+5, default_border-5)
Omen.BarList.backdrop:SetPoint("BOTTOMRIGHT", default_border-5, -18-default_border+5)
end
end,
function() -- dual
Omen.BarList:ClearAllPoints()
Omen.BarList:SetPoint("TOPLEFT", pfUI.chat.right, "TOPLEFT", -5, 5)
Omen.BarList:SetPoint("BOTTOMRIGHT", pfUI.chat.right, "BOTTOM", -default_border+5, pfUI.panel.right:GetHeight()-5)
Omen.BarList:SetWidth(pfUI.chat.right:GetWidth() / 2 + 7)
-- backdrop adjustments
if Omen.BarList.backdrop then
Omen.BarList.backdrop:SetPoint("TOPLEFT", -default_border+5, default_border-5)
Omen.BarList.backdrop:SetPoint("BOTTOMRIGHT", default_border-5, -18-default_border+5)
end
end,
function() -- show
Omen:UpdateDisplay()
Omen:EnableLastModule()
Omen:LayoutModuleIcons()
Omen.ModuleList:SetPoint("BOTTOMLEFT", Omen.BarList, "TOPLEFT", 5, default_border*3-5)
Omen.ModuleList:SetPoint("BOTTOMRIGHT", Omen.BarList, "TOPRIGHT", -5, default_border*3)
-- fake sizes to retain proper button sizes
Omen.ModuleList._GetHeight = Omen.ModuleList._GetHeight or Omen.ModuleList.GetHeight
Omen.ModuleList.GetHeight = function() return 30 end
Omen:LayoutModuleIcons()
Omen.ModuleList.GetHeight = Omen.ModuleList._GetHeight
Omen.ModuleList:SetHeight(20)
OmenResizeGrip:Hide()
Omen:Toggle(true)
end,
function() -- hide
Omen:Toggle(nil)
end,
function() -- once
Omen.Title:Hide()
Omen.Title.Show = function() return end
EnableAutohide(Omen.ModuleList, 1)
local hookUpdateDisplay = Omen.UpdateDisplay
Omen.UpdateDisplay = function(self)
hookUpdateDisplay(self)
pfUI.thirdparty.meters:Resize()
end
Omen.UpdateVisible = function()
if pfUI.thirdparty.meters.state then
Omen.Anchor:Show()
else
Omen.Anchor:Hide()
end
end
end,
}
pfUI.thirdparty.meters:RegisterMeter("threat", docktable)
if C.thirdparty.omen.skin == "1" then
if Omen.Anchor then
local hookUpdateDisplay = Omen.UpdateDisplay
Omen.UpdateDisplay = function(self)
hookUpdateDisplay(self)
StripTextures(Omen.Title)
StripTextures(Omen.ModuleList)
StripTextures(Omen.BarList)
if not Omen.Title.backdrop or not Omen.ModuleList.backdrop or not Omen.BarList.backdrop then
CreateBackdrop(Omen.Title, nil, nil, (C.thirdparty.chatbg == "1" and .8))
CreateBackdropShadow(Omen.Title)
CreateBackdrop(Omen.ModuleList, nil, nil, (C.thirdparty.chatbg == "1" and .8))
CreateBackdropShadow(Omen.ModuleList)
CreateBackdrop(Omen.BarList, nil, nil, (C.thirdparty.chatbg == "1" and .8))
CreateBackdropShadow(Omen.BarList)
end
if C.thirdparty.chatbg == "1" and C.chat.global.custombg == "1" then
local r, g, b, a = strsplit(",", C.chat.global.background)
Omen.BarList.backdrop:SetBackdropColor(tonumber(r), tonumber(g), tonumber(b), tonumber(a))
Omen.ModuleList.backdrop:SetBackdropColor(tonumber(r), tonumber(g), tonumber(b), tonumber(a))
local r, g, b, a = strsplit(",", C.chat.global.border)
Omen.BarList.backdrop:SetBackdropBorderColor(tonumber(r), tonumber(g), tonumber(b), tonumber(a))
Omen.ModuleList.backdrop:SetBackdropColor(tonumber(r), tonumber(g), tonumber(b), tonumber(a))
end
end
HookScript(Omen.Anchor, "OnShow", function()
for i, child in pairs({ OmenModuleButtons:GetChildren() }) do
if child and child:IsObjectType("Button") then
child:GetNormalTexture():SetTexCoord(.08, .92, .08, .92)
CreateBackdrop(child, nil, true)
end
end
end)
Omen:UpdateDisplay()
end
end
end)
HookAddonOrVariable("Recount", function()
local docktable = { "recount", "Recount", "Recount_MainWindow",
function() -- single
Recount.MainWindow:ClearAllPoints()
Recount.MainWindow:SetPoint("TOPLEFT", pfUI.chat.right, "TOPLEFT", 0, 10)
Recount.MainWindow:SetPoint("BOTTOMRIGHT", pfUI.chat.right, "BOTTOMRIGHT", 0, 18)
Recount.MainWindow:SetWidth(pfUI.chat.right:GetWidth())
end,
function() -- dual
Recount.MainWindow:ClearAllPoints()
Recount.MainWindow:SetPoint("TOPLEFT", pfUI.chat.right, "TOP", default_border, 10)
Recount.MainWindow:SetPoint("BOTTOMRIGHT", pfUI.chat.right, "BOTTOMRIGHT", 0, 18)
Recount.MainWindow:SetWidth(pfUI.chat.right:GetWidth() / 2)
end,
function() -- show
Recount.MainWindow:Show()
Recount:ResizeMainWindow()
Recount:RefreshMainWindow()
end,
function() -- hide
Recount.MainWindow:Hide()
end,
function() -- once
local hookResize = Recount.ResizeMainWindow
Recount.ResizeMainWindow = function()
hookResize()
local a, b, c = Recount.MainWindow:GetPoint()
if b == pfUI.chat.right and Recount.MainWindow.backdrop then
Recount.MainWindow.backdrop:SetPoint("BOTTOMRIGHT", default_border, -18-default_border)
else
Recount.MainWindow.backdrop:SetPoint("BOTTOMRIGHT", default_border, default_border)
end
end
end,
}
pfUI.thirdparty.meters:RegisterMeter("damage", docktable)
if C.thirdparty.recount.skin == "1" then
if Recount_MainWindow then
StripTextures(Recount.MainWindow)
CreateBackdrop(Recount.MainWindow, nil, nil, (C.thirdparty.chatbg == "1" and .8))
CreateBackdropShadow(Recount.MainWindow)
SkinScrollbar(Recount_MainWindow_ScrollBarScrollBar)
Recount_MainWindow_ScrollBarScrollBarScrollUpButton.Overlay:SetTexture(nil)
Recount_MainWindow_ScrollBarScrollBarScrollDownButton.Overlay:SetTexture(nil)
Recount.MainWindow.DragBottomLeft:SetNormalTexture(nil)
Recount.MainWindow.DragBottomRight:SetNormalTexture(nil)
-- backdrop adjustments
Recount.MainWindow.backdrop:SetPoint("TOPLEFT", -default_border, -5-default_border-GetPerfectPixel())
if C.thirdparty.chatbg == "1" and C.chat.global.custombg == "1" then
local r, g, b, a = strsplit(",", C.chat.global.background)
Recount.MainWindow.backdrop:SetBackdropColor(tonumber(r), tonumber(g), tonumber(b), tonumber(a))
local r, g, b, a = strsplit(",", C.chat.global.border)
Recount.MainWindow.backdrop:SetBackdropBorderColor(tonumber(r), tonumber(g), tonumber(b), tonumber(a))
end
end
end
end)
HookAddonOrVariable("BCEPGP_LootFrame_Update", function()
if C.thirdparty.bcepgp.enable == "0" then return end
local hook = _G.BCEPGP_LootFrame_Update
_G.BCEPGP_LootFrame_Update = function(a,b,c,d,e,f)
LootFrame.numLootItems = GetNumLootItems()
hook(a,b,c,d,e,f)
end
end)
-- Sheep Watch Continued
-- https://www.curseforge.com/wow/addons/sheep-watch-continued/files/225593
HookAddonOrVariable("SheepWatch", function()
if C.thirdparty.sheepwatch.enable == "0" then return end
StripTextures(SheepWatch)
if SheepWatchFrameStatusBar then
SheepWatchFrameStatusBar:SetStatusBarTexture(pfUI.media["img:bar"])
SheepWatchFrameStatusBar:SetHeight(14)
CreateBackdrop(SheepWatchFrameStatusBar)
CreateBackdropShadow(SheepWatchFrameStatusBar)
end
if SheepWatchText then
SheepWatchText:ClearAllPoints()
SheepWatchText:SetPoint("CENTER", 0, 4)
end
if SheepWatchCounterText then
SheepWatchCounterText:ClearAllPoints()
SheepWatchCounterText:SetPoint("RIGHT", 0, 4)
end
end)
HookAddonOrVariable("Bag_Sort", function()
if C.thirdparty.bag_sort.enable == "0" then return end
local sort = CreateFrame("Frame", nil)
sort:RegisterEvent("PLAYER_ENTERING_WORLD")
sort:SetScript("OnEvent", function()
this:UnregisterAllEvents()
pfUI.thirdparty.RegisterBagSort("Bag_Sort",
function()
BS_slashBagSortHandler()
end,
function()
GameTooltip:SetOwner(this, "ANCHOR_RIGHT")
GameTooltip:SetText(GetAddOnMetadata("Bag_Sort","Title"))
GameTooltip:AddLine(GetAddOnMetadata("Bag_Sort","Notes"),1,1,1)
GameTooltip:Show()
end,
function()
BS_slashBankSortHandler()
end,
function()
GameTooltip:SetOwner(this, "ANCHOR_RIGHT")
GameTooltip:SetText(GetAddOnMetadata("Bag_Sort","Title"))
GameTooltip:AddLine(GetAddOnMetadata("Bag_Sort","Notes"),1,1,1)
GameTooltip:Show()
end)
end)
end)
HookAddonOrVariable("AckisRecipeList", function()
if C.thirdparty.ackis.enable == "0" then return end
if AckisRecipeList.ShowScanButton then
local AckisRecipeListShowScanButton = AckisRecipeList.ShowScanButton
AckisRecipeList.ShowScanButton = function(a1,a2,a3,a4)
-- run the original function
AckisRecipeListShowScanButton(a1,a2,a3,a4)
-- apply skin and reposition the button
SkinButton(AckisRecipeList.ScanButton)
local a,b,c,d,e = AckisRecipeList.ScanButton:GetPoint()
AckisRecipeList.ScanButton:SetPoint(a,b,c,d-14,e-2)
end
end
end)
HookAddonOrVariable("TotemTimers", function()
if C.thirdparty.totemtimers.enable == "0" then return end
local function skin(button, weapon)
if button and not button.pfskinned then
button.pfskinned = true
local icon = button.icon or _G[button:GetName().."Icon"]
icon:SetDrawLayer("BORDER")
SkinButton(button, nil, nil, nil, icon)
SetAllPointsOffset(icon, button, 2)
if _G[button:GetName().."Flash"] then
SetAllPointsOffset(_G[button:GetName().."Flash"], button, 3)
_G[button:GetName().."Flash"]:SetTexCoord(.08, .92, .08, .92)
end
if button.spellIcon then
button.spellIcon:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -2, 2)
button.spellIcon:SetTexCoord(.08, .92, .08, .92)
end
if weapon then
-- weapon button skin workaround taken from ElvUI-TBC:
-- https://github.com/ElvUI-TBC/ElvUI_AddOnSkins/blob/master/ElvUI_AddOnSkins/Skins/Addons/totemTimers.lua#L92-L135
local icon2frame = _G[button:GetName().."Icon2Frame"]
icon2frame:SetFrameStrata("MEDIUM")
icon2frame:SetWidth(icon2frame:GetWidth() + 1)
button.icon2 = _G[button:GetName().."Icon2"]
SetAllPointsOffset(button.icon2, icon2frame, 2)
button.icon1Frame = CreateFrame("Frame", "TotemTimers_MainHandIcon1Frame", button)
button.icon1Frame:SetWidth(16)
button.icon1Frame:SetHeight(30)
button.icon1Frame:SetPoint("LEFT", 0, 0)
button.icon1 = button.icon1Frame:CreateTexture(nil, "MEDIUM")
SetAllPointsOffset(button.icon1, button.icon1Frame, 3)
button.icon1:SetTexture(icon:GetTexture())
button.icon1:SetAlpha(icon:GetAlpha())
_G[button:GetName().."Cooldown"]:SetFrameLevel(button.icon1Frame:GetFrameLevel() + 1)
icon:Hide()
hooksecurefunc(icon, "SetTexture", function(_, texture)
button.icon1:SetTexture(texture)
end)
hooksecurefunc(icon, "SetAlpha", function(_, alpha)
button.icon1:SetAlpha(alpha)
end)
if icon:GetTexCoordModifiesRect() then
button.icon1:SetTexCoord(.08, .5, .08, .92)
else
button.icon1:SetTexCoord(.08, .92, .08, .92)
end
button.icon2:SetTexCoord(.5, .92, .08, .92)
hooksecurefunc(icon, "SetTexCoord", function(self, arg1, arg2)
if arg2 == 0.5 and arg1 == 0 then
button.icon1:SetTexCoord(.08, .5, .08, .92)
elseif arg2 == 1 then
button.icon1:SetTexCoord(.08, .92, .08, .92)
end
end)
hooksecurefunc(button.icon2, "SetTexCoord", function(self, arg1, arg2)
if arg2 == 1 then self:SetTexCoord(.5, .92, .08, .92) end
end)
end
end
end
hooksecurefunc("TotemTimers_SetupGlobals", function()
for i=1,4 do -- skin main buttons
for j=1,10 do skin(_G[i.."SlaveButton"..j]) end
skin(_G["TotemTimers"..i])
end
for _, timer in pairs({ "EarthElemental", "FireElemental", "ManaTide", "ManaTrinket" }) do
skin(_G["TotemTimers_"..timer])
end
for i, tracker in pairs({ "Ankh", "Shield", "MainHand", "EarthShield" }) do
skin(_G["TotemTimers_"..tracker], i==3)
end
end)
end)
HookAddonOrVariable("DruidBarFrame", function()
if C.thirdparty.druidbar.enable == "0" then return end
local p = ManaBarColor[0]
local pr, pg, pb = 0, 0, 0
if p then pr, pg, pb = p.r + .5, p.g +.5, p.b +.5 end
DruidBarKey.color = { pr, pg, pb, 1 }
DruidBarKey.bordercolor = {1,1,1,0}
DruidBarKey.bgcolor = {0,0,0,0}
DruidBarKey.manatexture = pfUI.media[pfUI.uf.player.config.pbartexture]
DruidBarKey.bordertexture = ""
hooksecurefunc("DruidBar_MainGraphics", function()
local f = pfUI.uf.player
DruidBarFrame:SetWidth((f.config.pwidth ~= "-1" and f.config.pwidth or f.config.width))
DruidBarFrame:SetHeight(f.config.pheight)
DruidBarMana:SetAllPoints(DruidBarFrame)
DruidBarText:SetFont(pfUI.font_unit, C.global.font_unit_size, "OUTLINE")
DruidBarText1:SetFont(pfUI.font_unit, C.global.font_unit_size, "OUTLINE")
StripTextures(DruidBarFrame)
CreateBackdrop(DruidBarFrame)
CreateBackdropShadow(DruidBarFrame)
end)
end)
end)
+4 -10
View File
@@ -1,10 +1,7 @@
pfUI:RegisterModule("thirdparty", "vanilla:tbc", function()
pfUI:RegisterModule("thirdparty", "vanilla", function()
-- This module includes the core logic of thirdparty modules.
-- Right now, in particular the functions to register addons to the
-- dockframe of the chat panel aswell as the thirdparty root-table.
-- This module is supposed to be loaded on all expansions, so only
-- addons that can share the same glue code across expansions will go here.
-- For expansion related code, see: thirdparty-vanilla and thirdparty-tbc.
pfUI.thirdparty = {}
@@ -196,8 +193,7 @@ pfUI:RegisterModule("thirdparty", "vanilla:tbc", function()
end
-- MrPlow Bag Sorting Addon.
-- Vanilla: https://www.wowace.com/projects/mr-plow/files/288059
-- TBC: https://www.wowace.com/projects/mr-plow/files/136162
-- https://www.wowace.com/projects/mr-plow/files/288059
HookAddonOrVariable("MrPlow", function()
if C.thirdparty.mrplow.enable == "0" then return end
@@ -232,8 +228,7 @@ pfUI:RegisterModule("thirdparty", "vanilla:tbc", function()
end)
-- ShaguDPS Damage Meter
-- Vanilla: https://github.com/shagu/ShaguDPS
-- TBC: https://github.com/shagu/ShaguDPS
-- https://github.com/shagu/ShaguDPS
HookAddonOrVariable("ShaguDPS", function()
local docktable = { "shagudps", "ShaguDPS", "ShaguDPSWindow",
function() -- single
@@ -333,8 +328,7 @@ pfUI:RegisterModule("thirdparty", "vanilla:tbc", function()
end)
-- DPSMate Damage Meter
-- Vanilla: https://github.com/Geigerkind/DPSMate
-- TBC: https://github.com/Geigerkind/DPSMateTBC
-- https://github.com/Geigerkind/DPSMate
HookAddonOrVariable("DPSMate_DPSMate", function()
local docktable = { "dpsmate", "DPSMate", "DPSMate_DPSMate",
function() -- single
+5 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("tooltip", "vanilla:tbc", function ()
pfUI:RegisterModule("tooltip", "vanilla", function ()
local rawborder, default_border = GetBorderSize()
pfUI.tooltip = CreateFrame('Frame', "pfTooltip", GameTooltip)
@@ -33,6 +33,10 @@ pfUI:RegisterModule("tooltip", "vanilla:tbc", function ()
tooltip.cursor:SetWidth(tonumber(C.tooltip.cursoroffset) * 2)
tooltip.cursor:SetHeight(tonumber(C.tooltip.cursoroffset) * 2)
tooltip.cursor:SetScript("OnUpdate", function()
-- throttle to 0.1s - cursor following doesn't need to be every frame
if (this.tick or 0) > GetTime() then return end
this.tick = GetTime() + 0.1
local scale = UIParent:GetScale()
local x, y = GetCursorPosition()
this:SetPoint("CENTER", UIParent, "BOTTOMLEFT", x/scale, y/scale)
+1 -4
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("totems", "vanilla:tbc", function ()
pfUI:RegisterModule("totems", "vanilla", function ()
local _, class = UnitClass("player")
local slots = {
@@ -42,9 +42,6 @@ pfUI:RegisterModule("totems", "vanilla:tbc", function ()
-- Try to recast totem on left click in vanilla
local active, name, start, duration, icon = GetTotemInfo(this.id)
if name then CastSpellByName(name) end
elseif pfUI.client > 11200 and this.id and arg1 and arg1 == "RightButton" then
-- Try to cancel totem on right click in tbc+
DestroyTotem(this.id)
end
end
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("uf_tukui", "vanilla:tbc", function ()
pfUI:RegisterModule("uf_tukui", "vanilla", function ()
if C.unitframes.disable == "1" or C.unitframes.layout ~= "tukui" then return end
-- update player layout
+234
View File
@@ -0,0 +1,234 @@
-- UnitXP_SP3 integration module
-- Provides Line of Sight indicator, OS notifications, and enhanced targeting
-- Requires UnitXP_SP3 DLL: https://github.com/allfoxwy/UnitXP_SP3
pfUI:RegisterModule("unitxp", "vanilla", function ()
-- Check if UnitXP is available
local hasUnitXP = pcall(UnitXP, "nop", "nop")
if not hasUnitXP then return end
local rawborder, border = GetBorderSize()
-- Helper to create indicators after target frame exists
local function CreateTargetIndicators()
if not pfUI.uf or not pfUI.uf.target then return false end
-- Behind Indicator for all units (TOP)
if C.unitframes.behind_indicator == "1" and not pfUI.uf.target.behindIndicator then
local behindFrame = CreateFrame("Frame", "pfBehindIndicator", pfUI.uf.target)
behindFrame:SetAllPoints(pfUI.uf.target)
behindFrame:SetFrameLevel(pfUI.uf.target:GetFrameLevel() + 10)
behindFrame.text = behindFrame:CreateFontString(nil, "OVERLAY")
behindFrame.text:SetFont(pfUI.font_default, 13, "OUTLINE")
behindFrame.text:SetPoint("RIGHT", behindFrame, "RIGHT", -1, 7)
behindFrame.text:SetTextColor(0.3, 1, 0.3, 1)
behindFrame.text:SetText("BEHIND")
behindFrame.text:Hide()
local lastCheck = 0
behindFrame:SetScript("OnUpdate", function()
if GetTime() - lastCheck < 0.1 then return end
lastCheck = GetTime()
if not UnitExists("target") then
this.text:Hide()
return
end
local success, behind = pcall(UnitXP, "behind", "player", "target")
if success and behind then
this.text:Show()
else
this.text:Hide()
end
end)
pfUI.uf.target.behindIndicator = behindFrame
end
-- Line of Sight Indicator on Target Frame (BELOW BEHIND)
if C.unitframes.los_indicator == "1" and not pfUI.uf.target.losIndicator then
local losFrame = CreateFrame("Frame", "pfLoSIndicator", pfUI.uf.target)
losFrame:SetAllPoints(pfUI.uf.target)
losFrame:SetFrameLevel(pfUI.uf.target:GetFrameLevel() + 10)
losFrame.text = losFrame:CreateFontString(nil, "OVERLAY")
losFrame.text:SetFont(pfUI.font_default, 13, "OUTLINE")
losFrame.text:SetPoint("RIGHT", losFrame, "RIGHT", -1, -7)
losFrame.text:SetTextColor(1, 0.3, 0.3, 1)
losFrame.text:SetText("NO LOS")
losFrame.text:Hide()
local lastCheck = 0
losFrame:SetScript("OnUpdate", function()
if GetTime() - lastCheck < 0.2 then return end
lastCheck = GetTime()
if not UnitExists("target") then
this.text:Hide()
return
end
local success, inSight = pcall(UnitXP, "inSight", "player", "target")
if success and inSight == false then
this.text:Show()
else
this.text:Hide()
end
end)
pfUI.uf.target.losIndicator = losFrame
end
return true
end
-- Try to create indicators now
CreateTargetIndicators()
-- Also try on PLAYER_ENTERING_WORLD in case target frame wasn't ready
local initFrame = CreateFrame("Frame")
initFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
initFrame:SetScript("OnEvent", function()
CreateTargetIndicators()
this:UnregisterAllEvents()
end)
-- OS Notification Support
if C.unitframes.unitxp_notify == "1" then
local notifyFrame = CreateFrame("Frame")
notifyFrame:RegisterEvent("CHAT_MSG_WHISPER")
notifyFrame:RegisterEvent("CHAT_MSG_BN_WHISPER")
notifyFrame:RegisterEvent("READY_CHECK")
notifyFrame:RegisterEvent("RAID_INSTANCE_WELCOME")
notifyFrame:SetScript("OnEvent", function()
pcall(UnitXP, "notify", "taskbarIcon")
pcall(UnitXP, "notify", "systemSound")
end)
-- Also notify on BG queue pop
local origBattlefieldPortShow = BattlefieldFrame_Show
if origBattlefieldPortShow then
BattlefieldFrame_Show = function()
pcall(UnitXP, "notify", "taskbarIcon")
pcall(UnitXP, "notify", "systemSound")
return origBattlefieldPortShow()
end
end
end
-- Enhanced Distance API
pfUI.api.GetPreciseDistance = function(unit1, unit2)
if not unit2 then
unit2 = unit1
unit1 = "player"
end
local success, distance = pcall(UnitXP, "distanceBetween", unit1, unit2)
if success then return distance end
return nil
end
pfUI.api.IsInMeleeRange = function(unit)
local success, distance = pcall(UnitXP, "distanceBetween", "player", unit, "meleeAutoAttack")
if success and distance then
return distance <= 5
end
return nil
end
pfUI.api.GetAoEDistance = function(unit1, unit2)
if not unit2 then
unit2 = unit1
unit1 = "player"
end
local success, distance = pcall(UnitXP, "distanceBetween", unit1, unit2, "AoE")
if success then return distance end
return nil
end
-- Smart Targeting Helpers
pfUI.api.TargetNearestEnemy = function()
local success, found = pcall(UnitXP, "target", "nearestEnemy")
return success and found
end
pfUI.api.TargetHighestHP = function()
local success, found = pcall(UnitXP, "target", "mostHP")
return success and found
end
pfUI.api.TargetNextEnemy = function()
local success, found = pcall(UnitXP, "target", "nextEnemyInCycle")
return success and found
end
pfUI.api.TargetPreviousEnemy = function()
local success, found = pcall(UnitXP, "target", "previousEnemyInCycle")
return success and found
end
pfUI.api.TargetNextMarked = function(order)
local success, found = pcall(UnitXP, "target", "nextMarkedEnemyInCycle", order)
return success and found
end
pfUI.api.UnitInLineOfSight = function(unit1, unit2)
if not unit2 then
unit2 = unit1
unit1 = "player"
end
local success, inSight = pcall(UnitXP, "inSight", unit1, unit2)
if success then return inSight end
return nil
end
pfUI.api.UnitIsBehind = function(unit1, unit2)
if not unit2 then
unit2 = unit1
unit1 = "player"
end
local success, behind = pcall(UnitXP, "behind", unit1, unit2)
if success then return behind end
return nil
end
-- Debug command to test UnitXP indicators
SLASH_PFUNITXP1 = "/pfunitxp"
SlashCmdList["PFUNITXP"] = function()
local chat = DEFAULT_CHAT_FRAME
chat:AddMessage("|cff33ffccpfUI|r: UnitXP Indicator Debug")
-- Check if target exists
if not UnitExists("target") then
chat:AddMessage(" |cffff0000No target selected|r")
return
end
-- Test behind
local successB, behind = pcall(UnitXP, "behind", "player", "target")
chat:AddMessage(" Behind check: success=" .. tostring(successB) .. " value=" .. tostring(behind) .. " type=" .. type(behind))
-- Test LOS
local successL, inSight = pcall(UnitXP, "inSight", "player", "target")
chat:AddMessage(" LOS check: success=" .. tostring(successL) .. " value=" .. tostring(inSight) .. " type=" .. type(inSight))
-- Check if indicator frames exist
if pfUI.uf and pfUI.uf.target then
chat:AddMessage(" Target frame: |cff00ff00exists|r")
if pfUI.uf.target.behindIndicator then
chat:AddMessage(" Behind indicator: |cff00ff00created|r, visible=" .. tostring(pfUI.uf.target.behindIndicator:IsVisible()))
else
chat:AddMessage(" Behind indicator: |cffff0000NOT created|r (check settings)")
end
if pfUI.uf.target.losIndicator then
chat:AddMessage(" LOS indicator: |cff00ff00created|r")
else
chat:AddMessage(" LOS indicator: |cffff0000NOT created|r (check settings)")
end
else
chat:AddMessage(" Target frame: |cffff0000NOT found|r")
end
end
end)
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("unlock", "vanilla:tbc", function ()
pfUI:RegisterModule("unlock", "vanilla", function ()
local rawborder, default_border = GetBorderSize()
-- grouped frames
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("unusable", "vanilla:tbc", function ()
pfUI:RegisterModule("unusable", "vanilla", function ()
if not pfUI.bag then return end
if C.appearance.bags.unusable ~= "1" then return end
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("updatenotify", "vanilla:tbc", function ()
pfUI:RegisterModule("updatenotify", "vanilla", function ()
local alreadyshown = false
local localversion = tonumber(pfUI.version.major*10000 + pfUI.version.minor*100 + pfUI.version.fix)
local remoteversion = tonumber(pfUI_init.updateavailable) or 0
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterModule("xpbar", "vanilla:tbc", function ()
pfUI:RegisterModule("xpbar", "vanilla", function ()
local rawborder, default_border = GetBorderSize()
local parse_faction = SanitizePattern(FACTION_STANDING_INCREASED)
-17
View File
@@ -1,17 +0,0 @@
## Interface: 20400
## Title: |cff33ffccpf|cffffffffUI
## Author: Shagu
## Notes: A complete user interface replacement.
## Notes-ruRU: Полная замена пользовательского интерфейса.
## Version: 5.5.4
## SavedVariables: pfUI_profiles, pfUI_addon_profiles, pfUI_cache
## SavedVariablesPerCharacter: pfUI_config, pfUI_init, pfUI_playerDB
pfUI.lua
init\env.xml
init\compat.xml
init\api.xml
init\libs.xml
init\skins.xml
init\modules.xml
+7 -29
View File
@@ -77,17 +77,9 @@ end})
local _, _, _, client = GetBuildInfo()
client = client or 11200
-- detect client expansion
if client >= 20000 and client <= 20400 then
pfUI.expansion = "tbc"
pfUI.client = client
elseif client >= 30000 and client <= 30300 then
pfUI.expansion = "wotlk"
pfUI.client = client
else
pfUI.expansion = "vanilla"
pfUI.client = client
end
-- set expansion to vanilla
pfUI.expansion = "vanilla"
pfUI.client = client
-- setup pfUI namespace
setmetatable(pfUI.env, {__index = getfenv(0)})
@@ -119,34 +111,20 @@ function pfUI:UpdateFonts()
-- load font configuration
local default, tooltip, unit, unit_name, combat
if pfUI_config.global.force_region == "1" and GetLocale() == "zhCN" and pfUI.expansion == "vanilla" then
if pfUI_config.global.force_region == "1" and GetLocale() == "zhCN" then
-- force locale compatible fonts (zhCN 1.12)
default = "Fonts\\FZXHLJW.TTF"
tooltip = "Fonts\\FZXHLJW.TTF"
combat = "Fonts\\FZXHLJW.TTF"
unit = "Fonts\\FZXHLJW.TTF"
unit_name = "Fonts\\FZXHLJW.TTF"
elseif pfUI_config.global.force_region == "1" and GetLocale() == "zhCN" and pfUI.expansion == "tbc" then
-- force locale compatible fonts (zhCN 2.4.3)
default = "Fonts\\ZYHei.ttf"
tooltip = "Fonts\\ZYHei.ttf"
combat = "Fonts\\ZYKai_C.ttf"
unit = "Fonts\\ZYKai_T.ttf"
unit_name = "Fonts\\ZYHei.ttf"
elseif pfUI_config.global.force_region == "1" and GetLocale() == "zhTW" and pfUI.expansion == "vanilla" then
elseif pfUI_config.global.force_region == "1" and GetLocale() == "zhTW" then
-- force locale compatible fonts (zhTW 1.12)
default = "Fonts\\FZXHLJW.ttf"
tooltip = "Fonts\\FZXHLJW.ttf"
combat = "Fonts\\FZXHLJW.ttf"
unit = "Fonts\\FZXHLJW.ttf"
unit_name = "Fonts\\FZXHLJW.ttf"
elseif pfUI_config.global.force_region == "1" and GetLocale() == "zhTW" and pfUI.expansion == "tbc" then
-- force locale compatible fonts (zhTW 2.4.3)
default = "Fonts\\bHEI01B.ttf"
tooltip = "Fonts\\bHEI01B.ttf"
combat = "Fonts\\bHEI01B.ttf"
unit = "Fonts\\bHEI01B.ttf"
unit_name = "Fonts\\bHEI01B.ttf"
elseif pfUI_config.global.force_region == "1" and GetLocale() == "koKR" then
-- force locale compatible fonts (koKR)
default = "Fonts\\2002.TTF"
@@ -244,7 +222,7 @@ end
function pfUI:RegisterModule(name, a2, a3)
if pfUI.module[name] then return end
local hasv = type(a2) == "string"
local func, version = hasv and a3 or a2, hasv and a2 or "vanilla:tbc:wotlk"
local func, version = hasv and a3 or a2, hasv and a2 or "vanilla"
-- check for client compatibility
if not strfind(version, pfUI.expansion) then return end
@@ -259,7 +237,7 @@ end
function pfUI:RegisterSkin(name, a2, a3)
if pfUI.skin[name] then return end
local hasv = type(a2) == "string"
local func, version = hasv and a3 or a2, hasv and a2 or "vanilla:tbc:wotlk"
local func, version = hasv and a3 or a2, hasv and a2 or "vanilla"
-- check for client compatibility
if not strfind(version, pfUI.expansion) then return end
-55
View File
@@ -1,55 +0,0 @@
pfUI:RegisterSkin("Arena", "tbc", function ()
StripTextures(ArenaFrame)
CreateBackdrop(ArenaFrame, nil, nil, .75)
CreateBackdropShadow(ArenaFrame)
ArenaFrame.backdrop:SetPoint("TOPLEFT", 10, -10)
ArenaFrame.backdrop:SetPoint("BOTTOMRIGHT", -32, 72)
ArenaFrame:SetHitRectInsets(10,32,10,72)
EnableMovable(ArenaFrame)
SkinCloseButton(ArenaFrameCloseButton, ArenaFrame.backdrop, -6, -6)
ArenaFrame:DisableDrawLayer("BACKGROUND")
ArenaFrameFrameLabel:ClearAllPoints()
ArenaFrameFrameLabel:SetPoint("TOP", TabardFrame.backdrop, "TOP", 0, -10)
ArenaFrame.zones_bg = CreateFrame("Frame", "ArenaFrameZonesBackground", ArenaFrame)
CreateBackdrop(ArenaFrame.zones_bg, nil, nil, .7)
ArenaFrame.zones_bg:SetWidth(324)
ArenaFrame.zones_bg:SetHeight(204)
ArenaFrame.zones_bg:SetPoint("TOPLEFT", ArenaFrame.backdrop, "TOPLEFT", 9, -62)
ArenaFrame.tex1 = ArenaFrame.backdrop:CreateTexture("ArenaFrameWorldMap1", "ARTWORK")
ArenaFrame.tex1:SetTexture("Interface\\BattlefieldFrame\\UI-Battlefield-WorldMap1")
ArenaFrame.tex1:SetPoint("TOPLEFT", 11, -64)
ArenaFrame.tex1:SetHeight(240)
ArenaFrame.tex2 = ArenaFrame.backdrop:CreateTexture("ArenaFrameWorldMap2", "ARTWORK")
ArenaFrame.tex2:SetTexture("Interface\\BattlefieldFrame\\UI-Battlefield-WorldMap2")
ArenaFrame.tex2:SetPoint("LEFT", ArenaFrame.tex1, "RIGHT", 0, 0)
ArenaFrame.tex2:SetHeight(240)
ArenaFrameNameHeader:ClearAllPoints()
ArenaFrameNameHeader:SetPoint("BOTTOMLEFT", ArenaFrameDivider, "TOPLEFT", 14, 70)
local shift = 28
ArenaZone1:ClearAllPoints()
ArenaZone1:SetPoint("TOPLEFT", ArenaFrame, "TOPLEFT", 23, -79 - shift)
ArenaZone4:ClearAllPoints()
ArenaZone4:SetPoint("TOPLEFT", ArenaZone3, "TOPLEFT", 0, -85 + shift)
ArenaFrame.textbox = CreateFrame("Frame", "ArenaFrameTextBox", ArenaFrame)
ArenaFrame.textbox:SetWidth(324)
ArenaFrame.textbox:SetHeight(110)
CreateBackdrop(ArenaFrame.textbox)
ArenaFrame.textbox:SetPoint("BOTTOM", ArenaFrame.backdrop, "BOTTOM", 0, 36)
ArenaFrameZoneDescription:SetFontObject(GameFontWhite)
ArenaFrameZoneDescription:ClearAllPoints()
ArenaFrameZoneDescription:SetPoint("TOPLEFT", ArenaFrame.textbox, "TOPLEFT", 4, -4)
ArenaFrameZoneDescription:SetPoint("BOTTOMRIGHT", ArenaFrame.textbox, "BOTTOMRIGHT", -4, 4)
SkinButton(ArenaFrameCancelButton)
SkinButton(ArenaFrameJoinButton)
SkinButton(ArenaFrameGroupJoinButton)
end)
-119
View File
@@ -1,119 +0,0 @@
pfUI:RegisterSkin("Arena Registrar", "tbc", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
do -- ArenaRegistrarFrame
StripTextures(ArenaRegistrarFrame)
StripTextures(ArenaRegistrarGreetingFrame)
CreateBackdrop(ArenaRegistrarFrame, nil, nil, .75)
CreateBackdropShadow(ArenaRegistrarFrame)
ArenaRegistrarFrame.backdrop:SetPoint("TOPLEFT", 14, -18)
ArenaRegistrarFrame.backdrop:SetPoint("BOTTOMRIGHT", -28, 66)
ArenaRegistrarFrame:SetHitRectInsets(14,28,18,66)
EnableMovable(ArenaRegistrarFrame)
SkinCloseButton(ArenaRegistrarFrameCloseButton, ArenaRegistrarFrame.backdrop, -6, -6)
ArenaRegistrarFrame:DisableDrawLayer("BACKGROUND")
ArenaRegistrarFrameNpcNameText:ClearAllPoints()
ArenaRegistrarFrameNpcNameText:SetPoint("TOP", ArenaRegistrarFrame.backdrop, "TOP", 0, -10)
SkinButton(ArenaRegistrarFrameGoodbyeButton)
SkinButton(ArenaRegistrarFrameCancelButton)
SkinButton(ArenaRegistrarFramePurchaseButton)
ArenaRegistrarCostLabel:SetFontObject("GameFontWhite")
ArenaRegistrarFrameEditBox:DisableDrawLayer("BACKGROUND")
CreateBackdrop(ArenaRegistrarFrameEditBox, nil, nil, 1)
ArenaRegistrarFrameEditBox:SetHeight(16)
local bg = ArenaRegistrarFrame:CreateTexture(nil, "LOW")
bg:SetTexCoord(.1,1,0,1)
bg:SetTexture("Interface\\Stationery\\StationeryTest1")
bg:SetPoint("TOPLEFT", 23, -81)
bg:SetPoint("BOTTOMRIGHT", -40, 100)
end
do -- PVPBannerFrame
StripTextures(PVPBannerFrame)
CreateBackdrop(PVPBannerFrame, nil, nil, .75)
CreateBackdropShadow(PVPBannerFrame)
PVPBannerFrame.backdrop:SetPoint("TOPLEFT", 10, -12)
PVPBannerFrame.backdrop:SetPoint("BOTTOMRIGHT", -32, 72)
PVPBannerFrame:SetHitRectInsets(10,32,12,72)
EnableMovable(PVPBannerFrame)
SkinCloseButton(PVPBannerFrameCloseButton, PVPBannerFrame.backdrop, -6, -6)
PVPBannerFrame:DisableDrawLayer("BACKGROUND")
PVPBannerFrameNameText:ClearAllPoints()
PVPBannerFrameNameText:SetPoint("TOP", ArenaRegistrarFrame.backdrop, "TOP", 0, -10)
PVPBannerFrameGreetingText:ClearAllPoints()
PVPBannerFrameGreetingText:SetPoint("TOP", PVPBannerFrameNameText, "TOP", 0, -10)
PVPBannerFrameCustomizationBorder:Hide()
PVPBannerFrameCustomization1:ClearAllPoints()
PVPBannerFrameCustomization1:SetPoint("TOPLEFT", PVPBannerFrameCustomizationBorder, "TOPLEFT", 48, -45)
for i = 1, 2 do
local frame = _G["PVPBannerFrameCustomization"..i]
StripTextures(frame)
CreateBackdrop(frame, nil, true)
frame:SetHeight(25)
local left = _G["PVPBannerFrameCustomization"..i.."LeftButton"]
StripTextures(left)
SkinArrowButton(left, "left", 25)
left:ClearAllPoints()
left:SetPoint("LEFT", 0, 0)
local right = _G["PVPBannerFrameCustomization"..i.."RightButton"]
StripTextures(right)
SkinArrowButton(right, "right", 25)
right:ClearAllPoints()
right:SetPoint("RIGHT", 0, 0)
local text = _G["PVPBannerFrameCustomization"..i.."Text"]
text:ClearAllPoints()
text:SetPoint("CENTER", 0, 0)
end
local width = PVPBannerFrameCustomization2:GetWidth()
for i = 1, 3 do
local btn = _G["PVPColorPickerButton"..i]
local prev = _G["PVPColorPickerButton"..(i-1)]
SkinButton(btn)
btn:SetWidth(width)
btn:ClearAllPoints()
if prev then
btn:SetPoint("TOPLEFT", prev, "BOTTOMLEFT", 0, -5)
else
btn:SetPoint("TOPLEFT", PVPBannerFrameCustomization2, "BOTTOMLEFT", 0, -5)
end
end
local PVPBannerFrameCancelButton
do -- fix Blizzard bug. A button with the same name is created twice.
for k,v in ipairs({PVPBannerFrameCustomizationFrame:GetChildren()}) do
if v:GetName() == "PVPBannerFrameCancelButton" then v:Hide() end -- This is the wrong and broken button.
end
for k,v in ipairs({PVPBannerFrame:GetChildren()}) do
if v:GetName() == "PVPBannerFrameCancelButton" then PVPBannerFrameCancelButton = v end
end
end
SkinButton(PVPBannerFrameSaveButton)
SkinButton(PVPBannerFrameCancelButton)
PVPBannerFrameCancelButton:ClearAllPoints()
PVPBannerFrameCancelButton:SetPoint("TOPRIGHT", PVPColorPickerButton3, "BOTTOMRIGHT", 0, -10)
SkinButton(PVPBannerFrameAcceptButton)
PVPBannerFrameAcceptButton:ClearAllPoints()
PVPBannerFrameAcceptButton:SetPoint("RIGHT", PVPBannerFrameCancelButton, "LEFT", -2*bpad, 0)
end
end)
+5 -10
View File
@@ -1,16 +1,11 @@
pfUI:RegisterSkin("Auctionhouse", "vanilla:tbc", function ()
pfUI:RegisterSkin("Auctionhouse", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
HookAddonOrVariable("Blizzard_AuctionUI", function()
-- Compatibility
if BrowseResetButton then -- tbc
SkinButton(BrowseResetButton)
else -- vanilla
SkinArrowButton(BidPrevPageButton, "left", 18)
SkinArrowButton(BidNextPageButton, "right", 18)
SkinArrowButton(AuctionsPrevPageButton, "left", 18)
SkinArrowButton(AuctionsNextPageButton, "right", 18)
end
SkinArrowButton(BidPrevPageButton, "left", 18)
SkinArrowButton(BidNextPageButton, "right", 18)
SkinArrowButton(AuctionsPrevPageButton, "left", 18)
SkinArrowButton(AuctionsNextPageButton, "right", 18)
hooksecurefunc("AuctionFrame_OnShow", function()
AuctionFrame:ClearAllPoints()
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterSkin("Battlefield", "vanilla:tbc", function ()
pfUI:RegisterSkin("Battlefield", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterSkin("Battlefield Minimap", "vanilla:tbc", function ()
pfUI:RegisterSkin("Battlefield Minimap", "vanilla", function ()
local rawborder, border = GetBorderSize()
HookAddonOrVariable("Blizzard_BattlefieldMinimap", function()
+6 -19
View File
@@ -1,26 +1,13 @@
pfUI:RegisterSkin("Character", "vanilla:tbc", function ()
pfUI:RegisterSkin("Character", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
-- Compatibility
if PlayerTitleDropDown then -- tbc, wotlk
-- Character Tab
SkinDropDown(PlayerTitleDropDown)
PlayerTitleDropDown:SetPoint("TOP", CharacterLevelText, "BOTTOM", 0, -2)
PlayerTitleDropDownText:SetPoint("LEFT", PlayerTitleDropDown.backdrop, "LEFT", 6, 2)
SkinDropDown(PlayerStatFrameLeftDropDown)
SkinDropDown(PlayerStatFrameRightDropDown)
-- Honor Tab
StripTextures(HonorFrame)
-- Honor Tab
StripTextures(PVPFrame)
else -- vanilla
-- Honor Tab
StripTextures(HonorFrame)
HonorFrameProgressBar:SetStatusBarTexture(pfUI.media["img:bar"])
CreateBackdrop(HonorFrameProgressBar)
HonorFrameProgressBar:SetHeight(24)
end
HonorFrameProgressBar:SetStatusBarTexture(pfUI.media["img:bar"])
CreateBackdrop(HonorFrameProgressBar)
HonorFrameProgressBar:SetHeight(24)
local magicResTextureCords = {
{0.21875, 0.78125, 0.25, 0.3203125},
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterSkin("Dress Up Frame", "vanilla:tbc", function ()
pfUI:RegisterSkin("Dress Up Frame", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
+1 -59
View File
@@ -1,4 +1,4 @@
pfUI:RegisterSkin("Friends", "vanilla:tbc", function ()
pfUI:RegisterSkin("Friends", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
local maxtab = pfUI.expansion == "vanilla" and 4 or 5
@@ -336,24 +336,6 @@ pfUI:RegisterSkin("Friends", "vanilla:tbc", function ()
GuildInfoCancelButton:ClearAllPoints()
GuildInfoCancelButton:SetPoint("BOTTOMRIGHT", GuildInfoFrame, "BOTTOMRIGHT", -10, 8)
if GuildInfoGuildEventButton then -- log button (tbc+)
SkinButton(GuildInfoGuildEventButton)
GuildInfoGuildEventButton:ClearAllPoints()
GuildInfoGuildEventButton:SetPoint("BOTTOM", GuildInfoFrame, "BOTTOM", 0, 8)
end
if GuildEventLogFrame then -- guild log frame (tbc+)
StripTextures(GuildEventFrame)
CreateBackdrop(GuildEventFrame, nil, true, .75)
StripTextures(GuildEventLogFrame)
CreateBackdrop(GuildEventLogFrame, nil, true, .75)
StripTextures(GuildEventLogScrollFrame)
SkinScrollbar(GuildEventLogScrollFrameScrollBar)
SkinCloseButton(GuildEventLogCloseButton)
GuildEventLogCancelButton:SetPoint("BOTTOMRIGHT", -9, 8)
SkinButton(GuildEventLogCancelButton)
end
-- guild control
StripTextures(GuildControlPopupFrame)
CreateBackdrop(GuildControlPopupFrame, nil, true, .75)
@@ -392,46 +374,6 @@ pfUI:RegisterSkin("Friends", "vanilla:tbc", function ()
GuildControlPopupAcceptButton:SetPoint("RIGHT", GuildControlPopupFrameCancelButton, "LEFT", -2*bpad, 0)
end
if ChannelFrameVerticalBar then -- Channel Tab (TBC+)
StripTextures(ChannelFrameVerticalBar)
SkinButton(ChannelFrameNewButton)
ChannelFrameNewButton:SetPoint("BOTTOMRIGHT", -15, 82)
StripTextures(ChannelListScrollFrame)
SkinScrollbar(ChannelListScrollFrameScrollBar)
for i = 1, MAX_DISPLAY_CHANNEL_BUTTONS do
StripTextures(_G["ChannelButton"..i])
SkinButton(_G["ChannelButton"..i])
end
for i = 1, 22 do
StripTextures(_G["ChannelMemberButton"..i])
end
CreateBackdrop(ChannelMemberButton1)
ChannelMemberButton1.backdrop:SetPoint("BOTTOMRIGHT", ChannelMemberButton22, "BOTTOMRIGHT", -1, 0)
StripTextures(ChannelRosterScrollFrame)
SkinScrollbar(ChannelRosterScrollFrameScrollBar)
StripTextures(ChannelFrameDaughterFrame)
CreateBackdrop(ChannelFrameDaughterFrame)
StripTextures(ChannelFrameDaughterFrameChannelName)
CreateBackdrop(ChannelFrameDaughterFrameChannelName, nil, true)
ChannelFrameDaughterFrameChannelName:SetTextInsets(5,5,5,5)
StripTextures(ChannelFrameDaughterFrameChannelPassword)
CreateBackdrop(ChannelFrameDaughterFrameChannelPassword, nil, true)
ChannelFrameDaughterFrameChannelPassword:SetTextInsets(5,5,5,5)
SkinCloseButton(ChannelFrameDaughterFrameDetailCloseButton)
SkinButton(ChannelFrameDaughterFrameCancelButton)
SkinButton(ChannelFrameDaughterFrameOkayButton)
end
do -- Raid Tab
StripTextures(RaidInfoFrame)
CreateBackdrop(RaidInfoFrame, nil, true, .75)
+2 -6
View File
@@ -1,14 +1,10 @@
pfUI:RegisterSkin("Game Menu", "vanilla:tbc", function ()
pfUI:RegisterSkin("Game Menu", "vanilla", function ()
StripTextures(GameMenuFrame)
CreateBackdrop(GameMenuFrame, nil, true, .75)
CreateBackdropShadow(GameMenuFrame)
GameMenuFrame:SetWidth(GameMenuFrame:GetWidth() - 30)
if pfUI.expansion == 'tbc' then
GameMenuFrame:SetHeight(GameMenuFrame:GetHeight() + 10)
elseif pfUI.expansion == 'vanilla' then
GameMenuFrame:SetHeight(GameMenuFrame:GetHeight() + 6)
end
GameMenuFrame:SetHeight(GameMenuFrame:GetHeight() + 6)
local title = GetNoNameObject(GameMenuFrame, "FontString", "ARTWORK", MAIN_MENU)
title:SetTextColor(1,1,1,1)
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterSkin("Gossip and Quest", "vanilla:tbc", function ()
pfUI:RegisterSkin("Gossip and Quest", "vanilla", function ()
local frames = {'Quest', 'Gossip'}
local panels = {'Greeting', 'Detail', 'Progress', 'Reward'}
local buttons = {
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterSkin("Guild Registrar", "vanilla:tbc", function ()
pfUI:RegisterSkin("Guild Registrar", "vanilla", function ()
StripTextures(GuildRegistrarFrame)
StripTextures(GuildRegistrarGreetingFrame)
CreateBackdrop(GuildRegistrarFrame, nil, nil, .75)
-131
View File
@@ -1,131 +0,0 @@
pfUI:RegisterSkin("Guild Bank", "tbc", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
HookAddonOrVariable("Blizzard_GuildBankUI", function()
do -- GuildBankFrame
StripTextures(GuildBankFrame)
CreateBackdrop(GuildBankFrame, nil, nil, .75)
CreateBackdropShadow(GuildBankFrame)
GuildBankFrame.backdrop:SetPoint("TOPLEFT", 10, -30)
GuildBankFrame.backdrop:SetPoint("BOTTOMRIGHT", 0, 4)
GuildBankFrame:SetHitRectInsets(10,0,30,4)
EnableMovable(GuildBankFrame)
SkinCloseButton(GetNoNameObject(GuildBankFrame, "Button", nil, "UI-Panel-MinimizeButton-Up"), GuildBankFrame.backdrop, -6, -6)
GuildBankEmblemFrame:ClearAllPoints()
GuildBankEmblemFrame:SetPoint("BOTTOM", GuildBankFrame.backdrop, "TOP", -70, 0)
for i = 1, 4 do
local tab = _G["GuildBankFrameTab"..i]
local lastTab = _G["GuildBankFrameTab"..(i-1)]
tab:ClearAllPoints()
if lastTab then
tab:SetPoint("LEFT", lastTab, "RIGHT", border*2 + 1, 0)
else
tab:SetPoint("TOPLEFT", GuildBankFrame.backdrop, "BOTTOMLEFT", bpad, -(border + (border == 1 and 1 or 2)))
end
SkinTab(tab)
end
for i = 1, 6 do
local frame = _G["GuildBankTab"..i]
local button = _G["GuildBankTab"..i.."Button"]
local lastbutton = _G["GuildBankTab"..(i-1).."Button"]
local texture = _G["GuildBankTab"..i.."ButtonIconTexture"]
StripTextures(frame)
SkinButton(button, nil, nil, nil, texture)
button:ClearAllPoints()
if lastbutton then
button:SetPoint("TOP", lastbutton, "BOTTOM", 0, - (border + (border == 1 and 1 or 2) + bpad))
else
button:SetPoint("TOPLEFT", 6, -60)
end
function button.SetChecked(self, checked)
if checked then
self.locked = true
self:SetBackdropBorderColor(1,1,1)
else
self.locked = false
self:SetBackdropBorderColor(GetStringColor(pfUI_config.appearance.border.color))
end
end
end
for i = 1, NUM_GUILDBANK_COLUMNS do
local column = _G["GuildBankColumn"..i]
StripTextures(column)
for j = 1, NUM_SLOTS_PER_GUILDBANK_GROUP do
local slot = _G["GuildBankColumn"..i.."Button"..j]
SkinButton(slot, nil, nil, nil, _G[slot:GetName().."IconTexture"], true)
end
end
hooksecurefunc("GuildBankFrame_Update", function()
if GuildBankFrame.mode ~= "bank" then return end
for i = 1, MAX_GUILDBANK_SLOTS_PER_TAB do
local index = math.fmod(i, NUM_SLOTS_PER_GUILDBANK_GROUP)
if index == 0 then index = NUM_SLOTS_PER_GUILDBANK_GROUP end
local column = ceil((i-.5)/NUM_SLOTS_PER_GUILDBANK_GROUP)
local slot = _G["GuildBankColumn"..column.."Button"..index]
local tab = GetCurrentGuildBankTab()
local link = GetGuildBankItemLink(tab, i)
if link then
local r,g,b = GetItemQualityColor(select(3, GetItemInfo(link)))
slot:SetBackdropBorderColor(r,g,b,1)
else
slot:SetBackdropBorderColor(GetStringColor(pfUI_config.appearance.border.color))
end
end
end)
SkinButton(GuildBankFrameDepositButton)
SkinButton(GuildBankFrameWithdrawButton)
GuildBankFrameWithdrawButton:ClearAllPoints()
GuildBankFrameWithdrawButton:SetPoint("RIGHT", GuildBankFrameDepositButton, "LEFT", -2*bpad, 0)
SkinButton(GuildBankInfoSaveButton)
GuildBankInfoScrollFrameScrollBar:Hide()
end
do -- GuildBankPopupFrame
StripTextures(GuildBankPopupFrame)
CreateBackdrop(GuildBankPopupFrame, nil, nil, .75)
CreateBackdropShadow(GuildBankPopupFrame)
GuildBankPopupFrame.backdrop:SetPoint("TOPLEFT", 0, -6)
GuildBankPopupFrame.backdrop:SetPoint("BOTTOMRIGHT", -26, 26)
GuildBankPopupFrame:SetHitRectInsets(0,26,6,26)
GuildBankPopupFrame.backdrop:SetPoint("TOPLEFT", GuildBankFrame.backdrop, "TOPRIGHT", 2*border, 0)
GuildBankPopupEditBox:DisableDrawLayer("BACKGROUND")
CreateBackdrop(GuildBankPopupEditBox)
StripTextures(GuildBankPopupScrollFrame)
CreateBackdrop(GuildBankPopupScrollFrame)
SkinScrollbar(GuildBankPopupScrollFrameScrollBar)
GuildBankPopupScrollFrame:ClearAllPoints()
GuildBankPopupScrollFrame:SetPoint("TOPLEFT", GuildBankPopupEditBox, "BOTTOMLEFT", -11, -14)
GuildBankPopupScrollFrame:SetWidth(182)
GuildBankPopupScrollFrame:SetHeight(178)
for i = 1, 16 do
local slot = _G["GuildBankPopupButton"..i]
StripTextures(slot)
SkinButton(slot, nil, nil, nil, _G["GuildBankPopupButton"..i.."Icon"], true)
end
GuildBankPopupButton1:ClearAllPoints()
GuildBankPopupButton1:SetPoint("TOPLEFT", GuildBankPopupScrollFrame, "TOPLEFT", 4, -4)
SkinButton(GuildBankPopupCancelButton)
SkinButton(GuildBankPopupOkayButton)
GuildBankPopupOkayButton:ClearAllPoints()
GuildBankPopupOkayButton:SetPoint("RIGHT", GuildBankPopupCancelButton, "LEFT", -2*bpad, 0)
end
end)
end)
+1 -13
View File
@@ -1,19 +1,7 @@
pfUI:RegisterSkin("Help", "vanilla:tbc", function ()
pfUI:RegisterSkin("Help", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
-- not much here for tbc yet
if pfUI.client > 11200 then
local ticket, background = TicketStatusFrame:GetChildren()
CreateBackdrop(background, nil, true, .75)
TicketStatusFrame:SetHeight(40)
TicketStatusFrame:ClearAllPoints()
TicketStatusFrame:SetPoint("TOP", 0, -5)
UpdateMovable(TicketStatusFrame)
return
end
StripTextures(HelpFrame)
CreateBackdrop(HelpFrame, nil, nil, .75)
CreateBackdropShadow(HelpFrame)
-105
View File
@@ -20,111 +20,6 @@ local slots = {
"RangedSlot",
}
pfUI:RegisterSkin("Inspect", "tbc", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
HookAddonOrVariable("Blizzard_InspectUI", function()
CreateBackdrop(InspectFrame, nil, nil, .75)
CreateBackdropShadow(InspectFrame)
InspectFrame.backdrop:SetPoint("TOPLEFT", 10, -10)
InspectFrame.backdrop:SetPoint("BOTTOMRIGHT", -30, 72)
InspectFrame:SetHitRectInsets(10,30,10,72)
EnableMovable("InspectFrame", "Blizzard_InspectUI", INSPECTFRAME_SUBFRAMES)
SkinCloseButton(InspectFrameCloseButton, InspectFrame.backdrop, -6, -6)
InspectFrame:DisableDrawLayer("ARTWORK")
InspectNameText:ClearAllPoints()
InspectNameText:SetPoint("TOP", InspectFrame.backdrop, "TOP", 0, -10)
InspectGuildText:Show()
InspectGuildText:ClearAllPoints()
InspectGuildText:SetPoint("TOP", InspectLevelText, "BOTTOM", 0, -1)
for i = 1, 3 do
local tab = _G["InspectFrameTab"..i]
local lastTab = _G["InspectFrameTab"..(i-1)]
tab:ClearAllPoints()
if lastTab then
tab:SetPoint("LEFT", lastTab, "RIGHT", border*2 + 1, 0)
else
tab:SetPoint("TOPLEFT", InspectFrame.backdrop, "BOTTOMLEFT", bpad, -(border + (border == 1 and 1 or 2)))
end
SkinTab(tab)
end
do -- Character Tab
StripTextures(InspectPaperDollFrame)
EnableClickRotate(InspectModelFrame)
InspectModelRotateLeftButton:Hide()
InspectModelRotateRightButton:Hide()
for _, slot in pairs(slots) do
local frame = _G["Inspect"..slot]
SkinButton(frame, nil, nil, nil, _G["Inspect"..slot.."IconTexture"], true)
end
hooksecurefunc("InspectPaperDollFrame_OnShow", function()
local guild, title = GetGuildInfo(InspectFrame.unit)
local text = guild and format(TEXT(GUILD_TITLE_TEMPLATE), title, guild) or ""
InspectGuildText:SetText(text)
end)
hooksecurefunc("InspectPaperDollItemSlotButton_Update", function(button)
local unit = InspectFrame.unit
local link = GetInventoryItemLink(unit, button:GetID())
if link then
local quality = select(3, GetItemInfo(link))
button:SetBackdropBorderColor(GetItemQualityColor(quality))
else
button:SetBackdropBorderColor(pfUI.cache.er, pfUI.cache.eg, pfUI.cache.eb, pfUI.cache.ea)
end
end)
end
do -- PVP Tab
StripTextures(InspectPVPFrame)
end
do -- Talent Tab
StripTextures(InspectTalentFrame)
InspectTalentFrameCancelButton:Hide()
InspectTalentFrameCloseButton:Hide()
InspectTalentFrameSpentPoints:ClearAllPoints()
InspectTalentFrameSpentPoints:SetPoint("BOTTOMRIGHT", InspectTalentFrame, "BOTTOMRIGHT", 0, 83)
StripTextures(InspectTalentFrameScrollFrame)
SkinScrollbar(InspectTalentFrameScrollFrameScrollBar)
for i = 1, MAX_NUM_TALENTS do
local talent = _G["InspectTalentFrameTalent"..i]
if talent then
StripTextures(talent)
SkinButton(talent, nil, nil, nil, _G["InspectTalentFrameTalent"..i.."IconTexture"])
_G["InspectTalentFrameTalent"..i.."Rank"]:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE")
end
end
for i = 1, 3 do
local tab = _G["InspectTalentFrameTab"..i]
local lastTab = _G["InspectTalentFrameTab"..(i-1)]
tab:ClearAllPoints()
if lastTab then
tab:SetPoint("LEFT", lastTab, "RIGHT", border*2 + 1, 0)
else
tab:SetPoint("TOPLEFT", 70, -50)
end
SkinTab(tab)
end
end
end)
end)
pfUI:RegisterSkin("Inspect", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterSkin("Books", "vanilla:tbc", function ()
pfUI:RegisterSkin("Books", "vanilla", function ()
StripTextures(ItemTextFrame)
CreateBackdrop(ItemTextFrame, nil, nil, .75)
CreateBackdropShadow(ItemTextFrame)
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterSkin("KeyBindings", "vanilla:tbc", function ()
pfUI:RegisterSkin("KeyBindings", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
-75
View File
@@ -1,75 +0,0 @@
pfUI:RegisterSkin("Looking for group", "tbc", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
StripTextures(LFGParentFrame)
CreateBackdrop(LFGParentFrame, nil, nil, .75)
CreateBackdropShadow(LFGParentFrame)
LFGParentFrame.backdrop:SetPoint("TOPLEFT", 14, -10)
LFGParentFrame.backdrop:SetPoint("BOTTOMRIGHT", -26, 72)
LFGParentFrame:SetHitRectInsets(14,26,10,72)
EnableMovable(LFGParentFrame)
SkinCloseButton(GetNoNameObject(LFGParentFrame, 'Button', nil, "UI-Panel-MinimizeButton-Up"), LFGParentFrame.backdrop, -6, -6)
LFGParentFrame:DisableDrawLayer("BACKGROUND")
LFGParentFrameTitle:ClearAllPoints()
LFGParentFrameTitle:SetPoint("TOP", LFGParentFrame.backdrop, "TOP", 0, -10)
SkinTab(LFGParentFrameTab1)
LFGParentFrameTab1:ClearAllPoints()
LFGParentFrameTab1:SetPoint("TOPLEFT", LFGParentFrame.backdrop, "BOTTOMLEFT", bpad, -(border + (border == 1 and 1 or 2)))
SkinTab(LFGParentFrameTab2)
LFGParentFrameTab2:ClearAllPoints()
LFGParentFrameTab2:SetPoint("LEFT", LFGParentFrameTab1, "RIGHT", border*2 + 1, 0)
LFGParentFrameBackground:Hide()
LFGFrameClearAllButton:ClearAllPoints()
LFGFrameClearAllButton:SetPoint("RIGHT", LFGFrameDoneButton, "LEFT", -2*bpad, 0)
StripTextures(AutoJoinBackground)
SkinCheckbox(AutoJoinCheckButton)
StripTextures(AddMemberBackground)
SkinCheckbox(AutoAddMembersCheckButton)
CreateBackdrop(LFGComment)
-- skin buttons
local buttons = {
"LFGWizardFrameLFGButton",
"LFGWizardFrameLFMButton",
"LFGFrameDoneButton",
"LFGFrameClearAllButton",
"LFMFrameGroupInviteButton",
"LFMFrameSendMessageButton",
"LFMFrameSearchButton",
"LFMFrameColumnHeader1",
"LFMFrameColumnHeader2",
"LFMFrameColumnHeader3",
"LFMFrameColumnHeader4",
}
for _, name in pairs(buttons) do
SkinButton(_G[name])
end
-- skin dropdowns
local dropdowns = {
"LFGFrameTypeDropDown1",
"LFGFrameNameDropDown1",
"LFGFrameTypeDropDown2",
"LFGFrameNameDropDown2",
"LFGFrameTypeDropDown3",
"LFGFrameNameDropDown3",
}
for _, name in pairs(dropdowns) do
SkinDropDown(_G[name])
end
SkinDropDown(LFMFrameTypeDropDown, nil, nil, nil, true)
SkinDropDown(LFMFrameNameDropDown, nil, nil, nil, true)
end)
+1 -1
View File
@@ -1,4 +1,4 @@
pfUI:RegisterSkin("Macro", "vanilla:tbc", function ()
pfUI:RegisterSkin("Macro", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
+2 -46
View File
@@ -1,53 +1,10 @@
pfUI:RegisterSkin("Mailbox", "vanilla:tbc", function ()
pfUI:RegisterSkin("Mailbox", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
-- Compatibility
local StationeryBackgroundLeft, StationeryBackgroundRight
if ATTACHMENTS_MAX_SEND then -- tbc
do -- SendMailFrame
for i = 1, ATTACHMENTS_MAX_SEND do
local btn = _G["SendMailAttachment"..i]
StripTextures(btn)
SkinButton(btn, nil, nil, nil, nil, true)
end
hooksecurefunc("SendMailFrame_Update", function()
for i = 1, ATTACHMENTS_MAX_SEND do
local btn = _G["SendMailAttachment"..i]
HandleIcon(btn, btn:GetNormalTexture())
local link = GetSendMailItemLink(i)
if link then
local r,g,b = GetItemQualityColor(select(3, GetItemInfo(link)))
btn:SetBackdropBorderColor(r,g,b,1)
else
btn:SetBackdropBorderColor(GetStringColor(pfUI_config.appearance.border.color))
end
end
end)
StationeryBackgroundLeft, StationeryBackgroundRight = SendStationeryBackgroundLeft, SendStationeryBackgroundRight
end
do -- OpenMailFrame
for i = 1, ATTACHMENTS_MAX_RECEIVE do
SkinButton(_G["OpenMailAttachmentButton"..i], nil, nil, nil, _G["OpenMailAttachmentButton"..i.."IconTexture"], true)
end
hooksecurefunc("InboxFrame_OnClick", function(index)
for i=1, ATTACHMENTS_MAX_RECEIVE do
local link = GetInboxItemLink(index, i)
if not link then return end
local r,g,b = GetItemQualityColor(select(3, GetItemInfo(link)))
_G["OpenMailAttachmentButton"..i]:SetBackdropBorderColor(r,g,b,1)
end
end)
SkinButton(OpenMailReportSpamButton)
end
else -- vanilla
do -- SendMailFrame
do -- SendMailFrame
local skin = CreateFrame("Frame")
skin:SetScript("OnEvent", function()
this:UnregisterEvent("MAIL_SHOW")
@@ -122,7 +79,6 @@ pfUI:RegisterSkin("Mailbox", "vanilla:tbc", function ()
end
end)
end
end
StripTextures(MailFrame, true)
CreateBackdrop(MailFrame, nil, nil, .75)
+3 -15
View File
@@ -1,21 +1,9 @@
pfUI:RegisterSkin("Merchant", "vanilla:tbc", function ()
pfUI:RegisterSkin("Merchant", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
-- Compatibility
if MerchantGuildBankRepairButton then -- tbc
SkinButton(MerchantGuildBankRepairButton, nil, nil, nil, MerchantGuildBankRepairButtonIcon)
MerchantGuildBankRepairButtonIcon:SetTexCoord(.59, .82, .06, .54)
hooksecurefunc("MerchantFrame_UpdateRepairButtons", function()
MerchantGuildBankRepairButton:ClearAllPoints()
MerchantGuildBankRepairButton:SetPoint("RIGHT", MerchantBuyBackItemItemButton, "LEFT", -14, 0)
MerchantRepairAllButton:ClearAllPoints()
MerchantRepairAllButton:SetPoint("RIGHT", MerchantGuildBankRepairButton, "LEFT", -6, 0)
end)
else -- vanilla
MerchantRepairAllButton:ClearAllPoints()
MerchantRepairAllButton:SetPoint("RIGHT", MerchantBuyBackItemItemButton, "LEFT", -6, 0)
end
MerchantRepairAllButton:ClearAllPoints()
MerchantRepairAllButton:SetPoint("RIGHT", MerchantBuyBackItemItemButton, "LEFT", -6, 0)
StripTextures(MerchantFrame)
CreateBackdrop(MerchantFrame, nil, nil, .75)
+6 -6
View File
@@ -1,4 +1,4 @@
pfUI:RegisterSkin("Stack Split", "vanilla:tbc", function ()
pfUI:RegisterSkin("Stack Split", "vanilla", function ()
StripTextures(StackSplitFrame)
CreateBackdrop(StackSplitFrame, nil, nil, .75)
CreateBackdropShadow(StackSplitFrame)
@@ -7,7 +7,7 @@ pfUI:RegisterSkin("Stack Split", "vanilla:tbc", function ()
SkinButton(StackSplitCancelButton)
end)
pfUI:RegisterSkin("Coin Pickup", "vanilla:tbc", function ()
pfUI:RegisterSkin("Coin Pickup", "vanilla", function ()
StripTextures(CoinPickupFrame)
CreateBackdrop(CoinPickupFrame, nil, nil, .75)
CreateBackdropShadow(CoinPickupFrame)
@@ -16,7 +16,7 @@ pfUI:RegisterSkin("Coin Pickup", "vanilla:tbc", function ()
SkinButton(CoinPickupCancelButton)
end)
pfUI:RegisterSkin("Color Picker", "vanilla:tbc", function ()
pfUI:RegisterSkin("Color Picker", "vanilla", function ()
CreateBackdrop(ColorPickerFrame)
CreateBackdropShadow(ColorPickerFrame)
@@ -32,7 +32,7 @@ pfUI:RegisterSkin("Color Picker", "vanilla:tbc", function ()
SkinSlider(OpacitySliderFrame)
end)
pfUI:RegisterSkin("Opacity", "vanilla:tbc", function ()
pfUI:RegisterSkin("Opacity", "vanilla", function ()
CreateBackdrop(OpacityFrame, nil, true, .75)
CreateBackdropShadow(OpacityFrame)
@@ -41,7 +41,7 @@ pfUI:RegisterSkin("Opacity", "vanilla:tbc", function ()
OpacityFrameSlider:SetPoint("CENTER", 0, 0)
end)
pfUI:RegisterSkin("Tutorial", "vanilla:tbc", function ()
pfUI:RegisterSkin("Tutorial", "vanilla", function ()
CreateBackdrop(TutorialFrame, nil, true, .75)
CreateBackdropShadow(TutorialFrame)
@@ -49,7 +49,7 @@ pfUI:RegisterSkin("Tutorial", "vanilla:tbc", function ()
SkinButton(TutorialFrameOkayButton)
end)
pfUI:RegisterSkin("Quest Timer", "vanilla:tbc", function ()
pfUI:RegisterSkin("Quest Timer", "vanilla", function ()
CreateBackdrop(QuestTimerFrame, nil, nil, .75)
CreateBackdropShadow(QuestTimerFrame)
UpdateMovable(QuestTimerFrame, true)
-175
View File
@@ -1,175 +0,0 @@
pfUI:RegisterSkin("Options - Interface", "tbc", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
StripTextures(InterfaceOptionsFrame)
CreateBackdrop(InterfaceOptionsFrame, nil, nil, .75)
CreateBackdropShadow(InterfaceOptionsFrame)
EnableMovable(InterfaceOptionsFrame)
InterfaceOptionsFrameHeaderText:ClearAllPoints()
InterfaceOptionsFrameHeaderText:SetPoint("TOP", InterfaceOptionsFrame.backdrop, "TOP", 0, -10)
StripTextures(InterfaceOptionsFrameCategories)
CreateBackdrop(InterfaceOptionsFrameCategories, nil, true, .75)
StripTextures(InterfaceOptionsFrameAddOns)
CreateBackdrop(InterfaceOptionsFrameAddOns, nil, true, .75)
CreateBackdrop(InterfaceOptionsFramePanelContainer, nil, true, .75)
SkinTab(InterfaceOptionsFrameTab1)
InterfaceOptionsFrameTab1:ClearAllPoints()
InterfaceOptionsFrameTab1:SetPoint("BOTTOMLEFT", InterfaceOptionsFrameCategories, "TOPLEFT", bpad, border + (border == 1 and 1 or 2))
SkinTab(InterfaceOptionsFrameTab2)
InterfaceOptionsFrameTab2:ClearAllPoints()
InterfaceOptionsFrameTab2:SetPoint("LEFT", InterfaceOptionsFrameTab1, "RIGHT", border*2 + 1, 0)
SkinButton(InterfaceOptionsFrameDefaults)
InterfaceOptionsFrameDefaults:ClearAllPoints()
InterfaceOptionsFrameDefaults:SetPoint("TOPLEFT", InterfaceOptionsFrameCategories, "BOTTOMLEFT", 0, -10)
SkinButton(InterfaceOptionsFrameCancel)
InterfaceOptionsFrameCancel:ClearAllPoints()
InterfaceOptionsFrameCancel:SetPoint("TOPRIGHT", InterfaceOptionsFramePanelContainer, "BOTTOMRIGHT", 0, -10)
SkinButton(InterfaceOptionsFrameOkay)
InterfaceOptionsFrameOkay:ClearAllPoints()
InterfaceOptionsFrameOkay:SetPoint("RIGHT", InterfaceOptionsFrameCancel, "LEFT", -2*bpad, 0)
-- universal code for handling any frames!
local function SkinAllObjects(frame)
for _,obj in ipairs({frame:GetChildren()}) do
local obj_type = obj:GetObjectType()
if obj_type == "CheckButton" then
local size = obj:GetHeight()
if size > 26 then size = 26 end
SkinCheckbox(obj, size)
elseif obj_type == "Button" then
SkinButton(obj)
elseif obj_type == "Slider" then
SkinSlider(obj)
elseif obj_type == "Frame" then
local name = obj.GetName and obj:GetName()
if name and _G[name.."Button"] then
SkinDropDown(obj)
else
SkinAllObjects(obj)
end
end
end
end
local blizzardCategories = {
InterfaceOptionsControlsPanel, InterfaceOptionsCombatPanel, InterfaceOptionsDisplayPanel,
InterfaceOptionsQuestsPanel, InterfaceOptionsSocialPanel, InterfaceOptionsActionBarsPanel,
InterfaceOptionsNamesPanel, InterfaceOptionsCombatTextPanel, InterfaceOptionsStatusTextPanel,
InterfaceOptionsPartyRaidPanel, InterfaceOptionsCameraPanel, InterfaceOptionsMousePanel,
InterfaceOptionsHelpPanel, InterfaceOptionsLanguagesPanel
}
for _,frame in ipairs(blizzardCategories) do
SkinAllObjects(frame)
end
-- skin the option panel of any addon
for _,frame in pairs(INTERFACEOPTIONS_ADDONCATEGORIES) do
SkinAllObjects(frame)
end
end)
pfUI:RegisterSkin("Options - Interface", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
UIOptionsFrame:SetParent(UIParent)
UIOptionsFrame:SetWidth(1024)
UIOptionsFrame:SetHeight(700)
StripTextures(UIOptionsFrame)
CreateBackdrop(UIOptionsFrame, nil, nil, .75)
CreateBackdropShadow(UIOptionsFrame)
EnableMovable(UIOptionsFrame)
HookScript(UIOptionsFrame, "OnShow", function()
this:ClearAllPoints()
this:SetPoint("CENTER", 0, 0)
end)
UIOptionsFrame.backdrop:SetPoint("BOTTOMRIGHT", 0, 50)
UIOptionsFrame:SetHitRectInsets(0,0,0,50)
-- increase button layer
UIOptionsFrameTab1:SetFrameLevel(8)
UIOptionsFrameTab2:SetFrameLevel(8)
UIOptionsFrameDefaults:SetFrameLevel(8)
UIOptionsFrameCancel:SetFrameLevel(8)
UIOptionsFrameOkay:SetFrameLevel(8)
local close = GetNoNameObject(UIOptionsFrame, "Button", nil, "UI-Panel-MinimizeButton-Up")
if close then
close:SetFrameLevel(8)
SkinCloseButton(close, UIOptionsFrame.backdrop, -6, -6)
end
if UIOptionsFrameTitle then
UIOptionsFrameTitle:ClearAllPoints()
UIOptionsFrameTitle:SetPoint("TOP", UIOptionsFrame.backdrop, "TOP", 0, -10)
end
SkinTab(UIOptionsFrameTab1)
UIOptionsFrameTab1:ClearAllPoints()
UIOptionsFrameTab1:SetPoint("TOPLEFT", UIOptionsFrame.backdrop, "TOPLEFT", 20, -20)
UIOptionsFrameTab1:SetScript("OnClick", function()
PanelTemplates_Tab_OnClick(UIOptionsFrame)
BasicOptions:Show()
AdvancedOptions:Hide()
PlaySound("igCharacterInfoTab")
end)
SkinTab(UIOptionsFrameTab2)
UIOptionsFrameTab2:ClearAllPoints()
UIOptionsFrameTab2:SetPoint("LEFT", UIOptionsFrameTab1, "RIGHT", border*2 + 1, 0)
UIOptionsFrameTab2:SetScript("OnClick", function()
PanelTemplates_Tab_OnClick(UIOptionsFrame)
BasicOptions:Hide()
AdvancedOptions:Show()
PlaySound("igCharacterInfoTab")
end)
UIOptionsFrameCheckButton1:ClearAllPoints() -- Invert Mouse button
UIOptionsFrameCheckButton1:SetPoint("TOPLEFT", UIOptionsFrameSlider1, "TOPRIGHT", 38, 14)
for i=1, 69 do
local buton = _G["UIOptionsFrameCheckButton"..i]
if buton then
SkinCheckbox(buton)
end
end
for i=1, 4 do
SkinSlider(_G["UIOptionsFrameSlider"..i])
end
CreateBackdrop(BasicOptionsGeneral, nil, true, .75)
CreateBackdrop(BasicOptionsDisplay, nil, true, .75)
CreateBackdrop(BasicOptionsCamera, nil, true, .75)
CreateBackdrop(BasicOptionsHelp, nil, true, .75)
CreateBackdrop(AdvancedOptionsActionBars, nil, true, .75)
CreateBackdrop(AdvancedOptionsChat, nil, true, .75)
CreateBackdrop(AdvancedOptionsRaid, nil, true, .75)
CreateBackdrop(AdvancedOptionsCombatText, nil, true, .75)
SkinDropDown(UIOptionsFrameClickCameraDropDown)
SkinDropDown(UIOptionsFrameCameraDropDown)
SkinDropDown(UIOptionsFrameTargetofTargetDropDown)
SkinDropDown(UIOptionsFrameCombatTextDropDown)
SkinButton(UIOptionsFrameResetTutorials)
SkinButton(UIOptionsFrameDefaults)
UIOptionsFrameDefaults:ClearAllPoints()
UIOptionsFrameDefaults:SetPoint("BOTTOMLEFT", UIOptionsFrame.backdrop, "BOTTOMLEFT", 14, 14)
SkinButton(UIOptionsFrameCancel)
UIOptionsFrameCancel:ClearAllPoints()
UIOptionsFrameCancel:SetPoint("BOTTOMRIGHT", UIOptionsFrame.backdrop, "BOTTOMRIGHT", -14, 14)
SkinButton(UIOptionsFrameOkay)
UIOptionsFrameOkay:ClearAllPoints()
UIOptionsFrameOkay:SetPoint("RIGHT", UIOptionsFrameCancel, "LEFT", -2*bpad, 0)
end)
+11 -33
View File
@@ -1,40 +1,18 @@
pfUI:RegisterSkin("Options - Sound", "vanilla:tbc", function ()
pfUI:RegisterSkin("Options - Sound", "vanilla", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
-- Compatibility
local SoundOptionsFrameHeaderText, NUM_CHECKBOXES, NUM_SLIDERS
if SOUND_OPTIONS then -- tbc
SoundOptionsFrameHeaderText = GetNoNameObject(SoundOptionsFrame, "FontString", "BACKGROUND", SOUND_OPTIONS)
NUM_CHECKBOXES = 11
NUM_SLIDERS = 6
local SoundOptionsFrameHeaderText = GetNoNameObject(SoundOptionsFrame, "FontString", "ARTWORK", SOUNDOPTIONS_MENU)
local NUM_CHECKBOXES = 8
local NUM_SLIDERS = 4
StripTextures(AudioOptionsFrame)
CreateBackdrop(SoundOptionsFramePlayback, nil, true, .75)
CreateBackdrop(SoundOptionsFrameHardware, nil, true, .75)
CreateBackdrop(SoundOptionsFrameVolume, nil, true, .75)
SkinDropDown(SoundOptionsOutputDropDown)
SoundOptionsFrameDefaults:ClearAllPoints()
SoundOptionsFrameDefaults:SetPoint("TOPLEFT", SoundOptionsFramePlayback, "BOTTOMLEFT", 0, -10)
SoundOptionsFrameCancel:ClearAllPoints()
SoundOptionsFrameCancel:SetPoint("TOPRIGHT", SoundOptionsFrameVolume, "BOTTOMRIGHT", 0, -10)
SoundOptionsFrameOkay:ClearAllPoints()
SoundOptionsFrameOkay:SetPoint("RIGHT", SoundOptionsFrameCancel, "LEFT", -2*bpad, 0)
else -- vanilla
SoundOptionsFrameHeaderText = GetNoNameObject(SoundOptionsFrame, "FontString", "ARTWORK", SOUNDOPTIONS_MENU)
NUM_CHECKBOXES = 8
NUM_SLIDERS = 4
SoundOptionsFrameOkay:ClearAllPoints()
SoundOptionsFrameOkay:SetPoint("RIGHT", SoundOptionsFrameCancel, "LEFT", -2*bpad, 0)
SoundOptionsFrameSlider1:ClearAllPoints()
SoundOptionsFrameSlider1:SetPoint("TOPRIGHT", SoundOptionsFrame, "TOPRIGHT", -18, -43)
for i=2, NUM_SLIDERS do
_G["SoundOptionsFrameSlider"..i]:ClearAllPoints()
_G["SoundOptionsFrameSlider"..i]:SetPoint("TOP", _G["SoundOptionsFrameSlider"..i-1], "BOTTOM", 0, -30)
end
SoundOptionsFrameOkay:ClearAllPoints()
SoundOptionsFrameOkay:SetPoint("RIGHT", SoundOptionsFrameCancel, "LEFT", -2*bpad, 0)
SoundOptionsFrameSlider1:ClearAllPoints()
SoundOptionsFrameSlider1:SetPoint("TOPRIGHT", SoundOptionsFrame, "TOPRIGHT", -18, -43)
for i=2, NUM_SLIDERS do
_G["SoundOptionsFrameSlider"..i]:ClearAllPoints()
_G["SoundOptionsFrameSlider"..i]:SetPoint("TOP", _G["SoundOptionsFrameSlider"..i-1], "BOTTOM", 0, -30)
end
StripTextures(SoundOptionsFrame)

Some files were not shown because too many files have changed in this diff Show More