Simplified Bonus-Output

This commit is contained in:
Oliver Rümpelein 2014-10-18 18:28:18 +02:00
parent d315d38c39
commit 8c7a8f9777

View file

@ -298,40 +298,26 @@
sel_bon: function() { sel_bon: function() {
var outstr="<p>"; var outstr="<p>";
outstr += "Boni?<br>"; outstr += "Boni?<br>";
outstr += "Waffenbonus Nahkampf: <input id='wbn' type=numer step=1 min=0></input><br />"; outstr += "Waffenbonus Nahkampf: <input id='wbn' class='bon' type=numer step=1 min=0></input><br />";
outstr += "Waffenbonus Fernkampf: <input id='wbf' type=numer step=1 min=0></input><br>"; outstr += "Waffenbonus Fernkampf: <input id='wbf' class='bon' type=numer step=1 min=0></input><br>";
outstr += "Panzerungsbonus: <input id='pb' type=numer step=1 min=0></input><br>"; outstr += "Panzerungsbonus: <input id='pb' class='bon' type=numer step=1 min=0></input><br>";
outstr += "Zauberbonus: <input id='zb' type=numer step=1 min=0></input><br>"; outstr += "Zauberbonus: <input id='zb' class='bon' type=numer step=1 min=0></input><br>";
$('#uibon').html(outstr); $('#uibon').html(outstr);
$('#wbn').attr("value", cur_sel.extern.weapon_near+"") $('.bon').bind("change", function() {
.bind("change", cur_sel.extern.weapon_near = $('#wbn').val()*1;
function() {cur_sel.extern.weapon_near = this.value*1; cur_sel.extern.weapon_far = $('#wbf').val()*1;
cur_sel.recalc_battle(); cur_sel.extern.armor = $('#pb').val()*1;
cur_sel.printoutput(); cur_sel.extern.chant = $('#zb').val()*1;
} cur_sel.recalc_battle();
); cur_sel.sel_att();
$('#wbf').attr("value", cur_sel.extern.weapon_far) cur_sel.printoutput();
.bind("change", });
function() {cur_sel.extern.weapon_far = this.value*1;
cur_sel.recalc_battle(); $('#wbn').attr("value", cur_sel.extern.weapon_near+"");
cur_sel.printoutput(); $('#wbf').attr("value", cur_sel.extern.weapon_far);
} $('#pb').attr("value",cur_sel.extern.armor);
); $('#zb').attr("value",cur_sel.extern.chant);
$('#pb').attr("value",cur_sel.extern.armor)
.bind("change",
function() {cur_sel.extern.armor = this.value*1;
cur_sel.recalc_battle();
cur_sel.printoutput();
}
);
$('#zb').attr("value",cur_sel.extern.chant)
.bind("change",
function() {cur_sel.extern.chant = this.value*1;
cur_sel.recalc_battle();
cur_sel.printoutput();
}
);
}, },
printoutput: function() { printoutput: function() {
outstr = "<p>"; outstr = "<p>";