Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function toggleSelectionFrame(data)
- local frame = CreateFrame("Frame", "SelectionFrame", UIParent)
- frame:SetWidth(400)
- frame:SetHeight(400)
- frame.texture = frame:CreateTexture()
- frame.texture:SetAllPoints(frame)
- frame.texture:SetTexture("Interface/FrameXML/selectionBLP")
- frame:SetFrameLevel(3)
- local pos = -12
- local level = tonumber(data[2])
- local position = 3
- for i=1,3 do
- local texture = CreateFrame("Button", "SelectionSlot"..tostring(i), frame, nil)
- texture:SetWidth(52)
- texture:SetHeight(52)
- texture:SetPoint("CENTER", frame, "CENTER", pos, -2)
- texture:SetFrameLevel(4)
- texture:SetScript("OnEnter", OnEnterFrame)
- texture:SetScript("OnLeave", OnLeaveFrame)
- texture:SetScript("OnClick", OnClickedFrame)
- local _type = tonumber(data[position])
- local ID = tonumber(data[position + 1])
- position = position + 2
- print(ID)
- local name, icon, description
- if _type == 1 then -- spell
- name, _, icon, _, _, _ = GetSpellInfo(ID)
- description = ""--GetSpellDescription(ID)
- elseif _type == 2 then -- item
- local itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType,
- itemStackCount, itemEquipLoc, itemTexture, itemSellPrice =
- GetItemInfo(ID)
- name = itemName
- icon = itemTexture
- description = itemLink
- end
- print(name)
- print(icon)
- print(description)
- texture:SetBackdrop({bgFile = icon,
- edgeFile = "",
- tile = false, tileSize = 68, edgeSize = 16,
- insets = { left = 4, right = 4, top = 4, bottom = 4 }});
- pos = pos + 64
- end
- frame:SetPoint("BOTTOM", UIParent, "TOP", 0, 10);
- frame:Show();
- local y = -500;
- local dur = 3;
- local group = frame:CreateAnimationGroup(frame:GetName() .. "ChainAnim");
- group:SetLooping("BOUNCE");
- group:SetScript("OnLoop", Chain_OnLoop);
- local p1 = group:CreateAnimation("Path");
- p1:SetOrder(1);
- p1:SetDuration(1);
- p1:SetSmoothing("IN");
- p1:CreateControlPoint():SetOffset(0, y-20);
- local p2 = group:CreateAnimation("Path");
- p2:SetOrder(2);
- p2:SetDuration(0.2);
- p2:CreateControlPoint():SetOffset(0, 30);
- local p3 = group:CreateAnimation("Path");
- p3:SetOrder(3);
- p3:SetDuration(0.3);
- p3:CreateControlPoint():SetOffset(0, -10);
- group:Play();
- end
Advertisement
Add Comment
Please, Sign In to add comment