mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 06:07:21 +01:00
refactor: Adjust stat allocation modal
This commit is contained in:
@@ -161,6 +161,7 @@
|
||||
"con": "CON",
|
||||
"per": "PER",
|
||||
"int": "INT",
|
||||
"showHideQuickAllocation": "Show/hide stat allocation",
|
||||
"showQuickAllocation": "Show stat allocation",
|
||||
"hideQuickAllocation": "Hide stat allocation",
|
||||
"quickAllocationLevelPopover": "Each level earns you one point to assign to an attribute of your choice. You can do so manually, or let the game decide for you using one of the Automatic Allocation options found in User -> Stats."
|
||||
}
|
||||
|
||||
@@ -35,10 +35,19 @@ mixin ownedQuests(popoverAppend, popoverPlacement)
|
||||
.badge.badge-info.stack-count {{points}}
|
||||
|
||||
mixin statAllocation
|
||||
each statInfo, stat in { str: {title:"allocateStr",popover:'strengthText',allocatepop:'allocateStrPop'},int: {title:"allocateInt",popover:'intText',allocatepop:'allocateIntPop'},con: {title:"allocateCon",popover:'conText',allocatepop:'allocateConPop'},per: {title:"allocatePer",popover:'perText',allocatepop:'allocatePerPop'} }
|
||||
-
|
||||
var stats = {
|
||||
str: { title:"allocateStr",popover:'strengthText',allocatepop:'allocateStrPop' },
|
||||
int: { title:"allocateInt",popover:'intText',allocatepop:'allocateIntPop' },
|
||||
con: { title:"allocateCon",popover:'conText',allocatepop:'allocateConPop' },
|
||||
per: { title:"allocatePer",popover:'perText',allocatepop:'allocatePerPop' }
|
||||
}
|
||||
|
||||
each statInfo, stat in stats
|
||||
tr
|
||||
td
|
||||
span.hint(popover-trigger='mouseenter', popover-placement='right', popover=env.t(statInfo.popover))
|
||||
=env.t(statInfo.title) + ' {{user.stats.' + stat + '}}'
|
||||
td
|
||||
a.btn.btn-primary(ng-show='user.stats.points', ng-click='allocate("#{stat}")', popover-trigger='mouseenter', popover-placement='right', popover=env.t(statInfo.allocatepop)) +
|
||||
a.btn.btn-primary(ng-show='user.stats.points', ng-click='allocate("#{stat}")',
|
||||
popover-trigger='mouseenter', popover-placement='right', popover=env.t(statInfo.allocatepop)) +
|
||||
|
||||
@@ -17,9 +17,11 @@ script(type='text/ng-template', id='modals/levelUp.html')
|
||||
p=env.t('fullyHealed')
|
||||
br
|
||||
div(ng-if='user.flags.classSelected && !user.preferences.disableClasses && !user.preferences.automaticAllocation')
|
||||
a.btn.btn-default(data-toggle='collapse', data-target='#stat-allocation', aria-expanded=false, aria-controls='stat-allocation')=env.t('showHideQuickAllocation')
|
||||
a.btn.btn-default(ng-click='statsAllocationBoxIsOpen = !statsAllocationBoxIsOpen',
|
||||
data-toggle='collapse', data-target='#stat-allocation', aria-expanded=false, aria-controls='stat-allocation')
|
||||
| {{statsAllocationBoxIsOpen ? env.t('hideQuickAllocation') : env.t('showQuickAllocation')}}
|
||||
p
|
||||
div.collapse#stat-allocation
|
||||
.collapse#stat-allocation
|
||||
table.table.text-left
|
||||
tr
|
||||
td
|
||||
|
||||
Reference in New Issue
Block a user