Skip to content

Commit 687a85f

Browse files
committed
Fix error with PlayerChoiceFrame on 11.1.0 PTR (fixes #8)
1 parent 9212828 commit 687a85f

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

main.lua

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,23 @@ function DialogKey:OnPlayerChoiceShow()
161161
end
162162

163163
for option in frame.optionPools:EnumerateActive() do
164-
for button in option.buttons.buttonPool:EnumerateActive() do
165-
local key = buttons[button.buttonID]
166-
if self.db.numKeysForPlayerChoice then
167-
button.Text:SetText(key .. ' ' .. button.Text:GetText())
164+
if option.buttons.buttonFramePool then -- 11.1.0
165+
for buttonFrame in option.buttons.buttonFramePool:EnumerateActive() do
166+
local button = buttonFrame.Button
167+
local key = buttons[button.buttonID]
168+
if self.db.numKeysForPlayerChoice then
169+
button.Text:SetText(key .. ' ' .. button.Text:GetText())
170+
end
171+
self.playerChoiceButtons[key] = button
172+
end
173+
else -- 11.0.7
174+
for button in option.buttons.buttonPool:EnumerateActive() do
175+
local key = buttons[button.buttonID]
176+
if self.db.numKeysForPlayerChoice then
177+
button.Text:SetText(key .. ' ' .. button.Text:GetText())
178+
end
179+
self.playerChoiceButtons[key] = button
168180
end
169-
self.playerChoiceButtons[key] = button
170181
end
171182
end
172183
end

0 commit comments

Comments
 (0)