From 30a5b349f85c42c63b3df67411e1991e1477cb24 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Sun, 1 Dec 2013 10:16:21 -0600 Subject: [PATCH 1/7] Fix #1909 (keep stack selected after selling item) --- public/js/controllers/inventoryCtrl.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/public/js/controllers/inventoryCtrl.js b/public/js/controllers/inventoryCtrl.js index 28deb61463..f2f47159a2 100644 --- a/public/js/controllers/inventoryCtrl.js +++ b/public/js/controllers/inventoryCtrl.js @@ -55,21 +55,29 @@ habitrpg.controller("InventoryCtrl", ['$rootScope', '$scope', 'User', 'API_URL', 'items.eggs': user.items.eggs, 'stats.gp': User.user.stats.gp + $scope.selectedEgg.value }); - $scope.selectedEgg = null; + if (user.items.eggs[$scope.selectedEgg.name] < 1) { + $scope.selectedEgg = null; + } + } else if ($scope.selectedPotion) { user.items.hatchingPotions[$scope.selectedPotion.name]--; User.setMultiple({ 'items.hatchingPotions': user.items.hatchingPotions, 'stats.gp': User.user.stats.gp + $scope.selectedPotion.value }); - $scope.selectedPotion = null; + if (user.items.hatchingPotions[$scope.selectedPotion.name] < 1) { + $scope.selectedPotion = null; + } + } else if ($scope.selectedFood) { user.items.food[$scope.selectedFood.name]--; User.setMultiple({ 'items.food': user.items.food, 'stats.gp': User.user.stats.gp + $scope.selectedFood.value }); - $scope.selectedFood = null; + if (user.items.food[$scope.selectedFood.name] < 1) { + $scope.selectedFood = null; + } } } @@ -81,7 +89,7 @@ habitrpg.controller("InventoryCtrl", ['$rootScope', '$scope', 'User', 'API_URL', $scope.hatch = function(egg, potion){ var pet = egg.name+"-"+potion.name; if (user.items.pets[pet]) - return alert("You already have that pet, hatch a different combo."); + return alert("You already have that pet. Try hatching a different combination!"); var setObj = {}; setObj['items.pets.' + pet] = 5; From af80548a342fdaa636de24a5e0aee7a32b1508db Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Sun, 1 Dec 2013 11:58:03 -0600 Subject: [PATCH 2/7] Partial fix to #1938 (New name and location for Re-Roll) --- locales/en/app.json | 2 +- views/options/inventory/inventory.jade | 12 ++++++++---- views/shared/modals/reroll.jade | 8 ++++---- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/locales/en/app.json b/locales/en/app.json index 38d94fa446..c45eaf02b0 100644 --- a/locales/en/app.json +++ b/locales/en/app.json @@ -302,7 +302,7 @@ "_commentitemsother" : "OTHER ITEMS", "healthPotionName" : "Health Potion", "healthPotionNotes" : "Recover 15 HP Instantly", - "rerollName" : "Re-Roll", + "rerollName" : "Fortify", "rerollNotes" : "Resets your task values back to yellow. Useful when everything's red and it's hard to stay alive.", "rerollModelHeader" : "Reset Your Tasks", "rerollModelText1" : "Highly discouraged because red tasks provide good incentive to improve", diff --git a/views/options/inventory/inventory.jade b/views/options/inventory/inventory.jade index 4f56dd6671..721b9e9a47 100644 --- a/views/options/inventory/inventory.jade +++ b/views/options/inventory/inventory.jade @@ -44,7 +44,7 @@ script(type='text/ng-template', id='partials/options.inventory.inventory.html') a(target='_blank', href='http://www.kickstarter.com/profile/523661924') Alexander the Merchant .popover-content p - | Welcome to the Market. Dying to get that particular pet you're after, but don't want to wait for it to drop? Buy it here! If you have unwanted drops, sell them to me. + | Welcome to the Market! Buy hard-to-find eggs and potions! Sell your extras! Commission useful services! Come see what we have to offer. p button.btn.btn-primary(ng-show='selectedEgg', ng-click='sellInventory()') | Sell {{selectedEgg.name}} for {{selectedEgg.value}} Gold @@ -77,6 +77,10 @@ script(type='text/ng-template', id='partials/options.inventory.inventory.html') p | {{food.value}} span.Pet_Currency_Gem1x.inline-gems - - - + li.customize-menu + menu.pets-menu(label='Services') + div + button.btn(popover='Return all tasks to neutral value (yellow color).', popover-title=env.t('rerollName'), popover-trigger='mouseenter', popover-placement='left', ng-click='modals.reroll = true') Fortify + div + | 4 + span.Pet_Currency_Gem1x.inline-gems \ No newline at end of file diff --git a/views/shared/modals/reroll.jade b/views/shared/modals/reroll.jade index 0941593b32..4c9764b06a 100644 --- a/views/shared/modals/reroll.jade +++ b/views/shared/modals/reroll.jade @@ -1,12 +1,12 @@ // Re-Roll modal div(modal='modals.reroll') .modal-header - h3 Reset Your Tasks + h3 Fortify: Back to Yellow .modal-body include ../gems p. - Purchasing a Re-Roll will reset all your tasks to a neutral (yellow) state, as if you'd just added them. Consider - this an option of last resort, red tasks provide good incentive to improve. But if all that red fills you with + Fortify will return all your tasks to a neutral (yellow) state, as if you'd just added them. Consider + this an option of last resort! Red tasks provide good incentive to improve. But if all that red fills you with despair, and the beginning of each new day proves lethal, spend the Gems and catch a reprieve! .modal-footer @@ -14,6 +14,6 @@ div(modal='modals.reroll') a.btn.btn-success.btn-large(ng-click="modals.buyGems = true") Buy More Gems span.gem-cost Not enough Gems span(ng-if='user.balance >= 1', ng-controller='SettingsCtrl') - a.btn.btn-danger.btn-large(ng-click='reroll()') Re-Roll + a.btn.btn-danger.btn-large(ng-click='reroll()') Fortify span.gem-cost 4 Gems From 45b87288f025f839f9244b8089fd9dba9ff8c5ea Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Sun, 1 Dec 2013 15:03:03 -0600 Subject: [PATCH 3/7] Change "reroll" to "Fortify" in Gems popover text --- views/shared/gems.jade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/shared/gems.jade b/views/shared/gems.jade index 09c9c50dbf..0ef01f96c4 100644 --- a/views/shared/gems.jade +++ b/views/shared/gems.jade @@ -1,4 +1,4 @@ -a.pull-right.gem-wallet(ng-click='modals.buyGems = true', popover-trigger='mouseenter', popover-title='Gems', popover="Used for buying special items (reroll, eggs, hatching potions, etc). You'll need to unlock those features before being able to use Gems.", popover-placement='bottom') +a.pull-right.gem-wallet(ng-click='modals.buyGems = true', popover-trigger='mouseenter', popover-title='Gems', popover="Used for buying special items and services (eggs, hatching potions, Fortify, etc.). You'll need to unlock those features before being able to use Gems.", popover-placement='bottom') span.task-action-btn.tile.flush.bright.add-gems-btn + span.task-action-btn.tile.flush.neutral .Gems From 37f7a923ea26e0afca4ee611c648713e8d3a3b3d Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Mon, 2 Dec 2013 10:20:38 -0600 Subject: [PATCH 4/7] Fix #1934 (make Reset and Restore options more distinct) --- views/options/settings.jade | 14 ++++++------- views/shared/modals/settings.jade | 33 +++++++++++++++++-------------- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/views/options/settings.jade b/views/options/settings.jade index df14bc3b22..50f876c201 100644 --- a/views/options/settings.jade +++ b/views/options/settings.jade @@ -30,10 +30,11 @@ script(type='text/ng-template', id='partials/options.settings.settings.html') select(ng-model='language.code', ng-options='lang.code as lang.name for lang in avalaibleLanguages', ng-change='changeLanguage()') hr h4 Misc - button.btn(ng-hide='user.preferences.hideHeader', ng-click='set("preferences.hideHeader",true)') Hide Header - button.btn(ng-show='user.preferences.hideHeader', ng-click='set("preferences.hideHeader",false)') Show Header - button.btn(ng-click='showTour()') Show Tour - button.btn(ng-click='showBailey()') Show Bailey + button.btn(ng-hide='user.preferences.hideHeader', ng-click='set("preferences.hideHeader",true)', popover-trigger='mouseenter', popover-placement='right', popover='Hide your avatar, Health/Experience bars, and party.') Hide Header + button.btn(ng-show='user.preferences.hideHeader', ng-click='set("preferences.hideHeader",false)', popover-trigger='mouseenter', popover='Display your avatar, Health/Experience bars, and party.') Show Header + button.btn(ng-click='showTour()', popover-trigger='mouseenter', popover='Restart the introductory tour from when you first joined HabitRPG.') Show Tour + button.btn(ng-click='showBailey()', popover-trigger='mouseenter', popover='Bring Bailey the Town Crier out of hiding so you can review past news.') Show Bailey + button.btn(ng-click='modals.restore = true', popover-trigger='mouseenter', popover='Manually change values like Health, Level, and Gold.') Fix Character Values div(ng-show='user.auth.local') hr @@ -49,9 +50,8 @@ script(type='text/ng-template', id='partials/options.settings.settings.html') hr h4 Danger Zone - a.btn.btn-danger(ng-click='modals.reset = true', tooltip='Resets your entire account (dangerous).') Reset - a.btn.btn-danger(ng-click='modals.restore = true', tooltip='Restores attributes to your character.') Restore - a.btn.btn-danger(ng-click='modals.delete = true', tooltip='Delete your account.') Delete + a.btn.btn-danger(ng-click='modals.reset = true', popover-trigger='mouseenter', popover-placement='right', popover='Start over, removing all levels, gold, gear, history, and tasks.') Reset Account + a.btn.btn-danger(ng-click='modals.delete = true', popover-trigger='mouseenter', popover='Cancel and remove your HabitRPG account.') Delete Account script(type='text/ng-template', id='partials/options.settings.api.html') .row.fluid diff --git a/views/shared/modals/settings.jade b/views/shared/modals/settings.jade index 6aafed4060..639304c55f 100644 --- a/views/shared/modals/settings.jade +++ b/views/shared/modals/settings.jade @@ -1,35 +1,37 @@ div(ng-controller='SettingsCtrl') div(modal='modals.reset') .modal-header - h3 Reset + h3 Reset Account .modal-body p This resets your entire account - your tasks will be deleted and your character will start over. - p This is highly discouraged because you'll lose historical data, which is useful for graphing your progress over time. However, some people find it useful in the beginning after playing with the app for a while. + p. + This is highly discouraged because you'll lose historical data, which is useful for graphing your progress over time. However, some people find it useful in the beginning after playing with the app for a while. .modal-footer - button.btn.btn-default.cancel(ng-click='modals.reset = false') Close - button.btn.btn-danger(data-dismiss='modal', ng-click='reset()') Reset + button.btn.btn-default.cancel(ng-click='modals.reset = false') Never mind + button.btn.btn-danger(data-dismiss='modal', ng-click='reset()') Do it, reset my account! div(modal='modals.restore') .modal-header - h3 Restore + h3 Fix Values .modal-body - p HabitRPG is quite Beta-quality at present, and many find they need to restore character attributes as a result. Enter your numbers here and it will be applied automatically to your character. This will be removed once Habit is more stable. + p If you've encountered a bug or made a mistake that unfairly changed your character (damage you shouldn't have taken, Gold you didn't really earn, etc.), you can manually correct your numbers here. Yes, this makes it possible to cheat: use this feature wisely, or you'll sabotage your own habit-building! + p Note that you cannot restore Streaks on individual tasks here. To do that, edit the Daily and go to Advanced Options, where you will find a Restore Streak field. div.restore-options form#restore-form.form-horizontal h3 Stats .option-group.option-medium input.option-content(type='number', step="any", data-for='stats.hp', ng-model='restoreValues.stats.hp') - span.input-suffix HP + span.input-suffix Health .option-group.option-medium input.option-content(type='number', step="any", data-for='stats.exp', ng-model='restoreValues.stats.exp') - span.input-suffix Exp + span.input-suffix Experience .option-group.option-medium input.option-content(type='number', step="any", data-for='stats.gp', ng-model='restoreValues.stats.gp') - span.input-suffix GP + span.input-suffix Gold .option-group.option-medium input.option-content(type='number', data-for='stats.lvl', ng-model='restoreValues.stats.lvl') span.input-suffix Level - h3 Items + h3 Equipment .option-group.option-medium input.option-content(type='number', data-for='items.weapon', ng-model='restoreValues.items.weapon') span.input-suffix Weapon @@ -42,14 +44,15 @@ div(ng-controller='SettingsCtrl') .option-group.option-medium input.option-content(type='number', data-for='items.shield', ng-model='restoreValues.items.shield') span.input-suffix Shield - h3 Streak Achievements + h3 Achievements .option-group.option-medium input.option-content(type='number', data-for='achievements.streak', ng-model='restoreValues.achievements.streak') - span.input-suffix 21-Day Streak + span.input-suffix 21-Day Streaks //- This is causing too many problems for users h3 Other a.btn.btn-small.btn-warning(ng-controller='FooterCtrl', ng-click='addMissedDay()') Trigger New Day .modal-footer + button.btn.btn-default.cancel(ng-click='modals.restore = false') Discard Changes button.btn.btn-primary(ng-click='restore()') Save & Close div(modal='modals.delete') @@ -57,9 +60,9 @@ div(ng-controller='SettingsCtrl') h3 Delete Account .modal-body p. - Woa woa woa! Are you sure? This will seriously delete your account forever, and it can never be restored. If you're absolutely certain, type DELETE into the text-box below. + Are you sure? This will delete your account forever, and it can never be restored! You will need to register a new account to use HabitRPG again. Banked or spent Gems will not be refunded. If you're absolutely certain, type DELETE into the text box below. p input(type='text', ng-model='_deleteAccount') .modal-footer - button.btn.btn-default(ng-click='modals.delete = false') Cancel - button.btn.btn-danger.btn-small(ng-disabled='_deleteAccount != "DELETE"', ng-click='delete()') Delete Account + button.btn.btn-default(ng-click='modals.delete = false') Never mind + button.btn.btn-danger.btn-small(ng-disabled='_deleteAccount != "DELETE"', ng-click='delete()') Do it, delete my account! From dab22ec0511e50b62893e7d3126c2f5129abec7a Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Mon, 2 Dec 2013 11:10:58 -0600 Subject: [PATCH 5/7] Small formatting fix to Advanced Options --- views/shared/tasks/task.jade | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/views/shared/tasks/task.jade b/views/shared/tasks/task.jade index c6eb5fe897..6d81fdf2a0 100644 --- a/views/shared/tasks/task.jade +++ b/views/shared/tasks/task.jade @@ -157,9 +157,10 @@ li(bindonce='list', ng-repeat='task in obj[list.type+"s"]', class='task {{taskCl button.task-action-btn.tile(type='button', ng-class='{active: task.priority=="!!"}', ng-click='task.challenge.id || (task.priority="!!")') Medium button.task-action-btn.tile(type='button', ng-class='{active: task.priority=="!!!"}', ng-click='task.challenge.id || (task.priority="!!!")') Hard //span(ng-if='task.type=="daily" && !task.challenge.id') - span(ng-if='task.type=="daily"') - legend.option-title Restore Streak - input.option-content(type='number', ng-model='task.streak') + p + span(ng-if='task.type=="daily"') + legend.option-title Restore Streak + input.option-content(type='number', ng-model='task.streak') button.task-action-btn.tile.spacious(type='submit') Save & Close div(class='{{obj._id}}{{task.id}}-chart', ng-show='charts[obj._id+task.id]') From dd8b38ca04535bfabfab4f5509e89a8d4ece32a7 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Fri, 6 Dec 2013 06:34:54 -0600 Subject: [PATCH 6/7] Answer tavern FAQ in resource links --- views/options/social/tavern.jade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/options/social/tavern.jade b/views/options/social/tavern.jade index 46a773f8f4..be289c8ff4 100644 --- a/views/options/social/tavern.jade +++ b/views/options/social/tavern.jade @@ -27,7 +27,7 @@ table.table.table-striped tr td - a(target='_blank', href='http://community.habitrpg.com/forums/lfg') LFG Posts + a(target='_blank', href='http://community.habitrpg.com/forums/lfg') Looking for Group (Party Wanted) Posts tr td a(target='_blank', href='http://www.youtube.com/watch?feature=player_embedded&v=cT5ghzZFfao') Tutorial From 4d3a359d6b00a0e2aa569eb9da5dbf78dde8e0dd Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Sun, 8 Dec 2013 09:38:24 -0700 Subject: [PATCH 7/7] fixes to sabe/tweak #1952 @SabreCat (put gems inline with fortify button, remove reroll from store) --- public/js/controllers/tasksCtrl.js | 2 +- views/options/inventory/inventory.jade | 8 ++++---- views/shared/tasks/task.jade | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/public/js/controllers/tasksCtrl.js b/public/js/controllers/tasksCtrl.js index 975907d499..ec3ad92e90 100644 --- a/public/js/controllers/tasksCtrl.js +++ b/public/js/controllers/tasksCtrl.js @@ -110,7 +110,7 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User', ' /* Figure out whether we wanna put this in habitrpg-shared */ - sorted = [updated.weapon, updated.armor, updated.head, updated.shield, updated.potion, updated.reroll]; + sorted = [updated.weapon, updated.armor, updated.head, updated.shield, updated.potion]; $scope.itemStore = sorted; } diff --git a/views/options/inventory/inventory.jade b/views/options/inventory/inventory.jade index 721b9e9a47..22bcbbb78b 100644 --- a/views/options/inventory/inventory.jade +++ b/views/options/inventory/inventory.jade @@ -80,7 +80,7 @@ script(type='text/ng-template', id='partials/options.inventory.inventory.html') li.customize-menu menu.pets-menu(label='Services') div - button.btn(popover='Return all tasks to neutral value (yellow color).', popover-title=env.t('rerollName'), popover-trigger='mouseenter', popover-placement='left', ng-click='modals.reroll = true') Fortify - div - | 4 - span.Pet_Currency_Gem1x.inline-gems \ No newline at end of file + // Once grunt-spritesmith is merged, let's use https://github.com/browserquest/BrowserQuest/blob/master/client/img/1/item-firepotion.png + button.btn(popover='Return all tasks to neutral value (yellow color).', popover-title=env.t('rerollName'), popover-trigger='mouseenter', popover-placement='left', ng-click='modals.reroll = true') + | Fortify 4 + span.Pet_Currency_Gem1x.inline-gems \ No newline at end of file diff --git a/views/shared/tasks/task.jade b/views/shared/tasks/task.jade index 6d81fdf2a0..a1a6600f92 100644 --- a/views/shared/tasks/task.jade +++ b/views/shared/tasks/task.jade @@ -157,10 +157,10 @@ li(bindonce='list', ng-repeat='task in obj[list.type+"s"]', class='task {{taskCl button.task-action-btn.tile(type='button', ng-class='{active: task.priority=="!!"}', ng-click='task.challenge.id || (task.priority="!!")') Medium button.task-action-btn.tile(type='button', ng-class='{active: task.priority=="!!!"}', ng-click='task.challenge.id || (task.priority="!!!")') Hard //span(ng-if='task.type=="daily" && !task.challenge.id') - p - span(ng-if='task.type=="daily"') - legend.option-title Restore Streak - input.option-content(type='number', ng-model='task.streak') + br + span(ng-if='task.type=="daily"') + legend.option-title Restore Streak + input.option-content(type='number', ng-model='task.streak') button.task-action-btn.tile.spacious(type='submit') Save & Close div(class='{{obj._id}}{{task.id}}-chart', ng-show='charts[obj._id+task.id]')