mirror of
https://bitbucket.org/grumdrig/pq-web.git
synced 2026-09-29 00:34:00 -06:00
Make character load if exists in sim.js
This commit is contained in:
@@ -996,7 +996,7 @@ function pause(msec) {
|
|||||||
|
|
||||||
function quit() {
|
function quit() {
|
||||||
$(window).unbind('unload');
|
$(window).unbind('unload');
|
||||||
SaveGame(function () { window.location = "roster.html"; });
|
SaveGame(function () { window.location.href = "roster.html"; });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1037,7 +1037,7 @@ function SaveGame(callback) {
|
|||||||
function LoadGame(sheet) {
|
function LoadGame(sheet) {
|
||||||
if (!sheet) {
|
if (!sheet) {
|
||||||
alert("Error loading game");
|
alert("Error loading game");
|
||||||
window.location = "roster.html";
|
window.location.href = "roster.html";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,9 @@
|
|||||||
// It's not realtime - simulation runs at maximum speed and the
|
// It's not realtime - simulation runs at maximum speed and the
|
||||||
// virtual time elapsed is displayed at each level-up.
|
// virtual time elapsed is displayed at each level-up.
|
||||||
|
|
||||||
|
var CHARACTER = "Shienzid";
|
||||||
|
//var guy = window.location.href.split("#")[1];
|
||||||
|
|
||||||
var window = {
|
var window = {
|
||||||
location: {href: "#Woogle"},
|
location: {href: "#Woogle"},
|
||||||
|
|
||||||
@@ -117,21 +120,12 @@ var cs = 0;
|
|||||||
storage.loadRoster(function (cs) { for (var c in cs) cs++; });
|
storage.loadRoster(function (cs) { for (var c in cs) cs++; });
|
||||||
print(cs, "characters");
|
print(cs, "characters");
|
||||||
|
|
||||||
load("newguy.js");
|
|
||||||
NewGuyFormLoad();
|
|
||||||
traits.Name = "Shienzid";
|
|
||||||
sold();
|
|
||||||
|
|
||||||
write("local.storage", JSON.stringify(window.localStorage.items));
|
|
||||||
|
|
||||||
var guy = window.location.href.split("#")[1];
|
|
||||||
|
|
||||||
load("main.js");
|
|
||||||
|
|
||||||
var timeGetTime = global.timeGetTime = function () {
|
var timeGetTime = global.timeGetTime = function () {
|
||||||
return now;
|
return now;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
load("main.js");
|
||||||
FormCreate();
|
FormCreate();
|
||||||
|
|
||||||
function charsheet(game) {
|
function charsheet(game) {
|
||||||
@@ -151,8 +145,18 @@ for (var j = 1, t = 0; j < 1001; ++j) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var tmpl = read("charsheet.txt");
|
var tmpl = read("charsheet.txt");
|
||||||
storage.loadSheet("Shienzid", function (sheet) {
|
storage.loadSheet(CHARACTER, function (sheet) {
|
||||||
|
if (!sheet) {
|
||||||
|
load("newguy.js");
|
||||||
|
NewGuyFormLoad();
|
||||||
|
traits.Name = CHARACTER;
|
||||||
|
sold();
|
||||||
|
sheet = storage.games[CHARACTER];
|
||||||
|
}
|
||||||
|
//write("local.storage", JSON.stringify(window.localStorage.items));
|
||||||
|
|
||||||
game = sheet;
|
game = sheet;
|
||||||
|
LoadGame(game);
|
||||||
print(template(''+tmpl, sheet));
|
print(template(''+tmpl, sheet));
|
||||||
|
|
||||||
var l = 0;
|
var l = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user