/
return LSM:Fetch("statusbar", SC.SET.BarTexture) |
end |
function SliceCommander:PlayCDSound(BAR) |
if BAR['sound'] ~= nil and not _G['SC'].preventSound then |
local name = BAR['sound']['available'] |
if (SliceCommander:isCombat() or SC.SET.ForceCDSpellSound) and name ~= 'None' and name ~= nil then |
PlaySoundFile(LSM:Fetch("sound", name), SC.SET.soundChannel) |
end |
end |
end |
function SliceCommander:PlaySoundReal(name) |
local _ |
if SC.previousSound then |
for j,v in pairs(SC.BARS) do |
if v['obj']:IsVisible() and v['expire'] == 0 then |
v['obj']:Hide() |
if v['type'] == 4 or v['type'] == 5 then |
SliceCommander:PlayCDSound(v) |
end |
end |
if SC.SET.Pos[j] == i and v['expire'] ~= 0 then |
alignPos = -1*numberNeg*offSetSize-SC.SET.BarMargin |
BAR['expire'] = 0 |
if BAR['obj']:IsVisible() then |
SliceCommander:HideBar(BAR) |
SliceCommander:PlayCDSound(BAR) |
end |
return |
end |
BAR['expire'] = 0 |
if BAR['obj']:IsVisible() then--if you respect when a cd is enabled |
SliceCommander:HideBar(BAR) |
SliceCommander:PlayCDSound(BAR) |
end |
return |
end |
BAR['expire'] = 0 |
if BAR['obj']:IsVisible() then |
SliceCommander:HideBar(BAR) |
SliceCommander:PlayCDSound(BAR) |
end |
return |
end |
BAR['expire'] = 0 |
if BAR['obj']:IsVisible() then |
SliceCommander:HideBar(BAR) |
SliceCommander:PlayCDSound(BAR) |
end |
return |
end |
BAR['expire'] = 0 |
if BAR['obj']:IsVisible() then--if you respect when a cd is enabled |
SliceCommander:HideBar(BAR) |
SliceCommander:PlayCDSound(BAR) |
end |
return |
end |
BAR['expire'] = 0 |
if BAR['obj']:IsVisible() then |
SliceCommander:HideBar(BAR) |
SliceCommander:PlayCDSound(BAR) |
end |
return |
end |
value1, value2, value3 = 0 , 0, 0 |
local last = BAR['expire'] |
if BAR['type'] == 1 then |
_, icon, count, _, duration, BAR['expire'], unitCaster, _, _, _, _, _, _, _, _, value1, value2, value3 = SliceCommander:UnitAura("player", BAR['id'], "PLAYER") |
_, icon, count, _, duration, BAR['expire'], unitCaster, _, _, _, _, _, _, _, _, value1, value2, value3 = SliceCommander:UnitAura("player", BAR['id'], "HELPFUL PLAYER") |
elseif BAR['type'] == 2 then |
_, icon, count, _, duration, BAR['expire'], unitCaster = SliceCommander:UnitAura("target", BAR['id'], "PLAYER HARMFUL") |
_, icon, count, _, duration, BAR['expire'], unitCaster = SliceCommander:UnitAura("target", BAR['id'], "HARMFUL PLAYER") |
elseif BAR['type'] == 3 then |
_, icon, count, _, duration, BAR['expire'], unitCaster = SliceCommander:UnitAura("player", BAR['id'], "PLAYER HARMFUL") |
else |
_, icon, count, _, duration, BAR['expire'], unitCaster = SliceCommander:UnitAura("target", BAR['id'], "HARMFUL") |
_, icon, count, _, duration, BAR['expire'], unitCaster = SliceCommander:UnitAura("player", BAR['id'], "HARMFUL") |
end |
if unitCaster ~= "player" and BAR['type'] ~= 3 and unitCaster ~= nil then |
function SliceCommander:TestBF() |
if SC.SET.display.BFICON then |
local name = SliceCommander:UnitAura("player", SC_SPELLID['BF'], "PLAYER") |
local name = SliceCommander:UnitAura("player", SC_SPELLID['BF'], "HELPFUL PLAYER") |
if name and not SC.OTHER['BF']['obj']:IsVisible() then |
SC.OTHER['BF']['obj']:Show() |
elseif not name and SC.OTHER['BF']['obj']:IsVisible() then |
ohPoison = 'CRP' |
end |
local name, _, _, _, _, expirationTime = SliceCommander:UnitAura("player", SC_SPELLID[mhPoison], "PLAYER") |
local name2, _, _, _, _, expirationTime2 = SliceCommander:UnitAura("player", SC_SPELLID[ohPoison], "PLAYER") |
local name, _, _, _, _, expirationTime = SliceCommander:UnitAura("player", SC_SPELLID[mhPoison], "HELPFUL PLAYER") |
local name2, _, _, _, _, expirationTime2 = SliceCommander:UnitAura("player", SC_SPELLID[ohPoison], "HELPFUL PLAYER") |
local minimalTime = SC.SET.display.DPTIME*60 |
function SliceCommander:TestSOTD() |
if SC.SET.display.SOTD then |
local name, _, _, count = SliceCommander:UnitAura("player", SC_SPELLID['SOTD'], "PLAYER") |
local name, _, _, count = SliceCommander:UnitAura("player", SC_SPELLID['SOTD'], "HELPFUL PLAYER") |
if name and count >= 29 then |
if not SC.OTHER['SOTD']['obj']:IsVisible() then |
SC.OTHER['SOTD']['obj']:Show() |
local spellname = {} |
BAR['expire'] = 0 |
for k, v in pairs(BAR.subbar) do |
_, _, _, _, duration, expire = SliceCommander:UnitAura("player", k, "PLAYER") |
_, _, _, _, duration, expire = SliceCommander:UnitAura("player", k, "HELPFUL PLAYER") |
if expire ~= nil then |
if SC.SET.RB[v] then |
table.insert(spellname, SC.SET.RB[v]) |
end |
function SliceCommander:Global() |
SliceCommander:DisplaySpells({'CP', 'THREAT', 'CS', 'KS', 'KSCD', 'FOTD', 'CV', 'CVCD', 'TOT', 'FE', 'SSCD', 'SUB', 'CD', 'AC', 'MD', 'DFA', 'Poison', 'SOTD', 'MAI', 'FECD'}) |
SliceCommander:DisplaySpells({'CP', 'THREAT', 'CS', 'KS', 'KSCD', 'FOTD', 'CV', 'CVCD', 'TOT', 'FE', 'SSCD', 'SUB', 'CD', 'AC', 'MD', 'DFA', 'Poison', 'SOTD', 'MAI', 'FECD', 'ESSECD'}) |
SliceCommander:NotDisplaySpells({'HEALTH', 'THEALTH', 'VAN', 'KI', 'COS', 'COSCD', 'EVA', 'EVACD', 'SPR', 'SPRCD', 'SS'}) |
_G['SC'].orderBar = _G['SC'].maxPos |
end |
SliceCommander:OrderSpells({'FOTD', 'CV', 'FE', 'SUB', 'AC', 'MAI', 'COS', 'EVA', 'SPR', 'SS'}) |
SliceCommander:OrderCDs({'CVCD', 'TOT', 'VAN', 'SSCD', 'CD', 'MD', 'DFA', 'THREAT', 'HEALTH', 'THEALTH', 'CS', 'KS', 'KSCD', 'KI', 'COSCD', 'EVACD', 'SPRCD', 'FECD'}) |
SliceCommander:OrderCDs({'CVCD', 'TOT', 'VAN', 'SSCD', 'CD', 'MD', 'DFA', 'THREAT', 'HEALTH', 'THEALTH', 'CS', 'KS', 'KSCD', 'KI', 'COSCD', 'EVACD', 'SPRCD', 'FECD', 'ESSECD'}) |
end |
function SliceCommander:Assassination() |
end |
function SliceCommander:SetEssence() |
local essenceId = C_AzeriteEssence.GetMilestoneEssence(115) |
local essenceRank = C_AzeriteEssence.GetEssenceInfo(essenceId)['rank'] |
if SC_SPELLID['ALLESSE'][essenceId] ~= nil then |
SC_SPELLID['ESSECD'] = SC_SPELLID['ALLESSE'][essenceId][essenceRank] |
local name, _, icon = GetSpellInfo(SC_SPELLID['ESSECD']) |
SC_SPELL['ESSECD'] = name |
if SC.BARS['ESSECD']['obj'] ~= nil and SC.BARS['ESSECD']['obj'] ~= 0 then |
SC.BARS['ESSECD']['obj'].icon:SetTexture(icon) |
end |
else |
SC_SPELLID['ESSECD'] = -1 |
SC_SPELL['ESSECD'] = 'ESSENCE' |
end |
SC.BARS['ESSECD']['name'] = SC_SPELL['ESSECD'] |
SC.BARS['ESSECD']['id'] = SC_SPELLID['ESSECD'] |
end |
function SliceCommander:DisplayOrderBar() |
SliceCommander:Assassination() |
SliceCommander:Outlaw() |
if SC.BARS['SPRCD'] == nil then--Sprint CD |
SC.BARS['SPRCD'] = {['color'] = {.83, .51, .27}} |
end |
if SC.BARS['ESSECD'] == nil then--Essence CD |
SC.BARS['ESSECD'] = {['color'] = {.01, .59, .78}} |
end |
end |
function SliceCommander:InitAssassinationBarArray() |
SC.BARS[v]['type'] = 3 |
end |
local cd = {'VAN', 'KSP', 'ARCD', 'CDBCD', 'CVCD', 'MD', 'GH', 'BECD', 'TOT', 'SDCD', 'SBCD', 'VENCD', 'GBCD', 'EX', 'GARCD', 'KBCD', 'KSCD', 'DFA', 'KI', 'TXBCD', 'SODCD', 'SHTCD', 'STH', 'COSCD', 'EVACD', 'SPRCD', 'FECD', 'GSCD', 'BRCD', 'RIPCD', 'GGCD'} |
local cd = {'VAN', 'KSP', 'ARCD', 'CDBCD', 'CVCD', 'MD', 'GH', 'BECD', 'TOT', 'SDCD', 'SBCD', 'VENCD', 'GBCD', 'EX', 'GARCD', 'KBCD', 'KSCD', 'DFA', 'KI', 'TXBCD', 'SODCD', 'SHTCD', 'STH', 'COSCD', 'EVACD', 'SPRCD', 'FECD', 'GSCD', 'BRCD', 'RIPCD', 'GGCD', 'ESSECD'} |
for i, v in ipairs(cd) do |
SC.BARS[v]['type'] = 4 |
end |
end |
function SliceCommander:UIScale(event) |
if not _G['SC'].SET or _G['SC'].SET.PixelPerfect then |
if not _G['SC'].SET or _G['SC'].SET.PixelPerfect then |
local resolution = ({GetScreenResolutions()})[GetCurrentResolution()] |
if resolution == nil then |
if not _G['SC'].SET then |
return false |
end |
resolution = _G['SC'].SET.fixedResolution |
if resolution == nil then |
SliceCommander:StaticPopup_Show('FAILED_UISCALERESOLUTION') |
Color = SliceCommander:getColorSetting(spell), |
Pos = SliceCommander:getPosSetting(spell), |
} |
if SC.SET.SpellSound ~= nil and SC.SET.SpellSound then |
args.CDSpellSound = SliceCommander:getCDSpellSound(spell) |
end |
return { |
name = SC_SPELL[spell], |
type = "group", |
} |
if SC.SET.SpellSound ~= nil and SC.SET.SpellSound then |
args.SpellSound = SliceCommander:getSpellSound(spell) |
args.CDSpellSound = SliceCommander:getCDSpellSound(spell..'CD') |
end |
return { |
name = SC_SPELL[spell], |
} |
end |
function SliceCommander:getCDSpellSound(spell) |
return { |
name = L["CD Sound"], |
type = "group", |
order = SliceCommander:getOrder(), |
args = { |
available = SliceCommander:getSoundSetting(L["On cooldown"], L["Alert when the spell is ready to be used"], spell, 'available') |
} |
} |
end |
function SliceCommander:getSpellSound(spell) |
return { |
name = L["Sound"], |
type = "group", |
order = SliceCommander:getOrder(), |
args = { |
Tick3 = SliceCommander:getSoundSetting(L["Alert - 3 sec"], L["Alert 3 secondes before fade"], spell, 'alert3', "Tick"), |
Tick2 = SliceCommander:getSoundSetting(L["Alert - 2 sec"], L["Alert 2 secondes before fade"], spell, 'alert2', "Tick"), |
Tick1 = SliceCommander:getSoundSetting(L["Alert - 1 sec"], L["Alert 1 secondes before fade"], spell, 'alert1', "Tick"), |
Apply3 = SliceCommander:getSoundSetting(L["Refresh - 3 sec"], L["Refresh 3 secondes before fade"], spell, 'refresh3', "Apply"), |
Apply2 = SliceCommander:getSoundSetting(L["Refresh - 2 sec"], L["Refresh 2 secondes before fade"], spell, 'refresh2', "Apply"), |
Apply1 = SliceCommander:getSoundSetting(L["Refresh - 1 sec"], L["Refresh 1 secondes before fade"], spell, 'refresh1', "Apply"), |
Applied = SliceCommander:getSoundSetting(L["Applied"], string.format(L["%s is applied"], SC_SPELL[spell]), spell, 'applied', "Apply"), |
Expire = SliceCommander:getSoundSetting(L["Expired"], string.format(L["%s buff expire"], SC_SPELL[spell]), spell, 'expired', "Fail") |
Tick3 = SliceCommander:getSoundSetting(L["Alert - 3 sec"], L["Alert 3 secondes before fade"], spell, 'alert3'), |
Tick2 = SliceCommander:getSoundSetting(L["Alert - 2 sec"], L["Alert 2 secondes before fade"], spell, 'alert2'), |
Tick1 = SliceCommander:getSoundSetting(L["Alert - 1 sec"], L["Alert 1 secondes before fade"], spell, 'alert1'), |
Apply3 = SliceCommander:getSoundSetting(L["Refresh - 3 sec"], L["Refresh 3 secondes before fade"], spell, 'refresh3'), |
Apply2 = SliceCommander:getSoundSetting(L["Refresh - 2 sec"], L["Refresh 2 secondes before fade"], spell, 'refresh2'), |
Apply1 = SliceCommander:getSoundSetting(L["Refresh - 1 sec"], L["Refresh 1 secondes before fade"], spell, 'refresh1'), |
Applied = SliceCommander:getSoundSetting(L["Applied"], string.format(L["%s is applied"], SC_SPELL[spell]), spell, 'applied'), |
Expire = SliceCommander:getSoundSetting(L["Expired"], string.format(L["%s buff expire"], SC_SPELL[spell]), spell, 'expired') |
} |
} |
end |
} |
end |
function SliceCommander:getSoundSetting(name, description, spell, id, type) |
function SliceCommander:getSoundSetting(name, description, spell, id) |
return { |
order = SliceCommander:getOrder(), |
name = name, |
return SC.SET.SpellSound |
end |
}, |
ForceCDSpellSound = { |
order = SliceCommander:getOrder(), |
name = L["Force cooldown sound out of combat"], |
desc = L["Force the cooldown sound to be play even if you are not in combat."], |
type = "toggle", |
set = function(info,val) |
SC.SET.ForceCDSpellSound = val |
end, |
get = function(info) |
if SC.SET.ForceCDSpellSound == nil then |
SC.SET.ForceCDSpellSound = false |
end |
return SC.SET.ForceCDSpellSound |
end |
}, |
} |
} |
args = { |
Shortcut = SliceCommander:getShortcutHeader(), |
Shortcut_DFA = SliceCommander:getShortcutSetting("SliceCommander_General", "TalentsPVP", "DFA"), |
DFA = SliceCommander:getCDSettings('DFA'), |
DFA = SliceCommander:getCDSettings('DFA') |
} |
}, |
AzeriteEssence = { |
order = SliceCommander:getOrder(), |
name = L["Azerite Essence"], |
type = "group", |
childGroups = "tree", |
args = { |
Shortcut = SliceCommander:getShortcutHeader(), |
Shortcut_ESSECD = SliceCommander:getShortcutSetting("SliceCommander_General", "AzeriteEssence", "ESSECD"), |
ESSECD = SliceCommander:getCDSettings('ESSECD') |
} |
} |
} |
} |
} |
} |
} |
if SC.SET.SpellSound ~= nil and SC.SET.SpellSound then |
SC_OptionsTable["Outlaw"]['args']['Skills']['args']['AR']['args']['ARCDSpellSound'] = SliceCommander:getCDSpellSound('ARCD') |
end |
SC_OptionsTable["Sublety"] = { |
name = L["Subtlety settings"], |
end |
end |
function SliceCommander:AZERITE_ESSENCE_UPDATE() |
SliceCommander:SetEssence() |
end |
function SliceCommander:PLAYER_LOGIN() |
_G['SC'].preventSound = true |
SliceCommander:TestCurrentVersion() |
_G['SC'].initDone = true |
_G['SC'].order = 0 |
_G['SC'].maxPos = 0 |
_G['SC'].maxCDPos = 0 |
SliceCommander:TestValueOptions() |
SliceCommander:SetEssence() |
SliceCommander:InitConfigurationTable() |
SliceCommander:InitFont() |
SliceCommander:InitConstantValue() |
SliceCommander:InitIcon() |
SliceCommander:InitGCDBar() |
SliceCommander:ApplyConf() |
SliceCommander:SetEssence() |
SliceCommander:ChangeAnchor() |
_G['SC'].preventSound = false |
collectgarbage() |
UpdateAddOnMemoryUsage() |
print('|cffc14f2cSlice|r|cff40a740Commander|r v'..GetAddOnMetadata("SliceCommander", "Version")..' ('..L["memory use"]..':'..floor(GetAddOnMemoryUsage("SliceCommander"))..' kb)') |
SliceCommander:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED") |
SliceCommander:RegisterEvent("PLAYER_TALENT_UPDATE", "ACTIVE_TALENT_GROUP_CHANGED") |
SliceCommander:RegisterEvent("UNIT_MAXPOWER") |
SliceCommander:RegisterEvent("AZERITE_ESSENCE_UPDATE") |
else |
SliceCommander:OnDisable() |
return 0 |
## Interface: 80000 |
## Interface: 80200 |
## Author: Tomate |
## Version: 8.03 |
## Version: 8.05 |
## Title: |cffc14f2cSlice|r|cff40a740Commander|r |
## Notes: Energy bar, Combo point bar and rogue timer bar. |
## SavedVariables: SC |
SC_SPELLID['SPR'] = 2983 --Sprint |
SC_SPELLID['SPRCD'] = 2983 --Sprint CD |
--AZERITE ESSENCE |
SC_SPELLID['ESSECD'] = -1 |
SC_SPELLID['ALLESSE'] = { |
[4] = {--Worldvein Resonance |
[1] = 295186, |
[2] = 298628, |
[3] = 299334, |
[4] = 299334 |
}, |
[5] = {--Essence of the Focusing Iris |
[1] = 295258, |
[2] = 299336, |
[3] = 299338, |
[4] = 299338 |
}, |
[6] = {--Purification Protocol |
[1] = 295337, |
[2] = 299345, |
[3] = 299347, |
[4] = 299347 |
}, |
[12] = {--The Crucible of Flame |
[1] = 295373, |
[2] = 299349, |
[3] = 299353, |
[4] = 299353 |
}, |
[14] = {--Condensed Life-Force |
[1] = 295840, |
[2] = 299355, |
[3] = 299358, |
[4] = 299358 |
}, |
[15] = {--Ripple in Space |
[1] = 302731, |
[2] = 302982, |
[3] = 302983, |
[4] = 302983 |
}, |
[22] = {--Vision of Perfection |
[1] = 296325, |
[2] = 299368, |
[3] = 299370, |
[4] = 299370 |
}, |
[23] = {--Blood of the Enemy |
[1] = 297108, |
[2] = 298273, |
[3] = 298277, |
[4] = 298277 |
}, |
[27] = {--Memory of Lucid Dreams |
[1] = 298357, |
[2] = 299372, |
[3] = 299374, |
[4] = 299374 |
}, |
[28] = {--The Unbound Force |
[1] = 298452, |
[2] = 299376, |
[3] = 299378, |
[4] = 299378 |
}, |
[32] = {--Conflict and Strife |
[1] = 303823, |
[2] = 304088, |
[3] = 304121, |
[4] = 304121 |
} |
} |
--OUTLAW |
SC_SPELLID['SND'] = 5171 --Slice and Dice |
SC_SPELLID['AR'] = 13750 --Adrenaline Rush |