An Aku'mai Servant
Join Date: Jun 2010
Posts: 30
|
Originally Posted by Phanx
Well, then this is where posting fake code examples gets you in trouble... if the actual code is set up like your example (local "frame" with no name, parent, or distinguishing features created inside a local function) then no, there's no way to access it from another file in another addon. However, it seems unlikely that a real addon would actually do that, so there's probably a way... but without seeing the actual code, there's no way to tell.
|
Actually the addon (teksLoot) returns this frame, this is the whole function:
Lua Code:
local function CreateRollFrame() local frame = CreateFrame("Frame", nil, UIParent) frame:SetWidth(328) frame:SetHeight(26) frame:SetBackdrop(backdrop) frame:SetBackdropColor(0, 0, 0, .9) frame:SetScript("OnEvent", OnEvent) frame:RegisterEvent("CANCEL_LOOT_ROLL") frame:CreateBeautyBorder(11) frame:SetBeautyBorderPadding(-1) frame:Hide() local button = CreateFrame("Button", nil, frame) button:SetPoint("LEFT", 0, 0) button:SetWidth(28) button:SetHeight(28) --button:SetNormalTexture("Interface\\Buttons\\UI-Quickslot2") button:SetHighlightTexture("Interface\\Buttons\\ButtonHilight-Square") button:GetHighlightTexture():SetBlendMode("ADD") button:SetScript("OnEnter", SetItemTip) button:SetScript("OnLeave", HideTip2) button:SetScript("OnUpdate", ItemOnUpdate) button:SetScript("OnClick", LootClick) frame.button = button local buttonborder = CreateFrame("Frame", nil, button) buttonborder:SetWidth(32) buttonborder:SetHeight(32) buttonborder:SetPoint("CENTER", button, "CENTER") buttonborder:SetBackdrop(backdrop) buttonborder:SetBackdropColor(1, 1, 1, 0) buttonborder:CreateBeautyBorder(11) buttonborder:SetBeautyBorderPadding(-1) frame.buttonborder = buttonborder local tfade = frame:CreateTexture(nil, "BORDER") tfade:SetPoint("TOPLEFT", frame, "TOPLEFT", 4, -4) tfade:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -4, 4) tfade:SetTexture("Interface\\ChatFrame\\ChatFrameBackground") tfade:SetBlendMode("ADD") tfade:SetGradientAlpha("VERTICAL", .1, .1, .1, 0, .25, .25, .25, 1) local status = CreateFrame("StatusBar", nil, frame) status:SetPoint("TOPRIGHT", frame, "TOPRIGHT", -4, -4) status:SetPoint("BOTTOM", frame, "BOTTOM", 0, 4) status:SetPoint("LEFT", frame.button, "RIGHT", -1, 0) status:SetScript("OnUpdate", StatusUpdate) status:SetFrameLevel(status:GetFrameLevel()-1) status:SetStatusBarTexture("Interface\\AddOns\\teksLoot\\media\\statusbar.tga") status:SetStatusBarColor(.8, .8, .8, .9) status.parent = frame frame.status = status local spark = frame:CreateTexture(nil, "OVERLAY") spark:SetWidth(14) spark:SetHeight(35) spark:SetTexture("Interface\\CastingBar\\UI-CastingBar-Spark") spark:SetBlendMode("ADD") status.spark = spark local need, needtext = CreateRollButton(frame, "Interface\\Buttons\\UI-GroupLoot-Dice-Up", "Interface\\Buttons\\UI-GroupLoot-Dice-Highlight", "Interface\\Buttons\\UI-GroupLoot-Dice-Down", 1, NEED, "LEFT", frame.button, "RIGHT", 5, -1) local greed, greedtext = CreateRollButton(frame, "Interface\\Buttons\\UI-GroupLoot-Coin-Up", "Interface\\Buttons\\UI-GroupLoot-Coin-Highlight", "Interface\\Buttons\\UI-GroupLoot-Coin-Down", 2, GREED, "LEFT", need, "RIGHT", 0, -1) local de, detext de, detext = CreateRollButton(frame, "Interface\\Buttons\\UI-GroupLoot-DE-Up", "Interface\\Buttons\\UI-GroupLoot-DE-Highlight", "Interface\\Buttons\\UI-GroupLoot-DE-Down", 3, ROLL_DISENCHANT, "LEFT", greed, "RIGHT", 0, -1) local pass, passtext = CreateRollButton(frame, "Interface\\Buttons\\UI-GroupLoot-Pass-Up", nil, "Interface\\Buttons\\UI-GroupLoot-Pass-Down", 0, PASS, "LEFT", de or greed, "RIGHT", 0, 2.2) frame.needbutt, frame.greedbutt, frame.disenchantbutt = need, greed, de frame.need, frame.greed, frame.pass, frame.disenchant = needtext, greedtext, passtext, detext local bind = frame:CreateFontString() bind:SetPoint("LEFT", pass, "RIGHT", 3, 1) bind:SetFont("Fonts\\FRIZQT__.TTF", 13, "OUTLINE") frame.fsbind = bind local loot = frame:CreateFontString(nil, "ARTWORK", "SystemFont_Outline") loot:SetPoint("LEFT", bind, "RIGHT", 0, .12) loot:SetPoint("RIGHT", frame, "RIGHT", -5, 0) loot:SetHeight(16) loot:SetJustifyH("LEFT") frame.fsloot = loot frame.rolls = {} return frame end
|