From ae4a952849169d92388ef3a407d91efb89f521fd Mon Sep 17 00:00:00 2001 From: vrachv <52053491+vrachv@users.noreply.github.com> Date: Mon, 30 Dec 2024 00:15:35 +0000 Subject: [PATCH] Add quest_template_locale table --- apps/keira/src/app/routes.ts | 6 ++ apps/keira/src/assets/i18n/de.json | 1 + apps/keira/src/assets/i18n/el.json | 1 + apps/keira/src/assets/i18n/en.json | 1 + apps/keira/src/assets/i18n/es.json | 1 + apps/keira/src/assets/i18n/fr.json | 1 + apps/keira/src/assets/i18n/it.json | 1 + apps/keira/src/assets/i18n/ko.json | 1 + apps/keira/src/assets/i18n/nl.json | 1 + apps/keira/src/assets/i18n/pl.json | 1 + apps/keira/src/assets/i18n/pt.json | 1 + apps/keira/src/assets/i18n/ro.json | 1 + apps/keira/src/assets/i18n/ru.json | 1 + apps/keira/src/assets/i18n/sk.json | 1 + apps/keira/src/assets/i18n/sv.json | 1 + apps/keira/src/assets/i18n/zh.json | 1 + libs/features/quest/src/index.ts | 1 + .../quest/src/quest-handler.service.ts | 6 +- .../quest-template-locale.component.html | 94 +++++++++++++++++++ .../quest-template-locale.component.scss | 0 .../quest-template-locale.component.ts | 45 +++++++++ .../quest-template-locale.service.ts | 19 ++++ .../src/sidebar/sidebar.component.html | 8 ++ .../entities/quest-template-locale.type.ts | 20 ++++ libs/shared/acore-world-model/src/index.ts | 1 + 25 files changed, 214 insertions(+), 1 deletion(-) create mode 100644 libs/features/quest/src/quest-template-locale/quest-template-locale.component.html create mode 100644 libs/features/quest/src/quest-template-locale/quest-template-locale.component.scss create mode 100644 libs/features/quest/src/quest-template-locale/quest-template-locale.component.ts create mode 100644 libs/features/quest/src/quest-template-locale/quest-template-locale.service.ts create mode 100644 libs/shared/acore-world-model/src/entities/quest-template-locale.type.ts diff --git a/apps/keira/src/app/routes.ts b/apps/keira/src/app/routes.ts index 3a93976f10a..813f9a1d53b 100644 --- a/apps/keira/src/app/routes.ts +++ b/apps/keira/src/app/routes.ts @@ -71,6 +71,7 @@ import { QuestOfferRewardComponent, QuestRequestItemsComponent, QuestTemplateAddonComponent, + QuestTemplateLocaleComponent, QuestTemplateComponent, SelectQuestComponent, } from '@keira/features/quest'; @@ -223,6 +224,11 @@ export const KEIRA_ROUTES: Routes = [ component: QuestTemplateAddonComponent, canActivate: [QuestHandlerService], }, + { + path: 'quest-template-locale', + component: QuestTemplateLocaleComponent, + canActivate: [QuestHandlerService], + }, { path: 'quest-offer-reward', component: QuestOfferRewardComponent, diff --git a/apps/keira/src/assets/i18n/de.json b/apps/keira/src/assets/i18n/de.json index 8195cbadd6d..299af6ff498 100644 --- a/apps/keira/src/assets/i18n/de.json +++ b/apps/keira/src/assets/i18n/de.json @@ -99,6 +99,7 @@ "SELECT_QUEST": "Quest auswählen", "QUEST_TEMPLATE": "Questvorlage", "QUEST_TEMPLATE_ADDON": "Questvorlagen-Addon", + "QUEST_TEMPLATE_LOCALE": "Quest Template Locale", "QUEST_OFFER_REWARD": "Quest-Belohnung anbieten", "QUEST_REQUEST_ITEMS": "Quest-Objekte anfordern", "CREATURE_QUESTSTARTER": "Questgeber-Kreatur", diff --git a/apps/keira/src/assets/i18n/el.json b/apps/keira/src/assets/i18n/el.json index c41afdd39f4..536c0d03594 100644 --- a/apps/keira/src/assets/i18n/el.json +++ b/apps/keira/src/assets/i18n/el.json @@ -100,6 +100,7 @@ "SELECT_QUEST": "Select Quest", "QUEST_TEMPLATE": "Quest Template", "QUEST_TEMPLATE_ADDON": "Quest Template Addon", + "QUEST_TEMPLATE_LOCALE": "Quest Template Locale", "QUEST_OFFER_REWARD": "Quest Offer Reward", "QUEST_REQUEST_ITEMS": "Quest Request Items", "CREATURE_QUESTSTARTER": "Creature Queststarter", diff --git a/apps/keira/src/assets/i18n/en.json b/apps/keira/src/assets/i18n/en.json index ff56377d437..1208f676482 100644 --- a/apps/keira/src/assets/i18n/en.json +++ b/apps/keira/src/assets/i18n/en.json @@ -100,6 +100,7 @@ "SELECT_QUEST": "Select Quest", "QUEST_TEMPLATE": "Quest Template", "QUEST_TEMPLATE_ADDON": "Quest Template Addon", + "QUEST_TEMPLATE_LOCALE": "Quest Template Locale", "QUEST_OFFER_REWARD": "Quest Offer Reward", "QUEST_REQUEST_ITEMS": "Quest Request Items", "CREATURE_QUESTSTARTER": "Creature Queststarter", diff --git a/apps/keira/src/assets/i18n/es.json b/apps/keira/src/assets/i18n/es.json index f7e726b039a..94b2e864d9a 100644 --- a/apps/keira/src/assets/i18n/es.json +++ b/apps/keira/src/assets/i18n/es.json @@ -96,6 +96,7 @@ "SELECT_QUEST": "Seleccionar Misión", "QUEST_TEMPLATE": "Plantilla de Misión", "QUEST_TEMPLATE_ADDON": "Addon de Plantilla de Misión", + "QUEST_TEMPLATE_LOCALE": "Quest Template Locale", "QUEST_OFFER_REWARD": "Recompensa por Ofrecimiento de la Misión", "QUEST_REQUEST_ITEMS": "Items Requeridos para la Misión", "CREATURE_QUESTSTARTER": "Criatura para Iniciar la Misión", diff --git a/apps/keira/src/assets/i18n/fr.json b/apps/keira/src/assets/i18n/fr.json index 43c7ecf843f..9f446a83334 100644 --- a/apps/keira/src/assets/i18n/fr.json +++ b/apps/keira/src/assets/i18n/fr.json @@ -96,6 +96,7 @@ "SELECT_QUEST": "Sélectionner une quête", "QUEST_TEMPLATE": "Modèle de quête", "QUEST_TEMPLATE_ADDON": "Modèle d'addon de quête", + "QUEST_TEMPLATE_LOCALE": "Quest Template Locale", "QUEST_OFFER_REWARD": "Offre de récompense de quête", "QUEST_REQUEST_ITEMS": "Requête d'objets de quête", "CREATURE_QUESTSTARTER": "Créature qui débute une quête", diff --git a/apps/keira/src/assets/i18n/it.json b/apps/keira/src/assets/i18n/it.json index 2e14240293b..f79af338058 100644 --- a/apps/keira/src/assets/i18n/it.json +++ b/apps/keira/src/assets/i18n/it.json @@ -99,6 +99,7 @@ "SELECT_QUEST": "Select Quest", "QUEST_TEMPLATE": "Quest Template", "QUEST_TEMPLATE_ADDON": "Quest Template Addon", + "QUEST_TEMPLATE_LOCALE": "Quest Template Locale", "QUEST_OFFER_REWARD": "Quest Offer Reward", "QUEST_REQUEST_ITEMS": "Quest Request Items", "CREATURE_QUESTSTARTER": "Creature Queststarter", diff --git a/apps/keira/src/assets/i18n/ko.json b/apps/keira/src/assets/i18n/ko.json index c41afdd39f4..536c0d03594 100644 --- a/apps/keira/src/assets/i18n/ko.json +++ b/apps/keira/src/assets/i18n/ko.json @@ -100,6 +100,7 @@ "SELECT_QUEST": "Select Quest", "QUEST_TEMPLATE": "Quest Template", "QUEST_TEMPLATE_ADDON": "Quest Template Addon", + "QUEST_TEMPLATE_LOCALE": "Quest Template Locale", "QUEST_OFFER_REWARD": "Quest Offer Reward", "QUEST_REQUEST_ITEMS": "Quest Request Items", "CREATURE_QUESTSTARTER": "Creature Queststarter", diff --git a/apps/keira/src/assets/i18n/nl.json b/apps/keira/src/assets/i18n/nl.json index c41afdd39f4..536c0d03594 100644 --- a/apps/keira/src/assets/i18n/nl.json +++ b/apps/keira/src/assets/i18n/nl.json @@ -100,6 +100,7 @@ "SELECT_QUEST": "Select Quest", "QUEST_TEMPLATE": "Quest Template", "QUEST_TEMPLATE_ADDON": "Quest Template Addon", + "QUEST_TEMPLATE_LOCALE": "Quest Template Locale", "QUEST_OFFER_REWARD": "Quest Offer Reward", "QUEST_REQUEST_ITEMS": "Quest Request Items", "CREATURE_QUESTSTARTER": "Creature Queststarter", diff --git a/apps/keira/src/assets/i18n/pl.json b/apps/keira/src/assets/i18n/pl.json index c41afdd39f4..536c0d03594 100644 --- a/apps/keira/src/assets/i18n/pl.json +++ b/apps/keira/src/assets/i18n/pl.json @@ -100,6 +100,7 @@ "SELECT_QUEST": "Select Quest", "QUEST_TEMPLATE": "Quest Template", "QUEST_TEMPLATE_ADDON": "Quest Template Addon", + "QUEST_TEMPLATE_LOCALE": "Quest Template Locale", "QUEST_OFFER_REWARD": "Quest Offer Reward", "QUEST_REQUEST_ITEMS": "Quest Request Items", "CREATURE_QUESTSTARTER": "Creature Queststarter", diff --git a/apps/keira/src/assets/i18n/pt.json b/apps/keira/src/assets/i18n/pt.json index b0bc7e616d3..c97837c571e 100644 --- a/apps/keira/src/assets/i18n/pt.json +++ b/apps/keira/src/assets/i18n/pt.json @@ -96,6 +96,7 @@ "SELECT_QUEST": "Selecionar Quest", "QUEST_TEMPLATE": "Quest Template", "QUEST_TEMPLATE_ADDON": "Quest Template Addon", + "QUEST_TEMPLATE_LOCALE": "Quest Template Locale", "QUEST_OFFER_REWARD": "Quest Offer Reward", "QUEST_REQUEST_ITEMS": "Quest Request Items", "CREATURE_QUESTSTARTER": "Creature Queststarter", diff --git a/apps/keira/src/assets/i18n/ro.json b/apps/keira/src/assets/i18n/ro.json index c41afdd39f4..536c0d03594 100644 --- a/apps/keira/src/assets/i18n/ro.json +++ b/apps/keira/src/assets/i18n/ro.json @@ -100,6 +100,7 @@ "SELECT_QUEST": "Select Quest", "QUEST_TEMPLATE": "Quest Template", "QUEST_TEMPLATE_ADDON": "Quest Template Addon", + "QUEST_TEMPLATE_LOCALE": "Quest Template Locale", "QUEST_OFFER_REWARD": "Quest Offer Reward", "QUEST_REQUEST_ITEMS": "Quest Request Items", "CREATURE_QUESTSTARTER": "Creature Queststarter", diff --git a/apps/keira/src/assets/i18n/ru.json b/apps/keira/src/assets/i18n/ru.json index eb744917402..b3bea45499f 100644 --- a/apps/keira/src/assets/i18n/ru.json +++ b/apps/keira/src/assets/i18n/ru.json @@ -96,6 +96,7 @@ "SELECT_QUEST": "Выбрать Задание", "QUEST_TEMPLATE": "Quest Template", "QUEST_TEMPLATE_ADDON": "Quest Template Addon", + "QUEST_TEMPLATE_LOCALE": "Quest Template Locale", "QUEST_OFFER_REWARD": "Quest Offer Reward", "QUEST_REQUEST_ITEMS": "Quest Request Items", "CREATURE_QUESTSTARTER": "Creature Queststarter", diff --git a/apps/keira/src/assets/i18n/sk.json b/apps/keira/src/assets/i18n/sk.json index c41afdd39f4..536c0d03594 100644 --- a/apps/keira/src/assets/i18n/sk.json +++ b/apps/keira/src/assets/i18n/sk.json @@ -100,6 +100,7 @@ "SELECT_QUEST": "Select Quest", "QUEST_TEMPLATE": "Quest Template", "QUEST_TEMPLATE_ADDON": "Quest Template Addon", + "QUEST_TEMPLATE_LOCALE": "Quest Template Locale", "QUEST_OFFER_REWARD": "Quest Offer Reward", "QUEST_REQUEST_ITEMS": "Quest Request Items", "CREATURE_QUESTSTARTER": "Creature Queststarter", diff --git a/apps/keira/src/assets/i18n/sv.json b/apps/keira/src/assets/i18n/sv.json index 17544e8f84e..b95b356d751 100644 --- a/apps/keira/src/assets/i18n/sv.json +++ b/apps/keira/src/assets/i18n/sv.json @@ -96,6 +96,7 @@ "SELECT_QUEST": "Välj Quest", "QUEST_TEMPLATE": "Quest Template", "QUEST_TEMPLATE_ADDON": "Quest Template Addon", + "QUEST_TEMPLATE_LOCALE": "Quest Template Locale", "QUEST_OFFER_REWARD": "Quest Offer Reward", "QUEST_REQUEST_ITEMS": "Quest Request Items", "CREATURE_QUESTSTARTER": "Creature Queststarter", diff --git a/apps/keira/src/assets/i18n/zh.json b/apps/keira/src/assets/i18n/zh.json index d413c4c4da6..24e224c1f91 100644 --- a/apps/keira/src/assets/i18n/zh.json +++ b/apps/keira/src/assets/i18n/zh.json @@ -96,6 +96,7 @@ "SELECT_QUEST": "选择任务", "QUEST_TEMPLATE": "任务模板", "QUEST_TEMPLATE_ADDON": "任务模板插件", + "QUEST_TEMPLATE_LOCALE": "Quest Template Locale", "QUEST_OFFER_REWARD": "任务提供的奖励", "QUEST_REQUEST_ITEMS": "接取任务道具配置", "CREATURE_QUESTSTARTER": "接取任务NPC配置", diff --git a/libs/features/quest/src/index.ts b/libs/features/quest/src/index.ts index 65faa77c701..9a7c36713fb 100644 --- a/libs/features/quest/src/index.ts +++ b/libs/features/quest/src/index.ts @@ -9,3 +9,4 @@ export * from './quest-template/quest-template.component'; export * from './quest-template-addon/quest-template-addon.component'; export * from './select-quest/select-quest.component'; export * from './quest-handler.service'; +export * from './quest-template-locale/quest-template-locale.component'; diff --git a/libs/features/quest/src/quest-handler.service.ts b/libs/features/quest/src/quest-handler.service.ts index 6775747b603..9f93722b86a 100644 --- a/libs/features/quest/src/quest-handler.service.ts +++ b/libs/features/quest/src/quest-handler.service.ts @@ -7,7 +7,7 @@ import { GAMEOBJECT_QUESTSTARTER_TABLE, QUEST_OFFER_REWARD_TABLE, QUEST_REQUEST_ITEMS_TABLE, - QUEST_TEMPLATE_ADDON_TABLE, + QUEST_TEMPLATE_ADDON_TABLE, QUEST_TEMPLATE_LOCALE_TABLE, QUEST_TEMPLATE_TABLE, QuestTemplate, } from '@keira/shared/acore-world-model'; @@ -24,6 +24,9 @@ export class QuestHandlerService extends HandlerService { get isQuestTemplateAddonUnsaved(): boolean { return this.statusMap[QUEST_TEMPLATE_ADDON_TABLE]; } + get isQuestTemplateLocaleUnsaved(): boolean { + return this.statusMap[QUEST_TEMPLATE_LOCALE_TABLE]; + } get isQuestOfferRewardUnsaved(): boolean { return this.statusMap[QUEST_OFFER_REWARD_TABLE]; } @@ -46,6 +49,7 @@ export class QuestHandlerService extends HandlerService { protected _statusMap = { [QUEST_TEMPLATE_TABLE]: false, [QUEST_TEMPLATE_ADDON_TABLE]: false, + [QUEST_TEMPLATE_LOCALE_TABLE]: false, [QUEST_OFFER_REWARD_TABLE]: false, [QUEST_REQUEST_ITEMS_TABLE]: false, [CREATURE_QUESTSTARTER_TABLE]: false, diff --git a/libs/features/quest/src/quest-template-locale/quest-template-locale.component.html b/libs/features/quest/src/quest-template-locale/quest-template-locale.component.html new file mode 100644 index 00000000000..f5727560ead --- /dev/null +++ b/libs/features/quest/src/quest-template-locale/quest-template-locale.component.html @@ -0,0 +1,94 @@ + + +
+ @if (editorService.loading) { + + } + + @if (editorService.form && !!editorService.loadedEntityId && !editorService.loading) { +
+
+ +
+
+
+
+
+ + + +
+
+ + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+ + + + + + + + + + + +
+
+
+ +
+ } +
diff --git a/libs/features/quest/src/quest-template-locale/quest-template-locale.component.scss b/libs/features/quest/src/quest-template-locale/quest-template-locale.component.scss new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libs/features/quest/src/quest-template-locale/quest-template-locale.component.ts b/libs/features/quest/src/quest-template-locale/quest-template-locale.component.ts new file mode 100644 index 00000000000..5c3986f1fb5 --- /dev/null +++ b/libs/features/quest/src/quest-template-locale/quest-template-locale.component.ts @@ -0,0 +1,45 @@ +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { EMOTE, QuestTemplateLocale } from '@keira/shared/acore-world-model'; +import { MultiRowEditorComponent } from '@keira/shared/base-abstract-classes'; +import { EditorButtonsComponent, QueryOutputComponent, TopBarComponent } from '@keira/shared/base-editor-components'; +import { GameobjectSelectorBtnComponent, SingleValueSelectorBtnComponent } from '@keira/shared/selectors'; +import { TranslateModule } from '@ngx-translate/core'; +import { TooltipModule } from 'ngx-bootstrap/tooltip'; +import { QuestHandlerService } from '../quest-handler.service'; +import { QuestPreviewComponent } from '../quest-preview/quest-preview.component'; +import { QuestPreviewService } from '../quest-preview/quest-preview.service'; +import { QuestTemplateLocaleService } from './quest-template-locale.service'; +import { Model3DViewerComponent } from '@keira/shared/model-3d-viewer'; +import { AsyncPipe } from '@angular/common'; +import { NgxDatatableModule } from '@siemens/ngx-datatable'; + +@Component({ + changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'keira-quest-template-locale', + templateUrl: './quest-template-locale.component.html', + styleUrls: ['./quest-template-locale.component.scss'], + standalone: true, + imports: [ + TopBarComponent, + TranslateModule, + QueryOutputComponent, + FormsModule, + ReactiveFormsModule, + TooltipModule, + SingleValueSelectorBtnComponent, + QuestPreviewComponent, + Model3DViewerComponent, + GameobjectSelectorBtnComponent, + AsyncPipe, + EditorButtonsComponent, + NgxDatatableModule, + ], +}) +export class QuestTemplateLocaleComponent extends MultiRowEditorComponent { + readonly EMOTE = EMOTE; + + protected override readonly editorService = inject(QuestTemplateLocaleService); + readonly handlerService = inject(QuestHandlerService); + readonly questPreviewService = inject(QuestPreviewService); +} diff --git a/libs/features/quest/src/quest-template-locale/quest-template-locale.service.ts b/libs/features/quest/src/quest-template-locale/quest-template-locale.service.ts new file mode 100644 index 00000000000..cdf37d2d2ff --- /dev/null +++ b/libs/features/quest/src/quest-template-locale/quest-template-locale.service.ts @@ -0,0 +1,19 @@ +import { Injectable } from '@angular/core'; +import { MultiRowEditorService } from '@keira/shared/base-abstract-classes'; +import { + QUEST_TEMPLATE_LOCALE_ID, + QUEST_TEMPLATE_LOCALE_ID_2, + QUEST_TEMPLATE_LOCALE_TABLE, + QuestTemplateLocale, +} from '@keira/shared/acore-world-model'; +import { QuestHandlerService } from '../quest-handler.service'; + +@Injectable({ + providedIn: 'root', +}) +export class QuestTemplateLocaleService extends MultiRowEditorService { + /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 + constructor(protected override readonly handlerService: QuestHandlerService) { + super(QuestTemplateLocale, QUEST_TEMPLATE_LOCALE_TABLE, QUEST_TEMPLATE_LOCALE_ID, QUEST_TEMPLATE_LOCALE_ID_2, handlerService); + } +} diff --git a/libs/main/main-window/src/sidebar/sidebar.component.html b/libs/main/main-window/src/sidebar/sidebar.component.html index 29b29618a0c..d78a23a4459 100644 --- a/libs/main/main-window/src/sidebar/sidebar.component.html +++ b/libs/main/main-window/src/sidebar/sidebar.component.html @@ -260,6 +260,14 @@ } +
  • + + {{ 'SIDEBAR.QUEST.QUEST_TEMPLATE_LOCALE' | translate }} + @if (questHandlerService.isQuestTemplateLocaleUnsaved) { + + } + +
  • {{ 'SIDEBAR.QUEST.QUEST_OFFER_REWARD' | translate }} diff --git a/libs/shared/acore-world-model/src/entities/quest-template-locale.type.ts b/libs/shared/acore-world-model/src/entities/quest-template-locale.type.ts new file mode 100644 index 00000000000..60cd948c16b --- /dev/null +++ b/libs/shared/acore-world-model/src/entities/quest-template-locale.type.ts @@ -0,0 +1,20 @@ +import { TableRow } from '@keira/shared/constants'; + +export const QUEST_TEMPLATE_LOCALE_TABLE = 'quest_template_locale'; +export const QUEST_TEMPLATE_LOCALE_ID = 'ID'; +export const QUEST_TEMPLATE_LOCALE_ID_2 = 'locale'; + +export class QuestTemplateLocale extends TableRow { + ID: number = 0; + locale: string = ''; + Title: string = ''; + Details: string = ''; + Objectives: string = ''; + EndText: string = ''; + CompletedText: string = ''; + ObjectiveText1: string = ''; + ObjectiveText2: string = ''; + ObjectiveText3: string = ''; + ObjectiveText4: string = ''; + VerifiedBuild: number = 0; +} diff --git a/libs/shared/acore-world-model/src/index.ts b/libs/shared/acore-world-model/src/index.ts index a2a069fc638..b0c3a2e90b4 100644 --- a/libs/shared/acore-world-model/src/index.ts +++ b/libs/shared/acore-world-model/src/index.ts @@ -53,6 +53,7 @@ export * from './entities/prospecting-loot-template.type'; export * from './entities/quest-offer-reward.type'; export * from './entities/quest-request-items.type'; export * from './entities/quest-template.type'; +export * from './entities/quest-template-locale.type'; export * from './entities/quest-template-addon.type'; export * from './entities/reference-loot-template.type'; export * from './entities/skill.type';