refactor: Adjust stat allocation modal

This commit is contained in:
Blade Barringer
2016-03-16 22:06:13 -05:00
parent a639038a41
commit 3f16cd4fbf
3 changed files with 17 additions and 5 deletions

View File

@@ -161,6 +161,7 @@
"con": "CON", "con": "CON",
"per": "PER", "per": "PER",
"int": "INT", "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." "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."
} }

View File

@@ -35,10 +35,19 @@ mixin ownedQuests(popoverAppend, popoverPlacement)
.badge.badge-info.stack-count {{points}} .badge.badge-info.stack-count {{points}}
mixin statAllocation 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 tr
td td
span.hint(popover-trigger='mouseenter', popover-placement='right', popover=env.t(statInfo.popover)) span.hint(popover-trigger='mouseenter', popover-placement='right', popover=env.t(statInfo.popover))
=env.t(statInfo.title) + ' {{user.stats.' + stat + '}}' =env.t(statInfo.title) + ' {{user.stats.' + stat + '}}'
td 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)) +

View File

@@ -17,9 +17,11 @@ script(type='text/ng-template', id='modals/levelUp.html')
p=env.t('fullyHealed') p=env.t('fullyHealed')
br br
div(ng-if='user.flags.classSelected && !user.preferences.disableClasses && !user.preferences.automaticAllocation') 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   p  
div.collapse#stat-allocation .collapse#stat-allocation
table.table.text-left table.table.text-left
tr tr
td td