mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-22 07:36:56 +00:00
00292ca3b4
commit70b1e66c2dAuthor: Brues <5278969+brues-code@users.noreply.github.com> Date: Sun Jul 26 18:30:18 2026 -0500 Use SetSize/SetShown and simplify minimap/map commit7b6bfe9975Author: Brues <5278969+brues-code@users.noreply.github.com> Date: Sat Jul 25 11:27:14 2026 -0500 Include raidpet frames in /pftest test mode The unit-frame test toggle (showall) only previews frames that exist and are positioned. Raidpet frames are created when raidpet.visible == "1", but LayoutPets' collapse mode only positions pets whose raidpet<N> unit actually exists, so solo/in test mode they stayed hidden. Add a showall branch to LayoutPets that mirror-lays every pet cell and shows it (bypassing collapse and the roster gate), still guarded by the existing showpets check so nothing happens when raidpet is disabled. Call LayoutPets from the /pftest handler so the grid updates immediately on toggle-on and restores to the normal layout on toggle-off. commit4c65c38647Author: Brues <5278969+brues-code@users.noreply.github.com> Date: Sat Jul 25 10:34:33 2026 -0500 Remove unused RangeCache local in UnitInRange commit6c96bbbe6cAuthor: Brues <5278969+brues-code@users.noreply.github.com> Date: Sat Jul 25 10:34:33 2026 -0500 Use Clamp() for the two-sided clamps in ui-widgets Replace the hand-rolled math.min/math.max and if/elseif clamp idioms in the status bar and scroll frame with Clamp(). Equivalent for every value seen (min <= max always holds), just clearer. commit830e0a0be1Author: Brues <5278969+brues-code@users.noreply.github.com> Date: Sat Jul 25 10:34:33 2026 -0500 Drop vanilla GetItemInfo shim for C_Item.GetItemInfo The compat/vanilla.lua GetItemInfo override reshaped vanilla's tuple into retail order by inserting nil at slot 4 (itemLevel), but truncated at 8 fields, dropping itemEquipLoc/itemTexture. ClassicAPI's global GetItemInfo keeps the vanilla shape (its hook only warms the item cache), so the shim stayed necessary but incomplete. Remove it and point the three callers at ClassicAPI's C_Item.GetItemInfo, which returns the full 18-field retail tuple. Positions 1-8 are identical to the old shim output, so bags/roll are unchanged; character.lua's itemSlot (equipLoc, field 9) was always nil under the truncating shim and now resolves correctly for ShaguScore. commitc0da63657dAuthor: Brues <5278969+brues-code@users.noreply.github.com> Date: Sat Jul 25 10:09:34 2026 -0500 Various cleanup Removes version compatibility checks for TBC/Vanilla, consolidating code to target a single WoW version. Refactors repetitive SetWidth/SetHeight calls to SetSize for cleaner code. Removes duplicate function definitions from unitxp module and simplifies conditional show/hide operations using SetShown. commit11a6302c2dAuthor: Brues <5278969+brues-code@users.noreply.github.com> Date: Sat Jul 25 09:53:37 2026 -0500 Delegate pfUI.api.strsplit to ClassicAPI's strsplit Replace the Lua pattern-based implementation with a thin wrapper around ClassicAPI's C-level strsplit. Keeps the pfUI.api.strsplit entry point for backwards compatibility with addons that call it, while dropping the redundant reimplementation. Behavioral note: the old version used ([^delim]+) which silently collapsed empty fields; delegating to real strsplit now preserves them ("a,,b" -> "a", "", "b"). All in-repo callers split numeric color tuples, version strings, or build name-keyed lookup tables, none of which are affected by empty-field preservation. commit67c126eac8Author: Brues <5278969+brues-code@users.noreply.github.com> Date: Sat Jul 25 01:01:02 2026 -0500 Bump ClassicAPI minimum version to 1.8.0 commita6cf157518Author: Brues <5278969+brues-code@users.noreply.github.com> Date: Sat Jul 25 00:49:50 2026 -0500 read spell rank via C_Spell.GetSpellSubtext The rank string comes from the spell subtext ("Rank N"), which ClassicAPI's C_Spell.GetSpellSubtext returns directly -- so drop nampower's GetSpellRecField(spellId, "rank") here. The existing "Rank " gsub parse is unchanged. commit4b1ba99b4fAuthor: Brues <5278969+brues-code@users.noreply.github.com> Date: Sat Jul 25 00:33:20 2026 -0500 Move player info overlay onto ClassicAPI (drop Nampower) The haste/spell-power overlay read both values through Nampower and disabled itself entirely without it. Move both to ClassicAPI so it works on any ClassicAPI client: - Spell power: GetSpellPower("net") (nampower) -> GetSpellBonusDamage(i) (ClassicAPI, same per-school field). Merged the build+scan into one loop; the default school seeds the tiebreak so equal schools still favor it. - Haste: GetUnitField("player", "modCastSpeed") -> UnitSpellHaste("player"), which returns the haste percentage directly (the (1/modCastSpeed-1)*100 conversion is now baked in, off the same UNIT_MOD_CAST_SPEED field, signed). - Dropped the "if not GetUnitField then return" gate -- UpdateInfoText no longer touches Nampower, so the overlay runs everywhere. commit7df4aa6d50Author: Brues <5278969+brues-code@users.noreply.github.com> Date: Sat Jul 25 00:32:44 2026 -0500 Hook the real global _G.UnitHealth for feign death Inside a RegisterModule body, `function UnitHealth(...)` defines UnitHealth on the pfUI environment, not the real global -- so the feign-death real-HP fix only reached callers that resolve UnitHealth through pfUI's env, and missed _G consumers (Blizzard frames, other addons). Hook _G.UnitHealth explicitly (and capture oldUnitHealth from _G) so the un-gate applies everywhere. commitb0bf2fd869Author: Brues <5278969+brues-code@users.noreply.github.com> Date: Fri Jul 24 21:10:58 2026 -0500 Refactor nampower module Simplify reactive spell storage by using spell IDs instead of texture/name tables. Update to use modern C_Spell APIs (GetSpellTexture, GetSpellName) instead of manual texture paths. Consolidate SetWidth/SetHeight calls to SetSize and use print() instead of DEFAULT_CHAT_FRAME:AddMessage(). commit0b06961333Author: Brues <5278969+brues-code@users.noreply.github.com> Date: Fri Jul 24 20:54:23 2026 -0500 Use GetNamePlateForUnit for target lookups; drop dead ScanGuid block - Replace the three GetNamePlateForGUID(UnitGUID("target")) round-trips with GetNamePlateForUnit("target"), which resolves the token to a GUID internally -- no UnitGUID string detour, and it returns nil for no-target/no-plate so the UnitExists guards collapse. GetNamePlateForGUID is left for raw-GUID cases. - Remove the dead libunitscan.ScanGuid nameplate block (ScanGuid was deleted from libunitscan long ago, so the guard was never true) -- it carried the last GetUnitField("npcFlags") read. commit3e6210086eAuthor: Brues <5278969+brues-code@users.noreply.github.com> Date: Fri Jul 24 20:54:23 2026 -0500 Drop Nampower stats system and polling from unit frames GetUnitStats now reads health/power straight from UnitHealth/UnitPower (the descriptor fields the server broadcasts) -- for a real unit token GetUnitField read nothing different, so the whole Nampower-vs-fallback apparatus was measuring a distinction that no longer exists. Removed: - The stats system: pfUI.uf.stats, pfUIStatsFrame + UpdateStatsDisplay, the lastUnitStats change-cache, the /pfuistats slash command, and every counter increment (event/heartbeat/earlyReturn/throttledSkip/nampower/fallback). - All GetUnitField health reads (GetUnitStats, heal-prediction, health-gradient color) -- collapsed to the UnitHealth/UnitHealthMax they already fell back to. - The heartbeat-polling backstop and its fallbackThrottle/lastEventUpdate deps. Frames now refresh on events only; eventless frames still use their own tick, and range/aggro still run in the eventless-actions block. commit63001b7b0cAuthor: Brues <5278969+brues-code@users.noreply.github.com> Date: Fri Jul 24 20:09:42 2026 -0500 Move nameplates onto ClassicAPI stable nameplate tokens ClassicAPI now assigns retail-exact, per-plate-stable "nameplateN" tokens and fires vanilla UNIT_* events for them, so the nameplate module can key off the token instead of Nampower/SuperWoW GUID primitives: - Events: UNIT_AURA_GUID/UNIT_FLAGS_GUID -> UNIT_AURA/UNIT_FLAGS, matched by the "nameplateN" token (guarded on the token prefix, since these also fire for target/party/raid). Registered unconditionally -- no GetUnitField gate. - Health: GetUnitField(guid, "health"/"maxHealth") -> UnitHealth/UnitHealthMax on the plate's cached token. Same UNIT_FIELD_HEALTH the server broadcasts (real HP on Turtle; the ~= 100 scaled-vs-real guard is unchanged). - Combat/target in GetCombatStateColor: GetUnitField("flags") + HasFlag -> UnitAffectingCombat(token); GetUnitField("target") + SuperWoW "<guid>target" -> the "nameplateNtarget" chain. Dropped the now-dead HasFlag, UNIT_FLAG_IN_COMBAT, and guidTargetTokenCache. - GetCastInfo now takes the token directly; every caller already holds it, so the UnitTokenFromGUID(guid) round-trip is gone (unused module-wide now). NAME_PLATE_UNIT_ADDED caches the token as plate.nameplate.unit alongside the GUID; REMOVED clears both. GUID is retained only as the stable cache key (debuffCache/threatMemory/combatColorCache). Only GetUnitField("npcFlags") remains -- it has no token/vanilla equivalent. commitce1c49fcbbAuthor: Brues <5278969+brues-code@users.noreply.github.com> Date: Fri Jul 24 18:20:06 2026 -0500 Make focus/focustarget event-driven via ClassicAPI unit events ClassicAPI now fires UNIT_* (health/mana/aura/...) with arg1 == "focus" and arg1 == "focustarget", observed per-unit like target/party/raid. Both frames already registered those events (focus/focustarget are in pfValidUnits) and their OnEvent already matches arg1 == label, so the 0.2s polling ticks were pure workarounds for the missing events. Drop both ticks; the frames now refresh on-event like target, with range/glow still on the shared 0.5s state pass and PLAYER_FOCUS_CHANGED still driving assign/clear.
229 lines
8.2 KiB
Lua
229 lines
8.2 KiB
Lua
pfUI:RegisterSkin("Quest Log", function ()
|
|
local rawborder, border = GetBorderSize()
|
|
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
|
|
|
|
_G.QUESTS_DISPLAYED = 23
|
|
_G.MAX_WATCHABLE_QUESTS = 20 -- TODO
|
|
|
|
do -- quest log frame
|
|
QuestLogQuestCount:ClearAllPoints()
|
|
QuestLogQuestCount:SetPoint("TOPRIGHT", -10, -30)
|
|
|
|
hooksecurefunc("QuestLog_OnShow", function()
|
|
QuestLogFrame:ClearAllPoints()
|
|
QuestLogFrame:SetPoint("TOPLEFT", 10, -104)
|
|
end)
|
|
|
|
QuestLogFrame:SetSize(676, 440)
|
|
QuestLogFrame:DisableDrawLayer("BACKGROUND")
|
|
|
|
StripTextures(QuestLogFrame, true)
|
|
CreateBackdrop(QuestLogFrame, nil, nil, .75)
|
|
CreateBackdropShadow(QuestLogFrame)
|
|
|
|
EnableMovable(QuestLogFrame)
|
|
|
|
QuestLogTitleText:ClearAllPoints()
|
|
QuestLogTitleText:SetPoint("TOP", 0, -10)
|
|
SkinCloseButton(QuestLogFrameCloseButton, QuestLogFrame, -6, -6)
|
|
|
|
QuestLogNoQuestsText:ClearAllPoints()
|
|
QuestLogNoQuestsText:SetPoint("TOP", QuestLogFrame, 0, -100)
|
|
|
|
local QuestLogFrameLevelsCheckButton = CreateFrame("CheckButton", "QuestLogFrameLevelsCheckButton", QuestLogFrame, "UICheckButtonTemplate")
|
|
QuestLogFrameLevelsCheckButton:SetChecked(C.questlog.showQuestLevels == "1" and true or nil)
|
|
QuestLogFrameLevelsCheckButton:SetPoint("LEFT", QuestLogCollapseAllButton, "RIGHT", 0, 1)
|
|
QuestLogFrameLevelsCheckButton:SetScript("OnClick", function()
|
|
C.questlog.showQuestLevels = C.questlog.showQuestLevels == "1" and "0" or "1"
|
|
|
|
-- also update pfQuest's config
|
|
if pfQuest_config and pfQuestConfig and pfQuestConfig.UpdateConfigEntries then
|
|
pfQuest_config["questloglevel"] = C.questlog.showQuestLevels
|
|
pfQuestConfig:UpdateConfigEntries()
|
|
end
|
|
|
|
QuestLog_Update()
|
|
end)
|
|
SkinCheckbox(QuestLogFrameLevelsCheckButton, 23)
|
|
QuestLogFrameLevelsCheckButtonText:SetText(T["Quest Levels"])
|
|
|
|
CreateBackdrop(QuestLogTrack)
|
|
QuestLogTrack:SetSize(8, 8)
|
|
QuestLogTrack:ClearAllPoints()
|
|
QuestLogTrack:SetPoint("RIGHT", QuestLogQuestCount, "LEFT", -5, 0)
|
|
|
|
StripTextures(QuestLogTrack)
|
|
QuestLogTrackTracking:SetTexture(.8,.8,.8,1)
|
|
QuestLogTrackTitle:Hide()
|
|
|
|
SkinButton(QuestLogFrameAbandonButton)
|
|
QuestLogFrameAbandonButton:ClearAllPoints()
|
|
QuestLogFrameAbandonButton:SetPoint("BOTTOMLEFT", QuestLogFrame, "BOTTOMLEFT", 5, 5)
|
|
QuestLogFrameAbandonButton:SetWidth(98)
|
|
|
|
SkinButton(QuestFramePushQuestButton)
|
|
QuestFramePushQuestButton:ClearAllPoints()
|
|
QuestFramePushQuestButton:SetPoint("LEFT", QuestLogFrameAbandonButton, "RIGHT", 5, 0)
|
|
QuestFramePushQuestButton:SetWidth(98)
|
|
|
|
SkinButton(QuestFrameExitButton)
|
|
QuestFrameExitButton:ClearAllPoints()
|
|
QuestFrameExitButton:SetPoint("LEFT", QuestFramePushQuestButton, "RIGHT", 5, 0)
|
|
QuestFrameExitButton:SetWidth(99)
|
|
|
|
local QuestLogFrameExpandButton = CreateFrame("Button", "QuestLogFrameExpandButton", QuestLogFrame, "UIPanelButtonTemplate")
|
|
SkinArrowButton(QuestLogFrameExpandButton, "LEFT", 21)
|
|
SetAllPointsOffset(QuestLogFrameExpandButton.icon, QuestLogFrameExpandButton, 6)
|
|
QuestLogFrameExpandButton:SetPoint("LEFT", QuestFrameExitButton, "RIGHT", 5, 0)
|
|
QuestLogFrameExpandButton:SetScript("OnClick", function()
|
|
if QuestLogDetailScrollFrame:IsShown() then
|
|
QuestLogDetailScrollFrame:Hide()
|
|
QuestLogDetailScrollFrame.hidden = true
|
|
else
|
|
QuestLogDetailScrollFrame:Show()
|
|
QuestLogDetailScrollFrame.hidden = nil
|
|
end
|
|
end)
|
|
|
|
QuestLogDetailScrollFrame:HookScript("OnHide", function()
|
|
SkinArrowButton(QuestLogFrameExpandButton, "RIGHT", 21)
|
|
QuestLogDetailScrollFrame:Hide()
|
|
QuestLogFrame:SetWidth(340)
|
|
end)
|
|
|
|
QuestLogDetailScrollFrame:HookScript("OnShow", function()
|
|
SkinArrowButton(QuestLogFrameExpandButton, "LEFT", 21)
|
|
QuestLogDetailScrollFrame:Show()
|
|
QuestLogFrame:SetWidth(676)
|
|
QuestLog_UpdateQuestDetails()
|
|
end)
|
|
|
|
StripTextures(EmptyQuestLogFrame)
|
|
EmptyQuestLogFrame:SetScript("OnShow", function()
|
|
-- trigger hide events
|
|
if QuestLogDetailScrollFrame:IsShown() then
|
|
QuestLogDetailScrollFrame:Hide()
|
|
else
|
|
QuestLogDetailScrollFrame:GetScript("OnHide")()
|
|
end
|
|
QuestLogFrameExpandButton:Disable()
|
|
end)
|
|
|
|
EmptyQuestLogFrame:SetScript("OnHide", function()
|
|
QuestLogFrameExpandButton:Enable()
|
|
end)
|
|
end
|
|
|
|
do -- left pane
|
|
StripTextures(QuestLogListScrollFrame)
|
|
SkinScrollbar(QuestLogListScrollFrameScrollBar)
|
|
StripTextures(QuestLogExpandButtonFrame) -- ?
|
|
StripTextures(QuestLogCollapseAllButton)
|
|
SkinCollapseButton(QuestLogCollapseAllButton, true)
|
|
|
|
-- collapse buttons
|
|
QuestLogCollapseAllButton:ClearAllPoints()
|
|
QuestLogCollapseAllButton:SetPoint("BOTTOMLEFT", QuestLogTitle1, "TOPLEFT", -6, 4)
|
|
for i = 1, QUESTS_DISPLAYED do SkinCollapseButton(_G["QuestLogTitle"..i]) end
|
|
|
|
-- quest list backdrop
|
|
local backdrop = CreateFrame("Frame", nil, QuestLogFrame)
|
|
CreateBackdrop(backdrop, nil, nil, .75)
|
|
backdrop.backdrop:SetPoint("TOPLEFT", QuestLogListScrollFrame, "TOPLEFT", -5, 5)
|
|
backdrop.backdrop:SetPoint("BOTTOMRIGHT", QuestLogListScrollFrame, "BOTTOMRIGHT", 26, -5)
|
|
|
|
QuestLogTitle1:ClearAllPoints()
|
|
QuestLogTitle1:SetPoint("TOPLEFT", QuestLogListScrollFrame, "TOPLEFT", 0, 0)
|
|
|
|
-- add additional scroll entries
|
|
for i = 7, QUESTS_DISPLAYED do
|
|
local b = _G["QuestLogTitle"..i] or CreateFrame("Button", "QuestLogTitle"..i, QuestLogFrame, "QuestLogTitleButtonTemplate")
|
|
b:SetID(i)
|
|
b:SetPoint("TOPLEFT", _G["QuestLogTitle"..(i-1)], "BOTTOMLEFT", 0, 1)
|
|
SkinCollapseButton(_G["QuestLogTitle"..i])
|
|
end
|
|
|
|
QuestLogListScrollFrame:SetPoint("TOPLEFT", 10, -54)
|
|
QuestLogListScrollFrame:SetHeight(350)
|
|
|
|
hooksecurefunc("QuestLog_Update", function()
|
|
local numEntries = GetNumQuestLogEntries()
|
|
local questIndex, text, level, questTag, isHeader
|
|
|
|
if QuestLogDetailScrollFrame.hidden then
|
|
QuestLogDetailScrollFrame:Hide()
|
|
end
|
|
|
|
for i=1, QUESTS_DISPLAYED do
|
|
-- update tracked quest marks
|
|
_G["QuestLogTitle"..i.."Check"]:ClearAllPoints()
|
|
_G["QuestLogTitle"..i.."Check"]:SetPoint("RIGHT", _G["QuestLogTitle"..i], "LEFT", 24, 0)
|
|
|
|
-- update quest level
|
|
if C.questlog.showQuestLevels == "1" then
|
|
questIndex = i + FauxScrollFrame_GetOffset(QuestLogListScrollFrame)
|
|
if questIndex <= numEntries then
|
|
text, level, questTag, isHeader = GetQuestLogTitle(questIndex)
|
|
if not isHeader then
|
|
_G["QuestLogTitle"..i]:SetText(" ".."["..(questTag and level.."+" or level).."] "..text)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end)
|
|
end
|
|
|
|
do -- right pane
|
|
StripTextures(QuestLogDetailScrollFrame)
|
|
SkinScrollbar(QuestLogDetailScrollFrameScrollBar)
|
|
|
|
|
|
|
|
QuestLogDetailScrollFrame:ClearAllPoints()
|
|
QuestLogDetailScrollFrame:SetPoint("TOPLEFT", QuestLogListScrollFrame, "TOPRIGHT", 35, 0)
|
|
QuestLogDetailScrollFrame:SetHeight(376)
|
|
QuestLogDetailScrollChildFrame:SetHeight(376)
|
|
|
|
local bg = QuestLogDetailScrollFrame:CreateTexture(nil, "BACKGROUND")
|
|
bg:SetAllPoints()
|
|
bg:SetTexCoord(.1,1,0,1)
|
|
bg:SetTexture("Interface\\Stationery\\StationeryTest1")
|
|
|
|
-- quest log backdrop
|
|
CreateBackdrop(QuestLogDetailScrollFrame, nil, nil, .75)
|
|
QuestLogDetailScrollFrame.backdrop:SetPoint("TOPLEFT", -5, 5)
|
|
QuestLogDetailScrollFrame.backdrop:SetPoint("BOTTOMRIGHT", 26, -5)
|
|
|
|
-- skin item buttons
|
|
for i = 1, MAX_NUM_ITEMS do
|
|
local name = "QuestLogItem" .. i
|
|
local item = _G[name]
|
|
local icon = _G[name.."IconTexture"]
|
|
local count = _G[name.."Count"]
|
|
local title = _G[name.."Name"]
|
|
|
|
local xsize = item:GetWidth() -12
|
|
local ysize = item:GetHeight() -12
|
|
|
|
item:SetWidth(xsize)
|
|
StripTextures(item)
|
|
CreateBackdrop(item, nil, nil, .75)
|
|
SetAllPointsOffset(item.backdrop, item, 4)
|
|
SetHighlight(item)
|
|
|
|
icon:SetSize(ysize, ysize)
|
|
icon:ClearAllPoints()
|
|
icon:SetPoint("LEFT", 6, 0)
|
|
icon:SetTexCoord(.08, .92, .08, .92)
|
|
icon:SetParent(item.backdrop)
|
|
icon:SetDrawLayer("OVERLAY")
|
|
|
|
count:SetParent(item.backdrop)
|
|
count:SetDrawLayer("OVERLAY")
|
|
|
|
title:SetParent(item.backdrop)
|
|
title:SetDrawLayer("OVERLAY")
|
|
end
|
|
end
|
|
end)
|