Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- child.deco_up = CreateFrame("Button", nil, child)
- child.deco_up:SetPoint("TOPLEFT", child, "TOPLEFT", -4, 4)
- child.deco_up:SetPoint("BOTTOMRIGHT", child, "TOPRIGHT", 4, -spacing)
- child.deco_up:SetFrameStrata("DIALOG")
- child.deco_up:SetFrameLevel(128)
- child.deco_up:SetScript("OnClick", function()
- local scroll = this:GetParent()
- local current = scroll:GetVerticalScroll()
- local new = current - 25
- local max = scroll:GetVerticalScrollRange() + spacing
- if max > spacing then
- if new < 0 then
- scroll:SetVerticalScroll(0)
- elseif new > max then
- scroll:SetVerticalScroll(max)
- else
- scroll:SetVerticalScroll(new)
- end
- end
- scroll:UpdateScrollState()
- end)
- child.deco_up.fader = child.deco_up:CreateTexture("OVERLAY")
- child.deco_up.fader:SetTexture(1,1,1,1)
- child.deco_up.fader:SetGradientAlpha("VERTICAL", 0, 0, 0, 0, 0, 0, 0, 1)
- child.deco_up.fader:SetAllPoints(child.deco_up)
- child.deco_up_indicator = CreateFrame("Frame", nil, child.deco_up)
- child.deco_up_indicator:Hide()
- child.deco_up_indicator:SetPoint("TOP", child.deco_up, "TOP", 0, -6)
- child.deco_up_indicator:SetHeight(12)
- child.deco_up_indicator:SetWidth(12)
- child.deco_up_indicator.modifier = 0.03
- child.deco_up_indicator:SetScript("OnUpdate", function()
- local alpha = this:GetAlpha()
- if alpha >= .75 then
- this.modifier = -0.03
- elseif alpha <= .25 then
- this.modifier = 0.03
- end
- this:SetAlpha(alpha + this.modifier)
- end)
- child.deco_up_indicator.tex = child.deco_up_indicator:CreateTexture("OVERLAY")
- child.deco_up_indicator.tex:SetTexture("Interface\\AddOns\\pfUI\\img\\up")
- child.deco_up_indicator.tex:SetAllPoints(child.deco_up_indicator)
- child.deco_down = CreateFrame("Button", nil, child)
- child.deco_down:SetPoint("BOTTOMLEFT", child, "BOTTOMLEFT", -4, -4)
- child.deco_down:SetPoint("TOPRIGHT", child, "BOTTOMRIGHT", 4, spacing)
- child.deco_down:SetFrameStrata("DIALOG")
- child.deco_down:SetFrameLevel(128)
- child.deco_down:SetScript("OnClick", function()
- local scroll = this:GetParent()
- local current = scroll:GetVerticalScroll()
- local new = current + 25
- local max = scroll:GetVerticalScrollRange() + spacing
- if max > spacing then
- if new < 0 then
- scroll:SetVerticalScroll(0)
- elseif new > max then
- scroll:SetVerticalScroll(max)
- else
- scroll:SetVerticalScroll(new)
- end
- end
- scroll:UpdateScrollState()
- end)
- child.deco_down.fader = child.deco_down:CreateTexture("OVERLAY")
- child.deco_down.fader:SetTexture(1,1,1,1)
- child.deco_down.fader:SetGradientAlpha("VERTICAL", 0, 0, 0, 1, 0, 0, 0, 0)
- child.deco_down.fader:SetAllPoints(child.deco_down)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement