View Single Post
02-24-12, 09:23 PM   #16
unlimit
Lookin' Good
 
unlimit's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 484


I logged into wow to try out your code, Aftermath, then Fatality popped up and I figured I may as well see what makes it's check buttons click. c.c

Sooo, credit to oomp for his buttons. <_<

...and to my wife for the motivation for the screenshot. <_<

lua Code:
  1. function TRUESYS.Checkbox(self, selfid, px, py, description)
  2.     local checkbox = CreateFrame("CheckButton", "TrueAuiEnableButton_" .. selfid, self, "OptionsSmallCheckButtonTemplate")
  3.     checkbox:SetScript("OnClick", Checkbox_OnClick)
  4.     checkbox:SetPoint("TOPLEFT", self, px, py)
  5.     checkbox:SetWidth(28)
  6.     checkbox:SetHeight(28)
  7.     checkbox:SetHitRectInsets(0, -60, 0, 0)
  8.     checkbox:GetNormalTexture():SetAlpha(0.6)
  9.  
  10.     local checkboxtexture = checkbox:CreateTexture(nil, "ARTWORK")
  11.     checkboxtexture:SetWidth(22)
  12.     checkboxtexture:SetHeight(22)
  13.     checkboxtexture:SetAlpha(0.9)
  14.     checkboxtexture:SetPoint("LEFT", 2, 1)
  15.     checkboxtexture:SetTexture("Interface\\RAIDFRAME\\ReadyCheck-Ready")
  16.     checkbox:SetCheckedTexture(checkboxtexture)
  17.    
  18.     local checkboxtext = self:CreateFontString(nil, "ARTWORK", "GameFontNormal")
  19.     checkboxtext:SetPoint("LEFT", checkbox, "RIGHT", 5, 1)
  20.     checkboxtext:SetFontObject("GameFontNormal")
  21.     checkboxtext:SetText(description)
  22. end
  23.  
  24. function TRUESYS.CreateOptions(self, TextTitle, DescriptionsText)
  25.     local title = self:CreateFontString(nil, "OVERLAY")
  26.     title:SetFontObject('GameFontNormalLarge')
  27.     title:SetPoint('TOPLEFT', 16, -16)
  28.     title:SetText(TextTitle)
  29.  
  30.     local title2 = self:CreateFontString(nil, "OVERLAY")
  31.     title2:SetFontObject('GameFontHighlightSmall')
  32.     title2:SetPoint('TOPLEFT', 18, -35)
  33.     title2:SetText(DescriptionsText)
  34. end
  35.  
  36. TRUESYS.panel = CreateFrame("Frame", "TrueAuiOptions", UIParent)
  37. TRUESYS.panel.name = "|cff89F559True|r|c007ffcffAui|r"
  38. TRUESYS.CreateOptions(TRUESYS.panel, "|cff89F559(True)|r |c007ffcffAdaptive User Interface|r", "http://www.wowrdx.com")
  39.  
  40. TRUESYS.Checkbox(TRUESYS.panel, 1, 18, -60, "Enable ability priority system")
  41. TRUESYS.Checkbox(TrueAuiEnableButton_1, 2, 1, -25, "Enable PVP trinket tracking")
  42. TRUESYS.Checkbox(TrueAuiEnableButton_2, 3, 1, -25, "Enable loving your incredibly fussy wife forever")
  43.  
  44. InterfaceOptions_AddCategory(TRUESYS.panel)

I don't know how to make it actually work yet, but, just thought I'd share the good looking button code. c.c
__________________


kúdan: im playing pantheon
JRCapablanca: no youre not
** Pantheon has been Banned. **

Last edited by unlimit : 02-24-12 at 09:27 PM.
  Reply With Quote