Thread Tools Display Modes
07-15-10, 09:58 AM   #1
magges
An Aku'mai Servant
 
magges's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 36
IsAddOnLoaded doesnt work :S

Hey dudes

dont know why but IsAddOnLoaded seems not to work.
Id try

IsAddOnLoaded("TinyDPS")
IsAddOnLoaded("Recount")
Nothing happens even though both addons are loaded. Why? :/

magges
  Reply With Quote
07-15-10, 10:37 AM   #2
ravagernl
Proceritate Corporis
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 1,176
How are you using the function call in your code?
  Reply With Quote
07-15-10, 10:52 AM   #3
magges
An Aku'mai Servant
 
magges's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 36
Code:
if IsAddOnLoaded("TinyDPS") then
	local tdpsbutton = CreateFrame("Frame", "tdpsButton", OpenMenuButton)
	tdpsbutton:SetBackdrop({bgFile = "Interface\\ChatFrame\\ChatFrameBackground", 
								edgeFile = "Interface\\ChatFrame\\ChatFrameBackground",
								tileSize = 0, edgeSize = 1, 
								insets = { left = -1, right = -1, top = -1, bottom = -1}
	})
	tdpsbutton:SetBackdropColor(.2,.2,.2,1)
	tdpsbutton:SetBackdropBorderColor(.4,.4,.4,1)
	tdpsbutton:SetWidth(addonbuttonwidth)
	tdpsbutton:SetHeight(addonbuttonheight)
	tdpsbutton:EnableMouse(true)
	-- tdpsbutton:Hide()
	if not IsAddOnLoaded("Skada") then
		tdpsbutton:SetPoint("TOPRIGHT", OpenMenuButton, "BOTTOMRIGHT", -2, -4)
	else
		tdpsbutton:SetPoint("TOP", skadabutton, "BOTTOM", 0, -2)
	end

	-- if menu:IsShown() then
		-- tdpsbutton:Show()
	-- else
		-- tdpsbutton:Hide()
	-- end
	
	addons = addons + 1
end
  Reply With Quote
07-15-10, 11:05 AM   #4
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,934
Have you made sure that the frames are being made ?

If you haven't already tried it, put a print("Got Here!") kind of message at the top of that if statement. If you see that message you know that it worked but something else in that block went wrong. The repeat the process down the line.

If I don't know where the problem is ( in normal programming debugging ) in the block I usually place print("1") etc lines after each command so that I can see which command failed to work and it should work in lua debugging too.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
07-15-10, 11:45 AM   #5
magges
An Aku'mai Servant
 
magges's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 36
When i remove the if IsAddonLoaded + the end it works :/
  Reply With Quote
07-15-10, 12:06 PM   #6
Elhana
A Wyrmkin Dreamwalker
AddOn Author - Click to view addons
Join Date: Jul 2007
Posts: 51
Are you sure your addon is loaded after TinyDPS?
You probably want to try to run that code after PLAYER_LOGIN fires.
  Reply With Quote
07-15-10, 12:43 PM   #7
magges
An Aku'mai Servant
 
magges's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 36
Ah yeah thats is! thanks
id just add OptionalDeps in.toc and it works fine! Thanks

:> okay no .. after a /rl it breaks.
How do I add the PLAYER_ENTERING_WORLD (think u mean this, correct? I dont know)

The Hole addon as an function isnt the best way is it?

/e btw with print("!") it shows the ! .. but it still doesnt work.

down there i got this:

Code:
openmenubutton:SetScript("OnMouseDown", function()
	if not IsShiftKeyDown() then
		if menu:IsShown() then
			menu:Hide()
			if IsAddOnLoaded("1Recount") then recountbutton:Hide() end
			if IsAddOnLoaded("TinyDPS") then tdpsbutton:Hide() end
			if IsAddOnLoaded("Skada") then skadabutton:Hide() end
			openmenubutton:SetBackdropBorderColor(.4,.4,.4,1)
		else
			menu:Show()
			if IsAddOnLoaded("1Recount") then recountbutton:Show() end
			if IsAddOnLoaded("TinyDPS") then tdpsbutton:Show() end
			if IsAddOnLoaded("Skada") then skadabutton:Show() end
			openmenubutton:SetBackdropBorderColor(.9,.1,.1,1)
			
		end
	else
	openmenubutton:ClearAllPoints()
	openmenubutton:StartMoving()
	end
end)

