1. #1
    Field Marshal tulextreme's Avatar
    10+ Year Old Account
    Join Date
    Sep 2011
    Location
    Middle of Nowhere
    Posts
    82

    CAS (CharacterAbilitiesScheme)... help me make it!

    Hey guys how u all doing! Well here's my idea! Since i bought the Razer Naga Mouse I've been playing with it and manage to bind all my characters abilities to its 17+ buttons. Things is I've got lots of characters, and man it takes a lot of human memory to remember all the abilities and its buttons presses(lol)... Ok so I've been thinking on making this simple "glossary" addon that i would pop in game to see what and where my character abilities are bided!
    So I've made the UI layout and now I'm messing with addon studio so i can put all together but since i have zero exp with it, this has been a tiresome quest! Could someone give me tips on how to load the addon using a chocolate bar icon and also how to make it change all the characters abilities using say a pull down menu on the addon itself... here`s some screens to make it better to understand...





    I've been searching the internet for some tutorials and really want start doing some addons of my own! If u guys can point me to valid directions it would be extremely helpful... Thanks a lot for all the help and your time!
    Have a good day!
    ''this is your life and it`s ending one minute at a time''

  2. #2
    Looks pretty. There was a similar addon already out that does a similar thing, KeyBinder.

    Gershuun @ Borean Tundra US - Interface & Macros Moderator

  3. #3
    Field Marshal tulextreme's Avatar
    10+ Year Old Account
    Join Date
    Sep 2011
    Location
    Middle of Nowhere
    Posts
    82
    Quote Originally Posted by lawomous View Post
    Looks pretty. There was a similar addon already out that does a similar thing, KeyBinder.
    Well all i want this addon to really do is show me tge .blp with the selected character abilities it does not need to bind ir do anything since im doin this using bartender... its just a glossary of abilities and mouse binds!
    ''this is your life and it`s ending one minute at a time''

  4. #4
    Deleted
    Quote Originally Posted by lawomous View Post
    Looks pretty.
    Pretty sure that's only a shop showing how he wants it to look.

    Anyways, it's not pretty, but GUIs were never my strong side. Especially not when I don't spend ages on them.
    Code:
    local buttonSize = 40
    local buttonOffset = 5
    local buttons = {"1","2","3","4","5","6","7","8","9"}
    local modifiers = {"","SHIFT-","CTRL-","ALT-"}
    local frame = CreateFrame("Frame")
    frame:SetSize(#buttons*(buttonSize+buttonOffset)+buttonOffset,#modifiers*(buttonSize+buttonOffset)+buttonOffset)
    frame:SetPoint("CENTER")
    local frames = {}
    local function btnUpdate(s)
         local binding = GetBindingByKey(s.button)
         if binding then
              local btn = binding:match("CLICK (.+):LeftButton")
              local f = _G[btn]
              if f then
                   local spell = GetActionTexture(f:GetAttribute("action"))
                   s:SetNormalTexture(spell)
                   return
              end
         end
         s:SetNormalTexture(nil)
    end
    for btnNum, button in ipairs(buttons) do
         for modNum, mod in ipairs(modifiers) do
              local btn = CreateFrame("Button", nil, frame)
              btn:SetPoint("TOPLEFT",btnNum*(buttonSize+buttonOffset)-buttonSize, (modNum*(buttonSize+buttonOffset)-buttonSize)*(-1))
              btn:SetSize(buttonSize,buttonSize)
              btn.text = btn:CreateFontString()
              btn.text:SetFont("Fonts\\FRIZQT__.TTF", 10, "OUTLINE")
              btn.text:SetPoint("BOTTOM")
              btn.text:SetText(mod..button)
              btn.update = btnUpdate
              btn.button = mod..button
              frames[btn.button] = btn
         end
    end
    frame:SetScript("OnEvent",function()
        for _,f in pairs(frames) do f:update() end
    end)
    frame:RegisterEvent("UPDATE_BINDINGS")
    SlashCmdList["CAS"]=function() frame[frame:IsShown() and "Hide" or "Show"](frame) end
    SLASH_CAS = "/cas"
    Completely and utterly drycoded. Hope I didn't mess up anywhere.

  5. #5
    Field Marshal tulextreme's Avatar
    10+ Year Old Account
    Join Date
    Sep 2011
    Location
    Middle of Nowhere
    Posts
    82
    Hey Treeston how can i use this ti build my addon? Can i just import this code in addon studio and mess with?
    Dam i wish i knew a fraction of what u do about this friend! amazing really!
    ''this is your life and it`s ending one minute at a time''

  6. #6
    Deleted
    Addon studio? Is that the WYSIWYG editor thing?







    Dump it.

    Next, load up the code I pasted. Try to figure out what it does, then go from there. You'll have to add a global SavedVar that contains bindings for every character, and you'll have to add some way to switch characters, then change the :update function to read from the SavedVar instead of GetBindingByKey.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •