• 0

    posted a message on Method Failure with DB interaction (librockconfig and librockdb)
    I understand now, makes sense tbh. Problem i had was the reason i was passing in the link was so it could be used for more then just the example above. Ie. to allow me to plugin in other DB interactions such as profile.qShow or account.example[ val ], etc.

    If that is not possible without it becoming an upvalue then i shall leave it as the original exapmle of code.

    Although gonna try something else in the mean time.

    Edit:
    Tried this example which was what i had before:
    preFab:toggle( inPath.args[ nm.."_h" ],"Quick Text",profile.show[ val ],"quick",1 )
    
    function preFab:toggle( inConnect,inName,inDBLink,inDBRef,inOrder )
        inConnect.args[ inName.."_"..FuBar_Token:GetFirst( inName ) ] = {
            type = 'toggle', name = inName,
            desc = "Show "..inName.." in the "..inName.." tooltip.",
            get = function() return inDBLink[inDBRef] end,
            set = function(x) inDBLink[inDBRef] = x end,
            order = inOrder,
        }
    end


    This actually works, the link is still using the db and not an upvalue version of it. Although annoying to add in an extra field it will have to do. Unless there is an actual simpler way (but still allows for cross usage for multiple inDBLink.

    Hope that makes sense ^^
    Posted in: AddOn HELP!
  • 0

    posted a message on Method Failure with DB interaction (librockconfig and librockdb)
    I have recently decided to create a method to handle the constant used code within my project. Now the problem stands that although it can pull from the db to get the value it can no longer affect the value at the db. Rather it effects its own value and no longer the DB.

    Original working code:
    inPath.args[ nm.."_h" ].args[ nm.."_q" ] = {
         type = 'toggle', name = "Quick Text",
         desc = "Show "..nm.." in addon text.",
         get = function() return profile.show[ val ].quick end,
         set = function(x) profile.show[ val ].quick = x return end,
         order = 1,
    }


    defined - inPath = route to options location, nm = name, profile = addon.db.profile

    This works but when used like this:
    preFab:toggle( inPath.args[ nm.."_h" ],"Quick Text",profile.show[ val ].quick,1 )
    
    function preFab:toggle( inConnect,inName,inDBLink,inOrder )
        inConnect.args[ inName.."_"..FuBar_Token:GetFirst( inName ) ] = {
            type = 'toggle', name = inName,
            desc = "Show "..inName.." in the "..inName.." tooltip.",
            get = function() return inDBLink end,
            set = function(x) inDBLink = x end,
            order = inOrder,
        }
    end


    The function for retrieving the state works but then modifying the state of the db seems to fail or rather it works but doesn;t effect the db but rather some local variable created within the function.
    Posted in: AddOn HELP!
  • 0

    posted a message on [Grid] Modules: Threat,RaidIcons,MTs / Indicators: Text3,SideIcons
    Request for: GridIndicatorSideIcons
    Change: Offset Range

    Is there any chance u could increase the range from -10 to 10, to say -20 to 20.

    Thanks
    Posted in: Grid & Grid2
  • To post a comment, please or register a new account.