openmenubutton:SetScript("OnMouseUp", function()
	openmenubutton:StopMovingOrSizing()
end)
and it says:
'tdpsbutton' (a nil value)

Last edited by magges : 07-15-10 at 01:20 PM.
  Reply With Quote
07-15-10, 01:44 PM   #8
magges
An Aku'mai Servant
 
magges's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 36
cause i was a bit confused i just take a look at another addon

Code:
local AddOn = CreateFrame("Frame")
local OnEvent = function(self, event, ...) self[event](self, event, ...) end
AddOn:SetScript("OnEvent", OnEvent)

local function
[...all the stuff with IsAddonLoaded("")...]
end

AddOn:RegisterEvent("PLAYER_ENTERING_WORLD")
AddOn["PLAYER_ENTERING_WORLD"] = login
with tinydps it works.
With Recount not. It creates the button (the print appears) but the function on mousedown wont work? :/

magges
  Reply With Quote
07-15-10, 01:59 PM   #9
magges
An Aku'mai Servant
 
magges's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 36
okay lol ..it was cause of the local? Is that possible? What means that local exaclty?

Hm anyways - another question:

Code:
-- the menu open button
openmenubutton = CreateFrame("Frame", "OpenMenuButton", UIParent)
openmenubutton:SetBackdrop({bgFile = "Interface\\ChatFrame\\ChatFrameBackground", 
							edgeFile = "Interface\\ChatFrame\\ChatFrameBackground",
							tileSize = 0, edgeSize = 1, 
							insets = { left = -1, right = -1, top = -1, bottom = -1}
})
openmenubutton:SetBackdropColor(.2,.2,.2,1)
openmenubutton:SetBackdropBorderColor(.4,.4,.4,1)
openmenubutton:SetWidth(buttonwidth)
openmenubutton:SetHeight(buttonheight)
openmenubutton:SetPoint("CENTER",0,0)
openmenubutton:EnableMouse(true)
openmenubutton:SetMovable(true)

-- (texture)
openmenubutton.texture = openmenubutton:CreateTexture(nil, "OVERLAY")
openmenubutton.texture:SetAllPoints(openmenubutton)
openmenubutton.texture:SetTexture("Interface\AddOns\magges\menubutton",true)
the texture .. i dont see it. Why? :/
even if i setpoint to openmenubutton + alpha(1)
texture is 20x20, is that the point? may it has to be 24x24 or whatever?

/e even with 2x \ instead of 1

/e got it ..32x32

Last edited by magges : 07-15-10 at 02:33 PM.
  Reply With Quote
07-15-10, 03:03 PM   #10
magges
An Aku'mai Servant
 
magges's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 36
I try everything but ingame its still not transparent - the background is white. WHY? aaaaaaaaah RAGE



(even if the black is white and the white is black(cause im not sure what is correct^^)..thats btw only the alpha channel)

Help me, pls :<
  Reply With Quote
07-15-10, 03:46 PM   #11
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 404
Change:
Code:
openmenubutton.texture:SetTexture("Interface\AddOns\magges\menubutton",true)
to:
Code:
openmenubutton.texture:SetTexture("Interface\\AddOns\\magges\\menubutton",true)
  Reply With Quote
07-15-10, 04:02 PM   #12
magges
An Aku'mai Servant
 
magges's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 36
Already did that .. i see the texture but its not transparent doesnt matter what i try
  Reply With Quote
07-15-10, 04:29 PM   #13
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 404
I don't think this is a WoW issue but rather you not knowing how to use the alpha channel of your image editing software.
  Reply With Quote
07-15-10, 04:44 PM   #14
magges
An Aku'mai Servant
 
magges's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 36
Yeah im sure its not an wow issue :P
So what am I doing wrong in Photoshop?

I do it like this:
> open new file 32x32 transparent background, 72dpi. (default settings)
> i create the "m" button
> i add the alpha channel
> i configure/draw it like it is on the screen
> i safe as a .tga 16bit or whatever
> result: its not transparent?

magges

/e if i save it as .png it is transparent ..but its not supportet correct?
/e2 will open a new thread cause the title confuses

Last edited by magges : 07-15-10 at 05:23 PM.
  Reply With Quote
07-15-10, 05:33 PM   #15
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Are you saving as an uncompressed 32-bit .tga?
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » IsAddOnLoaded doesnt work :S


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