From 6307780b9c1f65ab709bf14df2be3ed774dc01f7 Mon Sep 17 00:00:00 2001 From: Thomas Bloor Date: Thu, 26 Dec 2019 21:28:24 +0000 Subject: [PATCH] Finish work on Quest editing pages --- .../components/form/text/text.component.html | 7 +- .../components/form/text/text.component.ts | 2 + src/app/models/atlasData/questEntry.model.ts | 2 +- .../pages/config/quests/quests.component.html | 93 +++++++++++++------ .../pages/config/quests/quests.component.ts | 48 +++++++--- 5 files changed, 107 insertions(+), 45 deletions(-) diff --git a/src/app/components/form/text/text.component.html b/src/app/components/form/text/text.component.html index a4f6351..fc1a752 100644 --- a/src/app/components/form/text/text.component.html +++ b/src/app/components/form/text/text.component.html @@ -1,7 +1,12 @@
- +
+ +
+ +
+
{{ help }}
\ No newline at end of file diff --git a/src/app/components/form/text/text.component.ts b/src/app/components/form/text/text.component.ts index 7e3be2d..b7f27a2 100644 --- a/src/app/components/form/text/text.component.ts +++ b/src/app/components/form/text/text.component.ts @@ -7,6 +7,8 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; export class TextComponent implements OnInit { @Input() text: string; @Output() textChange = new EventEmitter(); + @Input() postButtonText: string; + @Output() postButton = new EventEmitter(); @Input() label: string; @Input() id: string; @Input() help: string; diff --git a/src/app/models/atlasData/questEntry.model.ts b/src/app/models/atlasData/questEntry.model.ts index c5fac75..ea08b41 100644 --- a/src/app/models/atlasData/questEntry.model.ts +++ b/src/app/models/atlasData/questEntry.model.ts @@ -9,7 +9,7 @@ export class QuestEntryModel implements Deserialize { public UncompletedIcon: Texture2DModel; public QuestName: string; public QuestDescription: string; - public UnlockFeatNames: Array; + public UnlockFeatNames: string[]; public CompleteGiveEngramClasses: Array; public QuestPointsOfInterest: Array; diff --git a/src/app/pages/config/quests/quests.component.html b/src/app/pages/config/quests/quests.component.html index 56c1afe..3e50ebd 100644 --- a/src/app/pages/config/quests/quests.component.html +++ b/src/app/pages/config/quests/quests.component.html @@ -1,32 +1,67 @@
-
-
-
-

{{ quest.QuestID }} - {{ quest.QuestName }}

-

{{ quest.QuestDescription }}

-
-
Feat Unlocks
-
    -
  • {{ availableFeats[feat] }}
  • -
-
Engram Unlocks
-
    -
  • - Blueprint: {{ engram.blueprint }} -
  • -
-
Points of Interest
-
    -
  • - - {{ poi.PointOfInterestID }} - {{ poi.PointOfInterestName }} - (X: {{ poi.WorldMapPosition.X }} - Y: {{ poi.WorldMapPosition.Y }}) - -
      -
    • {{ availableFeats[feat] }}
    • -
    -
  • -
-
+
+

Quest Entries

+ + + + + + +
Feat Unlocks + +
+

+ Click + above to add Feat Unlocks +

+ +
Engram Unlocks + +
+

+ Click + above to add Engram Unlocks +

+ +
Points of Interest + +
+

+ Click + above to add Point of Interest +

+
+
+ + + + + + +
Feat Unlocks + +
+

+ Click + above to add Feat Unlocks +

+ +
+
+
+
+
diff --git a/src/app/pages/config/quests/quests.component.ts b/src/app/pages/config/quests/quests.component.ts index 2dd7b83..f61f6ae 100644 --- a/src/app/pages/config/quests/quests.component.ts +++ b/src/app/pages/config/quests/quests.component.ts @@ -1,6 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { Server } from "../../../server"; import { QuestEntryModel } from "../../../models/atlasData/questEntry.model"; +import { BlueprintGeneratedClassModel } from "../../../models/atlasData/blueprintGeneratedClass.model"; @Component({ selector: 'app-quests', @@ -10,24 +11,43 @@ import { QuestEntryModel } from "../../../models/atlasData/questEntry.model"; export class QuestsComponent implements OnInit { quests: QuestEntryModel[]; - // TODO figure out what each dance actually is - private availableFeats = { - 'Dance1': 'Dance 1', - 'Dance2': 'Dance 2', - 'Dance3': 'Dance 3', - 'Dance4': 'Dance 4', - 'Dance5': 'Dance 5', - 'Dance6': 'Dance 6', - 'Dance7': 'Dance 7', - 'Dance8': 'Dance 8', - 'Dance9': 'Dance 9', - 'Dance10': 'Dance 10', - }; - constructor(private server: Server) { this.quests = server.serverGrid.globalGameplaySetup.QuestEntries; } ngOnInit() { } + + // Issue with text arrays and editing jumps on each change. + trackByFn(index: any, item: any) { + return index; + } + + private addQuestFeat(quest) { + if (quest.UnlockFeatNames === undefined) { + quest.UnlockFeatNames = []; + } + quest.UnlockFeatNames.push(''); + } + + private removeQuestFeat(quest, j) { + quest.UnlockFeatNames.splice(j, 1); + if (quest.UnlockFeatNames.length === 0) { + quest.UnlockFeatNames = undefined; + } + } + + private addEngramClass(quest) { + if (quest.CompleteGiveEngramClasses === undefined) { + quest.CompleteGiveEngramClasses = []; + } + quest.CompleteGiveEngramClasses.push(new BlueprintGeneratedClassModel()); + } + + private removeEngramClass(quest, j) { + quest.CompleteGiveEngramClasses.splice(j, 1); + if (quest.CompleteGiveEngramClasses.length === 0) { + quest.UnlockFeatNames = undefined; + } + } }