mirror of
https://bitbucket.org/grumdrig/pq-web.git
synced 2026-09-29 08:44:00 -06:00
Restore the pq6.2 levelling schedule. Some half-baked online game support from 2018 that's now commented out.
This commit is contained in:
committed by
Eric Fredricksen
parent
40df70eac4
commit
60c28cd79b
@@ -1,6 +1,6 @@
|
||||
|
||||
|
||||
function load() {
|
||||
|
||||
|
||||
if (!window.localStorage) {
|
||||
roster.html("<b>Hrumph:</b> This browser does not support local storage. You can still play fast and loose: your character will live only as long as the game stays running in your browser.");
|
||||
return;
|
||||
@@ -14,30 +14,30 @@ function loadGames(games) {
|
||||
roster.empty();
|
||||
|
||||
var newone = window.location.href.split('#')[1];
|
||||
|
||||
|
||||
var count = 0;
|
||||
|
||||
$.each(games, function (key, c) {
|
||||
var name = c.Traits.Name;
|
||||
|
||||
|
||||
var br = brag(c);
|
||||
roster.append(br);
|
||||
br.find("a.go").attr("href", "main.html#" + escape(name));
|
||||
|
||||
|
||||
br.find("a.x").click(function () {
|
||||
if (confirm("Terminate " + Pick(["faithful","noble","loyal","brave"])+
|
||||
if (confirm("Terminate " + Pick(["faithful","noble","loyal","brave"])+
|
||||
" " + name + "?")) {
|
||||
delete games[name];
|
||||
storage.storeRoster(games);
|
||||
load();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
br.find("a.sheet").click(function () {
|
||||
alert(template($("#sheet").html(), games[name]));
|
||||
// TODO: put in a window or whatev
|
||||
});
|
||||
|
||||
|
||||
if (name === newone)
|
||||
br.addClass("lit");
|
||||
|
||||
@@ -49,18 +49,24 @@ function loadGames(games) {
|
||||
|
||||
++count;
|
||||
});
|
||||
if (!count)
|
||||
if (!count)
|
||||
roster.html("<i>Games you start can be loaded from this page, but no saved games were found. Roll up a new character to get started.</i>");
|
||||
}
|
||||
|
||||
|
||||
function brag(sheet) {
|
||||
var brag = $(template($("#badge").html(), sheet));
|
||||
if (sheet.motto)
|
||||
if (sheet.motto) {
|
||||
brag.find(".bs").text('"' + sheet.motto + '"');
|
||||
}
|
||||
if (sheet.online) {
|
||||
brag.addClass("online");
|
||||
brag.find(".bs").text("Realm of " + sheet.online.realm);
|
||||
brag.find(".icon.go").html("✿");
|
||||
}
|
||||
return brag;
|
||||
}
|
||||
|
||||
|
||||
function clearRoster() {
|
||||
storage.storeRoster({}, load);
|
||||
}
|
||||
@@ -68,14 +74,14 @@ function clearRoster() {
|
||||
$(document).ready(function () {
|
||||
|
||||
load();
|
||||
|
||||
|
||||
$("#roll").click(function () {
|
||||
window.location = "newguy.html";
|
||||
});
|
||||
|
||||
|
||||
$("#test").click(function () {
|
||||
window.location = "newguy.html?sold";
|
||||
});
|
||||
|
||||
|
||||
$("#clear").click(clearRoster);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user