/
SliceCommander:UnregisterAllEvents() |
end |
function SliceCommander:DEBUG(spell, message) |
if spell == 'SND' then |
print(spell.. ' => ' ..tostring(message)) |
end |
end |
function SliceCommander:AbilityCDBar(spell) |
local BAR = SC.BARS[spell] |
local display = SC.SET.display[spell] |
end |
return |
end |
if start ~= 0 and duration >= 2 and (not BAR['obj']:IsVisible() or BAR['obj'].anim:IsPlaying()) then |
if BAR['obj'].anim:IsPlaying() then |
BAR['obj'].anim:Stop() |
end |
if start ~= 0 and duration >= 2 and not BAR['obj']:IsVisible() then |
SliceCommander:EnableBar(BAR, duration, BAR['name'].." (CD)", (start+duration)) |
return |
end |
if start == 0 then |
if SC.SET.flash[spell] == true and UnitAffectingCombat("player") then |
if not BAR['obj'].anim:IsPlaying() then |
BAR['obj']:SetValue(500) |
BAR['obj'].text:SetText('') |
if BAR['expire'] ~= -1 then |
BAR['expire'] = -1 |
if BAR['obj']:IsVisible() then |
SliceCommander:PlayCDSound(BAR) |
end |
end |
if not BAR['obj']:IsVisible() then |
if SC.SET.SpellText == true then |
BAR['obj'].text2:SetText(string.format("%s", BAR['name'].." (CD)")) |
else |
BAR['obj'].text2:SetText('') |
end |
BAR['obj']:Show() |
SliceCommander:ChangeAnchor() |
end |
BAR['obj'].anim:Play() |
end |
else |
BAR['expire'] = 0 |
if BAR['obj']:IsVisible() then |
if BAR['obj'].anim:IsPlaying() then |
BAR['obj'].anim:Stop() |
else |
SliceCommander:PlayCDSound(BAR) |
end |
SliceCommander:HideBar(BAR) |
end |
BAR['expire'] = 0 |
if BAR['obj']:IsVisible() then |
SliceCommander:HideBar(BAR) |
SliceCommander:PlayCDSound(BAR) |
end |
return |
end |
if start == 0 or duration < 2 then |
if BAR['expire'] ~= -1 then |
BAR['expire'] = 0 |
end |
BAR['expire'] = 0 |
return |
end |
BAR['expire'] = (start+duration) |
end |
return |
end |
if charges ~= maxCharges and (not BAR['obj']:IsVisible() or BAR['obj'].anim:IsPlaying()) then |
if BAR['obj'].anim:IsPlaying() then |
BAR['obj'].anim:Stop() |
end |
if charges ~= maxCharges and not BAR['obj']:IsVisible() then |
SliceCommander:EnableBar(BAR, duration, BAR['name'].." (CD)", (start+duration)) |
return |
end |
if charges == maxCharges then |
if SC.SET.flash[spell] == true and UnitAffectingCombat("player") then |
if not BAR['obj'].anim:IsPlaying() then |
BAR['obj']:SetValue(500) |
BAR['obj'].text:SetText('') |
if BAR['expire'] ~= -1 then |
BAR['expire'] = -1 |
if BAR['obj']:IsVisible() then |
SliceCommander:PlayCDSound(BAR) |
end |
end |
if not BAR['obj']:IsVisible() then |
if SC.SET.SpellText == true then |
BAR['obj'].text2:SetText(string.format("%s", BAR['name'].." (CD)")) |
else |
BAR['obj'].text2:SetText('') |
end |
BAR['obj']:Show() |
SliceCommander:ChangeAnchor() |
end |
BAR['obj'].anim:Play() |
end |
else |
BAR['expire'] = 0 |
if BAR['obj']:IsVisible() then |
if BAR['obj'].anim:IsPlaying() then |
BAR['obj'].anim:Stop() |
else |
SliceCommander:PlayCDSound(BAR) |
end |
SliceCommander:HideBar(BAR) |
end |
BAR['expire'] = 0 |
if BAR['obj']:IsVisible() then |
SliceCommander:HideBar(BAR) |
SliceCommander:PlayCDSound(BAR) |
end |
return |
end |
end |
function SliceCommander:HideBar(BAR) |
if BAR['obj'].anim:IsPlaying() then |
BAR['obj'].anim:Stop() |
end |
BAR['expire'] = 0 |
BAR['obj']:Hide() |
BAR['obj'].text:SetText("") |
value1, value2, value3 = 0 , 0, 0 |
local last = BAR['expire'] |
if BAR['type'] == 1 then |
_, icon, count, _, duration, expire, unitCaster, _, _, _, _, _, _, _, _, value1, value2, value3 = SliceCommander:UnitAura("player", BAR['id'], "HELPFUL 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, expire, unitCaster = SliceCommander:UnitAura("target", BAR['id'], "HARMFUL PLAYER") |
_, icon, count, _, duration, BAR['expire'], unitCaster = SliceCommander:UnitAura("target", BAR['id'], "HARMFUL PLAYER") |
elseif BAR['type'] == 3 then |
_, icon, count, _, duration, expire, unitCaster = SliceCommander:UnitAura("player", 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 |
expire = last |
BAR['expire'] = last |
end |
if expire == nil then |
expire = 0 |
if BAR['expire'] == nil then |
BAR['expire'] = 0 |
end |
if SC.tNow == nil then |
SC.tNow = GetTime() |
end |
if expire > 0 and SC.tNow < expire then |
x = expire - SC.tNow |
if BAR['expire'] > 0 and SC.tNow < BAR['expire'] then |
x = BAR['expire'] - SC.tNow |
else |
x = 0 |
end |
if x > 0 then |
BAR['expire'] = expire |
local xlast = SliceCommander:ShowBar(BAR, duration, icon) |
local textcount = '' |
BAR['obj']:SetValue(x) |
BAR['obj'].text:SetText(string.format("%0.1f", x)) |
SliceCommander:Tick(BAR, x) |
SliceCommander:Pandemic(BAR, x) |
SliceCommander:SoundBar(BAR, x, xlast) |
else |
if SC.SET.flash[spell] == true and UnitAffectingCombat("player") then |
if not BAR['obj'].anim:IsPlaying() then |
BAR['obj']:SetValue(500) |
BAR['obj'].text:SetText('') |
if BAR['expire'] ~= -1 then |
BAR['expire'] = -1 |
if BAR['obj']:IsVisible() then |
SliceCommander:PlaySound(BAR['sound']['expired']) |
end |
end |
if not BAR['obj']:IsVisible() then |
if SC.SET.SpellText == true then |
BAR['obj'].text2:SetText(string.format("%s", BAR['name'])) |
else |
BAR['obj'].text2:SetText('') |
end |
BAR['obj'].icon:SetTexture(SC_SPELL_ICON[spell]) |
BAR['obj']:Show() |
SliceCommander:ChangeAnchor() |
end |
BAR['obj'].anim:Play() |
if BAR['obj']:IsVisible() then |
if BAR['sound'] ~= nil then |
SliceCommander:PlaySound(BAR['sound']['expired']) |
end |
else |
BAR['expire'] = expire |
if BAR['obj']:IsVisible() then |
if BAR['obj'].anim:IsPlaying() then |
BAR['obj'].anim:Stop() |
elseif BAR['sound'] ~= nil then |
SliceCommander:PlaySound(BAR['sound']['expired']) |
end |
SliceCommander:HideBar(BAR) |
end |
SliceCommander:HideBar(BAR) |
end |
end |
end |
end |
function SliceCommander:ShowBar(BAR, duration, icon) |
if not BAR['obj']:IsVisible() or BAR['obj'].anim:IsPlaying() then |
if BAR['obj'].anim:IsPlaying() then |
BAR['obj'].anim:Stop() |
end |
if not BAR['obj']:IsVisible() then |
if BAR['sound'] ~= nil then |
SliceCommander:PlaySound(BAR['sound']['applied']) |
end |
SliceCommander:Pandemic(BAR, x) |
SliceCommander:SoundBar(BAR, x, xlast) |
else |
if SC.SET.flash[spell] == true and UnitAffectingCombat("player") then |
if not BAR['obj'].anim:IsPlaying() then |
BAR['obj']:SetValue(500) |
BAR['obj'].text:SetText('') |
if BAR['expire'] ~= -1 then |
BAR['expire'] = -1 |
if BAR['obj']:IsVisible() then |
SliceCommander:PlaySound(BAR['sound']['expired']) |
end |
end |
if not BAR['obj']:IsVisible() then |
if SC.SET.SpellText == true then |
BAR['obj'].text2:SetText(string.format("%s", BAR['name'])) |
else |
BAR['obj'].text2:SetText('') |
end |
BAR['obj']:Show() |
SliceCommander:ChangeAnchor() |
end |
BAR['obj'].anim:Play() |
if BAR['obj']:IsVisible() then |
if BAR['sound'] ~= nil then |
SliceCommander:PlaySound(BAR['sound']['expired']) |
end |
else |
if BAR['obj']:IsVisible() then |
if BAR['obj'].anim:IsPlaying() then |
BAR['obj'].anim:Stop() |
end |
if BAR['sound'] ~= nil and BAR['expire'] ~= -1 then |
SliceCommander:PlaySound(BAR['sound']['expired']) |
end |
SliceCommander:HideBar(BAR) |
end |
SliceCommander:HideBar(BAR) |
end |
end |
end |
local selected = {} |
local cd |
for k, v in pairs(SC.SET.Pos) do |
if _G['SC'].BARS[string.upper(k)] == nil or _G['SC'].BARS[string.upper(k)]['name'] == nil then |
_G['SC'].SET.Pos[string.upper(k)] = nil--Remove spell |
_G['SC'].BARS[string.upper(k)] = nil |
if string.sub(string.upper(k), -2) == 'CD' then |
cd = ' CD' |
else |
if string.sub(string.upper(k), -2) == 'CD' then |
cd = ' CD' |
cd = '' |
end |
if not selected[v] then |
if _G['SC'].BARS[string.upper(k)] == nil or _G['SC'].BARS[string.upper(k)]['name'] == nil then |
_G['SC'].SET.Pos[string.upper(k)] = nil--Remove removed spell |
_G['SC'].BARS[string.upper(k)] = nil |
else |
cd = '' |
selected[v] = _G['SC'].BARS[string.upper(k)]['name'] .. cd |
end |
if not selected[v] then |
selected[v] = _G['SC'].BARS[string.upper(k)]['name'] .. cd |
else |
selected[v] = selected[v] .. ', ' .. _G['SC'].BARS[string.upper(k)]['name'] .. cd |
end |
else |
selected[v] = selected[v] .. ', ' .. _G['SC'].BARS[string.upper(k)]['name'] .. cd |
end |
end |
for key = -30, 30, 1 do |
} |
end |
function SliceCommander:getFlashSetting(spell) |
return { |
order = SliceCommander:getOrder(), |
name = L["Flash when ready"], |
desc = L["The bar will keep flashing when it should be use."], |
type = "toggle", |
set = function(info,val) |
SC.SET.flash[spell] = val |
end, |
get = function(info) return SC.SET.flash[spell] end |
} |
end |
function SliceCommander:getHeaderSetting(spell) |
return { |
order = SliceCommander:getOrder(), |
function SliceCommander:getSpellSettings(spell) |
local args = { |
header = { |
type = "header", |
order = SliceCommander:getOrder(), |
name = L['Spell'], |
}, |
Show = SliceCommander:getShowSetting(spell), |
Color = SliceCommander:getColorSetting(spell), |
Pos = SliceCommander:getPosSetting(spell), |
Flash = SliceCommander:getFlashSetting(spell) |
} |
if SC.SET.SpellSound ~= nil and SC.SET.SpellSound then |
args.SpellSound = SliceCommander:getSpellSound(spell) |
function SliceCommander:getCDSettings(spell) |
local args = { |
headerCD = { |
type = "header", |
order = SliceCommander:getOrder(), |
name = L['Cooldown'], |
}, |
Show = SliceCommander:getShowSetting(spell), |
Color = SliceCommander:getColorSetting(spell), |
Pos = SliceCommander:getPosSetting(spell), |
CDFlash = SliceCommander:getFlashSetting(spell) |
} |
if SC.SET.SpellSound ~= nil and SC.SET.SpellSound then |
args.CDSpellSound = SliceCommander:getCDSpellSound(spell) |
function SliceCommander:getSpellCDSettings(spell) |
local args = { |
header = { |
type = "header", |
order = SliceCommander:getOrder(), |
name = L['Spell'], |
}, |
Show = SliceCommander:getShowSetting(spell), |
Color = SliceCommander:getColorSetting(spell), |
Pos = SliceCommander:getPosSetting(spell), |
Flash = SliceCommander:getFlashSetting(spell), |
headerCD = { |
type = "header", |
order = SliceCommander:getOrder(), |
name = L['Cooldown'], |
}, |
CDShow = SliceCommander:getShowSetting(spell..'CD'), |
CDColor = SliceCommander:getColorSetting(spell..'CD'), |
CDPos = SliceCommander:getPosSetting(spell..'CD'), |
CDFlash = SliceCommander:getFlashSetting(spell..'CD') |
} |
if SC.SET.SpellSound ~= nil and SC.SET.SpellSound then |
args.SpellSound = SliceCommander:getSpellSound(spell) |
type = "group", |
order = SliceCommander:getOrder(), |
args = { |
headerCD = { |
type = "header", |
order = SliceCommander:getOrder(), |
name = L['Cooldown'], |
}, |
TOTShow = SliceCommander:getShowSetting('TOTCD'), |
TOTColor = SliceCommander:getColorSetting('TOTCD'), |
TOTPos = SliceCommander:getPosSetting('TOTCD'), |
Flash = SliceCommander:getFlashSetting('TOTCD'), |
TOTColor = SliceCommander:getColorSetting('TOTCD'), |
TOTTarget = { |
order = SliceCommander:getOrder(), |
name = L["Taget name"], |
ShowKI = SliceCommander:getShowSetting('KICD'), |
ColorKI = SliceCommander:getColorSetting('KICD'), |
PosKI = SliceCommander:getPosSetting('KICD'), |
Flash = SliceCommander:getFlashSetting('KICD'), |
HeaderKINotification = { |
order = SliceCommander:getOrder(), |
name = L["Warning settings"], |
args = SliceCommander_TableMerge( |
SliceCommander:getSpellCDSettings('RB').args, |
{ |
headerSpecial = { |
type = "header", |
order = SliceCommander:getOrder(), |
name = L['Special settings'], |
}, |
replaceName = { |
order = SliceCommander:getOrder(), |
name = L["Replace spell name with each following spell text"], |
name = SC_SPELL['BF'], |
type = "group", |
args = { |
header = { |
type = "header", |
order = SliceCommander:getOrder(), |
name = L['Spell'], |
}, |
BFShow = SliceCommander:getShowSetting('BF'), |
BFColor = SliceCommander:getColorSetting('BF'), |
BFPos = SliceCommander:getPosSetting('BF'), |
Flash = SliceCommander:getFlashSetting('BF'), |
BFColor = SliceCommander:getColorSetting('BF'), |
BFCDShow = SliceCommander:getShowSetting('BFCD'), |
BFCDPos = SliceCommander:getPosSetting('BFCD'), |
BFCDColor = SliceCommander:getColorSetting('BFCD'), |
BFIcon = { |
order = SliceCommander:getOrder(), |
name = string.format(L["Show %s icon"], SC_SPELL['BF']), |
desc = string.format(L["Display the %s icon when enbale"], SC_SPELL['BF']), |
width = "full", |
type = "toggle", |
set = function(info,val) |
SC.SET.display.BFICON = val |
end, |
get = function(info) return SC.SET.display.BFICON end |
}, |
headerCD = { |
type = "header", |
order = SliceCommander:getOrder(), |
name = L['Cooldown'], |
}, |
BFCDShow = SliceCommander:getShowSetting('BFCD'), |
BFCDColor = SliceCommander:getColorSetting('BFCD'), |
BFCDPos = SliceCommander:getPosSetting('BFCD'), |
FlashCD = SliceCommander:getFlashSetting('BFCD') |
} |
} |
}, |
AR = { |
name = SC_SPELL['AR'], |
type = "group", |
args = { |
header = { |
type = "header", |
order = SliceCommander:getOrder(), |
name = L['Spell'], |
}, |
ARShow = SliceCommander:getShowSetting('AR'), |
ARColor = SliceCommander:getColorSetting('AR'), |
ARPos = SliceCommander:getPosSetting('AR'), |
Flash = SliceCommander:getFlashSetting('AR'), |
ARColor = SliceCommander:getColorSetting('AR'), |
ARCDShow = SliceCommander:getShowSetting('ARCD'), |
ARCDPos = SliceCommander:getPosSetting('ARCD'), |
ARCDColor = SliceCommander:getColorSetting('ARCD'), |
ARMarioMod = { |
order = SliceCommander:getOrder(), |
name = L["Enable Mario mod"], |
SC.SET.ARMarioMod = val |
end, |
get = function(info) return SC.SET.ARMarioMod end |
}, |
headerCD = { |
type = "header", |
order = SliceCommander:getOrder(), |
name = L['Cooldown'], |
}, |
ARCDShow = SliceCommander:getShowSetting('ARCD'), |
ARCDColor = SliceCommander:getColorSetting('ARCD'), |
ARCDPos = SliceCommander:getPosSetting('ARCD'), |
FlashCD = SliceCommander:getFlashSetting('ARCD') |
} |
} |
}, |
BE = SliceCommander:getSpellCDSettings('BE'), |
name = SC_SPELL['FOTD'], |
type = "group", |
args = { |
header = { |
type = "header", |
order = SliceCommander:getOrder(), |
name = L['Spell'], |
}, |
Show = SliceCommander:getShowSetting('FOTD'), |
Pos = SliceCommander:getPosSetting('FOTD'), |
Color = SliceCommander:getColorSetting('FOTD'), |
Flash = SliceCommander:getFlashSetting('FOTD'), |
Icon = {--Shadow of the destroyer icon |
order = SliceCommander:getOrder(), |
name = string.format(L["%s icon"], SC_SPELL['SOTD']), |
for i,v in pairs(SC.BARS) do |
if i ~= "CP" then |
SC.BARS[i].obj = SliceCommander:NewFrame(v.color, i) |
SC.BARS[i].obj = SliceCommander:NewFrame(v.color) |
end |
end |
end |
end |
function SliceCommander:FlashSpells(Spells) |
for i, v in ipairs(Spells) do |
if SC.SET.flash[v] == nil then |
SC.SET.flash[v] = true |
end |
end |
end |
function SliceCommander:NotFlashSpells(Spells) |
for i, v in ipairs(Spells) do |
if SC.SET.flash[v] == nil then |
SC.SET.flash[v] = false |
end |
end |
end |
function SliceCommander:OrderSpells(Spells) |
for i, v in pairs(Spells) do |
_G['SC'].orderBar = _G['SC'].orderBar+1 |
end |
function SliceCommander:Global() |
SliceCommander:DisplaySpells({'CP', 'THREAT', 'SND', 'CS', 'KS', 'KSCD', 'FOTD', 'CV', 'CVCD', 'TOTCD', 'FE', 'SSCD', 'SUB', 'CDCD', 'AC', 'MDCD', 'DFACD', 'Poison', 'SOTD', 'MAI', 'FECD', 'ESSECD', 'DPICON'}) |
SliceCommander:DisplaySpells({'CP', 'THREAT', 'CS', 'KS', 'KSCD', 'FOTD', 'CV', 'CVCD', 'TOTCD', 'FE', 'SSCD', 'SUB', 'CDCD', 'AC', 'MDCD', 'DFACD', 'Poison', 'SOTD', 'MAI', 'FECD', 'ESSECD', 'DPICON'}) |
SliceCommander:NotDisplaySpells({'HEALTH', 'THEALTH', 'VANCD', 'KICD', 'COS', 'COSCD', 'EVA', 'EVACD', 'SPR', 'SPRCD', 'SS'}) |
SliceCommander:FlashSpells({'SND'}) |
SliceCommander:NotFlashSpells({'KSCD', 'CVCD', 'TOTCD', 'SSCD', 'CDCD', 'MDCD', 'DFACD', 'FECD', 'ESSECD', 'VANCD', 'KICD', 'COSCD', 'EVACD', 'SPRCD'}) |
_G['SC'].orderBar = _G['SC'].maxPos |
_G['SC'].orderCDBar = _G['SC'].maxCDPos |
SC.SET.Pos.CP = -1 |
end |
SliceCommander:OrderSpells({'SND', 'FOTD', 'CV', 'FE', 'SUB', 'AC', 'MAI', 'COS', 'EVA', 'SPR', 'SS'}) |
SliceCommander:OrderSpells({'FOTD', 'CV', 'FE', 'SUB', 'AC', 'MAI', 'COS', 'EVA', 'SPR', 'SS'}) |
SliceCommander:OrderCDs({'CVCD', 'TOTCD', 'VANCD', 'SSCD', 'CDCD', 'MDCD', 'DFACD', 'THREAT', 'HEALTH', 'THEALTH', 'CS', 'KS', 'KSCD', 'KICD', 'COSCD', 'EVACD', 'SPRCD', 'FECD', 'ESSECD'}) |
end |
function SliceCommander:Assassination() |
SliceCommander:DisplaySpells({'RUP', 'GAR', 'GARCD', 'VEN', 'VENCD', 'ENV', 'EP', 'DPBUT', 'EXCD', 'KB', 'KBCD', 'BA', 'ST', 'TXB', 'TXBCD', 'BLS', 'MA', 'CT'}) |
SliceCommander:NotDisplaySpells({'DP'}) |
SliceCommander:FlashSpells({'VENCD', 'EXCD'}) |
SliceCommander:NotFlashSpells({'GARCD', 'EXCD', 'KBCD', 'TXBCD'}) |
_G['SC'].orderBar = 0 |
_G['SC'].orderCDBar = -1 |
end |
function SliceCommander:Outlaw() |
SliceCommander:DisplaySpells({'RB', 'AR', 'ARCD', 'CDB', 'CDBCD', 'KSPCD', 'GS', 'GHCD', 'BE', 'BECD', 'BF', 'BFCD', 'OP', 'GSWW', 'BB', 'LD', 'GSCD', 'BRCD', 'RBCD'}) |
SliceCommander:DisplaySpells({'SND', 'RB', 'AR', 'ARCD', 'CDB', 'CDBCD', 'KSPCD', 'GS', 'GHCD', 'BE', 'BECD', 'BF', 'BFCD', 'OP', 'GSWW', 'BB', 'LD', 'GSCD', 'BRCD', 'RBCD'}) |
SliceCommander:NotDisplaySpells({'BFICON', 'GG', 'GGCD'}) |
SliceCommander:FlashSpells({'ARCD', 'CDBCD', 'KSPCD', 'BECD', 'BRCD', 'RBCD'}) |
SliceCommander:NotFlashSpells({'GHCD', 'BFCD', 'GSCD'}) |
_G['SC'].orderBar = 0 |
_G['SC'].orderCDBar = -1 |
SliceCommander:OrderSpells({'RB', 'AR', 'GS', 'OP', 'CDB', 'GSWW', 'BF', 'LD'}) |
SliceCommander:OrderSpells({'SND', 'RB', 'AR', 'GS', 'OP', 'CDB', 'GSWW', 'BF', 'LD'}) |
SliceCommander:OrderCDs({'BECD', 'BE', 'ARCD', 'BFCD', 'KSPCD', 'GHCD', 'CDBCD', 'GSCD', 'BRCD', 'GG', 'GGCD', 'RBCD'}) |
end |
function SliceCommander:Subtlety() |
SliceCommander:DisplaySpells({'SD', 'SDCD', 'SB', 'SBCD', 'NB', 'SOD', 'GB', 'GBCD', 'SODCD', 'SHT', 'SHTCD', 'STHCD'}) |
SliceCommander:NotDisplaySpells({'FW'}) |
SliceCommander:FlashSpells({'SDCD', 'SBCD', 'SODCD'}) |
SliceCommander:NotFlashSpells({'GBCD', 'SHTCD', 'STHCD'}) |
_G['SC'].orderBar = 0 |
_G['SC'].orderCDBar = -1 |
if SC.SET == nil or SC.SET.display == nil or SC.SET.Pos == nil then |
SC.SET = { display = {}, Pos = {} } |
end |
if SC.SET.flash == nil then |
SC.SET.flash = {} |
end |
if _G['SC'].SET.PixelPerfect == nil then |
_G['SC'].SET.PixelPerfect = true |
end |
local Smoother = LibStub("LibSmoothStatusBar-1.0") |
local Glower = LibStub("LibCustomGlow-1.0") |
function SliceCommander:NewFrame(color) |
local f = CreateFrame("StatusBar", nil, UIParent, BackdropTemplateMixin and "BackdropTemplate") |
function SliceCommander:NewFrame(color, name) |
local f = CreateFrame("StatusBar", 'SliceCommander_bar_' .. name, UIParent, BackdropTemplateMixin and "BackdropTemplate") |
--Mixin(f, "Region") |
Smoother:SmoothBar(f) |
f:SetStatusBarTexture(SliceCommander:BarTexture()) |
f:SetValue(0) |
f:SetDefaultBackdrop() |
f:SetStatusBarColor(unpack(color)) |
f.border = SliceCommander:tukSkin(f, false) |
f.iconBorder = SliceCommander:tukSkin(f, f.icon) |
local animPlaying = false |
--Animation (Blink) |
f.animFade = f:CreateAnimationGroup() |
f.animFade:SetLooping('BOUNCE') |
local animOut = f.animFade:CreateAnimation("Alpha") |
animOut:SetFromAlpha(1) |
animOut:SetToAlpha(.3) |
animOut:SetDuration(.4) |
animOut:SetSmoothing("OUT") |
animOut:SetOrder(1) |
--Animation (Glow) |
--local animFrame = CreateFrame("Frame", nil, UIParent, BackdropTemplateMixin and "BackdropTemplate") |
--animFrame:SetAllPoints(f) |
f.anim = { |
Play = function() |
animPlaying = true |
Glower.PixelGlow_Start(f) |
f.animFade:Play() |
end, |
Stop = function() |
animPlaying = false |
Glower.PixelGlow_Stop(f) |
f.animFade:Stop() |
end, |
IsPlaying = function() |
return animPlaying |
end |
} |
return f |
end |
function SliceCommander:ThinBar(point, relativePoint, x, y) |
local f = CreateFrame("StatusBar", nil, UIParent, BackdropTemplateMixin and "BackdropTemplate") |
Smoother:SmoothBar(f) |
f:SCHeight(2) |
f:SetFrameLevel(2) |
f:SetStatusBarTexture(SliceCommander:BarTexture()) |
end |
function SliceCommander:CreateEnergyFrame() |
local f = CreateFrame('StatusBar', 'VTimerEnergy', UIParent, BackdropTemplateMixin and "BackdropTemplate") |
Smoother:SmoothBar(f) |
f:SCSize(200, 20) |
f:SetMinMaxValues(0,100) |
f:SCPoint('CENTER', SliceCommanderFrame, 'CENTER', 0, 0) |
f:SetFrameLevel(1) |
f:SetMinMaxValues(0,UnitPowerMax("player", Enum.PowerType.Energy)) |
f:SetDefaultBackdrop() |
f:SetBackdropBorderColor(unpack(SC.V.wColor)) |
f:SetBackdropColor(unpack({.1,.1,.1,.7})) |
f:SetStatusBarTexture(SliceCommander:BarTexture()) |
f:SetFrameStrata("MEDIUM") |
f:SetFrameLevel(1) |
f:SetStatusBarColor(unpack(SC.SET.energyColor)) |
f.border = SliceCommander:tukSkin(f, false) |
CreateFrame('StatusBar', 'VTimerEnergy', UIParent, BackdropTemplateMixin and "BackdropTemplate") |
VTimerEnergy:SCSize(200, 20) |
VTimerEnergy:SetMinMaxValues(0,100) |
VTimerEnergy:SCPoint('CENTER', SliceCommanderFrame, 'CENTER', 0, 0) |
VTimerEnergy:SetFrameLevel(1) |
VTimerEnergy:SetMinMaxValues(0,UnitPowerMax("player", Enum.PowerType.Energy)) |
VTimerEnergy:SetDefaultBackdrop() |
VTimerEnergy:SetBackdropBorderColor(unpack(SC.V.wColor)) |
VTimerEnergy:SetBackdropColor(unpack({.1,.1,.1,.7})) |
VTimerEnergy:SetStatusBarTexture(SliceCommander:BarTexture()) |
VTimerEnergy:SetFrameStrata("MEDIUM") |
VTimerEnergy:SetFrameLevel(1) |
VTimerEnergy:SetStatusBarColor(unpack(SC.SET.energyColor)) |
VTimerEnergy.border = SliceCommander:tukSkin(VTimerEnergy, false) |
if SC.SET.HideEnergy then |
f:Hide() |
VTimerEnergy:Hide() |
else |
f:Show() |
VTimerEnergy:Show() |
end |
f.txt = f:CreateFontString('VTimerEnergyTxt', 'OVERLAY', GameFontWhite) |
f.txt:SetJustifyH("RIGHT") |
f.txt:SCSize(49, 20) |
f.txt:SCPoint('RIGHT', VTimerEnergy, 'RIGHT', -5, 0) |
f.txt:SetFontObject(SliceCommander:NewFont("VTimerFont", 17, 0.7, 1, 1, 1)) |
VTimerEnergy:CreateFontString('VTimerEnergyTxt', 'OVERLAY', GameFontWhite) |
VTimerEnergyTxt:SetJustifyH("RIGHT") |
VTimerEnergyTxt:SCSize(49, 20) |
VTimerEnergyTxt:SCPoint('RIGHT', VTimerEnergy, 'RIGHT', -5, 0) |
VTimerEnergyTxt:SetFontObject(SliceCommander:NewFont("VTimerFont", 17, 0.7, 1, 1, 1)) |
end |
function SliceCommander:CreateComboText() |
--[[ $Id: AceGUIWidget-DropDown.lua 1239 2020-09-20 10:22:02Z nevcairiel $ ]]-- |
--[[ $Id: AceGUIWidget-DropDown.lua 1237 2020-07-17 22:50:38Z nevcairiel $ ]]-- |
local AceGUI = LibStub("AceGUI-3.0") |
-- Lua APIs |
do |
local widgetType = "Dropdown-Pullout" |
local widgetVersion = 5 |
local widgetVersion = 4 |
--[[ Static data ]]-- |
local height = 8 |
for i, item in pairs(items) do |
item:SetPoint("TOP", itemFrame, "TOP", 0, -2 + (i - 1) * -16) |
if i == 1 then |
item:SetPoint("TOP", itemFrame, "TOP", 0, -2) |
else |
item:SetPoint("TOP", items[i-1].frame, "BOTTOM", 0, 1) |
end |
item:Show() |
height = height + 16 |
## Interface: 90001 |
## Author: Tomate |
## Version: 9.02 |
## Version: 9.01 |
## Title: |cffc14f2cSlice|r|cff40a740Commander|r |
## Notes: Energy bar, Combo point bar and rogue timer bar. |
## SavedVariables: SC |
<Include file="Libs\AceLocale-3.0\AceLocale-3.0.xml"/> |
<Include file="Libs\AceHook-3.0\AceHook-3.0.xml"/> |
<Include file="Libs\AceGUI-3.0-SharedMediaWidgets\widget.xml"/> |
<Include file="Libs\LibCustomGlow-1.0\LibCustomGlow-1.0.xml"/> |
<Include file="Libs\LibSmoothStatusBar-1.0\LibSmoothStatusBar-1.0.xml"/> |
</Ui> |
L["CD Sound"] = true |
L["On cooldown"] = true |
L["Alert when the spell is ready to be used"] = true |
L["Azerite Essence"] = true |
L["Spell"] = true |
L["Flash when ready"] = true |
L["The bar will keep flashing when it should be use."] = true |
L["Cooldown"] = true |
L["Special settings"] = true |
L["CD Sound"] = "CD Sound" |
L["On cooldown"] = "On cooldown" |
L["Alert when the spell is ready to be used"] = "Alert when the spell is ready to be used" |
L["Azerite Essence"] = "Azerite Essence" |
L["Spell"] = "Spell" |
L["Flash when ready"] = "Flash when ready" |
L["The bar will keep flashing when it should be use."] = "The bar will keep flashing when it should be use." |
L["Cooldown"] = "Cooldown" |
L["Special settings"] = "Special settings" |
L["CD Sound"] = true |
L["On cooldown"] = true |
L["Alert when the spell is ready to be used"] = true |
L["Azerite Essence"] = true |
L["Spell"] = true |
L["Flash when ready"] = true |
L["The bar will keep flashing when it should be use."] = true |
L["Cooldown"] = true |
L["Special settings"] = true |
L["CD Sound"] = "Son du CD" |
L["On cooldown"] = "Au rechargement" |
L["Alert when the spell is ready to be used"] = "Alerte quand le sort est près à être utilisé" |
L["Azerite Essence"] = "Essence d'Azérite" |
L["Spell"] = "Technique" |
L["Flash when ready"] = "Flash quand disponible" |
L["The bar will keep flashing when it should be use."] = "La barre clignotera lorsque la technique devrait être utilisée." |
L["Cooldown"] = "Cooldown" |
L["Special settings"] = "Options spéciales" |
SC_SPELL = {} |
SC_SPELL_ICON = {} |
--GLOBAL |
for k, v in pairs(SC_SPELLID) do |
if tonumber(v) ~= nil then |
SC_SPELL[k], _, SC_SPELL_ICON[k] = GetSpellInfo(v) |
SC_SPELL[k] = GetSpellInfo(v) |
else |
SC_SPELL[k] = v |
end |
L["CD Sound"] = "CD Sound" |
L["On cooldown"] = "On cooldown" |
L["Alert when the spell is ready to be used"] = "Alert when the spell is ready to be used" |
L["Azerite Essence"] = "Azerite Essence" |
L["Spell"] = "Spell" |
L["Flash when ready"] = "Flash when ready" |
L["The bar will keep flashing when it should be use."] = "The bar will keep flashing when it should be use." |
L["Cooldown"] = "Cooldown" |
L["Special settings"] = "Special settings" |
L["CD Sound"] = "CD Sound" |
L["On cooldown"] = "On cooldown" |
L["Alert when the spell is ready to be used"] = "Alert when the spell is ready to be used" |
L["Azerite Essence"] = "Azerite Essence" |
L["Spell"] = "Spell" |
L["Flash when ready"] = "Flash when ready" |
L["The bar will keep flashing when it should be use."] = "The bar will keep flashing when it should be use." |
L["Cooldown"] = "Cooldown" |
L["Special settings"] = "Special settings" |