Fix reroll click bug that probably didnt matter

This commit is contained in:
Eric Fredricksen
2010-07-04 22:17:49 -07:00
parent 57a80fa07c
commit fa5475a2f1
2 changed files with 16 additions and 14 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ input, button { display: inline; }
<div id="titlebar"> <div id="titlebar">
<img src="swords.gif"> <img src="swords.gif">
<span>Progress Quest/web v8.0</span> <span>Progress Quest - New Character</span>
</div> </div>
<div class="hbox"> <div class="hbox">
+15 -13
View File
@@ -21,7 +21,6 @@ var stats = {"history":[]};
function RollEm() { function RollEm() {
var Total = $("#Total"); var Total = $("#Total");
var ReRoll = $("#ReRoll");
stats.seed = randseed(); stats.seed = randseed();
stats.total = stats.total =
Roll("STR") + Roll("STR") +
@@ -32,7 +31,8 @@ function RollEm() {
Roll("CHA"); Roll("CHA");
Total.text(stats.total); Total.text(stats.total);
var color = (stats.total >= (63+18)) ? 'red' : var color =
(stats.total >= (63+18)) ? 'red' :
(stats.total > (4 * 18)) ? 'yellow' : (stats.total > (4 * 18)) ? 'yellow' :
(stats.total <= (63-18)) ? 'grey' : (stats.total <= (63-18)) ? 'grey' :
(stats.total < (3 * 18)) ? 'silver' : (stats.total < (3 * 18)) ? 'silver' :
@@ -48,6 +48,11 @@ function RerollClick() {
} }
function UnrollClick() {
randseed(stats.history.pop());
RollEm();
}
function fill(e, a, n) { function fill(e, a, n) {
var def = Random(a.length); var def = Random(a.length);
for (var i = 0; i < a.length; ++i) { for (var i = 0; i < a.length; ++i) {
@@ -62,30 +67,27 @@ $(document).ready(function () {
fill("#races", K.Races, "Race"); fill("#races", K.Races, "Race");
fill("#classes", K.Klasses, "Class"); fill("#classes", K.Klasses, "Class");
$("#Reroll").click(function(){RerollClick();}); $("#Reroll").click(RerollClick);
$("#Unroll").click(function(){UnrollClick();}); $("#Unroll").click(UnrollClick);
$("#RandomName").click(GenClick);
$('#Sold').click(sold);
$('#Cancel').click(cancel);
//var caption = 'Progress Quest - New Character'; //var caption = 'Progress Quest - New Character';
//if (MainForm.GetHostName != '') //if (MainForm.GetHostName != '')
// caption = caption + ' [' + MainForm.GetHostName + ']'; // caption = caption + ' [' + MainForm.GetHostName + ']';
RollEm();
$("#RandomName").click(GenClick);
if (!$("#Name").text()) { if (!$("#Name").text()) {
GenClick(); GenClick();
$("#Name")[0].focus(); $("#Name")[0].focus();
$("#Name")[0].select(); $("#Name")[0].select();
} }
$('#Sold').click(sold);
$('#Cancel').click(cancel); seed = new Alea();
RollEm();
}); });
function UnrollClick() {
randseed(stats.history.pop());
RollEm();
}
/* Multiplayer: /* Multiplayer:
function TNewGuyForm_ParseSoldResponse(body) { function TNewGuyForm_ParseSoldResponse(body) {