• 0

    posted a message on GameTooltip Width
    I want a tooltip with a short first line, and lengthier secondary/tertiary/etc lines. With the added stipulation that those later lines not wrap, that the tooltip be wide enough to fit their unbroken length. I've been working at this for the last few hours, dug through the appropriate files in the FrameXML, groaned at the psuedo-code on WoWWiki, and posted on the official UI forum (hah!), and am as yet empty-handed. The only solution I can think of is to take a hit-and-miss approach with SetWidth calls after the tooltip is rendered, but this is almost unspeakably ugly and imprecise. Following is my observations, as posted on the official forums:

    I'm aware that it has several functions that roughly parallel those of a typical Region, but are not defined within the FrameXML- like I said, I've dug through that. And I've checked WoWWiki, where someone has made an attempt to document the behavior in Lua-ish psuedo-code, but all that contains in terms of defining the size of the tooltip is the following:
             LayoutTooltip();    -- Resize tooltip based on shown fontstrings

    Which tells me something, but not much. I know experimentally that the width is, at least in some cases, derived from the length of the string supplied to GameTooltip:SetText. Those cases seem to be those in which this first string (StringA, for convenience) is the longest string to be displayed on the tooltip. However, if StringA is shorter (in pixel-width, not characters) than a string supplied to an AddLine call, the tooltip appears to expand itself, within limits, to adapt. That limit appears to be the greater of either the pixel-width of StringA, or a value, somehow derived from the other strings, that hovers around 235px. However, in this case, the final argument to AddLine (wrapLine) is ignored- all strings after StringA will be wrapped to the tooltip's width, period. Even if all extra strings are told not to wrap, some shorter width is chosen and the strings wrap anyways.

    And why this matters to me? I'm trying to build a tooltip with a relatively short first line, but with lengthier secondary lines, and those extra lines are getting wrapped despite my explicit instruction not to. The only solution I can see at this point is a rather hit-and-miss tactic of guessing SetWidth parameters for the Tooltip and it's FontStrings, which is obviously quite ugly and imprecise.


    So, my question:
    Is there any way to force a GameTooltip to determine its width using the un-broken length of the longest string it contains?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Multi-select List Boxes?
    /e is enlightened.

    Thanks. =)
    Posted in: Lua Code Discussion
  • 0

    posted a message on Multi-select List Boxes?
    Again, the most common use would be to select a wide range of entries, say, #15-24. Clicking nine times would be inconvenient. With this apparently out of easy reach, I've turned to just listing the entries and having the user type in two values for the range. However, this has led toz an interesting bug...

    Ignoring the abundant ugliness of this mess, there's something screwy going on. Despite the identical setup, MaxEdit is drawing improperly. (pic attached) What the hell is going on (What have I failed to understand this time) ?

    -- Label: "From: "
    	CorvSKG.RecordsMenu.MinLabel = CorvSKG.RecordsMenu:CreateFontString("MinLabel", "OVERLAY", "GameFontNormal")
    	CorvSKG.RecordsMenu.MinLabel:SetText("From: ")
    	CorvSKG.RecordsMenu.MinLabel:SetPoint("TOPLEFT", 10, -240)
    -- Minimum
    	CorvSKG.RecordsMenu.MinEdit = CreateFrame("EditBox",nil,CorvSKG.RecordsMenu,"InputBoxTemplate")
    	CorvSKG.RecordsMenu.MinEdit:SetAutoFocus(false)
    	CorvSKG.RecordsMenu.MinEdit:SetNumeric(true)
    	CorvSKG.RecordsMenu.MinEdit:SetMaxLetters(4)
    	CorvSKG.RecordsMenu.MinEdit:SetPoint("TOPLEFT", CorvSKG.RecordsMenu.MinLabel, "TOPRIGHT", 4, 0)
    	CorvSKG.RecordsMenu.MinEdit:SetHeight(20)
    	CorvSKG.RecordsMenu.MinEdit:SetWidth(40)
    	CorvSKG.RecordsMenu.MinEdit:SetScript("OnEscapePressed",function() CorvSKG.RecordsMenu.MinEdit:ClearFocus() end)
    	CorvSKG.RecordsMenu.MinEdit:Hide()
    -- Label: "To: "
    	CorvSKG.RecordsMenu.MaxLabel = CorvSKG.RecordsMenu:CreateFontString("MaxLabel", "OVERLAY", "GameFontNormal")
    	CorvSKG.RecordsMenu.MaxLabel:SetText("To: ")
    	CorvSKG.RecordsMenu.MaxLabel:SetPoint("TOPLEFT", CorvSKG.RecordsMenu.MinEdit, "TOPRIGHT", 4, 0)
    -- Maximum
    	CorvSKG.RecordsMenu.MaxEdit = CreateFrame("EditBox",nil,CorvSKG.RecordsMenu,"InputBoxTemplate")
    	CorvSKG.RecordsMenu.MaxEdit:SetAutoFocus(false)
    	CorvSKG.RecordsMenu.MaxEdit:SetNumeric(true)
    	CorvSKG.RecordsMenu.MaxEdit:SetMaxLetters(4)
    	CorvSKG.RecordsMenu.MaxEdit:SetPoint("TOPLEFT", CorvSKG.RecordsMenu.MaxLabel, "TOPRIGHT", 4, 0)
    	CorvSKG.RecordsMenu.MaxEdit:SetHeight(20)
    	CorvSKG.RecordsMenu.MaxEdit:SetWidth(40)
    	CorvSKG.RecordsMenu.MaxEdit:SetScript("OnEscapePressed",function() CorvSKG.RecordsMenu.MaxEdit:ClearFocus() end)
    	CorvSKG.RecordsMenu.MaxEdit:Hide()
    Posted in: Lua Code Discussion
  • 0

    posted a message on Multi-select List Boxes?
    Oh, I'm sure it's possible. Worth the effort is another question.
    Posted in: Lua Code Discussion
  • 0

    posted a message on communicating between addons
    I've wondered about how effective it would be to attempt global communication by sending new messages to the appropriate parties whenever the membership of the existing channels changes. Any decent level of communication would require that the addon be in very widespread use... I dunno. Crazy thought I had.
    Posted in: Lua Code Discussion
  • 0

    posted a message on 3.1.0 the self help thread
    I apologize- I misunderstood. I had assumed that the intent was to get a typical 0->2pi measure, counterclockwise from East (and yes, what I posted above would've given negative values in the 4th quadrant, but they'd refer to the correct angles). Testing on live, though, you want 0 to -2pi ccw from North?

    local radians = (-math.pi/180) * (GetPlayerFacing()+ (GetPlayerFacing() < 0 and 360 or 0))
    Posted in: Lua Code Discussion
  • 0

    posted a message on 3.1.0 the self help thread
    local radians = 0.0174532925 * (90 + GetPlayerFacing())

    Blizzard just rotated everything 90 degrees counter-clockwise, right?

    It returns one value in degrees, where 0 is north, -90 is east, 180 is south, 90 is west, as follows:


         0
    90      -90
        180


    Add 90 to those values:
         90
    180      0
        270
    Posted in: Lua Code Discussion
  • 0

    posted a message on Multi-select List Boxes?
    http://www.insidedhtml.com/tips/html/ts16/page1.asp

    I understand that AceConfig supports the checkbox implementation for multiple selection, but is there any existing way in either Blizzard or Ace (or anywhere else) to create the list box version? The typical use case will be to select a range of adjacent options, rather than picking and choosing, so the checkbox version would be inconvenient at best.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Macaroon broken? (was: Going crazy... an action "bar" - where to start?)
    Directly from game:
    [bonusbar:5]
    [mod:shift,bonusbar:0]
    [mod:ctrl,form:3]
    [form:3,stealth]
    [form:3]
    [mod:ctrl,form:1]
    [form:1]
    [mod:ctrl,form:0/2/4/5]
    [form:0/2/4/5]
    Class druid, in case the plethora of forms didn't give it away. The bar in question does not page to the bonusbar:5 state. Tested with Steam Tonk Controllers and the quest Defending Wyrmrest Accord.
    Posted in: AddOn HELP!
  • 0

    posted a message on Macaroon broken? (was: Going crazy... an action "bar" - where to start?)
    I beg to differ. A bar set to use action IDs 121+ for state bonusbar:5 via custom states does not page. And as for Maul being responsive, that was previously true, but he hasn't responded to a bug report or comment or anything else related to Macaroon! since Nov. 4.

    The "possess" state isn't a real macro option. It's an alias for bonusbar:5, and it's one of the default state options (not a custom state). Attempting to use "[possess]" as part of a custom state set results in errors informing you that "possess is not a valid macro conditional".
    Posted in: AddOn HELP!
  • 0

    posted a message on Macaroon broken? (was: Going crazy... an action "bar" - where to start?)
    Before I launch into a big long explanation, the tl;dr version. I want suggestions for starting places, tutorials, useful documentation, etc. for making an action "bar".

    My problem is basically thus: No up-to-date action bar addon supports paging (or a comparable functionality) based on complex states. For example, let's say that when I enter Bear Form, Bar1 pages to Bar2. And when I'm holding Ctrl, Bar1 pages to Bar5. But I can't have it page to, say, Bar7 if I'm holding Ctrl in Bear Form. No option exists, no combination of settings will allow me to set a paging option for the combined state (testing with Bartender always brought up the Ctrl bar; Dominos ignored modifier keys if I was shapeshifted).
    To express this succintly via macro conditionals, BT/Dominos/etc only allow:
    [mod:ctrl][form:1]
    I'm looking for
    [COLOR=Red][mod:ctrl,form:1][/COLOR][mod:ctrl][form:1].
    I know that the functionality exists (rather, that it *can* exist). FlexBar, FlexBar2, InfiniBar, Macaroon! all support it. Except that all but the last of those is now woefully out of date. Furthermore, Macaroon! only supports complex states via its custom states setting, which is broken and will not page for vehicles or possess, which means that Macaroon! is dead in the water for any serious use in WotLK.

    I spent several hours tonight searching through Macaroon!'s code in an attempt to patch it back together, but the combination of an almost absolute lack of comments with my near total lack of what to expect when looking at the guts of an action bar led to a severe case of frustration. Which you may percieve from my writing.

    I've given up at this point on finding any existing addon that can meet my needs. Thus, I'm left with the conclusion that I'll have to take matters into my own hands if I want it done "right". I come to you, WowAce, hoping that someone(s) might recommend a place to start. Sadly, I've only written a handful of addons in the past, most relatively simple and none with a complex GUI. Fortunately, this addon would be written primarily for myself, and I don't need or want most of the graphical extras associated with an action bar (ButtonFacade support, GCD/cooldown wheels, countdown, range indicators, charge counts, etc). My action bar would be hidden once set up, no more than a method of associating actions with keybinds.

    So really, I'm not so sure that what I want to build is an action bar at all. I could see the setup being done entirely via command line. My problem is learning to create whatever structure I would need to go from "<this key> + <these conditions> = <this spell>" (which I can do) to "<this key> + <these conditions> = cast <this spell>" (which I can't). All I know (or think I know) is that it will require Secure Handlers. But I don't know where to start.

    Please. Please. Help.
    Posted in: AddOn HELP!
  • 0

    posted a message on Question regarding AceTimer-3.0
    Shockingly fast response. Many thanks, Nev, Slakah. =)
    Posted in: Ace3
  • 0

    posted a message on Question regarding AceTimer-3.0
    When providing a third parameter to ScheduleTimer(), is that parameter evaluated immediately or when the timer goes off? For example,
    self:ScheduleTimer("Print",10,UnitHealth("player"))
    Posted in: Ace3
  • 0

    posted a message on Looking to make my own mod or die trying.
    Quote from Mokhtar »

    I found the quickest way to actually code and test was to deactivate all addons on your toon except the one you're working on to save on loading time (and possibly buggrabber / bugsack)


    I personally find myself running Swatter and DevTools for testing. =)
    Posted in: Lua Code Discussion
  • 0

    posted a message on Nameplates in combat only
    Checking lastUpdate against 1, the block executes every second. Checking it against zero, it updates instantly every frame (in a typical best case scenario, probably 10 times as often, possibly upwards of 60 times as often), at which point you may as well do away with that variable altogther. However, you performance hit is coming from that for loop and its contents, not the now-redundant lastUpdate check per se. That delay exists for performance reasons.
    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.