function Torta.gui:MakeTaskVisible(taskID) |
assert(type(taskID) == "number", "Assertion failed: method MakeTaskVisible requires a number parameter (taskID)"); |
local scrollBar = getglobal(clScrollBar:GetName() .. "ScrollBar"); |
local offset = FauxScrollFrame_GetOffset(clScrollBar) + 1; |
local offset = FauxScrollFrame_GetOffset(clScrollBar); |
for i = 1, 1000 do -- just so we don't go into an infinite loop |
if self:IsTaskVisible(taskID) then break; end |
-- scrollBar:SetValue(scrollBar:GetValue() + 1); |
offset = offset + 1 |
if self:IsTaskVisible(taskID) then |
break; |
end |
|
FauxScrollFrame_SetOffset(clScrollBar, offset); |
FauxScrollFrame_Update(clScrollBar, #self.data.text, #self.clListButtons, 32, nil, nil, nil, nil, nil, nil, true) |
self:CheckCLButtons(); |
self:UpdateCLScrollBar(); |
offset = offset + 1 |
end |
scrollBar:SetValue(floor(offset * 32 + 0.5)); |
print(offset, scrollBar:GetValue()); |
-- print(offset, scrollBar:GetValue()); |
end |
|
FauxScrollFrame_SetOffset(explorerScrollBar, 0); |