Download
(19 Kb)
Download
Updated: 09-20-13 10:28 PM
Pictures
File Info
Compatibility:
Siege of Orgrimmar (5.4)
Escalation (5.3)
Thunder Isle (5.2)
Landfall (5.1)
Mists of Pandaria (5.0.4)
Updated:09-20-13 10:28 PM
Created:02-09-09 05:18 PM
Downloads:97,246
Favorites:538
MD5:
5.4
CoolLine  Popular! (More than 5000 hits)
Version: 5.4.001
by: totalpackage [More]
CoolLine is a spell/item cooldown mod that displays icons on a single bar/line to give you an idea of when it will be ready. No statusbar timer and no text timer.

CoolLine is inspired by Forte_Cooldown (a module in the ForteXorcist package). CoolLine is basically a stripped down and standalone version written from scratch. The name comes from putting "cooldown" and "timeline" together (yes, lame).

YouTube Intro

How to Use:
  • Change settings - "/coolline" or check Interface Options -> AddOns
  • Change position and size - unlock to make it draggable and resizable
  • Filter/unfilter a spell or item cooldown - "/coolline Spell Item Name Link"
  • Add more fonts/texture - CoolLine uses LibSharedMedia

External Support:
  • CoolLine.NewCooldown(name, icon, endtime, isplayer)
    • name - unique string id of the cooldown, used as a look-up id
    • icon - string icon path used to display image on the bar
    • endtime - numerical time when the icon should expire, based on GetTime()
    • isplayer - boolean value used to determine if the icon is colored by spell
  • CoolLine.ClearCooldown(unused, name)

Notes:
  • Only one spell/item will be shown in an event that multiple spells/items share the same cooldown (whichever appeared first).
  • By design, icons will often overlap; if you do not like it, this type of cooldown mod is not for you.
  • What you see is what you get. If you like the idea of this mod but want more, I highly suggest checking out ForteXorcist or Ellipsis. I'll most likely ignore requests to make CoolLine more similar to them.
  • CoolLine only does spell/item cooldowns and NOT buff/debuff cooldowns, flight timers, time til enrage, etc; this will NOT change so don't ask.

Recently, I had some requests for donation info, so here it is. Do not feel obligated; donations (or lack of) will not determine what features I do or do not implement.
5.4.001 09/21/2013 - updated for 5.4
5.3.002 06/06/2013 - added options for bar border inset
5.3.001 06/05/2013 - updated for 5.3
5.2.001 04/28/2013 - fix Frost Bomb
5.2.001 03/10/2013 - updated for 5.2
5.1.001 12/08/2012 - updated for 5.1

5.0.004 09/18/2012:
- fix for cooldowns that share the same spell name
- performance fixes

5.0.003 09/11/2012 - workaround for several spells not showing
5.0.002 09/05/2012 - fixed cooldowns for grouped spells (ie. totems)
5.0.001 09/04/2012 - updated for 5.0.4

4.3.002 07/24/2012:
- fix support for priests' Chakra/Holy Word spells
- changed the "1m" tick to "30" seconds
- tweaked refresh rate to be a bit smoother

4.3.001 11/29/2011 - update for 4.3
4.2.001 06/29/2011 - update for 4.2
4.1.001 04/26/2011 - update for 4.1

4.0.003 10/30/2010:
- added workarounds for priests' Archangel and Holy Word spells
- cleaned up options menu

4.0.002 10/18/2010 - fix for long wait times at loading screen
4.0.001 10/12/2010 - 4.0 compat
3.3.003 01/16/2010 - removed "30" tick and added "3" tick
3.3.002 01/11/2010 - added LibSharedMedia-3.0 callback support

3.3.001 12/08/2009:
- updated toc for 3.3
- added option to increase icon size
- added option to reset settings

3.2.005 10/30/2009 - fix an issue where cooldowns refreshed to global cooldown did not update properly (ie. Shield Slam with Sword and Board)

3.2.004 10/07/2009:
- added option to save settings per character
- make death knight rune detection more robust to cooldown changes

3.2.003 09/04/2009:
- allow external access to useful CoolLine functions
- added ConfigMode support

3.2.002 08/04/2009 - fix spell cooldowns triggering when runes are on cooldown

3.2.001 08/04/2009:
- toc to 3.2
- fade icons out a bit faster
- text now have a shadow

