vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | --bgab_versionUpdate; a flag to tell |
2 | |||
3 | local function UpdateVersion(currentVersion) |
||
4 | BActionSets.version = currentVersion; |
||
5 | end |
||
6 | |||
7 | local function LoadVariables() |
||
8 | local currentVersion = GetAddOnMetadata("Bongos_ActionBar", "Version") |
||
9 | |||
10 | if not BActionSets or not BActionSets.g.version then |
||
11 | BMsg("Loading Defaults"); |
||
12 | local defaults = BProfile.GetDefaultValue("BActionSets.g"); |
||
13 | BActionSets = { |
||
14 | g = defaults or { |
||
15 | version = currentVersion, |
||
16 | buttonLocked = 1, |
||
17 | tooltips = 1, |
||
18 | altCast = 1, |
||
19 | quickMove = 2, |
||
20 | colorOutOfRange = 1, |
||
21 | rangeColor = { r = 1, g = 0.5, b = 0.5 }, |
||
22 | numActionBars = 10, |
||
23 | }, |
||
24 | }; |
||
25 | elseif BActionSets.version ~= currentVersion then |
||
26 | UpdateVersion(currentVersion); |
||
27 | end |
||
28 | end |
||
29 | |||
30 | BScript.AddEventAction("ADDON_LOADED", function(thisAction) |
||
31 | if arg1 == "Bongos_ActionBar" then |
||
32 | BScript.RemoveEventAction("ADDON_LOADED", thisAction); |
||
33 | LoadVariables(); |
||
34 | BProfile.RegisterForSave("BActionSets.g", LoadVariables); |
||
35 | end |
||
36 | end); |
||
37 | |||
38 | --make the first actionbar switch when changing stances/forms/stealthing |
||
39 | local _, class = UnitClass("player"); |
||
40 | if class == "DRUID" or class == "WARRIOR" or class == "ROGUE" then |
||
41 | BScript.AddBarEventAction(1, "UPDATE_BONUS_ACTIONBAR", function(bar) |
||
42 | if GetBonusBarOffset() ~= 0 then |
||
43 | BActionBar.SetStanceOffset(bar.id, 5 + GetBonusBarOffset()) |
||
44 | else |
||
45 | BActionBar.SetStanceOffset(bar.id, 0) |
||
46 | end |
||
47 | end) |
||
48 | end |