pfUI-raidsolo.lua 587 B

123456789101112131415161718192021
  1. local HookRefreshUnit = pfUI.uf.RefreshUnit
  2. function pfUI.uf:RefreshUnit(unit, component)
  3. local raidforgroup = pfUI_config["unitframes"]["raidforgroup"]
  4. if unit:GetName() == "pfRaid1"
  5. and GetNumPartyMembers() == 0
  6. and not UnitInRaid("player")
  7. then
  8. -- conflict with line api/unitframes.lua:884, I know this is shit,
  9. -- but I need to intercept this block
  10. pfUI_config["unitframes"]["raidforgroup"] = "0"
  11. unit.id = ""
  12. unit.label = "player"
  13. end
  14. HookRefreshUnit(this, unit, component)
  15. pfUI_config["unitframes"]["raidforgroup"] = raidforgroup
  16. end