From 8c20b0c71ac87203d8acec6fbabefc919ee48560 Mon Sep 17 00:00:00 2001 From: Anton Vakhrushev Date: Thu, 7 May 2020 11:42:59 +0300 Subject: [PATCH] Fix training units --- src/Core/Buildings.ts | 1 + src/Page/BuildingPageController.ts | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Core/Buildings.ts b/src/Core/Buildings.ts index 888e7cd..dbe5284 100644 --- a/src/Core/Buildings.ts +++ b/src/Core/Buildings.ts @@ -7,3 +7,4 @@ export const QUARTERS_ID = 19; export const HORSE_STABLE_ID = 20; export const GUILD_HALL_ID = 24; export const EMBASSY_ID = 25; +export const PALACE_ID = 26; diff --git a/src/Page/BuildingPageController.ts b/src/Page/BuildingPageController.ts index 6ac7a7f..59305c4 100644 --- a/src/Page/BuildingPageController.ts +++ b/src/Page/BuildingPageController.ts @@ -9,7 +9,7 @@ import { BuildBuildingTask } from '../Task/BuildBuildingTask'; import { Resources } from '../Core/Resources'; import { Coordinates } from '../Core/Village'; import { SendResourcesTask } from '../Task/SendResourcesTask'; -import { EMBASSY_ID, HORSE_STABLE_ID, QUARTERS_ID } from '../Core/Buildings'; +import { EMBASSY_ID, HORSE_STABLE_ID, PALACE_ID, QUARTERS_ID } from '../Core/Buildings'; import { BuildingPageAttributes, isForgePage, isGuildHallPage, isMarketSendResourcesPage } from './PageDetectors'; import { createTrainTroopButtons } from './BuildingPage/TrooperPage'; import { createSendResourcesButton } from './BuildingPage/MarketPage'; @@ -51,6 +51,10 @@ export class BuildingPageController { createTrainTroopButtons((troopId, res, count) => this.onScheduleTrainTroopers(troopId, res, count)); } + if (buildTypeId === PALACE_ID && sheetId === 1) { + createTrainTroopButtons((troopId, res, count) => this.onScheduleTrainTroopers(troopId, res, count)); + } + if (isMarketSendResourcesPage()) { createSendResourcesButton((res, crd, scale) => this.onSendResources(res, crd, scale)); }