diff --git a/bot.js b/bot.js index 6674d1a..eeb02e6 100644 --- a/bot.js +++ b/bot.js @@ -989,6 +989,11 @@ bot.command('ent_rename', async (ctx) => { if (!enterprise) { return await ctx.reply(`Предприятие с ID ${enterpriseId} не найдено.`) } + + const user = await UserModel.findByPk(ctx.from.id); + if (enterprise.playerId !== user.telegram_id) { + return await ctx.reply('Это не ваше предприятие.'); + } // Переименовываем предприятие await enterprise.update({ name: newName }) diff --git a/public/index.html b/public/index.html index a1b506b..a7a1d93 100644 --- a/public/index.html +++ b/public/index.html @@ -4,228 +4,256 @@ Меню игрока +
-
📜 Меню игрока
+
📜 Меню игрока
@@ -252,11 +280,11 @@ body {
-
+
-
+
@@ -279,33 +307,33 @@ body {
-

👤 Личные данные

-

Имя:

+

👤 Личные данные

+

Имя:

Telegram ID:

-

👤 Профиль

-

Деньги: ₽

-

Грязные деньги: ₽

+

👤 Профиль

+

Деньги:

+

Грязные деньги:

-

🏢 Организация

-

Название:

-

Баланс: ₽

+

🏢 Организация

+

Название:

+

Баланс:

Материалы:

-

🏭 Предприятия

+

🏭 Предприятия

Нет активных предприятий.

-

🗄️ Склад

+

🗄️ Склад

Нет доступного склада.

@@ -328,8 +356,8 @@ body { document.getElementById("telegramID").textContent = user.telegramID; // Профиль - document.getElementById("money").textContent = user.money; - document.getElementById("dirtymoney").textContent = user.dirtymoney; + document.getElementById("money").textContent = "₽" + user.money; + document.getElementById("dirtymoney").textContent = "Ð" + user.dirtymoney; // Устанавливаем картинку профиля const profileImg = document.getElementById("profile-img"); @@ -358,7 +386,6 @@ body { document.getElementById("hp-bar").style.width = `${hpProgress}%`; - document.getElementById("hp-bar").style.backgroundColor = `red`; document.getElementById("hp-bar").textContent = `❤`; document.getElementById("stamina-bar").style.width = `${staminaProgress}%`; document.getElementById("stamina-bar").style.backgroundColor = `green`; @@ -373,7 +400,7 @@ body { // Организация document.getElementById("business-name").textContent = business.name; - document.getElementById("business-balance").textContent = business.balance; + document.getElementById("business-balance").textContent = "₽" + business.balance; document.getElementById("business-materials").textContent = business.materials; // Предприятия @@ -382,18 +409,18 @@ body { enterprisesDiv.innerHTML = ""; enterprises.forEach(ent => { const div = document.createElement("div"); - div.classList.add("enterprise"); + div.classList.add("section"); div.innerHTML = ` ${ent.name}
Тип ресурса: ${getResourceIcon(ent.resourceType)} ${getResourceName(ent.resourceType)}
Уровень: ${ent.level}
Эффективность: ${ent.efficiency}/час
- Заполненность склада: ${ent.currentResources}/${ent.warehouseCapacity} + Заполненность склада: ${ent.currentResources}/${ent.warehouseCapacity}

`; // Добавляем прогрессбар заполненности склада const progress = (ent.currentResources / ent.warehouseCapacity) * 100; const progressBar = document.createElement("div"); - progressBar.innerHTML = `
`; + progressBar.innerHTML = `
`; div.appendChild(progressBar); enterprisesDiv.appendChild(div); }); @@ -412,8 +439,7 @@ body { const warehouseCapacity = warehouse.wood + warehouse.coal + warehouse.oil + warehouse.metall + warehouse.gold + warehouse.diamond; const progress = (warehouseCapacity / warehouse.capacity) * 100; const progressBar = document.createElement("div"); - progressBar.classList.add("progress-bar"); - progressBar.innerHTML = `
`; + progressBar.innerHTML = `
`; warehouseDiv.appendChild(progressBar); }) .catch(err => { diff --git a/public/scoreboard.html b/public/scoreboard.html index f4c174f..3d5352b 100644 --- a/public/scoreboard.html +++ b/public/scoreboard.html @@ -5,12 +5,12 @@ Таблица лидеров - +