├── .gitignore ├── ClassicPlatesPlus ├── media │ ├── auras │ │ ├── mask.tga │ │ ├── border.tga │ │ ├── aurasShadow.tga │ │ ├── borderStacks.tga │ │ ├── importantBorder.tga │ │ ├── importantBorder2.tga │ │ ├── importantHighlight.tga │ │ ├── importantHighlight2.tga │ │ ├── importantBorderStacks.tga │ │ ├── importantBorderStacks2.tga │ │ └── importantHighlightStacks.tga │ ├── icons │ │ ├── edit.tga │ │ ├── ffa.blp │ │ ├── mark.tga │ │ ├── raid.tga │ │ ├── tank.tga │ │ ├── Horde.blp │ │ ├── aggro.tga │ │ ├── badge.tga │ │ ├── friend.tga │ │ ├── guild.tga │ │ ├── leader.tga │ │ ├── mark2.tga │ │ ├── mark3.tga │ │ ├── member.tga │ │ ├── notTank.tga │ │ ├── party.tga │ │ ├── quest.tga │ │ ├── skull.blp │ │ ├── target.tga │ │ ├── Alliance.blp │ │ └── ClassicPlatesPlus_icon.tga │ ├── borders │ │ ├── level.tga │ │ ├── threat.tga │ │ ├── borderOwn.tga │ │ ├── healthbar.tga │ │ ├── personal.tga │ │ ├── portrait.tga │ │ ├── powerbar.tga │ │ ├── threatBG.tga │ │ ├── threat_new.tga │ │ ├── colorPicker.tga │ │ ├── threatBG_new.tga │ │ ├── borderOwnDruid.tga │ │ └── personalExtra.tga │ ├── classes │ │ ├── DRUID.tga │ │ ├── MAGE.tga │ │ ├── MONK.tga │ │ ├── ROGUE.tga │ │ ├── EVOKER.tga │ │ ├── HUNTER.tga │ │ ├── PALADIN.tga │ │ ├── PRIEST.tga │ │ ├── SHAMAN.tga │ │ ├── WARLOCK.tga │ │ ├── WARRIOR.tga │ │ ├── DEATHKNIGHT.tga │ │ └── DEMONHUNTER.tga │ ├── logo │ │ ├── boosty.tga │ │ ├── discord.tga │ │ └── github.tga │ ├── tracking │ │ ├── Food.blp │ │ ├── Banker.blp │ │ ├── Class.blp │ │ ├── Repair.blp │ │ ├── Vendor.tga │ │ ├── Innkeeper.blp │ │ ├── Poisons.blp │ │ ├── Reagents.blp │ │ ├── Ammunition.blp │ │ ├── Auctioneer.blp │ │ ├── Profession.blp │ │ ├── BattleMaster.blp │ │ ├── FlightMaster.blp │ │ └── StableMaster.blp │ ├── castbar │ │ ├── castbar.tga │ │ ├── castbarUI.tga │ │ ├── castbarUI2.tga │ │ └── castbarMask.tga │ ├── highlights │ │ ├── level.tga │ │ ├── spark.tga │ │ ├── threat.tga │ │ ├── aurasList.tga │ │ ├── healthbar.tga │ │ ├── portrait.tga │ │ ├── powerbar.tga │ │ ├── healPredict.tga │ │ ├── healthbar_2.tga │ │ ├── healthbar_3.tga │ │ └── threat_new.tga │ ├── masks │ │ └── colorPicker.tga │ ├── powers │ │ ├── comboPoints.tga │ │ ├── totemBorder.tga │ │ ├── totemMask.tga │ │ └── comboPointsBorder.tga │ └── classifications │ │ ├── rare.tga │ │ ├── elite.tga │ │ ├── rareelite.tga │ │ ├── worldboss.tga │ │ ├── compactelite.tga │ │ ├── compactrare.tga │ │ ├── compactrareelite.tga │ │ └── compactworldboss.tga ├── ClassicPlatesPlus.toc ├── nameplate_removed.lua ├── threat.lua ├── castbar.lua ├── init.lua ├── nameplate_added.lua ├── nameplate_created.lua ├── nameplate_personal.lua └── auras.lua ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | desktop.ini 3 | ClassicPlatesPlus/.vscode/settings.json 4 | -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/auras/mask.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/auras/mask.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/icons/edit.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/icons/edit.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/icons/ffa.blp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/icons/ffa.blp -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/icons/mark.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/icons/mark.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/icons/raid.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/icons/raid.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/icons/tank.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/icons/tank.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/auras/border.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/auras/border.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/borders/level.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/borders/level.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/classes/DRUID.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/classes/DRUID.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/classes/MAGE.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/classes/MAGE.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/classes/MONK.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/classes/MONK.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/classes/ROGUE.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/classes/ROGUE.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/icons/Horde.blp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/icons/Horde.blp -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/icons/aggro.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/icons/aggro.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/icons/badge.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/icons/badge.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/icons/friend.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/icons/friend.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/icons/guild.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/icons/guild.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/icons/leader.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/icons/leader.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/icons/mark2.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/icons/mark2.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/icons/mark3.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/icons/mark3.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/icons/member.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/icons/member.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/icons/notTank.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/icons/notTank.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/icons/party.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/icons/party.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/icons/quest.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/icons/quest.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/icons/skull.blp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/icons/skull.blp -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/icons/target.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/icons/target.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/logo/boosty.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/logo/boosty.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/logo/discord.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/logo/discord.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/logo/github.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/logo/github.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/tracking/Food.blp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/tracking/Food.blp -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/borders/threat.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/borders/threat.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/castbar/castbar.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/castbar/castbar.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/classes/EVOKER.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/classes/EVOKER.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/classes/HUNTER.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/classes/HUNTER.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/classes/PALADIN.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/classes/PALADIN.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/classes/PRIEST.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/classes/PRIEST.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/classes/SHAMAN.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/classes/SHAMAN.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/classes/WARLOCK.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/classes/WARLOCK.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/classes/WARRIOR.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/classes/WARRIOR.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/icons/Alliance.blp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/icons/Alliance.blp -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/tracking/Banker.blp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/tracking/Banker.blp -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/tracking/Class.blp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/tracking/Class.blp -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/tracking/Repair.blp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/tracking/Repair.blp -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/tracking/Vendor.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/tracking/Vendor.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/auras/aurasShadow.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/auras/aurasShadow.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/auras/borderStacks.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/auras/borderStacks.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/borders/borderOwn.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/borders/borderOwn.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/borders/healthbar.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/borders/healthbar.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/borders/personal.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/borders/personal.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/borders/portrait.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/borders/portrait.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/borders/powerbar.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/borders/powerbar.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/borders/threatBG.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/borders/threatBG.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/borders/threat_new.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/borders/threat_new.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/castbar/castbarUI.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/castbar/castbarUI.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/castbar/castbarUI2.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/castbar/castbarUI2.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/highlights/level.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/highlights/level.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/highlights/spark.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/highlights/spark.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/highlights/threat.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/highlights/threat.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/masks/colorPicker.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/masks/colorPicker.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/powers/comboPoints.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/powers/comboPoints.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/powers/totemBorder.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/powers/totemBorder.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/powers/totemMask.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/powers/totemMask.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/tracking/Innkeeper.blp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/tracking/Innkeeper.blp -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/tracking/Poisons.blp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/tracking/Poisons.blp -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/tracking/Reagents.blp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/tracking/Reagents.blp -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/borders/colorPicker.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/borders/colorPicker.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/borders/threatBG_new.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/borders/threatBG_new.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/castbar/castbarMask.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/castbar/castbarMask.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/classes/DEATHKNIGHT.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/classes/DEATHKNIGHT.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/classes/DEMONHUNTER.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/classes/DEMONHUNTER.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/classifications/rare.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/classifications/rare.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/highlights/aurasList.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/highlights/aurasList.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/highlights/healthbar.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/highlights/healthbar.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/highlights/portrait.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/highlights/portrait.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/highlights/powerbar.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/highlights/powerbar.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/tracking/Ammunition.blp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/tracking/Ammunition.blp -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/tracking/Auctioneer.blp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/tracking/Auctioneer.blp -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/tracking/Profession.blp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/tracking/Profession.blp -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/auras/importantBorder.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/auras/importantBorder.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/auras/importantBorder2.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/auras/importantBorder2.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/borders/borderOwnDruid.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/borders/borderOwnDruid.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/borders/personalExtra.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/borders/personalExtra.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/classifications/elite.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/classifications/elite.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/highlights/healPredict.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/highlights/healPredict.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/highlights/healthbar_2.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/highlights/healthbar_2.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/highlights/healthbar_3.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/highlights/healthbar_3.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/highlights/threat_new.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/highlights/threat_new.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/tracking/BattleMaster.blp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/tracking/BattleMaster.blp -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/tracking/FlightMaster.blp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/tracking/FlightMaster.blp -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/tracking/StableMaster.blp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/tracking/StableMaster.blp -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/auras/importantHighlight.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/auras/importantHighlight.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/auras/importantHighlight2.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/auras/importantHighlight2.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/classifications/rareelite.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/classifications/rareelite.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/classifications/worldboss.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/classifications/worldboss.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/powers/comboPointsBorder.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/powers/comboPointsBorder.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/auras/importantBorderStacks.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/auras/importantBorderStacks.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/auras/importantBorderStacks2.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/auras/importantBorderStacks2.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/classifications/compactelite.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/classifications/compactelite.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/classifications/compactrare.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/classifications/compactrare.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/icons/ClassicPlatesPlus_icon.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/icons/ClassicPlatesPlus_icon.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/auras/importantHighlightStacks.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/auras/importantHighlightStacks.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/classifications/compactrareelite.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/classifications/compactrareelite.tga -------------------------------------------------------------------------------- /ClassicPlatesPlus/media/classifications/compactworldboss.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReubinAuthor/ClassicPlatesPlus/HEAD/ClassicPlatesPlus/media/classifications/compactworldboss.tga -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | All Rights Reserved 2 | Copyright (c) 2022 Reubin 3 | 4 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 5 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 6 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 7 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 8 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 9 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 10 | THE SOFTWARE. 11 | -------------------------------------------------------------------------------- /ClassicPlatesPlus/ClassicPlatesPlus.toc: -------------------------------------------------------------------------------- 1 | ##Interface: 110100, 11506, 40402 2 | ## Title: |TInterface/Addons/ClassicPlatesPlus/media/icons/ClassicPlatesPlus_icon:16:16|t ClassicPlates Plus 3 | ## Notes: ClassicPlates Plus is an addon that adds additional features and new Classic-themed visuals to nameplates. 4 | ## Author: Reubin 5 | ## Version: 3.5.1 6 | ## DefaultState: enabled 7 | ## SavedVariables: CFG_Account_ClassicPlatesPlus 8 | ## SavedVariablesPerCharacter: CFG_ClassicPlatesPlus 9 | 10 | core.lua 11 | settings_functions.lua 12 | settings.lua 13 | 14 | nameplate_created.lua 15 | nameplate_added.lua 16 | nameplate_removed.lua 17 | nameplate_personal.lua 18 | castbar.lua 19 | auras.lua 20 | threat.lua 21 | init.lua -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Join my discord 2 | 3 | # **ClassicPlates Plus** 4 | ClassicPlates Plus is a nameplates addon that adds additional features and new updated Classic-themed visuals. 5 | 6 | ## Features 7 | - Buffs and Debuffs tracking 8 | - Threat status 9 | - Class colors and Icons 10 | - Personal nameplate 11 | - Power bar (*mana, rage, energy, etc...*) 12 | - NPC Classification (*rare, elite, world boss, etc...*) 13 | 14 |
15 | 16 | ## How to move Personal Nameplate 17 | You can move personal nameplate in Classic Flavors by holding down CTRL and dragging it with Left Mouse Button. 18 | 19 |
20 | 21 | ## Consider supporting this project 22 | You can support this project with [**one time donation**](https://boosty.to/reubin/donate) or a [**subscription**](https://boosty.to/reubin) 23 | 24 |
25 | 26 | ## Download 27 | 28 | Grab it on [**CurseForge**](https://www.curseforge.com/wow/addons/classicplatesplus). 29 | 30 |
31 | 32 | ## Screenshots 33 | 34 |
35 | 36 | ![pic8](https://github.com/ReubinAuthor/ClassicPlatesPlus/assets/82573908/816b44ea-b508-45c4-8c27-fe5a67f2a709) 37 | 38 |
39 | 40 | ![pic3](https://github.com/ReubinAuthor/ClassicPlates-Plus/assets/82573908/ac3ec5b3-476f-4fe4-ac33-4edf69cdcf05) 41 | 42 |
43 | 44 | ![pic6](https://github.com/ReubinAuthor/ClassicPlatesPlus/assets/82573908/878a5ee9-83be-47d2-8eea-e3efd84b1e9d) 45 | 46 |
47 | 48 | ![pic7](https://github.com/ReubinAuthor/ClassicPlatesPlus/assets/82573908/f36fe40d-330a-4b47-9abc-d0524227074d) 49 | 50 |
51 | 52 | ![pic1](https://github.com/ReubinAuthor/ClassicPlates-Plus/assets/82573908/9e5945fd-3baf-41b4-b2db-471c783db571) 53 | 54 |
55 | 56 | ![pic4](https://github.com/ReubinAuthor/ClassicPlatesPlus/assets/82573908/a0d98a1d-8753-485d-bf11-995113018a9b) 57 | 58 |
59 | 60 | ![pic5](https://github.com/ReubinAuthor/ClassicPlatesPlus/assets/82573908/9708f849-2341-4b76-a5dc-91c614187b85) 61 | 62 |
63 | 64 | ![pic2](https://github.com/ReubinAuthor/ClassicPlates-Plus/assets/82573908/ed349986-b991-405b-8260-6fbbe205db5b) 65 | -------------------------------------------------------------------------------- /ClassicPlatesPlus/nameplate_removed.lua: -------------------------------------------------------------------------------- 1 | ---------------------------------------- 2 | -- Core 3 | ---------------------------------------- 4 | local _, core = ...; 5 | local func = core.func; 6 | local data = core.data; 7 | 8 | ---------------------------------------- 9 | -- Removing nameplate 10 | ---------------------------------------- 11 | function func:Nameplate_Removed(unit) 12 | local CFG = CFG_Account_ClassicPlatesPlus.Profiles[CFG_ClassicPlatesPlus.Profile]; 13 | 14 | if unit then 15 | local nameplate = C_NamePlate.GetNamePlateForUnit(unit); 16 | 17 | if nameplate then 18 | local unitFrame = nameplate.unitFrame; 19 | 20 | unitFrame.portrait.countdown:Hide(); 21 | 22 | if CFG.Portrait then 23 | unitFrame.portrait.texture:Hide(); 24 | end 25 | 26 | -- Hidding auras 27 | if unitFrame.auras then 28 | if unitFrame.auras.helpful then 29 | for k,v in pairs(unitFrame.auras.helpful) do 30 | if k then 31 | v:Hide(); 32 | end 33 | end 34 | end 35 | if unitFrame.auras.harmful then 36 | for k,v in pairs(unitFrame.auras.harmful) do 37 | if k then 38 | v:Hide(); 39 | end 40 | end 41 | end 42 | end 43 | 44 | if data.portraits.queue then 45 | for k,v in ipairs(data.portraits.queue) do 46 | if k then 47 | if v.unit == unit then 48 | table.remove(data.portraits.queue, k); 49 | end 50 | end 51 | end 52 | end 53 | 54 | -- Threat percentage 55 | unitFrame.threatPercentage:Hide(); 56 | 57 | -- Combo points 58 | unitFrame.classPower:Hide(); 59 | 60 | -- Removing nameplate 61 | unitFrame.unit = nil; 62 | unitFrame.inVehicle = nil; 63 | unitFrame:Hide(); 64 | 65 | if data.isRetail then 66 | if UnitIsUnit(unit, "player") then 67 | data.nameplate:Hide(); 68 | end 69 | end 70 | end 71 | end 72 | end -------------------------------------------------------------------------------- /ClassicPlatesPlus/threat.lua: -------------------------------------------------------------------------------- 1 | ---------------------------------------- 2 | -- CORE 3 | ---------------------------------------- 4 | local myAddon, core = ...; 5 | local func = core.func; 6 | local data = core.data; 7 | 8 | ---------------------------------------- 9 | -- Check if other tank is tanking 10 | ---------------------------------------- 11 | function func:OtherTank(unit) 12 | if unit and not UnitIsPlayer(unit) or UnitIsOtherPlayersPet(unit) then 13 | for k in pairs(data.tanks) do 14 | if k then 15 | local status = UnitThreatSituation(k, unit); 16 | 17 | if status == 2 or status == 3 then 18 | return true; 19 | end 20 | end 21 | end 22 | end 23 | end 24 | 25 | ---------------------------------------- 26 | -- Threat 27 | ---------------------------------------- 28 | function func:Update_Threat(unit) 29 | if unit and string.match(unit, "nameplate") then 30 | local CFG = CFG_Account_ClassicPlatesPlus.Profiles[CFG_ClassicPlatesPlus.Profile]; 31 | local nameplate = C_NamePlate.GetNamePlateForUnit(unit); 32 | 33 | if nameplate then 34 | local unitFrame = nameplate.unitFrame; 35 | local ThreatPercentageOfLead = UnitThreatPercentageOfLead("player", unit) or 0; 36 | local status = UnitThreatSituation("player", unit); 37 | local r,g,b = func:GetUnitColor(unit, ThreatPercentageOfLead, status); 38 | 39 | -- Coloring highlights 40 | unitFrame.portrait.highlight:SetVertexColor(r,g,b); 41 | unitFrame.healthbar.highlight:SetVertexColor(r,g,b); 42 | unitFrame.level.highlight:SetVertexColor(r,g,b); 43 | unitFrame.powerbar.highlight:SetVertexColor(r,g,b); 44 | unitFrame.threatPercentage.highlight:SetVertexColor(r,g,b); 45 | 46 | -- Coloring rest 47 | unitFrame.healthbar:SetStatusBarColor(r,g,b); 48 | unitFrame.threatPercentage.background:SetVertexColor(r,g,b); 49 | 50 | --Swapping healthbar's highlight so that it won't show underneath the powerbar's background. 51 | if unitFrame.powerbar:IsShown() then 52 | if CFG.Portrait then 53 | unitFrame.healthbar.highlight:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\highlights\\healthbar_2"); 54 | else 55 | unitFrame.healthbar.highlight:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\highlights\\healthbar_3"); 56 | end 57 | else 58 | unitFrame.healthbar.highlight:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\highlights\\healthbar"); 59 | end 60 | 61 | -- Updating threat percentage 62 | if CFG.ThreatPercentage and ThreatPercentageOfLead > 0 then 63 | if ThreatPercentageOfLead > 999 then 64 | ThreatPercentageOfLead = 999; 65 | end 66 | 67 | unitFrame.threatPercentage.value:SetText(math.floor(ThreatPercentageOfLead) .. "%"); 68 | end 69 | 70 | unitFrame.threatPercentage:SetShown(CFG.ThreatPercentage and ThreatPercentageOfLead and ThreatPercentageOfLead > 0); 71 | 72 | -- Toggle for highlights 73 | local ShowHighlight = CFG.ThreatHighlight 74 | and (ThreatPercentageOfLead > CFG.ThreatWarningThreshold -- Above threat threshold 75 | or (UnitIsUnit(unit.."target", "player") and UnitIsEnemy(unit, "player") and (UnitIsPlayer(unit) or UnitIsOtherPlayersPet)) -- Enemy player or pet targeting you 76 | or (status == 3 or status == 2) -- Tanking 77 | or GetPartyAssignment("MainTank", "player", true) and func:OtherTank(unit) -- Other tank tanking 78 | ); 79 | 80 | -- Toggling frames: 81 | unitFrame.portrait.highlight:SetShown(ShowHighlight and unitFrame.portrait:IsShown()); 82 | unitFrame.healthbar.highlight:SetShown(ShowHighlight); 83 | unitFrame.level.highlight:SetShown(ShowHighlight and unitFrame.level:IsShown()); 84 | unitFrame.powerbar.highlight:SetShown(ShowHighlight and unitFrame.powerbar:IsShown()); 85 | unitFrame.threatPercentage.highlight:SetShown(false); 86 | end 87 | end 88 | end -------------------------------------------------------------------------------- /ClassicPlatesPlus/castbar.lua: -------------------------------------------------------------------------------- 1 | ---------------------------------------- 2 | -- CORE 3 | ---------------------------------------- 4 | local myAddon, core = ...; 5 | local func = core.func; 6 | local data = core.data; 7 | 8 | ---------------------------------------- 9 | -- Castbar start 10 | ---------------------------------------- 11 | function func:Castbar_Start(event, unit) 12 | if unit then 13 | local nameplate = C_NamePlate.GetNamePlateForUnit(unit); 14 | 15 | if nameplate then 16 | local castbar = nameplate.unitFrame.castbar; 17 | local text, icon, startTimeMS, endTimeMS, isTradeSkill, notInterruptible, minValue, maxValue, progressReverser; 18 | local r,g,b; 19 | local test = false; 20 | local showIcon = CFG_Account_ClassicPlatesPlus.Profiles[CFG_ClassicPlatesPlus.Profile].CastbarIconShow; 21 | 22 | castbar.animation:Stop(); 23 | 24 | if not showIcon then 25 | castbar.statusbar:SetPoint("center", castbar.border, "center", 0, 0); 26 | castbar.border:SetSize(128, 16); 27 | castbar.icon:Hide(); 28 | else 29 | castbar.statusbar:SetPoint("center", castbar.border, "center", 9, 0); 30 | castbar.border:SetSize(256, 64); 31 | castbar.icon:Show(); 32 | end 33 | 34 | if test then 35 | text = "This is a test castbar with a very long name"; 36 | icon = 135807; 37 | startTimeMS = GetTime() * 1000; 38 | endTimeMS = GetTime() * 1000 + 30; 39 | isTradeSkill = false; 40 | notInterruptible = false; 41 | progressReverser = -1; 42 | minValue = -(endTimeMS - startTimeMS) / 1000; 43 | maxValue = 0; 44 | if notInterruptible then 45 | r,g,b = data.colors.gray.r, data.colors.gray.g, data.colors.gray.b; 46 | else 47 | r,g,b = data.colors.orange.r, data.colors.orange.g, data.colors.orange.b; 48 | end 49 | elseif event then 50 | if event == "UNIT_SPELLCAST_START" then 51 | text, icon, startTimeMS, endTimeMS, isTradeSkill, _, notInterruptible = select(2, UnitCastingInfo(unit)); 52 | 53 | if text then 54 | minValue = -(endTimeMS - startTimeMS) / 1000; 55 | maxValue = 0; 56 | progressReverser = -1; 57 | if notInterruptible then 58 | r,g,b = data.colors.gray.r, data.colors.gray.g, data.colors.gray.b; 59 | else 60 | r,g,b = data.colors.orange.r, data.colors.orange.g, data.colors.orange.b; 61 | end 62 | end 63 | elseif event == "UNIT_SPELLCAST_CHANNEL_START" then 64 | text, icon, startTimeMS, endTimeMS, isTradeSkill, notInterruptible = select(2, UnitChannelInfo(unit)); 65 | 66 | if text then 67 | minValue = 0; 68 | maxValue = (endTimeMS - startTimeMS) / 1000; 69 | progressReverser = 1; 70 | if notInterruptible then 71 | r,g,b = data.colors.gray.r, data.colors.gray.g, data.colors.gray.b; 72 | else 73 | r,g,b = data.colors.purple.r, data.colors.purple.g, data.colors.purple.b; 74 | end 75 | end 76 | end 77 | else 78 | text, icon, startTimeMS, endTimeMS, isTradeSkill, _, notInterruptible = select(2, UnitCastingInfo(unit)); 79 | 80 | if text then 81 | minValue = -(endTimeMS - startTimeMS) / 1000; 82 | maxValue = 0; 83 | if notInterruptible then 84 | r,g,b = data.colors.gray.r, data.colors.gray.g, data.colors.gray.b; 85 | else 86 | r,g,b = data.colors.orange.r, data.colors.orange.g, data.colors.orange.b; 87 | end 88 | progressReverser = -1; 89 | else 90 | text, icon, startTimeMS, endTimeMS, isTradeSkill, notInterruptible = select(2, UnitChannelInfo(unit)); 91 | 92 | if text then 93 | minValue = 0; 94 | maxValue = (endTimeMS - startTimeMS) / 1000; 95 | if notInterruptible then 96 | r,g,b = data.colors.gray.r, data.colors.gray.g, data.colors.gray.b; 97 | else 98 | r,g,b = data.colors.purple.r, data.colors.purple.g, data.colors.purple.b; 99 | end 100 | progressReverser = 1; 101 | end 102 | end 103 | end 104 | 105 | if text then 106 | castbar.name:SetText(text); 107 | 108 | -- Trimming spell name 109 | local maxNameWidth = 135 110 | 111 | if castbar.name:GetStringWidth() > maxNameWidth then 112 | local spellName = castbar.name:GetText(); 113 | 114 | if castbar.name:GetStringWidth(spellName) > maxNameWidth then 115 | local spellNameLength = strlenutf8(string.sub(spellName, 2, #spellName - 1)); 116 | local trimmedLength = math.floor(maxNameWidth / castbar.name:GetStringWidth(spellName) * spellNameLength); 117 | 118 | spellName = func:utf8sub(spellName, 1, trimmedLength); 119 | castbar.name:SetText(spellName .. "..."); 120 | end 121 | end 122 | 123 | castbar.name:SetTextColor(1,1,1); 124 | castbar.icon:SetTexture(icon); 125 | castbar.statusbar:SetMinMaxValues(minValue, maxValue); 126 | castbar.statusbar:SetStatusBarColor(r,g,b); 127 | castbar.border:SetTexture( 128 | (not showIcon) and "Interface\\addons\\ClassicPlatesPlus\\media\\borders\\healthbar" 129 | or notInterruptible and "Interface\\addons\\ClassicPlatesPlus\\media\\castbar\\castbarUI2" 130 | or "Interface\\addons\\ClassicPlatesPlus\\media\\castbar\\castbar" 131 | ); 132 | castbar.border:SetVertexColor(0.75, 0.75, 0.75); 133 | if not showIcon then 134 | castbar:SetSize(128, 16); 135 | else 136 | castbar:SetSize(140, notInterruptible and 28 or 22); 137 | end 138 | castbar:SetSize((not showIcon) and 128 or 140, (not showIcon) and 16 or notInterruptible and 28 or 22); 139 | 140 | local timeElapsed = 0; 141 | castbar:SetScript("OnUpdate", function(self, elapsed) 142 | timeElapsed = timeElapsed + elapsed; 143 | if not castbar.animation:IsPlaying() then 144 | castbar.statusbar:SetValue(progressReverser * ((endTimeMS / 1000) - GetTime())); 145 | end 146 | 147 | if timeElapsed > 0.1 then 148 | local value = (endTimeMS / 1000) - GetTime(); 149 | timeElapsed = 0; 150 | castbar.countdown:SetText(func:formatTime(value)); 151 | end 152 | end); 153 | 154 | castbar.countdown:Show(); 155 | castbar:SetShown(CFG_Account_ClassicPlatesPlus.Profiles[CFG_ClassicPlatesPlus.Profile].CastbarShow and not isTradeSkill); 156 | end 157 | end 158 | end 159 | end 160 | 161 | ---------------------------------------- 162 | -- Castbar end 163 | ---------------------------------------- 164 | function func:Castbar_End(event, unit) 165 | if unit then 166 | local nameplate = C_NamePlate.GetNamePlateForUnit(unit); 167 | 168 | if nameplate then 169 | local castbar = nameplate.unitFrame.castbar; 170 | local channelName = UnitChannelInfo(unit); 171 | 172 | if event == "UNIT_SPELLCAST_FAILED" 173 | or event == "UNIT_SPELLCAST_FAILED_QUIET" 174 | or event == "UNIT_SPELLCAST_INTERRUPTED" then 175 | castbar.statusbar:SetStatusBarColor(data.colors.red.r, data.colors.red.g, data.colors.red.b); 176 | castbar.border:SetVertexColor(data.colors.red.r, data.colors.red.g, data.colors.red.b); 177 | castbar.name:SetTextColor(data.colors.orange.r, data.colors.orange.g, data.colors.orange.b); 178 | end 179 | 180 | if event == "UNIT_SPELLCAST_SUCCEEDED" and not channelName then 181 | castbar.statusbar:SetStatusBarColor(data.colors.green.r, data.colors.green.g, data.colors.green.b); 182 | castbar.border:SetVertexColor(data.colors.green.r, data.colors.green.g, data.colors.green.b); 183 | castbar.name:SetTextColor(data.colors.yellow.r, data.colors.yellow.g, data.colors.yellow.b); 184 | end 185 | 186 | if event == "UNIT_SPELLCAST_STOP" 187 | or event == "UNIT_SPELLCAST_CHANNEL_STOP" then 188 | castbar.animation:Stop(); 189 | castbar.animation:Play(); 190 | castbar.countdown:Hide(); 191 | end 192 | 193 | castbar.statusbar:SetValue(0); 194 | end 195 | end 196 | end -------------------------------------------------------------------------------- /ClassicPlatesPlus/init.lua: -------------------------------------------------------------------------------- 1 | ---------------------------------------- 2 | -- CORE 3 | ---------------------------------------- 4 | local myAddon, core = ...; 5 | local func = core.func; 6 | local data = core.data; 7 | 8 | ---------------------------------------- 9 | -- HANDLING EVENTS 10 | ---------------------------------------- 11 | function core:init(event, ...) 12 | local arg = ...; 13 | 14 | if event == "VARIABLES_LOADED" then 15 | func:CVars(event); 16 | end 17 | 18 | if event == "ADDON_LOADED" then 19 | if arg == myAddon then 20 | func:Load_Settings(); 21 | end 22 | end 23 | 24 | if event == "CVAR_UPDATE" then 25 | local cvarName, value = ...; 26 | 27 | func:Update_CVars(cvarName, value); 28 | end 29 | 30 | if event == "UI_SCALE_CHANGED" 31 | or event == "DISPLAY_SIZE_CHANGED" then 32 | func:ResizeNameplates(); 33 | end 34 | 35 | if event == "MODIFIER_STATE_CHANGED" then 36 | local nameplate = data.nameplate; 37 | local key, down = ...; 38 | 39 | if down == 0 then 40 | nameplate.isMoving = false; 41 | end 42 | 43 | nameplate:EnableMouse((key == "LCTRL" or key == "RCTRL") and down == 1); 44 | end 45 | 46 | if event == "PLAYER_ENTERING_WORLD" then 47 | func:ClassBarHeight(); 48 | func:Update_Roster(); 49 | func:PersonalNameplateCreate(); 50 | if not data.isRetail then 51 | func:PersonalNameplateAdd(); 52 | end 53 | end 54 | 55 | if event == "PLAYER_LOGOUT" then 56 | func:CVars(event); 57 | end 58 | 59 | if event == "PLAYER_TARGET_CHANGED" then 60 | local CFG = CFG_Account_ClassicPlatesPlus.Profiles[CFG_ClassicPlatesPlus.Profile]; 61 | 62 | func:myTarget(); 63 | func:Update_Colors(); 64 | func:Update_Auras("target"); 65 | end 66 | 67 | if event == "PLAYER_FLAGS_CHANGED" then 68 | func:Update_healthbar(arg); 69 | end 70 | 71 | if event == "PLAYER_GUILD_UPDATE" then 72 | if arg and string.match(arg, "nameplate") then 73 | func:Update_Guild(arg); 74 | func:Update_FellowshipBadge(arg); 75 | end 76 | end 77 | 78 | if event == "PLAYER_DEAD" 79 | or event == "PLAYER_UNGHOST" 80 | or event == "PLAYER_ALIVE" then 81 | if not data.isRetail then 82 | func:ToggleNameplatePersonal(event); 83 | end 84 | end 85 | 86 | if event == "PLAYER_REGEN_ENABLED" 87 | or event == "PLAYER_REGEN_DISABLED" then 88 | if not data.isRetail then 89 | func:ToggleNameplatePersonal(event); 90 | end 91 | end 92 | 93 | if event == "PLAYER_SPECIALIZATION_CHANGED" then 94 | if arg == "player" then 95 | func:PersonalNameplateAdd(); 96 | end 97 | end 98 | 99 | if event == "PLAYER_TOTEM_UPDATE" then 100 | func:Update_ClassPower(); 101 | end 102 | 103 | if event == "UPDATE_SHAPESHIFT_FORM" then 104 | func:ClassBarHeight(); 105 | func:PersonalNameplateAdd(); 106 | if UnitExists("target") then 107 | local nameplate = C_NamePlate.GetNamePlateForUnit("target"); 108 | 109 | if nameplate then 110 | func:PositionAuras(nameplate.unitFrame); 111 | end 112 | end 113 | end 114 | 115 | if event == "TALENT_GROUP_ROLE_CHANGED" then 116 | local groupIndex, newRole = ...; 117 | func:Update_Role(groupIndex, newRole); 118 | end 119 | 120 | if event == "NAME_PLATE_CREATED" then 121 | func:Nameplate_Created(arg); 122 | end 123 | 124 | if event == "NAME_PLATE_UNIT_ADDED" then 125 | func:Nameplate_Added(arg); 126 | end 127 | 128 | if event == "NAME_PLATE_UNIT_REMOVED" then 129 | func:Nameplate_Removed(arg); 130 | end 131 | 132 | if event == "UNIT_CLASSIFICATION_CHANGED" then 133 | func:Update_Classification(arg); 134 | end 135 | 136 | if event == "UNIT_HEALTH" then 137 | func:Update_Health(arg); 138 | end 139 | 140 | if event == "UNIT_MAXHEALTH" then 141 | func:Update_Health(arg); 142 | func:Update_healthbar(arg); 143 | end 144 | 145 | if event == 'UNIT_HEAL_PREDICTION' then 146 | func:PredictHeal(arg); 147 | end 148 | 149 | if event == "UNIT_POWER_FREQUENT" then 150 | func:Update_Power(arg); 151 | func:Update_ClassPower(arg); 152 | end 153 | 154 | if event == "UNIT_MAXPOWER" then 155 | func:Update_Power(arg); 156 | end 157 | 158 | if event == "UNIT_AURA" then 159 | func:Update_Auras(arg); 160 | if arg == "player" then 161 | func:Update_ExtraBar(); 162 | end 163 | end 164 | 165 | if event == "UNIT_THREAT_LIST_UPDATE" then 166 | func:Update_Threat(arg) 167 | end 168 | 169 | if event == "UNIT_THREAT_SITUATION_UPDATE" then 170 | func:Update_Threat(arg); 171 | end 172 | 173 | if event == "UNIT_FACTION" then 174 | func:Update_healthbar(arg); 175 | func:Update_Portrait(arg); 176 | func:Update_Name(arg); 177 | func:Update_Colors(arg); 178 | func:Nameplate_Added(arg); 179 | func:Update_PVP_Flag(arg); 180 | end 181 | 182 | if event == "UNIT_PORTRAIT_UPDATE" then 183 | func:Update_Portrait(arg); 184 | func:Update_Power(arg); 185 | end 186 | 187 | if event == "UNIT_NAME_UPDATE" then 188 | func:Update_Name(arg); 189 | end 190 | 191 | if event == "UNIT_LEVEL" then 192 | func:Update_Level(arg); 193 | end 194 | 195 | if event == "UNIT_COMBAT" then 196 | func:Update_Name(arg); 197 | func:Update_healthbar(arg); 198 | func:Update_Name(arg); 199 | func:Update_Colors(arg); 200 | end 201 | 202 | if event == "UNIT_SPELLCAST_START" 203 | or event == "UNIT_SPELLCAST_CHANNEL_START" 204 | or event == "UNIT_SPELLCAST_DELAYED" 205 | or event == "UNIT_SPELLCAST_CHANNEL_UPDATE" then 206 | func:Castbar_Start(event, arg); 207 | end 208 | 209 | if event == "UNIT_SPELLCAST_STOP" 210 | or event == "UNIT_SPELLCAST_CHANNEL_STOP" 211 | or event == "UNIT_SPELLCAST_FAILED" 212 | or event == "UNIT_SPELLCAST_FAILED_QUIET" 213 | or event == "UNIT_SPELLCAST_INTERRUPTED" 214 | or event == "UNIT_SPELLCAST_SUCCEEDED" then 215 | func:Castbar_End(event, arg); 216 | end 217 | 218 | if event == "GROUP_ROSTER_UPDATE" then 219 | func:Update_Roster(); 220 | func:Update_FellowshipBadge(); 221 | end 222 | 223 | if event == "RAID_TARGET_UPDATE" then 224 | func:RaidTargetIndex(); 225 | end 226 | 227 | if event == "QUEST_LOG_UPDATE" then 228 | func:Update_quests(); 229 | end 230 | 231 | if event == "FRIENDLIST_UPDATE" then 232 | func:Update_FellowshipBadge(); 233 | end 234 | end 235 | 236 | ---------------------------------------- 237 | -- Registering events 238 | ---------------------------------------- 239 | local events = CreateFrame("Frame"); 240 | 241 | -- Player 242 | events:RegisterEvent("ADDON_LOADED"); 243 | events:RegisterEvent("VARIABLES_LOADED"); 244 | events:RegisterEvent("NAME_PLATE_CREATED"); 245 | events:RegisterEvent("NAME_PLATE_UNIT_ADDED"); 246 | events:RegisterEvent("NAME_PLATE_UNIT_REMOVED"); 247 | events:RegisterEvent("PLAYER_ENTERING_WORLD"); 248 | events:RegisterEvent("PLAYER_LOGOUT"); 249 | events:RegisterEvent("PLAYER_FLAGS_CHANGED"); 250 | events:RegisterEvent("PLAYER_TARGET_CHANGED"); 251 | events:RegisterEvent("PLAYER_REGEN_ENABLED"); 252 | events:RegisterEvent("PLAYER_REGEN_DISABLED"); 253 | events:RegisterEvent("PLAYER_GUILD_UPDATE"); 254 | events:RegisterEvent("PLAYER_DEAD"); 255 | events:RegisterEvent("PLAYER_ALIVE"); 256 | events:RegisterEvent("PLAYER_UNGHOST"); 257 | if data.isRetail then 258 | events:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED"); 259 | end 260 | events:RegisterEvent("QUEST_LOG_UPDATE"); 261 | events:RegisterEvent("PLAYER_TOTEM_UPDATE"); 262 | 263 | -- Unit 264 | events:RegisterEvent("UNIT_NAME_UPDATE"); 265 | events:RegisterEvent("UNIT_PORTRAIT_UPDATE"); 266 | events:RegisterEvent("UNIT_HEALTH"); 267 | events:RegisterEvent("UNIT_MAXHEALTH"); 268 | events:RegisterEvent("UNIT_HEAL_PREDICTION"); 269 | events:RegisterEvent("UNIT_POWER_FREQUENT"); 270 | events:RegisterEvent("UNIT_MAXPOWER"); 271 | events:RegisterEvent("UNIT_AURA"); 272 | events:RegisterEvent("UNIT_LEVEL"); 273 | events:RegisterEvent("UNIT_CLASSIFICATION_CHANGED"); 274 | events:RegisterEvent("UNIT_FACTION"); 275 | events:RegisterEvent("UNIT_COMBAT"); 276 | events:RegisterEvent("UNIT_THREAT_LIST_UPDATE"); 277 | events:RegisterEvent("UNIT_THREAT_SITUATION_UPDATE"); 278 | 279 | -- Cast events 280 | events:RegisterEvent("UNIT_SPELLCAST_START"); 281 | events:RegisterEvent("UNIT_SPELLCAST_CHANNEL_START"); 282 | events:RegisterEvent("UNIT_SPELLCAST_DELAYED"); 283 | events:RegisterEvent("UNIT_SPELLCAST_CHANNEL_UPDATE"); 284 | events:RegisterEvent("UNIT_SPELLCAST_STOP"); 285 | events:RegisterEvent("UNIT_SPELLCAST_CHANNEL_STOP"); 286 | events:RegisterEvent("UNIT_SPELLCAST_FAILED"); 287 | events:RegisterEvent("UNIT_SPELLCAST_FAILED_QUIET"); 288 | events:RegisterEvent("UNIT_SPELLCAST_INTERRUPTED"); 289 | events:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED"); 290 | 291 | -- Nameplate's base 292 | events:RegisterEvent("UI_SCALE_CHANGED"); 293 | events:RegisterEvent("DISPLAY_SIZE_CHANGED"); 294 | 295 | -- Rest 296 | events:RegisterEvent("UPDATE_SHAPESHIFT_FORM"); 297 | events:RegisterEvent("GROUP_ROSTER_UPDATE"); 298 | events:RegisterEvent("RAID_TARGET_UPDATE"); 299 | events:RegisterEvent("MODIFIER_STATE_CHANGED"); 300 | events:RegisterEvent("CVAR_UPDATE"); 301 | events:RegisterEvent("FRIENDLIST_UPDATE"); 302 | 303 | -- Scripts 304 | events:SetScript("OnEvent", core.init); -------------------------------------------------------------------------------- /ClassicPlatesPlus/nameplate_added.lua: -------------------------------------------------------------------------------- 1 | ---------------------------------------- 2 | -- Core 3 | ---------------------------------------- 4 | local myAddon, core = ...; 5 | local func = core.func; 6 | local data = core.data; 7 | 8 | ---------------------------------------- 9 | -- Adding nameplate 10 | ---------------------------------------- 11 | function func:Nameplate_Added(unit, visuals) 12 | if unit then 13 | local CFG = CFG_Account_ClassicPlatesPlus.Profiles[CFG_ClassicPlatesPlus.Profile]; 14 | local nameplate = C_NamePlate.GetNamePlateForUnit(unit, false); 15 | 16 | if nameplate then 17 | nameplate.UnitFrame:Hide(); 18 | nameplate.UnitFrame:UnregisterAllEvents(); 19 | 20 | if UnitIsUnit(unit, "target") then 21 | func:PositionAuras(nameplate.unitFrame); 22 | end 23 | 24 | if UnitIsUnit(unit, "player") then 25 | func:PersonalNameplateAdd(); 26 | else 27 | local unitFrame = nameplate.unitFrame; 28 | 29 | -- Level 30 | unitFrame.level.background:SetColorTexture( 31 | data.colors.border.r - 0.35, 32 | data.colors.border.g - 0.35, 33 | data.colors.border.b - 0.35 34 | ); 35 | unitFrame.level:SetShown(CFG.ShowLevel); 36 | 37 | -- Name and Guild 38 | unitFrame.name:SetFontObject(CFG.NameAndGuildOutline and "GameFontNormalOutline" or "GameFontNormal"); 39 | unitFrame.guild:SetFontObject(CFG.NameAndGuildOutline and "GameFontNormalOutline" or "GameFontNormal"); 40 | unitFrame.name:SetScale(CFG.LargeName and 0.95 or 0.75); 41 | unitFrame.guild:SetScale(CFG.LargeGuildName and 0.95 or 0.75); 42 | 43 | -- Threat percentage 44 | unitFrame.threatPercentage:ClearAllPoints(); 45 | 46 | -- Classification 47 | unitFrame.classification:ClearAllPoints(); 48 | 49 | -- Faction 50 | unitFrame.fellowshipBadge:ClearAllPoints(); 51 | 52 | -- Health values: Main 53 | unitFrame.healthMain:SetTextColor( 54 | CFG.HealthFontColor.r, 55 | CFG.HealthFontColor.g, 56 | CFG.HealthFontColor.b, 57 | CFG.HealthFontColor.a 58 | ); 59 | if CFG.LargeMainValue then 60 | unitFrame.healthMain:SetFontObject("GameFontNormalLargeOutline"); 61 | unitFrame.healthMain:SetScale(0.85); 62 | else 63 | unitFrame.healthMain:SetFontObject("GameFontNormalOutline"); 64 | unitFrame.healthMain:SetScale(0.8); 65 | end 66 | unitFrame.healthMain:ClearAllPoints(); 67 | unitFrame.healthSecondary:ClearAllPoints(); 68 | 69 | -- Health values: Left side 70 | unitFrame.healthSecondary:SetTextColor( 71 | CFG.HealthFontColor.r, 72 | CFG.HealthFontColor.g, 73 | CFG.HealthFontColor.b, 74 | CFG.HealthFontColor.a 75 | ); 76 | 77 | -- Castbar 78 | unitFrame.castbar:SetScale(CFG.CastbarScale); 79 | unitFrame.castbar:ClearAllPoints(); 80 | 81 | -- Raid target 82 | unitFrame.raidTarget.icon:ClearAllPoints(); 83 | 84 | -- Auras counters 85 | unitFrame.buffsCounter:SetScale(CFG.AurasScale - 0.2); 86 | unitFrame.debuffsCounter:SetScale(CFG.AurasScale - 0.2); 87 | 88 | -- powerbar 89 | unitFrame.powerbar:ClearAllPoints(); 90 | local powerbarToggle = CFG.Powerbar and UnitPower(unit) and UnitPowerMax(unit) > 0; 91 | 92 | -- Name 93 | unitFrame.name:ClearAllPoints(); 94 | unitFrame.name:SetPoint("top", nameplate.UnitFrame.name, "top"); -- Anchor frame 95 | 96 | -- Quest 97 | unitFrame.quest:ClearAllPoints(); 98 | 99 | -- Class power 100 | unitFrame.classPower:SetHeight(data.classBarHeight); 101 | unitFrame.classPower:SetScale(CFG.SpecialPowerScale); 102 | 103 | -- Health Value Secondary 104 | unitFrame.healthSecondary:SetJustifyH("left"); 105 | 106 | -- Classification 107 | unitFrame.classification:SetTexCoord(0, 1, 0, 1) -- Undo Fliping horizontally 108 | 109 | -- These frames depend on whether portraits and level are enabled or not! 110 | if CFG.Portrait then 111 | unitFrame.classification:SetParent(unitFrame.portrait); 112 | unitFrame.classification:SetSize(48,48); 113 | 114 | if CFG.ShowLevel then 115 | unitFrame.threatPercentage:SetPoint("bottom", unitFrame.healthbar, "top", 0, -1.5); 116 | unitFrame.powerbar:SetPoint("top", unitFrame.healthbar, "bottom", 0, -1); 117 | unitFrame.healthMain:SetPoint("center", unitFrame.healthbar, "center"); 118 | unitFrame.healthSecondary:SetPoint("left", unitFrame.healthbar, "left", 4, 0); 119 | unitFrame.classification:SetPoint("center", unitFrame.portrait.texture, "center", -5, -2); 120 | unitFrame.quest:SetPoint("left", unitFrame.level, "right", -14, 1); 121 | else 122 | unitFrame.threatPercentage:SetPoint("bottom", unitFrame.healthbar, "top", -9, -1.5); 123 | unitFrame.powerbar:SetPoint("top", unitFrame.healthbar, "bottom", -6.33, -1); 124 | unitFrame.healthMain:SetPoint("center", unitFrame.healthbar, "center", -9, 0); 125 | unitFrame.healthSecondary:SetPoint("right", unitFrame.healthbar, "right", -4, 0); 126 | unitFrame.healthSecondary:SetJustifyH("right"); 127 | unitFrame.classification:SetPoint("center", unitFrame.portrait.texture, "center", -5, -2); 128 | unitFrame.quest:SetPoint("left", unitFrame.healthbar, "right", -6, 1); 129 | end 130 | else 131 | unitFrame.classification:SetParent(unitFrame.parent); 132 | unitFrame.classification:SetSize(32,32); 133 | 134 | if CFG.ShowLevel then 135 | unitFrame.threatPercentage:SetPoint("bottom", unitFrame.healthbar, "top", 9, -1.5); 136 | unitFrame.powerbar:SetPoint("top", unitFrame.healthbar, "bottom", 6.33, -1); 137 | unitFrame.healthMain:SetPoint("center", unitFrame.healthbar, "center", 9, 0); 138 | unitFrame.healthSecondary:SetPoint("left", unitFrame.healthbar, "left", 4, 0); 139 | unitFrame.classification:SetPoint("center", unitFrame.level.border, "center", 7, 0); 140 | unitFrame.quest:SetPoint("left", unitFrame.level, "right", -14, 1); 141 | else 142 | unitFrame.threatPercentage:SetPoint("bottom", unitFrame.healthbar, "top", 0, -1.5); 143 | unitFrame.powerbar:SetPoint("top", unitFrame.healthbar, "bottom", 0, -1); 144 | unitFrame.healthMain:SetPoint("center", unitFrame.healthbar, "center", 0, 0); 145 | unitFrame.healthSecondary:SetPoint("left", unitFrame.healthbar, "left", 4, 0); 146 | unitFrame.classification:SetPoint("left", unitFrame.healthbar, "left", -14, 0); 147 | unitFrame.classification:SetTexCoord(1, 0, 0, 1) -- Fliping horizontally 148 | unitFrame.quest:SetPoint("left", unitFrame.healthbar, "right", -6, 1); 149 | end 150 | end 151 | 152 | local widgetToggle = true; 153 | if data.isRetail then 154 | local widgetOnly = UnitNameplateShowsWidgetsOnly(unit); 155 | local widget = nameplate.UnitFrame.WidgetContainer; 156 | 157 | if widget then 158 | if widgetOnly then 159 | widget:SetParent(nameplate); 160 | widget:ClearAllPoints(); 161 | widget:SetPoint("center"); 162 | widgetToggle = UnitExists("target") 163 | else 164 | widget:SetParent(unitFrame); 165 | widget:ClearAllPoints(); 166 | widget:SetPoint("top", unitFrame.healthbar, "bottom", 0, -12); 167 | end 168 | 169 | unitFrame.castbar:SetScript("OnShow", function() 170 | if widget then 171 | widget:ClearAllPoints(); 172 | widget:SetPoint("top", unitFrame.castbar, "bottom", 0, 16); 173 | end 174 | end); 175 | unitFrame.castbar:SetScript("OnHide", function() 176 | if widget then 177 | widget:ClearAllPoints(); 178 | widget:SetPoint("top", unitFrame.healthbar, "bottom", 0, -12); 179 | end 180 | end); 181 | end 182 | end 183 | 184 | -- Toggling frames 185 | unitFrame.portrait:SetShown(CFG.Portrait); 186 | unitFrame.powerbar:SetShown(CFG.Powerbar); 187 | unitFrame.castbar:Hide(); 188 | 189 | -- Assigning unit 190 | unitFrame.unit = unit; 191 | if not data.isClassic then 192 | unitFrame.inVehicle = UnitInVehicle(unit); 193 | end 194 | 195 | -- Updating everything 196 | func:Update_Name(unit); 197 | func:Update_Guild(unit); 198 | func:Update_Classification(unit); 199 | if CFG.Portrait then 200 | func:Update_Portrait(unit); 201 | end 202 | func:Update_FellowshipBadge(unit); 203 | func:Update_PVP_Flag(unit); 204 | func:Update_Level(unit); 205 | func:Update_Health(unit); 206 | func:Update_healthbar(unit); 207 | func:Update_Power(unit); 208 | if not data.isRetail then 209 | func:Update_ClassPower(unit); 210 | end 211 | func:Update_Threat(unit); 212 | if not visuals then 213 | func:Update_Auras(unit); 214 | end 215 | func:Update_Colors(unit); 216 | func:Castbar_Start(nil, unit); 217 | func:RaidTargetIndex(); 218 | func:PredictHeal(unit); 219 | func:Update_quests(unit); 220 | func:myTarget(true); 221 | 222 | if not nameplate.UnitFrame.name[myAddon .. "_anchored"] then 223 | local isAnchoringName = false; 224 | 225 | hooksecurefunc(nameplate.UnitFrame.name,"SetPoint", function(self) 226 | if not self:IsProtected() then 227 | self[myAddon .. "_anchored"] = true; 228 | 229 | if isAnchoringName then 230 | return; 231 | end 232 | 233 | isAnchoringName = true; 234 | 235 | if self:GetParent() then 236 | local nameplate = self:GetParent():GetParent(); 237 | 238 | if nameplate then 239 | func:Update_NameAndGuildPositions(nameplate, true); 240 | end 241 | end 242 | 243 | isAnchoringName = false; 244 | end 245 | end); 246 | end 247 | 248 | local nameOnly = func:NamesOnly(unit); 249 | 250 | local exclude = CFG.NamesOnlyExcludeFriends and func:isFriend(unit) 251 | or CFG.NamesOnlyExcludeGuild and IsGuildMember(unit) 252 | or CFG.NamesOnlyExcludeParty and func:UnitInYourParty(unit) 253 | or CFG.NamesOnlyExcludeRaid and UnitPlayerOrPetInRaid(unit) 254 | 255 | local CastBar_offset = CFG.CastbarIconShow and 0 or not CFG.CastbarIconShow and -2; 256 | 257 | if nameOnly and not exclude then 258 | unitFrame.raidTarget.icon:SetPoint("right", unitFrame.name, "left", unitFrame.fellowshipBadge:IsShown() and -20 or -6, 0); 259 | unitFrame.raidTarget.icon:SetScale(0.7); 260 | unitFrame.castbar:SetPoint("top", unitFrame.guild:IsShown() and unitFrame.guild or unitFrame.name, "bottom", 0, -2 + CastBar_offset - CFG.CastbarPositionY); 261 | else 262 | unitFrame.raidTarget.icon:SetScale(1); 263 | 264 | if CFG.Portrait then 265 | unitFrame.raidTarget.icon:SetPoint("right", unitFrame.portrait.texture, "left", -6, 0); 266 | 267 | if CFG.ShowLevel then 268 | unitFrame.castbar:SetPoint("top", powerbarToggle and unitFrame.powerbar or unitFrame.healthbar.border, "bottom", 0, (powerbarToggle and 4 or -3) + CastBar_offset - CFG.CastbarPositionY); 269 | else 270 | unitFrame.castbar:SetPoint("top", powerbarToggle and unitFrame.powerbar or unitFrame.healthbar.border, "bottom", powerbarToggle and -2 or -9, (powerbarToggle and 4 or -3) + CastBar_offset - CFG.CastbarPositionY); 271 | end 272 | else 273 | unitFrame.raidTarget.icon:SetPoint("right", unitFrame.healthbar, "left", -6, 0); 274 | 275 | if CFG.ShowLevel then 276 | unitFrame.castbar:SetPoint("top", powerbarToggle and unitFrame.powerbar or unitFrame.healthbar.border, "bottom", powerbarToggle and 2.67 or 9, (powerbarToggle and 4 or 0) + CastBar_offset - CFG.CastbarPositionY); 277 | else 278 | unitFrame.castbar:SetPoint("top", powerbarToggle and unitFrame.powerbar or unitFrame.healthbar.border, "bottom", 0, (powerbarToggle and 4 or 0) + CastBar_offset - CFG.CastbarPositionY); 279 | end 280 | end 281 | end 282 | 283 | -- Felloship Badge 284 | if nameOnly and not exclude or not CFG.Portrait then 285 | unitFrame.fellowshipBadge:SetPoint("right", unitFrame.name, "left", 1, 1); 286 | unitFrame.fellowshipBadge:SetScale(0.75); 287 | unitFrame.fellowshipBadge:SetIgnoreParentScale(true); 288 | else 289 | unitFrame.fellowshipBadge:SetPoint("center", unitFrame.portrait.texture, "center", -12, 4); 290 | unitFrame.fellowshipBadge:SetScale(1); 291 | unitFrame.fellowshipBadge:SetIgnoreParentScale(false); 292 | end 293 | 294 | -- Interact Icon 295 | func:InteractIcon(nameplate); 296 | 297 | -- Toggling Parent 298 | unitFrame.parent:SetShown(not nameOnly or exclude); 299 | 300 | -- Toggling nameplate 301 | unitFrame:SetShown(widgetToggle and not UnitIsGameObject(unit) and (data.isRetail and not UnitNameplateShowsWidgetsOnly(unit) or not data.isRetail)); 302 | end 303 | 304 | -- Hiding default nameplates 305 | nameplate.UnitFrame:SetScript("OnShow", function(self) 306 | self:Hide(); 307 | end); 308 | end 309 | end 310 | end -------------------------------------------------------------------------------- /ClassicPlatesPlus/nameplate_created.lua: -------------------------------------------------------------------------------- 1 | ---------------------------------------- 2 | -- Core 3 | ---------------------------------------- 4 | local _, core = ...; 5 | local func = core.func; 6 | local data = core.data; 7 | 8 | ---------------------------------------- 9 | -- Creating nameplate 10 | ---------------------------------------- 11 | function func:Nameplate_Created(nameplate) 12 | if nameplate then 13 | local unitFrame = CreateFrame("frame", nil, nameplate); 14 | unitFrame:SetFrameStrata("low"); 15 | nameplate.unitFrame = unitFrame; 16 | 17 | -- Main strata 18 | unitFrame:SetFrameStrata("low"); 19 | 20 | -------------------------------- 21 | -- Name & Guild 22 | -------------------------------- 23 | unitFrame.name = unitFrame:CreateFontString(nil, nil, "GameFontNormalOutline"); 24 | unitFrame.name:SetIgnoreParentScale(true); 25 | unitFrame.name:SetJustifyH("center"); 26 | 27 | unitFrame.guild = unitFrame:CreateFontString(nil, nil, "GameFontNormal"); 28 | unitFrame.guild:SetPoint("top", unitFrame.name, "bottom", 0, -1); 29 | unitFrame.guild:SetIgnoreParentScale(true); 30 | unitFrame.guild:SetJustifyH("center"); 31 | 32 | -------------------------------- 33 | -- Parent rest 34 | -------------------------------- 35 | unitFrame.parent = CreateFrame("frame", nil, unitFrame); 36 | 37 | -------------------------------- 38 | -- Highlights strata 39 | -------------------------------- 40 | unitFrame.highlightsStrata = CreateFrame("frame", nil, unitFrame.parent); 41 | unitFrame.highlightsStrata:SetFrameStrata("background"); 42 | 43 | -------------------------------- 44 | -- Healthbar 45 | -------------------------------- 46 | 47 | -- Statusbar 48 | unitFrame.healthbar = CreateFrame("StatusBar", nil, unitFrame.parent); 49 | unitFrame.healthbar:SetSize(112, 10); 50 | unitFrame.healthbar:SetStatusBarTexture("Interface\\TargetingFrame\\UI-StatusBar"); 51 | unitFrame.healthbar:SetFrameLevel(1); 52 | 53 | -- Border 54 | unitFrame.healthbar.border = unitFrame.parent:CreateTexture(); 55 | unitFrame.healthbar.border:SetPoint("center", unitFrame.healthbar, "center"); 56 | unitFrame.healthbar.border:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\borders\\healthbar"); 57 | unitFrame.healthbar.border:SetSize(128, 16); 58 | unitFrame.healthbar.border:SetDrawLayer("border", 1); 59 | 60 | -- Heal prediction 61 | unitFrame.healthbar.healPrediction = unitFrame.parent:CreateTexture(nil, "background"); 62 | unitFrame.healthbar.healPrediction:SetPoint("left", unitFrame.healthbar:GetStatusBarTexture(), "right"); 63 | unitFrame.healthbar.healPrediction:SetHeight(unitFrame.healthbar:GetHeight()); 64 | unitFrame.healthbar.healPrediction:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\highlights\\healPredict"); --("Interface\\TARGETINGFRAME\\UI-StatusBar"); 65 | unitFrame.healthbar.healPrediction:SetVertexColor(0, 0.5, 0.0, 0.5); 66 | unitFrame.healthbar.healPrediction:SetBlendMode("add"); 67 | unitFrame.healthbar.healPrediction:Hide(); 68 | 69 | -- Animation: Group Alpha 70 | unitFrame.healthbar.healPrediction.animationGroupAlpha = unitFrame.healthbar.healPrediction:CreateAnimationGroup(); 71 | unitFrame.healthbar.healPrediction.animation_Alpha_From = unitFrame.healthbar.healPrediction.animationGroupAlpha:CreateAnimation("Alpha"); 72 | unitFrame.healthbar.healPrediction.animation_Alpha_From:SetDuration(0.36); 73 | unitFrame.healthbar.healPrediction.animation_Alpha_From:SetFromAlpha(0.6); 74 | unitFrame.healthbar.healPrediction.animation_Alpha_From:SetToAlpha(0.2); 75 | unitFrame.healthbar.healPrediction.animationGroupAlpha:SetLooping("BOUNCE"); 76 | unitFrame.healthbar.healPrediction.animationGroupAlpha:Stop(); 77 | 78 | -- Animation: Group Scale 79 | unitFrame.healthbar.healPrediction.animationGroupScale = unitFrame.healthbar.healPrediction:CreateAnimationGroup(); 80 | unitFrame.healthbar.healPrediction.animation_Scale_From = unitFrame.healthbar.healPrediction.animationGroupScale:CreateAnimation("Scale"); 81 | unitFrame.healthbar.healPrediction.animation_Scale_From:SetDuration(0.36); 82 | unitFrame.healthbar.healPrediction.animation_Scale_From:SetScaleFrom(1, 1); 83 | unitFrame.healthbar.healPrediction.animation_Scale_From:SetScaleTo(0.25, 1); 84 | unitFrame.healthbar.healPrediction.animation_Scale_From:SetOrigin("left", 0, 0); 85 | unitFrame.healthbar.healPrediction.animationGroupScale:SetLooping("BOUNCE"); 86 | unitFrame.healthbar.healPrediction.animationGroupScale:Stop(); 87 | 88 | -- background 89 | unitFrame.healthbar.background = unitFrame.healthbar:CreateTexture(); 90 | unitFrame.healthbar.background:SetAllPoints(); 91 | unitFrame.healthbar.background:SetDrawLayer("background"); 92 | 93 | -- Spark 94 | unitFrame.healthbar.spark = unitFrame.parent:CreateTexture(); 95 | unitFrame.healthbar.spark:SetPoint("center", unitFrame.healthbar:GetStatusBarTexture(), "right"); 96 | unitFrame.healthbar.spark:SetSize(6, 12); 97 | unitFrame.healthbar.spark:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\highlights\\spark"); 98 | unitFrame.healthbar.spark:SetVertexColor(1, 0.82, 0, 0.7); 99 | unitFrame.healthbar.spark:SetBlendMode("add"); 100 | unitFrame.healthbar.spark:SetDrawLayer("artwork"); 101 | 102 | -- Highlight 103 | unitFrame.healthbar.highlight = unitFrame.highlightsStrata:CreateTexture(); 104 | unitFrame.healthbar.highlight:SetPoint("center", unitFrame.healthbar.border, "center"); 105 | unitFrame.healthbar.highlight:SetSize(128, 32); 106 | unitFrame.healthbar.highlight:SetDrawLayer("background", -1); 107 | 108 | -------------------------------- 109 | -- Health values 110 | -------------------------------- 111 | 112 | -- Main 113 | unitFrame.healthMain = unitFrame.parent:CreateFontString(nil, "overlay"); 114 | unitFrame.healthMain:SetJustifyH("center"); 115 | 116 | -- Secondary 117 | unitFrame.healthSecondary = unitFrame.parent:CreateFontString(nil, "overlay", "GameFontNormalOutline"); 118 | unitFrame.healthSecondary:SetScale(0.8); 119 | 120 | -------------------------------- 121 | -- Powerbar 122 | -------------------------------- 123 | 124 | -- Parent 125 | unitFrame.powerbar = CreateFrame("Frame", nil, unitFrame.parent); 126 | unitFrame.powerbar:SetSize(100, 10); 127 | unitFrame.powerbar:SetFrameLevel(3); 128 | 129 | -- Statusbar 130 | unitFrame.powerbar.statusbar = CreateFrame("StatusBar", nil, unitFrame.powerbar); 131 | unitFrame.powerbar.statusbar:SetPoint("top"); 132 | unitFrame.powerbar.statusbar:SetSize(72, 5); 133 | unitFrame.powerbar.statusbar:SetStatusBarTexture("Interface\\TargetingFrame\\UI-StatusBar"); 134 | unitFrame.powerbar.statusbar:SetFrameLevel(1); 135 | 136 | -- Border 137 | unitFrame.powerbar.border = unitFrame.powerbar:CreateTexture(); 138 | unitFrame.powerbar.border:SetPoint("top", unitFrame.powerbar.statusbar, "top", 0, 5); 139 | unitFrame.powerbar.border:SetSize(128, 16); 140 | unitFrame.powerbar.border:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\borders\\powerbar"); 141 | unitFrame.powerbar.border:SetDrawLayer("border", 2); 142 | 143 | -- Background 144 | unitFrame.powerbar.background = unitFrame.powerbar.statusbar:CreateTexture(); 145 | unitFrame.powerbar.background:SetAllPoints(); 146 | unitFrame.powerbar.background:SetColorTexture(0.22, 0.22, 0.22, 0.85); 147 | unitFrame.powerbar.background:SetDrawLayer("background"); 148 | 149 | -- Spark 150 | unitFrame.powerbar.spark = unitFrame.powerbar:CreateTexture(); 151 | unitFrame.powerbar.spark:SetPoint("center", unitFrame.powerbar.statusbar:GetStatusBarTexture(), "right"); 152 | unitFrame.powerbar.spark:SetSize(8, 6); 153 | unitFrame.powerbar.spark:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\highlights\\spark"); 154 | unitFrame.powerbar.spark:SetVertexColor(1, 0.82, 0, 0.7); 155 | unitFrame.powerbar.spark:SetBlendMode("add"); 156 | unitFrame.powerbar.spark:SetDrawLayer("background"); 157 | 158 | -- Highlight 159 | unitFrame.powerbar.highlight = unitFrame.highlightsStrata:CreateTexture(); 160 | unitFrame.powerbar.highlight:SetPoint("center", unitFrame.powerbar.border, "center"); 161 | unitFrame.powerbar.highlight:SetSize(128, 16); 162 | unitFrame.powerbar.highlight:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\highlights\\powerbar"); 163 | unitFrame.powerbar.highlight:SetDrawLayer("background", -8); 164 | 165 | -------------------------------- 166 | -- Class Power 167 | -------------------------------- 168 | unitFrame.classPower = CreateFrame("frame", nil, unitFrame.parent); 169 | unitFrame.classPower:SetPoint("bottom", unitFrame.name, "top", 0, 2); 170 | unitFrame.classPower:SetSize(14, 14); 171 | 172 | -------------------------------- 173 | -- Portrait 174 | -------------------------------- 175 | 176 | -- Parent 177 | unitFrame.portrait = CreateFrame("Frame", nil, unitFrame.parent); 178 | 179 | -- Portrait 180 | unitFrame.portrait.texture = unitFrame.portrait:CreateTexture(); 181 | unitFrame.portrait.texture:SetPoint("right", unitFrame.healthbar, "left"); 182 | unitFrame.portrait.texture:SetSize(18, 18); 183 | unitFrame.portrait.texture:SetDrawLayer("background"); 184 | 185 | -- Border 186 | unitFrame.portrait.border = unitFrame.portrait:CreateTexture(); 187 | unitFrame.portrait.border:SetPoint("center", unitFrame.portrait.texture, "center"); 188 | unitFrame.portrait.border:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\borders\\portrait"); 189 | unitFrame.portrait.border:SetSize(32, 32); 190 | unitFrame.portrait.border:SetDrawLayer("border", 2); 191 | 192 | -- Highlight 193 | unitFrame.portrait.highlight = unitFrame.highlightsStrata:CreateTexture(); 194 | unitFrame.portrait.highlight:SetPoint("center", unitFrame.portrait.border, "center"); 195 | unitFrame.portrait.highlight:SetSize(32, 32); 196 | unitFrame.portrait.highlight:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\highlights\\portrait"); 197 | unitFrame.portrait.highlight:SetDrawLayer("background", -8); 198 | 199 | -- Mask 200 | unitFrame.portrait.mask = unitFrame.portrait:CreateMaskTexture(); 201 | unitFrame.portrait.mask:SetAllPoints(unitFrame.portrait.texture); 202 | unitFrame.portrait.mask:SetTexture("Interface/CHARACTERFRAME/TempPortraitAlphaMask", "CLAMPTOBLACKADDITIVE", "CLAMPTOBLACKADDITIVE"); 203 | 204 | -- Countdown 205 | unitFrame.portrait.countdown = unitFrame.portrait:CreateFontString(nil, nil, "GameFontNormalOutline"); 206 | unitFrame.portrait.countdown:SetPoint("center", unitFrame.portrait.texture, "center"); 207 | unitFrame.portrait.countdown:SetScale(0.65); 208 | unitFrame.portrait.countdown:SetJustifyH("center"); 209 | 210 | -------------------------------- 211 | -- Level 212 | -------------------------------- 213 | 214 | -- Parent 215 | unitFrame.level = CreateFrame("frame", nil, unitFrame.parent); 216 | unitFrame.level:SetSize(32, 32); 217 | 218 | -- Value 219 | unitFrame.level.value = unitFrame.level:CreateFontString(nil, nil, "GameFontNormalSmall"); 220 | unitFrame.level.value:SetPoint("center"); 221 | unitFrame.level.value:SetScale(0.9); 222 | unitFrame.level.value:SetJustifyH("center"); 223 | 224 | -- Border 225 | unitFrame.level.border = unitFrame.level:CreateTexture(); 226 | unitFrame.level.border:SetPoint("left", unitFrame.healthbar, "right", -6, 0); 227 | unitFrame.level.border:SetSize(32, 32); 228 | unitFrame.level.border:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\borders\\level"); 229 | 230 | -- level point 231 | unitFrame.level:SetPoint("center", unitFrame.level.border, "center"); 232 | 233 | -- High level skull icon 234 | unitFrame.level.highLevel = unitFrame.level:CreateTexture(); 235 | unitFrame.level.highLevel:SetPoint("center", unitFrame.level, "center"); 236 | unitFrame.level.highLevel:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\icons\\skull"); 237 | unitFrame.level.highLevel:SetSize(18, 18); 238 | unitFrame.level.highLevel:SetDrawLayer("artwork", 2); 239 | 240 | -- Background 241 | unitFrame.level.background = unitFrame.level:CreateTexture(); 242 | unitFrame.level.background:SetPoint("center", unitFrame.level.border, "center"); 243 | unitFrame.level.background:SetSize(18, 10); 244 | unitFrame.level.background:SetDrawLayer("background", 0); 245 | 246 | -- Highlight 247 | unitFrame.level.highlight = unitFrame.highlightsStrata:CreateTexture(); 248 | unitFrame.level.highlight:SetPoint("center", unitFrame.level.border, "center"); 249 | unitFrame.level.highlight:SetSize(32, 32); 250 | unitFrame.level.highlight:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\highlights\\level"); 251 | unitFrame.level.highlight:SetDrawLayer("background", -1); 252 | 253 | -------------------------------- 254 | -- Quest 255 | -------------------------------- 256 | unitFrame.quest = unitFrame.parent:CreateTexture(); 257 | unitFrame.quest:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\icons\\quest"); 258 | unitFrame.quest:SetVertexColor(1, 0.77, 0); 259 | unitFrame.quest:SetSize(32, 32); 260 | unitFrame.quest:Hide(); 261 | 262 | -------------------------------- 263 | -- Threat percentage 264 | -------------------------------- 265 | 266 | -- Parent 267 | unitFrame.threatPercentage = CreateFrame("Frame", nil, unitFrame.parent); 268 | unitFrame.threatPercentage:SetSize(64,16); 269 | unitFrame.threatPercentage:SetFrameLevel(3); 270 | unitFrame.threatPercentage:SetScript("OnShow", function() 271 | func:Update_NameAndGuildPositions(nameplate); 272 | end); 273 | unitFrame.threatPercentage:SetScript("OnHide", function() 274 | func:Update_NameAndGuildPositions(nameplate); 275 | end); 276 | 277 | -- Value 278 | unitFrame.threatPercentage.value = unitFrame.threatPercentage:CreateFontString(nil, nil, "GameFontNormalOutline"); 279 | unitFrame.threatPercentage.value:SetJustifyH("center"); 280 | unitFrame.threatPercentage.value:SetScale(0.7); 281 | 282 | -- Border 283 | unitFrame.threatPercentage.border = unitFrame.threatPercentage:CreateTexture(); 284 | unitFrame.threatPercentage.border:SetPoint("center") 285 | unitFrame.threatPercentage.border:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\borders\\threat_new"); 286 | unitFrame.threatPercentage.border:SetSize(64, 16); 287 | unitFrame.threatPercentage.border:SetVertexColor(data.colors.border.r, data.colors.border.g, data.colors.border.b); 288 | unitFrame.threatPercentage.border:SetDrawLayer("border", 2); 289 | 290 | -- Background 291 | unitFrame.threatPercentage.background = unitFrame.threatPercentage:CreateTexture(); 292 | unitFrame.threatPercentage.background:SetPoint("center", unitFrame.threatPercentage.border, "center"); 293 | unitFrame.threatPercentage.background:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\borders\\threatBG_new"); 294 | unitFrame.threatPercentage.background:SetSize(64, 16); 295 | unitFrame.threatPercentage.background:SetDrawLayer("background", 1); 296 | 297 | -- Value point 298 | unitFrame.threatPercentage.value:SetPoint("center", unitFrame.threatPercentage.background, "center", 0, -0.5); 299 | 300 | -- Highlight 301 | unitFrame.threatPercentage.highlight = unitFrame.highlightsStrata:CreateTexture(); 302 | unitFrame.threatPercentage.highlight:SetPoint("center", unitFrame.threatPercentage.border, "center"); 303 | unitFrame.threatPercentage.highlight:SetSize(64, 32); 304 | unitFrame.threatPercentage.highlight:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\highlights\\threat_new"); 305 | unitFrame.threatPercentage.highlight:SetDrawLayer("background", -1); 306 | unitFrame.threatPercentage.highlight:Hide(); 307 | 308 | -------------------------------- 309 | -- Classification 310 | -------------------------------- 311 | unitFrame.classification = unitFrame.parent:CreateTexture(); 312 | unitFrame.classification:SetDrawLayer("artwork", 1); 313 | 314 | -------------------------------- 315 | -- PVP Flag 316 | -------------------------------- 317 | unitFrame.pvp_flag = unitFrame:CreateTexture(); 318 | unitFrame.pvp_flag:SetSize(22, 22); 319 | 320 | -------------------------------- 321 | -- Faction 322 | -------------------------------- 323 | unitFrame.fellowshipBadge = CreateFrame("frame", nil, unitFrame); 324 | unitFrame.fellowshipBadge:SetSize(22,22); 325 | unitFrame.fellowshipBadge:SetFrameLevel(4); 326 | 327 | unitFrame.fellowshipBadge.icon = unitFrame.fellowshipBadge:CreateTexture(); 328 | unitFrame.fellowshipBadge.icon:SetAllPoints(); 329 | unitFrame.fellowshipBadge.icon:SetDrawLayer("artwork", 3); 330 | 331 | unitFrame.fellowshipBadge.badge = unitFrame.fellowshipBadge:CreateTexture(); 332 | unitFrame.fellowshipBadge.badge:SetAllPoints(); 333 | unitFrame.fellowshipBadge.badge:SetDrawLayer("artwork", 2); 334 | 335 | -------------------------------- 336 | -- Auras counter 337 | -------------------------------- 338 | unitFrame.buffsCounter = unitFrame:CreateFontString(nil, nil, "GameFontNormalOutline") 339 | unitFrame.buffsCounter:SetTextColor(0,1,0); 340 | unitFrame.debuffsCounter = unitFrame:CreateFontString(nil, nil, "GameFontNormalOutline") 341 | unitFrame.debuffsCounter:SetTextColor(1, 0.2, 0); 342 | 343 | -------------------------------- 344 | -- Class Bar Dummy 345 | -------------------------------- 346 | unitFrame.classPower = CreateFrame("frame", nil, unitFrame.parent); 347 | unitFrame.classPower:SetPoint("bottom", unitFrame.name, "top", 0, 4); 348 | unitFrame.classPower:SetWidth(10); 349 | unitFrame.classPower:SetIgnoreParentScale(true); 350 | 351 | -------------------------------- 352 | -- Castbar 353 | -------------------------------- 354 | 355 | -- Parent 356 | unitFrame.castbar = CreateFrame("frame", nil, unitFrame); 357 | unitFrame.castbar:SetIgnoreParentScale(true); 358 | 359 | -- Border 360 | unitFrame.castbar.border = unitFrame.castbar:CreateTexture(); 361 | unitFrame.castbar.border:SetPoint("center"); 362 | unitFrame.castbar.border:SetVertexColor(0.75, 0.75, 0.75); 363 | unitFrame.castbar.border:SetDrawLayer("artwork", 2); 364 | 365 | -- Icon mask 366 | unitFrame.castbar.mask = unitFrame.castbar:CreateMaskTexture(); 367 | unitFrame.castbar.mask:SetPoint("center", unitFrame.castbar.border, "center", -56, 0); 368 | unitFrame.castbar.mask:SetSize(32, 32); 369 | unitFrame.castbar.mask:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\castbar\\castbarMask"); 370 | 371 | -- Icon 372 | unitFrame.castbar.icon = unitFrame.castbar:CreateTexture(); 373 | unitFrame.castbar.icon:SetPoint("center", unitFrame.castbar.border, "center", -56, 0); 374 | unitFrame.castbar.icon:SetSize(18, 18); 375 | unitFrame.castbar.icon:AddMaskTexture(unitFrame.castbar.mask); 376 | unitFrame.castbar.icon:SetDrawLayer("artwork", 1); 377 | 378 | -- Status bar 379 | unitFrame.castbar.statusbar = CreateFrame("StatusBar", nil, unitFrame.castbar); 380 | unitFrame.castbar.statusbar:SetStatusBarTexture("Interface\\TargetingFrame\\UI-StatusBar"); 381 | unitFrame.castbar.statusbar:SetSize(112, 10); 382 | unitFrame.castbar.statusbar:SetStatusBarColor(data.colors.orange.r, data.colors.orange.g, data.colors.orange.b); 383 | unitFrame.castbar.statusbar:SetFrameLevel(1); 384 | 385 | -- Countdown 386 | unitFrame.castbar.countdown = unitFrame.castbar:CreateFontString(nil, nil, "GameFontNormalSmall"); 387 | unitFrame.castbar.countdown:SetPoint("right", unitFrame.castbar.statusbar, "right", -2, 0); 388 | unitFrame.castbar.countdown:SetTextColor(1,1,1); 389 | unitFrame.castbar.countdown:SetJustifyH("left"); 390 | unitFrame.castbar.countdown:SetScale(0.8); 391 | 392 | -- Name 393 | unitFrame.castbar.name = unitFrame.castbar:CreateFontString(nil, nil, "GameFontNormalSmall"); 394 | unitFrame.castbar.name:SetPoint("left", unitFrame.castbar.statusbar, "left", 5, 0); 395 | unitFrame.castbar.name:SetJustifyH("left"); 396 | unitFrame.castbar.name:SetScale(0.7); 397 | 398 | -- Spark 399 | unitFrame.castbar.spark = unitFrame.castbar:CreateTexture(); 400 | unitFrame.castbar.spark:SetPoint("center", unitFrame.castbar.statusbar:GetStatusBarTexture(), "right"); 401 | unitFrame.castbar.spark:SetTexture("Interface\\CastingBar\\UI-CastingBar-Spark"); 402 | unitFrame.castbar.spark:SetBlendMode("ADD"); 403 | unitFrame.castbar.spark:SetSize(32, 32); 404 | unitFrame.castbar.spark:SetDrawLayer("artwork", 3); 405 | 406 | -- Background 407 | unitFrame.castbar.background = unitFrame.castbar.statusbar:CreateTexture(); 408 | unitFrame.castbar.background:SetAllPoints(); 409 | unitFrame.castbar.background:SetColorTexture(0.18, 0.18, 0.18, 0.85); 410 | unitFrame.castbar.background:SetDrawLayer("background"); 411 | 412 | -- Animation group 413 | unitFrame.castbar.animation = unitFrame.castbar:CreateAnimationGroup(); 414 | 415 | -- Animation alpha 416 | local castbar_animation_alpha = unitFrame.castbar.animation:CreateAnimation("Alpha"); 417 | castbar_animation_alpha:SetStartDelay(0.36); 418 | castbar_animation_alpha:SetDuration(0.36); 419 | castbar_animation_alpha:SetFromAlpha(1); 420 | castbar_animation_alpha:SetToAlpha(0); 421 | 422 | -- Scripts: Hiding castbar after its animation finishes 423 | unitFrame.castbar.animation:SetScript("OnFinished", function() 424 | unitFrame.castbar:Hide(); 425 | end); 426 | 427 | -------------------------------- 428 | -- Raid target 429 | -------------------------------- 430 | 431 | -- Parent 432 | unitFrame.raidTarget = CreateFrame("frame", nil, unitFrame); 433 | 434 | -- Icon 435 | unitFrame.raidTarget.icon = unitFrame.raidTarget:CreateTexture(); 436 | unitFrame.raidTarget.icon:SetSize(20, 20); 437 | unitFrame.raidTarget.icon:SetDrawLayer("artwork", 2); 438 | 439 | -- Animation group 440 | unitFrame.raidTarget.animation = unitFrame.raidTarget:CreateAnimationGroup(); 441 | 442 | -- Animation alpha 443 | unitFrame.raidTarget.animation.alpha = unitFrame.raidTarget.animation:CreateAnimation("Alpha"); 444 | unitFrame.raidTarget.animation.alpha:SetDuration(0.26); 445 | unitFrame.raidTarget.animation.alpha:SetFromAlpha(0); 446 | unitFrame.raidTarget.animation.alpha:SetToAlpha(1); 447 | 448 | -- Animation scale 449 | unitFrame.raidTarget.animation.scale1 = unitFrame.raidTarget.animation:CreateAnimation("Scale"); 450 | unitFrame.raidTarget.animation.scale1:SetDuration(0.13); 451 | unitFrame.raidTarget.animation.scale1:SetScaleFrom(0,0); 452 | unitFrame.raidTarget.animation.scale1:SetScaleTo(1.15, 1.15); 453 | unitFrame.raidTarget.animation.scale1:SetSmoothing("out"); 454 | 455 | unitFrame.raidTarget.animation.scale2 = unitFrame.raidTarget.animation:CreateAnimation("Scale"); 456 | unitFrame.raidTarget.animation.scale2:SetStartDelay(0.13); 457 | unitFrame.raidTarget.animation.scale2:SetDuration(0.13); 458 | unitFrame.raidTarget.animation.scale2:SetScaleFrom(1.15, 1.15); 459 | unitFrame.raidTarget.animation.scale2:SetScaleTo(1, 1); 460 | unitFrame.raidTarget.animation.scale2:SetSmoothing("in") 461 | 462 | -- Scrits: Animating raid target icon on show 463 | unitFrame.raidTarget:SetScript("OnShow", function() 464 | if unitFrame.raidTarget.animation:IsPlaying() then 465 | unitFrame.raidTarget.animation:Restart(); 466 | else 467 | unitFrame.raidTarget.animation:Play(); 468 | end 469 | end); 470 | 471 | -------------------------------- 472 | -- Hiding what has to be hidden 473 | -------------------------------- 474 | unitFrame.threatPercentage:Hide(); 475 | unitFrame.raidTarget:Hide(); 476 | unitFrame.castbar:Hide(); 477 | unitFrame:Hide(); 478 | end 479 | end -------------------------------------------------------------------------------- /ClassicPlatesPlus/nameplate_personal.lua: -------------------------------------------------------------------------------- 1 | ---------------------------------------- 2 | -- Core 3 | ---------------------------------------- 4 | local myAddon, core = ...; 5 | local func = core.func; 6 | local data = core.data; 7 | 8 | -------------------------------------- 9 | -- Create personal nameplate 10 | -------------------------------------- 11 | local scaleOffset = 0.40; 12 | 13 | function func:PersonalNameplateCreate() 14 | if not data.nameplate then 15 | local CFG = CFG_Account_ClassicPlatesPlus.Profiles[CFG_ClassicPlatesPlus.Profile]; 16 | 17 | -- Anchor 18 | data.nameplate = CreateFrame("frame", myAddon .. "nameplateSelf", UIParent); 19 | 20 | local nameplate = data.nameplate; 21 | 22 | nameplate:SetSize(256,64); 23 | nameplate:SetFrameLevel(2); 24 | nameplate:SetScript("OnShow", function(self) 25 | func:DefaultPowerBars(); 26 | end); 27 | 28 | -- Dragging Personal Nameplate 29 | if not data.isRetail then 30 | local startY = 0; 31 | local originalY = 0; 32 | 33 | nameplate:SetMovable(true); 34 | nameplate:EnableMouse(false); 35 | nameplate:RegisterForDrag("LeftButton"); 36 | nameplate:SetClampedToScreen(true); 37 | 38 | nameplate.isMoving = false; 39 | nameplate:SetScript("OnDragStart", function(self) 40 | if IsControlKeyDown() then 41 | self.isMoving = true; 42 | startY = select(2, GetCursorPosition()); 43 | originalY = self:GetTop(); 44 | end 45 | end) 46 | 47 | nameplate:SetScript("OnDragStop", function(self) 48 | self.isMoving = false; 49 | end) 50 | 51 | nameplate:SetScript("OnUpdate", function(self) 52 | if self.isMoving then 53 | local y = select(2, GetCursorPosition()); 54 | local deltaY = y - startY; 55 | 56 | -- Calculate the new Y-coordinate 57 | local newY = originalY + deltaY; 58 | 59 | -- Set the frame's position along the Y-axis 60 | self:SetPoint("top", UIParent, "bottom", 0, newY); 61 | CFG.PersonalNameplatePointY = newY; 62 | 63 | -- Updating Personal Nameplate Configs 64 | local SettingFrame = _G[data.settings.configs.all.PersonalNameplatePointY.frame]; 65 | 66 | if SettingFrame then 67 | SettingFrame:SetValue(CFG.PersonalNameplatePointY); 68 | end 69 | end 70 | end); 71 | 72 | nameplate:SetScript("OnHide", function(self) 73 | self.isMoving = false; 74 | end) 75 | end 76 | 77 | -- Unit 78 | nameplate.unit = "player"; 79 | 80 | -- Main / Scale 81 | nameplate.main = CreateFrame("frame", nil, nameplate); 82 | nameplate.main:SetAllPoints(); 83 | nameplate.main:SetScale(CFG.PersonalNameplatesScale - 0.2); 84 | 85 | -- Border 86 | nameplate.border = nameplate.main:CreateTexture(); 87 | nameplate.border:SetPoint("center"); 88 | nameplate.border:SetSize(256,128); 89 | nameplate.border:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\borders\\borderOwn"); 90 | nameplate.border:SetVertexColor(CFG.BorderColor.r, CFG.BorderColor.g, CFG.BorderColor.b); 91 | nameplate.border:SetDrawLayer("border", 1); 92 | 93 | -- Healthbar 94 | nameplate.healthbar = CreateFrame("StatusBar", nil, nameplate.main); 95 | nameplate.healthbar:SetPoint("top", nameplate.border, "center", 0, 36); 96 | nameplate.healthbar:SetSize(222, 28); 97 | nameplate.healthbar:SetStatusBarTexture("Interface\\TargetingFrame\\UI-StatusBar"); 98 | nameplate.healthbar:SetStatusBarColor(0,1,0); 99 | nameplate.healthbar:SetFrameLevel(1); 100 | 101 | nameplate.healthbarChange = nameplate.main:CreateTexture(); 102 | nameplate.healthbarChange:SetParent(nameplate.healthbar); 103 | nameplate.healthbarChange:SetHeight(28); 104 | nameplate.healthbarChange:SetTexture("Interface\\TargetingFrame\\UI-StatusBar"); 105 | nameplate.healthbarChange:SetVertexColor(0.7, 0, 0, 1); 106 | nameplate.healthbarChange:SetDrawLayer("background", 3); 107 | nameplate.healthbarChange:Hide(); 108 | 109 | nameplate.healthbarChange.animation_group = nameplate.healthbarChange:CreateAnimationGroup(); 110 | nameplate.healthbarChange.animation_group.scale = nameplate.healthbarChange.animation_group:CreateAnimation("Scale"); 111 | nameplate.healthbarChange.animation_group.scale:SetDuration(1); 112 | nameplate.healthbarChange.animation_group.scale:SetScaleFrom(1, 1); 113 | nameplate.healthbarChange.animation_group.scale:SetScale(0, 1); 114 | nameplate.healthbarChange.animation_group.scale:SetSmoothing("IN"); 115 | nameplate.healthbarChange.animation_group.scale:SetOrigin("left", 0, 0); 116 | nameplate.healthbarChange.animation_group:SetScript("OnFinished", function(self) 117 | nameplate.healthbarChange:Hide(); 118 | end); 119 | nameplate.healthbar:SetScript("OnValueChanged", function(self, newValue) 120 | if CFG.PersonalHealthBarAnimation then 121 | local prevValue = data.nameplate.prevHealthValue; 122 | 123 | if prevValue then 124 | local healthMax = UnitHealthMax("player"); 125 | 126 | local function GetWidth(difference) 127 | return difference / healthMax * self:GetWidth(); 128 | end 129 | 130 | if newValue < prevValue then 131 | local difference = prevValue - newValue; 132 | 133 | if difference > 1 and prevValue <= healthMax then 134 | local diffWidth = GetWidth(difference); 135 | local valWidth = GetWidth(newValue) 136 | local percentage = (difference / healthMax) * 100; 137 | 138 | if percentage > CFG.PersonalHealthBarAnimationThreshold then 139 | nameplate.healthbarChange:ClearAllPoints(); 140 | nameplate.healthbarChange:SetPoint("left", nameplate.healthbar, "right", -(nameplate.healthbar:GetWidth() - valWidth), 0); 141 | nameplate.healthbarChange:SetWidth(diffWidth); 142 | nameplate.healthbarChange:Show(); 143 | nameplate.healthbarChange.animation_group:Restart(); 144 | end 145 | end 146 | end 147 | end 148 | end 149 | end); 150 | 151 | nameplate.healthbarSpark = nameplate.main:CreateTexture(); 152 | nameplate.healthbarSpark:SetPoint("center", nameplate.healthbar:GetStatusBarTexture(), "right"); 153 | nameplate.healthbarSpark:SetSize(10, 32); 154 | nameplate.healthbarSpark:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\highlights\\spark"); 155 | nameplate.healthbarSpark:SetVertexColor(1, 0.82, 0); 156 | nameplate.healthbarSpark:SetBlendMode("ADD"); 157 | nameplate.healthbarSpark:SetDrawLayer("artwork"); 158 | nameplate.healthbarSpark:Hide(); 159 | 160 | nameplate.healthbarBackground = nameplate.main:CreateTexture(); 161 | nameplate.healthbarBackground:SetColorTexture(0.18, 0.18, 0.18, 0.85); 162 | nameplate.healthbarBackground:SetParent(nameplate.healthbar); 163 | nameplate.healthbarBackground:SetAllPoints(); 164 | nameplate.healthbarBackground:SetDrawLayer("background", 2); 165 | 166 | nameplate.healPrediction = nameplate.main:CreateTexture(nil, "background"); 167 | nameplate.healPrediction:SetPoint("left", nameplate.healthbar:GetStatusBarTexture(), "right"); 168 | nameplate.healPrediction:SetHeight(nameplate.healthbar:GetHeight()); 169 | nameplate.healPrediction:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\highlights\\healPredict"); 170 | nameplate.healPrediction:SetBlendMode("add"); 171 | nameplate.healPrediction:SetVertexColor(0, 0.5, 0.0, 0.5); 172 | nameplate.healPrediction:Hide(); 173 | 174 | -- Animation: Group Alpha 175 | nameplate.healPrediction.animationGroupAlpha = nameplate.healPrediction:CreateAnimationGroup(); 176 | nameplate.healPrediction.animation_Alpha_From = nameplate.healPrediction.animationGroupAlpha:CreateAnimation("Alpha"); 177 | nameplate.healPrediction.animation_Alpha_From:SetDuration(0.36); 178 | nameplate.healPrediction.animation_Alpha_From:SetFromAlpha(0.6); 179 | nameplate.healPrediction.animation_Alpha_From:SetToAlpha(0.2); 180 | nameplate.healPrediction.animationGroupAlpha:SetLooping("BOUNCE"); 181 | nameplate.healPrediction.animationGroupAlpha:Stop(); 182 | 183 | -- Animation: Group Scale 184 | nameplate.healPrediction.animationGroupScale = nameplate.healPrediction:CreateAnimationGroup(); 185 | nameplate.healPrediction.animation_Scale_From = nameplate.healPrediction.animationGroupScale:CreateAnimation("Scale"); 186 | nameplate.healPrediction.animation_Scale_From:SetDuration(0.36); 187 | nameplate.healPrediction.animation_Scale_From:SetScaleFrom(1, 1); 188 | nameplate.healPrediction.animation_Scale_From:SetScaleTo(0.25, 1); 189 | nameplate.healPrediction.animation_Scale_From:SetOrigin("left", 0, 0); 190 | nameplate.healPrediction.animationGroupScale:SetLooping("BOUNCE"); 191 | nameplate.healPrediction.animationGroupScale:Stop(); 192 | 193 | -- Health main 194 | nameplate.healthMain = nameplate.main:CreateFontString(nil, "overlay"); 195 | nameplate.healthMain:SetParent(nameplate.main); 196 | nameplate.healthMain:SetPoint("center", nameplate.healthbar, "center", 0, -0.5); 197 | nameplate.healthMain:SetJustifyH("center"); 198 | nameplate.healthMain:SetTextColor( 199 | CFG.HealthFontColor.r, 200 | CFG.HealthFontColor.g, 201 | CFG.HealthFontColor.b, 202 | CFG.HealthFontColor.a 203 | ); 204 | if CFG.LargeMainValue then 205 | nameplate.healthMain:SetFontObject("GameFontNormalLargeOutline"); 206 | nameplate.healthMain:SetScale(1.4 + scaleOffset); 207 | else 208 | nameplate.healthMain:SetFontObject("GameFontNormalOutline"); 209 | nameplate.healthMain:SetScale(0.9 + scaleOffset); 210 | end 211 | 212 | -- Health left 213 | nameplate.healthSecondary = nameplate.main:CreateFontString(nil, "overlay", "GameFontNormalOutline"); 214 | nameplate.healthSecondary:SetParent(nameplate.main); 215 | nameplate.healthSecondary:SetPoint("left", nameplate.healthbar, "left", 4, 0); 216 | nameplate.healthSecondary:SetJustifyH("left"); 217 | nameplate.healthSecondary:SetTextColor( 218 | CFG.HealthFontColor.r, 219 | CFG.HealthFontColor.g, 220 | CFG.HealthFontColor.b, 221 | CFG.HealthFontColor.a 222 | ); 223 | nameplate.healthSecondary:SetScale(0.9 + scaleOffset); 224 | 225 | -- Health total 226 | nameplate.healthTotal = nameplate.main:CreateFontString(nil, "overlay", "GameFontNormalOutline"); 227 | nameplate.healthTotal:SetParent(nameplate.main); 228 | nameplate.healthTotal:SetPoint("right", nameplate.healthbar, "right", -4, 0); 229 | nameplate.healthTotal:SetJustifyH("right"); 230 | nameplate.healthTotal:SetTextColor( 231 | CFG.HealthFontColor.r, 232 | CFG.HealthFontColor.g, 233 | CFG.HealthFontColor.b, 234 | CFG.HealthFontColor.a 235 | ); 236 | nameplate.healthTotal:SetScale(0.9 + scaleOffset); 237 | 238 | -- Powebar 239 | nameplate.powerbar = CreateFrame("StatusBar", nil, nameplate.main); 240 | nameplate.powerbar:SetPoint("top", nameplate.border, "center", 0, 5); 241 | nameplate.powerbar:SetSize(222, 18); 242 | nameplate.powerbar:SetStatusBarTexture("Interface\\TargetingFrame\\UI-StatusBar"); 243 | nameplate.powerbar:SetFrameLevel(1); 244 | 245 | nameplate.powerbarChange = nameplate.main:CreateTexture(nil, "background"); 246 | nameplate.powerbarChange:SetHeight(18); 247 | nameplate.powerbarChange:SetTexture("Interface\\Buttons\\WHITE8x8"); 248 | nameplate.powerbarChange:SetVertexColor(0.75, 0.75, 1, 1); 249 | nameplate.powerbarChange:SetBlendMode("ADD"); 250 | nameplate.powerbarChange:Hide(); 251 | 252 | nameplate.powerbarChange.animation_group_1 = nameplate.powerbarChange:CreateAnimationGroup(); 253 | nameplate.powerbarChange.animation_group_1.scale = nameplate.powerbarChange.animation_group_1:CreateAnimation("Scale"); 254 | nameplate.powerbarChange.animation_group_1.scale:SetDuration(0.5); 255 | nameplate.powerbarChange.animation_group_1.scale:SetScaleFrom(1, 1); 256 | nameplate.powerbarChange.animation_group_1.scale:SetScale(0, 1); 257 | nameplate.powerbarChange.animation_group_1.scale:SetSmoothing("IN"); 258 | nameplate.powerbarChange.animation_group_1.scale:SetOrigin("right", 0, 0); 259 | 260 | nameplate.powerbarChange.animation_group_2 = nameplate.powerbarChange:CreateAnimationGroup(); 261 | nameplate.powerbarChange.animation_group_2.alpha = nameplate.powerbarChange.animation_group_2:CreateAnimation("Alpha"); 262 | nameplate.powerbarChange.animation_group_2.alpha:SetDuration(0.5); 263 | nameplate.powerbarChange.animation_group_2.alpha:SetFromAlpha(1); 264 | nameplate.powerbarChange.animation_group_2.alpha:SetToAlpha(0); 265 | nameplate.powerbarChange.animation_group_2.alpha:SetSmoothing("IN_OUT"); 266 | 267 | nameplate.powerbarChange.animation_group_1:SetScript("OnFinished", function(self) 268 | nameplate.powerbarChange:Hide(); 269 | end); 270 | 271 | nameplate.powerbarChange.animation_group_2:SetScript("OnFinished", function(self) 272 | nameplate.powerbarChange:Hide(); 273 | end); 274 | 275 | nameplate.powerbar:SetScript("OnValueChanged", function(self, newValue) 276 | if CFG.PersonalPowerBarAnimation then 277 | local prevValue = data.nameplate.prevPowerValue; 278 | local prewPower = data.nameplate.prevPowerType; 279 | 280 | if prevValue then 281 | local powerMax = UnitPowerMax("player"); 282 | local powerType = UnitPowerType("player"); 283 | 284 | local function GetWidth(difference) 285 | return difference / powerMax * self:GetWidth(); 286 | end 287 | 288 | if powerType == prewPower then 289 | if newValue < prevValue then 290 | local difference = prevValue - newValue; 291 | 292 | if difference > 1 then 293 | local diffWidth = GetWidth(difference); 294 | local valWidth = GetWidth(newValue) 295 | local percentage = (difference / powerMax) * 100; 296 | 297 | if percentage > CFG.PersonalPowerBarAnimationThreshold then 298 | nameplate.powerbarChange:ClearAllPoints(); 299 | nameplate.powerbarChange:SetPoint("left", nameplate.powerbar, "right", -(nameplate.powerbar:GetWidth() - valWidth), 0); 300 | nameplate.powerbarChange:SetWidth(diffWidth); 301 | nameplate.powerbarChange:Show(); 302 | nameplate.powerbarChange.animation_group_2:Restart(); 303 | nameplate.powerbarChange.animation_group_1:Stop(); 304 | end 305 | end 306 | elseif newValue > prevValue then 307 | local difference = newValue - prevValue; 308 | 309 | if difference > 1 then 310 | local diffWidth = GetWidth(difference); 311 | local percentage = (difference / powerMax) * 100; 312 | 313 | if diffWidth > nameplate.powerbar:GetWidth() then 314 | diffWidth = nameplate.powerbar:GetWidth(); 315 | end 316 | 317 | if percentage > CFG.PersonalPowerBarAnimationThreshold then 318 | nameplate.powerbarChange:ClearAllPoints(); 319 | nameplate.powerbarChange:SetPoint("right", self:GetStatusBarTexture(), "right"); 320 | nameplate.powerbarChange:SetWidth(diffWidth); 321 | nameplate.powerbarChange:SetShown(diffWidth > 0); 322 | nameplate.powerbarChange.animation_group_1:Restart(); 323 | nameplate.powerbarChange.animation_group_2:Stop(); 324 | end 325 | end 326 | end 327 | end 328 | end 329 | end 330 | end); 331 | 332 | nameplate.powerbarSpark = nameplate.main:CreateTexture(); 333 | nameplate.powerbarSpark:SetPoint("center", nameplate.powerbar:GetStatusBarTexture(), "right"); 334 | nameplate.powerbarSpark:SetSize(10, 22); 335 | nameplate.powerbarSpark:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\highlights\\spark"); 336 | nameplate.powerbarSpark:SetVertexColor(1, 0.82, 0, 0.7); 337 | nameplate.powerbarSpark:SetBlendMode("add"); 338 | nameplate.powerbarSpark:SetDrawLayer("artwork"); 339 | nameplate.powerbarSpark:Hide(); 340 | 341 | nameplate.powerbarBackground = nameplate.main:CreateTexture(); 342 | nameplate.powerbarBackground:SetColorTexture(0.18, 0.18, 0.18, 0.85); 343 | nameplate.powerbarBackground:SetParent(nameplate.powerbar); 344 | nameplate.powerbarBackground:SetAllPoints(); 345 | nameplate.powerbarBackground:SetDrawLayer("background"); 346 | 347 | nameplate.powerMain = nameplate.main:CreateFontString(nil, "overlay", "GameFontNormalOutline"); 348 | nameplate.powerMain:SetParent(nameplate.main); 349 | nameplate.powerMain:SetPoint("center", nameplate.powerbar, "center", 0, -0.2); 350 | nameplate.powerMain:SetJustifyH("center"); 351 | nameplate.powerMain:SetTextColor( 352 | CFG.HealthFontColor.r, 353 | CFG.HealthFontColor.g, 354 | CFG.HealthFontColor.b, 355 | CFG.HealthFontColor.a 356 | ); 357 | nameplate.powerMain:SetScale(0.9 + scaleOffset); 358 | 359 | nameplate.power = nameplate.main:CreateFontString(nil, "overlay", "GameFontNormalOutline"); 360 | nameplate.power:SetParent(nameplate.main); 361 | nameplate.power:SetPoint("left", nameplate.powerbar, "left", 4, -0.2); 362 | nameplate.power:SetJustifyH("left"); 363 | nameplate.power:SetTextColor( 364 | CFG.HealthFontColor.r, 365 | CFG.HealthFontColor.g, 366 | CFG.HealthFontColor.b, 367 | CFG.HealthFontColor.a 368 | ); 369 | nameplate.power:SetScale(0.9 + scaleOffset); 370 | 371 | nameplate.powerTotal = nameplate.main:CreateFontString(nil, "overlay", "GameFontNormalOutline"); 372 | nameplate.powerTotal:SetParent(nameplate.main); 373 | nameplate.powerTotal:SetPoint("right", nameplate.powerbar, "right", -4, -0.2); 374 | nameplate.powerTotal:SetJustifyH("right"); 375 | nameplate.powerTotal:SetTextColor( 376 | CFG.HealthFontColor.r, 377 | CFG.HealthFontColor.g, 378 | CFG.HealthFontColor.b, 379 | CFG.HealthFontColor.a 380 | ); 381 | nameplate.powerTotal:SetScale(0.9 + scaleOffset); 382 | 383 | -- Extra bar 384 | nameplate.extraBar = CreateFrame("StatusBar", nil, nameplate.main); 385 | nameplate.extraBar:SetPoint("top", nameplate.border, "center", 0, -17); 386 | nameplate.extraBar:SetSize(208, 18); 387 | nameplate.extraBar:SetStatusBarTexture("Interface\\TargetingFrame\\UI-StatusBar"); 388 | nameplate.extraBar:SetFrameLevel(1); 389 | nameplate.extraBar:Hide(); 390 | 391 | nameplate.extraBar.spark = nameplate.main:CreateTexture(); 392 | nameplate.extraBar.spark:SetParent(nameplate.extraBar); 393 | nameplate.extraBar.spark:SetPoint("center", nameplate.extraBar:GetStatusBarTexture(), "right"); 394 | nameplate.extraBar.spark:SetSize(10, 22); 395 | nameplate.extraBar.spark:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\highlights\\spark"); 396 | nameplate.extraBar.spark:SetVertexColor(1, 0.82, 0, 0.7); 397 | nameplate.extraBar.spark:SetBlendMode("add"); 398 | nameplate.extraBar.spark:SetDrawLayer("artwork"); 399 | nameplate.extraBar.spark:Hide(); 400 | 401 | nameplate.extraBar.background = nameplate.main:CreateTexture(); 402 | nameplate.extraBar.background:SetParent(nameplate.extraBar); 403 | nameplate.extraBar.background:SetAllPoints(); 404 | nameplate.extraBar.background:SetColorTexture(0.18, 0.18, 0.18, 0.85); 405 | nameplate.extraBar.background:SetDrawLayer("background"); 406 | 407 | nameplate.extraBar.value = nameplate.main:CreateFontString(nil, "overlay", "GameFontNormalOutline"); 408 | nameplate.extraBar.value:SetParent(nameplate.extraBar); 409 | nameplate.extraBar.value:SetPoint("center", nameplate.extraBar, "center"); 410 | nameplate.extraBar.value:SetJustifyH("center"); 411 | nameplate.extraBar.value:SetTextColor( 412 | CFG.HealthFontColor.r, 413 | CFG.HealthFontColor.g, 414 | CFG.HealthFontColor.b, 415 | CFG.HealthFontColor.a 416 | ); 417 | nameplate.extraBar.value:SetScale(0.9 + scaleOffset); 418 | 419 | -------------------------------- 420 | -- Class Power 421 | -------------------------------- 422 | nameplate.classPower = CreateFrame("frame", nil, nameplate.main); 423 | nameplate.classPower:SetSize(data.classBarHeight, data.classBarHeight); 424 | nameplate.classPower:SetIgnoreParentScale(true); 425 | nameplate.classPower:Hide(); 426 | 427 | -- Animation 428 | local function combatCheck() 429 | if InCombatLockdown() then 430 | return 1; 431 | else 432 | return 0.5; 433 | end 434 | end 435 | 436 | nameplate.animationShow = nameplate:CreateAnimationGroup(); 437 | nameplate.animationShow.alpha = nameplate.animationShow:CreateAnimation("Alpha"); 438 | nameplate.animationShow.alpha:SetDuration(0.18); 439 | nameplate.animationShow.alpha:SetFromAlpha(0); 440 | nameplate.animationShow.alpha:SetToAlpha(combatCheck()); 441 | 442 | nameplate.animationHide = nameplate:CreateAnimationGroup(); 443 | nameplate.animationHide.alpha = nameplate.animationHide:CreateAnimation("Alpha"); 444 | nameplate.animationHide.alpha:SetDuration(0.18); 445 | nameplate.animationHide.alpha:SetFromAlpha(combatCheck()); 446 | nameplate.animationHide.alpha:SetToAlpha(0); 447 | 448 | nameplate.animationHide:SetScript("OnFinished", function() 449 | nameplate:Hide(); 450 | end); 451 | 452 | -- Aurasa counter 453 | nameplate.buffsCounter = nameplate:CreateFontString(nil, nil, "GameFontNormalOutline") 454 | nameplate.buffsCounter:SetTextColor(0,1,0); 455 | nameplate.debuffsCounter = nameplate:CreateFontString(nil, nil, "GameFontNormalOutline") 456 | nameplate.debuffsCounter:SetTextColor(1, 0.2, 0); 457 | 458 | -- Auras 459 | nameplate.buffs = {}; 460 | nameplate.debuffs = {}; 461 | 462 | nameplate:Hide(); 463 | end 464 | end 465 | 466 | ----------------------------------------- 467 | -- Add personal nameplate 468 | ----------------------------------------- 469 | function func:PersonalNameplateAdd() 470 | local CFG = CFG_Account_ClassicPlatesPlus.Profiles[CFG_ClassicPlatesPlus.Profile]; 471 | local nameplate = data.nameplate; 472 | 473 | if nameplate then 474 | local dummyAnchor = NamePlateDriverFrame.classNamePlateAlternatePowerBar or NamePlateDriverFrame.classNamePlatePowerBar or nameplate.powerbar; 475 | 476 | nameplate:ClearAllPoints(); 477 | 478 | if data.isRetail then 479 | local myNameplate = C_NamePlate.GetNamePlateForUnit("player"); 480 | 481 | nameplate:SetScale(0.7); 482 | 483 | if myNameplate then 484 | nameplate:SetParent(myNameplate); 485 | nameplate.main:SetPoint("center", nameplate, "center", 0, 0); 486 | end 487 | else 488 | nameplate:SetPoint("top", UIParent, "bottom", 0, CFG.PersonalNameplatePointY); 489 | end 490 | 491 | nameplate.main:SetScale(CFG.PersonalNameplatesScale - 0.2); 492 | nameplate.border:SetVertexColor(CFG.BorderColor.r, CFG.BorderColor.g, CFG.BorderColor.b); 493 | 494 | if CFG.LargeMainValue then 495 | nameplate.healthMain:SetFontObject("GameFontNormalLargeOutline"); 496 | nameplate.healthMain:SetScale(1.4 + scaleOffset); 497 | else 498 | nameplate.healthMain:SetFontObject("GameFontNormalOutline"); 499 | nameplate.healthMain:SetScale(0.9 + scaleOffset); 500 | end 501 | 502 | nameplate.buffsCounter:SetScale(CFG.AurasScale + 0.2); 503 | nameplate.debuffsCounter:SetScale(CFG.AurasScale + 0.2); 504 | 505 | nameplate.classPower:SetPoint("top", dummyAnchor, "bottom", 0, -4); 506 | nameplate.classPower:SetHeight(data.classBarHeight); 507 | 508 | nameplate.healthSecondary:SetTextColor( 509 | CFG.HealthFontColor.r, 510 | CFG.HealthFontColor.g, 511 | CFG.HealthFontColor.b, 512 | CFG.HealthFontColor.a 513 | ); 514 | nameplate.healthTotal:SetTextColor( 515 | CFG.HealthFontColor.r, 516 | CFG.HealthFontColor.g, 517 | CFG.HealthFontColor.b, 518 | CFG.HealthFontColor.a 519 | ); 520 | nameplate.healthMain:SetTextColor( 521 | CFG.HealthFontColor.r, 522 | CFG.HealthFontColor.g, 523 | CFG.HealthFontColor.b, 524 | CFG.HealthFontColor.a 525 | ); 526 | nameplate.powerMain:SetTextColor( 527 | CFG.HealthFontColor.r, 528 | CFG.HealthFontColor.g, 529 | CFG.HealthFontColor.b, 530 | CFG.HealthFontColor.a 531 | ); 532 | nameplate.power:SetTextColor( 533 | CFG.HealthFontColor.r, 534 | CFG.HealthFontColor.g, 535 | CFG.HealthFontColor.b, 536 | CFG.HealthFontColor.a 537 | ); 538 | nameplate.powerTotal:SetTextColor( 539 | CFG.HealthFontColor.r, 540 | CFG.HealthFontColor.g, 541 | CFG.HealthFontColor.b, 542 | CFG.HealthFontColor.a 543 | ); 544 | 545 | func:Update_Health("player"); 546 | func:Update_Power("player"); 547 | 548 | nameplate.healthTotal:SetShown(CFG.PersonalNameplateTotalHealth); 549 | nameplate.powerTotal:SetShown(CFG.PersonalNameplateTotalPower); 550 | 551 | func:Toggle_ExtraBar(); 552 | func:ToggleNameplatePersonal(); 553 | func:Update_ClassPower(); 554 | end 555 | end 556 | 557 | -------------------------------------------- 558 | -- Toggle extra bar 559 | -------------------------------------------- 560 | function func:Toggle_ExtraBar() 561 | local CFG = CFG_Account_ClassicPlatesPlus.Profiles[CFG_ClassicPlatesPlus.Profile]; 562 | local nameplate = data.nameplate; 563 | local myNameplate = C_NamePlate.GetNamePlateForUnit("player"); 564 | local alternatePower = NamePlateDriverFrame.classNamePlateAlternatePowerBar; 565 | local powerType = UnitPowerType("player"); 566 | local _, _, classID = UnitClass("player"); 567 | local druidInCatOrBearFrom = classID == 11 and powerType ~= 0; 568 | local toggle = alternatePower or druidInCatOrBearFrom; 569 | local posY = 0; 570 | local scale = math.max(0.75, math.min(1.25, CFG.PersonalNameplatesScale)) -- Clamp Scale to the range [0.75, 1.25] 571 | 572 | if nameplate then 573 | -- Swapping border texture, calculating Y axis of the anchor and updating the extra powerbar values 574 | if toggle then 575 | nameplate.border:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\borders\\personalExtra"); 576 | posY = -30 + (scale - 0.75) * (22 / 0.5); 577 | func:Update_ExtraBar(); 578 | else 579 | posY = -24 + (scale - 0.75) * (12 / 0.5); 580 | nameplate.border:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\borders\\personal"); 581 | end 582 | 583 | -- Adjusting nameplate position 584 | if data.isRetail then 585 | nameplate:ClearAllPoints(); 586 | nameplate:SetPoint("bottom", myNameplate, "bottom", 0, posY); 587 | end 588 | 589 | -- Toggling extra bar 590 | nameplate.extraBar:SetShown(toggle); 591 | func:DefaultPowerBars(); 592 | func:PositionAuras(nameplate); 593 | end 594 | end 595 | 596 | ---------------------------------------- 597 | -- Toggle personal nameplate 598 | ---------------------------------------- 599 | function func:ToggleNameplatePersonal(event) 600 | local CFG = CFG_Account_ClassicPlatesPlus.Profiles[CFG_ClassicPlatesPlus.Profile]; 601 | local nameplate = data.nameplate; 602 | local toggle = false; 603 | 604 | if data.isRetail then 605 | local myNameplate = C_NamePlate.GetNamePlateForUnit("player"); 606 | 607 | toggle = data.cvars.nameplateHideHealthAndPower == "0" 608 | and data.cvars.nameplateShowSelf == "1" 609 | and myNameplate 610 | and myNameplate:IsVisible() 611 | 612 | elseif CFG.PersonalNameplate then 613 | if not UnitIsDeadOrGhost("player") then 614 | local classID = select(3, UnitClass("player")); 615 | local powerType = UnitPowerType("player"); 616 | 617 | if InCombatLockdown() or event == "PLAYER_REGEN_DISABLED" then 618 | nameplate:SetAlpha(1); 619 | toggle = true; 620 | else 621 | local fullHealth = UnitHealth("player") >= UnitHealthMax("player"); 622 | 623 | if CFG.PersonalNameplateFade then 624 | nameplate:SetAlpha(CFG.PersonalNameplateFadeIntensity); 625 | else 626 | nameplate:SetAlpha(1); 627 | end 628 | 629 | if CFG.PersonalNameplateAlwaysShow then 630 | toggle = true; 631 | elseif classID == 11 then -- If player is a druid 632 | local noRage = UnitPower("player", 1) <= 0; 633 | local fullEnergy = UnitPower("player", 3) == UnitPowerMax("player", 3); 634 | local fullMana = UnitPower("player", 0) == UnitPowerMax("player", 0); 635 | 636 | toggle = not (fullHealth and (powerType == 1 and noRage or powerType == 3 and fullEnergy or powerType == 0 and fullMana)) 637 | elseif classID == 1 then -- If player is a warrior 638 | local noRage = UnitPower("player", 1) <= 0; 639 | 640 | toggle = not (fullHealth and (powerType == 1 and noRage)); 641 | elseif classID == 6 then -- If player is a death knight 642 | local noRunicPower = UnitPower("player", 6) <= 0; 643 | 644 | toggle = not (fullHealth and noRunicPower); 645 | else 646 | toggle = not (UnitPower("player") == UnitPowerMax("player") and fullHealth); 647 | end 648 | end 649 | end 650 | end 651 | 652 | if toggle then 653 | func:Update_Auras("player"); 654 | nameplate.animationHide:Stop(); 655 | nameplate:Show(); 656 | else 657 | nameplate.animationHide:Play(); 658 | end 659 | end -------------------------------------------------------------------------------- /ClassicPlatesPlus/auras.lua: -------------------------------------------------------------------------------- 1 | ---------------------------------------- 2 | -- CORE 3 | ---------------------------------------- 4 | local myAddon, core = ...; 5 | local func = core.func; 6 | local data = core.data; 7 | 8 | ---------------------------------------- 9 | -- Auras 10 | ---------------------------------------- 11 | local AuraSize = { x = 32, y = 28 }; 12 | 13 | function func:HideAllAuras(unitframe) 14 | local function hideAuras(unitFrame, filter) 15 | if unitFrame.auras then 16 | 17 | unitFrame.buffsCounter:Hide(); 18 | unitFrame.buffsCounter:Hide(); 19 | 20 | for i = 1, 40 do 21 | if unitFrame.auras[filter][i] then 22 | unitFrame.auras[filter][i]:Hide(); 23 | unitFrame.auras[filter][i].highlight.animationGrp:Stop(); 24 | else 25 | break; 26 | end 27 | end 28 | end 29 | end 30 | 31 | if unitframe then 32 | unitframe.buffsCounter:Hide(); 33 | unitframe.buffsCounter:Hide(); 34 | 35 | if unitframe.unit and not UnitIsUnit("player", unitframe.unit) then 36 | hideAuras(unitframe, "helpful"); 37 | hideAuras(unitframe, "harmful"); 38 | end 39 | else 40 | for _, nameplate in ipairs(C_NamePlate.GetNamePlates(false)) do 41 | local unitFrame = nameplate.unitFrame; 42 | local unit = nameplate.unitFrame.unit; 43 | 44 | if unit and not UnitIsUnit("player", unit) then 45 | hideAuras(unitFrame, "helpful"); 46 | hideAuras(unitFrame, "harmful"); 47 | end 48 | end 49 | end 50 | end 51 | 52 | function func:Update_Auras(unit) 53 | local CFG = CFG_Account_ClassicPlatesPlus.Profiles[CFG_ClassicPlatesPlus.Profile]; 54 | 55 | if unit then 56 | local isNameplate = string.match(unit, "nameplate"); 57 | local UnitIsPlayer = UnitIsUnit("player", unit); 58 | local UnitIsTarget = UnitIsUnit("target", unit); 59 | local UnitIsMyPet = UnitIsUnit("pet", unit); 60 | local canAttack = UnitCanAttack("player", unit); 61 | local nameplate, unitFrame; 62 | 63 | if UnitIsPlayer then 64 | nameplate = data.nameplate; 65 | unitFrame = nameplate; 66 | elseif isNameplate then 67 | nameplate = C_NamePlate.GetNamePlateForUnit(unit); 68 | unitFrame = nameplate and nameplate.unitFrame; 69 | end 70 | 71 | if nameplate and unitFrame then 72 | unitFrame.auras = unitFrame.auras or CreateFrame("Frame", nil, unitFrame.parent); 73 | unitFrame.auras.helpful = unitFrame.auras.helpful or {}; 74 | unitFrame.auras.harmful = unitFrame.auras.harmful or {}; 75 | unitFrame.auras.toSort = { helpful = {}, harmful = {}, important_helpful = {}, important_harmful = {}, stealable_helpful = {} }; 76 | unitFrame.auras.sorted = { helpful = {}, harmful = {} }; 77 | 78 | if unitFrame.auras then 79 | local function getAuras(filter) 80 | for i = 1, 40 do 81 | local aura = C_UnitAuras.GetAuraDataByIndex(unit, i, filter); 82 | 83 | local test = false; 84 | if test and i < 10 then 85 | local durationN = 86 | i <= 2 and 0 87 | or i > 2 and i < 4 and 9 88 | or 30; 89 | 90 | aura = { 91 | name = "Test aura " .. i, 92 | icon = 1120721, 93 | applications = durationN, 94 | duration = durationN, 95 | isHarmful = filter == "harmful", 96 | isHelpful = filter == "helpful", 97 | expirationTime = durationN + GetTime(), 98 | sourceUnit = "player", 99 | dispelName = "Curse", 100 | } 101 | 102 | if i == 1 or i == 2 then 103 | aura.name = "Arcane Brilliance" 104 | end 105 | end 106 | 107 | if aura then 108 | local name = aura.name; 109 | local icon = aura.icon; 110 | local stacks = aura.applications; 111 | local duration = aura.duration; 112 | local expirationTime = aura.expirationTime; 113 | local source = aura.sourceUnit; 114 | local spellId = aura.spellId; 115 | local timeMod = aura.timeMod; 116 | local isHarmful = aura.isHarmful; 117 | local isHelpful = aura.isHelpful; 118 | local canApplyAura = aura.canApplyAura; 119 | local isRaid = aura.isRaid; 120 | local isStealable = aura.isStealable; 121 | local dispelName = aura.dispelName; 122 | local sourceIsPlayer = false; 123 | local markStealable = CFG.MarkStealableAuras and isStealable; 124 | 125 | if source then 126 | sourceIsPlayer = UnitIsUnit("player", source); 127 | end 128 | 129 | -- Border Color 130 | local r,g,b = 1,1,1; 131 | if isHarmful then 132 | if UnitIsPlayer then 133 | if dispelName then 134 | if dispelName == "Magic" then 135 | r = CFG.Auras_Personal_HarmfulBorderColor_Magic.r; 136 | g = CFG.Auras_Personal_HarmfulBorderColor_Magic.g; 137 | b = CFG.Auras_Personal_HarmfulBorderColor_Magic.b; 138 | elseif dispelName == "Curse" then 139 | r = CFG.Auras_Personal_HarmfulBorderColor_Curse.r; 140 | g = CFG.Auras_Personal_HarmfulBorderColor_Curse.g; 141 | b = CFG.Auras_Personal_HarmfulBorderColor_Curse.b; 142 | elseif dispelName == "Disease" then 143 | r = CFG.Auras_Personal_HarmfulBorderColor_Disease.r; 144 | g = CFG.Auras_Personal_HarmfulBorderColor_Disease.g; 145 | b = CFG.Auras_Personal_HarmfulBorderColor_Disease.b; 146 | elseif dispelName == "Poison" then 147 | r = CFG.Auras_Personal_HarmfulBorderColor_Poison.r; 148 | g = CFG.Auras_Personal_HarmfulBorderColor_Poison.g; 149 | b = CFG.Auras_Personal_HarmfulBorderColor_Poison.b; 150 | end 151 | else 152 | r = CFG.Auras_Personal_HarmfulBorderColor_Regular.r; 153 | g = CFG.Auras_Personal_HarmfulBorderColor_Regular.g; 154 | b = CFG.Auras_Personal_HarmfulBorderColor_Regular.b; 155 | end 156 | else 157 | if dispelName then 158 | if dispelName == "Magic" then 159 | r = CFG.Auras_HarmfulBorderColor_Magic.r; 160 | g = CFG.Auras_HarmfulBorderColor_Magic.g; 161 | b = CFG.Auras_HarmfulBorderColor_Magic.b; 162 | elseif dispelName == "Curse" then 163 | r = CFG.Auras_HarmfulBorderColor_Curse.r; 164 | g = CFG.Auras_HarmfulBorderColor_Curse.g; 165 | b = CFG.Auras_HarmfulBorderColor_Curse.b; 166 | elseif dispelName == "Disease" then 167 | r = CFG.Auras_HarmfulBorderColor_Disease.r; 168 | g = CFG.Auras_HarmfulBorderColor_Disease.g; 169 | b = CFG.Auras_HarmfulBorderColor_Disease.b; 170 | elseif dispelName == "Poison" then 171 | r = CFG.Auras_HarmfulBorderColor_Poison.r; 172 | g = CFG.Auras_HarmfulBorderColor_Poison.g; 173 | b = CFG.Auras_HarmfulBorderColor_Poison.b; 174 | end 175 | else 176 | r = CFG.Auras_HarmfulBorderColor_Regular.r; 177 | g = CFG.Auras_HarmfulBorderColor_Regular.g; 178 | b = CFG.Auras_HarmfulBorderColor_Regular.b; 179 | end 180 | end 181 | end 182 | 183 | if isHelpful then 184 | if markStealable then 185 | r = CFG.AurasStealableBorderColor.r; 186 | g = CFG.AurasStealableBorderColor.g; 187 | b = CFG.AurasStealableBorderColor.b; 188 | else 189 | r = CFG.AurasHelpfulBorderColor.r; 190 | g = CFG.AurasHelpfulBorderColor.g; 191 | b = CFG.AurasHelpfulBorderColor.b; 192 | end 193 | end 194 | 195 | -- Filter 196 | local function Settings_filter() 197 | -- Check if aura is Blacklisted or Important 198 | if data.settings.AurasBlacklist[name] then 199 | return false; 200 | elseif data.settings.AurasImportantList[name] then 201 | return true; 202 | end 203 | 204 | -- Option: Show Only Important Auras 205 | -- Since we already checked if aura is important, we can hide rest if this option is toggled. 206 | if CFG.AurasShowOnlyImportant then 207 | return false; 208 | end 209 | 210 | -- Option: Buffs / Debuffs toggles 211 | if UnitIsPlayer then 212 | if isHelpful and not CFG.BuffsPersonal then 213 | return false; 214 | end 215 | if isHarmful and not CFG.DebuffsPersonal then 216 | return false; 217 | end 218 | else 219 | if canAttack then 220 | if isHelpful and not CFG.BuffsEnemy then 221 | return false; 222 | elseif isHarmful and not CFG.DebuffsEnemy then 223 | return false; 224 | end 225 | else 226 | if isHelpful and not CFG.BuffsFriendly then 227 | return false; 228 | elseif isHarmful and not CFG.DebuffsFriendly then 229 | return false; 230 | end 231 | end 232 | end 233 | 234 | -- Option: Passive Auras 235 | if duration == 0 or not duration then 236 | if CFG.AurasHidePassive == 2 then 237 | return false; 238 | elseif CFG.AurasHidePassive == 3 and not sourceIsPlayer then 239 | return false; 240 | end 241 | end 242 | 243 | -- Option: Auras Source and ability to Dispel/Apply 244 | if UnitIsPlayer then 245 | if isHelpful then 246 | if CFG.BuffsFilterPersonal == 2 and not sourceIsPlayer then 247 | return false; 248 | elseif CFG.BuffsFilterPersonal == 3 and not sourceIsPlayer and not isRaid then 249 | return false; 250 | end 251 | end 252 | if isHarmful then 253 | if CFG.DebuffsFilterPersonal == 2 and not isRaid then 254 | return false; 255 | end 256 | end 257 | else 258 | if canAttack then 259 | if CFG.AurasFilterEnemy == 2 and not sourceIsPlayer then 260 | return false; 261 | end 262 | else 263 | if CFG.AurasFilterFriendly == 2 and not sourceIsPlayer then 264 | return false; 265 | elseif CFG.AurasFilterFriendly == 3 and not isRaid then 266 | return false; 267 | end 268 | end 269 | end 270 | 271 | -- Option: Group Filter 272 | if not UnitIsPlayer and not UnitIsMyPet and not canAttack then 273 | local exclude = CFG.AurasGroupFilterExcludeTarget and UnitIsTarget; 274 | 275 | if CFG.AurasGroupFilter == 2 then 276 | if not UnitPlayerOrPetInParty(unit) and not exclude then 277 | return false; 278 | end 279 | elseif CFG.AurasGroupFilter == 3 then 280 | if not UnitPlayerOrPetInRaid(unit) and not exclude then 281 | return false; 282 | end 283 | elseif CFG.AurasGroupFilter == 4 then 284 | if not UnitPlayerOrPetInParty(unit) and not UnitPlayerOrPetInRaid(unit) and not exclude then 285 | return false; 286 | end 287 | end 288 | end 289 | 290 | -- Option: Show Auras Only On Target 291 | if CFG.AurasOnTarget and not UnitIsPlayer then 292 | return UnitIsTarget; 293 | end 294 | 295 | return true; 296 | end 297 | 298 | if Settings_filter() then 299 | if not unitFrame.auras[filter][i] then 300 | ------------------------------------ 301 | -- Main 302 | ------------------------------------ 303 | unitFrame.auras[filter][i] = CreateFrame("frame", myAddon .. "_aurasList_" .. i, unitFrame); 304 | unitFrame.auras[filter][i]:SetFrameLevel(1); 305 | unitFrame.auras[filter][i]:SetIgnoreParentScale(true); 306 | 307 | ------------------------------------ 308 | -- Firse level 309 | ------------------------------------ 310 | unitFrame.auras[filter][i].first = CreateFrame("frame", nil, unitFrame.auras[filter][i]); 311 | unitFrame.auras[filter][i].first:SetPoint("center"); 312 | unitFrame.auras[filter][i].first:SetFrameLevel(1); 313 | 314 | -- Highlight important 315 | unitFrame.auras[filter][i].highlight = unitFrame.auras[filter][i].first:CreateTexture(); 316 | unitFrame.auras[filter][i].highlight:SetAllPoints(); 317 | unitFrame.auras[filter][i].highlight:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\auras\\importantHighlight2"); 318 | 319 | -- Highlight animation group 320 | unitFrame.auras[filter][i].highlight.animationGrp = unitFrame.auras[filter][i].highlight:CreateAnimationGroup(); 321 | unitFrame.auras[filter][i].highlight.animationGrp:SetLooping("repeat"); 322 | 323 | -- Highlight animation alpha 324 | local animation_alphaFrom = unitFrame.auras[filter][i].highlight.animationGrp:CreateAnimation("Alpha"); 325 | animation_alphaFrom:SetDuration(0.33); 326 | animation_alphaFrom:SetFromAlpha(0); 327 | animation_alphaFrom:SetToAlpha(1); 328 | animation_alphaFrom:SetOrder(1); 329 | 330 | local animation_alphaTo = unitFrame.auras[filter][i].highlight.animationGrp:CreateAnimation("Alpha"); 331 | animation_alphaTo:SetDuration(0.33); 332 | animation_alphaTo:SetFromAlpha(1); 333 | animation_alphaTo:SetToAlpha(0); 334 | animation_alphaTo:SetOrder(2); 335 | 336 | -- Mask 337 | unitFrame.auras[filter][i].mask = unitFrame.auras[filter][i].first:CreateMaskTexture(); 338 | unitFrame.auras[filter][i].mask:SetAllPoints(); 339 | unitFrame.auras[filter][i].mask:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\auras\\mask", "CLAMPTOBLACKADDITIVE", "CLAMPTOBLACKADDITIVE"); 340 | 341 | -- Icon 342 | unitFrame.auras[filter][i].icon = unitFrame.auras[filter][i].first:CreateTexture(); 343 | unitFrame.auras[filter][i].icon:SetPoint("center"); 344 | unitFrame.auras[filter][i].icon:AddMaskTexture(unitFrame.auras[filter][i].mask); 345 | unitFrame.auras[filter][i].icon:SetDrawLayer("background", 1); 346 | 347 | -- Cooldown 348 | unitFrame.auras[filter][i].cooldown_wrap = CreateFrame("frame", nil, unitFrame.auras[filter][i].first); 349 | unitFrame.auras[filter][i].cooldown_wrap:SetPoint("center"); 350 | unitFrame.auras[filter][i].cooldown_wrap:SetFrameLevel(1); 351 | unitFrame.auras[filter][i].cooldown = CreateFrame("Cooldown", nil, unitFrame.auras[filter][i].cooldown_wrap, "CooldownFrameTemplate"); 352 | unitFrame.auras[filter][i].cooldown:SetAllPoints(); 353 | unitFrame.auras[filter][i].cooldown:SetDrawEdge(true); 354 | unitFrame.auras[filter][i].cooldown:SetDrawBling(false); 355 | unitFrame.auras[filter][i].cooldown:SetSwipeColor(0, 0, 0, 0.6); 356 | unitFrame.auras[filter][i].cooldown:SetHideCountdownNumbers(true); 357 | unitFrame.auras[filter][i].cooldown:SetFrameLevel(1); 358 | 359 | ------------------------------------ 360 | -- Second level 361 | ------------------------------------ 362 | unitFrame.auras[filter][i].second = CreateFrame("frame", nil, unitFrame.auras[filter][i]); 363 | unitFrame.auras[filter][i].second:SetPoint("center"); 364 | unitFrame.auras[filter][i].second:SetFrameLevel(2); 365 | 366 | -- Border 367 | unitFrame.auras[filter][i].border = unitFrame.auras[filter][i].second:CreateTexture(); 368 | unitFrame.auras[filter][i].border:SetAllPoints(); 369 | unitFrame.auras[filter][i].border:SetDrawLayer("border", 1); 370 | 371 | -- Countdown 372 | unitFrame.auras[filter][i].countdown = unitFrame.auras[filter][i].second:CreateFontString(nil, nil, "GameFontNormalOutline"); 373 | 374 | -- Countdown shadow 375 | unitFrame.auras[filter][i].countdown_shadow = unitFrame.auras[filter][i].second:CreateTexture(); 376 | unitFrame.auras[filter][i].countdown_shadow:SetPoint("center", unitFrame.auras[filter][i].countdown, -4, -4); 377 | unitFrame.auras[filter][i].countdown_shadow:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\auras\\aurasShadow"); 378 | unitFrame.auras[filter][i].countdown_shadow:SetAlpha(0.5); 379 | unitFrame.auras[filter][i].countdown_shadow:SetTexCoord(0, 1, 1, 0); 380 | unitFrame.auras[filter][i].countdown_shadow:SetDrawLayer("border", 2); 381 | 382 | -- Stacks 383 | unitFrame.auras[filter][i].stacks = unitFrame.auras[filter][i].second:CreateFontString(nil, nil, "GameFontNormalOutline"); 384 | unitFrame.auras[filter][i].stacks:SetPoint("bottomRight", unitFrame.auras[filter][i], "bottomRight", 3, -2); 385 | unitFrame.auras[filter][i].stacks:SetJustifyH("right"); 386 | 387 | -- Stacks shadow 388 | unitFrame.auras[filter][i].stacks_shadow = unitFrame.auras[filter][i].second:CreateTexture(); 389 | unitFrame.auras[filter][i].stacks_shadow:SetPoint("center", unitFrame.auras[filter][i].stacks, -4, 4); 390 | unitFrame.auras[filter][i].stacks_shadow:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\auras\\aurasShadow"); 391 | unitFrame.auras[filter][i].stacks_shadow:SetAlpha(0.5); 392 | unitFrame.auras[filter][i].stacks_shadow:SetDrawLayer("border", 2); 393 | 394 | -- Mark 395 | unitFrame.auras[filter][i].mark = unitFrame.auras[filter][i].second:CreateTexture(); 396 | unitFrame.auras[filter][i].mark:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\icons\\mark3"); 397 | unitFrame.auras[filter][i].mark:SetDrawLayer("artwork"); 398 | unitFrame.auras[filter][i].mark:Hide(); 399 | end 400 | 401 | -- Tooltip 402 | if CFG.Tooltip then 403 | local hover = false; 404 | 405 | local function ModifierState() 406 | if CFG.Tooltip == 1 and IsShiftKeyDown() 407 | or CFG.Tooltip == 2 and IsControlKeyDown() 408 | or CFG.Tooltip == 3 and IsAltKeyDown() then 409 | return true; 410 | else 411 | return false; 412 | end 413 | end 414 | 415 | local function work() 416 | if hover then 417 | GameTooltip:SetOwner(unitFrame.auras[filter][i], "ANCHOR_BOTTOMLEFT", 0, -2); 418 | GameTooltip:SetUnitAura(unit, i, filter); 419 | 420 | C_Timer.After(0.025, function() 421 | if CFG.TooltipSpellID then 422 | GameTooltip:AddDoubleLine("Spell ID", spellId, nil, nil, nil, 1, 1, 1); 423 | end 424 | GameTooltip:Show(); 425 | end); 426 | end 427 | end 428 | 429 | unitFrame.auras[filter][i]:SetScript("OnEnter", function(self) 430 | hover = true; 431 | self:EnableMouse(ModifierState()); 432 | work(); 433 | end); 434 | 435 | unitFrame.auras[filter][i]:SetScript("OnLeave", function(self) 436 | hover = false; 437 | self:EnableMouse(ModifierState()); 438 | GameTooltip:Hide(); 439 | end); 440 | 441 | unitFrame.auras[filter][i]:RegisterEvent("MODIFIER_STATE_CHANGED"); 442 | unitFrame.auras[filter][i]:SetScript("OnEvent", function(self) 443 | self:EnableMouse(ModifierState()); 444 | end); 445 | end 446 | 447 | -- Border 448 | unitFrame.auras[filter][i].border:SetVertexColor(r,g,b); 449 | 450 | -- Stacks 451 | local showStacks = stacks > 0; 452 | unitFrame.auras[filter][i].stacks:SetText("x" .. stacks); 453 | unitFrame.auras[filter][i].stacks:SetShown(showStacks) 454 | unitFrame.auras[filter][i].stacks_shadow:SetShown(showStacks) 455 | 456 | -- Mark your own auras 457 | unitFrame.auras[filter][i].mark:SetVertexColor(CFG.AurasMarkColor.r, CFG.AurasMarkColor.g, CFG.AurasMarkColor.b); 458 | unitFrame.auras[filter][i].mark:SetShown(CFG.AurasMarkYours and sourceIsPlayer); 459 | unitFrame.auras[filter][i].mark:ClearAllPoints(); 460 | 461 | -- Cooldown 462 | unitFrame.auras[filter][i].cooldown:SetCooldown(GetTime() - (duration - (expirationTime - GetTime())), duration, timeMod); 463 | unitFrame.auras[filter][i].cooldown:SetReverse(CFG.AurasReverseAnimation); 464 | 465 | -- Icon 466 | unitFrame.auras[filter][i].icon:SetTexture(icon); 467 | 468 | -- Countdown 469 | unitFrame.auras[filter][i].countdown:SetText(func:formatTime(expirationTime - GetTime())); 470 | unitFrame.auras[filter][i].countdown:ClearAllPoints(); 471 | unitFrame.auras[filter][i].countdown:SetShown(CFG.AurasCountdown); 472 | if CFG.AurasCountdownPosition == 1 then 473 | unitFrame.auras[filter][i].countdown:SetPoint("topRight", unitFrame.auras[filter][i], "topRight", 3, 2); 474 | unitFrame.auras[filter][i].countdown:SetJustifyH("right"); 475 | elseif CFG.AurasCountdownPosition == 2 then 476 | unitFrame.auras[filter][i].countdown:SetPoint("center", unitFrame.auras[filter][i]); 477 | unitFrame.auras[filter][i].countdown:SetJustifyH("center"); 478 | end 479 | unitFrame.auras[filter][i].countdown_shadow:SetShown(CFG.AurasCountdown and duration > 0 and (expirationTime - GetTime()) > 0); 480 | 481 | -- Highlight 482 | unitFrame.auras[filter][i].highlight:SetVertexColor(r,g,b); 483 | unitFrame.auras[filter][i].highlight:SetShown(CFG.AurasImportantHighlight and data.settings.AurasImportantList[name]); 484 | 485 | -- Important auras adjustments 486 | local first_x, first_y = 64, 32; 487 | local second_x, second_y = 64, 32; 488 | local icon_x, icon_y = 28, 28; 489 | local cooldown_x, cooldown_y = 28, 24; 490 | local mark_x, mark_y = 18, 13; 491 | local shadow_x, shadow_y = 32, 28; 492 | 493 | if data.settings.AurasImportantList[name] then 494 | -- Adjusting scale 495 | unitFrame.auras[filter][i]:SetSize(AuraSize.x * CFG.AurasImportantScale, AuraSize.y * CFG.AurasImportantScale); 496 | unitFrame.auras[filter][i].first:SetSize(first_x * CFG.AurasImportantScale, first_y * CFG.AurasImportantScale); 497 | unitFrame.auras[filter][i].second:SetSize(second_x * CFG.AurasImportantScale, second_y * CFG.AurasImportantScale); 498 | unitFrame.auras[filter][i].icon:SetSize(icon_x * CFG.AurasImportantScale, icon_y * CFG.AurasImportantScale); 499 | unitFrame.auras[filter][i].cooldown_wrap:SetSize(cooldown_x * CFG.AurasImportantScale, cooldown_y * CFG.AurasImportantScale); 500 | unitFrame.auras[filter][i].mark:SetSize(mark_x * CFG.AurasImportantScale, mark_y * CFG.AurasImportantScale); 501 | unitFrame.auras[filter][i].countdown_shadow:SetSize(shadow_x * CFG.AurasImportantScale, shadow_y * CFG.AurasImportantScale); 502 | unitFrame.auras[filter][i].stacks_shadow:SetSize(shadow_x * CFG.AurasImportantScale, shadow_y * CFG.AurasImportantScale); 503 | 504 | if CFG.AurasMarkLocation == 1 then 505 | unitFrame.auras[filter][i].mark:SetPoint("top", unitFrame.auras[filter][i], "topLeft", 3 * CFG.AurasImportantScale, 2.5 * CFG.AurasImportantScale); 506 | elseif CFG.AurasMarkLocation == 2 then 507 | unitFrame.auras[filter][i].mark:SetPoint("top", unitFrame.auras[filter][i], "bottomLeft", 6 * CFG.AurasImportantScale, 7 * CFG.AurasImportantScale); 508 | end 509 | 510 | unitFrame.auras[filter][i].stacks:SetScale(CFG.AurasImportantScale - 0.2); 511 | unitFrame.auras[filter][i].countdown:SetScale(CFG.AurasImportantScale - 0.2); 512 | 513 | unitFrame.auras[filter][i].border:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\auras\\importantBorder2"); 514 | 515 | -- Flags 516 | unitFrame.auras[filter][i].isImportant = true; 517 | 518 | -- Inserting frames for further sorting 519 | table.insert(unitFrame.auras.toSort["important_" .. filter], unitFrame.auras[filter][i]); 520 | else 521 | -- Adjusting scale 522 | unitFrame.auras[filter][i]:SetSize(AuraSize.x * CFG.AurasScale, AuraSize.y * CFG.AurasScale); 523 | unitFrame.auras[filter][i].first:SetSize(first_x * CFG.AurasScale, first_y *- CFG.AurasScale); 524 | unitFrame.auras[filter][i].second:SetSize(second_x * CFG.AurasScale, second_y * CFG.AurasScale); 525 | unitFrame.auras[filter][i].icon:SetSize(icon_x * CFG.AurasScale, icon_y * CFG.AurasScale); 526 | unitFrame.auras[filter][i].cooldown_wrap:SetSize(cooldown_x * CFG.AurasScale, cooldown_y * CFG.AurasScale); 527 | unitFrame.auras[filter][i].mark:SetSize(mark_x * CFG.AurasScale, mark_y * CFG.AurasScale); 528 | unitFrame.auras[filter][i].countdown_shadow:SetSize(shadow_x * CFG.AurasScale, shadow_y * CFG.AurasScale); 529 | unitFrame.auras[filter][i].stacks_shadow:SetSize(shadow_x * CFG.AurasScale, shadow_y * CFG.AurasScale); 530 | 531 | if CFG.AurasMarkLocation == 1 then 532 | unitFrame.auras[filter][i].mark:SetPoint("top", unitFrame.auras[filter][i], "topLeft", 3 * CFG.AurasScale, 2.5 * CFG.AurasScale); 533 | elseif CFG.AurasMarkLocation == 2 then 534 | unitFrame.auras[filter][i].mark:SetPoint("top", unitFrame.auras[filter][i], "bottomLeft", 6 * CFG.AurasScale, 7 * CFG.AurasScale); 535 | end 536 | 537 | 538 | unitFrame.auras[filter][i].stacks:SetScale(CFG.AurasScale - 0.2); 539 | unitFrame.auras[filter][i].countdown:SetScale(CFG.AurasScale - 0.2); 540 | 541 | unitFrame.auras[filter][i].border:SetTexture("Interface\\addons\\ClassicPlatesPlus\\media\\auras\\border"); 542 | 543 | -- Flags 544 | unitFrame.auras[filter][i].isImportant = false; 545 | 546 | -- Inserting frames for further sorting 547 | if markStealable then 548 | table.insert(unitFrame.auras.toSort["stealable_" .. filter], unitFrame.auras[filter][i]); 549 | else 550 | table.insert(unitFrame.auras.toSort[filter], unitFrame.auras[filter][i]); 551 | end 552 | end 553 | 554 | -- Scripts 555 | local timeElapsed = 0; 556 | unitFrame.auras[filter][i]:SetScript("OnUpdate", function(self, elapsed) 557 | timeElapsed = timeElapsed + elapsed; 558 | 559 | if timeElapsed > 0.1 then 560 | local countdown = expirationTime - GetTime(); 561 | 562 | if countdown < 10 then 563 | self.countdown:SetVertexColor(1, 0.5, 0); 564 | else 565 | self.countdown:SetVertexColor(1, 0.82, 0); 566 | end 567 | 568 | self.countdown:SetText(func:formatTime(countdown)); 569 | end 570 | end); 571 | 572 | -- Flags 573 | unitFrame.auras[filter][i].name = name; 574 | unitFrame.auras[filter][i].type = filter; 575 | 576 | -- Showing aura 577 | unitFrame.auras[filter][i]:Show(); 578 | unitFrame.auras[filter][i].highlight.animationGrp:Play(); 579 | elseif unitFrame.auras[filter][i] then 580 | unitFrame.auras[filter][i]:Hide(); 581 | unitFrame.auras[filter][i].highlight.animationGrp:Stop(); 582 | end 583 | elseif unitFrame.auras[filter][i] then 584 | unitFrame.auras[filter][i]:Hide(); 585 | unitFrame.auras[filter][i].highlight.animationGrp:Stop(); 586 | else 587 | break; 588 | end 589 | end 590 | end 591 | 592 | getAuras("helpful"); 593 | getAuras("harmful"); 594 | 595 | ---------------------------------------- 596 | -- Sorting auras 597 | ---------------------------------------- 598 | local function sortAuras(toSortTable, sortedTable, maxAuras) 599 | for k,v in ipairs(toSortTable) do 600 | if k then 601 | if #sortedTable < maxAuras then 602 | table.insert(sortedTable, v); 603 | else 604 | v:Hide(); 605 | end 606 | end 607 | end 608 | end 609 | 610 | -- Sorting important auras first then normal ones 611 | if UnitIsPlayer then 612 | sortAuras(unitFrame.auras.toSort.important_helpful, unitFrame.auras.sorted.helpful, CFG.AurasPersonalMaxBuffs); 613 | sortAuras(unitFrame.auras.toSort.helpful, unitFrame.auras.sorted.helpful, CFG.AurasPersonalMaxBuffs); 614 | sortAuras(unitFrame.auras.toSort.important_harmful, unitFrame.auras.sorted.harmful, CFG.AurasPersonalMaxDebuffs); 615 | sortAuras(unitFrame.auras.toSort.harmful, unitFrame.auras.sorted.harmful, CFG.AurasPersonalMaxDebuffs); 616 | elseif canAttack then 617 | sortAuras(unitFrame.auras.toSort.important_helpful, unitFrame.auras.sorted.helpful, CFG.AurasMaxBuffsEnemy); 618 | sortAuras(unitFrame.auras.toSort.stealable_helpful, unitFrame.auras.sorted.helpful, CFG.AurasMaxBuffsEnemy); 619 | sortAuras(unitFrame.auras.toSort.helpful, unitFrame.auras.sorted.helpful, CFG.AurasMaxBuffsEnemy); 620 | sortAuras(unitFrame.auras.toSort.important_harmful, unitFrame.auras.sorted.harmful, CFG.AurasMaxDebuffsEnemy); 621 | sortAuras(unitFrame.auras.toSort.harmful, unitFrame.auras.sorted.harmful, CFG.AurasMaxDebuffsEnemy); 622 | else 623 | sortAuras(unitFrame.auras.toSort.important_helpful, unitFrame.auras.sorted.helpful, CFG.AurasMaxBuffsFriendly); 624 | sortAuras(unitFrame.auras.toSort.helpful, unitFrame.auras.sorted.helpful, CFG.AurasMaxBuffsFriendly); 625 | sortAuras(unitFrame.auras.toSort.important_harmful, unitFrame.auras.sorted.harmful, CFG.AurasMaxDebuffsFriendly); 626 | sortAuras(unitFrame.auras.toSort.harmful, unitFrame.auras.sorted.harmful, CFG.AurasMaxDebuffsFriendly); 627 | end 628 | 629 | ---------------------------------------- 630 | -- Call to position auras 631 | ---------------------------------------- 632 | func:PositionAuras(unitFrame, unit); 633 | 634 | ---------------------------------------- 635 | -- Auras counter 636 | ---------------------------------------- 637 | local function processAuras(counter, filter, maxAuras, pos1, pos2, x) 638 | local totalAuras = #unitFrame.auras.toSort["important_" .. filter] + #unitFrame.auras.toSort[filter]; 639 | 640 | if totalAuras > maxAuras then 641 | local sortedAuras = unitFrame.auras.sorted[filter]; 642 | local totalSorted = #sortedAuras; 643 | local anchor = filter == "harmful" and sortedAuras[totalSorted] or filter == "helpful" and sortedAuras[1]; 644 | 645 | if UnitIsPlayer and filter == "helpful" then 646 | anchor = sortedAuras[totalSorted]; 647 | end 648 | 649 | counter:ClearAllPoints(); 650 | counter:SetPoint(pos1, anchor, pos2, x, 0); 651 | counter:SetText("+" .. totalAuras - maxAuras); 652 | end 653 | 654 | counter:SetShown(CFG.AurasOverFlowCounter and totalAuras > maxAuras); 655 | end 656 | 657 | if UnitIsPlayer then 658 | processAuras(unitFrame.buffsCounter, "helpful", CFG.AurasPersonalMaxBuffs, "left", "right", 5); 659 | processAuras(unitFrame.debuffsCounter, "harmful", CFG.AurasPersonalMaxDebuffs, "left", "right", 5); 660 | elseif canAttack then 661 | processAuras(unitFrame.buffsCounter, "helpful", CFG.AurasMaxBuffsEnemy, "right", "left", -5); 662 | processAuras(unitFrame.debuffsCounter, "harmful", CFG.AurasMaxDebuffsEnemy, "left", "right", 5); 663 | else 664 | processAuras(unitFrame.buffsCounter, "helpful", CFG.AurasMaxBuffsFriendly, "right", "left", -5); 665 | processAuras(unitFrame.debuffsCounter, "harmful", CFG.AurasMaxDebuffsFriendly, "left", "right", 5); 666 | end 667 | 668 | -- Interact Icon 669 | func:InteractIcon(nameplate); 670 | end 671 | end 672 | end 673 | end 674 | 675 | ---------------------------------------- 676 | -- Position auras 677 | ---------------------------------------- 678 | function func:PositionAuras(unitFrame, unit) 679 | if unitFrame then 680 | unit = unit or unitFrame.unit; 681 | 682 | if unit then 683 | local CFG = CFG_Account_ClassicPlatesPlus.Profiles[CFG_ClassicPlatesPlus.Profile]; 684 | local resourceOnTarget = data.cvars.nameplateResourceOnTarget; 685 | local classFile = select(2, UnitClass("player")); 686 | local powerType = UnitPowerType("player"); 687 | local isPlayer = UnitIsUnit("player", unit); 688 | local isTarget = UnitIsUnit(unit, "target"); 689 | local class = 690 | classFile == "PALADIN" 691 | or classFile == "ROGUE" 692 | or classFile == "DEATHKNIGHT" 693 | or classFile == "WARLOCK" 694 | or classFile == "DRUID" and powerType == 3 695 | or classFile == "EVOKER" 696 | 697 | local function CountAuras(auras) 698 | local total = #auras; 699 | 700 | if total > 0 then 701 | local count_important = 0; 702 | local count_normal = 0; 703 | local count_gaps = 0; 704 | 705 | for i, aura in pairs(auras) do 706 | if i then 707 | if aura.isImportant then 708 | count_important = count_important + 1; 709 | else 710 | count_normal = count_normal + 1; 711 | end 712 | 713 | count_gaps = count_gaps + 1 714 | end 715 | end 716 | 717 | return count_normal, count_important, count_gaps - 1; 718 | else 719 | return 0, 0, 0; 720 | end 721 | end 722 | 723 | if unit and unitFrame.auras and unitFrame.auras.sorted then 724 | local total_helpful = #unitFrame.auras.sorted.helpful; 725 | local helpful_normal, helpful_important, helpful_gaps = CountAuras(unitFrame.auras.sorted.helpful); 726 | 727 | local total_harmful = #unitFrame.auras.sorted.harmful; 728 | local harmful_normal, harmful_important, harmful_gaps = CountAuras(unitFrame.auras.sorted.harmful); 729 | 730 | local halfSize = AuraSize.x / -2; 731 | local gap_width = 3; 732 | local x_helpful, x_harmful; 733 | local anchor, pos1, pos2, y; 734 | 735 | if data.isRetail and resourceOnTarget == "1" and unit and isTarget and class then 736 | anchor = unitFrame.classPower; 737 | elseif not data.isRetail and unitFrame.classPower:IsVisible() then 738 | anchor = unitFrame.classPower; 739 | else 740 | anchor = unitFrame.name; 741 | end 742 | 743 | if total_helpful > 0 then 744 | for i, aura in ipairs(unitFrame.auras.sorted.helpful) do 745 | if i == 1 then 746 | if isPlayer then 747 | anchor = unitFrame.healthbar; 748 | local x = halfSize * (helpful_normal * CFG.AurasScale + helpful_important * CFG.AurasImportantScale); 749 | local gaps = gap_width / -2 * helpful_gaps; 750 | 751 | x_helpful = x + gaps; 752 | y = 10 * CFG.PersonalNameplatesScale; 753 | else 754 | if total_harmful > 0 then 755 | local x1 = halfSize * (helpful_normal * CFG.AurasScale + helpful_important * CFG.AurasImportantScale); 756 | local x2 = halfSize * (harmful_normal * CFG.AurasScale + harmful_important * CFG.AurasImportantScale); 757 | local gaps = gap_width / -2 * (helpful_gaps + harmful_gaps) + gap_width * -1.5; 758 | 759 | x_helpful = x1 + x2 + gaps; 760 | else 761 | local x = halfSize * (helpful_normal * CFG.AurasScale + helpful_important * CFG.AurasImportantScale); 762 | local gaps = gap_width / -2 * helpful_gaps; 763 | 764 | x_helpful = x + gaps; 765 | end 766 | 767 | y = 6; 768 | end 769 | 770 | pos1, pos2 = "bottomLeft", "top"; 771 | else 772 | anchor = unitFrame.auras.sorted.helpful[i - 1]; 773 | x_helpful = gap_width; 774 | y = 0; 775 | pos1, pos2 = "BottomLeft", "BottomRight"; 776 | end 777 | 778 | aura:ClearAllPoints(); 779 | aura:SetPoint(pos1, anchor, pos2, x_helpful, y); 780 | end 781 | end 782 | 783 | if total_harmful > 0 then 784 | for i, aura in ipairs(unitFrame.auras.sorted.harmful) do 785 | if isPlayer then 786 | if i == 1 then 787 | pos1, pos2 = "topLeft", "bottom"; 788 | local x = halfSize * (harmful_normal * CFG.AurasScale + harmful_important * CFG.AurasImportantScale); 789 | local gaps = gap_width / -2 * harmful_gaps; 790 | 791 | x_harmful = x + gaps; 792 | 793 | if resourceOnTarget == "0" and class then 794 | anchor = unitFrame.classPower; 795 | 796 | if classFile == "PALADIN" then 797 | y = 0; 798 | else 799 | y = -8; 800 | end 801 | else 802 | if unitFrame.classPower:IsVisible() then 803 | anchor = unitFrame.classPower; 804 | elseif unitFrame.extraBar:IsShown() then 805 | anchor = unitFrame.extraBar; 806 | else 807 | anchor = unitFrame.powerbar; 808 | end 809 | 810 | y = -10; 811 | end 812 | else 813 | anchor = unitFrame.auras.sorted.harmful[i - 1]; 814 | 815 | x_harmful = gap_width; 816 | y = 0; 817 | pos1, pos2 = "topLeft", "topRight"; 818 | end 819 | else 820 | if i == 1 then 821 | if total_helpful > 0 then 822 | anchor = unitFrame.auras.sorted.helpful[total_helpful]; 823 | x_harmful = gap_width * 3; 824 | y = 0; 825 | 826 | pos1, pos2 = "bottomLeft", "bottomRight"; 827 | else 828 | local x = halfSize * (harmful_normal * CFG.AurasScale + harmful_important * CFG.AurasImportantScale); 829 | local gaps = gap_width / -2 * harmful_gaps; 830 | 831 | x_harmful = x + gaps; 832 | y = 6; 833 | pos1, pos2 = "bottomLeft", "top"; 834 | end 835 | else 836 | anchor = unitFrame.auras.sorted.harmful[i - 1]; 837 | x_harmful = gap_width; 838 | y = 0; 839 | pos1, pos2 = "bottomLeft", "bottomRight"; 840 | end 841 | end 842 | 843 | aura:ClearAllPoints(); 844 | aura:SetPoint(pos1, anchor, pos2, x_harmful, y); 845 | end 846 | end 847 | end 848 | end 849 | end 850 | end --------------------------------------------------------------------------------