Git didn't include the client part of Fix #76. Added it now See merge request !50tags/v0.1.2^2
@@ -0,0 +1,47 @@ | |||||
define([ | |||||
], function( | |||||
) { | |||||
var stats = { | |||||
'vit': 'vitality', | |||||
'hpMax': 'vitality', | |||||
'regenHp': 'health regeneration', | |||||
'manaMax': 'maximum mana', | |||||
'regenMana': 'mana regeneration', | |||||
'str': 'strength', | |||||
'int': 'intellect', | |||||
'dex': 'dexterity', | |||||
'armor': 'armor', | |||||
'addCritChance': 'increased crit chance', | |||||
'magicFind': 'magic find', | |||||
'sprintChance': 'sprint chance', | |||||
'dmgPercent': 'to all damage', | |||||
'allAttributes': 'to all attributes', | |||||
'xpIncrease': 'additional xp per kill', | |||||
'elementArcanePercent': 'increased arcane damage', | |||||
'elementFrostPercent': 'increased frost damage', | |||||
'elementFirePercent': 'increased fire damage', | |||||
'elementHolyPercent': 'increased holy damage', | |||||
'elementPhysicalPercent': 'increased physical damage', | |||||
'elementPoisonPercent': 'increased poison damage', | |||||
'elementArcaneResist': 'arcane resistance', | |||||
'elementFrostResist': 'frost resistance', | |||||
'elementFireResist': 'fire resistance', | |||||
'elementHolyResist': 'holy resistance', | |||||
'elementPhysicalResist': 'physical resistance', | |||||
'elementPoisonResist': 'poison resistance', | |||||
'elementAllResist': 'all resistance', | |||||
//This stat is used for gambling when you can't see the stats | |||||
'stats': 'stats' | |||||
}; | |||||
return { | |||||
translate: function(stat) { | |||||
return stats[stat]; | |||||
} | |||||
}; | |||||
}); |
@@ -3,13 +3,15 @@ define([ | |||||
'js/system/client', | 'js/system/client', | ||||
'html!ui/templates/smithing/template', | 'html!ui/templates/smithing/template', | ||||
'css!ui/templates/smithing/styles', | 'css!ui/templates/smithing/styles', | ||||
'html!/ui/templates/smithing/templateItem' | |||||
'html!/ui/templates/smithing/templateItem', | |||||
'js/misc/statTranslations' | |||||
], function( | ], function( | ||||
events, | events, | ||||
client, | client, | ||||
template, | template, | ||||
styles, | styles, | ||||
templateItem | |||||
templateItem, | |||||
statTranslations | |||||
) { | ) { | ||||
return { | return { | ||||
tpl: template, | tpl: template, | ||||
@@ -89,7 +91,7 @@ define([ | |||||
} | } | ||||
result.addStatMsgs.forEach(function(a) { | result.addStatMsgs.forEach(function(a) { | ||||
msg.msg += '<br /> ' + a; | |||||
msg.msg += '<br /> ' + ((a.value > 0) ? '+' : '-') + a.value + ' ' + statTranslations.translate(a.stat); | |||||
}); | }); | ||||
events.emit('onGetAnnouncement', msg); | events.emit('onGetAnnouncement', msg); | ||||
@@ -2,12 +2,14 @@ define([ | |||||
'js/system/events', | 'js/system/events', | ||||
'css!ui/templates/tooltipItem/styles', | 'css!ui/templates/tooltipItem/styles', | ||||
'html!ui/templates/tooltipItem/template', | 'html!ui/templates/tooltipItem/template', | ||||
'html!ui/templates/tooltipItem/templateTooltip' | |||||
'html!ui/templates/tooltipItem/templateTooltip', | |||||
'js/misc/statTranslations' | |||||
], function( | ], function( | ||||
events, | events, | ||||
styles, | styles, | ||||
template, | template, | ||||
tplTooltip | |||||
tplTooltip, | |||||
statTranslations | |||||
) { | ) { | ||||
return { | return { | ||||
tpl: template, | tpl: template, | ||||
@@ -59,7 +61,7 @@ define([ | |||||
stats = Object.keys(tempStats) | stats = Object.keys(tempStats) | ||||
.map(function(s) { | .map(function(s) { | ||||
var statName = this.mapStat(s); | |||||
var statName = statTranslations.translate(s); | |||||
var value = tempStats[s]; | var value = tempStats[s]; | ||||
if (['addCritChance', 'sprintChance', 'dmgPercent', 'xpIncrease'].indexOf(s) > -1) | if (['addCritChance', 'sprintChance', 'dmgPercent', 'xpIncrease'].indexOf(s) > -1) | ||||
@@ -216,44 +218,6 @@ define([ | |||||
if (!canAfford) | if (!canAfford) | ||||
this.tooltip.find('.worth').addClass('no-afford'); | this.tooltip.find('.worth').addClass('no-afford'); | ||||
}, | |||||
mapStat: function(stat) { | |||||
return { | |||||
'vit': 'vitality', | |||||
'hpMax': 'vitality', | |||||
'regenHp': 'health regeneration', | |||||
'manaMax': 'maximum mana', | |||||
'regenMana': 'mana regeneration', | |||||
'str': 'strength', | |||||
'int': 'intellect', | |||||
'dex': 'dexterity', | |||||
'armor': 'armor', | |||||
'addCritChance': 'increased crit chance', | |||||
'magicFind': 'magic find', | |||||
'sprintChance': 'sprint chance', | |||||
'dmgPercent': 'to all damage', | |||||
'allAttributes': 'to all attributes', | |||||
'xpIncrease': 'additional xp per kill', | |||||
'elementArcanePercent': 'increased arcane damage', | |||||
'elementFrostPercent': 'increased frost damage', | |||||
'elementFirePercent': 'increased fire damage', | |||||
'elementHolyPercent': 'increased holy damage', | |||||
'elementPhysicalPercent': 'increased physical damage', | |||||
'elementPoisonPercent': 'increased poison damage', | |||||
'elementArcaneResist': 'arcane resistance', | |||||
'elementFrostResist': 'frost resistance', | |||||
'elementFireResist': 'fire resistance', | |||||
'elementHolyResist': 'holy resistance', | |||||
'elementPhysicalResist': 'physical resistance', | |||||
'elementPoisonResist': 'poison resistance', | |||||
'elementAllResist': 'all resistance', | |||||
//This stat is used for gambling when you can't see the stats | |||||
'stats': 'stats' | |||||
}[stat]; | |||||
} | } | ||||
}; | }; | ||||
}); | }); |