WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   bBag IconBorder (https://www.wowinterface.com/forums/showthread.php?t=52790)

badness 10-03-15 04:50 PM

bBag IconBorder
 
I have button borders enabled on my bBags addon with a texture I found in another bag addon. What I want to know is if it is possible to make the normal border transparent or clear instead of black.

Example:
http://postimg.org/image/8lwhyrlrj/

Code:
Code:

local bUI = CreateFrame('frame')
config = {
        enable = true,
        spacing = 1.95,
        ["bank"] = {
                buttons_per_row = 12,
                button_size = 40,
        },
        ["bag"] = {
                buttons_per_row = 15,
                button_size = 40,
        }
}
local media = {
        flat = "Interface\\Buttons\\WHITE8x8",
        font = "fonts\\ARIALN.ttf",
}

if (not config.enable) then return end
config.spacing = config.spacing - 2

bUI.bags = CreateFrame("frame")
bUI.bags:RegisterEvent("ADDON_LOADED")

local togglemain, togglebank = 0,0
local togglebag

local bags, bank = nil;

local bags = {
        ['bag'] = {
                CharacterBag0Slot,
                CharacterBag1Slot,
                CharacterBag2Slot,
                CharacterBag3Slot
        },
        ['bank'] = {
       
        }
}

local function StripTextures(object, text)
        for i = 1, object:GetNumRegions() do
                local region = select(i, object:GetRegions())
               
                if region:GetObjectType() == "Texture" then
                        region:SetTexture(nil)
                elseif (text) then
                        region:Hide(0)
                        region:SetAlpha(0)
                end
        end
end

function SkinBackdrop(frame)
    frame:SetBackdrop({bgFile = media.flat, edgeFile = media.flat, edgeSize = 1})
    frame:SetBackdropColor(0,0,0,0.6)
    frame:SetBackdropBorderColor(0,0,0,1)
end


local function skin(frame)
        local f = _G[frame:GetName().."IconTexture"]
        local q = _G[frame:GetName().."IconQuestTexture"]
        --if (bag.iconBorder) then
        local r, g, b = frame.IconBorder:GetVertexColor()
        local tex = frame.IconBorder:GetTexture()
        --en
       
        frame:SetAlpha(1)
        frame.IconBorder:SetTexture("Interface\\AddOns\\bBag\\border")
        frame:SetNormalTexture("")
        frame:SetPushedTexture("")   
frame.IconBorder:SetHeight(40)                   
frame.IconBorder:SetWidth(40)

        frame.IconBorder:SetAlpha(0)
        frame:SetBackdrop({bgFile = media.flat, edgeFile = media.flat, edgeSize = 0.58})
        frame:SetBackdropColor(0,0,0,0.1)
        frame:SetBackdropBorderColor(0,0,0,1)
        f:SetPoint("TOPLEFT", frame, 1.1, -1.1)
        f:SetPoint("BOTTOMRIGHT", frame, -1.1, 1.1)
        f:SetTexCoord(.1, .9, .1, .9)
       
        if (q) then
                q:SetPoint("TOPLEFT", frame, 1.1, -1.1)
                q:SetPoint("BOTTOMRIGHT", frame, -1.1, 1.1)
                q:SetTexCoord(.1, .9, .1, .9)
        end
end

local function hideCrap()
        for i = 1, 12 do
                _G["ContainerFrame"..i.."CloseButton"]:Hide()
                --skin(36, "ContainerFrame"..i.."Item")
                for p = 1, 7 do
                        select(p, _G["ContainerFrame"..i]:GetRegions()):SetAlpha(0)
                end
        end
        for i = 1, 5 do                               
                select(i, _G['BankFrame']:GetRegions()):Hide()
        end
        _G["BackpackTokenFrame"]:GetRegions():SetAlpha(0)
       
        BankFrameCloseButton:Hide()
        BankSlotsFrame:Hide()
        BankFrameMoneyFrame:Hide()
        StripTextures(BankFrameMoneyFrameInset)
        StripTextures(BankFrameMoneyFrameBorder)
        StripTextures(BankFrameMoneyFrame)
        StripTextures(BankFrame, true)
        StripTextures(BankSlotsFrame, true)
        StripTextures(ReagentBankFrame)
        ReagentBankFrame:DisableDrawLayer("BACKGROUND")
        ReagentBankFrame:DisableDrawLayer("ARTWORK")
end

function bUI.bags:setUp(frameName, ...)
        local bagconfig = config[frameName]
        local frame = CreateFrame("Frame", "bBag_"..frameName, UIParent)
        frame:SetWidth(((bagconfig.button_size+config.spacing)*bagconfig.buttons_per_row)+20-config.spacing)
        frame:SetPoint(...)
        frame:SetFrameStrata("HIGH")
        frame:SetFrameLevel(1)
        frame:SetClampedToScreen(true)
    frame:SetMovable(true)
    frame:SetUserPlaced(false)
        frame:EnableMouse(false)
        frame:RegisterForDrag("LeftButton","RightButton")
        frame:RegisterForDrag("LeftButton","RightButton")
        frame:SetScript("OnDragStart", function(self) self:StartMoving() end)
        frame:SetScript("OnDragStop", function(self) self:StopMovingOrSizing() end)
        frame:SetBackdrop({bgFile = media.flat, edgeFile = media.flat, edgeSize = 1})
    frame:SetBackdropColor(0,0,0,0.5)
    frame:SetBackdropBorderColor(0,0,0,1)       
    frame:Hide()
       
        frame.bags = CreateFrame('Frame', nil, frame)
        frame.bags:SetWidth(180)
        frame.bags:SetHeight(40)
        frame.bags:SetPoint("BOTTOMRIGHT", frame, "TOPRIGHT", 0, -2)
        frame.bags:Hide()
        SkinBackdrop(frame.bags)
       
        frame.bags.toggle = CreateFrame('Frame', nil, frame)
        frame.bags.toggle:SetHeight(20)
        frame.bags.toggle:SetWidth(20)
        frame.bags.toggle:SetPoint("TOPRIGHT", frame, "TOPRIGHT", 0, -2)
        frame.bags.toggle:EnableMouse(true)
       
        frame.bags.toggle.text = frame.bags.toggle:CreateFontString("button")
        frame.bags.toggle.text:SetPoint("CENTER", frame.bags.toggle, "CENTER")
        frame.bags.toggle.text:SetFont(media.font, 14, "OUTLINE")
        frame.bags.toggle.text:SetText("B")
        frame.bags.toggle.text:SetTextColor(.4,.4,.4)
        frame.bags.toggle:SetScript('OnMouseUp', function()
                if (togglebag ~= 1) then
                        togglebag = 1
                        frame.bags:Show()
                        frame.bags.toggle.text:SetTextColor(1,1,1)
                else
                        togglebag= 0
                        frame.bags:Hide()
                        frame.bags.toggle.text:SetTextColor(.4,.4,.4)
                end
        end)
       
        if (frameName == "bag") then       
                for _, f in pairs(bags[frameName]) do
                        local count = _G[f:GetName().."Count"]
                        local icon = _G[f:GetName().."IconTexture"]
                        f:SetParent(frame.bags)
                        f:ClearAllPoints()
                        f:SetWidth(43)
                        f:SetHeight(43)
                        if lastbutton then
                                f:SetPoint("LEFT", lastbutton, "RIGHT", config.spacing, 0)
                        else
                                f:SetPoint("TOPLEFT", frame.bags, "TOPLEFT", 8, -8)
                        end
                        count.Show = function() end
                        count:Hide()
                       
                        f:GetRegions():Hide()
                       
                        --[[local highlight = f.HighlightFrame.HighlightTexture
                        if highlight and not highlight.skinned then
                                highlight:SetTexture(1, 1, 1, 0.3)
                                highlight:SetTexture("")
                                highlight:ClearAllPoints()
                                highlight:SetPoint("TOPLEFT", 2, -2)
                                highlight:SetPoint("BOTTOMRIGHT", -2, 2)
                                highlight.skinned = true
                        end--]]

                        icon:SetTexCoord(.08, .92, .08, .92)
                        f:SetNormalTexture("")
                        f:SetPushedTexture("")
                        f:SetHighlightTexture("")
                        f.IconBorder:SetTexture("")
                        SkinBackdrop(f)
                        lastbutton = f
                        frame.bags:SetWidth((24+config.spacing)*(getn(bags[frameName]))+18)
                        frame.bags:SetHeight(40)
                end
        else
                lastbutton = nil
               
                local tab1 = CreateFrame("frame", nil, _G["bBag_bank"])
                local tab2 = CreateFrame("frame", nil, _G["bBag_bank"])
               
                tab1:SetPoint("BOTTOM", frame, "TOP", -21, -2)
                tab1:SetSize(40, 24)
                SkinBackdrop(tab1)
                tab1.text = tab1:CreateFontString("button")
                tab1.text:SetPoint("CENTER", tab1, "CENTER", 2, 0)
                tab1.text:SetJustifyH("CENTER")
                tab1.text:SetFont(media.font, 12, "OUTLINE")
                tab1.text:SetText("Bank")
                tab1.text:SetTextColor(1, 1, 1)
                tab1:SetScript("OnMouseUp", function(self)
                        BankFrameTab1:Click()
                        tab1.text:SetTextColor(1, 1, 1)
                        tab2.text:SetTextColor(.4,.4,.4)
                end)
               
                tab2:SetPoint("BOTTOM", frame, "TOP", 31, -2)
                tab2:SetSize(60, 24)
                SkinBackdrop(tab2)
                tab2.text = tab2:CreateFontString("button")
                tab2.text:SetPoint("CENTER", tab2, "CENTER", 2, 0)
                tab2.text:SetJustifyH("CENTER")
                tab2.text:SetFont(media.font, 12, "OUTLINE")
                tab2.text:SetText("Reagents")
                tab2.text:SetTextColor(.4,.4,.4)
                tab2:SetScript("OnMouseUp", function(self)
                        BankFrameTab2:Click()
                        tab2.text:SetTextColor(1, 1, 1)
                        tab1.text:SetTextColor(.4,.4,.4)
                end)
               
                for i = 1, 2 do
                        local tab = _G["BankFrameTab"..i]
                        StripTextures(tab)
                        tab:ClearAllPoints()
                        tab:Hide()
                end
               
                for i = 1, 7 do
                        local bankbag = BankSlotsFrame["Bag"..i]
                        local icon = bankbag.icon
                        local highlight = bankbag.HighlightFrame.HighlightTexture
                       
                        bankbag:SetParent(frame.bags)
                        bankbag:GetChildren():Hide()
                        bankbag:ClearAllPoints()
                        bankbag:SetWidth(24)
                        bankbag:SetHeight(24)
                       
                        if lastbutton then
                                bankbag:SetPoint("LEFT", lastbutton, "RIGHT", config.spacing, 0)
                        else
                                bankbag:SetPoint("TOPLEFT", frame.bags, "TOPLEFT", 8, -8)
                        end
                        lastbutton = bankbag
                        SkinBackdrop(bankbag)
                       
                        bankbag:SetNormalTexture("")
                        bankbag:SetPushedTexture("")
                        bankbag:SetHighlightTexture("")
                        bankbag.IconBorder:SetTexture("")
                       
                        StripTextures(bankbag)
                       
                        icon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
                        icon:ClearAllPoints()
                        icon:SetPoint("TOPLEFT", 2, -2)
                        icon:SetPoint("BOTTOMRIGHT", -2, 2)
                       
                        if highlight and not highlight.skinned then
                                highlight:SetTexture(1, 1, 1, 0.3)
                                highlight:SetTexture("")
                                highlight:ClearAllPoints()
                                highlight:SetPoint("TOPLEFT", 2, -2)
                                highlight:SetPoint("BOTTOMRIGHT", -2, 2)
                                highlight.skinned = true
                        end
                       
                        frame.bags:SetWidth((24+config.spacing)*(7)+16)
                        frame.bags:SetHeight(40)
                end
                --print(bags[frameName])
        end
        return frame
end

local numrows, lastrowbutton, numbuttons, lastbutton = 0, ContainerFrame1Item1, 1, ContainerFrame1Item1
local banknumrows, banklastrowbutton, banknumbuttons, banklastbutton = 0, BankFrameItem1, 1, BankFrameItem1
function ContainerFrame_GenerateFrame(frame, size, id)
        frame.size = size;
        for i=1, size, 1 do
                local index = size - i + 1;
                local itemButton = _G[frame:GetName().."Item"..i];
                itemButton:SetID(index);
                itemButton:Show();
        end
        frame:SetID(id);
        frame:Show()
       
        if ( id < 5 ) then
                local slots = GetContainerNumSlots(id)

                for item = slots, 1, -1 do
                        local itemframes = _G["ContainerFrame"..(id+1).."Item"..item]
                        itemframes:ClearAllPoints()
                        itemframes:SetWidth(config.bag.button_size)
                        itemframes:SetHeight(config.bag.button_size)
                        itemframes:SetFrameStrata("HIGH")
                        itemframes:SetFrameLevel(2)
                        skin(itemframes)
                       
                        if id == 0 and item == 16 then
                                numrows, lastrowbutton, numbuttons, lastbutton = 0, ContainerFrame1Item1, 1, ContainerFrame1Item1
                                itemframes:SetPoint("TOPLEFT", _G["bBag_bag"], "TOPLEFT", 10, -30)
                                lastrowbutton = itemframes
                                lastbutton = itemframes
                        elseif numbuttons==config.bag.buttons_per_row then
                                itemframes:SetPoint("TOP", lastrowbutton, "BOTTOM", 0, -config.spacing)
                                lastrowbutton = itemframes
                                numrows = numrows + 1
                                numbuttons = 1
                        else
                                itemframes:SetPoint("LEFT", lastbutton, "RIGHT", config.spacing, 0)
                                numbuttons = numbuttons + 1
                        end
                        lastbutton = itemframes
                end

                _G["bBag_bag"]:SetHeight(((config.bag.button_size+config.spacing)*(numrows+1)+60)-config.spacing)
               
                BackpackTokenFrameToken1:ClearAllPoints()
                BackpackTokenFrameToken1:SetPoint("BOTTOMLEFT", _G["bBag_bag"], "BOTTOMLEFT", 0, 8)
                for i = 1, 3 do
                        _G["BackpackTokenFrameToken"..i]:SetFrameStrata("TOOLTIP")
                        _G["BackpackTokenFrameToken"..i]:SetFrameLevel(5)
                        _G["BackpackTokenFrameToken"..i.."Icon"]:SetSize(12,12)
                        _G["BackpackTokenFrameToken"..i.."Icon"]:SetTexCoord(.1,.9,.1,.9)
                        _G["BackpackTokenFrameToken"..i.."Icon"]:SetPoint("LEFT", _G["BackpackTokenFrameToken"..i], "RIGHT", -8, 2)
                        _G["BackpackTokenFrameToken"..i.."Count"]:SetFont(media.font, 14)
                        if (i ~= 1) then
                                _G["BackpackTokenFrameToken"..i]:SetPoint("LEFT", _G["BackpackTokenFrameToken"..(i-1)], "RIGHT", 10, 0)
                        end
                end
        else
                if (id == 5) then
                        banknumrows, banklastrowbutton, banknumbuttons, banklastbutton = 0, BankFrameItem1, 1, BankFrameItem1
                        for bank = 1, 28 do
                                local bankitems = _G["BankFrameItem"..bank]
                                bankitems:ClearAllPoints()
                                bankitems:SetWidth(config.bank.button_size)
                                bankitems:SetHeight(config.bank.button_size)
                                bankitems:SetFrameStrata("HIGH")
                                bankitems:SetFrameLevel(2)
                                skin(bankitems)
                               
                                BankFrameMoneyFrame:Hide()
                                if bank==1 then
                                        bankitems:SetPoint("TOPLEFT", _G["bBag_bank"], "TOPLEFT", 10, -30)
                                        banklastrowbutton = bankitems
                                        banklastbutton = bankitems
                                elseif banknumbuttons==config.bank.buttons_per_row then
                                        bankitems:SetPoint("TOP", banklastrowbutton, "BOTTOM", 0, -config.spacing)
                                        banklastrowbutton = bankitems
                                        banknumrows = banknumrows + 1
                                        banknumbuttons = 1
                                else
                                        bankitems:SetPoint("LEFT", banklastbutton, "RIGHT", config.spacing, 0)
                                        banknumbuttons = banknumbuttons + 1
                                end
                                banklastbutton = bankitems
                        end
                end
                        local slots = GetContainerNumSlots(id)
                        for item = slots, 1, -1 do
                                local itemframes = _G["ContainerFrame"..(id+1).."Item"..item]
                                itemframes:ClearAllPoints()
                                itemframes:SetWidth(config.bank.button_size)
                                itemframes:SetHeight(config.bank.button_size)
                                itemframes:SetFrameStrata("HIGH")
                                itemframes:SetFrameLevel(2)
                                skin(itemframes)
                               
                                if banknumbuttons == config.bank.buttons_per_row then
                                        itemframes:SetPoint("TOP", banklastrowbutton, "BOTTOM", 0, -config.spacing)
                                        banklastrowbutton = itemframes
                                        banknumrows = banknumrows + 1
                                        banknumbuttons = 1
                                else
                                        itemframes:SetPoint("LEFT", banklastbutton, "RIGHT", config.spacing, 0)
                                        banknumbuttons = banknumbuttons + 1
                                end
                                banklastbutton = itemframes
                        end
                        _G["bBag_bank"]:SetHeight(((config.bank.button_size+config.spacing)*(banknumrows+1)+40)-config.spacing)
        end
       
       
        hideCrap()
end
function ToggleBag() end
function ToggleBackpack() end
function OpenBackpack() end
function CloseBackpack() end
function updateContainerFrameAnchors() end
function OpenAllBags(frame) ToggleAllBags("open") end
function ToggleAllBags(func)
        if (func == "open") then
                togglemain = 1
                OpenBackpack()
                _G["bBag_bag"]:Show()
                for i=0, NUM_BAG_FRAMES, 1 do OpenBag(i) end
        else
                if (togglemain == 1) then
                        if (not _G["bBag_bank"]:IsShown()) then
                                togglemain = 0
                                CloseBackpack()
                                _G["bBag_bag"]:Hide()
                                for i=0, NUM_BAG_FRAMES, 1 do CloseBag(i) end
                        end
                else
                        if(not BankFrame:IsShown()) then
                                togglemain = 1
                                OpenBackpack()
                                _G["bBag_bag"]:Show()
                                for i=0, NUM_BAG_FRAMES, 1 do OpenBag(i) end
                        end
                end
        end

        if( BankFrame:IsShown() ) then
       
                if (not _G["bBag_bank"]:IsShown()) then
                        if (togglebank == 1) then
                                togglebank = 0
                                _G["bBag_bank"]:Hide()
                                --BankFrame:Hide()
                                for i=NUM_BAG_FRAMES+1, NUM_CONTAINER_FRAMES, 1 do
                                        if ( IsBagOpen(i) ) then CloseBag(i) end
                                end
                        else
                                togglebank = 1
                                _G["bBag_bank"]:Show()
                                BankFrame:Show()
                               
                                for i=1, NUM_CONTAINER_FRAMES, 1 do
                                        if (not IsBagOpen(i)) then OpenBag(i) end
                                end

                        end
                end
        end
end
BackpackTokenFrame:Hide();

local function quickbank(show)
        local numrows, lastrowbutton, numbuttons, lastbutton = 0, BankFrameItem1, 1, BankFrameItem1
       
        for i = 1, 28 do
                local name = _G["BankFrameItem"..i]
                if (show) then
                        name:Show()
                else
                        name:Hide()
                end
                if numbuttons == config.bank.buttons_per_row then
                        numrows = numrows + 1
                        numbuttons = 1
                end
                numbuttons = numbuttons + 1
        end
       
        for b = 6, 16 do
                local slots = GetContainerNumSlots(b-1)
                for t = 1, slots do
                        local name = _G["ContainerFrame"..b.."Item"..t]
                        if (show) then
                                name:Show()
                        else
                                name:Hide()
                        end
                        if numbuttons == config.bank.buttons_per_row then
                                numrows = numrows + 1
                                numbuttons = 1
                        end
                        numbuttons = numbuttons + 1
                end
        end

        if (show) then
                _G["bBag_bank"]:SetHeight(((config.bank.button_size+config.spacing)*(numrows)+40)-config.spacing)
        end

        _G["bBag_bank"]:Show()
end
local function quickreagent(show)
        local numrows, lastrowbutton, numbuttons, lastbutton = 0, ReagentBankFrameItem, 1, ReagentBankFrameItem
        for r = 1, 98 do
                local itemframe = _G["ReagentBankFrameItem"..r]
                        if (itemframe) then
                        itemframe:ClearAllPoints()
                        itemframe:SetWidth(config.bank.button_size)
                        itemframe:SetHeight(config.bank.button_size)
                        itemframe:SetFrameStrata("HIGH")
                        itemframe:SetFrameLevel(2)
                        skin(itemframe)
                       
                        if r == 1 then
                                itemframe:SetPoint("TOPLEFT", _G["bBag_bank"], "TOPLEFT", 10, -30)
                                lastrowbutton = itemframe
                                lastbutton = itemframe
                        elseif numbuttons==config.bank.buttons_per_row then
                                itemframe:SetPoint("TOP", lastrowbutton, "BOTTOM", 0, -config.spacing)
                                lastrowbutton = itemframe
                                numrows = numrows + 1
                                numbuttons = 1
                        else
                                itemframe:SetPoint("LEFT", lastbutton, "RIGHT", config.spacing, 0)
                                numbuttons = numbuttons + 1
                        end
                        lastbutton = itemframe
                end
        end
        if (show) then
                _G["bBag_bank"]:SetHeight(((config.bank.button_size+config.spacing)*(numrows+1)+70)-config.spacing)

                local children = {ReagentBankFrame:GetChildren()}
                children[1]:SetPoint("BOTTOM", _G["bBag_bank"], "BOTTOM", 0, 10)
                children[1]:SetFrameStrata("HIGH")
                children[1]:SetFrameLevel(3)
        else
               
        end
end

-- I have to keep stealing blizzard functions, because they are doing so far from what I want they are actually making bag coding near impossible.
function BankFrame_ShowPanel(sidePanelName, selection)
        local self = BankFrame;
        -- find side panel
        local tabIndex;
        ShowUIPanel(self);
        for index, data in pairs(BANK_PANELS) do
                local panel = _G[data.name];

                if ( data.name == sidePanelName ) then
                        panel:Show()
                        tabIndex = index;
                        self.activeTabIndex = tabIndex;
                       
                        if (data.name == "ReagentBankFrame") then
                                -- Redraw reagent in bank
                                quickbank(false)
                                quickreagent(true)
                        else
                                -- Redraw bank in rank
                                quickbank(true)
                                quickreagent(false)
                        end
                else
                        panel:Hide()
                end
        end
end

ContainerFrame1Item1:SetScript("OnHide", function()
        _G["bBag_bag"]:Hide()
        togglemain = 0
end)
BankFrameItem1:SetScript("OnHide", function()
        _G["bBag_bank"]:Hide()
        togglebank = 0
end)
BankFrameItem1:SetScript("OnShow", function()
        _G["bBag_bank"]:Show()
        togglebank = 1
end)

BankPortraitTexture:Hide()
BankFrame:EnableMouse(0)
function SkinEditBox(frame)
        frame.Left:Hide()
        frame.Right:Hide()
        frame.Middle:Hide()
        frame:GetChildren():SetAlpha(0)
       
        frame:SetFrameStrata("HIGH")
        frame:SetWidth(200)
       
        frame.bg = CreateFrame('frame', nil, frame)
        frame.bg:SetPoint("TOPLEFT", frame, "TOPLEFT", -4, 0)
        frame.bg:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", 0, 0)
    frame.bg:SetBackdrop({bgFile = media.flat, edgeFile = media.flat, edgeSize = 1, insets = {top = 2, left = 2, bottom = 2, right = 2}})
    frame.bg:SetBackdropColor(1,1,1,.02)
    frame.bg:SetBackdropBorderColor(0,0,0,1)
end

SkinEditBox(BagItemSearchBox)
SkinEditBox(BankItemSearchBox)

hooksecurefunc("ContainerFrame_Update", function(frame)
        BagItemSearchBox:ClearAllPoints()
        BagItemSearchBox:SetParent(_G["bBag_bag"])
        BagItemSearchBox:SetPoint("TOPRIGHT", _G["bBag_bag"], "TOPRIGHT", -28, -6)
        BagItemAutoSortButton:Hide();
       
        BankItemSearchBox:ClearAllPoints()
        BankItemSearchBox:SetParent(_G["bBag_bank"])
        BankItemSearchBox:SetPoint("TOPRIGHT", _G["bBag_bank"], "TOPRIGHT", -28, -6)
        BankItemAutoSortButton:Hide();
       
        ContainerFrame1MoneyFrame:ClearAllPoints()
        ContainerFrame1MoneyFrame:Show()
        ContainerFrame1MoneyFrame:SetPoint("TOPLEFT", _G["bBag_bag"], "TOPLEFT", 6, -10)
        ContainerFrame1MoneyFrame:SetFrameStrata("HIGH")
        ContainerFrame1MoneyFrame:SetFrameLevel(2)
       
        ContainerFrame2MoneyFrame:Show()
        ContainerFrame2MoneyFrame:ClearAllPoints()
        ContainerFrame2MoneyFrame:SetPoint("TOPLEFT", _G["bBag_bank"], "TOPLEFT", 6, -10)
        ContainerFrame2MoneyFrame:SetFrameStrata("HIGH")
        ContainerFrame2MoneyFrame:SetFrameLevel(2)
        ContainerFrame2MoneyFrame:SetParent(_G["bBag_bank"])
       
        ContainerFrame1:EnableMouse(false);
        ContainerFrame2:EnableMouse(false);
        ContainerFrame3:EnableMouse(false);
        ContainerFrame4:EnableMouse(false);
        ContainerFrame5:EnableMouse(false);
        BankFrame:EnableMouse(false);
end)

bUI.bags:SetScript("OnEvent", function(self, event, addon)
        if (addon == "bBag") then
                bags = bUI.bags:setUp("bag", "BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", -2, 430)
                bank = bUI.bags:setUp("bank", "TOPLEFT", UIParent, "TOPLEFT", 10, -134)
        end
end)


kawe 10-04-15 03:28 AM

frame:SetBackdropBorderColor(0,0,0, 1) > set alpha to 0 > (0,0,0, 0)

badness 10-04-15 07:16 AM

that didn't work.

kawe 10-05-15 03:01 AM

Quote:

Originally Posted by badness (Post 311310)
that didn't work.

then i dont know what you mean, i installed the addon myself too see if i had it wrong somehow, but it does fade out the icon borders :cool:


badness 10-05-15 04:50 AM

What I want is if you look in the picture I posted i just want the black borders around the white items like my herbs,hearthstone,pots,flask etc etc to be transparent or clear while still keeping the purple and blue borders shown.

kawe 10-05-15 05:35 AM

ah i understand, as i can see its the other addon thats coloring/setting icon borders, not the bBag addon.
what you want, can get quite complicated 0_o

badness 10-05-15 08:17 AM

I dont mind I'm willing to learn if you are willing to help :)

kawe 10-05-15 09:01 AM

Quote:

Originally Posted by badness (Post 311331)
I dont mind I'm willing to learn if you are willing to help :)

i am learner myself :D :cool: but can try. first, whats the other addon doing the coloring? oGlow?

badness 10-05-15 07:34 PM

no that is bBags its just a border texture I got from another bag addon.

Phanx 10-06-15 02:18 AM

Well, the default UI function that actually updates the bag items does this to show+color or hide the border based on the item's rarity:

lua Code:
  1. function ContainerFrame_Update(frame)
  2.     local id = frame:GetID();
  3.     local name = frame:GetName();
  4.     -- (snip)
  5.     for i=1, frame.size, 1 do
  6.         itemButton = _G[name.."Item"..i];
  7.         texture, itemCount, locked, quality, readable, _, _, isFiltered, noValue = GetContainerItemInfo(id, itemButton:GetID());
  8.         -- (snip)
  9.         if (quality) then
  10.             if (quality >= LE_ITEM_QUALITY_COMMON and BAG_ITEM_QUALITY_COLORS[quality]) then
  11.                 itemButton.IconBorder:Show();
  12.                 itemButton.IconBorder:SetVertexColor(BAG_ITEM_QUALITY_COLORS[quality].r, BAG_ITEM_QUALITY_COLORS[quality].g, BAG_ITEM_QUALITY_COLORS[quality].b);
  13.             else
  14.                 itemButton.IconBorder:Hide();
  15.             end
  16.             -- (snip)
  17.         else
  18.             itemButton.IconBorder:Hide();
  19.         end

... and your code just changes the IconBorder texture:

lua Code:
  1. local function skin(frame)
  2.     -- (snip)
  3.     frame.IconBorder:SetTexture("Interface\\AddOns\\bBag\\border")
  4.     -- (snip)
  5.     frame.IconBorder:SetHeight(40)                    
  6.     frame.IconBorder:SetWidth(40)
  7.     frame.IconBorder:SetAlpha(0)

... but based on this it should never be visible in the first place, since your code sets the alpha (opacity/visibility) to 0 on load and never changes it, the default UI code never touches the alpha, and nothing in your code does anything else with the texture.

Are you sure you don't have any other addons touching your bags?

Place the cursor over a bag item in-game and run this:

Code:

/run local t = GetMouseFocus().IconBorder local r, g, b = t:GetVertexColor() print("Shown?", t:IsShown(), "Alpha", floor(t:GetAlpha() * 100 + 0.5), "R", floor(r * 255 + 0.5), "G", floor(g * 255 + 0.5), "B", floor(b * 255 + 0.5))
If it reports that it's not shown and/or the alpha is 0, but you see a border, then you definitely have something else going on.

If it reports that it is shown and the alpha is greater than 0, try this:

Code:

/run GetMouseFocus().IconBorder:Hide()
Does the border disappear? Again, if not, then you have some other addon interfering.

badness 10-06-15 10:58 AM

Ok, I ran the first script and i got " Shown? true Alpha 100 R 0 G 0 B 0 " (This is when I have the border alpha to 1 in the lua)

2nd script made the border disappear but when you close and open the bag again the border reappears.

Phanx 10-07-15 12:39 AM

Okay, that means you have some other code, apart from what you posted, that's not only setting the texture's alpha to 1, but also setting its color to black (0,0,0). The code you posted doesn't do that, and neither does the default UI code.

badness 10-07-15 02:37 PM

Or do you think it could possibly be the custom border I was trying to use?

Phanx 10-08-15 02:09 AM

No. A texture is just a file. It can't change its opacity or color. That's like asking if a rock that was lying on the ground might have picked itself up and launched itself at your head, instead of being thrown by someone. :p

badness 10-08-15 08:13 AM

I've figured it out and for some reason it is my Aurora addon coloring the borders black, but I have no idea on how to fix it :S

Mazzy_Wow 10-08-15 12:32 PM

Quote:

Originally Posted by badness (Post 311393)
I've figured it out and for some reason it is my Aurora addon coloring the borders black, but I have no idea on how to fix it :S

Maybe uncheck "bags" from the Aurora config!

badness 10-08-15 07:01 PM

Quote:

Originally Posted by Mazzy_Wow (Post 311396)
Maybe uncheck "bags" from the Aurora config!

I never had it checked in the first place lol

kawe 10-09-15 06:12 AM

Quote:

Originally Posted by badness (Post 311404)
I never had it checked in the first place lol

maybe you should screenshot your WoW addon folder or make a list of all addons you are using. it's best if we could lessen the guesswork :P ;)

badness 10-09-15 09:42 AM

Quote:

Originally Posted by kawe (Post 311408)
maybe you should screenshot your WoW addon folder or make a list of all addons you are using. it's best if we could lessen the guesswork :P ;)

http://postimg.org/image/qtj3d2znb/full/

Phanx 10-10-15 02:10 AM

Figuring out which addon is interfering isn't hard, and doesn't take more than 5 minutes, and is just way easier for you to do yourself, than for others to do by reading your addon list and making guesses:

http://phanx.net/addons/help#conflicts


All times are GMT -6. The time now is 04:18 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI