diff --git a/src/DashboardView/VillageStateList.vue b/src/DashboardView/VillageStateList.vue
index 0ffca11..feb5f1c 100644
--- a/src/DashboardView/VillageStateList.vue
+++ b/src/DashboardView/VillageStateList.vue
@@ -8,15 +8,16 @@
Глина |
Железо |
Зерно |
- Время |
+ Рес. |
+ Очередь |
-
+ |
{{ villageState.village.name }}
- (ред)
+ [ред]:
|
|
|
+ |
@@ -64,6 +66,7 @@
|
+ |
@@ -100,112 +103,57 @@
:sign="false"
>
- |
-
-
-
- Баланс задачи: |
-
-
- |
-
-
- |
-
-
- |
-
-
- |
- |
-
-
-
- {{ queueTitle(queueState.queue) }}: |
-
-
- |
-
-
- |
-
-
- |
-
-
- |
- |
-
-
-
- Баланс фронтира: |
-
-
- |
-
-
- |
-
-
- |
-
-
- |
- |
-
-
-
- Баланс очереди: |
-
-
- |
-
-
- |
-
-
- |
-
-
- |
- |
-
-
-
- Обязательства: |
-
-
- |
-
-
- |
-
-
- |
-
-
- |
- |
-
-
- Торговцы: |
-
-
- |
-
-
- |
-
-
- |
-
-
- |
+ |
|
+
+
+
+
+
+
+
+
+
+
+
+
+
- |
-
+ |
- |
- |
+ |
|
@@ -246,6 +193,7 @@ import { COLLECTION_POINT_ID, HORSE_STABLE_ID, MARKET_ID, QUARTERS_ID } from '..
import { path } from '../Helpers/Path';
import { Actions } from './Store';
import { translateProductionQueue } from '../Core/ProductionQueue';
+import VillageStateResourceLine from './VillageStateResourceLine';
function secondsToTime(value) {
if (value === 0) {
@@ -259,8 +207,9 @@ function secondsToTime(value) {
export default {
components: {
- resource: ResourceBalance,
- filling: VillageResource,
+ 'resource': ResourceBalance,
+ 'filling': VillageResource,
+ 'resource-line': VillageStateResourceLine,
},
data() {
return {
diff --git a/src/DashboardView/VillageStateResourceLine.vue b/src/DashboardView/VillageStateResourceLine.vue
new file mode 100644
index 0000000..9ef355e
--- /dev/null
+++ b/src/DashboardView/VillageStateResourceLine.vue
@@ -0,0 +1,95 @@
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+ |
+ |
+
+
+
+
+
+
diff --git a/src/VillageState.ts b/src/VillageState.ts
index b10e382..df329fe 100644
--- a/src/VillageState.ts
+++ b/src/VillageState.ts
@@ -7,6 +7,7 @@ import { VillageRepositoryInterface } from './VillageRepository';
import { VillageNotFound } from './Errors';
import { ProductionQueue, ProductionQueueTypes } from './Core/ProductionQueue';
import { Task } from './Queue/TaskProvider';
+import { timestamp } from './utils';
interface VillageStorageState {
resources: Resources;
@@ -37,10 +38,12 @@ interface ResourceLineState {
interface VillageProductionQueueState {
queue: ProductionQueue;
- active: boolean;
- ts: number;
+ isActive: boolean;
+ currentTaskFinishTimestamp: number;
+ currentTaskFinishSeconds: number;
firstTask: ResourceLineState;
allTasks: ResourceLineState;
+ taskCount: number;
}
interface VillageOwnState {
@@ -140,13 +143,16 @@ function createProductionQueueState(
const firstTaskResources = tasks.slice(0, 1).reduce(taskResourceReducer, Resources.zero());
const allTaskResources = tasks.reduce(taskResourceReducer, Resources.zero());
+ const taskEndingTimestamp = storage.getQueueTaskEnding(queue);
return {
queue,
- active: tasks.length !== 0,
- ts: storage.getQueueTaskEnding(queue),
+ isActive: tasks.length !== 0 || taskEndingTimestamp !== 0,
+ currentTaskFinishTimestamp: taskEndingTimestamp,
+ currentTaskFinishSeconds: taskEndingTimestamp ? taskEndingTimestamp - timestamp() : 0,
firstTask: calcResourceBalance(firstTaskResources, resources, performance),
allTasks: calcResourceBalance(allTaskResources, resources, performance),
+ taskCount: tasks.length,
};
}