• 0

    posted a message on Minimap hiding help

    In reply to Ketho17:

     Like a glove! Thank you so much for taking the time to help <3

     

    edit-   jic someone else is looking for the info the whole working thing looks like:

     

    local MinimapHider = CreateFrame("Frame")

    MinimapHider:RegisterEvent("PLAYER_REGEN_ENABLED")

    MinimapHider:RegisterEvent("PLAYER_REGEN_DISABLED")

    MinimapHider:SetScript("OnEvent", function(self, event)

    if event == "PLAYER_REGEN_DISABLED" and not IsMounted() then

    Minimap:Hide()

    BattlefieldMapFrame:Show()

    else

    Minimap:Show()

    BattlefieldMapFrame:Hide()

    end

    end)

     

    <333

     

    Posted in: AddOn HELP!
  • 0

    posted a message on Minimap hiding help

    Hello, I am hoping to find someone to share some knowledge about some wow code.

    What I am trying to accomplish is to make the Minimap disappear upon entering combat UNLESS mounted.

    I scavenged some donated code in some reply and so far have:

     

    local MinimapHider = CreateFrame("Frame")
    MinimapHider:RegisterEvent("PLAYER_REGEN_ENABLED")
    MinimapHider:RegisterEvent("PLAYER_REGEN_DISABLED")
    MinimapHider:SetScript("OnEvent", function(self, event)
    if event == "PLAYER_REGEN_DISABLED" then
    Minimap:Hide()
    else
    Minimap:Show()
    end
    end)

     

    which behaves perfect except observing the mounted condition (cant figure out how to fit or even if it fits with that)

    I would be grateful if anyone could shine some light on this

    -bonus points- if I could make the zone map pop up when the minmap disappears that would be just...mmm  perfect

    <3 thank you for your time

    Posted in: AddOn HELP!
  • 0

    posted a message on needing help with weak auras
    Beautiful!
    Works exactly how I'd like. The trigger ended up being:
    function() return UnitIsWildBattlePet("target") end

    without the 'not'
    Thank you so much for your help Phanx, and thank you Dridzt for taking a stab at it too. =)
    Posted in: AddOn HELP!
  • 0

    posted a message on needing help with weak auras
    Thank you, Phanx.
    I feel bad taking up your time on this, I just can't find the answer in any forums. Here is an example of a working trigger for WeakAuras... I use it to hide some weakauras that are normally shown except during pet battles:

    There are drop down menus to choose the type of trigger you are trying to make;
    Trigger: Custom
    Event Type: Status
    Check On: Event(s)
    Event(s): PET_BATTLE_OPENING_START, PET_BATTLE_CLOSE

    Custom trigger:
    function()
        return not C_PetBattles.IsInBattle() and true
    end


    Custom untrigger:
    function()
        return true
    end


    Im sorry, I have tried endless variations of if UnitIsWildBattlePet("target") then, - dropping the C_, taking out not, "", true/false... Being unable to find anything on a forum remotely close to what Im trying to get - and lack of knowledge leaves me grasping at straws.
    Posted in: AddOn HELP!
  • 0

    posted a message on needing help with weak auras
    Thank you much for your time. Im just not good at coding to begin with and its hard to find anything helpful concerning wild battle pet api.
    I still cant seem to put together anything workable, but its not really neccessary - just a finishing touch kind of thing.
    I appreciate all the help I have gotten from this forum. If anybody is interested in seeing what I've been working on, you can view it at: http://youtu.be/ktNT1yYR9Eg
    Posted in: AddOn HELP!
  • 0

    posted a message on needing help with weak auras
    UPDATE-

    It appears that the capturable pets in the higher level areas are NOT level 1, so that generic trigger is not going to work.
    What I am trying to do is include Weakauras models/icons relating to what I have targeted. I have been able to use the addons own triggers so far, but I can not find any way to register as a capturable pet.
    What I have so far...

    Trigger: Custom
    Event Type: Status
    Check On: Event(s)
    Event(s): PLAYER_TARGET_CHANGED

    trigger:
    function()
        return not C_UnitIsWildBattlePet() and true
    end

    untrigger:
    function()
        return true
    end


    But it doesn't work. >< I am not sure Im even close on this one. Any help with this is greatly appreciated. Thank you.
    Posted in: AddOn HELP!
  • 0

    posted a message on Help with kgPanels target color
    Excellent!

    I'm pretty embarassed though - I thought I had tried changing self:SetBackdropColor to self.bg:SetVertexColor. After reading your post I tried your previous script, applied the suggest changes, and that worked like a charm as well. I spent quite a while messing with it last night and can"t believe I didnt try that. ><

    At any rate, thank you so much for the help and patience. Also thank you for moving it all some place relative, I hope someone else will find it useful. =)
    Posted in: AddOn HELP!
  • 0

    posted a message on Help with kgPanels target color
    Hello, and thank you, again.

    I tried that code but it does not work at all for me. ><
    No idea what I am doing wrong with it...
    I did manage to get one worked out that is doing what I want.

    on load:
    self:RegisterEvent("PLAYER_TARGET_CHANGED")


    on event:
    local r,g,b
    if UnitIsPlayer("target") then
        local c = RAID_CLASS_COLORS[(select(2,UnitClass("target")))]
        r,g,b = c.r, c.g, c.b
    else
        r,g,b = UnitSelectionColor("target")
    end
      self.bg:SetVertexColor(r,g,b,self.bg:GetAlpha())
    self[UnitExists("target") and "Show" or "Hide"](self)


    The above will show or hide the panel based on wether there is a target or not, and change the background color to class colors (for players) or reaction colors (for npc's).
    If there is a better way of doing this please let me know - I'm really winging it here. Thanks for all your time Phanx, I really appreciate it.

    P.S. Can the previous posts have their titles edited? All the info has been on KGPanels and it may help someone else who is looking for this kind of thing in the future.
    Posted in: AddOn HELP!
  • 0

    posted a message on Help with kgPanels target color
    First, thank you for taking so much time on this issue.
    I will try to clarify... I would like the target panel background to change color based on player class color - or when that is not available -reaction color.
    I accidentally posted code for backdrop border color when what I am really trying to change is the (kgpanels) panel background >< (my panels have no borders).

    I believe there is no other addon defining a "UDF" table with a "unitname" - that was a script I grabbed from a forum while bungling my way through this. I messed with it initially and crudely cobbled together something to get it showing reactions. But it would get stuck on a player color after targeting a player, so I reverted back to the first code I posted.

    I tried the rewritten code above and there were no color reactions (class or otherwise), so I changed the end of the code:

    self:SetBackdropBorderColor(Color.r, Color.g, Color.b, self.bg:GetAlpha())


    to:

    self.bg:SetVertexColor(c.r,c.g,c.b, self.bg:GetAlpha())


    ...and still nothing.

    I am using Pitbull4 unit frames, I wonder if they are the culprit - perhaps using different color values? TBH I do not know enough to know if that matters >.> Again, thank you for any help on this. Trying to do what you do makes my brain feel like its melting XD

    For good measure I will post everything I have going so as to make sure one is not interferring with the other. For the players target panel, in on load :

    self:RegisterEvent("PLAYER_TARGET_CHANGED")
    self:RegisterEvent("PET_BATTLE_OPENING_START")
     self:RegisterEvent("PET_BATTLE_CLOSE")


    on event:

    self[UnitExists("target") and "Show" or "Hide"](self)
    local _, class = UnitClass("target")
    local c = RAID_CLASS_COLORS[class]
    self.bg:SetVertexColor(c.r,c.g,c.b, self.bg:GetAlpha())
    if event == "PET_BATTLE_OPENING_START" then
     self:Hide()
     elseif event == "PET_BATTLE_CLOSE" then
     self:Show()
     end


    This makes the target frame appear/disappear when I have a target or not, changes background color based on target player class, and hides when in pet battles. ~Sorry for taking up so much real estate.
    Posted in: AddOn HELP!
  • 0

    posted a message on needing help with weak auras
    Thank you so much for such a speedy reply Phanx. I was able to solve the issue within the addon without using any special code - after noticing that capturable pets had 1 health point I added a trigger (= 1 hp) to register as 'battle pet' if the target unit is a critter.

    Perhaps I could pick your brain on another issue Im having with KG panels:
    http://forums.wowace.com/showthread.php?t=20442
    Posted in: AddOn HELP!
  • 0

    posted a message on Help with kgPanels target color
    I have trolled all the forums and have found many helpful replies from yourself and others. I have been able to do some nice things with my UI thanks to everyones help. A last lingering issue I am unable to work out is changing my target background color based on (1st) class color and (secondary) reaction.

    i am currently using: in on event...

    local _, class = UnitClass("target")
    local c = RAID_CLASS_COLORS[class]
    self.bg:SetVertexColor(c.r,c.g,c.b, self.bg:GetAlpha())
    


    ...which only sets the background color based on class color. The following, which reportedly does both (class and reaction), did NOT work for me:

    local Color = {r = 1, g = 1, b = 1};
    	
    if UnitExists("target") then
    	if ( UnitExists("pet") and UnitIsUnit("target", "pet") ) then
    		Color = {r = 1, g = 1, b = 1}
    	elseif UnitIsPlayer("target") then
    		local _, class = UnitClass("target");
    		Color = RAID_CLASS_COLORS[class];
    	else
    		if UnitIsEnemy("player", "target") then
    			Color = {r = 1, g = 0, b = 0}
    		elseif UnitCanAttack("player", UFD.unitname) then
    			Color = {r = 1, g = 1, b = 0}
    		else
    			Color = {r = 0, g = 1, b = 0}
    		end
    	end
    end
    	
    self:SetBackdropBorderColor(Color.r, Color.g, Color.b, self.bg:GetAlpha())
    


    I apologize if this has been covered elsewhere, I was unable to find a solution after much digging. Since most of the information I used in my UI came from your own replies in various forums I hoped I could spring this on you since you answered me personally. =) Thanks again for any help.
    Posted in: AddOn HELP!
  • 0

    posted a message on needing help with weak auras
    I am using WeakAuras to add icons and spell effects to the target frame in my UI. I have been successful with what I wanted different targets to display with the exception of wild (capturable) critters/pets. I have tried various triggers and events to have an icon (tracking_wildpet) show while targeting capturable critters, but I have found no way to differentiate from other (non-capturable) critters/pets. I'm certain the solution lies in creating some type of custom trigger, but my experience with API and lua extends to just over 48 hours now.... I have tried to cobble it together myself with no luck =( any help from a knowledgeable source would be much appreciated.
    Posted in: AddOn HELP!
  • To post a comment, please or register a new account.