Reply
Thread Tools Display Modes
Unread 03-04-13, 02:16 PM   #21
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 4,267
There is already an overlay texture.
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
Phanx is offline   Reply With Quote
Unread 03-04-13, 03:15 PM   #22
ravagernl
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 1,145
...



Well, I guess it's me missing or ignoring screenshots then.
ravagernl is offline   Reply With Quote
Unread 03-04-13, 04:19 PM   #23
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 4,267
It's only on the "install" part, not the "activate bonus features" part, but the original code only did anything with the UIParent for the "install" part.

@Mayron:
Try making the following substitions:
UIParent:Hide() -> UIParent:SetAlpha(0)
UIParent:Show() -> UIParent:SetAlpha(1)
That may avoid any taint problems, as well as the unwanted re-showing with the Esc key.

It also occurred to me that your dialogs should hide themselves if the player enters combat, and re-show after combat ends. You can add that by changing this part:

Code:
EventFrame:RegisterEvent("PLAYER_LOGIN")
EventFrame:SetScript("OnEvent", function(self, event, ...)
	self:UnregisterAllEvents()
	self:SetScript("OnEvent", nil)

	if MUI_INSTALLED then
		return
	end

	local setupMode = "setup"

	local AceAddon = LibStub("AceAddon-3.0")
	for _, addon in pairs(ADDONS) do
		addon = AceAddon:GetAddon(addon, true) or _G[addon]
		if type(addon) == "table" and type(addon.db) == "table" and type(addon.db.GetCurrentProfile) == "function" and addon.db:GetCurrentProfile() == "MayronUI" then
			setupMode = "bonus"
			break
		end
	end

	if setupMode == "setup" then
		SetupFrame:Show()
elseif setupMode == "bonus" then
		BonusFrame:Show()
	end
end)
to this:
Code:
EventFrame:RegisterEvent("PLAYER_LOGIN")
EventFrame:SetScript("OnEvent", function(self, event, ...)
	if event == "PLAYER_LOGIN" then
		self:UnregisterEvent("PLAYER_LOGIN")

		if MUI_INSTALLED then
			return self:SetScript("OnEvent", nil)
		end

		local setupMode = "setup"

		local AceAddon = LibStub("AceAddon-3.0")
		for _, addon in pairs(ADDONS) do
			addon = AceAddon:GetAddon(addon, true) or _G[addon]
			if type(addon) == "table" and type(addon.db) == "table" and type(addon.db.GetCurrentProfile) == "function" and addon.db:GetCurrentProfile() == "MayronUI" then
				setupMode = "bonus"
				break
			end
		end

		if setupMode == "setup" then
			SetupFrame:Show()
		elseif setupMode == "bonus" then
			BonusFrame:Show()
		end

		self:RegisterEvent("PLAYER_REGEN_DISABLED")
		self:RegisterEvent("PLAYER_REGEN_ENABLED")

	elseif event == "PLAYER_REGEN_DISABLED" then
		if MayronSetupFrame:IsShown() then
			MayronSetupFrame.__wasShown = true
			MayronSetupFrame:Hide()
		end
		if MayronBonusFrame:IsShown() then
			MayronBonusFrame.__wasShown = true
			MayronBonusFrame:Hide()
		end

	else -- PLAYER_REGEN_ENABLED
		if MayronSetupFrame.__wasShown then
			MayronSetupFrame.__wasShown = nil
			MayronSetupFrame:Show()
		end
		if MayronBonusFrame.__wasShown then
			MayronBonusFrame.__wasShown = nil
			MayronBonusFrame:Show()
		end
	end
end)
And add this to both the DoSetup() and DoBonusSetup() functions, right after the <x>Frame:Hide() line:

Code:
	EventFrame:UnregisterAllEvents()
	EventFrame:SetScript("OnEvent", nil)
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
Phanx is offline   Reply With Quote
Unread 03-05-13, 01:10 AM   #24
Mayron
A Chromatic Dragonspawn
 
Mayron's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 162
EDIT: Must have not seen the second page when I last replied. I noticed that UIParent:Hide() was not working so I changed it to UIParent:SetAlpha(0) because I was using that for my old code. Thanks a lot of the advice and the work you put into it. That makes great sense to have to hide while in combat. Really appreciate it!

Last edited by Mayron : 03-06-13 at 01:18 AM.
Mayron is offline   Reply With Quote
Reply

Go BackWoWInterface » Developer Discussions » Lua/XML Help » Disable event on click?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off