From 7e791158d4dba848299029cb7e47cfd48cf8a4a6 Mon Sep 17 00:00:00 2001 From: diablo Date: Thu, 16 Jan 2014 20:42:15 -0600 Subject: [PATCH 1/4] Fixes misuse of food.key in modal display and instead uses the text value --- public/js/controllers/inventoryCtrl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/controllers/inventoryCtrl.js b/public/js/controllers/inventoryCtrl.js index cc4ed11448..d790d93c25 100644 --- a/public/js/controllers/inventoryCtrl.js +++ b/public/js/controllers/inventoryCtrl.js @@ -99,7 +99,7 @@ habitrpg.controller("InventoryCtrl", ['$rootScope', '$scope', '$window', 'User', var food = $scope.selectedFood if (food.key == 'Saddle') { if (!$window.confirm('Saddle ' + pet + '?')) return; - } else if (!$window.confirm('Feed ' + pet + ' a ' + food.key + '?')) { + } else if (!$window.confirm('Feed ' + pet + ' a ' + food.text + '?')) { return; } User.user.ops.feed({params:{pet: pet, food: food.key}}); From dfdccfb4585c80805194e39e1fc1e54a4849954e Mon Sep 17 00:00:00 2001 From: diablo Date: Thu, 16 Jan 2014 21:34:10 -0600 Subject: [PATCH 2/4] generifies article for food when feeding to pet --- public/js/controllers/inventoryCtrl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/controllers/inventoryCtrl.js b/public/js/controllers/inventoryCtrl.js index d790d93c25..5f4d63f95e 100644 --- a/public/js/controllers/inventoryCtrl.js +++ b/public/js/controllers/inventoryCtrl.js @@ -99,7 +99,7 @@ habitrpg.controller("InventoryCtrl", ['$rootScope', '$scope', '$window', 'User', var food = $scope.selectedFood if (food.key == 'Saddle') { if (!$window.confirm('Saddle ' + pet + '?')) return; - } else if (!$window.confirm('Feed ' + pet + ' a ' + food.text + '?')) { + } else if (!$window.confirm('Feed ' + pet + ' '+ food.article + food.text + '?')) { return; } User.user.ops.feed({params:{pet: pet, food: food.key}}); From 16c38634b6b88abfba0cfe301fb643c560ddc37d Mon Sep 17 00:00:00 2001 From: diablo Date: Thu, 16 Jan 2014 21:42:08 -0600 Subject: [PATCH 3/4] Modifies pet name to be 'Desert Wolf' rather than 'Wolf-Desert' --- public/js/controllers/inventoryCtrl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/controllers/inventoryCtrl.js b/public/js/controllers/inventoryCtrl.js index 5f4d63f95e..aee6d5b062 100644 --- a/public/js/controllers/inventoryCtrl.js +++ b/public/js/controllers/inventoryCtrl.js @@ -92,7 +92,7 @@ habitrpg.controller("InventoryCtrl", ['$rootScope', '$scope', '$window', 'User', } $scope.choosePet = function(egg, potion){ - var pet = egg + '-' + potion; + var pet = potion + " " + egg; // Feeding Pet if ($scope.selectedFood) { From 7179a308275b7d3eaa908f463982e22d0bde574d Mon Sep 17 00:00:00 2001 From: diablo Date: Fri, 17 Jan 2014 19:16:40 -0600 Subject: [PATCH 4/4] Fixed broken test for display name --- public/js/controllers/inventoryCtrl.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/js/controllers/inventoryCtrl.js b/public/js/controllers/inventoryCtrl.js index aee6d5b062..082e93287a 100644 --- a/public/js/controllers/inventoryCtrl.js +++ b/public/js/controllers/inventoryCtrl.js @@ -92,14 +92,15 @@ habitrpg.controller("InventoryCtrl", ['$rootScope', '$scope', '$window', 'User', } $scope.choosePet = function(egg, potion){ - var pet = potion + " " + egg; + var petDisplayName = potion + " " + egg, + pet = egg + '-' + potion; // Feeding Pet if ($scope.selectedFood) { var food = $scope.selectedFood if (food.key == 'Saddle') { if (!$window.confirm('Saddle ' + pet + '?')) return; - } else if (!$window.confirm('Feed ' + pet + ' '+ food.article + food.text + '?')) { + } else if (!$window.confirm('Feed ' + petDisplayName + ' '+ food.article + food.text + '?')) { return; } User.user.ops.feed({params:{pet: pet, food: food.key}});