View Single Post
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 online now   Reply With Quote