Thread Tools Display Modes
Prev Previous Post   Next Post Next
12-24-20, 01:27 PM   #1
Krainz
A Wyrmkin Dreamwalker
Join Date: Oct 2016
Posts: 57
SetScript OnMouseDown for a clickable text-only Frame?

Hello, I'm tinkering with this code to make a clickable "Great Vault" text that opens the Weekly Vault

However, when I click the text, the OnMouseDown script doesn't happen. What am I doing wrong?

Lua Code:
  1. local f = CreateFrame("Frame", nil, UIParent)
  2. f:SetWidth(1)
  3. f:SetHeight(1)
  4. f:SetPoint("CENTER", 0, 0)
  5. local t = f:CreateFontString(f, "OVERLAY", "GameTooltipText")
  6. t:SetPoint("CENTER", 0, 0)
  7. t:SetText("Great Vault")
  8.  
  9. f:SetScript("OnMouseDown", function (self, button)
  10.     if button=='LeftButton' then
  11.         LoadAddOn("Blizzard_WeeklyRewards");
  12.         WeeklyRewardsFrame:Show()
  13.     end
  14. end)

Also, there's a XIV_Databar frame. I'd like to make that "Great Vault" frame's position relative to the XIV_Databar's position. How do I do it?
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » SetScript OnMouseDown for a clickable text-only Frame?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off