• 0

    posted a message on Addon Template
    Ok, maybe more of a tutorial, advanced hello world add on?

    I'm slowly reworking it into more of a library format that you can just drop in 1 file, like ChangeMeLib.lua then YourAddon.lua but that brings right back to why now use a library.

    So I guess I could settle on this being an example that includes all the features of bigger ones in a easier to follow package.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Addon Template
    For a lot of my smaller addons I use a template that emulates some core ace3 functionality. I'm not sure what to call (as in template/framework etc.) or if I should bother expending on it any more. I do this so I can use the same syntax as Ace3 without having to fuss with no-lib and dependancies.

    ## Interface: 50100
    
    ## Title: Change Me
    ## Notes: A simple addon template that can be quickly filled in for rapid devlopment.
    ## Author: Scotepi
    
    ## Version: @project-version@
    
    ##SavedVariables: CME_Global
    ##SavedVariablesPerCharacter: CME_Local
    
    ChangeMe.lua

    --[[
        Change Me Addon Template by Scotepi
    
        This is a template to build an addon off of. It works very simaler to Ace3 without the dependancy.
        
        Getting Started:
            # Rename the folder and files to your addon name
            # Update the title, notes and author in the toc as well as the referance to lua
            # Do a batch replace in the .toc and .lua of "CME" with a short abbreviation of you addon, this will become the addon table that you use to referance.
            # Update .addon* values in the .lua to referance your addon name, folder and abbreviation
            
        To-Do:
            * Add a method to process settings and make sure all values are set
    
        API:
            * self:OnInitialize() - Ran when the addon is loaded
            * self:Print(...) - Prints a message addonNameAbr: ... to the chat frame
            * self:Debug(...) - Prints a debug message only if self:GetDebug() returns true
            * self:AddSlashHandlers(slashcmd, handler) - Adds a slash handler for the table of slashcmd's
            * self:RegisterEvent(event, callback) - Registeres the event and runs the callback when its fired
    ]]
    
    --[[ Setup the addon ]]
    CME = {}
    CME.addonName = "Change Me"     -- Addon Name
    CME.addonFolder = "ChangeMe"    -- Folder of the Addon
    CME.addonNameAbr = "CME"        -- Short abbreviation
    
    CME.version = '@project-version@'
    CME.versionRev = 'r@project-revision@'
    --[[ end setup ]]
    
    
    --[[ Set your default settings ]]
    local CME_GlobalDefault = {
    }
    local CME_LocalDefault = {
        debug = false,
    }
    
    function CME:OnInitialize()
        self:Print(self.addonName..' Loaded... '..self.version..'-'..self.versionRev)
    
        -- Check saved variables
        if not CME_Global or type(CME_Global) ~= 'table' then CME_Global = CME_GlobalDefault end
        if not CME_Local or type(CME_Local) ~= 'table' then CME_Local = CME_LocalDefault end
    
        -- Add slash handler
        self:AddSlashHandlers({'cm', 'change', 'cme'}, function(...) CME:SlashHandler(...) end)
    
        --[[ Fill this in with what you want ]]
    end
    
    -- Slash handler
    function CME:SlashHandler(msg)
        local command, rest = msg:match("^(%S*)%s*(.-)$")
    
        --[[ Fill this in with what you want ]]
    end
    
    
    --[[ Setters / Getters / Togglers ]]
    function CME:SetDebug(v) CME_Local.debug = v end
    function CME:GetDebug() return CME_Local.debug end
    function CME:ToggleDebug() self:SetDebug(not self:GetDebug()) end
    
    
    
    --[[ 
            DON'T CHANGE ANYTHING OTHER THEN CME: and CME. bellow this line!
    ]]
    
    --[[ Simplifying methods ]]
    function CME:AddSlashHandlers(tbl, handler)
        if type(tbl) ~= 'table' then return false end
    
        for i,slash in pairs(tbl) do
            if strsub(slash,0,1) ~= '/' then slash = '/'..slash end
            _G['SLASH_CME'..i] = slash
        end
    
        SlashCmdList["CME"] = handler
    end
    
    --[[ Ace3 Like methods and supporters ]]
    function CME:RegisterEvent(event, callback)
        self.events[event] = callback
        self.frame:RegisterEvent(event)
    end
    
    CME.events = {}
    function CME:OnEvent(event, ...)
        if type(self.events[event]) == 'function' then
            self.events[event](...);
        else
            self:Debug('No Callback for', event, ...)
        end
    end
    
    function CME:Print(...) print('|cFF3079ED'..self.addonNameAbr..':|r', ...); end
    function CME:Debug(...) if self:GetDebug() then print('|cFFFF0000'..self.addonNameAbr..' Debug:|r', ...); end end
    
    -- Special Functions
    local function OnEvent(self, ...) CME:OnEvent(...) end
    
    -- Create the frame and register handlers
    CME.frame = CreateFrame("Frame", CME.addonFolder.."Frame")
    CME.frame:SetScript("OnEvent", OnEvent);
    CME:RegisterEvent("PLAYER_LOGIN", function() CME:OnInitialize(); end);


    What do you guys think? Is there a better way to implement this? Ideally I would like to see it loaded before the developers code and left in a pristine condition but then we are looping back on a lib.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Planing: LibInspect
    Added support for talents

    I want to add honor and achievements before final release but I have never worked with either before.
    Posted in: Libraries
  • 0

    posted a message on Chat Window Profiles
    I have a small addon that does the first part. It could use a bit of work but its a start. http://wow.curseforge.com/addons/chat-window-spec/
    Posted in: Addon Ideas
  • 0

    posted a message on Artwork Replacements?
    Thanks, MiirGui looks good. I remember there was a gray mesh/Gothic one that curse did a featured artist thing on a long, long time ago.
    Posted in: Need Help?
  • 0

    posted a message on Artwork Replacements?
    I remember back in Vanilla through Wrath there were 'addons' (they weren't really addons but it was on curse) that would replace the whole wow ui skin without using something like kgPanels. It was a zip you extracted to like Interface/Artwork or something like that.

    Are those still around? Is there a good list of them even if it requires kgPanels to run. I looked under Artwork but that's kind of a junk FFA category.
    Posted in: Need Help?
  • 0

    posted a message on Chat Window Profiles
    I've seen addons like ElvUI set up chat windows. Thats how I got my current settings. I don;t use ElvUI anymore but part of the first run was moving and changing just about everything with the chat windows.

    So I know its possible to move them with a addon. Hopefully it won't require a reload. I'll play with it tomorrow.
    Posted in: Addon Ideas
  • 0

    posted a message on Chat Window Profiles
    There are some replacement addons such as Phrat but i don't want something that big. I'l play around with moving the windows based on spec and maybe release that was a small addon. I'll just copy the chat-cache.txt from my main to all my toons for now.
    Posted in: Addon Ideas
  • 0

    posted a message on Chat Window Profiles
    Is there a addon outthere that will give me chat window profiles so that I can:

    • Have different settings (positions) per spec? ex, my DK has a stance bar and pet bar on the right for unholy but not blood so if I adjust for the the other is out of position.
    • Copy chat window settings across toons? ex, set a default profile for all toons so that if I update it one it would update it on the other.

    I could probably do a positioning addon rather easily. However, I would rather have a profile solution that would keep track of all windows, positions, channels, colors etc.. That way I could have a profile for no-stance, stance/pet, stance + pet.
    Posted in: Addon Ideas
  • 0

    posted a message on Looking for an Addon!
    As to the OP:
    For PartyBuffer I use SmartBuff however HealBot can do it too. As for PartyHealer, like rowaasr13 said, not possible since 2.0 however an addon like HealBot does a decent job of replace it by binding everything to your mouse and showing you expected incoming heal.
    Posted in: Addon Ideas
  • 0

    posted a message on Planing: LibInspect
    I release an alpha version that support only items as of now. The version has code in place for the other options however I haven't gotten to them yet. My plan is to add talents and honor next, release as beta then work on talents.

    Question:
    Should the callback be specified on the inspect request? My only issue is collision when you have say 2 addons that do a request after PLAYER_TARGET_CHANGED. On the flip side of that, as it stands say 5 addons are hooked for items, and when a item request is made, all addons will receive the response.

    Ideas on how to have the callback defined on request avoid collusion? maybe save lib.cache[guid].callback = {} and when the callbacks are ran .callback = false;

    I would love to get some input from you guys, particularly some of the larger addon devs that have similar functionality that could benefit a lot from this.
    Posted in: Libraries
  • 0

    posted a message on Planing: LibInspect
    The goal of this library is to provide a universal way to inspect players that doesn't compete with other addons. This library with achieve this by doing asynchronous requests.

    In order to use the addon you will need to first load it as a library, then lib:AddHook('addonName', 'what', function(guid) YourFunction(guid, data); end); It will then only request the type of information for addons that have registered. For example what = items it will only run NotifyInspect() and get data.items , or what = {items,talents} then will return data.items and data.talents. 'what' will also include honor and arena information, and maybe more when I get in game and play around with it.

    Then when you want to make a request lib:RequestData('what', target, force) or lib:RequestItems(target, force) where force will ignore cached data. It will return caninspect, cached, refreshing where CanInspect() is if fresh data is posable, cached is bool if there is cached information and refreshing is if a NotifyInspect() was sent out.

    Speaking of cached data, the lib will store localy old inspect information. This will allow for faster retrevial. The max age that information will be stored is set by lib:MaxAge(seconds); where the lowest settng by any addon will win out. Default will be 1800 or 30 minutes.

    The lib will try to not break the inspect window as well as try and fix a few issues in the default blizzard inspect.

    The lib will be looking for events for inspecting data being returned however if the lib didn't make the request it won't know what target to associate with the unitGUID returned by INSPECT_READY so nothing can be done.

    I have only written addons for inspecting gear however looking over the functions and events for honor and talents it looks feasible.

    http://www.wowace.com/addons/libinspect/ - The basic library
    http://wow.curseforge.com/addons/simple-ilevel/ - Example using gear data
    http://www.wowace.com/addons/tooltip-spec/ - Using spec data
    Posted in: Libraries
  • 0

    posted a message on LibInspect ?
    I have a basic inspect lib for items. I'm wondering if anyone else would be interested in it. I only has 4 real functions, I can't really think of any more.

    INSPECT:AddHook(name, callback);
        ex. INSPECT:AddHook('AddonName', function(guid, items) YourFunction(guid, items); end);
        
    INSPECT:RemoveHook(name);
    
    INSPECT:GetItems(target, force);
        returns items, age, guid, refreshing
        refreshing is true if a InspectNotify(target) was fired, look for a callback in 1sec
        
    INSPECT:CacheAge(maxAge);
        lowest wins
        
    Note: cache is reset on UI reload, its not to replace your own caching mechanism


    It doesn't do anything with throttling inspects because I can't find and usful information about the limits.
    Posted in: Addon Ideas
  • 0

    posted a message on libGMI aka. GuildMemberInfo - Official Thread
    Added 2 modules as a start.

    I changed this thread title a few days ago and It is still showing the old one in some places.
    Posted in: General AddOns
  • 0

    posted a message on testing addons
    Sketch out your code and if statements before hand and make sure its implemented well. I have 2 8x11" white boards I use all the time.

    I find testing in BG is rather easy, i just defend something easy and only load my addon + a few I can live without.

    As for Areans, if it is something dealing with unitIDs use another placeholder while doing initial testing such as party1-5 or raid1-6 or something and then do a few final tests in areans.
    Posted in: General Chat
  • To post a comment, please or register a new account.