Updated LibOpenRaid and DetailsFramework
This commit is contained in:
+110
-110
@@ -21,7 +21,7 @@ function gump:NewLabel2 (parent, container, member, text, font, size, color)
|
||||
if (member) then
|
||||
container [member] = newFontString
|
||||
end
|
||||
newFontString:SetText (text)
|
||||
newFontString:SetText(text)
|
||||
|
||||
if (size) then
|
||||
_detalhes:SetFontSize (newFontString, size)
|
||||
@@ -31,7 +31,7 @@ function gump:NewLabel2 (parent, container, member, text, font, size, color)
|
||||
newFontString:SetTextColor (unpack (color))
|
||||
end
|
||||
|
||||
newFontString:SetJustifyH ("LEFT")
|
||||
newFontString:SetJustifyH("LEFT")
|
||||
|
||||
return newFontString
|
||||
end
|
||||
@@ -48,13 +48,13 @@ function gump:NewDetailsButton (parent, container, instancia, func, param1, para
|
||||
|
||||
local new_button
|
||||
if (ischeck) then
|
||||
new_button = CreateFrame ("CheckButton", FrameName, parent, inherits)
|
||||
new_button = CreateFrame("CheckButton", FrameName, parent, inherits)
|
||||
else
|
||||
new_button = CreateFrame ("Button", FrameName, parent)
|
||||
new_button = CreateFrame("Button", FrameName, parent)
|
||||
end
|
||||
|
||||
new_button:SetWidth (w)
|
||||
new_button:SetHeight (h)
|
||||
new_button:SetWidth(w)
|
||||
new_button:SetHeight(h)
|
||||
|
||||
if (not pic_down and pic_up) then
|
||||
pic_down = pic_up
|
||||
@@ -66,32 +66,32 @@ function gump:NewDetailsButton (parent, container, instancia, func, param1, para
|
||||
pic_highlight = pic_up
|
||||
end
|
||||
|
||||
new_button:SetNormalTexture (pic_up)
|
||||
new_button:SetPushedTexture (pic_down)
|
||||
new_button:SetNormalTexture(pic_up)
|
||||
new_button:SetPushedTexture(pic_down)
|
||||
new_button:SetDisabledTexture (pic_disabled)
|
||||
new_button:SetHighlightTexture (pic_highlight, "ADD")
|
||||
new_button:SetHighlightTexture(pic_highlight, "ADD")
|
||||
|
||||
local new_text = new_button:CreateFontString (nil, "OVERLAY", "GameFontNormal")
|
||||
new_text:SetPoint ("center", new_button, "center")
|
||||
new_text:SetPoint("center", new_button, "center")
|
||||
new_button.text = new_text
|
||||
|
||||
new_button.supportFrame = CreateFrame ("frame", nil, new_button)
|
||||
new_button.supportFrame:SetPoint ("topleft", new_button, "topleft")
|
||||
new_button.supportFrame:SetPoint ("bottomright", new_button, "bottomright")
|
||||
new_button.supportFrame = CreateFrame("frame", nil, new_button)
|
||||
new_button.supportFrame:SetPoint("topleft", new_button, "topleft")
|
||||
new_button.supportFrame:SetPoint("bottomright", new_button, "bottomright")
|
||||
new_button.supportFrame:SetFrameLevel (new_button:GetFrameLevel()+1)
|
||||
|
||||
new_button.supportFrame.disable_overlay = new_button.supportFrame:CreateTexture (nil, "overlay")
|
||||
new_button.supportFrame.disable_overlay:SetTexture ("Interface\\AddOns\\Details\\images\\button_disable_overlay")
|
||||
new_button.supportFrame.disable_overlay:SetPoint ("topleft", new_button.supportFrame, "topleft")
|
||||
new_button.supportFrame.disable_overlay:SetPoint ("bottomright", new_button.supportFrame, "bottomright")
|
||||
new_button.supportFrame.disable_overlay = new_button.supportFrame:CreateTexture(nil, "overlay")
|
||||
new_button.supportFrame.disable_overlay:SetTexture("Interface\\AddOns\\Details\\images\\button_disable_overlay")
|
||||
new_button.supportFrame.disable_overlay:SetPoint("topleft", new_button.supportFrame, "topleft")
|
||||
new_button.supportFrame.disable_overlay:SetPoint("bottomright", new_button.supportFrame, "bottomright")
|
||||
new_button.supportFrame.disable_overlay:Hide()
|
||||
|
||||
local rightFunction = options.rightFunc
|
||||
|
||||
new_button:SetScript ("OnDisable", function()
|
||||
new_button:SetScript("OnDisable", function()
|
||||
new_button.supportFrame.disable_overlay:Show()
|
||||
end)
|
||||
new_button:SetScript ("OnEnable", function()
|
||||
new_button:SetScript("OnEnable", function()
|
||||
new_button.supportFrame.disable_overlay:Hide()
|
||||
end)
|
||||
|
||||
@@ -106,7 +106,7 @@ function gump:NewDetailsButton (parent, container, instancia, func, param1, para
|
||||
|
||||
new_button.enter = false
|
||||
|
||||
new_button:SetScript ("OnMouseDown", function(self, button)
|
||||
new_button:SetScript("OnMouseDown", function(self, button)
|
||||
if (not self:IsEnabled()) then
|
||||
return
|
||||
end
|
||||
@@ -140,7 +140,7 @@ function gump:NewDetailsButton (parent, container, instancia, func, param1, para
|
||||
end
|
||||
end)
|
||||
|
||||
new_button:SetScript ("OnMouseUp", function(self, button)
|
||||
new_button:SetScript("OnMouseUp", function(self, button)
|
||||
if (not self:IsEnabled()) then
|
||||
return
|
||||
end
|
||||
@@ -181,7 +181,7 @@ function gump:NewDetailsButton (parent, container, instancia, func, param1, para
|
||||
|
||||
new_button.tooltip = nil
|
||||
|
||||
new_button:SetScript ("OnEnter", function()
|
||||
new_button:SetScript("OnEnter", function()
|
||||
|
||||
new_button.enter = true
|
||||
|
||||
@@ -203,7 +203,7 @@ function gump:NewDetailsButton (parent, container, instancia, func, param1, para
|
||||
end
|
||||
end)
|
||||
|
||||
new_button:SetScript ("OnLeave", function()
|
||||
new_button:SetScript("OnLeave", function()
|
||||
|
||||
new_button.enter = false
|
||||
|
||||
@@ -221,10 +221,10 @@ function gump:NewDetailsButton (parent, container, instancia, func, param1, para
|
||||
end)
|
||||
|
||||
function new_button:ChangeIcon (icon1, icon2, icon3, icon4)
|
||||
new_button:SetNormalTexture (icon1)
|
||||
new_button:SetPushedTexture (icon2)
|
||||
new_button:SetNormalTexture(icon1)
|
||||
new_button:SetPushedTexture(icon2)
|
||||
new_button:SetDisabledTexture (icon3)
|
||||
new_button:SetHighlightTexture (icon4, "ADD")
|
||||
new_button:SetHighlightTexture(icon4, "ADD")
|
||||
end
|
||||
|
||||
function new_button:InstallCustomTexture (texture, rect)
|
||||
@@ -233,17 +233,17 @@ function gump:NewDetailsButton (parent, container, instancia, func, param1, para
|
||||
new_button:SetDisabledTexture("")
|
||||
new_button:SetHighlightTexture("")
|
||||
texture = texture or "Interface\\AddOns\\Details\\images\\default_button"
|
||||
new_button.texture = new_button:CreateTexture (nil, "background")
|
||||
new_button.texture = new_button:CreateTexture(nil, "background")
|
||||
|
||||
if (not rect) then
|
||||
new_button.texture:SetAllPoints (new_button)
|
||||
new_button.texture:SetAllPoints(new_button)
|
||||
else
|
||||
new_button.texture:SetPoint ("topleft", new_button, "topleft", rect.x1, rect.y1)
|
||||
new_button.texture:SetPoint ("bottomright", new_button, "bottomright", rect.x2, rect.y2)
|
||||
new_button.texture:SetPoint("topleft", new_button, "topleft", rect.x1, rect.y1)
|
||||
new_button.texture:SetPoint("bottomright", new_button, "bottomright", rect.x2, rect.y2)
|
||||
end
|
||||
|
||||
new_button.texture:SetTexCoord (0, 1, 0, 0.24609375)
|
||||
new_button.texture:SetTexture (texture)
|
||||
new_button.texture:SetTexture(texture)
|
||||
end
|
||||
|
||||
new_button.textColor = {}
|
||||
@@ -260,21 +260,21 @@ local EditBoxBackdrop = {
|
||||
|
||||
function gump:NewTextBox (parent, container, member, func, param1, param2, w, h, options)
|
||||
|
||||
local editbox = CreateFrame ("EditBox", "DetailsEditBox1", parent)
|
||||
local editbox = CreateFrame("EditBox", "DetailsEditBox1", parent)
|
||||
container [member] = editbox
|
||||
options = options or {}
|
||||
|
||||
editbox:SetAutoFocus (false)
|
||||
editbox:SetFontObject (GameFontHighlightSmall)
|
||||
|
||||
editbox:SetWidth (w)
|
||||
editbox:SetHeight (h)
|
||||
editbox:SetWidth(w)
|
||||
editbox:SetHeight(h)
|
||||
editbox:SetJustifyH("CENTER")
|
||||
editbox:EnableMouse (true)
|
||||
editbox:SetBackdrop (EditBoxBackdrop)
|
||||
editbox:SetBackdropColor (0, 0, 0, 0.5)
|
||||
editbox:SetBackdropBorderColor (0.3, 0.3, 0.30, 0.80)
|
||||
editbox:SetText ("") --localize-me
|
||||
editbox:SetBackdrop(EditBoxBackdrop)
|
||||
editbox:SetBackdropColor(0, 0, 0, 0.5)
|
||||
editbox:SetBackdropBorderColor(0.3, 0.3, 0.30, 0.80)
|
||||
editbox:SetText("") --localize-me
|
||||
|
||||
editbox.perdeu_foco = nil
|
||||
|
||||
@@ -284,15 +284,15 @@ function gump:NewTextBox (parent, container, member, func, param1, param2, w, h,
|
||||
editbox.tab_on_enter = options.TabOnEnterPress
|
||||
editbox.space = options.MySpace
|
||||
|
||||
gump:NewLabel (editbox, editbox, nil, "label", "", "GameFontHighlightSmall")
|
||||
gump:NewLabel(editbox, editbox, nil, "label", "", "GameFontHighlightSmall")
|
||||
editbox ["label"]: SetPoint ("right", editbox, "left", -2, 0)
|
||||
editbox.label:SetTextColor (.8, .8, .8, 1)
|
||||
|
||||
function editbox:SetPointAndSpace (MyAnchor, SnapTo, HisAnchor, x, y, Width)
|
||||
|
||||
if (type (MyAnchor) == "boolean" and MyAnchor and editbox.space) then
|
||||
if (type(MyAnchor) == "boolean" and MyAnchor and editbox.space) then
|
||||
local textWidth = editbox ["label"]:GetStringWidth()+2
|
||||
editbox:SetWidth (editbox.space - textWidth - 15)
|
||||
editbox:SetWidth(editbox.space - textWidth - 15)
|
||||
return
|
||||
|
||||
elseif (not editbox.space and not Width) then
|
||||
@@ -304,23 +304,23 @@ function gump:NewTextBox (parent, container, member, func, param1, param2, w, h,
|
||||
if (editbox.space) then
|
||||
editbox ["label"]:ClearAllPoints()
|
||||
editbox:ClearAllPoints()
|
||||
editbox ["label"]:SetPoint (MyAnchor, SnapTo, HisAnchor, x, y)
|
||||
editbox:SetPoint ("left", editbox["label"].widget, "right", 2, 0)
|
||||
editbox ["label"]:SetPoint(MyAnchor, SnapTo, HisAnchor, x, y)
|
||||
editbox:SetPoint("left", editbox["label"].widget, "right", 2, 0)
|
||||
|
||||
local textWidth = editbox ["label"]:GetStringWidth()+2
|
||||
editbox:SetWidth (editbox.space - textWidth - 15)
|
||||
editbox:SetWidth(editbox.space - textWidth - 15)
|
||||
end
|
||||
end
|
||||
|
||||
function editbox:SetLabelText (text)
|
||||
if (text) then
|
||||
editbox ["label"]:SetText (text)
|
||||
editbox ["label"]:SetText(text)
|
||||
else
|
||||
editbox ["label"]:SetText ("")
|
||||
editbox ["label"]:SetText("")
|
||||
end
|
||||
|
||||
if (editbox.space) then
|
||||
editbox:SetPointAndSpace (true) --> refresh
|
||||
editbox:SetPointAndSpace (true) --refresh
|
||||
end
|
||||
end
|
||||
|
||||
@@ -337,10 +337,10 @@ function gump:NewTextBox (parent, container, member, func, param1, param2, w, h,
|
||||
func (param1, param2, texto, editbox, byScript)
|
||||
end
|
||||
else
|
||||
editbox:SetText ("")
|
||||
editbox:SetText("")
|
||||
editbox.text = ""
|
||||
end
|
||||
editbox.perdeu_foco = true --> isso aqui pra quando estiver editando e clicar em outra caixa
|
||||
editbox.perdeu_foco = true --isso aqui pra quando estiver editando e clicar em outra caixa
|
||||
editbox:ClearFocus()
|
||||
|
||||
if (editbox.tab_on_enter and editbox.next) then
|
||||
@@ -352,9 +352,9 @@ function gump:NewTextBox (parent, container, member, func, param1, param2, w, h,
|
||||
EnterPress (byScript)
|
||||
end
|
||||
|
||||
editbox:SetScript ("OnEnterPressed", EnterPress)
|
||||
editbox:SetScript("OnEnterPressed", EnterPress)
|
||||
|
||||
editbox:SetScript ("OnEscapePressed", function()
|
||||
editbox:SetScript("OnEscapePressed", function()
|
||||
editbox:SetText("")
|
||||
editbox.text = ""
|
||||
editbox.perdeu_foco = true
|
||||
@@ -365,10 +365,10 @@ function gump:NewTextBox (parent, container, member, func, param1, param2, w, h,
|
||||
end
|
||||
end)
|
||||
|
||||
editbox:SetScript ("OnEnter", function()
|
||||
editbox:SetScript("OnEnter", function()
|
||||
editbox.mouse_over = true
|
||||
if (editbox:IsEnabled()) then
|
||||
editbox:SetBackdropBorderColor (0.5, 0.5, 0.5, 1)
|
||||
editbox:SetBackdropBorderColor(0.5, 0.5, 0.5, 1)
|
||||
end
|
||||
if (editbox.tooltip) then
|
||||
GameCooltip:Reset()
|
||||
@@ -384,7 +384,7 @@ function gump:NewTextBox (parent, container, member, func, param1, param2, w, h,
|
||||
end
|
||||
end)
|
||||
|
||||
editbox:SetScript ("OnLeave", function()
|
||||
editbox:SetScript("OnLeave", function()
|
||||
editbox.mouse_over = false
|
||||
if (editbox:IsEnabled()) then
|
||||
editbox:SetBackdropBorderColor(0.3, 0.3, 0.3, 0.8)
|
||||
@@ -408,7 +408,7 @@ function gump:NewTextBox (parent, container, member, func, param1, param2, w, h,
|
||||
|
||||
end)
|
||||
|
||||
editbox:SetScript ("OnEditFocusGained", function()
|
||||
editbox:SetScript("OnEditFocusGained", function()
|
||||
if (editbox.label) then
|
||||
editbox.label:SetTextColor (1, 1, 1, 1)
|
||||
end
|
||||
@@ -417,7 +417,7 @@ function gump:NewTextBox (parent, container, member, func, param1, param2, w, h,
|
||||
end
|
||||
end)
|
||||
|
||||
editbox:SetScript ("OnEditFocusLost", function()
|
||||
editbox:SetScript("OnEditFocusLost", function()
|
||||
|
||||
if (editbox:IsShown()) then
|
||||
if (editbox.perdeu_foco == nil) then
|
||||
@@ -428,7 +428,7 @@ function gump:NewTextBox (parent, container, member, func, param1, param2, w, h,
|
||||
func (param1, param2, texto, editbox, nil)
|
||||
end
|
||||
else
|
||||
editbox:SetText ("")
|
||||
editbox:SetText("")
|
||||
end
|
||||
else
|
||||
editbox.perdeu_foco = nil
|
||||
@@ -444,19 +444,19 @@ function gump:NewTextBox (parent, container, member, func, param1, param2, w, h,
|
||||
end
|
||||
end)
|
||||
|
||||
editbox:SetScript ("OnChar", function(self, text)
|
||||
editbox:SetScript("OnChar", function(self, text)
|
||||
if (editbox.InputHook) then
|
||||
editbox:InputHook (text)
|
||||
end
|
||||
end)
|
||||
|
||||
editbox:SetScript ("OnTextChanged", function(self, userChanged)
|
||||
editbox:SetScript("OnTextChanged", function(self, userChanged)
|
||||
if (editbox.TextChangeedHook and userChanged) then
|
||||
editbox:TextChangeedHook (userChanged)
|
||||
end
|
||||
end)
|
||||
|
||||
editbox:SetScript ("OnTabPressed", function()
|
||||
editbox:SetScript("OnTabPressed", function()
|
||||
if (editbox.next) then
|
||||
EnterPress()
|
||||
editbox.next:SetFocus()
|
||||
@@ -491,20 +491,20 @@ end
|
||||
|
||||
function gump:NewScrollBar2 (master, slave, x, y)
|
||||
|
||||
local slider_gump = CreateFrame ("Slider", master:GetName() and master:GetName() .. "SliderGump" or "DetailsSliderGump" .. math.random (1, 10000000), master)
|
||||
local slider_gump = CreateFrame("Slider", master:GetName() and master:GetName() .. "SliderGump" or "DetailsSliderGump" .. math.random (1, 10000000), master)
|
||||
slider_gump.scrollMax = 560 --default - tamanho da janela de fundo
|
||||
|
||||
-- ///// SLIDER /////
|
||||
slider_gump:SetPoint ("TOPLEFT", master, "TOPRIGHT", x, y)
|
||||
slider_gump:SetPoint("TOPLEFT", master, "TOPRIGHT", x, y)
|
||||
slider_gump.ativo = true
|
||||
|
||||
slider_gump.bg = slider_gump:CreateTexture (nil, "BACKGROUND")
|
||||
slider_gump.bg:SetAllPoints (true)
|
||||
slider_gump.bg:SetTexture (0, 0, 0, 0)
|
||||
slider_gump.bg = slider_gump:CreateTexture(nil, "BACKGROUND")
|
||||
slider_gump.bg:SetAllPoints(true)
|
||||
slider_gump.bg:SetTexture(0, 0, 0, 0)
|
||||
--coisinha do meio
|
||||
slider_gump.thumb = slider_gump:CreateTexture (nil, "OVERLAY")
|
||||
slider_gump.thumb:SetTexture ("Interface\\Buttons\\UI-ScrollBar-Knob")
|
||||
slider_gump.thumb:SetSize (29, 30)
|
||||
slider_gump.thumb = slider_gump:CreateTexture(nil, "OVERLAY")
|
||||
slider_gump.thumb:SetTexture("Interface\\Buttons\\UI-ScrollBar-Knob")
|
||||
slider_gump.thumb:SetSize(29, 30)
|
||||
slider_gump:SetThumbTexture (slider_gump.thumb)
|
||||
|
||||
slider_gump:SetOrientation ("VERTICAL")
|
||||
@@ -513,29 +513,29 @@ function gump:NewScrollBar2 (master, slave, x, y)
|
||||
slider_gump:SetValue(0)
|
||||
slider_gump.ultimo = 0
|
||||
|
||||
local botao_cima = CreateFrame ("Button", slider_gump:GetName() .. "UpButton", master)
|
||||
local botao_cima = CreateFrame("Button", slider_gump:GetName() .. "UpButton", master)
|
||||
|
||||
botao_cima:SetWidth (29)
|
||||
botao_cima:SetHeight (32)
|
||||
botao_cima:SetNormalTexture ([[Interface\Buttons\Arrow-Up-Up]])
|
||||
botao_cima:SetPushedTexture ([[Interface\Buttons\Arrow-Up-Down]])
|
||||
botao_cima:SetWidth(29)
|
||||
botao_cima:SetHeight(32)
|
||||
botao_cima:SetNormalTexture([[Interface\Buttons\Arrow-Up-Up]])
|
||||
botao_cima:SetPushedTexture([[Interface\Buttons\Arrow-Up-Down]])
|
||||
botao_cima:SetDisabledTexture ([[Interface\Buttons\Arrow-Up-Disabled]])
|
||||
botao_cima:Show()
|
||||
botao_cima:Disable()
|
||||
|
||||
botao_cima:SetPoint ("BOTTOM", slider_gump, "TOP", 0, -12)
|
||||
botao_cima:SetPoint("BOTTOM", slider_gump, "TOP", 0, -12)
|
||||
botao_cima.x = 0
|
||||
botao_cima.y = -12
|
||||
|
||||
local botao_baixo = CreateFrame ("Button", slider_gump:GetName() .. "DownButton", master)
|
||||
botao_baixo:SetPoint ("TOP", slider_gump, "BOTTOM", 0, 12)
|
||||
local botao_baixo = CreateFrame("Button", slider_gump:GetName() .. "DownButton", master)
|
||||
botao_baixo:SetPoint("TOP", slider_gump, "BOTTOM", 0, 12)
|
||||
botao_baixo.x = 0
|
||||
botao_baixo.y = 12
|
||||
|
||||
botao_baixo:SetWidth (29)
|
||||
botao_baixo:SetHeight (32)
|
||||
botao_baixo:SetNormalTexture ([[Interface\Buttons\Arrow-Down-Up]])
|
||||
botao_baixo:SetPushedTexture ([[Interface\Buttons\Arrow-Down-Down]])
|
||||
botao_baixo:SetWidth(29)
|
||||
botao_baixo:SetHeight(32)
|
||||
botao_baixo:SetNormalTexture([[Interface\Buttons\Arrow-Down-Up]])
|
||||
botao_baixo:SetPushedTexture([[Interface\Buttons\Arrow-Down-Down]])
|
||||
botao_baixo:SetDisabledTexture ([[Interface\Buttons\Arrow-Down-Disabled]])
|
||||
botao_baixo:Show()
|
||||
botao_baixo:Disable()
|
||||
@@ -544,7 +544,7 @@ function gump:NewScrollBar2 (master, slave, x, y)
|
||||
master.cima = botao_cima
|
||||
master.slider = slider_gump
|
||||
|
||||
botao_baixo:SetScript ("OnMouseDown", function(self)
|
||||
botao_baixo:SetScript("OnMouseDown", function(self)
|
||||
if (not slider_gump:IsEnabled()) then
|
||||
return
|
||||
end
|
||||
@@ -552,70 +552,70 @@ function gump:NewScrollBar2 (master, slave, x, y)
|
||||
local current = slider_gump:GetValue()
|
||||
local minValue, maxValue = slider_gump:GetMinMaxValues()
|
||||
if (current+5 < maxValue) then
|
||||
slider_gump:SetValue (current+5)
|
||||
slider_gump:SetValue(current+5)
|
||||
else
|
||||
slider_gump:SetValue (maxValue)
|
||||
slider_gump:SetValue(maxValue)
|
||||
end
|
||||
self.precionado = true
|
||||
self.last_up = -0.3
|
||||
self:SetScript ("OnUpdate", function(self, elapsed)
|
||||
self:SetScript("OnUpdate", function(self, elapsed)
|
||||
self.last_up = self.last_up + elapsed
|
||||
if (self.last_up > 0.03) then
|
||||
self.last_up = 0
|
||||
local current = slider_gump:GetValue()
|
||||
local minValue, maxValue = slider_gump:GetMinMaxValues()
|
||||
if (current+2 < maxValue) then
|
||||
slider_gump:SetValue (current+2)
|
||||
slider_gump:SetValue(current+2)
|
||||
else
|
||||
slider_gump:SetValue (maxValue)
|
||||
slider_gump:SetValue(maxValue)
|
||||
end
|
||||
end
|
||||
end)
|
||||
end)
|
||||
botao_baixo:SetScript ("OnMouseUp", function(self)
|
||||
botao_baixo:SetScript("OnMouseUp", function(self)
|
||||
self.precionado = false
|
||||
self:SetScript ("OnUpdate", nil)
|
||||
self:SetScript("OnUpdate", nil)
|
||||
end)
|
||||
|
||||
botao_cima:SetScript ("OnMouseDown", function(self)
|
||||
botao_cima:SetScript("OnMouseDown", function(self)
|
||||
if (not slider_gump:IsEnabled()) then
|
||||
return
|
||||
end
|
||||
|
||||
local current = slider_gump:GetValue()
|
||||
if (current-5 > 0) then
|
||||
slider_gump:SetValue (current-5)
|
||||
slider_gump:SetValue(current-5)
|
||||
else
|
||||
slider_gump:SetValue (0)
|
||||
slider_gump:SetValue(0)
|
||||
end
|
||||
self.precionado = true
|
||||
self.last_up = -0.3
|
||||
self:SetScript ("OnUpdate", function(self, elapsed)
|
||||
self:SetScript("OnUpdate", function(self, elapsed)
|
||||
self.last_up = self.last_up + elapsed
|
||||
if (self.last_up > 0.03) then
|
||||
self.last_up = 0
|
||||
local current = slider_gump:GetValue()
|
||||
if (current-2 > 0) then
|
||||
slider_gump:SetValue (current-2)
|
||||
slider_gump:SetValue(current-2)
|
||||
else
|
||||
slider_gump:SetValue (0)
|
||||
slider_gump:SetValue(0)
|
||||
end
|
||||
end
|
||||
end)
|
||||
end)
|
||||
botao_cima:SetScript ("OnMouseUp", function(self)
|
||||
botao_cima:SetScript("OnMouseUp", function(self)
|
||||
self.precionado = false
|
||||
self:SetScript ("OnUpdate", nil)
|
||||
self:SetScript("OnUpdate", nil)
|
||||
end)
|
||||
--> isso aqui pra quando o slider ativar, o scroll fica na posi��o zero
|
||||
botao_cima:SetScript ("OnEnable", function(self)
|
||||
--isso aqui pra quando o slider ativar, o scroll fica na posi��o zero
|
||||
botao_cima:SetScript("OnEnable", function(self)
|
||||
local current = slider_gump:GetValue()
|
||||
if (current == 0) then
|
||||
botao_cima:Disable()
|
||||
end
|
||||
end)
|
||||
|
||||
slider_gump:SetScript ("OnValueChanged", function(self)
|
||||
slider_gump:SetScript("OnValueChanged", function(self)
|
||||
local current = self:GetValue()
|
||||
master:SetVerticalScroll (current)
|
||||
|
||||
@@ -635,22 +635,22 @@ function gump:NewScrollBar2 (master, slave, x, y)
|
||||
|
||||
end)
|
||||
|
||||
slider_gump:SetScript ("OnShow", function(self)
|
||||
slider_gump:SetScript("OnShow", function(self)
|
||||
botao_cima:Show()
|
||||
botao_baixo:Show()
|
||||
end)
|
||||
|
||||
slider_gump:SetScript ("OnDisable", function(self)
|
||||
slider_gump:SetScript("OnDisable", function(self)
|
||||
botao_cima:Disable()
|
||||
botao_baixo:Disable()
|
||||
end)
|
||||
|
||||
slider_gump:SetScript ("OnEnable", function(self)
|
||||
slider_gump:SetScript("OnEnable", function(self)
|
||||
botao_cima:Enable()
|
||||
botao_baixo:Enable()
|
||||
end)
|
||||
|
||||
master:SetScript ("OnMouseWheel", function(self, delta)
|
||||
master:SetScript("OnMouseWheel", function(self, delta)
|
||||
if (not slider_gump:IsEnabled()) then
|
||||
return
|
||||
end
|
||||
@@ -660,22 +660,22 @@ function gump:NewScrollBar2 (master, slave, x, y)
|
||||
--baixo
|
||||
local minValue, maxValue = slider_gump:GetMinMaxValues()
|
||||
if (current + (master.wheel_jump or 20) < maxValue) then
|
||||
slider_gump:SetValue (current + (master.wheel_jump or 20))
|
||||
slider_gump:SetValue(current + (master.wheel_jump or 20))
|
||||
else
|
||||
slider_gump:SetValue (maxValue)
|
||||
slider_gump:SetValue(maxValue)
|
||||
end
|
||||
elseif (delta > 0) then
|
||||
--cima
|
||||
if (current + (master.wheel_jump or 20) > 0) then
|
||||
slider_gump:SetValue (current - (master.wheel_jump or 20))
|
||||
slider_gump:SetValue(current - (master.wheel_jump or 20))
|
||||
else
|
||||
slider_gump:SetValue (0)
|
||||
slider_gump:SetValue(0)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
function slider_gump:Altura (h)
|
||||
self:SetHeight (h)
|
||||
self:SetHeight(h)
|
||||
end
|
||||
|
||||
function slider_gump:Update (desativar)
|
||||
@@ -705,11 +705,11 @@ function gump:NewScrollBar2 (master, slave, x, y)
|
||||
end
|
||||
|
||||
function slider_gump:cimaPoint (x, y)
|
||||
botao_cima:SetPoint ("BOTTOM", slider_gump, "TOP", x, (y)-12)
|
||||
botao_cima:SetPoint("BOTTOM", slider_gump, "TOP", x, (y)-12)
|
||||
end
|
||||
|
||||
function slider_gump:baixoPoint (x, y)
|
||||
botao_baixo:SetPoint ("TOP", slider_gump, "BOTTOM", x, (y)+12)
|
||||
botao_baixo:SetPoint("TOP", slider_gump, "BOTTOM", x, (y)+12)
|
||||
end
|
||||
|
||||
return slider_gump
|
||||
|
||||
Reference in New Issue
Block a user