In the following snippet the slider works fine on live, does nothing in beta.
For some reason, :SetHorizontalScroll and :SetPoint methods don't work together.
Lua Code:
local Frame = CreateFrame('Frame', nil, UIParent)
Frame:SetPoint('CENTER')
Frame:SetSize(300, 40)
local Background = Frame:CreateTexture(nil, 'BORDER')
Background:SetAllPoints()
if(select(4, GetBuildInfo()) >= 70000) then
Background:SetColorTexture(1/3, 1/3, 1/3)
else
Background:SetTexture(1/3, 1/3, 1/3)
end
local ScrollFrame = CreateFrame('ScrollFrame', nil, Frame)
ScrollFrame:SetPoint('LEFT')
ScrollFrame:SetSize(300, 40)
local ScrollChild = CreateFrame('Frame')
ScrollChild:SetSize(ScrollFrame:GetSize())
ScrollFrame:SetScrollChild(ScrollChild)
local Portrait = CreateFrame('PlayerModel', nil, ScrollChild)
Portrait:SetAllPoints()
Portrait:SetPortraitZoom(1)
Portrait:RegisterEvent('UNIT_MODEL_CHANGED')
Portrait:SetScript('OnEvent', function()
Portrait:SetUnit('player')
end)
local Slider = CreateFrame('Slider', nil, UIParent, 'OptionsSliderTemplate')
Slider:SetPoint('TOP', Frame, 'BOTTOM', 0, -30)
Slider:SetMinMaxValues(0, 300)
Slider:SetValue(300)
Slider:SetScript('OnValueChanged', function(self, value)
local reverse = 300 - value
-- the following two lines don't work together on the beta, works fine on live
-- seperately they work just fine though, and there are no errors
ScrollFrame:SetPoint('LEFT', -reverse, 0)
ScrollFrame:SetHorizontalScroll(-reverse)
end)
If you print :GetHorizontalScroll and :GetPoint after setting them it shows that both changed, it just doesn't update properly on the beta.