From 6117dc75dd87ae4bb2c33ed29e69c6c25674961a Mon Sep 17 00:00:00 2001 From: haunter Date: Mon, 20 Apr 2026 16:04:20 +0300 Subject: [PATCH] fix time and cost v1 --- GrepolisRemoteControl.user.js | 4 ++-- static/js/components/commandForm.js | 18 ++++-------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/GrepolisRemoteControl.user.js b/GrepolisRemoteControl.user.js index 00a8e37..b9c6a8e 100644 --- a/GrepolisRemoteControl.user.js +++ b/GrepolisRemoteControl.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Grepolis Remote Control // @namespace http://tampermonkey.net/ -// @version 1.6 +// @version 1.7 // @description Polls grepo.haunter-pets.top for remote commands and executes them in-game // @author Dimitrios // @match https://*.grepolis.com/game/* @@ -107,7 +107,7 @@ stone: buildDataRaw[k].resources_for?.stone || 0, iron: buildDataRaw[k].resources_for?.iron || 0, pop: buildDataRaw[k].population_for || 0, - build_time: buildDataRaw[k].build_time || 0 + build_time: buildDataRaw[k].build_time || buildDataRaw[k].time || buildDataRaw[k].building_time || buildDataRaw[k].real_build_time || 0 }; } } catch (e) { diff --git a/static/js/components/commandForm.js b/static/js/components/commandForm.js index 9a660e1..8193d93 100644 --- a/static/js/components/commandForm.js +++ b/static/js/components/commandForm.js @@ -35,30 +35,20 @@ window.renderBuildingDropdown = function() { const data = bData[key]; let text = `${nameGr} [Επίπεδο ${level}]`; - let buildable = true; - if (data) { + if (data && data.dependencies) { const w = window.fmt(data.wood || 0); const st = window.fmt(data.stone || 0); const i = window.fmt(data.iron || 0); const t = formatTime(data.build_time); - buildable = data.buildable; - // Only show costs if the prerequisites are fulfilled and it's not max level - if (data.dependencies) { - text += ` — Ξ:${w} Π:${st} Α:${i} · ⏱ ${t}`; - } else { - text += ` — (Μη διαθέσιμο)`; - } + // Only show costs if the prerequisites are fulfilled + text += ` — Ξ:${w} Π:${st} Α:${i} · ⏱ ${t}`; } const option = document.createElement('option'); option.value = key; - option.textContent = (!buildable && data?.dependencies) ? `❌ ${text}` : text; - - if (!buildable) { - option.style.color = '#aa5555'; - } + option.textContent = text; bSelect.appendChild(option); }