ElvUI WindTools

ElvUI WindTools

3M Downloads

关于右键增强

someblu opened this issue · 5 comments

commented

第一份taint.log

9/8 15:31:58.442  Global variable UIDROPDOWNMENU_MENU_LEVEL tainted by ElvUI_WindTools - Interface\FrameXML\UIDropDownMenu.lua:957 ToggleDropDownMenu()
9/8 15:31:58.442      Interface\FrameXML\UIDropDownMenu.lua:203
9/8 15:31:58.442  Execution tainted by ElvUI_WindTools while reading UIDROPDOWNMENU_MENU_LEVEL - Interface\FrameXML\UIDropDownMenu.lua:881 UIDropDownMenu_GetSelectedID()
9/8 15:31:58.442      Interface\FrameXML\UIDropDownMenu.lua:566 UIDropDownMenu_AddButton()
9/8 15:31:58.442      Interface\FrameXML\UnitPopup.lua:792 UnitPopup_AddDropDownButton()
9/8 15:31:58.442      Interface\FrameXML\UnitPopup.lua:543
9/8 15:31:58.442      UnitPopup_ShowMenu()
9/8 15:31:58.442      Interface\FrameXML\SecureTemplates.lua:237 initFunction()
9/8 15:31:58.442      Interface\FrameXML\UIDropDownMenu.lua:77 UIDropDownMenu_Initialize()
9/8 15:31:58.442      Interface\FrameXML\UIDropDownMenu.lua:1085 ToggleDropDownMenu()
9/8 15:31:58.442      Interface\FrameXML\UIDropDownMenu.lua:203
9/8 15:31:58.442  Hide()
9/8 15:31:58.442  An action was blocked because of taint from ElvUI_WindTools - FocusUnit()
9/8 15:31:58.442      Interface\FrameXML\UnitPopup.lua:1796
9/8 15:31:58.442      func()
9/8 15:31:58.442      Interface\FrameXML\UIDropDownMenu.lua:935 UIDropDownMenuButton_OnClick()
9/8 15:31:58.442      DropDownList1Button2:OnClick()

此时右键菜单功能完全开启。

第二份taint.log

9/8 15:52:03.609  Hide()
9/8 15:52:03.609  An action was blocked because of taint from ElvUI_WindTools - FocusUnit()
9/8 15:52:03.609      Interface\FrameXML\UnitPopup.lua:1796
9/8 15:52:03.609      func()
9/8 15:52:03.609      Interface\FrameXML\UIDropDownMenu.lua:935 UIDropDownMenuButton_OnClick()
9/8 15:52:03.609      DropDownList1Button2:OnClick()

此时右键菜单功能中被注释掉了

hooksecurefunc("UnitPopup_ShowMenu", function(...) ......)

只有在设置面板中完全禁用右键增强功能才不会出现类似taint,初步怀疑是

hooksecurefunc("UnitPopup_OnClick", function(...) ......)

也会产生taint。
之后我尝试使用LibUIDropDownMenu,一直提示numButtons值为nil从而无法调用L_UnitPopup_AddDropDownButton()

commented

还有一处发现是,当我设置

EnhancedRCMenu.dropdownmenu_show["PLAYER"] = false

且开启右键增强并取消注释后
第一处taint.log的内容会变成第二处taint.log,此时调换

if (UIDROPDOWNMENU_MENU_LEVEL == 1 and EnhancedRCMenu.dropdownmenu_show[which]) then ...... end

该处判断的两个条件的位置,

if (EnhancedRCMenu.dropdownmenu_show[which] and UIDROPDOWNMENU_MENU_LEVEL == 1) then ...... end

并不会影响taint.log的内容,即第一处taint.log中提到的

Global variable UIDROPDOWNMENU_MENU_LEVEL tainted by ElvUI_WindTools
Execution tainted by ElvUI_WindTools while reading UIDROPDOWNMENU_MENU_LEVEL

并不是由这处if判断引起的。

commented

综上所述,根据三次实验得出的结论是,还是把右键菜单增强禁用了吧。。仅仅保留部分功能并不能解决问题。

commented

默认关闭好了,慢慢寻找有没有其他方案可以达到相同的功能。

commented

查了下基本上 OnClick 事件就会触发taint,有空可以把菜单改成不是右键,但是依旧方便的呼出模式。

commented

2.0 版本已经采用自建框架方式嵌入, 不会产生 taint 了.
bf23a6e