View Single Post
06/04/14, 02:38 PM   #3
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
There is needed a bit more code to make it work. I think the best way is to ask Sideshow to add it...

If you want do all the job, you will need to add your new notification type to the Power.lua, Constants.lua, Notification.lua, Menu.lua, Defaults.lua and to the localization files.

If you just want to make it somehow work with no settings, you will need to make at least the following changes:
changed parts of Core\EventViewers\Notification.lua:
Lua Code:
  1. --lines 1 - 42 from the original code here
  2.     elseif (notificationType == 'COMBATCLOUD_NOTIFICATION_TYPE_EXECUTE' ) then
  3.         color = {1,0,0,1} --red color, format is {r, g, b, a}
  4.         text = self:FormatString('%t!', { value = value, text = 'Execute!' }) --displayed text will be "Execute!"
  5. --rest of the original code (lines 43 - 76) here

changed part of Core\EventListeners\Power.lua:
Lua Code:
  1. --lines 1-10 from the original code
  2.     self.executeWarning = false
  3. --lines 11-35 from the original code
  4.     if (unit == 'reticleover' and powerType == POWERTYPE_HEALTH) then
  5.         if not self.executeWarning and (power / powerMax) < 0.25 then --target's health is below 25%
  6.             self:TriggerEvent(CombatCloudConstants.eventType.NOTIFICATION, 'COMBATCLOUD_NOTIFICATION_TYPE_EXECUTE', power)
  7.             self.executeWarning = true
  8.         elseif (power / powerMax) > 0.35 --target's health > 35%
  9.             self.executeWarning = false
  10.         end
  11.     end
  12. end --line 36 from the original code
  Reply With Quote