• 0

    posted a message on EnumerateFrames and HookScript
    Oh, got it: HookScript changes result of ActionButton1:GetScript("OnClick")
    Posted in: Need Help?
  • 0

    posted a message on EnumerateFrames and HookScript
    I'm using Enumerate also to attach text to every button, some of them can be from Bartender, ElvUI etc (this is short version, just added another call to also attach hooks). Full addon code at http://www.curse.com/addons/wow/lasteffect So enumerating every addon manually would enlarge this section too much. Everything was fine until HookScript.
    Lua errors enabled and I have no errors at all. I'll try BugSack.

    P.S. also you forgot several Blizzard's bars :)

    Edit: no bugs with BugSack :confused:
    Posted in: Need Help?
  • 0

    posted a message on EnumerateFrames and HookScript
    I have code to enumerate action buttons
    local frame = EnumerateFrames()
    while frame do
    	local fname = frame:GetName()
    	if frame.IsProtected and frame:IsProtected() --exists and true
    	and frame.GetObjectType and frame.GetScript and fname
    	and frame:GetObjectType() == "CheckButton" then
    		local script = frame:GetScript("OnClick")
    		if (script == ActionButton1:GetScript("OnClick")) and frame.action and (frame.action < 120) then
    			if not(string.find(fname, "Override", 1, true)) then
    				CheckAddOnClickHook(frame)
    				local action = frame.action
    				local atype, id, _ = GetActionInfo(action)
    				print(action, atype, fname, id)
    			end
    		end
    	end
    	frame = EnumerateFrames(frame)
    end

    and if function CheckAddOnClickHook contains HookScript like
    local function CheckAddOnClickHook(btn)
    	if not(btn.lasteffecthook) then
    		btn:HookScript("OnClick", ButtonOnClick)
    		btn.lasteffecthook = true
    	end
    end

    all I can see is only first action button. If I comment HookScript I can see all buttons. ButtonOnClick simple local function that prints button name for now.
    Why that happens and can it be solved?
    Posted in: Need Help?
  • 0

    posted a message on Masque - Official Thread
    Quote from StormFX
    And just as a pointer, I see a lot of authors calling something like...

    Happens because there is no full example in docs. Only pure API, like msdn where you can see lot of functions but probability to make own Iocp handler without example how to put functions together near zero.
    I found there is Masque instead of Button Facade. My addon supports BF only still and support made by monkey copying from another addon (and I'm not sure is addon author understood what he doing also).
    Lets imagine my buttons inherited from SecureActionButtonTemplate and ActionButtonTemplate - can you please provide short example (not as short as "do something here") what should I do to support Masque?
    Posted in: General AddOns
  • 0

    posted a message on How to hook dynamic frame's events?
    Thanks, found solution on http://us.battle.net/wow/en/forum/topic/6147287766?page=1#4
    	hooksecurefunc("ShowMacroFrame", function()
    		print("func ShowMacroFrame hooked")
    		--my stuff
    		--now catch OnHide
    		MacroFrame:HookScript("OnHide",function()
    			print("MacroFrame just closed")
    		end)
    	end)


    I'm catching not only OnShow/OnHide of MacroFrame, but also PetJournal, SpellBookFrame, PaperDollFrame - i.e. frame from which player can drag spells, mounts etc to put my addon in proper state. Last 2 frames was easy, MacroFrame and PetJournal harder.
    Also I'm hooking OnHide to leave that state, so OnLoad not enough.
    Posted in: Need Help?
  • 0

    posted a message on How to hook dynamic frame's events?
    So MacroFrame and PetJournaFrame are dynamic - first one created through ShowMacroFrame(). I found can't hook OnShow in ordinal way but able to
     	hooksecurefunc("ShowMacroFrame", function()
    		print("func ShowMacroFrame hooked")
    	end)
    
    it works.
    But how to catch OnClose or OnHide for such frames? Code
     	hooksecurefunc("ShowMacroFrame", function()
    		print("func ShowMacroFrame hooked")
    		--my stuff
    		--now catch OnHide
    		hooksecurefunc("MacroFrame_OnHide", function()
    			print("func MacroFrame_OnHide hooked")
    			--on close stuff
    		end)		
    	end)
    
    not works because probably it called after destroying frame and MacroFrame_OnHide not exists at this moment.
    How to catch OnHide or OnClose? Or some other solution exists?
    Posted in: Need Help?
  • 0

    posted a message on [MoP API] warlock - Burning Embers and MoP addon dev in general
    Quote from Mizh
    Where do you find the code for the Blizzard GUI?

    I'm googling something like "wow ui sources tekkub", first link to GitHub, there by link branches with MoP Beta. Downloadable as zip.
    Posted in: Need Help?
  • 0

    posted a message on LibActionButton-1.0
    Thanks, that works
    elseif actBtnName:match("^BT4Button%d+$") then
    	local atype, action = actBtn:GetAction()
    	if atype == "action" then
    		FlyoutButton_SetCursor(self.command, self.value, self.subValue)
    		PlaceAction(action)
    		actBtn:UpdateAction(true)
    		ClearCursor()
    	end
    Posted in: Libraries
  • 0

    posted a message on LibActionButton-1.0
    How to call OnReceiveDrag for this buttons (is nil)? Or at least is this possible to implement PlaceAction for this buttons?
    I'm trying from my addon (FlyoutButton Custom) to put into parent BT4 button another spell on right click while not in combat. It works for Blizzard buttons through
    FlyoutButton_SetCursor(self.command, self.value, self.subValue)
    PlaceAction(actBtn.action)
    ActionButton_UpdateState(actBtn)
    ActionButton_UpdateFlash(actBtn)
    ClearCursor()

    and for Button Forge through
    FlyoutButton_SetCursor(self.command, self.value, self.subValue)
    BFButton.OnReceiveDrag(actBtn)
    ClearCursor()


    Thanks.
    Posted in: Libraries
  • 0

    posted a message on LibKeyBound-1.0
    Error on pressing "Enter" when keybinding active, line 475 "ChatFrameEditBox:Show()". Probably this frame renamed since WoW 4.x.

    Edit: fix is DEFAULT_CHAT_FRAME.editBox:Show()
    Posted in: Libraries
  • 0

    posted a message on GameTooltip:SetSpell and spell rank?
    function My_FindSpellID(spellName)
    	local i = 1;
    	while true do
    		local spellAndRank = My_GetSpellName(i, BOOKTYPE_SPELL);
    		if (not spellAndRank) then
    			break;
    		end
    		if (spellName == spellAndRank) then
    			--print at this point like "Fireball(Rank 13)"
    			return i;
    		end
    		i = i + 1;
    	end
    	return nil;
    end
    
    function My_GetSpellName(spell, ...)
    	local name, rank = GetSpellName(spell, ...);
    	if (name) then
    		return name.."("..rank..")", name, rank;
    	end
    	return nil, nil, nil;
    end

    I guess SpellBook lookup isn't best technique, but thats from wowwiki.

    and to set tooltip
    	local spellId = My_FindSpellID(value);
    	if (spellId and GameTooltip:SetSpell(spellId, BOOKTYPE_SPELL)) then
    ...


    About ranks removal - how about spells like Polymorph(Pig), Polymorph(Rabbit) etc? Those "Pig" and "Rabbit" is ranks.
    Posted in: Lua Code Discussion
  • 0

    posted a message on GameTooltip:SetSpell and spell rank?
    When I using GameTooltip:SetSpell(spellId, , BOOKTYPE_SPELL) tooltip works, except there is no spell rank. How to show spell ranks? Am I doing something wrong?
    Posted in: Lua Code Discussion
  • 0

    posted a message on How to fix filenames?
    Thanks, works :)
    Posted in: General Chat
  • 0

    posted a message on How to fix filenames?
    Did. Filename there "ExtraBarsSpsh v1.10b". In "Facts" "Filename ExtraBarsSpsh1.10b.zip". However on my download page "Download ExtraBarsShapeshift ExtraBarsShapeshift ExtraBarsSpsh v1.10b" still.
    Posted in: General Chat
  • 0

    posted a message on How to fix filenames?
    When I uploading file there is required field "Name". So I put there "ExtraBarsSpsh v1.10b". But on my main page I have links like "ExtraBarsShapeshift ExtraBarsSpsh" (http://wow.curse.com/downloads/wow-addons/details/extrabars_shapeshift.aspx) and header on download "Download ExtraBarsShapeshift ExtraBarsShapeshift ExtraBarsSpsh v1.10b" (http://wow.curse.com/downloads/wow-addons/details/extrabars_shapeshift/download/434118.aspx)

    How I should fix that? Thx.
    Posted in: General Chat
  • To post a comment, please or register a new account.