• 0

    posted a message on Adding Buttonfacade support
    Hmm I followed the instructions and I think I got it working, I'm not familiar with ace at all so I might have made some misstakes

    local testAddon = {}
    local addon = testAddon
    local defaults = {}
    
    addon.db = LibStub("AceDB-3.0"):New("testaddonDB", defaults)
    
    local button = CreateFrame("Button", "testbutton", UIParent, "BuffButtonTemplate")
    addon.button = button
    button:SetPoint("CENTER")
    button:SetHeight(50)
    button:SetWidth(50)
    
    button.icon =_G[button:GetName().."Icon"]
    addon.button.icon = button.icon
    button.icon:SetTexture("Interface\\Icons\\Spell_nature_rejuvenation")
    
    -- First things first, create a local copy of the LibButtonFacade library.
    local LBF = LibStub("LibButtonFacade", true)
    
    -- Register your call-back function in your load function.
    LBF:RegisterSkinCallback("testAddon", LBF.SkinCallback, LBF)
    
    -- Create a local "Group" object for each "bar" of buttons.
    local Group = LBF:Group("testAddon", "buttonGroups")
    
    -- Skin your groups with the data saved in your saved variables file.
    function LBF:SkinCallback(SkinID, Gloss, Backdrop, Group, Button, Colors)
       -- If no group is specified, save the data as the root add-on skin.
       -- This will allow the ButtonFacade GUI to display it correctly.
       if not Group then
          self.db.SkinID = SkinID
          self.db.Gloss = Gloss
          self.db.Backdrop = Backdrop
          self.db.Colors = Colors
       else
          self.db[Group]["SkinID"] = SkinID
          self.db[Group]["Gloss"] = Gloss
          self.db[Group]["Backdrop"] = Backdrop
          self.db[Group]["Colors"] = Colors
       end
    end
    
    -- Add the buttons to each group.
    Group:AddButton(addon.button)
    
    


    I added the following libs to my addon folder: LibStub, CallbackHandler-1.0,AceDB-3.0 and the embeds.xml file containing the path to libs.

    Any suggestions?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Adding Buttonfacade support
    Like the title says, how can I add buttonfacade support to my buttons?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Localized strings issue
    Ah nice, thanks
    Posted in: Lua Code Discussion
  • 0

    posted a message on Localized strings issue
    Hey all, I'm having a localization issue with one of my addons. It's a simple addon that counts all the gems you have equipped and which color they are. The problem is the api I'm using to determine the color of the gem uses localized strings: GetItemInfo(gemItemID) returns localized itemSubType ie. "Red" for a red gem, "Blue" for a blue.

       local testGem = (select(7, GetItemInfo(gem)))
       if testGem == "Red" then
          redGems = redGems + 1
       elseif testGem == "Blue" then
          blueGems = blueGems + 1
    ---- and so on
    


    Is there any easy way to make this to work on other clients or do I have to create a localization file for all the languages? :(
    Posted in: Lua Code Discussion
  • 0

    posted a message on Localization code review
    Cool thanks
    Posted in: Lua Code Discussion
  • 0

    posted a message on Localization code review
    So I've decided to finally start localizing my addons, I read some stuff on wowwiki and checked out other addons and I think I got something working. Since my client is in english I can't really test it (or can I?), so I figured I would post my code here for review before implementing it into my public addons.

    Here is my test addon
    -- helloworld.toc
    ## Title: HelloWorld
    ## Notes: Hello world
    ## Notes-deDE: Hallo Welt
    ## Notes-esES: Hola Mundo
    ## Notes-frFR: Bonjour tout le monde
    ## Version: 1.0
    ## Author: blahblah
    ## Interface: 40000
    ## SavedVariablesPerCharacter: 
    
    localization.lua
    HelloWorld.lua
    
    -- helloworld.lua
    local _, L = ...
    
    local f = CreateFrame("Frame")
    f:RegisterEvent("PLAYER_ENTERING_WORLD")
    
    f:SetScript("OnEvent", function()
    	print(L["Hello World!"])
    end)
    
    -- localization.lua
    local _, L = ...
    local locale = GetLocale()
    
    if locale == "deDE" then
    	L["Hello World!"] = "Hallo Welt!"
    elseif locale == "esES" then
    	L["Hello World!"] = "Hola Mundo!"
    elseif locale == "frFR" then
    	L["Hello World!"] = "Bonjour tout le monde!"
    else
    	L["Hello World!"] = "Hello World!"
    end
    
    


    Does it seem ok?
    Also, should I translate the slash commands as well? and the options panel name?

    e.g
    --snip--
    addon.panel = CreateFrame("Frame", addonName.."panel", UIParent)
    addon.panel.name = L["PortraitTimers"]
    
    --
    L["PortraitTimers"] = "??????? ???" --ok I suck at russian
    


    and (does this even work?)
    --snip--
    SLASH_TB1 = L["/tb"]
    
    --
    L["/tb"] = "/??"
    


    or is that gonna cause problems?
    And a final question, how do you get ahold of the proper translations? Is it acceptable to use an online translator? :p
    Posted in: Lua Code Discussion
  • 0

    posted a message on 26 hours waiting on project approval?
    Well that sounds like an awful lot of work for only 2 persons, I don't know who's in charge here but maybe they should hire more people.
    Posted in: Need Help?
  • 0

    posted a message on 26 hours waiting on project approval?
    What gives? why is curseforge so slow at approving projects? On wowinterface it takes literally 1-2 hours to get approved.
    Posted in: Need Help?
  • 0

    posted a message on Question about updating projects
    If I update my project with a new file and description, will it list as updated on the front page even if my file hasn't been aproved yet? Or will it only be listed as 'updated' after it's been aproved?
    Also, why does it take so long for my addons to get approved?
    Posted in: Need Help?
  • To post a comment, please or register a new account.