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 |
ZO_ELSWEYR_BACKGROUND_FADE_DURATION_MS = 500
local GROUND_TEXTURE_WIDTH = 2048
local GROUND_TEXTURE_HEIGHT = 2048
local GROUND_TEXTURE_USED_WIDTH = 1920
local GROUND_TEXTURE_USED_HEIGHT = 1080
local GROUND_TEXTURE_MAX_U = GROUND_TEXTURE_USED_WIDTH / GROUND_TEXTURE_WIDTH
local GROUND_TEXTURE_MAX_V = GROUND_TEXTURE_USED_HEIGHT / GROUND_TEXTURE_HEIGHT
--Background
return obj
end
if newState == SCENE_SHOWING then
elseif newState == SCENE_HIDDEN then
end
end )
end
self . showTimeline = ANIMATION_MANAGER : CreateTimelineFromVirtual ( "ZO_ElsweyrBackgroundShowAnimation" , self . containerControl )
end
local STORM_DURATION_S = 12
local STORM_CYCLE_DURATION_S = 12
local SAND_MIN_WIDTH = 200
local SAND_MAX_WIDTH = 400
local SAND_MIN_SCALE = 2
local SAND_MAX_SCALE = 4
local SAND_MAX_SCALED_WIDTH = SAND_MAX_WIDTH * SAND_MAX_SCALE
local SAND_MAX_OFFSET_X_FROM_CENTER = 1000
local SAND_MAX_TRAVEL_DISTANCE_TO_LEAVE_SCREEN = SAND_MAX_OFFSET_X_FROM_CENTER + 1920 / 2 + SAND_MAX_SCALED_WIDTH
local SAND_MIN_SPEED = 600
local SAND_MAX_SPEED = 900
local SAND_FADE_IN_OVER_PERCENT = 0.2
function ElsweyrBackground : CreateSandParticleSystem ( waveDurationS , waveMagnitudeDegrees , numParticlesPerCycle , bandTopY , bandHeight )
if progress < SAND_FADE_IN_OVER_PERCENT then
else
return 1
end
end
sandParticleSystem : SetBurst ( numParticlesPerCycle * STORM_DURATION_S , STORM_DURATION_S , 0 , STORM_CYCLE_DURATION_S )
sandParticleSystem : SetParticleParameter ( "Width" , ZO_UniformRangeGenerator : New ( SAND_MIN_WIDTH , SAND_MAX_WIDTH ) )
sandParticleSystem : SetParticleParameter ( "Texture" , "EndAlpha" , "DrawLevel" , ZO_WeightedChoiceGenerator : New (
{ "EsoUI/Art/PregameAnimatedBackground/elsweyrSand.dds" , 0.08 , 1 } , 0.7 ,
{ "EsoUI/Art/PregameAnimatedBackground/elsweyrSandShadow.dds" , 0.16 , 0 } , 0.3 ) )
local angleGenerator = ZO_SmoothCycleGenerator : New ( math . rad ( - waveMagnitudeDegrees ) , math . rad ( waveMagnitudeDegrees ) )
sandParticleSystem : SetParticleParameter ( "BentArcVelocity" , "DurationS" , ZO_UniformRangeGenerator : New ( SAND_MIN_SPEED , SAND_MAX_SPEED , SAND_MAX_TRAVEL_DISTANCE_TO_LEAVE_SCREEN / SAND_MIN_SPEED , SAND_MAX_TRAVEL_DISTANCE_TO_LEAVE_SCREEN / SAND_MAX_SPEED ) )
sandParticleSystem : SetParticleParameter ( "StartOffsetX" , ZO_UniformRangeGenerator : New ( - SAND_MAX_OFFSET_X_FROM_CENTER / 2 , - SAND_MAX_OFFSET_X_FROM_CENTER ) )
sandParticleSystem : SetParticleParameter ( "StartOffsetY" , ZO_UniformRangeGenerator : New ( bandTopY , bandTopY + bandHeight ) )
return sandParticleSystem
end
stoneParticleSystem : SetParticleParameter ( "Texture" , "EsoUI/Art/PregameAnimatedBackground/elsweyrDust.dds" )
--Verical ranges that map to the sand area in the background image. Evenly distributed across the screen horizontally.
{ 0.32 , 0.75 } ,
{ 0.31 , 0.80 } ,
{ 0.34 , 0.82 } ,
{ 0.36 , 0.88 } ,
{ 0.34 , 0.87 } ,
{ 0.32 , 0.8 } ,
{ 0.32 , 0.75 } ,
{ 0.35 , 0.77 } ,
{ 0.33 , 0.85 } ,
} )
return stoneParticleSystem
end
local LIGHT_EMITTERS_CENTER_X = { - 1000 , - 670 , 340 , 670 , 1000 }
local LIGHT_EMITTER_RANGE_X = 50
local LIGHT_DURATION_S = 12
lightParticleSystem : SetParticleParameter ( "Texture" , "EsoUI/Art/PregameAnimatedBackground/lightShaft.dds" )
lightParticleSystem : SetParticleParameter ( "StartOffsetX" , ZO_UniformRangeGenerator : New ( offsetX - LIGHT_EMITTER_RANGE_X , offsetX + LIGHT_EMITTER_RANGE_X ) )
return lightParticleSystem
end
local DRAGON_FLIP_BOOK_PLAYBACK_INFO = { playbackType = ANIMATION_PLAYBACK_LOOP , loopCount = LOOP_INDEFINITELY }
local SECONDS_PER_DRAGON = 10
local FIRST_DRAGON_OFFSET_S = 2
local DRAGON_EMITTERS =
{
{ offsetX = ZO_UniformRangeGenerator : New ( - 900 , 900 ) , offsetY = 1300 , startRadians = ZO_UniformRangeGenerator : New ( math . rad ( 80 ) , math . rad ( 100 ) ) } ,
{ offsetX = - 1800 , offsetY = ZO_UniformRangeGenerator : New ( - 500 , 500 ) , startRadians = ZO_UniformRangeGenerator : New ( math . rad ( - 10 ) , math . rad ( 10 ) ) } ,
{ offsetX = ZO_UniformRangeGenerator : New ( - 900 , 900 ) , offsetY = - 1300 , startRadians = ZO_UniformRangeGenerator : New ( math . rad ( 260 ) , math . rad ( 280 ) ) } ,
{ offsetX = 1800 , offsetY = ZO_UniformRangeGenerator : New ( - 500 , 500 ) , startRadians = ZO_UniformRangeGenerator : New ( math . rad ( 170 ) , math . rad ( 190 ) ) } ,
}
shadowParticleSystem : SetBurst ( 1 , 1 , SECONDS_PER_DRAGON * ( index - 1 ) + FIRST_DRAGON_OFFSET_S , SECONDS_PER_DRAGON * # DRAGON_EMITTERS )
shadowParticleSystem : SetParticleParameter ( "Texture" , "EsoUI/Art/PregameAnimatedBackground/elsweyrDragonShadow.dds" )
shadowParticleSystem : SetParticleParameter ( "BentArcOrientWithMotionTextureRotationRadians" , math . rad ( 90 ) )
return shadowParticleSystem
end
local PARTICLES_PER_BAND =
{
2 ,
7 ,
10 ,
7 ,
2
}
local BAND_HEIGHT = 200
for i = 1 , # PARTICLES_PER_BAND do
local offsetY = - 500 + ( i - 1 ) * BAND_HEIGHT
table . insert ( self . particleSystems , self : CreateSandParticleSystem ( 12 , 2 , PARTICLES_PER_BAND [ i ] , offsetY , BAND_HEIGHT ) )
table . insert ( self . particleSystems , self : CreateSandParticleSystem ( 12 , 5 , PARTICLES_PER_BAND [ i ] , offsetY , BAND_HEIGHT ) )
end
table . insert ( self . particleSystems , self : CreateDragonShadowParticleSystem ( i , dragonInfo . offsetX , dragonInfo . offsetY , dragonInfo . startRadians ) )
end
end
end
end
end
end
end
local GROUND_ASPECT_RATIO = GROUND_TEXTURE_USED_WIDTH / GROUND_TEXTURE_USED_HEIGHT
local groundWidth = GROUND_ASPECT_RATIO * guiHeight
if groundWidth < guiWidth then
groundWidth = guiWidth
end
end
end
end
--Events
end
--Global XML Handlers
end
end |