From 58ef9f6ae29d6223b04ec1217cf99845fdfadb0c Mon Sep 17 00:00:00 2001 From: Nyan404 Date: Tue, 25 Aug 2026 04:26:33 +0300 Subject: [PATCH] docs: explain CatWar goal calculator helpers --- web/CatWarMod.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web/CatWarMod.js b/web/CatWarMod.js index 86b0473..a027616 100644 --- a/web/CatWarMod.js +++ b/web/CatWarMod.js @@ -2007,11 +2007,13 @@ function activityCalc(catId) { }); } + // Keeps the goal calculator's Russian hour label grammatically correct. function updateHourWord() { const hours = sets[catId].hours; $('#hour-word').text(declOfNum(hours, ['час', 'часа', 'часов'])); } + // Converts an action duration descriptor into minutes for goal calculations. function actLength(d) { const minus = sets[catId].minus || 0; if (d <= 14) return 150 - minus; @@ -2019,6 +2021,7 @@ function activityCalc(catId) { else return Math.ceil(150 - d / 15) - minus; } + // Estimates remaining training time from current progress and daily capacity. function left(currentActivity, goal, hoursPerDay) { const secsPerDay = convertTime('h s', hoursPerDay); if (actLength(currentActivity) * 4 + 1 > secsPerDay) { @@ -2056,6 +2059,7 @@ function activityCalc(catId) { }; } + // Recalculates and renders the visible remaining-time estimate. function updateToact() { if (progress.stage === actStages.length - 1) { $('#toact').hide(); @@ -2732,6 +2736,7 @@ function getSavedLsById(lsId) { } } /* + // Synchronizes the calculator with the currently selected training page. function changeTimePage() { const catTimeNow = timestampToCatTime(Date.now()); $(isDesctop ? '#branch' : '#site_table').append(`