diff --git a/app/pylocal/core.py b/app/pylocal/core.py index 2646049..dc67b4a 100644 --- a/app/pylocal/core.py +++ b/app/pylocal/core.py @@ -36,7 +36,7 @@ def render_base_context(): base_context["scripts"] = ["https://cdn.otl-hga.net/seagull/js/seagull.js"] base_context["seagull_pic"] = "https://cdn.otl-hga.net/seagull/image/seagull.jpg" else: # dev, serve files from here - print(base_domain) + #print(base_domain) base_context["styles"] = [app.url_for("static", filename="css/seagull.css")] base_context["scripts"] = [app.url_for("static", filename="js/seagull.js")] base_context["seagull_pic"] = app.url_for("static", filename="image/seagull.jpg") diff --git a/static/js/seagull.js b/static/js/seagull.js index c602d7a..08af011 100644 --- a/static/js/seagull.js +++ b/static/js/seagull.js @@ -1,3 +1,6 @@ +const ver_numeric = 0; +const ver_string = "pre alpha"; + const sleep = ms => new Promise(r => setTimeout(r, ms)); // sleep(int ms) var page_elements = {}; @@ -16,8 +19,14 @@ const gamestate_default = { function prepare_gamestate() { var gamestate_loaded = window.localStorage.getItem("gamestate"); - if (gamestate_loaded == null) { gamestate = structuredClone(gamestate_default); } - else { gamestate = JSON.parse(gamestate_loaded); } + if (gamestate_loaded == null) { + record_log("Welcome to Seagull Game! We haven't found a save in your browser storage, so we're starting a new game!"); + gamestate = structuredClone(gamestate_default); + } + else { + gamestate = JSON.parse(gamestate_loaded); + record_log("Welcome back! Game loaded.") + } } function record_log(text) { @@ -95,7 +104,7 @@ document.addEventListener("DOMContentLoaded", function (ev) { prepare_gamestate(); - record_log("It works!"); + record_log("seagull game ver. " + ver_string); page_elements["lbl_name"].innerHTML = gamestate["name"]; page_elements["lbl_tick"].innerHTML = gamestate["tick"];