docs: explain shared game page helpers

This commit is contained in:
nyan404 committed 2026-08-25 04:27:54 +03:00
1 parent 915ac6bfb8
commit 67688052bd
1 file changed
+8
+8
View File
@@ -313,6 +313,7 @@
}`); }`);
} }
// Initializes helpers shared by profiles, blogs, messages, and other pages.
function site() { // Весь сайт, кроме Игровой и её разделов function site() { // Весь сайт, кроме Игровой и её разделов
if (globals.on_deletionWarning) { if (globals.on_deletionWarning) {
const el = $('.other_cats_list').first(); const el = $('.other_cats_list').first();
@@ -350,6 +351,7 @@
} }
} }
} }
// Initializes the main game page and installs its dynamic DOM observers.
function cw3() { //Игровая function cw3() { //Игровая
if (globals.on_settLink) { if (globals.on_settLink) {
$('.small').first().append(` | <a href="/settings">Настройки модов</a>`); //Настройки мода $('.small').first().append(` | <a href="/settings">Настройки модов</a>`); //Настройки мода
@@ -530,6 +532,7 @@
let firstNote = ""; let firstNote = "";
let rang = true; let rang = true;
// Updates the smell countdown and triggers the configured alert at zero.
function smellTimerTick() { function smellTimerTick() {
let val = parseInt($('#cws_smell_timer').attr('value')); let val = parseInt($('#cws_smell_timer').attr('value'));
if (val) { if (val) {
@@ -849,6 +852,7 @@
}); });
} }
if (globals.on_actNotif) { if (globals.on_actNotif) {
// Maps an action label to the corresponding configured sound/text key.
function which_action(text) { function which_action(text) {
const act_detect = { const act_detect = {
"move": "Переход", "move": "Переход",
@@ -1265,6 +1269,7 @@
"Воевода": "воеводу" "Воевода": "воеводу"
}; };
// Converts a raw game title into the localized display form.
function title_convert(title) { function title_convert(title) {
return convert[title] || title; return convert[title] || title;
} }
@@ -1628,6 +1633,7 @@
$('.cws-tt-table[page=' + page + ']').show(); $('.cws-tt-table[page=' + page + ']').show();
} }
// Applies a saved minefield panel style to one DOM element.
function tt_setStyle($elem, style) { function tt_setStyle($elem, style) {
$elem.removeClass('cws-tt-safe cws-tt-unsafe cws-tt-move').addClass(style); $elem.removeClass('cws-tt-safe cws-tt-unsafe cws-tt-move').addClass(style);
if (proj) { if (proj) {
@@ -1637,6 +1643,7 @@
} }
} }
// Renders the configurable minefield panel and its page controls.
function tt_draw() { function tt_draw() {
$('.cws-tt-table[page=' + page + '] td.cws-tt-safe, .cws-tt-table[page=' + page + '] td.cws-tt-unsafe, .cws-tt-table[page=' + page + '] td.cws-tt-move').each(function () { $('.cws-tt-table[page=' + page + '] td.cws-tt-safe, .cws-tt-table[page=' + page + '] td.cws-tt-unsafe, .cws-tt-table[page=' + page + '] td.cws-tt-move').each(function () {
let col = $(this).index(); let col = $(this).index();
@@ -1726,6 +1733,7 @@
}); });
} }
if (globals.on_paramInfo) { if (globals.on_paramInfo) {
// Formats seconds as the compact timer string used in game panels.
function timeConv(sec) { function timeConv(sec) {
let str = ""; let str = "";
let hr = parseInt(sec / 3600); let hr = parseInt(sec / 3600);