Shestak UI
Go Back   Shestak UI > Interface Forums > English Community > Modified Versions

Modified Versions Your modified version of ShestakUI.

Advertising

 
Thread Tools
Old 10.09.2012, 15:23   #1
 Assistant User Information

leg883's Avatar
Lightbulb Chat Scroll Module "AddTheLowDown"

Scroll to the bottom automatically after 20 seconds
lua Code [Select]:
local Runtime = 20  -- Change this value if you want a different delay between your last scroll and the time the frame resets.  This value is in seconds.

local frame, handlers, running = CreateFrame("Frame"), {}, {}
frame.name = "TheLowDown"
frame:Hide()


frame:SetScript("OnUpdate", function (frame, elapsed)
    for name,v in pairs(handlers) do
        if running[name] then
            v.elapsed = v.elapsed + elapsed
            if v.elapsed >= v.rate then
                v.func(unpack(v))
                v.elapsed = 0
            end
        end
    end
end)


local function Register(name, func, rate, ...)
    handlers[name] = {
        name = name,
        func = func,
        rate = rate or 0,
        ...
    }
end


local function Start(name)
    handlers[name].elapsed = 0
    running[name] = true
    frame:Show()
end


local function Stop(name)
    running[name] = nil
    if not next(running) then frame:Hide() end
end

-------------------


local scrolldowns = {}
local delay = Runtime 
                    

local function ResetFrame(name, frame)
    Stop(name.."DownTimeout")
    Start(name.."DownTick")
end


local function ScrollOnce(name, frame)
    if frame:AtBottom() then Stop(name.."DownTick")
    else scrolldowns[name](frame) end
end


local _G = getfenv(0)
local funcs = {"ScrollUp", "ScrollDown", "ScrollToTop", "PageUp", "PageDown"}

for i=1,7 do
    local name = "ChatFrame" .. i
    local frame = _G[name]
    scrolldowns[name] = frame.ScrollDown
    Register(name.."DownTick", ScrollOnce, 0.1, name, frame)
    Register(name.."DownTimeout", ResetFrame, delay, name, frame)
    for _,func in ipairs(funcs) do
        local orig = frame[func]
        frame[func] = function(...)
            Stop(name.."DownTick")
            Start(name.."DownTimeout", 1)
            orig(...)
        end
    end
end

张贴在 75 小时 19 分钟
This code can be added to the ShestakUI?
Say Thank:
Shestak (07.09.2012)
Old 10.09.2012, 15:23   #1.5 - Disable Ads

Advertise on this site

Old 10.09.2012, 16:03   #2
Shestak
 Junior Member User Information

Shestak's Avatar
Quote:
Originally Posted by leg883 View Post
This code can be added to the ShestakUI?
No.
Old 10.09.2012, 16:19   #3
leg883
 Assistant User Information

leg883's Avatar
In fact, this is a very useful feature.

张贴在 9 分钟
It can make the chat content within a specified time scroll to the bottom.
I know that this code is bad,but you can add this feature, With Yourself code code.
Old 10.09.2012, 16:21   #4
Shestak
 Junior Member User Information

Shestak's Avatar
Quote:
Originally Posted by leg883 View Post
It can make the chat content within a specified time scroll to the bottom.
I know. But once again I will answer - no.
Old 10.09.2012, 16:25   #5
leg883
 Assistant User Information

leg883's Avatar
okay,i respect your choice.
Say Thank:
Shestak (10.09.2012)

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Fixed] AtlasLoot Skin - Module "Extra" F5Hellbound Bugs Reports 1 07.12.2011 19:37


Mobile Style Русский English Deutsch Italian Chinese