Skip to content

UI exception of the mixin of BugSackSoundDropdownInitializer #163

@MrQiYin

Description

@MrQiYin

Describe the problem

BugSack uses CreateFromMixins. In the Mixins, the SettingsListElementTemplate has had the previewButton and soundDropdown added to it. Then, when other addons use the same SettingsListElementTemplate, the previewButton and soundDropdown will be created within the options of other addons. To solve this issue, u need to hide them in BugSackSoundDropdownInitializer:Resetter. like this:

	function BugSackSoundDropdownInitializer:Resetter(frame)
		if frame.cbrHandles then
			frame.cbrHandles:Unregister()
		end
		frame.previewButton:Hide()
		frame.soundDropdown:Hide()
	end

However, if I switch back to the options page of BugSack again, they will not be displayed, Because they were hidden when the page was closed last time, So, you still need to make them display at the end of the BugSackSoundDropdownInitializer:InitFrame method. like this:

	function BugSackSoundDropdownInitializer:InitFrame(frame)
		...

		-- Register callback for external changes
		frame.cbrHandles:SetOnValueChangedCallback(soundSetting:GetVariable(), UpdateDropdownText)

		-- display hidden widgets
		frame.previewButton:Show()
		frame.soundDropdown:Show()
	end

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions