From 342a0ec7b3d79be9a9fd26a143aedd6bfc66cfcb Mon Sep 17 00:00:00 2001 From: Anton Vakhrushev Date: Thu, 16 Apr 2020 18:26:16 +0300 Subject: [PATCH] Add link to send resources --- src/Dashboard/Components/VillageStateList.vue | 24 ++++++++++++++++++- src/Page/VillageBlock.ts | 16 ++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/src/Dashboard/Components/VillageStateList.vue b/src/Dashboard/Components/VillageStateList.vue index 7cc6136..038e999 100644 --- a/src/Dashboard/Components/VillageStateList.vue +++ b/src/Dashboard/Components/VillageStateList.vue @@ -2,27 +2,45 @@
- + +
{{ village.id }} - {{ village.name }}{{ village.id }} - {{ village.name }} Д: {{ resources(village.id).lumber }} Г: {{ resources(village.id).clay }} Ж: {{ resources(village.id).iron }} З: {{ resources(village.id).crop }} + РЕС +
@@ -37,4 +55,8 @@ export default { border-top: 1px solid #ddd; padding: 4px; } + +.village-table td.active { + font-weight: bold; +} diff --git a/src/Page/VillageBlock.ts b/src/Page/VillageBlock.ts index 0f4be6b..9f097a9 100644 --- a/src/Page/VillageBlock.ts +++ b/src/Page/VillageBlock.ts @@ -40,5 +40,19 @@ function grabVillageInfo($el): Village { const id = getNumber(parsedHref.query.newdid); const name = $el.find('.name').text(); const active = $el.hasClass('active'); - return new Village(id, name, active, new Coordinates(0, 0)); + const x = getNumber( + $el + .find('.coordinateX') + .text() + .replace('−‭', '-') + .replace(/[^0-9-]/gi, '') + ); + const y = getNumber( + $el + .find('.coordinateY') + .text() + .replace('−‭', '-') + .replace(/[^0-9-]/gi, '') + ); + return new Village(id, name, active, new Coordinates(x, y)); }