Skip to content
This repository was archived by the owner on Jan 21, 2024. It is now read-only.

Commit fcb8bdb

Browse files
committed
move all bar frame handles into a .elements sub-table rather than being at the root
1 parent eeb3b7e commit fcb8bdb

File tree

12 files changed

+585
-579
lines changed

12 files changed

+585
-579
lines changed

Objects/ACTIONBUTTON.lua

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -451,8 +451,8 @@ function ACTIONBUTTON:StartGlow()
451451
if self.spellGlowDef then
452452
ActionButton_ShowOverlayGlow(self)
453453
elseif self.spellGlowAlt then
454-
self.shine:Show()
455-
AutoCastShine_AutoCastStart(self.shine);
454+
self.elements.Shine:Show()
455+
AutoCastShine_AutoCastStart(self.elements.Shine);
456456
end
457457
end
458458
end
@@ -462,8 +462,8 @@ function ACTIONBUTTON:StopGlow()
462462
if self.spellGlowDef then
463463
ActionButton_HideOverlayGlow(self)
464464
elseif self.spellGlowAlt then
465-
self.shine:Hide()
466-
AutoCastShine_AutoCastStop(self.shine);
465+
self.elements.Shine:Hide()
466+
AutoCastShine_AutoCastStop(self.elements.Shine);
467467
end
468468
end
469469
end
@@ -704,17 +704,17 @@ function ACTIONBUTTON:UpdateIcon()
704704
if self.actionID then
705705
self:SetActionIcon(self.actionID)
706706
elseif self.data.macro_Icon then
707-
self.iconframeicon:SetTexture(self.data.macro_Icon)
708-
self.iconframeicon:Show()
707+
self.elements.IconFrameIcon:SetTexture(self.data.macro_Icon)
708+
self.elements.IconFrameIcon:Show()
709709
elseif self.spell then
710710
self:SetSpellIcon(self.spell)
711711
elseif self.item then
712712
self:SetItemIcon(self.item)
713713
else
714-
self.button_name:SetText("")
715-
self.iconframeicon:SetTexture("")
716-
self.iconframeicon:Hide()
717-
self.button_border:Hide()
714+
self.elements.Name:SetText("")
715+
self.elements.IconFrameIcon:SetTexture("")
716+
self.elements.IconFrameIcon:Hide()
717+
self.elements.Border:Hide()
718718
end
719719
end
720720

@@ -741,21 +741,21 @@ function ACTIONBUTTON:SetSpellIcon(spell)
741741
end
742742

743743
if texture then
744-
self.iconframeicon:SetTexture(texture)
744+
self.elements.IconFrameIcon:SetTexture(texture)
745745
else
746-
self.iconframeicon:SetTexture("INTERFACE\\ICONS\\INV_MISC_QUESTIONMARK")
746+
self.elements.IconFrameIcon:SetTexture("INTERFACE\\ICONS\\INV_MISC_QUESTIONMARK")
747747
end
748-
self.iconframeicon:Show()
748+
self.elements.IconFrameIcon:Show()
749749
end
750750

751751
function ACTIONBUTTON:SetItemIcon(item)
752752
local texture
753753

754754
if IsEquippedItem(item) then --makes the border green when item is equipped and dragged to a button
755-
self.button_border:SetVertexColor(0, 1.0, 0, 0.2)
756-
self.button_border:Show()
755+
self.elements.Border:SetVertexColor(0, 1.0, 0, 0.2)
756+
self.elements.Border:Show()
757757
else
758-
self.button_border:Hide()
758+
self.elements.Border:Hide()
759759
end
760760

761761
if NeuronItemCache[item] then
@@ -765,12 +765,12 @@ function ACTIONBUTTON:SetItemIcon(item)
765765
end
766766

767767
if texture then
768-
self.iconframeicon:SetTexture(texture)
768+
self.elements.IconFrameIcon:SetTexture(texture)
769769
else
770-
self.iconframeicon:SetTexture("INTERFACE\\ICONS\\INV_MISC_QUESTIONMARK")
770+
self.elements.IconFrameIcon:SetTexture("INTERFACE\\ICONS\\INV_MISC_QUESTIONMARK")
771771
end
772772

