Hi,
my addon DynamicCam is almost useless without the ActionCam. The newly introduced accessibility feature "keep character centered" disables the ActionCam, so I want to prevent users from enabling it. However, I want to inform users what is happening, which is why I modified the Interface->Accessibility->Motion Sickness drop down like this.
(This is just the front end part of my solution, I am changing the cvars with another hook, which however is not required to reproduce the error I am getting.)
Lua Code:
-- Automatically set the dropdown list to an allowed value.
hooksecurefunc("UIDropDownMenu_SetSelectedValue", function(menu, value)
if menu == InterfaceOptionsAccessibilityPanelMotionSicknessDropdown then
if value == 1 then
print("Debug: 1 not allowed, switching to 4...")
InterfaceOptionsAccessibilityPanelMotionSicknessDropdown.value = 4
InterfaceOptionsAccessibilityPanelMotionSicknessDropdown.selectedValue = 4
elseif value == 3 then
print("Debug: 3 not allowed, switching to 2...")
InterfaceOptionsAccessibilityPanelMotionSicknessDropdown.value = 2
InterfaceOptionsAccessibilityPanelMotionSicknessDropdown.selectedValue = 2
end
end
end)
I also used UIDropDownMenu_SetSelectedValue() to set the values before, but because of the strange error I am experiencing I switched to just setting value and selectedValue; but the error remains. Here is how to reproduce it:
- Go into combat.
- Open the game menu (click the button, do not press ESC which would exit combat).
- Click on "Interface".
- Chose the "Accessibilty" tab of the "Interface" window.
- Click the "Motion Sickness" dropdown.
- Select one of the two options including "Keep Character Centered" (observe that it is automatically changed as expected).
- Click the "Motion Sickness" dropdown again!
- Select any option!
- Press the "Cancel" button in the bottom right of the "Interface" window.
You now get an "Interface action failed because of an AddOn" error.
With BugSack I was able to identify what's happening:
Code:
[ADDON_ACTION_BLOCKED] AddOn 'MinimalWorkingExample' tried to call the protected function 'CompactRaidFrameContainer:Hide()'.
[string "@!BugGrabber\BugGrabber.lua"]:519: in function <!BugGrabber\BugGrabber.lua:519>
[string "=[C]"]: in function `Hide'
[string "@Blizzard_CompactRaidFrames\Blizzard_CompactRaidFrameManager.lua"]:530: in function `CompactRaidFrameManager_UpdateContainerVisibility'
[string "@Blizzard_CompactRaidFrames\Blizzard_CompactRaidFrameManager.lua"]:475: in function <...mpactRaidFrames\Blizzard_CompactRaidFrameManager.lua:464>
[string "@Blizzard_CompactRaidFrames\Blizzard_CompactRaidFrameManager.lua"]:514: in function `CompactRaidFrameManager_SetSetting'
[string "@Blizzard_CUFProfiles\Blizzard_CompactUnitFrameProfiles.lua"]:594: in function `func'
[string "@Blizzard_CUFProfiles\Blizzard_CompactUnitFrameProfiles.lua"]:571: in function `CompactUnitFrameProfiles_ApplyProfile'
[string "@Blizzard_CUFProfiles\Blizzard_CompactUnitFrameProfiles.lua"]:174: in function `CompactUnitFrameProfiles_ApplyCurrentSettings'
[string "@Blizzard_CUFProfiles\Blizzard_CompactUnitFrameProfiles.lua"]:83: in function `CompactUnitFrameProfiles_CancelChanges'
[string "@Blizzard_CUFProfiles\Blizzard_CompactUnitFrameProfiles.lua"]:76: in function <...rd_CUFProfiles\Blizzard_CompactUnitFrameProfiles.lua:74>
[string "=[C]"]: in function `pcall'
[string "@FrameXML\InterfaceOptionsFrame.lua"]:215: in function <FrameXML\InterfaceOptionsFrame.lua:214>
[string "=[C]"]: ?
[string "@FrameXML\InterfaceOptionsFrame.lua"]:250: in function <FrameXML\InterfaceOptionsFrame.lua:246>
So it all starts with InterfaceOptionsFrameCancel_OnClick() and eventually tries to hide CompactRaidFrameContainer, which is apparently protected in combat.
I would have many questions regarding this:
- I always thought taint is only created when an addon calls functions. But apparently it is also created by just assigning variables?
- How is the taint passed on in this case? It is not my addon calling InterfaceOptionsFrameCancel_OnClick().
- Why are steps 7. and 8. in my description to reproduce the error even necessary?
- If there is no solution to this taint problem, maybe somebody has a better idea to achieve what I initially wanted?
Thank you all in advance!