Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions BearCastBar.toc → BearCastBar/BearCastBar.toc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## Interface: 11200
## Title: Bear Cast Bar 1.1
## Notes: Replaces default cast bar. Latency spell cancel support. Attack timers.
## Notes-ruRU: Заменяет панель произнесения. Поддержка задержки заклинаний. Таймеры атаки.
## Author: Kuroneko
## OptionalDeps:
## SavedVariables:
## SavedVariablesPerCharacter: BCB_SAVED
addon.lua
attackbar.xml
## Interface: 11200
## Title: Bear Cast Bar 1.2
## Notes: Replaces default cast bar. Latency spell cancel support. Attack timers.
## Notes-ruRU: Заменяет панель произнесения. Поддержка задержки заклинаний. Таймеры атаки.
## Author: Kuroneko
## OptionalDeps:
## SavedVariables:
## SavedVariablesPerCharacter: BCB_SAVED
addon.lua
attackbar.xml
localization.lua
58 changes: 42 additions & 16 deletions addon.lua → BearCastBar/addon.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SLASH_BCB1, SLASH_BCB2 = '/bcb', '/bear';

local bcb = {}
bcb = {}
local oldUseAction
local safeZone= 0.1
local barHeight = 28
Expand Down Expand Up @@ -162,6 +162,7 @@ function bcb:ADDON_LOADED(name)
BCB_SAVED.debug = false
BCB_SAVED.abar_is_enabled = true
BCB_SAVED.hunter_is_enabled = true
BCB_SAVED.castbar_is_enabled = true

bcb.debug("Variable load failed. Using defaults.")
end
Expand Down Expand Up @@ -209,25 +210,32 @@ function bcb:ADDON_LOADED(name)
if(BCB_SAVED.hunter_is_enabled == nil) then
BCB_SAVED.hunter_is_enabled = true
end

if( BCB_SAVED.castbar_is_enabled == nil) then
BCB_SAVED.castbar_is_enabled = true
end


end
end

function bcb:PLAYER_ENTERING_WORLD()
this:RegisterEvent("SPELLCAST_START")
this:RegisterEvent("SPELLCAST_CHANNEL_START")
this:RegisterEvent("SPELLCAST_CHANNEL_STOP")
this:RegisterEvent("SPELLCAST_CHANNEL_UPDATE")
this:RegisterEvent("SPELLCAST_STOP")
this:RegisterEvent("SPELLCAST_DELAYED")
this:RegisterEvent("SPELLCAST_INTERRUPTED")--CHAT_MSG_SPELL_FAILED_LOCALPLAYER --SPELLCAST_CHANNEL_START
this:RegisterEvent("CHAT_MSG_SPELL_FAILED_LOCALPLAYER")

this:UnregisterEvent("PLAYER_ENTERING_WORLD")
if (BCB_SAVED.castbar_is_enabled) then
this:RegisterEvent("SPELLCAST_START")
this:RegisterEvent("SPELLCAST_CHANNEL_START")
this:RegisterEvent("SPELLCAST_CHANNEL_STOP")
this:RegisterEvent("SPELLCAST_CHANNEL_UPDATE")
this:RegisterEvent("SPELLCAST_STOP")
this:RegisterEvent("SPELLCAST_DELAYED")
this:RegisterEvent("SPELLCAST_INTERRUPTED")--CHAT_MSG_SPELL_FAILED_LOCALPLAYER --SPELLCAST_CHANNEL_START
this:RegisterEvent("CHAT_MSG_SPELL_FAILED_LOCALPLAYER")

CastingBarFrame:Hide()
CastingBarFrame:UnregisterAllEvents()
end

CastingBarFrame:Hide()
CastingBarFrame:UnregisterAllEvents()
this:UnregisterEvent("PLAYER_ENTERING_WORLD")

--- config frame

Expand Down Expand Up @@ -556,11 +564,30 @@ function bcb:PLAYER_ENTERING_WORLD()
end
end)

self.configFrame.attackBarConfigFrame.CastBar = CreateFrame("CheckButton", "bcb_GlobalCheckbox_CastBar", self.configFrame.attackBarConfigFrame, "UICheckButtonTemplate");
self.configFrame.attackBarConfigFrame.CastBar:SetPoint("TOPLEFT",self.configFrame.attackBarConfigFrame, 10, -125)
bcb_GlobalCheckbox_CastBarText:SetText(L["Cast bar enabled"])

if (BCB_SAVED.castbar_is_enabled == true) then
self.configFrame.attackBarConfigFrame.CastBar:SetChecked(true)
end

self.configFrame.attackBarConfigFrame.CastBar:SetScript("OnClick", function()

if self.configFrame.attackBarConfigFrame.CastBar:GetChecked() then
-- enable bar
SlashCmdList["ATKBAR"]("caston");
else
-- disable bar
SlashCmdList["ATKBAR"]("castoff")
end
end)



-----------------------
--- CAST BAR ---
-----------------------
-----------------------
--- CAST BAR ---
-----------------------

self.frame:SetWidth(BCB_SAVED.width+8)
self.frame:SetHeight(BCB_SAVED.height+8)
Expand Down Expand Up @@ -672,7 +699,6 @@ function bcb:PLAYER_ENTERING_WORLD()
self.resetLag = false

self.frame:Hide() --debugging

end

function bcb.setHeight(height)
Expand Down
Loading