Nameplatecooldowns Plug-in analysis

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.