docs: explain CatWar mod calculator helpers
This commit is contained in:
1 parent
f9da8094e1
commit
31275b0ae6
1 file changed
+5
@@ -2018,6 +2018,7 @@ function activityCalc(catId) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Keeps the goal calculator's Russian hour label grammatically correct.
|
||||||
// Keeps the goal calculator's Russian hour label grammatically correct.
|
// Keeps the goal calculator's Russian hour label grammatically correct.
|
||||||
function updateHourWord() {
|
function updateHourWord() {
|
||||||
const hours = sets[catId].hours;
|
const hours = sets[catId].hours;
|
||||||
@@ -2025,6 +2026,7 @@ function activityCalc(catId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Converts an action duration descriptor into minutes for goal calculations.
|
// Converts an action duration descriptor into minutes for goal calculations.
|
||||||
|
// Converts an action duration descriptor into minutes for calculations.
|
||||||
function actLength(d) {
|
function actLength(d) {
|
||||||
const minus = sets[catId].minus || 0;
|
const minus = sets[catId].minus || 0;
|
||||||
if (d <= 14) return 150 - minus;
|
if (d <= 14) return 150 - minus;
|
||||||
@@ -2033,6 +2035,7 @@ function activityCalc(catId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Estimates remaining training time from current progress and daily capacity.
|
// Estimates remaining training time from current progress and daily capacity.
|
||||||
|
// Estimates remaining training time from progress and daily capacity.
|
||||||
function left(currentActivity, goal, hoursPerDay) {
|
function left(currentActivity, goal, hoursPerDay) {
|
||||||
const secsPerDay = convertTime('h s', hoursPerDay);
|
const secsPerDay = convertTime('h s', hoursPerDay);
|
||||||
if (actLength(currentActivity) * 4 + 1 > secsPerDay) {
|
if (actLength(currentActivity) * 4 + 1 > secsPerDay) {
|
||||||
@@ -2070,6 +2073,7 @@ function activityCalc(catId) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Recalculates and renders the visible remaining-time estimate.
|
||||||
// Recalculates and renders the visible remaining-time estimate.
|
// Recalculates and renders the visible remaining-time estimate.
|
||||||
function updateToact() {
|
function updateToact() {
|
||||||
if (progress.stage === actStages.length - 1) {
|
if (progress.stage === actStages.length - 1) {
|
||||||
@@ -2748,6 +2752,7 @@ function getSavedLsById(lsId) {
|
|||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
// Synchronizes the calculator with the currently selected training page.
|
// Synchronizes the calculator with the currently selected training page.
|
||||||
|
// Initializes the training-time calculator and its form interactions.
|
||||||
function changeTimePage() {
|
function changeTimePage() {
|
||||||
const catTimeNow = timestampToCatTime(Date.now());
|
const catTimeNow = timestampToCatTime(Date.now());
|
||||||
$(isDesctop ? '#branch' : '#site_table').append(`
|
$(isDesctop ? '#branch' : '#site_table').append(`
|
||||||
|
|||||||
Reference in new issue
Block a user