• 0

    posted a message on Boss Mod
    Hi,

    Just an idea for a very simple addon... I don't have time to write it but , for those who play at work how about an emergency button, that pops up a fullscreen graphic of email Inbox or something... emergency "hide wow" button.

    :)
    Posted in: Addon Ideas
  • 0

    posted a message on Unitframes
    Thanks, Egingell, I have quite a few requests to fix this, I'll give it a try tonight! :)
    Posted in: Lua Code Discussion
  • 0

    posted a message on Unitframes
    Bump, in case anyone has time to help on this.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Unitframes
    Hi,
    I wrote a unitframe oUF, but it has a bunch of bugs, mainly, that I don't know how to make it change target when the unitframe is clicked, ie, if I clicked target-of-target unitframe, then it won't change target. I know it can be done because Clique does it and other oUF files do it.

    If anyone has a little time, (because of xpac and work and xmas shopping I really am behind for a couple more weeks).. this addon needs some assistance, with the clique thing or any other bugs that are obvious in how to fix.

    I'll link whole thing in case anyone has time to help, because the problem isn't in any particular line of code, but in that my structure isn't exactly like other oUF files and thus doesn't work in quite the same way at all, I couldn't place my menus where theirs were and have it work, so copying their click code also didn't help.

    http://www.wowinterface.com/downloads/info18969-oUFHenna.html

    Thanks :)
    Posted in: Lua Code Discussion
  • 0

    posted a message on Number format with commas
    Quote from contrebasse
    Not in french : 1000 millions = 1 milliard. But I dont't know how it is shorten, I guess we rather use kilo-, Mega-, Giga-, Tera- and so on. Also, a lowercase 'm' means 10^-3. 10^6 would be M.


    I'm sure I can find a file somewhere later about localization of mill and billion, but would the m actually be confusing? I will probably not worry about billions until I see a mob that has so much.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Number format with commas
    Quote from Ketho

    and sorry for about continuing derailing the thread :)


    No worry Ketho, I do it all the time. ;)
    Posted in: Lua Code Discussion
  • 0

    posted a message on CreateTitleRegion
    Thanks Xin, Never would have thought of it, but it's particularly relevant, since the frame being dragged is a player's Target frame, which is hidden often. Tested and working nicely.
    :cool:
    Posted in: Lua Code Discussion
  • 0

    posted a message on Number format with commas
    I'm also confused by all the %s and %d type things in formatting. Is there somewhere these are explained?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Number format with commas
    Thanks, Dridzt!
    I'm not sure of the etiquette - should I ask them before using this bit of code?

    In case anyone else is struggling with this, here's code (that I used for a healthbar) that shows commas if my target is under 1 million health, but rounds if he's over. It adds also a green m for millions.

    When showing my own health, I don't like it rounded off because I like to see the full numbers when changing out gear. But numbers are far more legible with the commas.

    local function numformat(number)
        if number < 0 or number == 0 or not number then
            return 0
        elseif number > 0 and number < 1000000 then 
            local t = {}
            thousands = ','
            decimal = '.'
            local int = math.floor(number)
            local rest = number % 1
            if int == 0 then
                t[#t+1] = 0
            else
                local digits = math.log10(int)
                local segments = math.floor(digits / 3)
                t[#t+1] = math.floor(int / 1000^segments)
                for i = segments-1, 0, -1 do
                    t[#t+1] = thousands
                    t[#t+1] = ("%03d"):format(math.floor(int / 1000^i) % 1000)
                end
            end
            if rest ~= 0 then
                t[#t+1] = decimal
                rest = math.floor(rest * 10^6)
                while rest % 10 == 0 do
                    rest = rest / 10
                end
                t[#t+1] = rest
            end
            local s = table.concat(t)
            wipe(t)
            return s
        elseif number >= 1000000 and number < 1000000000 then
            return format("%.1f|cff93E74F%s|r", number * 0.000001, "m")
        elseif number >= 1000000000 then 
            return format("%.1f|cff93E74F%s|r", number * 0.000000001, "bil")
        else
            return number
        end
    end

    Note that 93E74F is the color value for the "m" and "bil", and can be changed.

    And to call it:
    local num1 = numformat(12345)
    local num2 = numformat(12345678)
    MyTextField:SetText(num1.."/"..num2)
    Posted in: Lua Code Discussion
  • 0

    posted a message on Number format with commas
    Hi,
    Working on an oUF and I would like to add commas into my numbers, like my health is 42,080 instead of 42080.
    I just can't even think of how to search for this or ... all my searches come up with nothing. Would it be very difficult?
    Thanks!
    Posted in: Lua Code Discussion
  • 0

    posted a message on CreateTitleRegion
    Thanks Phanx!

    This worked with minor edits:

    function MyAddonName:SetMovable(self)
        local Container = self.DragFrame:GetParent()
        self.DragFrame:EnableMouse(true)
        self.DragFrame:SetClampedToScreen(true)
            Container:SetMovable(true)
            Container:SetClampedToScreen(true)
        self.DragFrame:RegisterForDrag("LeftButton")
        self.DragFrame:SetScript("OnDragStart", function(self, button)
            Container:StartMoving()
        end)
        self.DragFrame:SetScript("OnDragStop", function(self, button)
            Container:StopMovingOrSizing()
        -- get container position and save it here if you want
        end)
    end
    It wouldn't retrieve self.Container, which is odd since I used that all over everywhere else in the file, but GetParent worked. Silly computer.

    I also couldn't find any documentation on the CreateTitleRegion... probably because everyone does it this way.
    Posted in: Lua Code Discussion
  • 0

    posted a message on CreateTitleRegion
    Hi,

    I think I need to use Frame:CreateTitleRegion:
    http://wowprogramming.com/docs/widgets/Frame/CreateTitleRegion

    I created a frame called Container, that holds everything. Then I created a Child frame that's anchored to the container, but placed outside it on the left. If I want to drag the Container and the Child, by clicking on the Child only, then what do I do?

    Changing the width/height of the container to cover this region would be a long workaround, since I referenced the width about 100 times already.

    What kind of values would I put in CreateTitleRegion, and is it appropriate for this case?

    Thanks.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Quartz: Modular Casting Bar
    Yes but I'm a druid... I have 15000 spells. I use all my Cliques, and my shift-cliques, and all the number keys I can reach with the hand that's not Clique-ing. I am Lyelu, hear me rawr! But seriously, I have a tank selected at all times.

    Someone wrote a "proof of concept", so I'm going to try it out:
    http://www.wowinterface.com/downloads/info18718-GlobalCastBars.html
    Posted in: General AddOns
  • 0

    posted a message on Sum of values in list
    I see what you mean... It's working now and I have absolutely no idea why... I don't think I changed anything. Spent a couple hours on it, couldn't make it work, and now when I go back it's working. I feel like an idiot, sorry! Baffled.
    ;)
    Posted in: Lua Code Discussion
  • 0

    posted a message on Quartz: Modular Casting Bar
    Hi Nev...
    I had an idea which I thought might best belong in Quartz. As a healer I generally have to keep my target on players in my raid. I can set the focus to the boss and see his castbar with Quartz, which is nice because on LK for example, I make the castbar really big atop my Grid and I always know what he's casting.

    But now I want to be able to also see the cast when Shambling Horror casts "Enrage", so I can Soothe. As a healer, I can't keep him selected. Would there be any way to set more than one focus, and see their cast bars? Or better, to create a listener for specific spellcasts from specific mobs, that I would type in, and then see the castbar appear?

    I don't think that any mod currently has this, and it may not be possible... just thought I'd suggest it, in case any other healers want to be able to do interrupts etc, more easily. I suggest it in Quartz because it could be added as a module or something, since probably most healers use Quartz already.

    :) Lyelu
    Posted in: General AddOns
  • To post a comment, please or register a new account.