-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also fixed line endings to Unix
- Loading branch information
Joao Cardoso
committed
Nov 11, 2016
1 parent
c1f5383
commit 1a3d77e
Showing
30 changed files
with
1,241 additions
and
1,241 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
## Interface: 70100 | ||
## Title: |cffE32929OmniCC|r | ||
## Notes: Cooldown count for everything | ||
## Notes-koKR: 모든 것을 위한 쿨다운 카운트 | ||
## Author: Tuller | ||
## Version: 7.1.0 | ||
## SavedVariables: OmniCC4Config | ||
|
||
libs\libs.xml | ||
localization\localization.xml | ||
|
||
main.lua | ||
|
||
core\core.xml | ||
settings\settings.xml | ||
engines\engines.xml | ||
effects\effects.xml | ||
## Interface: 70100 | ||
## Title: |cffE32929OmniCC|r | ||
## Notes: Cooldown count for everything | ||
## Notes-koKR: 모든 것을 위한 쿨다운 카운트 | ||
## Author: Tuller | ||
## Version: 7.1.0 | ||
## SavedVariables: OmniCC4Config | ||
|
||
libs\libs.xml | ||
localization\localization.xml | ||
|
||
main.lua | ||
|
||
core\core.xml | ||
settings\settings.xml | ||
engines\engines.xml | ||
effects\effects.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,46 @@ | ||
--[[ | ||
actions.lua | ||
Handles action buttons specific behaviour | ||
--]] | ||
|
||
local Actions = OmniCC:New('Actions', {visible = {}}) | ||
local Cooldown = OmniCC.Cooldown | ||
|
||
|
||
--[[ API ]]-- | ||
|
||
function Actions:AddDefaults() | ||
for i, button in pairs(ActionBarButtonEventsFrame.frames) do | ||
self:Add(button.action, button.cooldown) | ||
end | ||
end | ||
|
||
function Actions:Add(action, cooldown) | ||
cooldown.omniccAction = action | ||
|
||
if not cooldown.omnicc then | ||
cooldown:HookScript('OnShow', Actions.OnShow) | ||
cooldown:HookScript('OnHide', Actions.OnHide) | ||
Cooldown.Setup(cooldown) | ||
end | ||
end | ||
|
||
function Actions:Update() | ||
for cooldown in pairs(self.visible) do | ||
local start, duration = GetActionCooldown(cooldown.omniccAction) | ||
local charges = GetActionCharges(cooldown.omniccAction) | ||
|
||
Cooldown.Start(cooldown, start, duration, charges) | ||
end | ||
end | ||
|
||
|
||
--[[ Events ]]-- | ||
|
||
function Actions:OnShow() | ||
Actions.visible[self] = true | ||
end | ||
|
||
function Actions:OnHide() | ||
Actions.visible[self] = nil | ||
--[[ | ||
actions.lua | ||
Handles action buttons specific behaviour | ||
--]] | ||
|
||
local Actions = OmniCC:New('Actions', {visible = {}}) | ||
local Cooldown = OmniCC.Cooldown | ||
|
||
|
||
--[[ API ]]-- | ||
|
||
function Actions:AddDefaults() | ||
for i, button in pairs(ActionBarButtonEventsFrame.frames) do | ||
self:Add(button.action, button.cooldown) | ||
end | ||
end | ||
|
||
function Actions:Add(action, cooldown) | ||
cooldown.omniccAction = action | ||
|
||
if not cooldown.omnicc then | ||
cooldown:HookScript('OnShow', Actions.OnShow) | ||
cooldown:HookScript('OnHide', Actions.OnHide) | ||
Cooldown.Setup(cooldown) | ||
end | ||
end | ||
|
||
function Actions:Update() | ||
for cooldown in pairs(self.visible) do | ||
local start, duration = GetActionCooldown(cooldown.omniccAction) | ||
local charges = GetActionCharges(cooldown.omniccAction) | ||
|
||
Cooldown.Start(cooldown, start, duration, charges) | ||
end | ||
end | ||
|
||
|
||
--[[ Events ]]-- | ||
|
||
function Actions:OnShow() | ||
Actions.visible[self] = true | ||
end | ||
|
||
function Actions:OnHide() | ||
Actions.visible[self] = nil | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,108 +1,108 @@ | ||
--[[ | ||
cooldown.lua | ||
Manages the cooldowns need for timers | ||
--]] | ||
|
||
local Cooldown = OmniCC:New('Cooldown') | ||
|
||
|
||
--[[ Control ]]-- | ||
|
||
function Cooldown:Start(...) | ||
Cooldown.UpdateAlpha(self) | ||
|
||
if Cooldown.CanShow(self, ...) then | ||
Cooldown.Setup(self) | ||
self.omnicc:Start(...) | ||
else | ||
Cooldown.Stop(self) | ||
end | ||
end | ||
|
||
function Cooldown:Setup() | ||
if not self.omnicc then | ||
self:HookScript('OnShow', Cooldown.OnShow) | ||
self:HookScript('OnHide', Cooldown.OnHide) | ||
self:HookScript('OnSizeChanged', Cooldown.OnSizeChanged) | ||
self.omnicc = OmniCC.Timer:New(self) | ||
end | ||
|
||
OmniCC:SetupEffect(self) | ||
end | ||
|
||
function Cooldown:Stop() | ||
local timer = self.omnicc | ||
if timer and timer.enabled then | ||
timer:Stop() | ||
end | ||
end | ||
|
||
function Cooldown:CanShow(start, duration) | ||
if not self.noCooldownCount and duration and start and start > 0 then | ||
local sets = OmniCC:GetGroupSettingsFor(self) | ||
if duration >= sets.minDuration and sets.enabled then | ||
local globalstart, globalduration = GetSpellCooldown(61304) | ||
return start ~= globalstart or duration ~= globalduration | ||
end | ||
end | ||
end | ||
|
||
|
||
--[[ Frame Events ]]-- | ||
|
||
function Cooldown:OnShow() | ||
local timer = self.omnicc | ||
if timer and timer.enabled then | ||
if timer:GetRemain() > 0 then | ||
timer.visible = true | ||
timer:UpdateShown() | ||
else | ||
timer:Stop() | ||
end | ||
end | ||
end | ||
|
||
function Cooldown:OnHide() | ||
local timer = self.omnicc | ||
if timer and timer.enabled then | ||
timer.visible = nil | ||
timer:Hide() | ||
end | ||
end | ||
|
||
function Cooldown:OnSizeChanged(width, ...) | ||
if self.omniWidth ~= width then | ||
self.omniWidth = width | ||
|
||
local timer = self.omnicc | ||
if timer then | ||
timer:UpdateFontSize(width, ...) | ||
end | ||
end | ||
end | ||
|
||
function Cooldown:OnColorSet(...) | ||
if not self.omniTask then | ||
self.omniR, self.omniG, self.omniB, self.omniA = ... | ||
Cooldown.UpdateAlpha(self) | ||
end | ||
end | ||
|
||
|
||
--[[ Misc ]]-- | ||
|
||
function Cooldown:UpdateAlpha() | ||
local alpha = OmniCC:GetGroupSettingsFor(self).spiralOpacity * (self.omniA or 1) | ||
|
||
self.omniTask = true | ||
OmniCC.Meta.SetSwipeColor(self, self.omniR or 0, self.omniG or 0, self.omniB or 0, alpha) | ||
self.omniTask = nil | ||
end | ||
|
||
function Cooldown:ForAll(func, ...) | ||
func = self[func] | ||
|
||
for cooldown in pairs(OmniCC.Cache) do | ||
func(cooldown, ...) | ||
end | ||
--[[ | ||
cooldown.lua | ||
Manages the cooldowns need for timers | ||
--]] | ||
|
||
local Cooldown = OmniCC:New('Cooldown') | ||
|
||
|
||
--[[ Control ]]-- | ||
|
||
function Cooldown:Start(...) | ||
Cooldown.UpdateAlpha(self) | ||
|
||
if Cooldown.CanShow(self, ...) then | ||
Cooldown.Setup(self) | ||
self.omnicc:Start(...) | ||
else | ||
Cooldown.Stop(self) | ||
end | ||
end | ||
|
||
function Cooldown:Setup() | ||
if not self.omnicc then | ||
self:HookScript('OnShow', Cooldown.OnShow) | ||
self:HookScript('OnHide', Cooldown.OnHide) | ||
self:HookScript('OnSizeChanged', Cooldown.OnSizeChanged) | ||
self.omnicc = OmniCC.Timer:New(self) | ||
end | ||
|
||
OmniCC:SetupEffect(self) | ||
end | ||
|
||
function Cooldown:Stop() | ||
local timer = self.omnicc | ||
if timer and timer.enabled then | ||
timer:Stop() | ||
end | ||
end | ||
|
||
function Cooldown:CanShow(start, duration) | ||
if not self.noCooldownCount and duration and start and start > 0 then | ||
local sets = OmniCC:GetGroupSettingsFor(self) | ||
if duration >= sets.minDuration and sets.enabled then | ||
local globalstart, globalduration = GetSpellCooldown(61304) | ||
return start ~= globalstart or duration ~= globalduration | ||
end | ||
end | ||
end | ||
|
||
|
||
--[[ Frame Events ]]-- | ||
|
||
function Cooldown:OnShow() | ||
local timer = self.omnicc | ||
if timer and timer.enabled then | ||
if timer:GetRemain() > 0 then | ||
timer.visible = true | ||
timer:UpdateShown() | ||
else | ||
timer:Stop() | ||
end | ||
end | ||
end | ||
|
||
function Cooldown:OnHide() | ||
local timer = self.omnicc | ||
if timer and timer.enabled then | ||
timer.visible = nil | ||
timer:Hide() | ||
end | ||
end | ||
|
||
function Cooldown:OnSizeChanged(width, ...) | ||
if self.omniWidth ~= width then | ||
self.omniWidth = width | ||
|
||
local timer = self.omnicc | ||
if timer then | ||
timer:UpdateFontSize(width, ...) | ||
end | ||
end | ||
end | ||
|
||
function Cooldown:OnColorSet(...) | ||
if not self.omniTask then | ||
self.omniR, self.omniG, self.omniB, self.omniA = ... | ||
Cooldown.UpdateAlpha(self) | ||
end | ||
end | ||
|
||
|
||
--[[ Misc ]]-- | ||
|
||
function Cooldown:UpdateAlpha() | ||
local alpha = OmniCC:GetGroupSettingsFor(self).spiralOpacity * (self.omniA or 1) | ||
|
||
self.omniTask = true | ||
OmniCC.Meta.SetSwipeColor(self, self.omniR or 0, self.omniG or 0, self.omniB or 0, alpha) | ||
self.omniTask = nil | ||
end | ||
|
||
function Cooldown:ForAll(func, ...) | ||
func = self[func] | ||
|
||
for cooldown in pairs(OmniCC.Cache) do | ||
func(cooldown, ...) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<Ui xmlns="http://www.blizzard.com/wow/ui/"> | ||
<Script file="timer.lua"/> | ||
<Script file="cooldown.lua"/> | ||
<Script file="actions.lua"/> | ||
<Ui xmlns="http://www.blizzard.com/wow/ui/"> | ||
<Script file="timer.lua"/> | ||
<Script file="cooldown.lua"/> | ||
<Script file="actions.lua"/> | ||
</Ui> |
Oops, something went wrong.