Skip to content

Commit

Permalink
Add quest_template_locale table
Browse files Browse the repository at this point in the history
  • Loading branch information
vrachv committed Dec 30, 2024
1 parent 4442cc8 commit ae4a952
Show file tree
Hide file tree
Showing 25 changed files with 214 additions and 1 deletion.
6 changes: 6 additions & 0 deletions apps/keira/src/app/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ import {
QuestOfferRewardComponent,
QuestRequestItemsComponent,
QuestTemplateAddonComponent,
QuestTemplateLocaleComponent,
QuestTemplateComponent,
SelectQuestComponent,
} from '@keira/features/quest';
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions apps/keira/src/assets/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions apps/keira/src/assets/i18n/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions apps/keira/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions apps/keira/src/assets/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions apps/keira/src/assets/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions apps/keira/src/assets/i18n/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions apps/keira/src/assets/i18n/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions apps/keira/src/assets/i18n/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions apps/keira/src/assets/i18n/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions apps/keira/src/assets/i18n/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions apps/keira/src/assets/i18n/ro.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions apps/keira/src/assets/i18n/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions apps/keira/src/assets/i18n/sk.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions apps/keira/src/assets/i18n/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions apps/keira/src/assets/i18n/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -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配置",
Expand Down
1 change: 1 addition & 0 deletions libs/features/quest/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
6 changes: 5 additions & 1 deletion libs/features/quest/src/quest-handler.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -24,6 +24,9 @@ export class QuestHandlerService extends HandlerService<QuestTemplate> {
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];
}
Expand All @@ -46,6 +49,7 @@ export class QuestHandlerService extends HandlerService<QuestTemplate> {
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,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<keira-top-bar [selected]="handlerService.selected" [selectedName]="handlerService.selectedName" [isNew]="handlerService.isNew" />

<div class="container-fluid editor-with-preview" [class.show-preview]="questPreviewService.showPreview">
@if (editorService.loading) {
<span [translate]="'LOADING'"></span>
}

@if (editorService.form && !!editorService.loadedEntityId && !editorService.loading) {
<div>
<div class="content-block">
<keira-query-output [docUrl]="docUrl" [editorService]="editorService" (executeQuery)="save($event)" />
</div>
<div class="content-block">
<form [formGroup]="editorService.form" class="form-group edit-form">
<div class="row">
<div class="form-group col-12 col-sm-6 col-md-4 col-lg-4 col-xl-4">
<label class="control-label" for="id">ID</label>
<i class="fas fa-info-circle ms-1" placement="auto" [tooltip]="'UNIQUE_ID' | translate: { ENTITY: 'quest' }"></i>
<input [formControlName]="'ID'" id="id" type="number" class="form-control form-control-sm" />
</div>
<div class="form-group col-12 col-sm-6 col-md-4 col-lg-4 col-xl-4">
<label class="control-label" for="id">Title</label>
<i class="fas fa-info-circle ms-1" placement="auto" [tooltip]="'QUEST.TEMPLATE.LOG_TITLE' | translate"></i>
<input [formControlName]="'Title'" id="title" class="form-control form-control-sm" />
</div>
<div class="form-group col-12 col-sm-12 col-md-8 col-lg-9 col-xl-12">
<label class="control-label" for="id">Details</label>
<textarea [formControlName]="'Details'" id="details" class="form-control form-control-sm"></textarea>
</div>
<div class="form-group col-12 col-sm-12 col-md-8 col-lg-9 col-xl-12">
<label class="control-label" for="id">Objectives</label>
<textarea [formControlName]="'Objectives'" id="objectives" class="form-control form-control-sm"></textarea>
</div>
<div class="form-group col-12 col-sm-12 col-md-8 col-lg-9 col-xl-12">
<label class="control-label" for="id">EndText</label>
<textarea [formControlName]="'EndText'" id="end-text" class="form-control form-control-sm"></textarea>
</div>
<div class="form-group col-12 col-sm-12 col-md-8 col-lg-9 col-xl-12">
<label class="control-label" for="id">CompletedText</label>
<textarea [formControlName]="'CompletedText'" id="completed-text" class="form-control form-control-sm"></textarea>
</div>
<div class="form-group col-12 col-sm-6 col-md-6 col-lg-6 col-xl-6">
<label class="control-label" for="id">ObjectiveText1</label>
<input [formControlName]="'ObjectiveText1'" id="objective-text-1" class="form-control form-control-sm" />
</div>
<div class="form-group col-12 col-sm-6 col-md-6 col-lg-6 col-xl-6">
<label class="control-label" for="id">ObjectiveText2</label>
<input [formControlName]="'ObjectiveText2'" id="objective-text-2" class="form-control form-control-sm" />
</div>
<div class="form-group col-12 col-sm-6 col-md-6 col-lg-6 col-xl-6">
<label class="control-label" for="id">ObjectiveText3</label>
<input [formControlName]="'ObjectiveText3'" id="objective-text-3" class="form-control form-control-sm" />
</div>
<div class="form-group col-12 col-sm-6 col-md-6 col-lg-6 col-xl-6">
<label class="control-label" for="id">ObjectiveText4</label>
<input [formControlName]="'ObjectiveText4'" id="objective-text-4" class="form-control form-control-sm" />
</div>
<div class="col-12 form-error" [hidden]="editorService.isFormIdUnique()">
<i class="fas fa-exclamation-triangle"></i>
<span [innerHTML]="'UNIQUE' | translate: { ENTITY_SECOND_ID_FIELD: editorService.entitySecondIdField }"></span>
</div>
</div>
</form>
<div class="row">
<div class="col-12">
<keira-editor-buttons [editorService]="editorService" />
<ngx-datatable
id="editor-table"
class="bootstrap table table-striped text-center datatable-select"
[rows]="editorService.newRows"
[headerHeight]="DTCFG.headerHeight"
[footerHeight]="DTCFG.footerHeight"
[columnMode]="DTCFG.columnMode"
[rowHeight]="DTCFG.rowHeight"
[selectionType]="DTCFG.selectionType"
(select)="editorService.onRowSelection($event)"
(keydown.delete)="editorService.deleteSelectedRow()"
>
<ngx-datatable-column [minWidth]="30" [maxWidth]="30" [sortable]="false">
<ng-template let-row="row" ngx-datatable-cell-template>
<i [hidden]="!editorService.isRowSelected(row)" class="fas fa-chevron-right"></i>
</ng-template>
</ngx-datatable-column>
<ngx-datatable-column name="Id" prop="ID" [minWidth]="80" [maxWidth]="150"></ngx-datatable-column>
<ngx-datatable-column name="Locale" prop="locale" [minWidth]="200"></ngx-datatable-column>
<ngx-datatable-column name="Title" prop="Title" [minWidth]="200"></ngx-datatable-column>
</ngx-datatable>
</div>
</div>
</div>
<keira-quest-preview />
</div>
}
</div>
Empty file.
Original file line number Diff line number Diff line change
@@ -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<QuestTemplateLocale> {
readonly EMOTE = EMOTE;

protected override readonly editorService = inject(QuestTemplateLocaleService);
readonly handlerService = inject(QuestHandlerService);
readonly questPreviewService = inject(QuestPreviewService);
}
Original file line number Diff line number Diff line change
@@ -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<QuestTemplateLocale> {
/* 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);
}
}
8 changes: 8 additions & 0 deletions libs/main/main-window/src/sidebar/sidebar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,14 @@
}
</a>
</li>
<li>
<a href="#" routerLinkActive="active" [routerLink]="'quest/quest-template-locale'">
{{ 'SIDEBAR.QUEST.QUEST_TEMPLATE_LOCALE' | translate }}
@if (questHandlerService.isQuestTemplateLocaleUnsaved) {
<keira-unsaved-icon />
}
</a>
</li>
<li>
<a href="#" routerLinkActive="active" [routerLink]="'quest/quest-offer-reward'">
{{ 'SIDEBAR.QUEST.QUEST_OFFER_REWARD' | translate }}
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}
1 change: 1 addition & 0 deletions libs/shared/acore-world-model/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit ae4a952

Please sign in to comment.