1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
local FADE_OUT_DELAY = 3000
local FADE_IN_TIME = 250
local FADE_OUT_TIME = 750
local g_hasValidTarget = false
local g_isMousedOver = false
local g_actionBarReferences = 0
local g_actionBarHasAnAction = false
local g_holdingForFadeOut = false
local INSTANT = true
local ANIMATED = false
if g_showActionBarSetting == ACTION_BAR_SETTING_CHOICE_ON then
return true
elseif g_showActionBarSetting == ACTION_BAR_SETTING_CHOICE_OFF then
return false
else
local actionBarIsRelevant = ( g_hasValidTarget or g_isMousedOver or g_actionBarReferences > 0 )
if g_actionBarHasAnAction and actionBarIsRelevant then
return true
else
return false
end
end
end
local fadeInTime = speed == ANIMATED and FADE_IN_TIME or 0
local fadeOutTime = speed == ANIMATED and FADE_OUT_TIME or 0
return fadeInTime , fadeOutTime
end
g_holdingForFadeOut = false
end
end
if ( g_holdingForFadeOut ) then
g_holdingForFadeOut = false
end
else
--only wait to set the hidden reason if we're animating and the bar is actually showing
if ( not g_holdingForFadeOut ) then
g_holdingForFadeOut = true
end
else
end
end
end
if inCombat then
else
end
end
if settingType == SETTING_TYPE_UI then
if settingId == UI_SETTING_SHOW_ACTION_BAR then
end
end
end
local hadAnAction = g_actionBarHasAnAction
return hadAnAction ~= g_actionBarHasAnAction
end
local hadValidTarget = g_hasValidTarget
g_hasValidTarget = false
g_hasValidTarget = true
else
if ( reaction == UNIT_REACTION_FRIENDLY or reaction == UNIT_REACTION_PLAYER_ALLY or IsUnitFriendlyFollower ( "reticleover" ) ) then
if ( currentHealth < maxHealth ) then
g_hasValidTarget = true
end
end
end
end
return ( hadValidTarget ~= g_hasValidTarget )
end
end
end
end
end
end
end
g_isMousedOver = true
end
g_isMousedOver = false
end
end
g_actionBarReferences = g_actionBarReferences + 1
end
g_actionBarReferences = g_actionBarReferences - 1
end
if ( newState == SCENE_FRAGMENT_HIDING and g_holdingForFadeOut ) then
end
end )
EVENT_MANAGER : AddFilterForEvent ( "ZO_Contextual" , EVENT_POWER_UPDATE , REGISTER_FILTER_POWER_TYPE , POWERTYPE_HEALTH , REGISTER_FILTER_UNIT_TAG , "reticleover" )
EVENT_MANAGER : RegisterForEvent ( "ZO_Contextual" , EVENT_RETICLE_TARGET_CHANGED , OnReticleTargetChanged )
EVENT_MANAGER : RegisterForEvent ( "ZO_Contextual" , EVENT_INTERFACE_SETTING_CHANGED , OnInterfaceSettingChanged )
end
end |