diff --git a/WeakAuras_Scripts/HWA/Group_Grow(Core - HWA - CLASS).lua b/WeakAuras_Scripts/HWA/Group_Grow(Core - HWA - CLASS).lua index d520c2f..0e1f1de 100644 --- a/WeakAuras_Scripts/HWA/Group_Grow(Core - HWA - CLASS).lua +++ b/WeakAuras_Scripts/HWA/Group_Grow(Core - HWA - CLASS).lua @@ -6,8 +6,8 @@ --]] function(newPositions, activeRegions) local HWA = HWA and HWA[aura_env.id:gsub("Core %- HWA %- ", "")] or {} - + if HWA and HWA.coreGrow then HWA.coreGrow(newPositions, activeRegions) end -end \ No newline at end of file +end diff --git a/WeakAuras_Scripts/HWA/Group_Grow(Dynamic Effects - HWA - CLASS).lua b/WeakAuras_Scripts/HWA/Group_Grow(Dynamic Effects - HWA - CLASS).lua index 20826bc..4bf40ac 100644 --- a/WeakAuras_Scripts/HWA/Group_Grow(Dynamic Effects - HWA - CLASS).lua +++ b/WeakAuras_Scripts/HWA/Group_Grow(Dynamic Effects - HWA - CLASS).lua @@ -4,8 +4,8 @@ --]] function(newPositions, activeRegions) local HWA = HWA and HWA[aura_env.id:gsub("Dynamic Effects %- HWA %- ", "")] or {} - + if HWA and HWA.dynamicEffectsGrow then HWA.dynamicEffectsGrow(newPositions, activeRegions) end -end \ No newline at end of file +end diff --git a/WeakAuras_Scripts/HWA/Group_Grow(Maintenance - HWA - CLASS).lua b/WeakAuras_Scripts/HWA/Group_Grow(Maintenance - HWA - CLASS).lua index cb8527d..92d927d 100644 --- a/WeakAuras_Scripts/HWA/Group_Grow(Maintenance - HWA - CLASS).lua +++ b/WeakAuras_Scripts/HWA/Group_Grow(Maintenance - HWA - CLASS).lua @@ -4,8 +4,8 @@ --]] function(newPositions, activeRegions) local HWA = HWA and HWA[aura_env.id:gsub("Maintenance %- HWA %- ", "")] or {} - + if HWA and HWA.maintenanceGrow then HWA.maintenanceGrow(newPositions, activeRegions) end -end \ No newline at end of file +end diff --git a/WeakAuras_Scripts/HWA/Group_Grow(Power - HWA - CLASS).lua b/WeakAuras_Scripts/HWA/Group_Grow(Power - HWA - CLASS).lua index ab5f0b5..b5bbc3e 100644 --- a/WeakAuras_Scripts/HWA/Group_Grow(Power - HWA - CLASS).lua +++ b/WeakAuras_Scripts/HWA/Group_Grow(Power - HWA - CLASS).lua @@ -7,8 +7,8 @@ --]] function(newPositions, activeRegions) local HWA = HWA and HWA[aura_env.id:gsub(".+ %- HWA %- ", "")] or {} - + if HWA and HWA.resourceGrow then HWA.resourceGrow(newPositions, activeRegions) end -end \ No newline at end of file +end diff --git a/WeakAuras_Scripts/HWA/Group_Sort(Core - HWA - CLASS).lua b/WeakAuras_Scripts/HWA/Group_Sort(Core - HWA - CLASS).lua index 089242e..8c841b4 100644 --- a/WeakAuras_Scripts/HWA/Group_Sort(Core - HWA - CLASS).lua +++ b/WeakAuras_Scripts/HWA/Group_Sort(Core - HWA - CLASS).lua @@ -6,9 +6,9 @@ --]] function(a, b) local HWA = HWA and HWA[aura_env.id:gsub("Core %- HWA %- ", "")] or {} - + if HWA and HWA.coreSort then return HWA.coreSort(a, b) end return a.dataIndex < b.dataIndex -end \ No newline at end of file +end diff --git a/WeakAuras_Scripts/HWA/Group_Sort(Dynamic Effects - HWA - CLASS).lua b/WeakAuras_Scripts/HWA/Group_Sort(Dynamic Effects - HWA - CLASS).lua index e987e75..186c07f 100644 --- a/WeakAuras_Scripts/HWA/Group_Sort(Dynamic Effects - HWA - CLASS).lua +++ b/WeakAuras_Scripts/HWA/Group_Sort(Dynamic Effects - HWA - CLASS).lua @@ -4,9 +4,9 @@ --]] function(a, b) local HWA = HWA and HWA[aura_env.id:gsub("Dynamic Effects %- HWA %- ", "")] or {} - + if HWA and HWA.dynamicEffectsSort then return HWA.dynamicEffectsSort(a, b) end return a.dataIndex < b.dataIndex -end \ No newline at end of file +end diff --git a/WeakAuras_Scripts/HWA/Group_Sort(Maintenance - HWA - CLASS).lua b/WeakAuras_Scripts/HWA/Group_Sort(Maintenance - HWA - CLASS).lua index c0286bd..87ca1f3 100644 --- a/WeakAuras_Scripts/HWA/Group_Sort(Maintenance - HWA - CLASS).lua +++ b/WeakAuras_Scripts/HWA/Group_Sort(Maintenance - HWA - CLASS).lua @@ -4,9 +4,9 @@ --]] function(a, b) local HWA = HWA and HWA[aura_env.id:gsub("Maintenance %- HWA %- ", "")] or {} - + if HWA and HWA.maintenanceSort then return HWA.maintenanceSort(a, b) end return a.dataIndex < b.dataIndex -end \ No newline at end of file +end diff --git a/WeakAuras_Scripts/HWA/Init(General Options - HWA).lua b/WeakAuras_Scripts/HWA/Init(General Options - HWA).lua index f63e20b..19daf38 100644 --- a/WeakAuras_Scripts/HWA/Init(General Options - HWA).lua +++ b/WeakAuras_Scripts/HWA/Init(General Options - HWA).lua @@ -18,6 +18,181 @@ local function tcontains(t, v) return false end +HWA.bit = { + tobit = function(x) + x = x % (2 ^ 32) + if x >= 2 ^ 31 then + return x - 2 ^ 32 + end + return x + end, + tohex = function(x, n) + if n == nil then + n = 8 + elseif n < 0 then + n = -n + x = x % (2 ^ (n * 4)) + x = string.format("%0" .. n .. "X", x) + return x + end + x = x % (2 ^ (n * 4)) + x = string.format("%0" .. n .. "x", x) + return x + end, + bnot = function(x) + x = x % (2 ^ 32) + local output = 0 + for i = 0, 31 do + if x % 2 == 0 then + output = output + 2 ^ i + end + x = math.floor(x / 2) + end + if output >= 2 ^ 31 then + output = output - 2 ^ 32 + end + return output + end, + bor = function(...) + local output = 0 + local bits = {} + for i = 1, select("#", ...) do + local x = select(i, ...) + x = x % (2 ^ 32) + for i = 1, 32 do + if x % 2 ~= 0 and bits[i] == nil then + bits[i] = true + output = output + 2 ^ (i - 1) + end + x = math.floor(x / 2) + end + end + if output >= 2 ^ 31 then + output = output - 2 ^ 32 + end + return output + end, + band = function(...) + local output = 2 ^ 32 - 1 + local bits = {} + for i = 1, select("#", ...) do + local x = select(i, ...) + x = x % (2 ^ 32) + for i = 1, 32 do + if x % 2 == 0 and bits[i] == nil then + bits[i] = true + output = output - 2 ^ (i - 1) + end + x = math.floor(x / 2) + end + end + if output >= 2 ^ 31 then + output = output - 2 ^ 32 + end + return output + end, + bxor = function(...) + local bits = {} + for i = 1, select("#", ...) do + local x = select(i, ...) + x = x % (2 ^ 32) + for i = 1, 32 do + if x % 2 ~= 0 then + bits[i] = not bits[i] + end + x = math.floor(x / 2) + end + end + local output = 0 + for i = 1, 32 do + if bits[i] == true then + output = output + 2 ^ (i - 1) + end + end + if output >= 2 ^ 31 then + output = output - 2 ^ 32 + end + return output + end, + lshift = function(x, n) + x = x % (2 ^ 32) + n = n % 32 + x = x * (2 ^ n) + x = x % (2 ^ 32) + if x >= 2 ^ 31 then + x = x - 2 ^ 32 + end + return x + end, + rshift = function(x, n) + x = x % (2 ^ 32) + n = n % 32 + for i = 1, n do + x = math.floor(x / 2) + end + if x >= 2 ^ 31 then + x = x - 2 ^ 32 + end + return x + end, + arshift = function(x, n) + x = x % (2 ^ 32) + n = n % 32 + local extension = 0 + if x >= 2 ^ 31 then + extension = 2 ^ 31 + end + for i = 1, n do + x = math.floor(x / 2) + extension + end + if x >= 2 ^ 31 then + x = x - 2 ^ 32 + end + return x + end, + rol = function(x, n) + x = x % (2 ^ 32) + n = n % 32 + for i = 1, n do + x = x * 2 + if x >= 2 ^ 32 then + x = x % (2 ^ 32) + 1 + end + end + if x >= 2 ^ 31 then + x = x - 2 ^ 32 + end + return x + end, + ror = function(x, n) + x = x % (2 ^ 32) + n = n % 32 + for i = 1, n do + local msb = 0 + if x % 2 ~= 0 then + msb = 2 ^ 31 + end + x = math.floor(x / 2) + msb + end + if x >= 2 ^ 31 then + x = x - 2 ^ 32 + end + return x + end, + bswap = function(x) + x = x % (2 ^ 32) + local b1 = math.floor(x / 0x1000000) + local b2 = math.floor(x / 0x10000) % 0x100 + local b3 = math.floor(x / 0x100) % 0x100 + local b4 = x % 0x100 + x = b4 * 0x1000000 + b3 * 0x10000 + b2 * 0x100 + b1 + if x >= 2 ^ 31 then + x = x - 2 ^ 32 + end + return x + end, +} + function HWA.getShow(config) if not config then return true diff --git a/WeakAuras_Scripts/HWA/TSU(Icon - HWA)_Aura.lua b/WeakAuras_Scripts/HWA/TSU(Icon - HWA)_Aura.lua index 833e9d7..23ac390 100644 --- a/WeakAuras_Scripts/HWA/TSU(Icon - HWA)_Aura.lua +++ b/WeakAuras_Scripts/HWA/TSU(Icon - HWA)_Aura.lua @@ -26,7 +26,7 @@ function(states, event, ...) if not state.show then states[key] = { show = false, - changed = true + changed = true, } else states[key] = { @@ -36,7 +36,7 @@ function(states, event, ...) progressType = state.progressType, duration = state.duration, expirationTime = state.expirationTime, - stacks = state.stacks + stacks = state.stacks, } end return true diff --git a/WeakAuras_Scripts/HWA/TSU(Icon - HWA)_Spell.lua b/WeakAuras_Scripts/HWA/TSU(Icon - HWA)_Spell.lua index d891edc..72ee07d 100644 --- a/WeakAuras_Scripts/HWA/TSU(Icon - HWA)_Spell.lua +++ b/WeakAuras_Scripts/HWA/TSU(Icon - HWA)_Spell.lua @@ -44,7 +44,7 @@ function(states, event) if not state.show then states[key] = { show = false, - changed = true + changed = true, } else states[key] = { diff --git a/WeakAuras_Scripts/HWA/Trigger(Class Options - HWA - CLASS)_1.lua b/WeakAuras_Scripts/HWA/Trigger(Class Options - HWA - CLASS)_1.lua index b4d1eed..2b40653 100644 --- a/WeakAuras_Scripts/HWA/Trigger(Class Options - HWA - CLASS)_1.lua +++ b/WeakAuras_Scripts/HWA/Trigger(Class Options - HWA - CLASS)_1.lua @@ -3,4 +3,4 @@ --]] function(event) WeakAuras.ScanEvents("HWA_OPTIONS") -end \ No newline at end of file +end diff --git a/WeakAuras_Scripts/HWA/Trigger(General Options - HWA - CLASS)_1.lua b/WeakAuras_Scripts/HWA/Trigger(General Options - HWA - CLASS)_1.lua index 9b9d825..94f72a8 100644 --- a/WeakAuras_Scripts/HWA/Trigger(General Options - HWA - CLASS)_1.lua +++ b/WeakAuras_Scripts/HWA/Trigger(General Options - HWA - CLASS)_1.lua @@ -1,21 +1,24 @@ --[[ -- Events: OPTIONS, HWA_OPTIONS, HWA_INIT, PLAYER_ENTERING_WORLD, PLAYER_SPECIALIZATION_CHANGED, TRAIT_CONFIG_UPDATED, UPDATE_SHAPESHIFT_FORM +- Events: OPTIONS, HWA_OPTIONS, HWA_INIT, PLAYER_ENTERING_WORLD, PLAYER_SPECIALIZATION_CHANGED, TRAIT_CONFIG_UPDATED, GROUP_JOINED, GROUP_LEFT, UPDATE_SHAPESHIFT_FORM --]] function(event, ...) - local arg1, arg2 = ... - - if "OPTIONS" == event or "HWA_OPTIONS" == event or ("HWA_INIT" == event and arg1) then + local arg = ... + + if "OPTIONS" == event or "HWA_OPTIONS" == event or ("HWA_INIT" == event and arg) then aura_env.initThrottled() - elseif "HWA_INIT" == event then aura_env.init() - - elseif "PLAYER_ENTERING_WORLD" == event or "PLAYER_SPECIALIZATION_CHANGED" == event or "TRAIT_CONFIG_UPDATED" == event then + elseif + "PLAYER_ENTERING_WORLD" == event + or "PLAYER_SPECIALIZATION_CHANGED" == event + or "TRAIT_CONFIG_UPDATED" == event + or "GROUP_JOINED" == event + or "GROUP_LEFT" == event + then aura_env.initThrottled() C_Timer.After(1, function() WeakAuras.ScanEvents("HWA_INIT", true) end) - elseif "UPDATE_SHAPESHIFT_FORM" == event then local formID = GetShapeshiftFormID() if aura_env.formID ~= formID then diff --git a/WeakAuras_Scripts/HWA/Trigger(General Options - HWA - CLASS)_2.lua b/WeakAuras_Scripts/HWA/Trigger(General Options - HWA - CLASS)_2.lua index ad3831b..c7239e8 100644 --- a/WeakAuras_Scripts/HWA/Trigger(General Options - HWA - CLASS)_2.lua +++ b/WeakAuras_Scripts/HWA/Trigger(General Options - HWA - CLASS)_2.lua @@ -22,11 +22,11 @@ function(event, ...) end local class = UnitClassBase("player") - local isMounted = IsMounted() or ("DRUID" == class and tContains({3, 4, 27, 29}, GetShapeshiftFormID())) + local isMounted = IsMounted() or ("DRUID" == class and tContains({ 3, 4, 27, 29 }, GetShapeshiftFormID())) local isSkyriding = WeakAuras.IsRetail() and isMounted and select(2, C_PlayerInfo.GetGlidingInfo()) local isPetBattle = C_PetBattles.IsInBattle() - local isVehicle = UnitInVehicle('player') or UnitOnTaxi('player') - local isVehicleUI = UnitHasVehicleUI('player') or HasOverrideActionBar() or HasVehicleActionBar() + local isVehicle = UnitInVehicle("player") or UnitOnTaxi("player") + local isVehicleUI = UnitHasVehicleUI("player") or HasOverrideActionBar() or HasVehicleActionBar() if isSkyriding or (isMounted and not config.skyriding_only) then alpha = min(alpha, config.mounted or 0) diff --git a/WeakAuras_Scripts/HWA/Trigger(General Options - HWA - CLASS)_3.lua b/WeakAuras_Scripts/HWA/Trigger(General Options - HWA - CLASS)_3.lua index 0591610..5a6b0ee 100644 --- a/WeakAuras_Scripts/HWA/Trigger(General Options - HWA - CLASS)_3.lua +++ b/WeakAuras_Scripts/HWA/Trigger(General Options - HWA - CLASS)_3.lua @@ -7,4 +7,4 @@ function(event) WeakAuras.ScanEvents("HWA_INIT") end) end -end \ No newline at end of file +end diff --git a/WeakAuras_Scripts/HWA/Trigger(Icon - HWA)_Aura.lua b/WeakAuras_Scripts/HWA/Trigger(Icon - HWA)_Aura.lua index 14f0f4b..be39014 100644 --- a/WeakAuras_Scripts/HWA/Trigger(Icon - HWA)_Aura.lua +++ b/WeakAuras_Scripts/HWA/Trigger(Icon - HWA)_Aura.lua @@ -28,7 +28,6 @@ function(event, ...) return false end - -- Untrigger function(event, ...) local key = "AURA" @@ -39,7 +38,6 @@ function(event, ...) return false end - -- Duration Info function() local key = "AURA" @@ -50,7 +48,6 @@ function() return 0, 0 end - -- Name Info function() local key = "AURA" @@ -61,7 +58,6 @@ function() return nil end - -- Stack Info function() local key = "AURA" diff --git a/WeakAuras_Scripts/HWA/Trigger(Icon - HWA)_Totem.lua b/WeakAuras_Scripts/HWA/Trigger(Icon - HWA)_Totem.lua index 8089c6a..24b5eff 100644 --- a/WeakAuras_Scripts/HWA/Trigger(Icon - HWA)_Totem.lua +++ b/WeakAuras_Scripts/HWA/Trigger(Icon - HWA)_Totem.lua @@ -24,7 +24,6 @@ function(event, ...) return false end - -- Untrigger function(event, ...) local key = "TOTEM" @@ -35,7 +34,6 @@ function(event, ...) return false end - -- Duration Info function() local key = "TOTEM" @@ -46,7 +44,6 @@ function() return 0, 0 end - -- Stack Info function() local key = "TOTEM"