/trunk/Core
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 |