View Single Post
03-11-21, 12:14 AM   #7
Walkerbo
A Cobalt Mageweaver
 
Walkerbo's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 233
Hi guys

@ Fizzlemizz
Based on your post I changed the way my update worked.
I built a templist that from the DKChatlist so I was updating that instead.
Lua Code:
  1. local function updateDeathKnightSpellChatList()
  2.     currentSpellList = {}
  3.     for k, v in pairs(DeathKnightSpellList) do
  4.         if v.spellID == VariableList.currentSpellID then
  5.             currentSpellList = v.spellChatList
  6.         end
  7.     end
  8.     FauxScrollFrame_Update(
  9.         DeathKnightChatScrollFrame,
  10.         #currentSpellList,
  11.         NumberList.scrollButtonNumber,
  12.         NumberList.scrollButtonHeight
  13.     )
  14.     for index = 1, NumberList.scrollButtonNumber do
  15.         offset = index + FauxScrollFrame_GetOffset(DeathKnightChatScrollFrame)
  16.         button = DeathKnightChatScrollFrame.buttons[index]
  17.         button.index = offset
  18.         if offset <= #currentSpellList then
  19.             button:SetText(currentSpellList[offset])
  20.             button:Show()
  21.         else
  22.             button:Hide()
  23.         end
  24.     end
  25. end

That allowed me to use the following syntax;
Lua Code:
  1. print("Test Print 1 - ", currentSpellList[self.index]) -- debug --

@Kanegasi
After I re-reading your first post again I realized you had already given me the answer when you said
The second button: DeathKnightSpellList[2].spellChatList[2]

So I changed the syntax to
Lua Code:
  1. print("Test Print 2 -  ", DeathKnightSpellList[1].spellChatList[self.index]) -- debug --

Both of these syntaxes now work.

Thanks for all of your help.
__________________
"As someone once told me, frames are just special types of tables, and tables are special types of pointers."
Fizzlemizz
  Reply With Quote