• 0

    posted a message on Scope problem? Fontstring overlays itself ...
    Dear Torhal,

    Thank you so much for your prompt answer (and I put your modified code in and of course it works beautifully). I think I understand what is happening better. I reckon the sample code I was looking at on lua frames was trying to accomplish two things and explain about events at the same time or something.

    Also, we like your hair.

    Yours,
    Dor
    Posted in: Need Help?
  • 0

    posted a message on Scope problem? Fontstring overlays itself ...
    Hi,

    I'm just trying to learn Lua, so I took one of my favorite addons and decided to modify it as a first project. The original just created a small text string above the target's portrait with the player class and was a simple XML/Lua project.

    I have now modified it so that it will show the player class if it is a player, or the mob type if it is a mob. It will also /love a critter! Also I wanted to try to completely create the frames from lua so I modified it to lose the XML completely. HOWEVER ...

    When i am targetting a player and i zone into an instance, then target something else, the text for the original player shows up under/over the new text.

    I am thinking that a new instance of fontstring has been created and is being superimposed on the old one, but I am not sure.

    Here is my entire code. I suspect a problem with scope and/or garbage collection as I am not really understanding when you create a new frame and should i be creating something UNDER the font string to 'support it'?

    Should i be deregistering the "PLAYER_ENTERING_WORLD" event after the first initialize and HOW? I have tried but all the ways I have tried pop up errors.

    Thanks very much in advance,
    Dor


    ----------------------------------------------------------------------------------------------------
    -- TARGET CLASS
    -- originally by Shaktar of Stonemaul - but pretty much completely changed now.
    -- Shows target's class above target portrait.
    --
    -- 27.5.2010: modified by Dor of EU-Moonglade 27.5.2010 to show also type of target if it is not a player.
    -- 28.5.2010: modified by Dor of EU-Moonglade 28.5.2010 to use only lua and no XML.
    ----------------------------------------------------------------------------------------------------


    local TargetFramePlus = {}

    local frame = CreateFrame("Frame", nil, TargetFrame)

    frame:RegisterEvent("PLAYER_ENTERING_WORLD")
    frame:RegisterEvent("PLAYER_TARGET_CHANGED")
    frame:RegisterEvent("ZONE_CHANGED_NEW_AREA")


    frame:SetScript("OnEvent",
    function()
    if event == "PLAYER_ENTERING_WORLD" then
    TargetFramePlus:Initialize()
    end

    if event == "PLAYER_TARGET_CHANGED" then
    TargetFramePlus:ShowLabel()
    end
    end)

    TargetFramePlus.frame = frame

    function TargetFramePlus:Initialize()

    local frame = self.frame

    local frameText = frame:CreateFontString(nil,"OVERLAY","GameFontNormalSmall")
    frameText:SetPoint("CENTER","TargetFrame","TOPRIGHT",-74,-3)

    frame.TargetFramePlusText = frameText

    end

    ----------------------------------------------------------------------------------------------------

    function TargetFramePlus:ShowLabel()

    local frame = self.frame

    local class = ''
    local creature = ''
    local race = ''
    local displaystring = ''

    frame.TargetFramePlusText:SetText(displaystring)

    if UnitIsPlayer('target') then
    class = UnitClass('target')
    race = UnitRace('target')
    if class and race then
    displaystring = race .. ' - ' .. class end
    else
    creature = UnitCreatureType('target')
    -- class = UnitClassBase('target')
    if creature then
    displaystring = creature
    if creature == "Critter" then DoEmote("love") end
    end

    end
    frame.TargetFramePlusText:SetText(displaystring)

    end

    ----------------------------------------------------------------------------------------------------
    Posted in: Need Help?
  • 0

    posted a message on JWowUpdater - A new java addons updater for ace2
    Quote from rolfba
    JWU is of now a discontinued project, i dont have the energy to keep fighting the small hurdles that seems to appear on wowace and curse all the time.

    Thank you all for the time you used JWU, and may your time with Curse Client be as happy as your time with JWU.

    /Rolf


    Thank you for all your hard work on this wonderful program. I am very sorry to see it go.

    Dorelli
    Posted in: Updaters
  • 0

    posted a message on Daily Quest Tracker: (Offical Thread)
    I installed this addon today with JWoWUpdater and everything is working fine until I go to the daily randoms. Then I get these errors:

    2008/07/14 17:55:58-835-x1]: DailiesQuestTracker-2.4.2.07\DailiesQuestTracker.lua:368: attempt to index field '?' (a nil value)

    and

    [2008/07/14 17:57:45-835-x5]: DailiesQuestTracker-2.4.2.07\DailiesQuestTracker.lua:1678: attempt to index field '?' (a nil value)
    FuBarPlugin-2.0-63898:369: in function `runChildren'
    Tablet-2.0-64130 (TabletLib):2356: in function `children'
    Tablet-2.0-64130 (TabletLib):2400: in function `Open'
    Tablet-2.0-64130 (TabletLib):2534: in function <Interface\AddOns\TabletLib\Tablet-2.0\Tablet-2.0.lua:2528>
    FuBarPlugin-2.0-63898:418: in function <...\FuBarPlugin-2.0\FuBarPlugin-2.0\FuBarPlugin-2.0.lua:417>

    I am not sure what I am doing wrong (Fubar is new on my computer as well - maybe I am missing part of it?)

    Thanks in advance ... Dor


    Posted in: FuBar AddOns
  • 0

    posted a message on AckisRecipeList - Official Thread
    -- Deleted b/c I realized you HAD put in the BFAC for the rep for alliance and horde but it depends on filters etc. to either see or not see, rather than a tag in the display.

    Feeling silly but all the same happy to help should you need it in any way in the future ...

    Dorelli
    Posted in: General AddOns
  • 0

    posted a message on AckisRecipeList - Official Thread
    I absolutely love this work! I went and got most of my cooking recipes today and only have a few left. I found out about the three new ones from the lady in LC-Shattrath that i didn't know about from using ARL!

    Wishlist. Some of my toons don't have many recipes so everything scrolls out of sight and cannot be found again. The guiscan isn't happy on my config with text lines opening and obscuring other lines and it being all pretty illegible. Suggestion: either a filter to scan x y which just tells you the missing recipes from skill level x to skill level y - and therefore lets you chunk it up. Or output to a text file?

    Second. Some of the recipes are vendor but are known to be horde only or alliance only. Would it be possible to mark them with Vendor (AH) or Vendor (H) or Vendor (A) - or something similar?

    http://www.wowwiki.com/Alliance-only_Recipes
    http://www.wowwiki.com/Horde-only_Recipes

    Thank you again for writing this great addon!
    -- Dorelli
    Posted in: General AddOns
  • To post a comment, please or register a new account.