vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | --[[ Get Settings ]]-- |
2 | |||
3 | --show tooltips |
||
4 | function BActionSets_SetTooltips(enable) |
||
5 | if enable then |
||
6 | BActionSets.g.tooltips = 1; |
||
7 | else |
||
8 | BActionSets.g.tooltips = nil; |
||
9 | end |
||
10 | end |
||
11 | |||
12 | function BActionSets_TooltipsShown() |
||
13 | return BActionSets.g.tooltips; |
||
14 | end |
||
15 | |||
16 | --lock button positions |
||
17 | function BActionSets_SetButtonsLocked(enable) |
||
18 | if enable then |
||
19 | BActionSets.g.buttonsLocked = 1; |
||
20 | else |
||
21 | BActionSets.g.buttonsLocked = nil; |
||
22 | end |
||
23 | end |
||
24 | |||
25 | function BActionSets_ButtonsLocked() |
||
26 | return BActionSets.g.buttonsLocked; |
||
27 | end |
||
28 | |||
29 | --show empty buttons |
||
30 | function BActionSets_SetShowGrid(enable) |
||
31 | if enable then |
||
32 | BActionSets.g.showGrid = 1; |
||
33 | if PetHasActionBar() then |
||
34 | BPetBar_ForAllButtons(BPetButton.ShowGrid); |
||
35 | end |
||
36 | BActionMain_ForAllButtons(BActionButton.ShowGrid); |
||
37 | else |
||
38 | BActionSets.g.showGrid = nil; |
||
39 | if PetHasActionBar() then |
||
40 | BPetBar_ForAllButtons(BPetButton.HideGrid); |
||
41 | end |
||
42 | BActionMain_ForAllButtons(BActionButton.HideGrid); |
||
43 | end |
||
44 | end |
||
45 | |||
46 | function BActionSets_ShowGrid() |
||
47 | return BActionSets.g.showGrid; |
||
48 | end |
||
49 | |||
50 | --show hotkeys |
||
51 | function BActionSets_SetHotkeys(enable) |
||
52 | if enable then |
||
53 | BActionSets.g.hideHotkeys = nil; |
||
54 | else |
||
55 | BActionSets.g.hideHotkeys = 1; |
||
56 | end |
||
57 | BActionMain_ForAllButtons(BBasicActionButton.ShowHotkey, enable); |
||
58 | BPetBar_ForAllButtons(BBasicActionButton.ShowHotkey, enable); |
||
59 | BClassBar_ForAllButtons(BBasicActionButton.ShowHotkey, enable); |
||
60 | end |
||
61 | |||
62 | function BActionSets_HotkeysShown() |
||
63 | return not BActionSets.g.hideHotkeys; |
||
64 | end |
||
65 | |||
66 | --show macro text |
||
67 | function BActionSets_SetMacroText(enable) |
||
68 | if enable then |
||
69 | BActionSets.g.hideMacroText = nil; |
||
70 | else |
||
71 | BActionSets.g.hideMacroText = 1; |
||
72 | end |
||
73 | BActionMain_ForAllButtons(BActionButton.ShowMacroText, enable) |
||
74 | end |
||
75 | |||
76 | function BActionSets_MacrosShown() |
||
77 | return not BActionSets.g.hideMacroText; |
||
78 | end |
||
79 | |||
80 | --[[ Actionbar Specific Settings ]]-- |
||
81 | |||
82 | --set the key to pick up buttons |
||
83 | function BActionSets_SetQuickMoveMode(mode) |
||
84 | BActionSets.g.quickMove = mode; |
||
85 | end |
||
86 | |||
87 | function BActionSets_GetQuickMoveMode() |
||
88 | return BActionSets.g.quickMove; |
||
89 | end |
||
90 | |||
91 | function BActionSets_IsQuickMoveKeyDown() |
||
92 | local quickMoveKey = BActionSets.g.quickMove; |
||
93 | |||
94 | if quickMoveKey then |
||
95 | if quickMoveKey == 1 and IsShiftKeyDown() then |
||
96 | return true; |
||
97 | end |
||
98 | if quickMoveKey == 2 and IsControlKeyDown() then |
||
99 | return true; |
||
100 | end |
||
101 | return quickMoveKey == 3 and IsAltKeyDown(); |
||
102 | end |
||
103 | return false; |
||
104 | end |
||
105 | |||
106 | --set a key to use for altcast |
||
107 | function BActionSets_SetSelfCastMode(mode) |
||
108 | BActionSets.g.altCast = mode; |
||
109 | end |
||
110 | |||
111 | function BActionSets_IsSelfCastHotkeyDown() |
||
112 | local altCastKey = BActionSets.g.altCast; |
||
113 | |||
114 | if altCastKey then |
||
115 | if altCastKey == 1 and IsAltKeyDown() then |
||
116 | return true; |
||
117 | end |
||
118 | if altCastKey == 2 and IsControlKeyDown() then |
||
119 | return true; |
||
120 | end |
||
121 | return altCastKey == 3 and IsShiftKeyDown(); |
||
122 | end |
||
123 | return false; |
||
124 | end |
||
125 | |||
126 | function BActionSets_GetSelfCastMode() |
||
127 | return BActionSets.g.altCast; |
||
128 | end |
||
129 | |||
130 | --set range color |
||
131 | function BActionSets_SetColorOutOfRange(enable) |
||
132 | if enable then |
||
133 | BActionSets.g.colorOutOfRange = 1; |
||
134 | else |
||
135 | BActionSets.g.colorOutOfRange = nil; |
||
136 | end |
||
137 | BActionMain_ForAllShownButtons(BActionButton.UpdateUsable); |
||
138 | end |
||
139 | |||
140 | function BActionSets_ColorOutOfRange() |
||
141 | return BActionSets.g.colorOutOfRange; |
||
142 | end |
||
143 | |||
144 | function BActionSets_SetRangeColor(red, green, blue) |
||
145 | if red and green and blue then |
||
146 | BActionSets.g.rangeColor = { r = red, g = green, b = blue}; |
||
147 | end |
||
148 | end |
||
149 | |||
150 | function BActionSets_GetRangeColor() |
||
151 | return BActionSets.g.rangeColor; |
||
152 | end |