From fe2ea22983e29b1e99dabe883e773c4949d3d6e2 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 13 Apr 2012 12:23:00 -0700 Subject: IKNinja-1022 - PaintBucket tooltip is incorrect. Also added kb shortcuts for PaintBucket, InkBottle and Eyedropper tools. Signed-off-by: Nivesh Rajbhandari --- js/data/tools-data.js | 6 +++--- js/mediators/keyboard-mediator.js | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) (limited to 'js') diff --git a/js/data/tools-data.js b/js/data/tools-data.js index faf3336f..4d009530 100755 --- a/js/data/tools-data.js +++ b/js/data/tools-data.js @@ -151,7 +151,7 @@ exports.ToolsData = Montage.create(Montage, { "properties": "fillProperties", "spriteSheet": true, "action": "FillTool", - "toolTip": "Fill Tool", + "toolTip": "Paint Bucket Tool (K)", "cursor": "url('images/tools/bucket_down.png'), default", "lastInGroup": false, "container": false, @@ -162,7 +162,7 @@ exports.ToolsData = Montage.create(Montage, { "properties": "inkbottleProperties", "spriteSheet": true, "action": "InkBottleTool", - "toolTip": "Ink Bottle Tool", + "toolTip": "Ink Bottle Tool (K)", "cursor": "url('images/tools/inkbottle_down.png'), default", "lastInGroup": true, "container": false, @@ -173,7 +173,7 @@ exports.ToolsData = Montage.create(Montage, { "properties": "eyedropperProperties", "spriteSheet": true, "action": "EyedropperTool", - "toolTip": "Eyedropper Tool", + "toolTip": "Eyedropper Tool (I)", "cursor": "url('images/tools/eyedropper_down.png') 6 20, default", "lastInGroup": false, "container": false, diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js index 82596693..79967799 100755 --- a/js/mediators/keyboard-mediator.js +++ b/js/mediators/keyboard-mediator.js @@ -168,6 +168,24 @@ exports.KeyboardMediator = Montage.create(Component, { return; } + // Paint Bucket Tool and Ink Bottle tools share keyboard shortcut K + if(evt.keyCode === Keyboard.K ) { + evt.preventDefault(); + if(this.application.ninja.toolsData.selectedTool.id === "FillTool") { + this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[11]}); + } else { + this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[10]}); + } + return; + } + + // Shortcut for Eyedropper Tool is I + if(evt.keyCode === Keyboard.I ) { + evt.preventDefault(); + this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[12]}); + return; + } + // Rotate Stage Tool is M if(evt.keyCode === Keyboard.M ) { evt.preventDefault(); -- cgit v1.2.3