Function: Shows the cooldowns of enemy players above their nameplates
The Ace3 library is not used and contains only two files: Localizations.lua and Nameplatecooldowns.lua
1, Localizations.lua, defined the multi-language interface text, using ADDONTABLE.L to pass the text content to Nameplatecooldowns.lua
Local addonname, addontable = ...;
ADDONTABLE.L = Locales[getlocale ()];
--nameplatecooldowns.lua--
Local addonname, addontable = ...;
Local L = ADDONTABLE.L;
...
Print (l["...
2, Nameplatecooldowns.lua find the name board checkfornewnameplates (), using the Wow API worldframe. The name board frame body is saved under the Worldframe box body, using Worldframe:getchildren (), by looking up the box body name matching string "nameplate", to find out all the name board frame body
3, the name board frame Body Hook script frame:hookscript ("OnShow", Nameplate_onshow) and Frame:hookscript ("Onhide", Nameplate_onhide), with the name board display settings, Call Updateonlyonenameplate to update the skill cooling icon. Updateonlyonenameplate creates and updates all skill CD icons on the name board by using the skill CD information saved prior to monitoring the battle log events. Create icons primarily through the Createframe function and use frame. Nciconscount and frame. Ncicons to save the icon and then update the icon state through a series of set functions
4, the entire plug-in main frame body eventframe, as the code entry, registered "Player_entering_world" and "combat_log_event_unfiltered" event listener function. The former initializes some of the content, which focuses on 4 variables: EventType, SrcName, Srcflags, Spellid. EventType monitoring "spell_cast_success", "spell_aura_applied", "spell_missed", "Spell_summon"; SrcName provide role name Srcflags is used to determine whether a hostile character, Spellid is a skill spell ID. Finally, update the name board icon with Updateonlyonenameplate.
5, finally is the '/NC ' command display of the configuration interface, this configuration interface is very practical, directly list each profession can monitor the skills, let us choose which to monitor, and the mouse to see the details of the skill. Guiframe is a simple frame that uses buttons, scrub bars, fonts, and so on to create an interface. The Skill icon button monitors "OnEnter", "Onleave", "OnClick" for displaying and hiding skill tooltip and configuring switch for skill monitoring
Nameplatecooldowns Plug-in analysis