function Castbars:FrameTimerRestore(frame, adjustTextWidth)
if (frame.mergingTradeSkill) then
if (frame.casting and frame.maxValue == frame.maxValueMerge) then
local secLeft = max(frame.maxValue - frame.value, 0);
local minLeft = floor(secLeft / 60);
frame.tmr:SetFormattedText("%d/%d - %d:%02d", frame.countCurrent, frame.countTotal, minLeft, secLeft - minLeft * 60);
end
elseif (frame.casting) then
if (frame.delayTime and self.db.profile[frame.configName]["ShowPushback"]) then
frame.tmr:SetFormattedText("|cFFFF0000+%.1f |cFFFFFFFF" .. frame.castTimeFormat, frame.delayTime, max(frame.maxValue - frame.value, 0), frame.maxValue);
else
frame.tmr:SetFormattedText(frame.castTimeFormat, max(frame.maxValue - frame.value, 0), frame.maxValue + (frame.delayTime or 0));
end
elseif (frame.channeling) then
frame.tmr:SetFormattedText(frame.castTimeFormat, max(frame.value, 0), frame.maxValue);
elseif (self.ConfigMode) then
if (self.db.profile[frame.configName]["ShowPushback"]) then
frame.tmr:SetFormattedText("|cFFFF0000+%.1f |cFFFFFFFF" .. frame.castTimeFormat, 0, 0, 0);
else
frame.tmr:SetFormattedText(frame.castTimeFormat, 0, 0);
end
elseif (frame.value and frame.timer) then -- MirrorTimer
if (not frame.expirationTime) then
local duration, expirationTime = select(6, UnitAura("player", frame.text:GetText(), nil, "HELPFUL|PLAYER|CANCELABLE"));
if (duration and expirationTime) then
frame.duration, frame.expirationTime = duration, expirationTime;
end
end
frame.value = frame.expirationTime and frame.expirationTime - GetTime() or frame.value;
frame.value = frame.duration and frame.value > frame.duration and frame.duration or frame.value;
frame.value = frame.value < 0 and 0 or frame.value;
local minLeft = floor(frame.value / 60);
frame.tmr:SetFormattedText("%d:%02d", minLeft, floor(frame.value - minLeft * 60));
else
frame.tmr:SetText();
end
if (frame.text and adjustTextWidth) then
frame.text:SetWidthReal(frame:GetWidth() - 10 - frame.tmr:GetWidth());
end
end