mirror of
https://github.com/brues-code/pfUI.git
synced 2026-11-02 17:06:57 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ebb4b056c3 | ||
|
|
b17f5bcd3d | ||
|
|
e60f9eb410 | ||
|
|
66171d5354 | ||
|
|
8b239a5532 | ||
|
|
b6d570df97 | ||
|
|
698dedcb7a | ||
|
|
e609809fff | ||
|
|
3651341697 | ||
|
|
77be27094a | ||
|
|
3e50a0b34f |
+10
-1
@@ -460,6 +460,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", "raid", "raidlayout", "8x5")
|
||||
pfUI:UpdateConfig("unitframes", "raid", "raidpadding", "3")
|
||||
pfUI:UpdateConfig("unitframes", "raid", "raidfill", "VERTICAL")
|
||||
pfUI:UpdateConfig("unitframes", "raid", "raidgrowleft", "0")
|
||||
pfUI:UpdateConfig("unitframes", "raid", "collapse", "0")
|
||||
pfUI:UpdateConfig("unitframes", "raid", "raidgrouplabel", "0")
|
||||
pfUI:UpdateConfig("unitframes", "raid", "grouplabelxoff", "0")
|
||||
@@ -550,6 +551,8 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", unit, "bufflimit", "32")
|
||||
pfUI:UpdateConfig("unitframes", unit, "buffperrow", "8")
|
||||
pfUI:UpdateConfig("unitframes", unit, "ownbuffsize", "-1")
|
||||
pfUI:UpdateConfig("unitframes", unit, "buffoffx", "0")
|
||||
pfUI:UpdateConfig("unitframes", unit, "buffoffy", "0")
|
||||
pfUI:UpdateConfig("unitframes", unit, "buffspacingx", "1")
|
||||
pfUI:UpdateConfig("unitframes", unit, "buffspacingy", "1")
|
||||
pfUI:UpdateConfig("unitframes", unit, "debuffs", "TOPLEFT")
|
||||
@@ -557,6 +560,8 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", unit, "debufflimit", "32")
|
||||
pfUI:UpdateConfig("unitframes", unit, "debuffperrow", "8")
|
||||
pfUI:UpdateConfig("unitframes", unit, "owndebuffsize", "-1")
|
||||
pfUI:UpdateConfig("unitframes", unit, "debuffoffx", "0")
|
||||
pfUI:UpdateConfig("unitframes", unit, "debuffoffy", "0")
|
||||
pfUI:UpdateConfig("unitframes", unit, "debuffspacingx", "1")
|
||||
pfUI:UpdateConfig("unitframes", unit, "debuffspacingy", "1")
|
||||
pfUI:UpdateConfig("unitframes", unit, "invert_healthbar", "0")
|
||||
@@ -1453,6 +1458,10 @@ function pfUI:MigrateConfig()
|
||||
cooldown.blizzard.text = cooldown.foreign.text
|
||||
end
|
||||
|
||||
-- pfUI drew its own numbers before; the native countdown shows them
|
||||
-- only with this cvar on, which only the first-run setup sets
|
||||
SetCVar("countdownForCooldowns", "1")
|
||||
|
||||
pfUI_config.appearance.cd = nil
|
||||
end
|
||||
|
||||
@@ -1520,4 +1529,4 @@ function pfUI:MigrateConfig()
|
||||
else
|
||||
pfUI_config.version = pfUI.version.string
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
+65
-22
@@ -19,11 +19,11 @@ local auraCorners = {
|
||||
}
|
||||
|
||||
-- Flows the shown icons of an aura block outward from the frame edge, starting
|
||||
-- `offset` away from it (its own row gap when nil): `perrow` icons per row,
|
||||
-- each row as tall as its largest icon. The first `icons.own` icons are the
|
||||
-- player's (C_UnitAuras lists them first) and use `icons.ownsize`. Returns the
|
||||
-- offset just past the block's last row, where a block sharing the same corner
|
||||
-- continues.
|
||||
-- `offset` away from it (its own row gap when nil) and shifted on screen by
|
||||
-- `offx`/`offy`: `perrow` icons per row, each row as tall as its largest icon.
|
||||
-- The first `icons.own` icons are the player's (C_UnitAuras lists them first)
|
||||
-- and use `icons.ownsize`. Returns the offset just past the block's last
|
||||
-- shifted row, where a block sharing the same corner continues.
|
||||
local function LayoutAuraBlock(unit, icons, offset)
|
||||
local corner = auraCorners[icons.pos]
|
||||
local anchor = unit.config.portraitheight ~= "-1" and unit.hp or unit
|
||||
@@ -42,7 +42,7 @@ local function LayoutAuraBlock(unit, icons, offset)
|
||||
local size = i <= icons.own and icons.ownsize or icons.size
|
||||
icons[i]:SetSize(size, size)
|
||||
icons[i]:ClearAllPoints()
|
||||
icons[i]:SetPoint(corner[1], anchor, icons.pos, corner[2] * x, corner[3] * offset)
|
||||
icons[i]:SetPoint(corner[1], anchor, icons.pos, icons.offx + corner[2] * x, icons.offy + corner[3] * offset)
|
||||
|
||||
x = x + size + icons.gapx
|
||||
if size > rowsize then rowsize = size end
|
||||
@@ -50,7 +50,7 @@ local function LayoutAuraBlock(unit, icons, offset)
|
||||
i = i + 1
|
||||
end
|
||||
|
||||
if col > 0 then offset = offset + rowsize + icons.gapy end
|
||||
if col > 0 then offset = offset + rowsize + icons.gapy + corner[3] * icons.offy end
|
||||
return offset
|
||||
end
|
||||
|
||||
@@ -248,6 +248,43 @@ local VISIBILITY_EVENTS = {
|
||||
UNIT_TARGET = true, -- a link of a chained frame's unit retargeted
|
||||
}
|
||||
|
||||
-- The events a frame hears hidden or not: the visibility events that concern
|
||||
-- the unit it was created for (raid.lua remaps a raid frame's label, so this is
|
||||
-- decided once, at creation), and the logout guard. UNIT_TARGET belongs to
|
||||
-- RegisterChainEvents, and focus.lua drives the focus frames itself.
|
||||
local function GetIdleEvents(label, fname)
|
||||
local events = { PLAYER_ENTERING_WORLD = true, PLAYER_LOGOUT = true }
|
||||
if label:find("^party") or label:find("^raid")
|
||||
or fname == "Group0" or fname == "PartyPet0" or fname == "Party0Target" then
|
||||
events.PARTY_MEMBERS_CHANGED = true
|
||||
events.RAID_ROSTER_UPDATE = true
|
||||
end
|
||||
if label:find("^target") then events.PLAYER_TARGET_CHANGED = true end
|
||||
if label:find("pet") then events.UNIT_PET = true end
|
||||
return events
|
||||
end
|
||||
|
||||
-- The events that only redraw what a frame shows. A hidden frame drops them,
|
||||
-- and OnShow's full refresh catches up on whatever it missed.
|
||||
local SHOWN_EVENTS = {
|
||||
"PLAYER_AURAS_CHANGED", -- label=player && frame=buff
|
||||
"PLAYER_EQUIPMENT_CHANGED", -- label=player && frame=buff (ClassicAPI: weapon-enchant buffs)
|
||||
"PARTY_MEMBERS_CHANGED", -- frame=leaderIcon
|
||||
"PARTY_LEADER_CHANGED", -- frame=leaderIcon
|
||||
"RAID_ROSTER_UPDATE", -- frame=raidIcon
|
||||
"PLAYER_UPDATE_RESTING", -- frame=restIcon
|
||||
"PARTY_LOOT_METHOD_CHANGED", -- frame=lootIcon
|
||||
"RAID_TARGET_UPDATE", -- frame=raidIcon
|
||||
}
|
||||
|
||||
local function RegisterShownEvents(frame)
|
||||
for i = 1, table.getn(SHOWN_EVENTS) do
|
||||
frame:RegisterEvent(SHOWN_EVENTS[i])
|
||||
end
|
||||
-- label=pet; the player's own pet only, not every pet in view
|
||||
frame:RegisterUnitEvent("UNIT_HAPPINESS", "pet")
|
||||
end
|
||||
|
||||
-- ============================================================================
|
||||
-- GetUnitStats - health + power for a unit token.
|
||||
-- Returns: hp, maxHp, power, maxPower, powerType
|
||||
@@ -877,6 +914,8 @@ function pfUI.uf:UpdateConfig()
|
||||
f.buffs.size = tonumber(f.config.buffsize)
|
||||
f.buffs.ownsize = f.config.ownbuffsize == "-1" and f.buffs.size or tonumber(f.config.ownbuffsize)
|
||||
f.buffs.perrow = tonumber(f.config.buffperrow)
|
||||
f.buffs.offx = tonumber(f.config.buffoffx)
|
||||
f.buffs.offy = tonumber(f.config.buffoffy)
|
||||
f.buffs.gapx = aura_border + tonumber(f.config.buffspacingx)
|
||||
f.buffs.gapy = aura_border + tonumber(f.config.buffspacingy)
|
||||
f.buffs.own = 0
|
||||
@@ -927,6 +966,8 @@ function pfUI.uf:UpdateConfig()
|
||||
f.debuffs.size = tonumber(f.config.debuffsize)
|
||||
f.debuffs.ownsize = f.config.owndebuffsize == "-1" and f.debuffs.size or tonumber(f.config.owndebuffsize)
|
||||
f.debuffs.perrow = tonumber(f.config.debuffperrow)
|
||||
f.debuffs.offx = tonumber(f.config.debuffoffx)
|
||||
f.debuffs.offy = tonumber(f.config.debuffoffy)
|
||||
f.debuffs.gapx = aura_border + tonumber(f.config.debuffspacingx)
|
||||
f.debuffs.gapy = aura_border + tonumber(f.config.debuffspacingy)
|
||||
f.debuffs.own = 0
|
||||
@@ -980,8 +1021,17 @@ function pfUI.uf:UpdateConfig()
|
||||
end
|
||||
|
||||
function pfUI.uf.OnShow()
|
||||
pfUI.uf:RefreshUnit(this, "portrait")
|
||||
pfUI.uf:RefreshUnit(this, "base")
|
||||
RegisterShownEvents(this)
|
||||
pfUI.uf:RefreshUnit(this, "all")
|
||||
end
|
||||
|
||||
function pfUI.uf.OnHide()
|
||||
for i = 1, table.getn(SHOWN_EVENTS) do
|
||||
if not this.idleevents[SHOWN_EVENTS[i]] then
|
||||
this:UnregisterEvent(SHOWN_EVENTS[i])
|
||||
end
|
||||
end
|
||||
this:UnregisterEvent("UNIT_HAPPINESS")
|
||||
end
|
||||
|
||||
function pfUI.uf.OnEvent()
|
||||
@@ -1403,19 +1453,10 @@ end
|
||||
function pfUI.uf:EnableEvents()
|
||||
local f = self
|
||||
|
||||
f:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||
f:RegisterEvent("PLAYER_LOGOUT")
|
||||
f:RegisterEvent("PLAYER_AURAS_CHANGED") -- label=player && frame=buff
|
||||
f:RegisterEvent("PLAYER_EQUIPMENT_CHANGED") -- label=player && frame=buff (ClassicAPI: weapon-enchant buffs)
|
||||
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")
|
||||
for event in pairs(f.idleevents) do
|
||||
f:RegisterEvent(event)
|
||||
end
|
||||
if f:IsShown() then RegisterShownEvents(f) end
|
||||
|
||||
f:RegisterForClicks('LeftButtonUp', 'RightButtonUp',
|
||||
'MiddleButtonUp', 'Button4Up', 'Button5Up')
|
||||
@@ -1481,6 +1522,7 @@ function pfUI.uf:EnableScripts()
|
||||
end
|
||||
|
||||
f:SetScript("OnShow", pfUI.uf.OnShow)
|
||||
f:SetScript("OnHide", pfUI.uf.OnHide)
|
||||
f:SetScript("OnEvent", pfUI.uf.OnEvent)
|
||||
f:SetScript("OnUpdate", pfUI.uf.OnUpdate)
|
||||
|
||||
@@ -1528,6 +1570,7 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick)
|
||||
f.id = id
|
||||
f.config = config or pfUI_config.unitframes.fallback
|
||||
f.tick = tick
|
||||
f.idleevents = GetIdleEvents(f.label, fname)
|
||||
|
||||
CreateBackdropShadow(f)
|
||||
|
||||
|
||||
Vendored
+1
-2
@@ -359,6 +359,7 @@ pfUI_translation["deDE"] = {
|
||||
["Group Options"] = nil,
|
||||
["Group-Pet"] = nil,
|
||||
["Group-Target"] = nil,
|
||||
["Grow Right To Left"] = nil,
|
||||
["Gryphon"] = nil,
|
||||
["Gryphons"] = nil,
|
||||
["Guild Online"] = nil,
|
||||
@@ -908,8 +909,6 @@ pfUI_translation["deDE"] = {
|
||||
["Panel Alignment"] = "Panel Ausrichtung",
|
||||
["Nameplate Update Rate"] = "Namensplaketten Aktualisierungsrate",
|
||||
["Target/Casting Plates"] = "Ziel/Cast Plaketten",
|
||||
["Normal Plates"] = "Normale Plaketten",
|
||||
["Mass Pulls (20+ Plates)"] = "Große Pulls (20+ Plaketten)",
|
||||
["Tooltip Update Rate"] = "Tooltip Aktualisierungsrate",
|
||||
["Cursor Follow"] = "Cursor Folgen",
|
||||
["Health/Status Bar"] = "Leben/Status Leiste",
|
||||
|
||||
Vendored
+5
-2
@@ -90,6 +90,8 @@ pfUI_translation["enUS"] = {
|
||||
["Buffs"] = nil,
|
||||
["Buff Size"] = nil,
|
||||
["Buff Spacing"] = nil,
|
||||
["Buff X-Offset"] = nil,
|
||||
["Buff Y-Offset"] = nil,
|
||||
["Buff X-Spacing"] = nil,
|
||||
["Buff Y-Spacing"] = nil,
|
||||
["Buffs Per Row"] = nil,
|
||||
@@ -196,6 +198,8 @@ pfUI_translation["enUS"] = {
|
||||
["Debuff Position"] = nil,
|
||||
["Debuffs"] = nil,
|
||||
["Debuff Size"] = nil,
|
||||
["Debuff X-Offset"] = nil,
|
||||
["Debuff Y-Offset"] = nil,
|
||||
["Debuff X-Spacing"] = nil,
|
||||
["Debuff Y-Spacing"] = nil,
|
||||
["Debuffs Per Row"] = nil,
|
||||
@@ -369,6 +373,7 @@ pfUI_translation["enUS"] = {
|
||||
["Group Options"] = nil,
|
||||
["Group-Pet"] = nil,
|
||||
["Group-Target"] = nil,
|
||||
["Grow Right To Left"] = nil,
|
||||
["Gryphon"] = nil,
|
||||
["Gryphons"] = nil,
|
||||
["Guild Online"] = nil,
|
||||
@@ -936,8 +941,6 @@ pfUI_translation["enUS"] = {
|
||||
["Panel Alignment"] = nil,
|
||||
["Nameplate Update Rate"] = nil,
|
||||
["Target/Casting Plates"] = nil,
|
||||
["Normal Plates"] = nil,
|
||||
["Mass Pulls (20+ Plates)"] = nil,
|
||||
["Tooltip Update Rate"] = nil,
|
||||
["Cursor Follow"] = nil,
|
||||
["Health/Status Bar"] = nil,
|
||||
|
||||
Vendored
+1
@@ -359,6 +359,7 @@ pfUI_translation["esES"] = {
|
||||
["Group Options"] = "Opciones de grupo",
|
||||
["Group-Pet"] = "Mascota-Grupo",
|
||||
["Group-Target"] = "Objetivo-Grupo",
|
||||
["Grow Right To Left"] = nil,
|
||||
["Gryphon"] = nil,
|
||||
["Gryphons"] = nil,
|
||||
["Guild Online"] = "Conectados en hermandad",
|
||||
|
||||
Vendored
+1
@@ -359,6 +359,7 @@ pfUI_translation["frFR"] = {
|
||||
["Group Options"] = "Options de groupe",
|
||||
["Group-Pet"] = "Groupe des familiers",
|
||||
["Group-Target"] = "Groupe des cibles",
|
||||
["Grow Right To Left"] = nil,
|
||||
["Gryphon"] = nil,
|
||||
["Gryphons"] = nil,
|
||||
["Guild Online"] = "Membres de guilde connectés",
|
||||
|
||||
Vendored
+1
@@ -359,6 +359,7 @@ pfUI_translation["koKR"] = {
|
||||
["Group Options"] = nil,
|
||||
["Group-Pet"] = "파티-팻",
|
||||
["Group-Target"] = "파티-타켓",
|
||||
["Grow Right To Left"] = nil,
|
||||
["Gryphon"] = nil,
|
||||
["Gryphons"] = nil,
|
||||
["Guild Online"] = "접속중인 길드원",
|
||||
|
||||
Vendored
+1
@@ -359,6 +359,7 @@ pfUI_translation["ruRU"] = {
|
||||
["Group Options"] = "Настройки группы",
|
||||
["Group-Pet"] = "Группа-питомец",
|
||||
["Group-Target"] = "Группа-цель",
|
||||
["Grow Right To Left"] = nil,
|
||||
["Gryphon"] = nil,
|
||||
["Gryphons"] = nil,
|
||||
["Guild Online"] = "Члены гильдии в сети",
|
||||
|
||||
Vendored
+1
@@ -359,6 +359,7 @@ pfUI_translation["zhCN"] = {
|
||||
["Group Options"] = "队伍选项",
|
||||
["Group-Pet"] = "小队宠物",
|
||||
["Group-Target"] = "小队目标",
|
||||
["Grow Right To Left"] = nil,
|
||||
["Gryphon"] = "狮鹫",
|
||||
["Gryphons"] = "狮鹫(多个)",
|
||||
["Guild Online"] = "公会在线",
|
||||
|
||||
Vendored
+1
@@ -359,6 +359,7 @@ pfUI_translation["zhTW"] = {
|
||||
["Group Options"] = nil,
|
||||
["Group-Pet"] = "小隊寵物",
|
||||
["Group-Target"] = "小隊目標",
|
||||
["Grow Right To Left"] = nil,
|
||||
["Gryphon"] = nil,
|
||||
["Gryphons"] = nil,
|
||||
["Guild Online"] = "公會線上",
|
||||
|
||||
+54
-86
@@ -25,7 +25,7 @@ setfenv(1, pfUI:GetEnvironment())
|
||||
-- return instantly when another libpredict is already active
|
||||
if pfUI.api.libpredict then return end
|
||||
|
||||
local heals, events, hots = {}, {}, {}
|
||||
local heals, hots = {}, {}
|
||||
local spell_queue = { "DUMMY", "DUMMYRank 9", "TARGET" }
|
||||
local player = UnitName("player")
|
||||
local cache, gear_string = {}, ""
|
||||
@@ -134,19 +134,6 @@ local function OnOwnCastStart(spellId, castGUID)
|
||||
local amount = cache[spell_queue[2]][1]
|
||||
local casttime = castTime
|
||||
|
||||
if spellName == REGROWTH then
|
||||
local fullSpell = spell_queue[2]
|
||||
local _, _, rankStr = fullSpell and string.find(fullSpell, "Rank (%d+)")
|
||||
local rankNum = rankStr and tonumber(rankStr) or nil
|
||||
if libpredict.sender.regrowth_timer then
|
||||
libpredict.sender.regrowth_target_next = target
|
||||
libpredict.sender.regrowth_rank_next = rankNum
|
||||
else
|
||||
libpredict.sender.regrowth_target = target
|
||||
libpredict.sender.regrowth_rank = rankNum
|
||||
end
|
||||
end
|
||||
|
||||
if spellName == PRAYER_OF_HEALING then
|
||||
-- target is already correctly set from spell_queue[3]:
|
||||
-- selfcast (ALT) = player, otherwise = current target
|
||||
@@ -207,34 +194,35 @@ local function OnOwnCastSucceeded(spellId, castGUID)
|
||||
|
||||
libpredict:HealStop(player)
|
||||
local spellName = C_Spell.GetSpellName(spellId)
|
||||
if spellName == REGROWTH then
|
||||
local now = pfUI.uf.now or GetTime()
|
||||
if libpredict.sender.regrowth_timer then
|
||||
libpredict.sender.regrowth_start_next = now
|
||||
else
|
||||
libpredict.sender.regrowth_start = now
|
||||
end
|
||||
libpredict.sender.regrowth_timer = now + 0.1
|
||||
end
|
||||
libpredict.sender.castGUID = nil
|
||||
libpredict.sender.current_cast = nil
|
||||
libpredict.sender.current_cast_target = nil
|
||||
|
||||
if not target then return end
|
||||
|
||||
-- Instant HoTs — classify by name (rank-independent) instead of a
|
||||
-- hardcoded per-rank ID table.
|
||||
-- HoTs — classify by name (rank-independent) instead of a hardcoded
|
||||
-- per-rank ID table.
|
||||
local hotType
|
||||
if spellName == REJUVENATION then hotType = "Reju"
|
||||
elseif spellName == RENEW then hotType = "Renew"
|
||||
elseif spellName == REGROWTH then hotType = "Regr"
|
||||
end
|
||||
if hotType then
|
||||
local duration = hotType == "Reju" and rejuvDuration or renewDuration
|
||||
local rank = 0
|
||||
local rankSub = C_Spell.GetSpellSubtext(spellId)
|
||||
if rankSub and rankSub ~= "" then
|
||||
rank = tonumber((string.gsub(rankSub, "Rank ", ""))) or 0
|
||||
end
|
||||
if hotType == "Regr" then
|
||||
-- Regrowth's HoT follows its direct heal a moment later
|
||||
local start = GetTime()
|
||||
C_Timer.After(0.1, function()
|
||||
libpredict:Hot(player, target, hotType, 20, start, "UNIT_SPELLCAST_SUCCEEDED", rank)
|
||||
libpredict.sender:SendHealCommMsg(hotType .. "/" .. target .. "/20/" .. rank .. "/")
|
||||
end)
|
||||
return
|
||||
end
|
||||
local duration = hotType == "Reju" and rejuvDuration or renewDuration
|
||||
libpredict:Hot(player, target, hotType, duration, nil, "UNIT_SPELLCAST_SUCCEEDED", rank)
|
||||
libpredict.sender:SendHealCommMsg(hotType .. "/" .. target .. "/" .. duration .. "/" .. rank .. "/")
|
||||
end
|
||||
@@ -326,20 +314,11 @@ local function RefreshResFrames(guid)
|
||||
end
|
||||
end
|
||||
|
||||
libpredict:SetScript("OnUpdate", function()
|
||||
-- throttle cleanup - no need to check every frame
|
||||
local now = pfUI.uf.now or GetTime()
|
||||
if (this.tick or 0) > now then return end
|
||||
this.tick = now + pfUI.throttle:Get("libpredict") -- Default: Normal (10 FPS)
|
||||
|
||||
-- update on timeout events
|
||||
for timestamp, targets in pairs(events) do
|
||||
if now >= timestamp then
|
||||
events[timestamp] = nil
|
||||
end
|
||||
end
|
||||
|
||||
-- drop resurrection offers the target accepted or let run out
|
||||
-- Drop resurrection offers the target accepted or let run out. Nothing reports
|
||||
-- either, so a ticker checks while any offer is open.
|
||||
local resTicker
|
||||
local function CheckResOffers()
|
||||
local now = GetTime()
|
||||
for guid, expiry in pairs(resOffers) do
|
||||
local unit = UnitTokenFromGUID(guid)
|
||||
if now >= expiry or not (unit and UnitIsDeadOrGhost(unit)) then
|
||||
@@ -347,7 +326,11 @@ libpredict:SetScript("OnUpdate", function()
|
||||
RefreshResFrames(guid)
|
||||
end
|
||||
end
|
||||
end)
|
||||
if not next(resOffers) then
|
||||
resTicker:Cancel()
|
||||
resTicker = nil
|
||||
end
|
||||
end
|
||||
|
||||
function libpredict:ParseComm(sender, msg)
|
||||
local msgtype, target, heal, time, rank
|
||||
@@ -496,11 +479,6 @@ function libpredict:ParseChatMessage(sender, msg)
|
||||
end
|
||||
end
|
||||
|
||||
function libpredict:AddEvent(time, target)
|
||||
events[time] = events[time] or {}
|
||||
table.insert(events[time], target)
|
||||
end
|
||||
|
||||
function libpredict:Heal(sender, target, amount, duration, senderGuid)
|
||||
if not sender or not target or not amount or not duration then
|
||||
return
|
||||
@@ -511,7 +489,6 @@ function libpredict:Heal(sender, target, amount, duration, senderGuid)
|
||||
heals[target] = heals[target] or {}
|
||||
heals[target][sender] = { amount, timeout }
|
||||
if senderGuid then healGuidToName[senderGuid] = sender end
|
||||
libpredict:AddEvent(timeout, target)
|
||||
end
|
||||
|
||||
-- Debug flag
|
||||
@@ -596,7 +573,6 @@ function libpredict:HealDelay(sender, delay)
|
||||
for tsender, amount in pairs(heals[target]) do
|
||||
if sender == tsender then
|
||||
amount[2] = amount[2] + delay
|
||||
libpredict:AddEvent(amount[2], target)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -932,39 +908,33 @@ libpredict.sender.SendResCommMsg = function(self, msg)
|
||||
-- BG groups are handled by RAID channel
|
||||
end
|
||||
|
||||
libpredict.sender:SetScript("OnUpdate", function()
|
||||
-- trigger delayed regrowth timers
|
||||
local now = pfUI.uf.now or GetTime()
|
||||
if this.regrowth_timer and now > this.regrowth_timer then
|
||||
local target = this.regrowth_target or player
|
||||
local duration = 20
|
||||
local startTime = this.regrowth_start
|
||||
local rank = this.regrowth_rank
|
||||
|
||||
libpredict:Hot(player, target, "Regr", duration, startTime, "OnUpdate", rank)
|
||||
local rankStr = rank and tostring(rank) or "0"
|
||||
libpredict.sender:SendHealCommMsg("Regr/"..target.."/"..duration.."/"..rankStr.."/")
|
||||
|
||||
-- Apply next queued Regrowth if available
|
||||
this.regrowth_target = this.regrowth_target_next
|
||||
this.regrowth_start = this.regrowth_start_next
|
||||
this.regrowth_rank = this.regrowth_rank_next
|
||||
this.regrowth_target_next = nil
|
||||
this.regrowth_start_next = nil
|
||||
this.regrowth_rank_next = nil
|
||||
this.regrowth_timer = nil
|
||||
-- Own casts arrive as "player". Other casters only matter as group members
|
||||
-- (the only names resolveNameFromGuid knows), so their events are filtered to
|
||||
-- the group's tokens, and solo nobody else's casts arrive at all. A member in
|
||||
-- a raid also fires as raidN for its own casts; the handler drops those by
|
||||
-- UnitIsUnit, and other repeats by castGUID.
|
||||
local GROUP_CAST_EVENTS = {
|
||||
"UNIT_SPELLCAST_START", "UNIT_SPELLCAST_SUCCEEDED", "UNIT_SPELLCAST_INTERRUPTED",
|
||||
}
|
||||
local castunits = {}
|
||||
local function RegisterCastEvents()
|
||||
local n, token = 0, IsInRaid() and "raid" or "party"
|
||||
castunits[1] = "player"
|
||||
for i = 1, IsInRaid() and GetNumRaidMembers() or GetNumPartyMembers() do
|
||||
castunits[i + 1] = token .. i
|
||||
n = i
|
||||
end
|
||||
end)
|
||||
|
||||
-- Own casts arrive as "player"; every other caster fires once per unit token
|
||||
-- it currently holds (raidN, target, nameplateN, ...), so other-unit handlers
|
||||
-- drop the repeats by castGUID.
|
||||
libpredict.sender:RegisterEvent("UNIT_SPELLCAST_SENT")
|
||||
libpredict.sender:RegisterEvent("UNIT_SPELLCAST_START")
|
||||
libpredict.sender:RegisterEvent("UNIT_SPELLCAST_DELAYED")
|
||||
libpredict.sender:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
|
||||
libpredict.sender:RegisterEvent("UNIT_SPELLCAST_FAILED")
|
||||
libpredict.sender:RegisterEvent("UNIT_SPELLCAST_INTERRUPTED")
|
||||
for i = table.getn(castunits), n + 2, -1 do castunits[i] = nil end
|
||||
for i = 1, table.getn(GROUP_CAST_EVENTS) do
|
||||
libpredict.sender:RegisterUnitEvent(GROUP_CAST_EVENTS[i], unpack(castunits))
|
||||
end
|
||||
end
|
||||
RegisterCastEvents()
|
||||
libpredict.sender:RegisterUnitEvent("UNIT_SPELLCAST_SENT", "player")
|
||||
libpredict.sender:RegisterUnitEvent("UNIT_SPELLCAST_DELAYED", "player")
|
||||
libpredict.sender:RegisterUnitEvent("UNIT_SPELLCAST_FAILED", "player")
|
||||
libpredict.sender:RegisterEvent("PARTY_MEMBERS_CHANGED")
|
||||
libpredict.sender:RegisterEvent("RAID_ROSTER_UPDATE")
|
||||
libpredict.sender:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
|
||||
|
||||
-- Shared cleanup helper for failed/interrupted casts
|
||||
@@ -980,12 +950,6 @@ local function onCastFailed()
|
||||
s:SendResCommMsg("RESNO " .. (target or ""))
|
||||
s.resurrecting = nil
|
||||
end
|
||||
if s.current_cast == REGROWTH then
|
||||
s.regrowth_timer = nil
|
||||
s.regrowth_start = nil
|
||||
s.regrowth_target_next = nil
|
||||
s.regrowth_start_next = nil
|
||||
end
|
||||
s.castGUID = nil
|
||||
s.current_cast = nil
|
||||
s.current_cast_target = nil
|
||||
@@ -1032,6 +996,7 @@ local function OnResurrect()
|
||||
-- arg8=destGUID
|
||||
resOffers[arg8] = GetTime() + RES_OFFER_TIMEOUT
|
||||
RefreshResFrames(arg8)
|
||||
resTicker = resTicker or C_Timer.NewTicker(.1, CheckResOffers)
|
||||
end
|
||||
|
||||
local lastOtherCast = {} -- [event] = castGUID of the last other-unit event handled
|
||||
@@ -1041,6 +1006,9 @@ libpredict.sender:SetScript("OnEvent", function()
|
||||
if arg2 == "SPELL_HEAL" then OnHeal()
|
||||
elseif arg2 == "SPELL_RESURRECT" then OnResurrect() end
|
||||
return
|
||||
elseif event == "PARTY_MEMBERS_CHANGED" or event == "RAID_ROSTER_UPDATE" then
|
||||
RegisterCastEvents()
|
||||
return
|
||||
end
|
||||
|
||||
-- UNIT_SPELLCAST_SENT: arg1=unit, arg2=target token, arg3=castGUID, arg4=spellID
|
||||
|
||||
@@ -31,10 +31,7 @@ libthrottle.presetNames = {
|
||||
|
||||
-- Default throttle categories
|
||||
libthrottle.defaults = {
|
||||
nameplates = "custom",
|
||||
nameplates_target = "custom",
|
||||
nameplates_castbar = "custom",
|
||||
nameplates_mass = "custom",
|
||||
tooltip_cursor = "fastest",
|
||||
chat_tab = "custom",
|
||||
swingtimer = "custom",
|
||||
@@ -158,10 +155,7 @@ libthrottle:SetScript("OnEvent", function()
|
||||
end
|
||||
|
||||
-- Set defaults for custom fields if missing
|
||||
if not _G.pfUI_throttle.nameplates_target_custom then _G.pfUI_throttle.nameplates_target_custom = "50" end
|
||||
if not _G.pfUI_throttle.nameplates_custom then _G.pfUI_throttle.nameplates_custom = "10" end
|
||||
if not _G.pfUI_throttle.nameplates_castbar_custom then _G.pfUI_throttle.nameplates_castbar_custom = "100" end
|
||||
if not _G.pfUI_throttle.nameplates_mass_custom then _G.pfUI_throttle.nameplates_mass_custom = "7" end
|
||||
if not _G.pfUI_throttle.tooltip_cursor_custom then _G.pfUI_throttle.tooltip_cursor_custom = "10" end
|
||||
if not _G.pfUI_throttle.chat_tab_custom then _G.pfUI_throttle.chat_tab_custom = "10" end
|
||||
if not _G.pfUI_throttle.swingtimer_custom then _G.pfUI_throttle.swingtimer_custom = "50" end
|
||||
|
||||
+11
-8
@@ -36,7 +36,7 @@ pfUI:RegisterModule("castbar", function ()
|
||||
cb.bar:SetValue(1)
|
||||
end
|
||||
if cb.bar.spark then cb.bar.spark:Hide() end
|
||||
if cb:GetAlpha() > 0 and not cb.fade:IsPlaying() then cb.fade:Play() end
|
||||
if cb:IsShown() and not cb.fade:IsPlaying() then cb.fade:Play() end
|
||||
end
|
||||
|
||||
-- "Spellname (N)" label for an active tradeskill merge — N is the number
|
||||
@@ -95,7 +95,7 @@ pfUI:RegisterModule("castbar", function ()
|
||||
cb.isTradeskill = isTradeskill
|
||||
cb.delay = (delayMs or 0) / 1000
|
||||
cb.fade:Stop()
|
||||
cb:SetAlpha(1)
|
||||
cb:Show()
|
||||
|
||||
-- Shield an uninterruptible cast. Not on the player's own bar: the flag is
|
||||
-- measured against the reader's own interrupts and silences, so on your own
|
||||
@@ -247,12 +247,16 @@ pfUI:RegisterModule("castbar", function ()
|
||||
cb.bar.spark:SetPoint("BOTTOM", cb.bar, "BOTTOMLEFT", 0, 0)
|
||||
cb.bar.spark:Hide()
|
||||
|
||||
-- Fade-out after a cast ends. The bar stays at alpha 0 while idle.
|
||||
-- Fade-out after a cast ends. The bar is hidden while idle, so its OnUpdate
|
||||
-- only runs during a cast; unlock mode keeps it shown for dragging.
|
||||
local function unlocked() return cb.drag and cb.drag:IsShown() end
|
||||
cb.fade = cb:CreateAnimationGroup()
|
||||
local fade = cb.fade:CreateAnimation("Alpha")
|
||||
fade:SetChange(-1)
|
||||
fade:SetDuration(.4)
|
||||
cb.fade:SetScript("OnFinished", function() cb:SetAlpha(0) end)
|
||||
cb.fade:SetScript("OnFinished", function()
|
||||
if not unlocked() then cb:Hide() end
|
||||
end)
|
||||
|
||||
-- OnUpdate animates the bar fill. All state transitions (cast start/stop/interrupt, channel start/stop,
|
||||
-- pushback) come from the event handler below — we never poll C_Spell
|
||||
@@ -261,16 +265,15 @@ pfUI:RegisterModule("castbar", function ()
|
||||
if (this.tick or 0) > GetTime() then return end
|
||||
this.tick = GetTime() + 0.020 -- ~50 FPS
|
||||
|
||||
if this.drag and this.drag:IsShown() then
|
||||
if unlocked() then
|
||||
this.fade:Stop()
|
||||
this:SetAlpha(1)
|
||||
return
|
||||
end
|
||||
|
||||
if this.fade:IsPlaying() then return end
|
||||
|
||||
if not this.endTime then
|
||||
if this:GetAlpha() ~= 0 then this:SetAlpha(0) end
|
||||
this:Hide()
|
||||
return
|
||||
end
|
||||
|
||||
@@ -443,7 +446,7 @@ pfUI:RegisterModule("castbar", function ()
|
||||
end
|
||||
end)
|
||||
|
||||
cb:SetAlpha(0)
|
||||
cb:Hide()
|
||||
return cb
|
||||
end
|
||||
|
||||
|
||||
+150
-109
@@ -30,39 +30,6 @@ pfUI:RegisterModule("chat", function ()
|
||||
end
|
||||
end)
|
||||
|
||||
local realm = GetRealmName()
|
||||
local player = UnitName("player")
|
||||
local history
|
||||
local function SaveChatHistory(id, msg, r, g, b)
|
||||
-- create cache tables if not existing
|
||||
pfUI_cache = pfUI_cache or {}
|
||||
pfUI_cache["chathistory"] = pfUI_cache["chathistory"] or {}
|
||||
pfUI_cache["chathistory"][realm] = pfUI_cache["chathistory"][realm] or {}
|
||||
pfUI_cache["chathistory"][realm][player] = pfUI_cache["chathistory"][realm][player] or {}
|
||||
pfUI_cache["chathistory"][realm][player][id] = pfUI_cache["chathistory"][realm][player][id] or {}
|
||||
|
||||
if r and g and b then
|
||||
local color = rgbhex(r*.5+.2, g*.5+.2, b*.5+.2)
|
||||
msg = string.gsub(msg, "^", color)
|
||||
msg = string.gsub(msg, "|r", "|r" .. color)
|
||||
end
|
||||
|
||||
history = pfUI_cache["chathistory"][realm][player][id]
|
||||
table.insert(history, 1, msg)
|
||||
if history[30] then table.remove(history, 30) end
|
||||
end
|
||||
|
||||
local function GetChatHistory(id)
|
||||
-- create cache tables if not existing
|
||||
pfUI_cache = pfUI_cache or {}
|
||||
pfUI_cache["chathistory"] = pfUI_cache["chathistory"] or {}
|
||||
pfUI_cache["chathistory"][realm] = pfUI_cache["chathistory"][realm] or {}
|
||||
pfUI_cache["chathistory"][realm][player] = pfUI_cache["chathistory"][realm][player] or {}
|
||||
pfUI_cache["chathistory"][realm][player][id] = pfUI_cache["chathistory"][realm][player][id] or {}
|
||||
|
||||
return pfUI_cache["chathistory"][realm][player][id]
|
||||
end
|
||||
|
||||
-- [ Chat Panel Colors ]
|
||||
-- The panels normally inherit pfUI's global appearance theme; custom colors let chat
|
||||
-- deviate from it. CreateBackdrop is re-run first to restore the theme, so toggling
|
||||
@@ -456,15 +423,20 @@ pfUI:RegisterModule("chat", function ()
|
||||
|
||||
if pfUI.chat.hideLock then return end
|
||||
|
||||
-- the dock lays the tabs out again only when their bar comes back
|
||||
if pfUI.chat.left:IsMouseOver(10, -10, -10, 10) then
|
||||
pfUI.chat.left.panelTop:Show()
|
||||
FCF_DockUpdate()
|
||||
if not pfUI.chat.left.panelTop:IsShown() then
|
||||
pfUI.chat.left.panelTop:Show()
|
||||
FCF_DockUpdate()
|
||||
end
|
||||
elseif pfUI.chat.right:IsMouseOver(10, -10, -10, 10) then
|
||||
-- disable while dock is active
|
||||
if pfUI.chat.right:GetAlpha() == 0 then return end
|
||||
|
||||
pfUI.chat.right.panelTop:Show()
|
||||
FCF_DockUpdate()
|
||||
if not pfUI.chat.right.panelTop:IsShown() then
|
||||
pfUI.chat.right.panelTop:Show()
|
||||
FCF_DockUpdate()
|
||||
end
|
||||
else
|
||||
pfUI.chat.left.panelTop:Hide()
|
||||
pfUI.chat.right.panelTop:Hide()
|
||||
@@ -587,6 +559,9 @@ pfUI:RegisterModule("chat", function ()
|
||||
end
|
||||
|
||||
for i=1, NUM_CHAT_WINDOWS do
|
||||
-- ChatFrame_OnUpdate only blinks the flash of the bottom button hidden
|
||||
-- below; the lines fade in the engine's own update
|
||||
_G["ChatFrame" .. i]:SetScript("OnUpdate", nil)
|
||||
_G["ChatFrame" .. i .. "UpButton"]:Hide()
|
||||
_G["ChatFrame" .. i .. "UpButton"].Show = function() return end
|
||||
_G["ChatFrame" .. i .. "DownButton"]:Hide()
|
||||
@@ -732,6 +707,62 @@ pfUI:RegisterModule("chat", function ()
|
||||
return pfUI_playerDB[name].level
|
||||
end
|
||||
|
||||
-- the sender of the line AddMessage is reading, from its chat event
|
||||
local lineSender, lineSenderClass, lineSenderRace, lineSenderSex
|
||||
|
||||
-- [ FormatPlayerLink ]
|
||||
-- The gsub callback for a player link: the name in its class colour, with
|
||||
-- the level and icons the settings ask for. Returns the link unchanged when
|
||||
-- there is nothing to add, as a Lua 5.0 callback that returns nil deletes
|
||||
-- the match.
|
||||
local function FormatPlayerLink(link, name, shown)
|
||||
local real = strsplit(":", name)
|
||||
if shown ~= real then return link end
|
||||
|
||||
local color, icon = "", ""
|
||||
if C.chat.text.classcolor == "1" then
|
||||
local _, class, raceKey, sex
|
||||
if lineSenderClass and real == lineSender then
|
||||
class, raceKey, sex = lineSenderClass, lineSenderRace, lineSenderSex
|
||||
else
|
||||
_, class, _, raceKey, sex = C_PlayerCache.GetPlayerInfoByName(real)
|
||||
end
|
||||
if not class then
|
||||
class = GetUnitInfo(real)
|
||||
end
|
||||
if class and class ~= UNKNOWN then
|
||||
color = "|c" .. PFUI_CLASS_COLORS[class].colorStr
|
||||
if C.chat.text.factionicons == "1" then
|
||||
icon = GetFactionIcon(raceKey)
|
||||
end
|
||||
if C.chat.text.raceicons == "1" then
|
||||
icon = icon .. GetRaceIcon(raceKey, sex)
|
||||
end
|
||||
elseif C.chat.text.tintunknown == "1" then
|
||||
color = unknowncolorhex
|
||||
end
|
||||
end
|
||||
|
||||
local suffix = ""
|
||||
local level = C.chat.text.playerlevel == "1" and GetPlayerLevel(real)
|
||||
if level and level > 0 then
|
||||
suffix = " " .. rgbhex(GetDifficultyColor(level)) .. level .. "|r"
|
||||
elseif level then
|
||||
-- Show ?? for unknown levels (e.g. -1 from UnitLevel)
|
||||
suffix = " |cffff0000??|r"
|
||||
end
|
||||
|
||||
if color == "" and suffix == "" then return link end
|
||||
return left .. icon .. color .. "|Hplayer:" .. name .. "|h" .. color .. real .. "|h|r" .. suffix .. right
|
||||
end
|
||||
|
||||
-- the timestamp of the current second
|
||||
local stampTime, stamp
|
||||
|
||||
-- the last chat line read and what it became. A line shown in several
|
||||
-- frames is read once: nothing in the result depends on the frame.
|
||||
local lastLineID, lastText, lastResult
|
||||
|
||||
-- Passes every argument after the text on: GetMessageInfo returns them all,
|
||||
-- and a hook that drops some loses them for every frame after it.
|
||||
local function AddMessage(frame, text, ...)
|
||||
@@ -744,76 +775,40 @@ pfUI:RegisterModule("chat", function ()
|
||||
|
||||
-- payload of the CHAT_MSG event printing this line; nil for lines
|
||||
-- that don't come from one (system text, addon output, history)
|
||||
local event, _, sender, _, _, _, _, _, _, _, _, _, guid = GetCurrentChatEvent()
|
||||
local event, _, sender, _, _, _, _, _, _, _, _, lineID, guid = GetCurrentChatEvent()
|
||||
|
||||
-- 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 emotes all have line 0
|
||||
if lineID and lineID ~= 0 and lineID == lastLineID and text == lastText then
|
||||
return frame:HookAddMessage(lastResult, ...)
|
||||
end
|
||||
local input = text
|
||||
|
||||
-- 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")
|
||||
text = gsub(text, "{CLINK:enchant:(%x+):([%d-]-):([^}]-)}", "|c%1|Henchant:%2|h[%3]|h|r")
|
||||
text = gsub(text, "{CLINK:spell:(%x+):([%d-]-):([^}]-)}", "|c%1|Hspell:%2|h[%3]|h|r")
|
||||
text = gsub(text, "{CLINK:quest:(%x+):([%d-]-):([%d-]-):([^}]-)}", "|c%1|Hquest:%2:%3|h[%4]|h|r")
|
||||
-- Remove prat and chatter CLINKs
|
||||
if text:find("{CLINK:", 1, true) then
|
||||
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:item:(%x+):([%d-]-:[%d-]-:[%d-]-:[%d-]-:[%d-]-:[%d-]-:[%d-]-:[%d-]-):([^}]-)}", "|c%1|Hitem:%2|h[%3]|h|r")
|
||||
text = gsub(text, "{CLINK:enchant:(%x+):([%d-]-):([^}]-)}", "|c%1|Henchant:%2|h[%3]|h|r")
|
||||
text = gsub(text, "{CLINK:spell:(%x+):([%d-]-):([^}]-)}", "|c%1|Hspell:%2|h[%3]|h|r")
|
||||
text = gsub(text, "{CLINK:quest:(%x+):([%d-]-):([%d-]-):([^}]-)}", "|c%1|Hquest:%2:%3|h[%4]|h|r")
|
||||
end
|
||||
|
||||
-- detect urls
|
||||
if C.chat.text.detecturl == "1" then
|
||||
-- detect urls; every pattern needs a dot between name characters or a "://"
|
||||
if C.chat.text.detecturl == "1" and (text:find("[%w_-]%.[%w_-]") or text:find("://", 1, true)) then
|
||||
text = pfUI.chat:HandleLink(text)
|
||||
end
|
||||
|
||||
-- display class colors and player levels if already indexed
|
||||
local classcolor = C.chat.text.classcolor == "1"
|
||||
local playerlevel = C.chat.text.playerlevel == "1"
|
||||
if classcolor or playerlevel then
|
||||
if classcolor or C.chat.text.playerlevel == "1" then
|
||||
-- the engine name-queries a chat sender before the event fires,
|
||||
-- so the sender's GUID always resolves; other names in the text
|
||||
-- fall back to the name-keyed lookups
|
||||
local _, senderClass, senderRace, senderSex
|
||||
lineSender, lineSenderClass, lineSenderRace, lineSenderSex = sender, nil, nil, nil
|
||||
if classcolor and guid and guid ~= "" then
|
||||
_, senderClass, _, senderRace, senderSex = GetPlayerInfoByGUID(guid)
|
||||
end
|
||||
|
||||
for name in gfind(text, "|Hplayer:(.-)|h") do
|
||||
local real, _ = strsplit(":", name)
|
||||
local color, icon = "", ""
|
||||
|
||||
if classcolor then
|
||||
local class, raceKey, sex
|
||||
if senderClass and real == sender then
|
||||
class, raceKey, sex = senderClass, senderRace, senderSex
|
||||
else
|
||||
_, class, _, raceKey, sex = C_PlayerCache.GetPlayerInfoByName(real)
|
||||
end
|
||||
if not class then
|
||||
class = GetUnitInfo(real)
|
||||
end
|
||||
if class and class ~= UNKNOWN then
|
||||
color = "|c" .. PFUI_CLASS_COLORS[class].colorStr
|
||||
if C.chat.text.factionicons == "1" then
|
||||
icon = GetFactionIcon(raceKey)
|
||||
end
|
||||
if C.chat.text.raceicons == "1" then
|
||||
icon = icon .. GetRaceIcon(raceKey, sex)
|
||||
end
|
||||
elseif C.chat.text.tintunknown == "1" then
|
||||
color = unknowncolorhex
|
||||
end
|
||||
end
|
||||
|
||||
local suffix = ""
|
||||
local level = playerlevel and GetPlayerLevel(real)
|
||||
if level and level > 0 then
|
||||
suffix = " " .. rgbhex(GetDifficultyColor(level)) .. level .. "|r"
|
||||
elseif level then
|
||||
-- Show ?? for unknown levels (e.g. -1 from UnitLevel)
|
||||
suffix = " |cffff0000??|r"
|
||||
end
|
||||
|
||||
if color ~= "" or suffix ~= "" then
|
||||
text = string.gsub(text, "|Hplayer:"..name.."|h%["..real.."%]|h(.-:-)",
|
||||
left..icon..color.."|Hplayer:"..name.."|h" .. color .. real .. "|h|r"..suffix..right.."%1")
|
||||
end
|
||||
_, lineSenderClass, _, lineSenderRace, lineSenderSex = GetPlayerInfoByGUID(guid)
|
||||
end
|
||||
text = text:gsub("(|Hplayer:([^|]*)|h%[([^%]]*)%]|h)", FormatPlayerLink)
|
||||
end
|
||||
|
||||
-- reduce channel name to number
|
||||
@@ -823,9 +818,7 @@ pfUI:RegisterModule("chat", function ()
|
||||
|
||||
-- detect the whisper prefix BEFORE prepending a timestamp; the timestamp
|
||||
-- pushes the whisper colour code off position 1 and the find below fails
|
||||
local isWhisper = C.chat.global.whispermod == "1" and string.find(text, wcol, 1) == 1
|
||||
|
||||
if isWhisper then
|
||||
if C.chat.global.whispermod == "1" and string.find(text, wcol, 1) == 1 then
|
||||
-- patch incoming whisper string to match the colors, before the
|
||||
-- timestamp so it keeps the form StripTimestamp looks for
|
||||
text = string.gsub(text, "|r", "|r" .. wcol)
|
||||
@@ -833,19 +826,66 @@ pfUI:RegisterModule("chat", function ()
|
||||
|
||||
-- show timestamp in chat
|
||||
if C.chat.text.time == "1" then
|
||||
text = timestampStart .. date(C.chat.text.timeformat) .. timestampEnd .. text
|
||||
end
|
||||
|
||||
-- save chat history
|
||||
if isWhisper then
|
||||
SaveChatHistory(frame:GetID(), string.gsub(text, wcol, ""), cr, cg, cb)
|
||||
else
|
||||
SaveChatHistory(frame:GetID(), text, ...)
|
||||
local now = time()
|
||||
if now ~= stampTime then
|
||||
stampTime, stamp = now, timestampStart .. date(C.chat.text.timeformat) .. timestampEnd
|
||||
end
|
||||
text = stamp .. text
|
||||
end
|
||||
|
||||
lastLineID, lastText, lastResult = lineID, input, text
|
||||
frame:HookAddMessage(text, ...)
|
||||
end
|
||||
|
||||
-- [ Chat History ]
|
||||
-- The newest lines of each chat frame, kept per character and written back
|
||||
-- at login, newest first and dimmed. They are read from the frames when
|
||||
-- leaving the world, which logout and reload both do before the saved
|
||||
-- variables are written.
|
||||
local HISTORY_LINES = 30
|
||||
|
||||
local function GetChatHistory()
|
||||
local realm, player = GetRealmName(), UnitName("player")
|
||||
pfUI_cache["chathistory"] = pfUI_cache["chathistory"] or {}
|
||||
pfUI_cache["chathistory"][realm] = pfUI_cache["chathistory"][realm] or {}
|
||||
pfUI_cache["chathistory"][realm][player] = pfUI_cache["chathistory"][realm][player] or {}
|
||||
return pfUI_cache["chathistory"][realm][player]
|
||||
end
|
||||
|
||||
-- a line dimmed in its colour, which also comes back after every |r in it
|
||||
local function DimHistoryLine(text, r, g, b)
|
||||
local color = rgbhex(r*.5+.2, g*.5+.2, b*.5+.2)
|
||||
return color .. text:gsub("|r", "|r" .. color)
|
||||
end
|
||||
|
||||
local function SaveChatHistory()
|
||||
local history = GetChatHistory()
|
||||
for i=1, NUM_CHAT_WINDOWS do
|
||||
local frame = _G["ChatFrame"..i]
|
||||
if not frame.pfCombatLog then
|
||||
local lines = {}
|
||||
local num = frame:GetNumMessages()
|
||||
for index = num, math.max(1, num - HISTORY_LINES + 1), -1 do
|
||||
local text, r, g, b, _, restored = frame:GetMessageInfo(index)
|
||||
-- lines written back from the history are dimmed already
|
||||
if not restored then
|
||||
-- an incoming whisper is in the whisper colour, not its own
|
||||
if C.chat.global.whispermod == "1" and pfUI.chat.StripTimestamp(text):sub(1, #wcol) == wcol then
|
||||
text, r, g, b = text:gsub(wcol, ""), cr, cg, cb
|
||||
end
|
||||
text = DimHistoryLine(text, r, g, b)
|
||||
end
|
||||
table.insert(lines, text)
|
||||
end
|
||||
history[i] = lines
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if C.chat.text.history == "1" then
|
||||
pfUI.events:RegisterFrameEventAndCallback("PLAYER_LEAVING_WORLD", SaveChatHistory)
|
||||
end
|
||||
|
||||
for i=1,NUM_CHAT_WINDOWS do
|
||||
if C.chat.global.maxlines ~= "128" then
|
||||
_G["ChatFrame"..i]:SetMaxLines(tonumber(C.chat.global.maxlines) or 128)
|
||||
@@ -853,13 +893,14 @@ pfUI:RegisterModule("chat", function ()
|
||||
|
||||
if not _G["ChatFrame"..i].HookAddMessage then
|
||||
if C.chat.text.history == "1" then
|
||||
-- write history to chat, newest first, above the lines already there
|
||||
for _, msg in ipairs(GetChatHistory(i)) do
|
||||
_G["ChatFrame"..i]:BackFillMessage(msg, .7,.7,.7)
|
||||
-- write history to chat, newest first, above the lines already there;
|
||||
-- after the colour come the id slot and the mark SaveChatHistory reads
|
||||
for _, msg in ipairs(GetChatHistory()[i] or {}) do
|
||||
_G["ChatFrame"..i]:BackFillMessage(msg, .7,.7,.7, nil, true)
|
||||
end
|
||||
end
|
||||
|
||||
-- add chat parse and history hooks
|
||||
-- add chat parse hooks
|
||||
_G["ChatFrame"..i].HookAddMessage = _G["ChatFrame"..i].AddMessage
|
||||
_G["ChatFrame"..i].AddMessage = AddMessage
|
||||
end
|
||||
|
||||
@@ -85,10 +85,16 @@ pfUI:RegisterModule("chatcopy", function ()
|
||||
|
||||
scroll:SetFont(frame:GetFont())
|
||||
scroll:SetText(text)
|
||||
|
||||
-- the cursor at the end scrolls the box to the newest line
|
||||
scroll:SetFocus()
|
||||
scroll:SetCursorPosition(#text)
|
||||
|
||||
-- the edit box lays the text out in this frame's update, so scroll to
|
||||
-- the newest line after it; the caret only scrolls the focused box
|
||||
RunNextFrame(function()
|
||||
local scrollBox = scroll:GetScrollBox()
|
||||
scrollBox:FullUpdate(ScrollBoxConstants.UpdateImmediately)
|
||||
scrollBox:ScrollToEnd(ScrollBoxConstants.NoScrollInterpolation)
|
||||
end)
|
||||
end)
|
||||
|
||||
frame.scroll = scroll
|
||||
|
||||
+21
-166
@@ -1669,115 +1669,6 @@ pfUI:RegisterModule("gui", function ()
|
||||
local header = CreateConfig(nil, T["Nameplate Update Rate"], nil, nil, "header")
|
||||
header:GetParent().objectCount = header:GetParent().objectCount - 1
|
||||
header:SetHeight(20)
|
||||
|
||||
local targetCustom -- declare first so callback can use it
|
||||
|
||||
CreateConfig(function()
|
||||
-- Callback when dropdown changes - update custom field immediately
|
||||
if targetCustom and targetCustom.input then
|
||||
local isCustom = pfUI.throttle:IsCustom("nameplates_target")
|
||||
if not isCustom then
|
||||
-- Preset selected - show FPS from preset, make readonly
|
||||
targetCustom.input:EnableMouse(false)
|
||||
targetCustom.input:EnableKeyboard(false)
|
||||
targetCustom.input:ClearFocus()
|
||||
targetCustom.input:SetTextColor(.5,.5,.5,1)
|
||||
targetCustom.input:SetText(tostring(pfUI.throttle:GetFps("nameplates_target")))
|
||||
else
|
||||
-- Custom selected - make editable
|
||||
targetCustom.input:EnableMouse(true)
|
||||
targetCustom.input:EnableKeyboard(true)
|
||||
targetCustom.input:SetTextColor(.2,1,.8,1)
|
||||
if _G.pfUI_throttle.nameplates_target_custom then
|
||||
targetCustom.input:SetText(_G.pfUI_throttle.nameplates_target_custom)
|
||||
end
|
||||
end
|
||||
end
|
||||
end, T["Target Plates"], _G.pfUI_throttle, "nameplates_target", "dropdown", {
|
||||
"very_slow:" .. T["Very Slow"] .. " (2 FPS)",
|
||||
"slow:" .. T["Slow"] .. " (5 FPS)",
|
||||
"normal:" .. T["Normal"] .. " (10 FPS)",
|
||||
"fast:" .. T["Fast"] .. " (20 FPS)",
|
||||
"very_fast:" .. T["Very Fast"] .. " (30 FPS)",
|
||||
"fastest:" .. T["Fastest"] .. " (50 FPS)",
|
||||
"custom:" .. T["Custom"],
|
||||
})
|
||||
|
||||
-- Now create custom field AFTER dropdown
|
||||
targetCustom = CreateConfig(nil, T["Custom FPS"], _G.pfUI_throttle, "nameplates_target_custom")
|
||||
|
||||
-- Set initial state
|
||||
local isCustom = pfUI.throttle:IsCustom("nameplates_target")
|
||||
if not isCustom then
|
||||
targetCustom.input:EnableMouse(false)
|
||||
targetCustom.input:EnableKeyboard(false)
|
||||
targetCustom.input:SetTextColor(.5,.5,.5,1)
|
||||
targetCustom.input:SetText(tostring(pfUI.throttle:GetFps("nameplates_target")))
|
||||
else
|
||||
targetCustom.input:EnableMouse(true)
|
||||
targetCustom.input:EnableKeyboard(true)
|
||||
targetCustom.input:SetTextColor(.2,1,.8,1)
|
||||
if _G.pfUI_throttle.nameplates_target_custom then
|
||||
targetCustom.input:SetText(_G.pfUI_throttle.nameplates_target_custom)
|
||||
end
|
||||
end
|
||||
|
||||
-- Spacer after custom field
|
||||
local spacer1 = CreateConfig(nil, " ", nil, nil, "header")
|
||||
spacer1:GetParent().objectCount = spacer1:GetParent().objectCount - 1
|
||||
spacer1:SetHeight(5)
|
||||
|
||||
local normalCustom
|
||||
|
||||
CreateConfig(function()
|
||||
if normalCustom and normalCustom.input then
|
||||
local isCustom = pfUI.throttle:IsCustom("nameplates")
|
||||
if not isCustom then
|
||||
normalCustom.input:EnableMouse(false)
|
||||
normalCustom.input:EnableKeyboard(false)
|
||||
normalCustom.input:ClearFocus()
|
||||
normalCustom.input:SetTextColor(.5,.5,.5,1)
|
||||
normalCustom.input:SetText(tostring(pfUI.throttle:GetFps("nameplates")))
|
||||
else
|
||||
normalCustom.input:EnableMouse(true)
|
||||
normalCustom.input:EnableKeyboard(true)
|
||||
normalCustom.input:SetTextColor(.2,1,.8,1)
|
||||
if _G.pfUI_throttle.nameplates_custom then
|
||||
normalCustom.input:SetText(_G.pfUI_throttle.nameplates_custom)
|
||||
end
|
||||
end
|
||||
end
|
||||
end, T["Normal Plates"], _G.pfUI_throttle, "nameplates", "dropdown", {
|
||||
"very_slow:" .. T["Very Slow"] .. " (2 FPS)",
|
||||
"slow:" .. T["Slow"] .. " (5 FPS)",
|
||||
"normal:" .. T["Normal"] .. " (10 FPS)",
|
||||
"fast:" .. T["Fast"] .. " (20 FPS)",
|
||||
"very_fast:" .. T["Very Fast"] .. " (30 FPS)",
|
||||
"fastest:" .. T["Fastest"] .. " (50 FPS)",
|
||||
"custom:" .. T["Custom"],
|
||||
})
|
||||
|
||||
normalCustom = CreateConfig(nil, T["Custom FPS"], _G.pfUI_throttle, "nameplates_custom")
|
||||
|
||||
local isCustom2 = pfUI.throttle:IsCustom("nameplates")
|
||||
if not isCustom2 then
|
||||
normalCustom.input:EnableMouse(false)
|
||||
normalCustom.input:EnableKeyboard(false)
|
||||
normalCustom.input:SetTextColor(.5,.5,.5,1)
|
||||
normalCustom.input:SetText(tostring(pfUI.throttle:GetFps("nameplates")))
|
||||
else
|
||||
normalCustom.input:EnableMouse(true)
|
||||
normalCustom.input:EnableKeyboard(true)
|
||||
normalCustom.input:SetTextColor(.2,1,.8,1)
|
||||
if _G.pfUI_throttle.nameplates_custom then
|
||||
normalCustom.input:SetText(_G.pfUI_throttle.nameplates_custom)
|
||||
end
|
||||
end
|
||||
|
||||
-- Spacer after custom field
|
||||
local spacer2 = CreateConfig(nil, " ", nil, nil, "header")
|
||||
spacer2:GetParent().objectCount = spacer2:GetParent().objectCount - 1
|
||||
spacer2:SetHeight(5)
|
||||
|
||||
local castbarCustom
|
||||
|
||||
@@ -1811,71 +1702,30 @@ pfUI:RegisterModule("gui", function ()
|
||||
|
||||
castbarCustom = CreateConfig(nil, T["Custom FPS"], _G.pfUI_throttle, "nameplates_castbar_custom")
|
||||
|
||||
local spacer3 = CreateConfig(nil, " ", nil, nil, "header")
|
||||
spacer3:GetParent().objectCount = spacer3:GetParent().objectCount - 1
|
||||
spacer3:SetHeight(5)
|
||||
|
||||
local massCustom
|
||||
|
||||
CreateConfig(function()
|
||||
if massCustom and massCustom.input then
|
||||
local isCustom = pfUI.throttle:IsCustom("nameplates_mass")
|
||||
if not isCustom then
|
||||
massCustom.input:EnableMouse(false)
|
||||
massCustom.input:EnableKeyboard(false)
|
||||
massCustom.input:ClearFocus()
|
||||
massCustom.input:SetTextColor(.5,.5,.5,1)
|
||||
massCustom.input:SetText(tostring(pfUI.throttle:GetFps("nameplates_mass")))
|
||||
else
|
||||
massCustom.input:EnableMouse(true)
|
||||
massCustom.input:EnableKeyboard(true)
|
||||
massCustom.input:SetTextColor(.2,1,.8,1)
|
||||
if _G.pfUI_throttle.nameplates_mass_custom then
|
||||
massCustom.input:SetText(_G.pfUI_throttle.nameplates_mass_custom)
|
||||
end
|
||||
end
|
||||
end
|
||||
end, T["Mass Pulls (20+ Plates)"], _G.pfUI_throttle, "nameplates_mass", "dropdown", {
|
||||
"very_slow:" .. T["Very Slow"] .. " (2 FPS)",
|
||||
"slow:" .. T["Slow"] .. " (5 FPS)",
|
||||
"normal:" .. T["Normal"] .. " (10 FPS)",
|
||||
"fast:" .. T["Fast"] .. " (20 FPS)",
|
||||
"very_fast:" .. T["Very Fast"] .. " (30 FPS)",
|
||||
"fastest:" .. T["Fastest"] .. " (50 FPS)",
|
||||
"custom:" .. T["Custom"],
|
||||
})
|
||||
|
||||
massCustom = CreateConfig(nil, T["Custom FPS"], _G.pfUI_throttle, "nameplates_mass_custom")
|
||||
|
||||
local isCustom3 = pfUI.throttle:IsCustom("nameplates_mass")
|
||||
if not isCustom3 then
|
||||
massCustom.input:EnableMouse(false)
|
||||
massCustom.input:EnableKeyboard(false)
|
||||
massCustom.input:SetTextColor(.5,.5,.5,1)
|
||||
massCustom.input:SetText(tostring(pfUI.throttle:GetFps("nameplates_mass")))
|
||||
local isCustom = pfUI.throttle:IsCustom("nameplates_castbar")
|
||||
if not isCustom then
|
||||
castbarCustom.input:EnableMouse(false)
|
||||
castbarCustom.input:EnableKeyboard(false)
|
||||
castbarCustom.input:SetTextColor(.5,.5,.5,1)
|
||||
castbarCustom.input:SetText(tostring(pfUI.throttle:GetFps("nameplates_castbar")))
|
||||
else
|
||||
massCustom.input:EnableMouse(true)
|
||||
massCustom.input:EnableKeyboard(true)
|
||||
massCustom.input:SetTextColor(.2,1,.8,1)
|
||||
if _G.pfUI_throttle.nameplates_mass_custom then
|
||||
massCustom.input:SetText(_G.pfUI_throttle.nameplates_mass_custom)
|
||||
castbarCustom.input:EnableMouse(true)
|
||||
castbarCustom.input:EnableKeyboard(true)
|
||||
castbarCustom.input:SetTextColor(.2,1,.8,1)
|
||||
if _G.pfUI_throttle.nameplates_castbar_custom then
|
||||
castbarCustom.input:SetText(_G.pfUI_throttle.nameplates_castbar_custom)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- Spacer before reset button
|
||||
local spacer = CreateConfig(nil, " ", nil, nil, "header")
|
||||
spacer:GetParent().objectCount = spacer:GetParent().objectCount - 1
|
||||
spacer:SetHeight(10)
|
||||
|
||||
|
||||
-- Reset to defaults button
|
||||
CreateConfig(nil, T["Reset to Defaults"], nil, nil, "button", function()
|
||||
pfUI.throttle:ResetToDefault("nameplates_target")
|
||||
pfUI.throttle:ResetToDefault("nameplates")
|
||||
pfUI.throttle:ResetToDefault("nameplates_mass")
|
||||
-- Also reset custom fields to their default FPS values
|
||||
_G.pfUI_throttle.nameplates_target_custom = "50"
|
||||
_G.pfUI_throttle.nameplates_custom = "10"
|
||||
_G.pfUI_throttle.nameplates_mass_custom = "7"
|
||||
pfUI.throttle:ResetToDefault("nameplates_castbar")
|
||||
_G.pfUI_throttle.nameplates_castbar_custom = "100"
|
||||
Reload()
|
||||
end, true)
|
||||
end)
|
||||
@@ -2294,6 +2144,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
CreateConfig(U["raid"], T["Raid Padding"], C.unitframes[c], "raidpadding")
|
||||
CreateConfig(U["raid"], T["Raid Layout"], C.unitframes[c], "raidlayout", "dropdown", pfUI.gui.dropdowns.uf_raidlayout)
|
||||
CreateConfig(U["raid"], T["Raid Fill Direction"], C.unitframes[c], "raidfill", "dropdown", pfUI.gui.dropdowns.orientation)
|
||||
CreateConfig(U["raid"], T["Grow Right To Left"], C.unitframes[c], "raidgrowleft", "checkbox")
|
||||
CreateConfig(U["raid"], T["Collapse Empty Slots"], C.unitframes[c], "collapse", "checkbox")
|
||||
elseif c == "raidpet" then
|
||||
CreateConfig(U[c], T["Layout"], nil, nil, "header")
|
||||
@@ -2360,6 +2211,8 @@ pfUI:RegisterModule("gui", function ()
|
||||
CreateConfig(U[c], T["Buff Limit"], C.unitframes[c], "bufflimit")
|
||||
CreateConfig(U[c], T["Buffs Per Row"], C.unitframes[c], "buffperrow")
|
||||
CreateConfig(U[c], T["Own Buff Size"], C.unitframes[c], "ownbuffsize")
|
||||
CreateConfig(U[c], T["Buff X-Offset"], C.unitframes[c], "buffoffx")
|
||||
CreateConfig(U[c], T["Buff Y-Offset"], C.unitframes[c], "buffoffy")
|
||||
CreateConfig(U[c], T["Buff X-Spacing"], C.unitframes[c], "buffspacingx")
|
||||
CreateConfig(U[c], T["Buff Y-Spacing"], C.unitframes[c], "buffspacingy")
|
||||
|
||||
@@ -2369,6 +2222,8 @@ pfUI:RegisterModule("gui", function ()
|
||||
CreateConfig(U[c], T["Debuff Limit"], C.unitframes[c], "debufflimit")
|
||||
CreateConfig(U[c], T["Debuffs Per Row"], C.unitframes[c], "debuffperrow")
|
||||
CreateConfig(U[c], T["Own Debuff Size"], C.unitframes[c], "owndebuffsize")
|
||||
CreateConfig(U[c], T["Debuff X-Offset"], C.unitframes[c], "debuffoffx")
|
||||
CreateConfig(U[c], T["Debuff Y-Offset"], C.unitframes[c], "debuffoffy")
|
||||
CreateConfig(U[c], T["Debuff X-Spacing"], C.unitframes[c], "debuffspacingx")
|
||||
CreateConfig(U[c], T["Debuff Y-Spacing"], C.unitframes[c], "debuffspacingy")
|
||||
|
||||
@@ -3084,4 +2939,4 @@ pfUI:RegisterModule("gui", function ()
|
||||
end
|
||||
end)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
+1222
-1439
File diff suppressed because it is too large
Load Diff
+16
-22
@@ -30,8 +30,8 @@ pfUI:RegisterModule("raid", function ()
|
||||
-- flat pool of pet frames, laid out by LayoutPets (mirror or collapsed)
|
||||
pfUI.uf.raid.pets = {}
|
||||
|
||||
-- 1-based grid slot -> (row, col) for the current fill direction, matching
|
||||
-- the raid grid's own fill loops.
|
||||
-- 1-based grid slot -> (col, row) for the current fill direction, shared by
|
||||
-- the raid and pet grids.
|
||||
local function SlotToCoord(slot, fill, x, y)
|
||||
slot = slot - 1
|
||||
if fill == "VERTICAL" then
|
||||
@@ -75,12 +75,12 @@ pfUI:RegisterModule("raid", function ()
|
||||
end
|
||||
end
|
||||
|
||||
local i = 1
|
||||
local width = pfUI.uf.raid[1]:GetWidth()+2*default_border
|
||||
local height = pfUI.uf.raid[1]:GetHeight()+2*default_border
|
||||
local layout = pfUI.uf.raid[1].config.raidlayout
|
||||
local padding = tonumber(pfUI.uf.raid[1].config.raidpadding)*GetPerfectPixel()
|
||||
local fill = pfUI.uf.raid[1].config.raidfill
|
||||
local growleft = pfUI.uf.raid[1].config.raidgrowleft == "1"
|
||||
local _, _, x, y = string.find(layout,"(.+)x(.+)")
|
||||
x, y = tonumber(x), tonumber(y)
|
||||
|
||||
@@ -95,24 +95,18 @@ pfUI:RegisterModule("raid", function ()
|
||||
}
|
||||
end
|
||||
|
||||
if fill == "VERTICAL" then
|
||||
for r=1, x do for g=1, y do
|
||||
if pfUI.uf.raid[i] then
|
||||
pfUI.uf.raid[i]:ClearAllPoints()
|
||||
pfUI.uf.raid[i]:SetPoint("BOTTOMLEFT", (r-1)*(padding+width), (g-1)*(padding+height))
|
||||
UpdateMovable(pfUI.uf.raid[i], true)
|
||||
end
|
||||
i = i + 1
|
||||
end end
|
||||
else
|
||||
for g=1, y do for r=1, x do
|
||||
if pfUI.uf.raid[i] then
|
||||
pfUI.uf.raid[i]:ClearAllPoints()
|
||||
pfUI.uf.raid[i]:SetPoint("BOTTOMLEFT", (r-1)*(padding+width), (g-1)*(padding+height))
|
||||
UpdateMovable(pfUI.uf.raid[i], true)
|
||||
end
|
||||
i = i + 1
|
||||
end end
|
||||
-- right to left mirrors across the columns maxraid can fill, so a smaller
|
||||
-- raid stays next to the anchor instead of the far edge of the layout
|
||||
local cols = min(x, fill == "VERTICAL" and ceil(maxraid / y) or maxraid)
|
||||
|
||||
for i=1, x*y do
|
||||
if pfUI.uf.raid[i] then
|
||||
local r, g = SlotToCoord(i, fill, x, y)
|
||||
if growleft then r = cols - r + 1 end
|
||||
pfUI.uf.raid[i]:ClearAllPoints()
|
||||
pfUI.uf.raid[i]:SetPoint("BOTTOMLEFT", (r-1)*(padding+width), (g-1)*(padding+height))
|
||||
UpdateMovable(pfUI.uf.raid[i], true)
|
||||
end
|
||||
end
|
||||
|
||||
self:LayoutPets()
|
||||
@@ -303,4 +297,4 @@ pfUI:RegisterModule("raid", function ()
|
||||
pfUI.uf.raid:QueueUpdate(0)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user