3.1.006 07/24/2009:
- switched to a 6-minute time scale instead of 10
- performance tweaks
- added more font size values

3.1.004 05/30/2009:
- icons' alpha now constant
- slightly reduced icon fade time

3.1.003 05/22/2009 - slightly tweaked layout

3.1.002 04/24/2009:
- added an optional visual that lets you know if and where a spell is on cooldown when you attempt to cast it

3.1.001 04/14/2009:
- updated for 3.1
- slightly improved performance

3.0.005 03/25/2009:
- prevent error caused by default variables
- replaced "10m" with "9m" because of the offset and size, bar is still 10m long
- added AddonLoader support, set to "delay" by default

3.0.004 02/22/2009 - several minor performance tweaks

3.0.003 02/14/2009:
- slash command to add/remove filter now accepts spell or item links
- added coloring to distinguish player spell from pet/item cooldowns

3.0.002 02/09/2009 - attempt to make it work with other locales

3.0.001 02/09/2009 - Initial upload
Archived Files (14)
File Name
Version
Size
Author
Date
5.3.002
19kB
totalpackage
06-06-13 05:20 PM
5.3.001
18kB
totalpackage
06-05-13 09:27 PM
5.2.002
18kB
totalpackage
04-28-13 05:07 PM
5.2.001
18kB
totalpackage
03-10-13 04:59 PM
5.1.001
18kB
totalpackage
12-08-12 08:33 AM
5.0.004
18kB
totalpackage
09-18-12 09:10 PM
5.0.003
18kB
totalpackage
09-11-12 07:52 PM
4.3.002
18kB
totalpackage
07-24-12 08:00 PM
4.2.001
16kB
totalpackage
06-29-11 08:08 PM
4.1.001
16kB
totalpackage
04-26-11 06:23 PM
4.0.003
16kB
totalpackage
10-30-10 07:54 PM
3.3.003
16kB
totalpackage
01-16-10 05:51 PM
3.2.005
16kB
totalpackage
10-30-09 03:27 AM
3.1.006
15kB
totalpackage
07-24-09 02:16 PM


Post A Reply Comment Options
Unread 09-11-12, 07:58 PM  
totalpackage
A Fallenroot Satyr
 
totalpackage's Avatar
AddOn Author - Click to view AddOns

Forum posts: 21
File comments: 874
Uploads: 2
Yeah, for some reason, the tooltip appears blank for those rogue abilities. Removing the tooltip check is probably the best solution, which I did in the lastest update. Thanks.
totalpackage is offline Report comment to moderator  
Reply With Quote
Unread 09-11-12, 12:26 PM  
SinaC
A Kobold Labourer
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 5
Uploads: 1
Originally Posted by maneki
Since last update of CL I've been trying to figure out what's going wrong and how to fix it but to no avail yet. It does fine for my mage but not for my rogue.

What does it do?
With my rogue I only can see cooldown icons of adrenaline rush (perfectly works with restless blades), evasion and stuff in bags/hearthstone/trinkets but none of the other class cds like shadowstep, cloak, killing spree, vanish etc.

