View Single Post
06-05-22, 08:34 AM   #2
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
Every time you click, that function is looping through the whole options table, from ONE to FOUR, calling SetText() and set() for each one. No matter how many times you click, you will always see FOUR, while the other three attempted to show within the frame you clicked.

I'm going to assume your default value is also in this frame since options is there.

Lua Code:
  1. function(self)
  2.     local valueset
  3.     if not self.firstload then
  4.         self.firstload=true
  5.         valueset=self.value
  6.         for k,v in ipairs(self.options) do
  7.             if v=self.value then
  8.                 self.lastindex=k
  9.             end
  10.         end
  11.     else
  12.         valueset=self.options[#self.options==self.lastindex and 1 or self.lastindex+1]
  13.     end
  14.     self.valueText:SetText(valueset)
  15.     self:set(valueset)
  16. end
  Reply With Quote