View Single Post
06-05-22, 10:29 AM   #4
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
Oops, forgot to actually save the last index lol.

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.         local index=#self.options==self.lastindex and 1 or self.lastindex+1
  13.         valueset=self.options[index]
  14.         self.lastindex=index
  15.     end
  16.     self.valueText:SetText(valueset)
  17.     self:set(valueset)
  18. end
  Reply With Quote