View Single Post
07-14-19, 02:29 AM   #3
thewizard20
A Defias Bandit
AddOn Author - Click to view addons
Join Date: Jul 2019
Posts: 2
Thanks for your response. I went ahead and tried to give it another shot based off your feedback. I also tried to move all of my interface code into wowlua so I could give the full picture and the framestack of my result.

Unfortunately I'm still not getting an icon so I'm still a bit puzzled. Attached is the result of that.



The reason I was thinking of using a ScrollFrame is because I was going to have options for each stance.

Here is the code in case anyone would like to try it locally:

Lua Code:
  1. local function MyAddOn_BuildStanceListItem(f, index, icon, name, active)
  2.    StanceIconFrame = CreateFrame("Frame", "StanceIconFrame"..index, f);
  3.    StanceIconFrame:SetSize(68, 68);
  4.    StanceIconFrame:SetPoint("TOPLEFT");
  5.    StanceIcon = StanceIconFrame:CreateTexture("StanceIcon"..index, "ARTWORK");
  6.    StanceIcon:SetTexture(icon);
  7.    StanceIcon:SetSize(68, 68);
  8.    StanceIcon:SetPoint("TOPLEFT");
  9.    StanceIconFrame.texture = StanceIcon;
  10. end
  11.  
  12.  
  13. local f = CreateFrame("Frame", "MyAddOnFrame", UIParent, "UIPanelDialogTemplate");
  14. f:SetSize(384, 512);
  15. f:SetPoint("LEFT");
  16. f.Title:ClearAllPoints();
  17. f.Title:SetFontObject("GameFontHighlight");
  18. f.Title:SetPoint("LEFT", MyAddOnFrameTitleBG, "LEFT", 6, 1);
  19. f.Title:SetText("My Awesome AddOn");
  20. f.ScrollFrame = CreateFrame("ScrollFrame", nil, f, "UIPanelScrollFrameTemplate");
  21. f.ScrollFrame:SetPoint("TOPLEFT", MyAddOnFrameDialogBG, "TOPLEFT", 4, -8);
  22. f.ScrollFrame:SetPoint("BOTTOMRIGHT", MyAddOnFrameDialogBG, "BOTTOMRIGHT", -3, 4);
  23. f.ScrollFrame:SetClipsChildren(true);
  24. f.ScrollFrame:SetScript("OnMouseWheel", ScrollFrame_OnMouseWheel);
  25. f.ScrollFrame.ScrollBar:ClearAllPoints();
  26. f.ScrollFrame.ScrollBar:SetPoint("TOPLEFT", f.ScrollFrame, "TOPRIGHT", -12, -18);
  27. f.ScrollFrame.ScrollBar:SetPoint("BOTTOMRIGHT", f.ScrollFrame, "BOTTOMRIGHT", -7, 18);
  28.  
  29. f.ScrollChild = CreateFrame("Frame", nil, f.ScrollFrame)
  30. f.ScrollFrame:SetScrollChild(f.ScrollChild)
  31.  
  32. for index=1,GetNumShapeshiftForms(),1 do
  33.    icon, name, active = GetShapeshiftFormInfo(index)
  34.    MyAddOn_BuildStanceListItem(f.ScrollChild, index, icon, name, active);
  35. end

Last edited by thewizard20 : 07-14-19 at 02:31 AM.
  Reply With Quote