What did I do to try to make it work as intended?
- deactivated all other addons but CL, didn't help.
- un- and reinstalled CL (incl personal settings) via Curse client, without avail.
- have a friend install CL (to make sure it's not my installation of wow which is to blame), deactivate all other addons on his machine and let him try with his priest and his rogue. Results: priest was fine, some soulword had a wrong icon when first used but had the right one on a second try. His rogue had the same problems as mine, some (same) cds showed up, most did not.
- spent 3 days on figuring out what which line in CL's core.lua-file does
I thought it might have sth to do with messed up spell ids and/or language (german) so I tried to write sth similar to the priest lines in CL's core.lua but didn't work (well, would've been surprised if it did, me noob ) so I put back in the original .lua and...
- tried the workaround of SinacC, still no difference.
- installed ForteXorcist to see if other addons had the same problem but it shows all of my cds. But it is a monster of an addon and I don't want to keep it.

What else can I do? Any advice/suggestions/help is welcome!
I have found where the problem comes from but I cannot fix it.
Most rogue abilities (maybe other classes) are filtered in function CacheBook because they fail the test on CheckRight
If you add following code

Code:
print(tostring(name).."  "..tostring(i).."  "..tostring(btype).."  "..tostring(stype).."  "..tostring(id).."  "..tostring(sb[name]))
print(tostring(CLTipTextRight1 and CLTipTextRight1:GetText() or "nil").."  "..tostring(CLTipTextRight2 and CLTipTextRight2:GetText() or "nil").."  "..tostring(CLTipTextRight3 and CLTipTextRight3:GetText() or "nil").."  "..tostring(CLTipTextRight4 and CLTipTextRight4:GetText() or "nil"))
after
Code:
CLTip:SetSpellBookItem(i, btype)
near the end of the function, you'll see that tooltip are not filled correctly by previous instructions. No tooltip, mean no cooldown timer found in tooltip ==> filtered (not added to valid spell list)
A brutal workaround would be to remove tests on tooltip but it's against the philosophy of this cache
SinaC is offline Report comment to moderator  
Reply With Quote
Unread 09-11-12, 06:39 AM  
maneki
A Kobold Labourer

Forum posts: 0
File comments: 1
Uploads: 0
Since last update of CL I've been trying to figure out what's going wrong and how to fix it but to no avail yet. It does fine for my mage but not for my rogue.

What does it do?
With my rogue I only can see cooldown icons of adrenaline rush (perfectly works with restless blades), evasion and stuff in bags/hearthstone/trinkets but none of the other class cds like shadowstep, cloak, killing spree, vanish etc.

What did I do to try to make it work as intended?
- deactivated all other addons but CL, didn't help.
- un- and reinstalled CL (incl personal settings) via Curse client, without avail.
- have a friend install CL (to make sure it's not my installation of wow which is to blame), deactivate all other addons on his machine and let him try with his priest and his rogue. Results: priest was fine, some soulword had a wrong icon when first used but had the right one on a second try. His rogue had the same problems as mine, some (same) cds showed up, most did not.
- spent 3 days on figuring out what which line in CL's core.lua-file does
I thought it might have sth to do with messed up spell ids and/or language (german) so I tried to write sth similar to the priest lines in CL's core.lua but didn't work (well, would've been surprised if it did, me noob ) so I put back in the original .lua and...
- tried the workaround of SinacC, still no difference.
- installed ForteXorcist to see if other addons had the same problem but it shows all of my cds. But it is a monster of an addon and I don't want to keep it.

What else can I do? Any advice/suggestions/help is welcome!
maneki is offline Report comment to moderator  
Reply With Quote
Unread 09-06-12, 05:22 AM  
SinaC
A Kobold Labourer
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 5
Uploads: 1
Bug + request for ICD

Hi, I've started using this addon as cooldown watcher and I've noticed that some spells doesn't show up even if they are not in blocked list: Thrash and Mangle
I've found a workaround, you have to GetSpellCooldown(name) instead of GetSpellCooldown(id) in CheckSpellBook at core.lua:467

local start, duration, enable = GetSpellCooldown(name) --GetSpellCooldown(id)

No side effects discovered for the moment.

I also have a request, do you think it would be possible to add easily ICD using LibInternalCooldown ?
Last edited by SinaC : 09-10-12 at 11:01 AM.
SinaC is offline Report comment to moderator  
Reply With Quote
Unread 09-04-12, 12:57 PM  
totalpackage
A Fallenroot Satyr
 
totalpackage's Avatar
AddOn Author - Click to view AddOns

Forum posts: 21
File comments: 874
Uploads: 2
Sorry everyone, thought I had until the end of September for MoP, and I was on vacation the past week. I will have something out tonight after I get home.
totalpackage is offline Report comment to moderator  
Reply With Quote
Unread 09-02-12, 08:24 AM  
Othgar
"That" Guy
 
Othgar's Avatar
AddOn Author - Click to view AddOns

Forum posts: 228
File comments: 10
Uploads: 4
Just had this error after a /rl

Code:
Date: 2012-09-02 10:12:46
ID: 1
Error occured in: Global
Count: 1
Message: ..\AddOns\CoolLine\core.lua line 417:
   GetSpellBookItemName(): Invalid spell slot
Debug:
   [C]: ?
   [C]: ?
   CoolLine\core.lua:417:
      CoolLine\core.lua:413
   CoolLine\core.lua:436: SPELLS_CHANGED()
   CoolLine\core.lua:264: ?()
   CoolLine\core.lua:4:
      CoolLine\core.lua:3
Locals:
(*temporary) = 192
(*temporary) = "spell"

AddOns:
  Swatter, v5.14.5335 (KowariOnCrutches)
  Ace3, v
  ACP, v3.4 
  AucAdvanced, v5.14.5335 (KowariOnCrutches)
  AucFilterBasic, v5.14.5335 (KowariOnCrutches)
  AucFilterOutlier, v5.14.5335.5335(5.14/embedded)
  AucMatchUndercut, v5.14.5335.5225(5.14/embedded)
  AucStatHistogram, v5.14.5335 (KowariOnCrutches)
  AucStatiLevel, v5.14.5335 (KowariOnCrutches)
  AucStatPurchased, v5.14.5335 (KowariOnCrutches)
  AucStatSales, v5.14.5335.5335(5.14/embedded)
  AucStatSimple, v5.14.5335 (KowariOnCrutches)
  AucStatStdDev, v5.14.5335 (KowariOnCrutches)
  AucStatWOWEcon, v5.14.5335.5335(5.14/embedded)
  AucUtilAHWindowControl, v5.14.5335.5133(5.14/embedded)
  AucUtilAppraiser, v5.14.5335.5335(5.14/embedded)
  AucUtilAskPrice, v5.14.5335.5160(5.14/embedded)
  AucUtilAutoMagic, v5.14.5335.5335(5.14/embedded)
  AucUtilCompactUI, v5.14.5335.5335(5.14/embedded)
  AucUtilEasyBuyout, v5.14.5335.5238(5.14/embedded)
  AucUtilFixAH, v5.14.5335 (KowariOnCrutches)
  AucUtilItemSuggest, v5.14.5335.5335(5.14/embedded)
  AucUtilPriceLevel, v5.14.5335.5237(5.14/embedded)
  AucUtilScanButton, v5.14.5335.5335(5.14/embedded)
  AucUtilScanFinish, v5.14.5335.5153(5.14/embedded)
  AucUtilScanProgress, v5.14.5335.4979(5.14/embedded)
  AucUtilScanStart, v5.14.5335.5153(5.14/embedded)
  AucUtilSearchUI, v5.14.5335.5335(5.14/embedded)
  AucUtilSimpleAuction, v5.14.5335.5208(5.14/embedded)
  AucUtilVendMarkup, v5.14.5335.4828(5.14/embedded)
  Babylonian, v5.1.DEV.312(/embedded)
  Bartender4, v4.5.3
  BeanCounter, v5.14.5335 (KowariOnCrutches)
  BulkBuy, v1.0
  Carbonite, v5.0
  Chinchilla, vv2.5.5
  ChocolateBar, vv2.2.6
  Combuctor, v5.0.2
  CombuctorScrap, v
  CombuctorSets, v
  Configator, v5.1.DEV.330(/embedded)
  CoolLine, v4.3.002
  CursorCastbar, v
  DBMArchaeology, v
  DBMCore, v
  DBMLDB, v
  DebugLib, v5.1.DEV.312(/embedded)
  EasyMail, v
  FasterCamera, v1.2
  GTFO, v4.14
  Informant, v5.14.5335 (KowariOnCrutches)
  kgPanels, v1.13
  LDBThreat, v5.01
  LibExtraTip, v5.12.DEV.324(/embedded)
  Masque, v5.0.387
  MasqueDiabloIII, v1.1
  MikScrollingBattleText, v5.7.119
  OmniCC, v5.0.1
  OPie, vJade 4
  Panda, v5.0.1.40
  PitBull4, vv4.0.0-beta35
  PitBull4Aggro, vv4.0.0-beta35
  PitBull4AltPowerBar, vv4.0.0-beta35
  PitBull4BattlePet, vv4.0.0-beta35
  PitBull4BlankSpace, vv4.0.0-beta35
  PitBull4Border, vv4.0.0-beta35
  PitBull4CastBar, vv4.0.0-beta35
  PitBull4CastBarLatency, vv4.0.0-beta35
  PitBull4CombatFader, vv4.0.0-beta35
  PitBull4CombatIcon, vv4.0.0-beta35
  PitBull4CombatText, vv4.0.0-beta35
  PitBull4ComboPoints, vv4.0.0-beta35
  PitBull4ExperienceBar, vv4.0.0-beta35
  PitBull4HealthBar, vv4.0.0-beta35
  PitBull4HideBlizzard, vv4.0.0-beta35
  PitBull4Highlight, vv4.0.0-beta35
  PitBull4HostilityFader, vv4.0.0-beta35
  PitBull4LeaderIcon, vv4.0.0-beta35
  PitBull4LuaTexts, vv4.0.0-beta35
  PitBull4MasterLooterIcon, vv4.0.0-beta35
  PitBull4PhaseIcon, vv4.0.0-beta35
  PitBull4Portrait, vv4.0.0-beta35
  PitBull4PowerBar, vv4.0.0-beta35
  PitBull4PvPIcon, vv4.0.0-beta35
  PitBull4QuestIcon, vv4.0.0-beta35
  PitBull4RaidTargetIcon, vv4.0.0-beta35
  PitBull4RangeFader, vv4.0.0-beta35
  PitBull4ReadyCheckIcon, vv4.0.0-beta35
  PitBull4ReputationBar, vv4.0.0-beta35
  PitBull4RestIcon, vv4.0.0-beta35
  PitBull4RoleIcon, vv4.0.0-beta35
  PitBull4Sounds, vv4.0.0-beta35
  PitBull4ThreatBar, vv4.0.0-beta35
  PitBull4VisualHeal, vv4.0.0-beta35
  PitBull4VoiceIcon, vv4.0.0-beta35
  Prat30, v3.5      
  Prat30HighCPUUsageModules, v
  Prat30Libraries, v
  Raven, v
  REFlex, v0.9.8
  Scrap, v11.3
  ScreenshotThis, v4.3.0.001
  SharedMediaRenaitre, v4.3.3
  Skada, v1.4-3
  SkadaCC, v1.0
  SkadaDamage, v1.0
  SkadaDamageTaken, v1.0
  SkadaDeaths, v1.0
  SkadaDebuffs, v1.0
  SkadaDispels, v1.0
  SkadaEnemies, v1.0
  SkadaHealing, v1.0
  SkadaPower, v1.0
  SkadaThreat, v1.0
  Stubby, v5.14.5335 (KowariOnCrutches)
  SwindlerPreventer, v5.0.1 (15799) BETA
  TidyPlates, v6.7.2 (R527)
  TidyPlatesGraphite, v
  TidyPlatesGrey, v
  TidyPlatesNeon, v
  TidyPlatesQuatre, v
  TidyPlatesHub, v
  TidyPlatesWidgets, v
  TipHelper, v5.12.DEV.315(/embedded)
  TipTac, v12.09.01
  TipTacItemRef, v12.08.30
  TipTacTalents, v12.09.01
  xanErrorDevourer, v1.2
  XLoot10, vz32-release
  BlizRuntimeLib_enUS v5.0.4.50001 <us>
  (ck=1091)
Didn't break the addon as far as I can tell but wanted to let you know anyways.
__________________


Othgar is offline Report comment to moderator  
Reply With Quote
Unread 09-01-12, 09:26 AM  
infinitumx
A Kobold Labourer

Forum posts: 0
File comments: 1
Uploads: 0
Until an update is made you can modify core.lua:

Around line 418:
Change
Lua Code:
  1. local sb = spells[btype]
  2. for i = 1, 500, 1 do
  3.     name = GetSpellBookItemName(i, btype)

To
Lua Code:
  1. local sb = spells[btype]
  2. local tabName, tabTexture, tabOffset, tabSlots = GetSpellTabInfo(2);
  3. for i = tabOffset+1, tabSlots+tabOffset do
  4.    name = GetSpellBookItemName(i, btype)
infinitumx is offline Report comment to moderator  
Reply With Quote
Unread 09-01-12, 07:42 AM  
flaicher
A Cyclonian
 
flaicher's Avatar

Forum posts: 42
File comments: 29
Uploads: 0
The same error as Tzarina but for nightelf and hunter abilities.
Odd, considering that apart from the error the addon works flawlessly.
flaicher is offline Report comment to moderator  
Reply With Quote
Unread 08-30-12, 12:04 PM  
Astera
A Kobold Labourer

Forum posts: 1
File comments: 53
Uploads: 0
I'm getting pretty much the same error as Tzarina.
Astera is offline Report comment to moderator  
Reply With Quote
Unread 08-30-12, 04:42 AM  
Tzarina
A Kobold Labourer

Forum posts: 0
File comments: 3
Uploads: 0
Error after patch

After the patch I have started to get this error:


105x CoolLine-4.3.002\core.lua:417: GetSpellBookItemName(): Invalid spell slot
<in C code>
CoolLine-4.3.002\core.lua:417: in function <CoolLine\core.lua:413>
CoolLine-4.3.002\core.lua:436: in function "SPELLS_CHANGED"
CoolLine-4.3.002\core.lua:264: in function "?"
CoolLine-4.3.002\core.lua:4: in function <CoolLine\core.lua:3>

Locals:
btype = "spell"
name = "Survey"
last = "Survey"
sb = <table> {
Every Man for Himself = 59752
Soulstone = 20707
Create Soulwell = 29893
Dark Soul: Misery = 77801
Ritual of Summoning = 698
Demonic Leap = 109151
Unending Resolve = 104773
Soulshatter = 29858
Flames of Xoroth = 120451
Cooking Fire = 818
Summon Infernal = 1122
Grimoire of Sacrifice = 108503
Twilight Ward = 6229
Havoc = 80240
Carrion Swarm = 103967
Fishing = 131474
Demonic Circle: Teleport = 48020
Summon Doomguard = 18540
Metamorphosis = 103958
Survey = 80451
Dark Soul: Knowledge = 113861
Soul Swap = 86121
Shadowfury = 30283
Unbound Will = 108482
Summon Demon = 10
Dark Soul: Instability = 113858
Dark Bargain = 110913
}
(for index) = 258
(for limit) = 500
(for step) = 1
i = 258
spells = <table> {
pet = <table> {}
spell = <table> {}
}
GetSpellBookItemName = <func> =[C]:-1
GetSpellBookItemInfo = <func> =[C]:-1
specialspells = <table> {}
CLTip = CLTip {
0 = <userdata>
updateTooltip = 0.2
}
CheckRight = <func> @CoolLine\core.lua:407


Any way it could be fixed? Would be awesome, since this is a really nice addon
Tzarina is offline Report comment to moderator  
Reply With Quote
Unread 08-13-12, 11:00 AM  
twopro
A Defias Bandit

Forum posts: 3
File comments: 189
Uploads: 0
whirld wind

hey, my whirl wind cooldown isnt working
twopro is offline Report comment to moderator  
Reply With Quote
Unread 07-20-12, 10:23 AM  
Alexon88
A Kobold Labourer

Forum posts: 0
File comments: 2
Uploads: 0
Missing Spell

Hi,
realy great addon helps having the overview without taking alot of space!

I don't know why, but the "holy word" spells are not displayed in the coolline. I think they would very much help every holy priest. Because one has a 7 second cooldown! the other one a 28s cd.
Exact names:
Holy word: Serenity, 10s cooldown, 7s with spec
Holy word: Sanctuary, 40s cooldown, 28s with spec
Holy word: Chastice, 30s cd, 21s with spec

Btw: they all share one button but are able to be cast in different "stances".

Alexon
Alexon88 is offline Report comment to moderator  
Reply With Quote
Unread 07-10-12, 02:30 AM  
Xavias
A Kobold Labourer

Forum posts: 0
File comments: 1
Uploads: 0
Sound

Hey totalpackage,

Great addon! I just wanted to comment that I think it would be really helpful if the addon had options to play a sound when a spell/item goes off cooldown.. Preferably right before the icon flies out.

Best,

Rob
Xavias is offline Report comment to moderator  
Reply With Quote
Unread 03-30-12, 09:41 PM  
totalpackage
A Fallenroot Satyr
 
totalpackage's Avatar
AddOn Author - Click to view AddOns

Forum posts: 21
File comments: 874
Uploads: 2
I do not know if times have changed, but the performance is the reason why I decided to use simple linear math compared to say a log function to handle the animation. Remember, something like this can be a CPU hog during intense combat, and I'm sure people do not want an addon reducing their FPS.

Looking pretty has its place, but usability is priority here.
totalpackage is offline Report comment to moderator  
Reply With Quote
Unread 03-28-12, 11:22 AM  
FuzTheCat
A Kobold Labourer

Forum posts: 0
File comments: 1
Uploads: 0
Smooth acceleration

Really love Coolline, thanks heaps for the addon .
Any chance of having the icons move with more smooth acceleration vs sudden speed changes from one section to the next?
Also may we change the 1m to 30s as this would even up the sections to a more geometrical progression? (10s*3 = 30s, 30s*4 = 2m instead of 10s*6=1m, 1m*2=2m)

I had a little edit and changed the 1m to 30s:
Code:
tick60 = createfs(tick60, "30", section * 4)
Also changed the movement from linear to parabolic for smooth acceleration:
Code:
-- Smooth out the velocity of the icon by using parabolic motion and make the velocity ending/starting a section the same.
-- Assuming a final velocity of -1.2025 at remain = 0, we have the following accelerations (times, velocities): (u = 2/t - v) & (a = (v-u)/t)
-- (0,-1.2025) a=-0.405 (remain=1,u=-0.765) -0.2975 (3,-0.2025) -0.0170408 (10,-0.083214) -0.0033214 (30,-0.016786) -0.0001261 (120,-0.0054365) -1.0582E-05 (360,-0.0028968)
-- Using s = u*t + 0.5*a*t^2 we can then get the distance in each section. t = (endsectiontime - remain), eg t = 360 - remain for the rightmost section.
-- position = x + u * (endtime - remain) + 0.5 * a * (endtime - remain) ^ 2   (where x = section number we are in)
-- position = (x + (u + 0.5 * a * endtime)*endtime) + remain * (-u - a * endtime + 0.5 * a * remain)
-- position = C + remain * (B + A * remain) where: C = x + (u + 0.5 * a * endtime)*endtime, B = -u - a * endtime, A = 0.5 * a
local function OnUpdate(this, a1, ctime, dofl)
	elapsed = elapsed + a1
	if elapsed < throt then return end
	elapsed = 0
	
	if #cooldowns == 0 then
		if not CoolLine.unlock then
			self:SetScript("OnUpdate", nil)
			self:SetAlpha(db.inactivealpha)
		end
		return
	end
	
	ctime = ctime or GetTime()
	if ctime > ptime then
		dofl, ptime = true, ctime + 0.4
	end
	isactive, throt = false, 1.5
	for index, frame in pairs(cooldowns) do
		local remain = frame.endtime - ctime
		if remain < 3 then
			if remain > 1 then
				SetupIcon(frame, section * (0.05375 + remain * (1.095 - 0.14875 * remain)), 0.01, true, dofl)  -- 2 + (-0.2025 + 0.5 * -0.2975 * 3) * 3 + remain * (0.2025 - -0.2975 * 3 + 0.5 * -0.2975 * remain)
			elseif remain > 0.3 then
				SetupIcon(frame, section * (0.0 + remain * (1.2025 - 0.2025 * remain)), 0, true, dofl)
			elseif remain > 0 then
				local size = iconsize * (0.5 - remain) * 5  -- iconsize + iconsize * (0.3 - remain) / 0.2
				frame:SetWidth(size)
				frame:SetHeight(size)
				SetupIcon(frame, section * (0.0 + remain * (1.2025 - 0.2025 * remain)), 0, true, dofl)
			elseif remain > -1 then
				SetupIcon(frame, 0, 0, true, dofl)
				frame:SetAlpha(1 + remain)  -- fades
			else
				throt = (throt < 0.2 and throt) or 0.2
				isactive = true
				ClearCooldown(frame)
			end
		elseif remain < 10 then
			SetupIcon(frame, section * (1.315816 + remain * (0.25362245 - 0.008520408 * remain)), remain > 4 and 0.02 or 0.01, true, dofl)  -- 2 + (remain - 3) / 7
		elseif remain < 30 then
			SetupIcon(frame, section * (2.001786 + remain * (0.11642857 - 0.001660714 * remain)), 0.05, true, dofl)  -- 3 + (remain - 10) / 50
		elseif remain < 120 then
			SetupIcon(frame, section * (3.439683 + remain * (0.02056878 - 6.30511E-05 * remain)), 0.1, true, dofl)  -- 4 + (remain - 60) / 60
		elseif remain < 360 then
			SetupIcon(frame, section * (4.271429 + remain * (0.00670635 - 5.29101E-06 * remain)), 0.5, true, dofl)  -- 5 + (remain - 120) / 240
			frame:SetAlpha(1)
		else
			SetupIcon(frame, 6 * section, 2, false, dofl)
		end
	end
	if not isactive and not CoolLine.unlock then
		self:SetAlpha(db.inactivealpha)
	end
end
Also had to drop the throt a bit to keep the continuous acceleration a bit smoother.

Thanks again for a simply awesome cooldown line .
FuzTheCat is offline Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump:

Support AddOn Development!

You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.