From 91412ccd69830812c34a2282e7e667d0df2f9ef0 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Mon, 24 Feb 2014 09:58:12 -0800 Subject: [PATCH] Playback and level editor shortcut tweaks. --- app/templates/play/level/thang_avatar.jade | 3 ++- app/views/editor/level/thangs_tab_view.coffee | 25 ++++++++----------- app/views/play/level/playback_view.coffee | 4 +-- 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/app/templates/play/level/thang_avatar.jade b/app/templates/play/level/thang_avatar.jade index a37e5c311..03be3d62e 100644 --- a/app/templates/play/level/thang_avatar.jade +++ b/app/templates/play/level/thang_avatar.jade @@ -1,6 +1,7 @@ .thang-avatar-wrapper(class="team-" + (thang.team || "neutral")) //canvas(width=100, height=100, title=thang.id + " - " + thang.team) - img.img-responsive(src=avatarURL, title=thang.id + " - " + thang.team) + - var title = thang.id + " - " + thang.team + (thang.type ? ' - type: "' + thang.type + '"' : '') + img.img-responsive(src=avatarURL, title=title) .badge.problems .badge.shared-thangs if includeName diff --git a/app/views/editor/level/thangs_tab_view.coffee b/app/views/editor/level/thangs_tab_view.coffee index afc46cf14..33d703b77 100644 --- a/app/views/editor/level/thangs_tab_view.coffee +++ b/app/views/editor/level/thangs_tab_view.coffee @@ -48,15 +48,10 @@ module.exports = class ThangsTabView extends View 'click #extant-thangs-filter button': 'onFilterExtantThangs' shortcuts: - 'esc': -> @selectAddThang() - - onFilterExtantThangs: (e) -> - button = $(e.target).closest('button') - button.button('toggle') - val = button.val() - @thangsTreema.$el.removeClass(@lastHideClass) if @lastHideClass - @thangsTreema.$el.addClass(@lastHideClass = "hide-except-#{val}") if val - + 'esc': 'selectAddThang' + 'delete, del, backspace': 'deleteSelectedExtantThang' + 'left': -> @moveAddThangSelection -1 + 'right': -> @moveAddThangSelection 1 constructor: (options) -> super options @@ -102,12 +97,12 @@ module.exports = class ThangsTabView extends View $('#thangs-list').bind 'mousewheel', @preventBodyScrollingInThangList @$el.find('#extant-thangs-filter button:first').button('toggle') - # TODO: move these into the shortcuts list - key 'left', _.bind @moveAddThangSelection, @, -1 - key 'right', _.bind @moveAddThangSelection, @, 1 - key 'delete, del, backspace', @deleteSelectedExtantThang - key 'f', => Backbone.Mediator.publish('level-set-debug', debug: not @surface.debug) - key 'g', => Backbone.Mediator.publish('level-set-grid', grid: not @surface.gridShowing()) + onFilterExtantThangs: (e) -> + button = $(e.target).closest('button') + button.button('toggle') + val = button.val() + @thangsTreema.$el.removeClass(@lastHideClass) if @lastHideClass + @thangsTreema.$el.addClass(@lastHideClass = "hide-except-#{val}") if val preventBodyScrollingInThangList: (e) -> @scrollTop += (if e.deltaY < 0 then 1 else -1) * 30 diff --git a/app/views/play/level/playback_view.coffee b/app/views/play/level/playback_view.coffee index 26e8454c1..a04e61c48 100644 --- a/app/views/play/level/playback_view.coffee +++ b/app/views/play/level/playback_view.coffee @@ -36,8 +36,8 @@ module.exports = class PlaybackView extends View shortcuts: '⌘+p, p, ctrl+p': 'onTogglePlay' - '[': 'onScrubBack' - ']': 'onScrubForward' + '⌘+[, ctrl+[': 'onScrubBack' + '⌘+], ctrl+]': 'onScrubForward' constructor: -> super(arguments...)