some work done on character sheets

This commit is contained in:
2025-08-22 13:01:58 -07:00
parent 5c3d34aafa
commit 621d65b9e5
10 changed files with 165 additions and 5 deletions

View File

@@ -22,7 +22,9 @@ const gamestate_default = {
"xp": 0,
"xp_next": 50,
"enc_human": "pause",
"enc_seagull": "pause"
"enc_seagull": "pause",
"agility": 0,
"instinct": 0
};
var bool_log_alt = false
@@ -84,6 +86,38 @@ function record_log_with_choices() {
tick_meter_running = false;
}
var modal_dialog_open = false;
var dialog_queue = [];
function modal_no_prop(event) { event.stopPropagation(); }
async function open_modal_dialog(dialog) {
var modal_background = document.getElementById("modal-background");
if (!modal_background) {
modal_background = document.createElement("div");
modal_background.setAttribute("id", "modal-background");
}
var modal_root = document.getElementById("modal");
if (!modal_root) {
modal_root = document.createElement("div");
modal_root.setAttribute("id", "modal");
modal_root.onclick = modal_no_prop;
modal_background.appendChild(modal_root);
}
if (!modal_dialog_open) {
tick_meter_running = false;
modal_dialog_open = true;
modal_background.style = "z-index: 10 !important; visibility: visible !important;";
}
dialog_data = await fetch(`/dialog/${dialog}`)
.then(res => { return res.text(); });
modal_root.innerHTML = dialog_data;
}
function update_ui() {
page_elements["lbl_name"].innerHTML = gamestate["name"];
page_elements["lbl_tick"].innerHTML = gamestate["tick"];