Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 10-08-12, 09:16 PM   #1
Spawnova
A Black Drake
 
Spawnova's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2012
Posts: 82
slider variable saving and using

Lua Code:
  1. MyAddon = {};
  2.  MyAddon.panel = CreateFrame( "Frame", "MyAddonPanel", UIParent );
  3.  MyAddon.panel.name = "Smp";
  4.  InterfaceOptions_AddCategory(MyAddon.panel);
  5.  
  6.     --SLIDER
  7.     SlashCmdList["SMP"] = function() InterfaceOptionsFrame_OpenToCategory(MyAddon.panel) end
  8.     SLASH_SMP1 = "/smp"
  9.     local slider = CreateFrame("Slider","MyAddonSlider",MyAddon.panel,'OptionsSliderTemplate')
  10.     slider:SetPoint("CENTER",0,0)
  11.     getglobal(slider:GetName() .. 'Low'):SetText('25%');
  12.     getglobal(slider:GetName() .. 'High'):SetText('95%');
  13.     getglobal(slider:GetName() .. 'Text'):SetText('Health');
  14.     slider:SetMinMaxValues(25, 95)
  15.     slider:SetValue(70)
  16.     slider:SetValueStep(5)

how would i save the slider value after changing it (so its that value everytime i run wow)
and how would i find the value of the slider such as "slider.Value" etc.
Spawnova is offline   Reply With Quote
 

Go BackWoWInterface » Developer Discussions » Lua/XML Help » slider variable saving and using

Thread Tools
Display Modes

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