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 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 |
--Attribute Bar
-------------------
local DELAY_BEFORE_FADING = 1500
function ZO_PlayerAttributeBar : New ( control , barControls , powerType , unitOverride , secondPriorityUnitTag )
bar . barControls = barControls
bar . powerType = powerType
bar . unitTag = unitOverride or "player"
bar . secondPriorityUnitTag = secondPriorityUnitTag
bar . current = 0
bar . effectiveMax = 0
bar . fadeOutDelay = 0
bar . textEnabled = false
bar . forcedVisibleReferences = 0
control : RegisterForEvent ( EVENT_INTERFACE_SETTING_CHANGED , function ( _ , settingType , settingId ) bar : OnInterfaceSettingChanged ( settingType , settingId ) end )
control : RegisterForEvent ( EVENT_POWER_UPDATE , function ( _ , unitTag , powerPoolIndex , powerType , current , max , effectiveMax ) bar : OnPowerUpdate ( unitTag , powerPoolIndex , powerType , current , max , effectiveMax ) end )
if unitOverride or secondPriorityUnitTag then
control : RegisterForEvent ( EVENT_UNIT_CREATED , function ( _ , unitTag ) if self : IsUnitTag ( unitTag ) then self : UpdateStatusBar ( ) end end )
end
EVENT_MANAGER : RegisterForUpdate ( control : GetName ( ) .. "FadeUpdate" , DELAY_BEFORE_FADING , function ( ) bar : UpdateContextualFading ( ) end )
return bar
end
end
end
end
end
local gradient = ZO_POWER_BAR_GRADIENT_COLORS [ powerType ]
end
end
return false
end
local forceInit = false
forceInit = true
end
return
end
local barCurrent = current
barMax = barMax / 2
barCurrent = barCurrent / 2
end
end
if not forceInit then
end
end
end
end
local EXCLUDE_LINK_CHECK = true
return false
end
return false
end
return true
end
return true
end
return true
end
return true
end
end
return false
end
end
end
end
end
if shouldContextuallyShow then
else
end
end
end
end
end
end
end
end
end
else
end
end
end
end
--Events
function ZO_PlayerAttributeBar : OnPowerUpdate ( unitTag , powerPoolIndex , powerType , current , max , effectiveMax )
if ( self : IsUnitTag ( unitTag ) and self . powerType == powerType and ( current ~= self . current or max ~= self . max or effectiveMax ~= self . effectiveMax ) ) then
end
end
end
if settingType == SETTING_TYPE_UI then
if settingId == UI_SETTING_FADE_PLAYER_BARS then
elseif settingId == UI_SETTING_ALWAYS_SHOW_STATUS_TEXT then
end
end
end
--Attribute Bar Group
-----------------------
local NUM_BARS = 3
local NORMAL_WIDTH = 237
local EXPANDED_WIDTH = 323
local SHRUNK_WIDTH = 141
local BAR_OFFSET_FROM_SCREEN_EDGE = 502
local MIN_BAR_AREA_WIDTH = ( EXPANDED_WIDTH + 15 ) * NUM_BARS
local MAX_BAR_AREA_WIDTH = 1600
local PLAYER_ATTRIBUTE_VISUALIZER_SOUNDS =
{
[ STAT_HEALTH_MAX ] =
{
[ ATTRIBUTE_BAR_STATE_NORMAL ] = SOUNDS . UAV_MAX_HEALTH_NORMAL ,
[ ATTRIBUTE_BAR_STATE_EXPANDED ] = SOUNDS . UAV_MAX_HEALTH_INCREASED ,
[ ATTRIBUTE_BAR_STATE_SHRUNK ] = SOUNDS . UAV_MAX_HEALTH_DECREASED ,
} ,
[ STAT_MAGICKA_MAX ] =
{
[ ATTRIBUTE_BAR_STATE_NORMAL ] = SOUNDS . UAV_MAX_MAGICKA_NORMAL ,
[ ATTRIBUTE_BAR_STATE_EXPANDED ] = SOUNDS . UAV_MAX_MAGICKA_INCREASED ,
[ ATTRIBUTE_BAR_STATE_SHRUNK ] = SOUNDS . UAV_MAX_MAGICKA_DECREASED ,
} ,
[ STAT_STAMINA_MAX ] =
{
[ ATTRIBUTE_BAR_STATE_NORMAL ] = SOUNDS . UAV_MAX_STAMINA_NORMAL ,
[ ATTRIBUTE_BAR_STATE_EXPANDED ] = SOUNDS . UAV_MAX_STAMINA_INCREASED ,
[ ATTRIBUTE_BAR_STATE_SHRUNK ] = SOUNDS . UAV_MAX_STAMINA_DECREASED ,
} ,
[ STAT_HEALTH_REGEN_COMBAT ] =
{
[ STAT_STATE_INCREASE_GAINED ] = SOUNDS . UAV_INCREASED_HEALTH_REGEN_ADDED ,
[ STAT_STATE_INCREASE_LOST ] = SOUNDS . UAV_INCREASED_HEALTH_REGEN_LOST ,
[ STAT_STATE_DECREASE_GAINED ] = SOUNDS . UAV_DECREASED_HEALTH_REGEN_ADDED ,
[ STAT_STATE_DECREASE_LOST ] = SOUNDS . UAV_DECREASED_HEALTH_REGEN_LOST ,
} ,
[ STAT_MAGICKA_REGEN_COMBAT ] =
{
[ STAT_STATE_INCREASE_GAINED ] = SOUNDS . UAV_INCREASED_MAGICKA_REGEN_ADDED ,
[ STAT_STATE_INCREASE_LOST ] = SOUNDS . UAV_INCREASED_MAGICKA_REGEN_LOST ,
[ STAT_STATE_DECREASE_GAINED ] = SOUNDS . UAV_DECREASED_MAGICKA_REGEN_ADDED ,
[ STAT_STATE_DECREASE_LOST ] = SOUNDS . UAV_DECREASED_MAGICKA_REGEN_LOST ,
} ,
[ STAT_STAMINA_REGEN_COMBAT ] =
{
[ STAT_STATE_INCREASE_GAINED ] = SOUNDS . UAV_INCREASED_STAMINA_REGEN_ADDED ,
[ STAT_STATE_INCREASE_LOST ] = SOUNDS . UAV_INCREASED_STAMINA_REGEN_LOST ,
[ STAT_STATE_DECREASE_GAINED ] = SOUNDS . UAV_DECREASED_STAMINA_REGEN_ADDED ,
[ STAT_STATE_DECREASE_LOST ] = SOUNDS . UAV_DECREASED_STAMINA_REGEN_LOST ,
} ,
[ STAT_ARMOR_RATING ] =
{
[ STAT_STATE_INCREASE_GAINED ] = SOUNDS . UAV_INCREASED_ARMOR_ADDED ,
[ STAT_STATE_INCREASE_LOST ] = SOUNDS . UAV_INCREASED_ARMOR_LOST ,
[ STAT_STATE_DECREASE_GAINED ] = SOUNDS . UAV_DECREASED_ARMOR_ADDED ,
[ STAT_STATE_DECREASE_LOST ] = SOUNDS . UAV_DECREASED_ARMOR_LOST ,
} ,
[ STAT_POWER ] =
{
[ STAT_STATE_INCREASE_GAINED ] = SOUNDS . UAV_INCREASED_POWER_ADDED ,
[ STAT_STATE_INCREASE_LOST ] = SOUNDS . UAV_INCREASED_POWER_LOST ,
[ STAT_STATE_DECREASE_GAINED ] = SOUNDS . UAV_DECREASED_POWER_ADDED ,
[ STAT_STATE_DECREASE_LOST ] = SOUNDS . UAV_DECREASED_POWER_LOST ,
} ,
[ STAT_MITIGATION ] =
{
[ STAT_STATE_IMMUNITY_GAINED ] = SOUNDS . UAV_IMMUNITY_ADDED ,
[ STAT_STATE_IMMUNITY_LOST ] = SOUNDS . UAV_IMMUNITY_LOST ,
[ STAT_STATE_SHIELD_GAINED ] = SOUNDS . UAV_DAMAGE_SHIELD_ADDED ,
[ STAT_STATE_SHIELD_LOST ] = SOUNDS . UAV_DAMAGE_SHIELD_LOST ,
[ STAT_STATE_POSSESSION_APPLIED ] = SOUNDS . UAV_POSSESSION_APPLIED ,
[ STAT_STATE_POSSESSION_REMOVED ] = SOUNDS . UAV_POSSESSION_REMOVED ,
} ,
}
barGroup . forceVisible = false
local bars = { }
local healthBarControls = { GetControl ( healthControl , "BarLeft" ) , GetControl ( healthControl , "BarRight" ) }
healthControl . barControls = healthBarControls
local healthAttributeBar = ZO_PlayerAttributeBar : New ( healthControl , healthBarControls , POWERTYPE_HEALTH )
local siegeHealthBarControls = { GetControl ( siegeHealthControl , "BarLeft" ) , GetControl ( siegeHealthControl , "BarRight" ) }
siegeHealthControl . barControls = siegeHealthBarControls
local siegeHealthAttributeBar = ZO_PlayerAttributeBar : New ( siegeHealthControl , siegeHealthBarControls , POWERTYPE_HEALTH , "controlledsiege" , "escortedram" )
end
siegeHealthAttributeBar : SetExternalVisibilityRequirement ( function ( ) return IsGameCameraSiegeControlled ( ) or IsPlayerEscortingRam ( ) end )
magickaControl . barControls = magickaBarControls
local magickaAttributeBar = ZO_PlayerAttributeBar : New ( magickaControl , magickaBarControls , POWERTYPE_MAGICKA )
werewolfControl . barControls = werewolfBarControls
local werewolfAttributeBar = ZO_PlayerAttributeBar : New ( werewolfControl , werewolfBarControls , POWERTYPE_WEREWOLF )
control : RegisterForEvent ( EVENT_WEREWOLF_STATE_CHANGED , function ( ) werewolfAttributeBar : UpdateContextualFading ( ) end )
staminaControl . barControls = staminaBarControls
local staminaAttributeBar = ZO_PlayerAttributeBar : New ( staminaControl , staminaBarControls , POWERTYPE_STAMINA )
mountStaminaControl . barControls = mountStaminaBarControls
local mountStaminaAttributeBar = ZO_PlayerAttributeBar : New ( mountStaminaControl , mountStaminaBarControls , POWERTYPE_MOUNT_STAMINA )
control : RegisterForEvent ( EVENT_MOUNTED_STATE_CHANGED , function ( ) mountStaminaAttributeBar : UpdateContextualFading ( ) end )
barGroup . bars = bars
if change > 0 then
else
end
end
barGroup . forceShow = false
barGroup . attributeVisualizer = ZO_UnitAttributeVisualizer : New ( "player" , PLAYER_ATTRIBUTE_VISUALIZER_SOUNDS , healthControl , magickaControl , staminaControl , OnExternalControlCountChanged )
barGroup . attributeVisualizer : AddModule ( ZO_UnitVisualizer_ShrinkExpandModule : New ( NORMAL_WIDTH , EXPANDED_WIDTH , SHRUNK_WIDTH ) )
local armorDamageLayoutInfo =
{
increasedArmorBgContainerTemplate = "ZO_IncreasedArmorBgContainerArrow" ,
increasedArmorFrameContainerTemplate = "ZO_IncreasedArmorFrameContainerArrow" ,
increasedArmorBgLeftOffset = - 8 ,
increasedArmorBgTopOffset = - 7 ,
increasedArmorBgRightOffset = 8 ,
increasedArmorBgBottomOffset = 6 ,
decreasedArmorOverlayContainerTemplate = "ZO_DecreasedArmorOverlayContainerArrow" ,
increasedPowerGlowTemplate = "ZO_IncreasedPowerGlowArrow" ,
}
local unwaveringLayoutInfo =
{
overlayContainerTemplate = "ZO_UnwaveringOverlayContainerArrow" ,
overlayLeftOffset = 3 ,
overlayTopOffset = 3 ,
overlayRightOffset = - 3 ,
overlayBottomOffset = - 3 ,
}
barGroup . attributeVisualizer : AddModule ( ZO_UnitVisualizer_UnwaveringModule : New ( unwaveringLayoutInfo ) )
local possessionLayoutInfo =
{
overlayContainerTemplate = "ZO_PossessionOverlayContainerArrow" ,
overlayLeftOffset = 3 ,
overlayTopOffset = 3 ,
overlayRightOffset = - 3 ,
overlayBottomOffset = - 3 ,
possessionHaloGlowTemplate = "ZO_PossessionHaloGlowArrow" ,
}
barGroup . attributeVisualizer : AddModule ( ZO_UnitVisualizer_PossessionModule : New ( possessionLayoutInfo ) )
local powerShieldLayoutInfo =
{
barLeftOverlayTemplate = "ZO_PowerShieldBarLeftOverlayArrow" ,
barRightOverlayTemplate = "ZO_PowerShieldBarRightOverlayArrow" ,
}
barGroup . attributeVisualizer : AddModule ( ZO_UnitVisualizer_PowerShieldModule : New ( powerShieldLayoutInfo ) )
control : RegisterForEvent ( EVENT_GAMEPAD_PREFERRED_MODE_CHANGED , function ( ) barGroup : OnGamepadPreferredModeChanged ( ) end )
return barGroup
end
end
end
if forceShow then
else
end
end
end
end
local barAreaWidth = screenWidth - BAR_OFFSET_FROM_SCREEN_EDGE * 2
end
--Events
end
--XML
end |