Go through proper channels with test button

This commit is contained in:
Eric Fredricksen
2010-07-07 11:09:50 -07:00
parent 4eac89834f
commit b42ae65fa2
5 changed files with 21 additions and 23 deletions
+11 -4
View File
@@ -85,6 +85,9 @@ $(document).ready(function () {
seed = new Alea();
RollEm();
if (window.location.href.indexOf("?sold") > 0)
sold(); // TODO: cheesy
});
@@ -147,11 +150,15 @@ function sold() {
birthday: ''+new Date(),
birthstamp: +new Date()
};
$.each('STR,CON,DEX,INT,WIS,CHA'.split(','), function (index,value) {
newguy[value] = stats[value];
});
$.each(K.Stats, function (index,value) {
newguy[value] = stats[value];
});
addToRoster(newguy);
window.location = "main.html#" + newguy.name;
// TODO: cheesy
var args = (window.location.href.indexOf("?sold") > 0) ? "?quit" : "";
window.location = "main.html" + args + "#" + newguy.name;
}
function cancel() {