Bunch of fixes and refactoring for the Arena Trinket element
Hi, this is my first MR to the project and also first time writing LUA code. I didn't find any guidelines for code style or contributing in general. Let me know if i need to change something for the change to be accepted.
The oUF_Trinket module was using old APIs for managing enemy trinket cooldowns in arena, had breaking bugs and contained a few usability issues. With this MR i intend to fix the issues that i found related to the element by thoroughly testing it.
- Using wow API's to retrieve information about arena trinket cooldowns, spellID's, icon textures, etc. instead of hardcoding these values. The code and APIs used is inspired by Blizzard UI, sArena and Gladius, but is stripped down to fit ElvUI.
- Updated and added "general" icon textures, to improve UX
- #2310 (closed) - PvP Trinkets are not being tracked
- A hard to debug race-condition bug, where the Trinket frames is created after the "ARENA_OPPONENT_UPDATE" event was triggered, which led to trinket elements for specific arena# targets not be updated when the arena match starts. Fixed by handling the "OnShow" event in addition to "ARENA_OPPONENT_UPDATE".
- The Trinket element are now reset between arenas (Cooldown and icon texture). Previously the trinket element cooldowns and icon textures from the last arena was shown.
- Trinket elements are now shown if enabled and "Display Frames" are activated in the configuration. The icons shown is updated (more recent versions of faction specific pvp trinkets) and faction specific. A randomized cooldown will also be shown on the element, so the user can verify that cooldown text are shown properly.
- During arena preparation, the trinket icon will display a question mark, as we don't know what trinkets the opponents are using before the arena starts.
- If an opponent don't have a arena CC trinket equipped, the trinket element for that opponent are hidden (background and icon), for clarity.