Релиз v1.2.9
Build release archive / release (push) Failing after 28s

Изменено:
 - Поддержка новых типов товаров: "Механические приспособления" и "Религиозные товары".
 - Добавлена возможность случайной генерации уровня торговца.
 - Улучшена производительность при загрузке предметов из компендиумов.
 - Обновлены тексты описаний для категорий товаров.
 - Исправлена ошибка при добавлении предметов к торговцу (см. `module/data.mjs`, строки 2436-2446).
 - Исправлена проблема с отображением характеристик торговца в интерфейсе.
This commit is contained in:
2026-07-15 19:42:45 +03:00
parent 34782dc3b0
commit e21d8c5198
5611 changed files with 163869 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
/**
* Returns a random integer between 0 (inclusive) and the specified maximum (exclusive).
*
* @param {number} max - The maximum value (exclusive).
* @returns {number} A random integer between 0 (inclusive) and the specified maximum (exclusive).
*/
export function getRandomInt(max) {
return Math.floor(Math.random() * max);
}
/**
* Loads items from a specified folder and returns them as an array of objects.
*
* @param {string} path - The path to the folder containing the items.
* @returns {Promise<Array<Object>>} An array of objects representing the loaded items.
**/
export async function loadItemsFromFolder(path) {
const items = [];
const fileList = await FilePicker.browse('data', path);
for (let file of fileList.files) {
const response = await fetch(file);
try {
const itemData = await response.json();
items.push(itemData);
} catch (e) {
console.error(`Ошибка загрузки файла ${file}: ${e}`);
}
}
return items;
}