Added arg names or ... for functions which take arguments in spell palette entries.

This commit is contained in:
Nick Winter 2014-02-23 13:27:02 -08:00
parent a156edc0a2
commit 68497b2cf3
2 changed files with 7 additions and 3 deletions

View file

@ -17,7 +17,7 @@ module.exports = class CastButtonView extends View
@spells = options.spells
@levelID = options.levelID
isMac = navigator.platform.toUpperCase().indexOf('MAC') isnt -1
@castShortcut = ""
@castShortcut = ""
@castShortcutVerbose = "Shift+Enter"
getRenderData: (context={}) ->
@ -35,7 +35,7 @@ module.exports = class CastButtonView extends View
# TODO: use a User setting instead of localStorage
delay = localStorage.getItem 'autocastDelay'
delay ?= 5000
if @levelID is 'project-dota'
if @levelID in ['project-dota', 'brawlwood', 'ladder-tutorial']
delay = 90019001
@setAutocastDelay delay

View file

@ -83,7 +83,11 @@ module.exports = class SpellPaletteEntryView extends View
@doc.shortName = @doc.shorterName = @doc.title = @doc.name
else
@doc.owner ?= 'this'
suffix = if @doc.type is 'function' then '()' else ''
suffix = ''
if @doc.type is 'function'
argNames = (arg.name for arg in @doc.args ? []).join(', ')
argNames = '...' if argNames.length > 6
suffix = "(#{argNames})"
@doc.shortName = "#{@doc.owner}.#{@doc.name}#{suffix};"
if @doc.owner is 'this' or options.tabbify
@doc.shorterName = "#{@doc.name}#{suffix}"