773-
self.iconframeicon:Show()
773+
self.elements.IconFrameIcon:Show()
774774
end
775775

776776
function ACTIONBUTTON:SetActionIcon(action)
@@ -782,13 +782,13 @@ function ACTIONBUTTON:SetActionIcon(action)
782782
end
783783

784784
if texture then
785-
self.iconframeicon:SetTexture(texture)
785+
self.elements.IconFrameIcon:SetTexture(texture)
786786
else
787-
--self.iconframeicon:SetTexture("INTERFACE\\ICONS\\INV_MISC_QUESTIONMARK")
788-
self.iconframeicon:SetTexture("")
787+
--self.elements.IconFrameIcon:SetTexture("INTERFACE\\ICONS\\INV_MISC_QUESTIONMARK")
788+
self.elements.IconFrameIcon:SetTexture("")
789789
end
790790

791-
self.iconframeicon:Show()
791+
self.elements.IconFrameIcon:Show()
792792
end
793793

794794
-----------------------------------------------------------------------------------------
@@ -804,8 +804,8 @@ function ACTIONBUTTON:UpdateState()
804804
self:SetItemState(self.item)
805805
else
806806
self:SetChecked(nil)
807-
self.button_name:SetText("")
808-
self.button_count:SetText("")
807+
self.elements.Name:SetText("")
808+
self.elements.Count:SetText("")
809809
end
810810
end
811811

@@ -816,7 +816,7 @@ function ACTIONBUTTON:SetSpellState(spell)
816816
self:SetChecked(nil)
817817
end
818818

819-
self.button_name:SetText(self.data.macro_Name)
819+
self.elements.Name:SetText(self.data.macro_Name)
820820
self:UpdateSpellCount(spell)
821821
self:UpdateUsable()
822822

@@ -829,7 +829,7 @@ function ACTIONBUTTON:SetItemState(item)
829829
self:SetChecked(nil)
830830
end
831831

832-
self.button_name:SetText(self.data.macro_Name)
832+
self.elements.Name:SetText(self.data.macro_Name)
833833
self:UpdateItemCount(item)
834834
self:UpdateUsable()
835835
end
@@ -847,8 +847,8 @@ function ACTIONBUTTON:SetActionState(action)
847847
self:SetChecked(nil)
848848
end
849849

850-
self.button_name:SetText("")
851-
self.button_count:SetText("")
850+
self.elements.Name:SetText("")
851+
self.elements.Count:SetText("")
852852
self:UpdateUsable()
853853
end
854854

@@ -858,15 +858,15 @@ end
858858

859859
function ACTIONBUTTON:UpdateUsable()
860860
if self.editmode then
861-
self.iconframeicon:SetVertexColor(0.2, 0.2, 0.2)
861+
self.elements.IconFrameIcon:SetVertexColor(0.2, 0.2, 0.2)
862862
elseif self.actionID then
863863
self:SetUsableAction(self.actionID)
864864
elseif self.spell then
865865
self:SetUsableSpell(self.spell)
866866
elseif self.item then
867867
self:SetUsableItem(self.item)
868868
else
869-
self.iconframeicon:SetVertexColor(1.0, 1.0, 1.0)
869+
self.elements.IconFrameIcon:SetVertexColor(1.0, 1.0, 1.0)
870870
end
871871
end
872872

@@ -877,21 +877,21 @@ function ACTIONBUTTON:SetUsableSpell(spell)
877877
isUsable, notEnoughMana = IsUsableSpell(spellName)
878878

879879
if notEnoughMana then
880-
self.iconframeicon:SetVertexColor(self.manacolor[1], self.manacolor[2], self.manacolor[3])
880+
self.elements.IconFrameIcon:SetVertexColor(self.manacolor[1], self.manacolor[2], self.manacolor[3])
881881
elseif isUsable then
882882
if self.rangeInd and IsSpellInRange(spellName, self.unit) == 0 then
883-
self.iconframeicon:SetVertexColor(self.rangecolor[1], self.rangecolor[2], self.rangecolor[3])
883+
self.elements.IconFrameIcon:SetVertexColor(self.rangecolor[1], self.rangecolor[2], self.rangecolor[3])
884884
elseif NeuronSpellCache[spellName] and NeuronSpellCache[spellName].index and self.rangeInd and IsSpellInRange(NeuronSpellCache[spellName].index,"spell", self.unit) == 0 then
885-
self.iconframeicon:SetVertexColor(self.rangecolor[1], self.rangecolor[2], self.rangecolor[3])
885+
self.elements.IconFrameIcon:SetVertexColor(self.rangecolor[1], self.rangecolor[2], self.rangecolor[3])
886886
else
887-
self.iconframeicon:SetVertexColor(1.0, 1.0, 1.0)
887+
self.elements.IconFrameIcon:SetVertexColor(1.0, 1.0, 1.0)
888888
end
889889

