quick tidying
This commit is contained in:
parent
5526098a05
commit
248592dbff
@ -73,6 +73,7 @@ function record_log_with_choices() {
|
|||||||
|
|
||||||
var btn_action = document.createElement("button");
|
var btn_action = document.createElement("button");
|
||||||
btn_action.innerHTML = label;
|
btn_action.innerHTML = label;
|
||||||
|
btn_action.className = "log-action-button";
|
||||||
btn_action.setAttribute("onclick", callback + "; tick_meter_running = true;");
|
btn_action.setAttribute("onclick", callback + "; tick_meter_running = true;");
|
||||||
div_logactions.append(btn_action);
|
div_logactions.append(btn_action);
|
||||||
}
|
}
|
||||||
@ -89,6 +90,7 @@ function update_ui() {
|
|||||||
page_elements["lbl_colony"].innerHTML = gamestate["colony"];
|
page_elements["lbl_colony"].innerHTML = gamestate["colony"];
|
||||||
page_elements["lbl_shinies"].innerHTML = gamestate["shinies"];
|
page_elements["lbl_shinies"].innerHTML = gamestate["shinies"];
|
||||||
page_elements["lbl_food"].innerHTML = gamestate["food"];
|
page_elements["lbl_food"].innerHTML = gamestate["food"];
|
||||||
|
page_elements["lbl_class"].innerHTML = gamestate["class"];
|
||||||
page_elements["lbl_xp"].innerHTML = gamestate["xp"];
|
page_elements["lbl_xp"].innerHTML = gamestate["xp"];
|
||||||
page_elements["lbl_xp_next"].innerHTML = gamestate["xp_next"];
|
page_elements["lbl_xp_next"].innerHTML = gamestate["xp_next"];
|
||||||
}
|
}
|
||||||
@ -108,7 +110,7 @@ function dev_toolbox(open) {
|
|||||||
else {
|
else {
|
||||||
var div_toolbox = page_elements["div_toolbox"];
|
var div_toolbox = page_elements["div_toolbox"];
|
||||||
page_elements["div_sidebar"].removeChild(div_toolbox);
|
page_elements["div_sidebar"].removeChild(div_toolbox);
|
||||||
div_toolbox.remove()
|
div_toolbox.remove();
|
||||||
delete page_elements["div_toolbox"];
|
delete page_elements["div_toolbox"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -170,10 +172,10 @@ async function game_tick() {
|
|||||||
var logstring = "You have encountered a human. It is carrying these resources:\n\n"
|
var logstring = "You have encountered a human. It is carrying these resources:\n\n"
|
||||||
logstring += "<ol>\n"
|
logstring += "<ol>\n"
|
||||||
if (total_food > 0) {
|
if (total_food > 0) {
|
||||||
logstring += "<li><b>" + total_food + " food:</b> " + food_descs.join(", ") + "</li>\n";
|
logstring += `<li><b>${total_food} food:</b> ${food_descs.join(", ")}</li>\n`;
|
||||||
}
|
}
|
||||||
if (total_shinies > 0) {
|
if (total_shinies > 0) {
|
||||||
logstring += "<li><b>" + total_shinies + " shinies:</b> " + shinies_descs.join(", ") + "</li>\n";
|
logstring += `<li><b>${total_shinies} shinies:</b> ${shinies_descs.join(", ")}</li>\n`;
|
||||||
}
|
}
|
||||||
logstring += "</ol>\nWhat would you like to do?";
|
logstring += "</ol>\nWhat would you like to do?";
|
||||||
|
|
||||||
@ -224,7 +226,7 @@ if (desktop_mode) {
|
|||||||
target = window;
|
target = window;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// in web mode, browsers are expected to have working local storage
|
// in web mode, browsers are expected to have working local storage by this point
|
||||||
start_event = "DOMContentLoaded";
|
start_event = "DOMContentLoaded";
|
||||||
target = document;
|
target = document;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user