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 |
local TEXTURE_WIDTH = 1680
local TEXTURE_HEIGHT = 1050
local TEXTURE_ASPECT_RATIO = TEXTURE_WIDTH / TEXTURE_HEIGHT
local LOADING_TIP_PERCENTAGE = 0.8
local TARGET_FRAMERATE = 60
local MAX_FRAMES_PER_UPDATE = 5
local MAX_ROTATION = math . pi * 2
local ROTATION_PER_FRAME = - math . pi * . 02
local MINIMUM_TIME_TO_HOLD_LOADING_TIP_MS = 15000
-- Instance type icons
------------------------------
local INSTANCE_DISPLAY_TYPE_ICONS =
{
[ INSTANCE_DISPLAY_TYPE_SOLO ] = "EsoUI/Art/loadingTips/loadingTip_soloInstance.dds" ,
[ INSTANCE_DISPLAY_TYPE_DUNGEON ] = "EsoUI/Art/loadingTips/loadingTip_groupInstance.dds" ,
[ INSTANCE_DISPLAY_TYPE_RAID ] = "EsoUI/Art/loadingTips/loadingTip_raidDungeon.dds" ,
[ INSTANCE_DISPLAY_TYPE_GROUP_DELVE ] = "EsoUI/Art/loadingTips/loadingTip_groupDelve.dds" ,
[ INSTANCE_DISPLAY_TYPE_GROUP_AREA ] = "EsoUI/Art/Icons/mapKey/mapKey_groupArea.dds" ,
[ INSTANCE_DISPLAY_TYPE_PUBLIC_DUNGEON ] = "EsoUI/Art/Icons/mapKey/mapKey_publicDungeon.dds" ,
[ INSTANCE_DISPLAY_TYPE_DELVE ] = "EsoUI/Art/Icons/mapKey/mapKey_delve.dds" ,
[ INSTANCE_DISPLAY_TYPE_HOUSING ] = "EsoUI/Art/Icons/mapKey/mapKey_housing.dds" ,
}
return INSTANCE_DISPLAY_TYPE_ICONS [ instanceType ]
end
--Local implementation of object pool for key edge file
------------------------------
local g_keyEdgefileFreeList = { }
local g_keyEdgefileActiveList = { }
local keyEdgeFile = next ( g_keyEdgefileFreeList ) or GetWindowManager ( ) : CreateControlFromVirtual ( "" , LoadingScreenZoneDescription , "ZO_LoadingScreen_KeyBackdrop" )
g_keyEdgefileFreeList [ keyEdgeFile ] = nil
g_keyEdgefileActiveList [ keyEdgeFile ] = true
return keyEdgeFile
end
g_keyEdgefileActiveList [ keyEdgeFile ] = nil
g_keyEdgefileFreeList [ keyEdgeFile ] = true
end
end
--Loading Screen Object
-- Note: Must provide an InitializeAnimations function in derived classes
------------------------------
LoadingScreen_Base = { }
EVENT_MANAGER : RegisterForEvent ( self : GetSystemName ( ) , EVENT_AREA_LOAD_STARTED , function ( ... ) self : OnAreaLoadStarted ( ... ) end )
EVENT_MANAGER : RegisterForEvent ( self : GetSystemName ( ) , EVENT_SCREEN_RESIZED , function ( ... ) self : SizeLoadingTexture ( ... ) end )
EVENT_MANAGER : RegisterForEvent ( self : GetSystemName ( ) , EVENT_PREPARE_FOR_JUMP , function ( ... ) self : OnPrepareForJump ( ... ) end )
EVENT_MANAGER : RegisterForEvent ( self : GetSystemName ( ) , EVENT_JUMP_FAILED , function ( ... ) self : HideLoadingScreen ( ... ) end )
EVENT_MANAGER : RegisterForEvent ( self : GetSystemName ( ) , EVENT_DISCONNECTED_FROM_SERVER , function ( ... ) self : HideLoadingScreen ( ... ) end )
EVENT_MANAGER : RegisterForEvent ( self : GetSystemName ( ) , EVENT_RESUME_FROM_SUSPEND , function ( ... ) self : OnResumeFromSuspend ( ... ) end )
end
end
EVENT_MANAGER : RegisterForEvent ( self : GetSystemName ( ) , EVENT_SUBSYSTEM_LOAD_COMPLETE , OnSubsystemLoadComplete )
end
end
local screenAspectRatio = screenWidth / screenHeight
if TEXTURE_ASPECT_RATIO > screenAspectRatio then
local scale = screenHeight / TEXTURE_HEIGHT
else
local scale = screenWidth / TEXTURE_WIDTH
end
end
function LoadingScreen_Base : OnAreaLoadStarted ( evt , area , instance , zoneName , zoneDescription , loadingTexture , instanceType )
end
function LoadingScreen_Base : OnPrepareForJump ( evt , zoneName , zoneDescription , loadingTexture , instanceType )
end
end
end
else
end
end
end
local isDefaultTexture = "" == loadingTexture
if ( isDefaultTexture ) then
end
end
local showInstanceType = instanceType ~= INSTANCE_DISPLAY_TYPE_NONE
if not isDefaultTexture then
if ( showInstanceType ) then
end
if ( tip ~= "" ) then
else
end
else
end
end
--fade in the spinner on first showing the screen
end
end
end
end
-- App doesn't load libraries, so we don't have ZO_ClearTable, and it seems like a huge waste to bring it all over for this one call
end
end
end
if # self . pendingLoadingTips > 0 and self . timeShowingTipMS > MINIMUM_TIME_TO_HOLD_LOADING_TIP_MS then
end
end
local numFramesToIncrease = delta / TARGET_FRAMERATE
if numFramesToIncrease == 0 then
return
elseif numFramesToIncrease > MAX_FRAMES_PER_UPDATE then
numFramesToIncrease = MAX_FRAMES_PER_UPDATE
end
self . currentRotation = ( self . currentRotation + numFramesToIncrease * ROTATION_PER_FRAME ) % MAX_ROTATION
end
-- hold on other animations till background art is fully loaded
end
end
end
function LoadingScreen_Base : OnZoneDescriptionNewUserAreaCreated ( control , areaData , areaText , left , right , top , bottom )
if areaData == "key" then
end
end
end |