890890
else
891891
if NeuronSpellCache[(spell):lower()] then
892-
self.iconframeicon:SetVertexColor(0.4, 0.4, 0.4)
892+
self.elements.IconFrameIcon:SetVertexColor(0.4, 0.4, 0.4)
893893
else
894-
self.iconframeicon:SetVertexColor(1.0, 1.0, 1.0)
894+
self.elements.IconFrameIcon:SetVertexColor(1.0, 1.0, 1.0)
895895
end
896896
end
897897
end
@@ -904,15 +904,15 @@ function ACTIONBUTTON:SetUsableItem(item)
904904
end
905905

906906
if notEnoughMana and self.manacolor then
907-
self.iconframeicon:SetVertexColor(self.manacolor[1], self.manacolor[2], self.manacolor[3])
907+
self.elements.IconFrameIcon:SetVertexColor(self.manacolor[1], self.manacolor[2], self.manacolor[3])
908908
elseif isUsable then
909909
if self.rangeInd and IsItemInRange(spell, self.unit) == 0 then
910-
self.iconframeicon:SetVertexColor(self.rangecolor[1], self.rangecolor[2], self.rangecolor[3])
910+
self.elements.IconFrameIcon:SetVertexColor(self.rangecolor[1], self.rangecolor[2], self.rangecolor[3])
911911
else
912-
self.iconframeicon:SetVertexColor(1.0, 1.0, 1.0)
912+
self.elements.IconFrameIcon:SetVertexColor(1.0, 1.0, 1.0)
913913
end
914914
else
915-
self.iconframeicon:SetVertexColor(0.4, 0.4, 0.4)
915+
self.elements.IconFrameIcon:SetVertexColor(0.4, 0.4, 0.4)
916916
end
917917
end
918918

@@ -921,26 +921,26 @@ function ACTIONBUTTON:SetUsableAction(action)
921921

922922
if actionID then
923923
if actionID == 0 then
924-
self.iconframeicon:SetVertexColor(1.0, 1.0, 1.0)
924+
self.elements.IconFrameIcon:SetVertexColor(1.0, 1.0, 1.0)
925925
else
926926
local isUsable, notEnoughMana = IsUsableAction(actionID)
927927

928928
if isUsable then
929929
if IsActionInRange(action, self.unit) == 0 then
930-
self.iconframeicon:SetVertexColor(self.rangecolor[1], self.rangecolor[2], self.rangecolor[3])
930+
self.elements.IconFrameIcon:SetVertexColor(self.rangecolor[1], self.rangecolor[2], self.rangecolor[3])
931931
else
932-
self.iconframeicon:SetVertexColor(1.0, 1.0, 1.0)
932+
self.elements.IconFrameIcon:SetVertexColor(1.0, 1.0, 1.0)
933933
end
934934

935935
elseif notEnoughMana and self.manacolor then
936-
self.iconframeicon:SetVertexColor(self.manacolor[1], self.manacolor[2], self.manacolor[3])
936+
self.elements.IconFrameIcon:SetVertexColor(self.manacolor[1], self.manacolor[2], self.manacolor[3])
937937
else
938-
self.iconframeicon:SetVertexColor(0.4, 0.4, 0.4)
938+
self.elements.IconFrameIcon:SetVertexColor(0.4, 0.4, 0.4)
939939
end
940940
end
941941

942942
else
943-
self.iconframeicon:SetVertexColor(1.0, 1.0, 1.0)
943+
self.elements.IconFrameIcon:SetVertexColor(1.0, 1.0, 1.0)
944944
end
945945
end
946946

0 commit comments

Comments
 (0)