• 0

    posted a message on How to add libsharedmedia to my addon?
    hmm i should probably toss libstub in with the widgets (never was a problem cause usualy people run either everything embedded or nothing :P )


    Edit: done try http://www.wowace.com/addons/ace-gui-3-0-shared-media-widgets/files/41-r34/

    Edit2: also i just figured out your problem, you do not have one :P

    in the 3.3.x and before versions i basically hacked the acegui dropdown to display the all the bars and for some reason they ended up behind something thus getting darker. in the 3.4.x versions i completely rewrote the dropdown so it doesn't rely on the acegui dropdown widget anymore and was thus able to display the textures in their full glory (without any coloring/tinting so that nothing gets lost due to lost contrast)
    Posted in: Lua Code Discussion
  • 0

    posted a message on How to add libsharedmedia to my addon?
    have you tried removing the widgets from your addon and running them as standalone? see if you embeded them wrong otherwise could you zip up your addon and post it so that i can try to run it and see whats going on
    Posted in: Lua Code Discussion
  • 0

    posted a message on How to add libsharedmedia to my addon?
          Textures = {
                    type = 'select',
                    name = 'Background Texture',
                    desc = 'Changes the background texture',
                    dialogControl = [B]'LSM30_Statusbar'[/B],
                    values = LSM:HashTable([B]'statusbar'[/B]),
                    get = function()
                            return 'Empty' -- return UnitBars.PlayerHealth.StatusBarTexture
                          end,
                    set = function(info, value)
                            table.foreach(info, print)
                            print(info, [B][COLOR="Red"]LSM:Fetch('background', value)[/COLOR][/B])
                          end,
    
                  },


    again let me point out you are still mixing your media types. you are specifying LSM30_Statusbar but are using background in your set function this is all kinds of bad


    the below code is "fixed" but you need to make sure to fix all your media references and not mix and match them randomly in your code.
          Textures = {
                    type = 'select',
                    name = 'Background Texture',
                    desc = 'Changes the background texture',
                    dialogControl = 'LSM30_Statusbar',
                    values = LSM:HashTable('statusbar'),
                    get = function()
                            return 'Empty' -- return UnitBars.PlayerHealth.StatusBarTexture
                          end,
                    set = function(info, value)
                            table.foreach(info, print)
                            print(info, LSM:Fetch('statusbar', value))
                          end,
    
                  },
    Posted in: Lua Code Discussion
  • 0

    posted a message on Checking if an element exists in an unknown-dimensioned table
    Quote from sapu94
    Yea that's not really any better...what about something like this

    if pcall(function() return t.chicken.feet.value end) then
      local value = t.chicken.feet.value
    end


    I just tried that and it seems to have worked. Not really a good solution but arguably better than the original if statement.


    stick with your original IF statment. it might look ugly but it works very well. this "new" approach would waste memory and be slower since instead of some fast table lookups you are doing a pcall and creating a closure(function) each time that code is called
    Posted in: Lua Code Discussion
  • 0

    posted a message on How to add libsharedmedia to my addon?
    Quote from Galvin
    I copied pasted that code but somehow my addon is still making that dropdown nearly all white along with threatplates statusbar texture dropdown. Soon as I disable my addon from the login screen the threat plates dropdown goes back to grey.

    Somewhere in the way I have it in my toc or in main.lua. Maybe the TOC is the issue?



    i didn't fix that code i just pointed out the mistakes in it which you will need to fix :)
    Posted in: Lua Code Discussion
  • 0

    posted a message on How to add libsharedmedia to my addon?
    your LSM widget implementation is all screwy you are using multiple types of media on the same widget

                  Textures = {
                    type = 'select',
                    name = 'Background Texture',
                    desc = 'Changes the background texture',
                    dialogControl = 'LSM30_Statusbar',
                    values = LSM:HashTable('statusbar'),
                    get = function()
                            return UnitBars.PlayerHealth.BackdropSettings.BgTexture
                          end,
                    set = function(info, value)
                            table.foreach(info, print)
                            print(info, LSM:Fetch('background', value))
                          end,
    
                  },

    you need to make sure that you are not mixing up your media types, the above is from your code, you seam to create everything correctly but then in your set function you are Fetching background data instead of statusbar data.

    you may want to go through all your options and make sure that each media type stays the same all the way throughout mixing up the different types is very bad.
    Posted in: Lua Code Discussion
  • 0

    posted a message on How to add libsharedmedia to my addon?
    Quote from Galvin
    So what could I be doing wrong to cause the statusbar texture dropdown in all mods that use ace sharedmedia widgets to appear very bright or like highlighted?

    Normally the dropdown is grey, but after my mod loads the dropdown becomes nearly white.


    any chance we can have a look at your option code?:D
    Posted in: Lua Code Discussion
  • 0

    posted a message on How to add libsharedmedia to my addon?
    Quote from Galvin
    So I have to register all the border, statusbar textures, fonts? It doesn't preload it?

    Whats the setglobal in the callbacks do?

    I'm looking at omen, but I really need to know what these functions do, do they pass back an array of fonts, statusbars, etc. How do I store it, etc.

    does the callback fire off every time the addon loads? what data does the callback supply, how do I pull the new data, etc etc.


    LSM comes with some media preloaded however you can register your own media as well

    as far as what each function does look at http://www.wowace.com/addons/libsharedmedia-3-0/pages/api-documentation/

    under the callback part of that it also tells you when each callback fires
    Posted in: Lua Code Discussion
  • 0

    posted a message on How to mix AceGUI widgets with Xml frames?
    Quote from Torhal
    Ideally, you'd never use AceGUI-3.0 directly. Instead, you'd use AceConfigDialog-3.0 which uses AceGUI-3.0 internally, and was specifically designed for handling options tables.


    one thing i have found a use for AceGUI directly is if i need a dynamic list of widgets in a scrollframe. Thats what i do in YssBossLoot. I made a AceGUI widget for loot items (has a place for and items name, texture, type, drop rate) then i make 1-4 container frames (depending on how many difficulty's a dungeon has) this container i fill with a AceGUI Scrollframe, then i simply add all the items to the scrollframe which takes care of the layout for me thus saving me from needing to write all the scrollframe and layout code. once i close it i release all the widgets inside the scrollframe and they will get reused the next time its opened (again here i saved myself some frame recycling code)

    other than that your probably better of creating your own GUI (this way you don't have to try to wrap your head around the inner workings of AceGUI)


    just remember whatever you do frames can not be destroyed so reuse them as much as possible (and NEVER create new frames OnUpdate)
    Posted in: Ace3
  • 0

    posted a message on How to add libsharedmedia to my addon?
    Quote from myrroddin

    Set a callback function for media changes (you can set all changes via one function)


    To elaborate on this:

    The callback is used to notify your addon that more media has become available for use via LSM. You need to know about this since one of your users might be using a font that addon "XYZ" provides which gets loaded much later than yours. as such your addon will use the default font (LSM will give you a default font) and you should update your addons fontstrings when the appropriate font gets loaded later

    also you should wait to right before you start pulling info from LSM to register for the callback since otherwise you will get unnecessary function calls at loadtime
    Posted in: Lua Code Discussion
  • 0

    posted a message on YssBossLoot
    thoughts i had when moving those files into a lib folder:

    I am thinking of splitting the dropinfo on item tooltips into its own addon and thus would require a shared yet independent database. As such when i rewrote the wowhead miner, last time it broke, I also broke out all the data access functions to parse the data and made sure it could upgrade itself when more than one version was loaded (YAY libstub). As such it is more a library than just some data so I tossed it in the lib folder.

    I am not entirely sure if i want to make it into a standalone Lib, unless there is demand from others (also someone else with more programming experience should look through the lib code to make sure it is all good before releasing it imo), but i am open to it :)
    Posted in: Map/Minimap AddOns
  • 0

    posted a message on Simple list box with AceConfig?
    Quote from Niightblade
    In future I will probably want to multi-select items in the list.


    with that you have 3 options

    1. Design your own GUI
    2. Use AceGUI directly and layout the widgets exactly like you want
    3. create your own baseframe that has two containers. The first one you fill with a optiontable that contains all your spells via the toggle type, and the second one you fill with the options for that spell/s
    Posted in: Ace3
  • 0

    posted a message on Simple list box with AceConfig?
    you can just force update your option table via AceConfigRegistry:NotifyChange(appName)

    with that you can change your optiontable and then tell it to update and it will refresh your window
    Posted in: Ace3
  • 0

    posted a message on LibScriptableDisplay-1.0
    also if you have the same person in both white and blacklist (say person is in your guild and also on the black-list) black-list should always trump the white-list

    you could maybe have an event log that has a history of who and when you accepted scripts and maybe even the code of the script
    Posted in: Libraries
  • 0

    posted a message on Simple list box with AceConfig?
    treegroup is your only real option with AceConfigDialog (why is your list changing frequently and why is this a problem for the treegroup?)
    Posted in: Ace3
  • To post a comment, please or register a new account.