代码拉取完成,页面将自动刷新
STREAMING_CURRENT_STATUS = 0;
function StreamingIcon_OnLoad(self)
self:RegisterEvent("STREAMING_ICON");
self:RegisterEvent("PLAYER_ENTERING_WORLD");
end
function StreamingIcon_OnEvent(self, event, ...)
if(GetCVarBool("streamStatusMessage")) then
if event == "STREAMING_ICON" then
local status = ...;
StreamingIcon_UpdateIcon(status);
elseif event == "PLAYER_ENTERING_WORLD" then
StreamingIcon_UpdateIcon(GetFileStreamingStatus());
end
end
end
function StreamingIcon_UpdateIcon(status)
if(status > 0) then
if (status == 1) then
StreamingIconSpinSpinner:SetVertexColor(0,1,0);
StreamingIconFrameBackground:SetVertexColor(0,1,0);
StreamingIcon.tooltip = STATUS_ADDL_FILE_TOOLTIP;
elseif (status == 2) then
StreamingIconSpinSpinner:SetVertexColor(1,.82,0);
StreamingIconFrameBackground:SetVertexColor(1,0.82,0);
StreamingIcon.tooltip = STATUS_MAJOR_FILE_TOOLTIP;
elseif (status == 3) then
StreamingIconSpinSpinner:SetVertexColor(1,0,0);
StreamingIconFrameBackground:SetVertexColor(1,0,0);
StreamingIcon.tooltip = STATUS_CORE_FILE_TOOLTIP;
end
if (StreamingIcon.FadeOUT:IsPlaying()) then
local alpha = StreamingIcon:GetAlpha();
StreamingIcon.FadeOUT:Stop();
StreamingIcon:SetAlpha(alpha);
end
StreamingIcon.FadeIN:Play();
StreamingIcon.Loop:Play();
StreamingIcon:Show();
elseif(STREAMING_CURRENT_STATUS > 0) then
StreamingIconSpinSpinner:SetVertexColor(0,1,0);
StreamingIconFrameBackground:SetVertexColor(0,1,0);
StreamingIcon.tooltip = STATUS_ADDL_FILE_TOOLTIP;
if (StreamingIcon.FadeIN:IsPlaying()) then
local alpha = StreamingIcon:GetAlpha();
StreamingIcon.FadeIN:Stop();
StreamingIcon:SetAlpha(alpha);
end
StreamingIcon.FadeOUT:Play();
end
STREAMING_CURRENT_STATUS = status;
end
function StreamingFrame_FadeIN_OnFinished()
StreamingIcon:SetAlpha(1);
end
function StreamingFrame_FadeOUT_OnFinished()
StreamingIcon:SetAlpha(0)
StreamingIcon:Hide();
end
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。