createEatMeatButton: function(weaponName) {
// if (cooldown == null) {
// cooldown = Events._EAT_COOLDOWN;
// }
var btn = new Button.Button({
id: 'attack_' + weaponName.replace(' ', '-'),
text: _('eat meat'),
// cooldown: cooldown,
click: Events.useWeapon,
cost: { 'cured meat': 1 }
});
if(Path.outfit['cured meat'] === 0) {
Button.setDisabled(btn, true);
}
return btn;
},
以上代码中ID为'attack_' + weaponName.replace(' ', '-')时,程序会出错,而改为其它值时,程序正常。
我的问题是为什么 ID不能取这个值。
// if (cooldown == null) {
// cooldown = Events._EAT_COOLDOWN;
// }
var btn = new Button.Button({
id: 'attack_' + weaponName.replace(' ', '-'),
text: _('eat meat'),
// cooldown: cooldown,
click: Events.useWeapon,
cost: { 'cured meat': 1 }
});
if(Path.outfit['cured meat'] === 0) {
Button.setDisabled(btn, true);
}
return btn;
},
以上代码中ID为'attack_' + weaponName.replace(' ', '-')时,程序会出错,而改为其它值时,程序正常。
我的问题是为什么 ID不能取这个值。