Stanzilla / WoWUIBugs

World of Warcraft UI Bug Tracker
153 stars 7 forks source link

Addon compartment entries are visible for some disabled addons #524

Closed Ghostopheles closed 3 weeks ago

Ghostopheles commented 5 months ago

Due to the addon enable state previously being broken, the addon compartment is checking for C_AddOns.GetAddOnEnableState(addon) > 0, which will cause it to incorrectly show addon compartment entries if the given addon is enabled on any character, even if it's disabled on the current character. This leads to errors when entering and clicking entries from addons that are not enabled.

A possible solution would be to check the addon enable state for the current character, rather than for all characters on the account.

function AddonCompartmentMixin:RegisterAddons()
    local addonCount = C_AddOns.GetNumAddOns();
+       local character = UnitName("player");
    for addon = 1, addonCount do
-           local addonEnabled = C_AddOns.GetAddOnEnableState(addon) > 0;
+           local addonEnabled = C_AddOns.GetAddOnEnableState(addon, character) == 2;
Meorawr commented 3 weeks ago

Was fixed in 10.2.7 - probably missed it because of the source restructure.