• 0

    posted a message on Ideas for the Ultimate Scrollsheet Library?
    If lib-st's author wants to pick up on these ideas and make a new major rev, I'm 100% fine with that, too :P
    Posted in: Libraries
  • 0

    posted a message on Ideas for the Ultimate Scrollsheet Library?
    After tossing ideas around in #wowace, I figured I should jot this down...


    Why another scrolltable / sheet library? Well, not everyone is happy with how lib-st requires all data to be pre-formatted into a fairly recursive set of tables. It doesn't match the raw data storage formats very well.

    The design goal of this library would be to allow data to live in its native format as far as possible, and to query as few values as possible. I.e. only ones currently being displayed, and possibly ones being sorted on (if sorting is enabled at all).



    The basic calls to get the ball rolling


    lib:Create()  - return a "sheet"
    
    sheet:Setup(COLUMNINFO, PROPERTIES, SAVEVAR)


    See below for descriptions of these three tables.
    Only COLUMNINFO is requred. The other two are optional.

    sheet:Close() - return the sheet to the library for future re-use



    Setting data


    sheet:SetData(DATA)
    
    DATA = {
      1 = { foo="Data", bar="More data", baz=123 },
      2 = { foo="Other", bar="More data", baz=234 },
    }


    Obviously these tables can have metatables that create/return some of their values as needed. (At a guess, such a column would not be set as "sortable", since that requires all rows to be populated.)

    If sorting is enabled, the caller must be prepared to have this data re-sorted. If not, it has to make a copy of the table (not deep).


    Describing columns


    COLUMNINFO = {
      ["foo"] = {
        order = 1,
        name="Descriptive Name",
        font=fontobject or function(rowdata, columnname),
        align="RIGHT" or "LEFT" or "CENTER" or function(rowdata, columnname),
        onEnter = function(rowdata, columnname, frame),
        onClick = function(rowdata, columnname, frame, mousebutton),
        width = 123,  -- leave out for automatic sensing of text length
        sizeable = true,
        minWidth = 100,
        maxWidth = 150,
        sortable = true,
        sortFunc = function(rowdata1, rowdata2) -- or nil for standard number/alpha sort
        hidden = true,
        paint = function(rowdata, columnname, frame),
      },
      ["bar"] = {
        order = 2,
        ...
      }
    }


    A note about onEnter / onClick:

    There is no trigger for "onLeave". Instead, react to "frame" becoming hidden. You're allowed to rewrite its OnHide script.

    Similarly, in "onClick" and "paint" drivers, you should react to the frame becoming hidden. In the "onClick" case it would mean something else got clicked. In the "paint" case, it would mean the row scrolled off-screen.



    Table-wide properties


    PROPERTIES = {
      -- defaults for all columns
      columnDefaults = {
        sizeable = true
        sortable = true
        width = 123,
        minWidth = 100,
        maxWidth = 150,
      },
      -- table-wide properties
      columnsDraggable = true
    }





    Optional dynamic data format


    We also define a second way of giving the lib its data: by "row IDs" and a function to extract data from it.

    sheet:SetData(DATA, DATAFUNC)
    
    DATA = {
      1 = "someid",
      2 = 2345,
      3 = sometable
    }
    
    DATAFUNC = function(rowid, columnname)


    All functions that normally get passed a "rowdata" parameter now instead get passed rowids. Note that you can mix the modes fairly easily by having the function react to "rowid" being a table and just extracting the named member. You can also use this instead of metatables on the data to compute some columns dynamically as and when needed.



    Saving state


    If SAVEVAR is defined, the library keeps track of sort orders and user-set column widths in it. Obviously, if resizing / reordering is not enable, this will remain empty.

    SAVEVAR = {
      COLUMNINFO = {
        ["foo"] = {
          order = 2,
          width=150
        },
        ["bar"] = {
          order = 1
        }
      }
    }




    Internal workings


    I'm thinking that the library doesn't have to put buttons all over the place for click / mouseover handling. Perhaps one big button + mouse coordinate math is enough. The "frame" passed to onEnter / onClick could easily hidden, repositioned and re-shown. Well, that is, one for them each.

    The "paint" case isn't fully fleshed out and added somewhat as an afterthought, I must admit. Maybe it should be given a parent, attachpoint, and width+height instead.






    Now.. am I coding this? Er, maybe some year. Otherwise I'd be just as glad if someone else did. I'm just contributing my ideas for a spec here, really.

    Oh and do feel free to discuss improvements and use cases :)
    Posted in: Libraries
  • 0

    posted a message on Baggins - Official Thread
    Yes, Ace3 porting Baggins is something I want to do. But I also know what a pain in the arse it'll be due to config - and especially the bag config which is hardcoded to Waterfall at the moment. (And I want to redesign that completely to begin with. Sigh.) So yeah lots of work that I don't have the energy for right now.

    Going LDB is definitely something I want to do more short term. Same situation here - I think it's my last FuBar plugin. If someone else wants to do the job just holler. It's really one of those "just do it" things - keeping Tablet & Dewdrop popups 'n all as-is.
    Posted in: General AddOns
  • 0

    posted a message on Idea: Supersimple wrapper for UIDROPDOWNMENU to take some of the pain out
    Quote from Xinhuan
    Oh Mikk, there's nothing wrong with your proposed wrapper. However, I just don't think 20 lines of code is worth making into a library


    Quite, hence the copy & paste format ;D


    Quote from Xinhuan
    or just coding to use UIDROPDOWNMENU directly (see my dropdownmenu guide in the Tips and Guides forum).


    Yeah it just does my head in somewhere around option 4 in level 3 which is a child of option 8 in level 2. The chilren->parent relation gets too spread out for my poor brain :(
    Posted in: Lua Code Discussion
  • 0

    posted a message on Idea: Supersimple wrapper for UIDROPDOWNMENU to take some of the pain out
    Somewhat similar but with the major difference that you can supply functions as .value and [index] and not just tables. Granted you could do the same with a bunch of metatables and EasyMenu but arf.

    Oh and my implementation passes arg1 & arg2 to isChecked() if it's a function :)


    Edit: Oh and you don't have to create a frame of your own either.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Idea: Supersimple wrapper for UIDROPDOWNMENU to take some of the pain out
    Okay, check my logic here:

    local ssddmVERSION = 1
    local lib = _G.SuperSimpleDropDownMenu or CreateFrame("Frame", "SuperSimpleDropDownMenu")
    if (lib.version or 0) < ssddmVERSION then
    	lib.version = SuperSimpleDownDownMenu
    	function lib:Show(tab, anchorName, xOffset, yOffset)
    		self.displayMode = MENU
    		ToggleDropDownMenu(1, tab, lib, (anchorName or "cursor"), (xOffset or 0), (yOffset or 0))
    	end
    	function lib:Hide(tab)
    		if UIDROPDOWNMENU_OPEN_MENU == lib and (tab==nil or self.tab==tab) then
    			CloseDropDownMenus()
    		end
    	end
    	function lib:initialize(level)
    		if not level then return end
    		local tab=UIDROPDOWNMENU_MENU_VALUE
    		if type(tab)=="function" then 	-- Is the whole level a function? Call it.
    			tab(level)
    		else
    			for _,v in ipairs(tab) do	-- Iterate children
    				if type(v)=="function" then
    					v(level)
    				else
    					local oldchecked = v.checked
    					if type(v.checked)==function then
    						v.checked = v.checked(v.arg1,v.arg2)
    					end
    					UIDropDownMenu_AddButton(v, level)
    					v.checked = oldchecked
    				end
    			end
    		end
    	end
    end
    


    This is just drycoded, but with this little wrapper you should be able to do stuff like... oh

    local myMenu = {
    	{ text = "WhootMenu", isTitle=1 },
    	{ text = "Submenu!", hasArrow=1, value={
    		{ text="Submenu item 1", isChecked = myIsChecked, func = mySetChecked, arg1="SubMenuItem1" },
    		{ text="Submenu item 2", isChecked = myIsChecked, func = mySetChecked, arg1="SubMenuItem2" },
    	},
    	function(level)
    		-- We do complicated dynamic stuff here so we do a bunch of stuff ourselves
    		UIDropDownMenu_AddButton(blah, level)
    		UIDropDownMenu_AddButton(bluh, level)
    		UIDropDownMenu_AddButton(bleh, level)
    	end,
    	{ text = "Always checked", isChecked = true }
    }
    
    Posted in: Lua Code Discussion
  • 0

    posted a message on GridStatusRaidDebuff
    Quote from yoshimo
    the lib was even updated with data from the testrealms before the patch went even live, i consider this to be a minor problem. Do you want to say im too slow at updating it? ;)


    No, but I've been around for long enough to know that authors come and go, and that they're busy elsewhere sometimes. ;)
    Posted in: Grid & Grid2
  • 0

    posted a message on GridStatusRaidDebuff
    LibBossIds has the same problem - needing manual updating to work.

    Imo just capture names&levels on mouseover/target and autolearn from that.
    Posted in: Grid & Grid2
  • 0

    posted a message on AceGUI button - how to capture Right-Click?
    idd, ticket or gtfo! :)
    Posted in: Ace3
  • 0

    posted a message on AceConfigDialog and relative ordering of negative 'order's
    Quote from Nevcairiel
    We would never code a hack with math.huge in there


    We wouldn't?

    I mean.. we wouldn't!

    *cough*

    cd ..\ace3
    svn revert
    Posted in: Ace3
  • 0

    posted a message on GridStatusRaidDebuff
    Yeah you still need to be able to configure learned debuffs on/off. And when the author learns of a debuff that should be default off (raidwide aoe shit like you talked about), it's still possible to push out a version with that debuff defaulting to off.

    I'm just thinking that the autolearning feature would make it so much ... well.. userfriendlier for those of us being early into new encounters =)
    Posted in: Grid & Grid2
  • 0

    posted a message on GridStatusRaidDebuff
    Something I've been wondering for a while now...

    Couldn't 99% of the stuff be autolearned by just examining who casts a buff? Check targets / mouseovers - if it's a boss level mob, learn its name. Then when you scan buffs, check if it's cast by a known boss.

    You could of course still add new buffs to the list of configurable buffs so that people can turn them on/off.
    Posted in: Grid & Grid2
  • 0

    posted a message on Difficulty getting testers nowadays
    I sincerely doubt that any sort of solution that relies on testers to have an addon installed to know what they should test will have much success.

    Popping a message in the chat window still seems like the best way to me.
    Posted in: General Chat
  • 0

    posted a message on SavedInstances
    Just my own $.02 and personal opinion here: The UI to classify & reorder instances is, imo, overkill and .. well.. "unnecessary bloat". Separating them by raid/5man and then alphabetical sorting is going to cover anyone's needs, really.

    Something entirely different I think would rock though, is being able to request saves from group members and displaying them in the same tooltip. With heroic farming being the current rage, it would be really nice to quickly check what people are saved to (assuming they're running SavedInstances or something else supporting the same protocol).

    Something else it might support would be to manually tick if someone's saved to an instance after querying people and realizing that group members A, B and D don't speak the savedinstances protocol.

    For a protocol, I'd suggest something Real Damn Simple so that other addons can easily speak it. Something like:
    prefix="SAVED", and a single message with lines on the format:
      Halls of Lightning: 5h
      Trial of the Champion: 10, 10h, 25


    Obviously there's going to be a translation issue here, and we can't even assume that clients on the same realm are using the same language. (No, really, ask anyone playing on an english european server). So you'd need to use something useful like LibBabble-Instance and always transmit the instance names as English (or untranslated if no translation exists and hope that the receiving end checks for untranslated also and is the same locale).
    Posted in: Raid AddOns
  • 0

    posted a message on Difficulty getting testers nowadays
    Imo, outputting a chatframe message a couple seconds after login is a lot more user-friendly than popping up dialogs that you have to swat at.

    If you want to be able to click it (e.g. a [Shut up!]), it's fairly trivial to add your own hyperlink type and hook SetItemRef to catch it.
    Posted in: General Chat
  • To post a comment, please or register a new account.