Thread Tools Display Modes
05-03-16, 03:42 PM   #1
feraldrood
A Theradrim Guardian
 
feraldrood's Avatar
Join Date: Dec 2008
Posts: 62
DBM sliders!

Hi, Anyone know how to adjust the min/max values for the fontsize/barheight sliders in dbm?

I'm digging through the code atm, but on the offchance someone knows I would appreciate the wisdom.
  Reply With Quote
05-04-16, 01:02 PM   #2
Yukyuk
A Chromatic Dragonspawn
 
Yukyuk's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2015
Posts: 179
In DBM-GUI.lua

This part is used to create the silders.

Lua Code:
  1. -- This function creates a slider for numeric values
  2. --
  3. --  arg1 = text ontop of the slider, centered
  4. --  arg2 = lowest value
  5. --  arg3 = highest value
  6. --  arg4 = stepping
  7. --  arg5 = framewidth
  8. --
  9. do
  10.     local function onValueChanged(font, text)
  11.         return function(self, value)
  12.             font:SetFormattedText(text, value)
  13.         end
  14.     end
  15.     function PanelPrototype:CreateSlider(text, low, high, step, framewidth)
  16.         local slider = CreateFrame('Slider', FrameTitle..self:GetNewID(), self.frame, 'OptionsSliderTemplate')
  17.         slider.mytype = "slider"
  18.         slider.myheight = 50
  19.         slider:SetMinMaxValues(low, high)
  20.         slider:SetValueStep(step)
  21.         slider:SetWidth(framewidth or 180)
  22.         _G[FrameTitle..self:GetCurrentID()..'Text']:SetText(text)
  23.         slider:SetScript("OnValueChanged", onValueChanged(_G[FrameTitle..self:GetCurrentID()..'Text'], text))
  24.         self:SetLastObj(slider)
  25.         return slider
  26.     end
  27. end

On line 2275 in the same file (see below).
7 is the minimum font size.
18 is the maximum font size.
You guess the min, max values for the Bar Height

Lua Code:
  1. local FontSizeSlider = BarSetup:CreateSlider(L.Bar_FontSize, 7, 18, 1)
  2.         FontSizeSlider:SetPoint("TOPLEFT", BarSetup.frame, "TOPLEFT", 20, -175)
  3.         FontSizeSlider:SetScript("OnShow", createDBTOnShowHandler("FontSize"))
  4.         FontSizeSlider:HookScript("OnValueChanged", createDBTOnValueChangedHandler("FontSize"))
  5.  
  6.         local BarHeightSlider = BarSetup:CreateSlider(L.Bar_Height, 10, 35, 1)
  7.         BarHeightSlider:SetPoint("TOPLEFT", BarSetup.frame, "TOPLEFT", 20, -215)
  8.         BarHeightSlider:SetScript("OnShow", createDBTOnShowHandler("Height"))
  9.         BarHeightSlider:HookScript("OnValueChanged", createDBTOnValueChangedHandler("Height"))
  10. end
__________________
Better to fail then never have tried at all.

Last edited by Yukyuk : 05-04-16 at 01:10 PM.
  Reply With Quote
05-04-16, 04:24 PM   #3
feraldrood
A Theradrim Guardian
 
feraldrood's Avatar
Join Date: Dec 2008
Posts: 62
Excellent!! of course- the gui.lua... the one place I didn't look

Thanks for the help yukyuk!


Also, looking for a way to call a border for the dbm bars from my shared media. way beyond my lua experience thus far. anyone know how?
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » DBM sliders!


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off