From a17ad79009a7bf6e47e37f7f4a764c4b43fc4ac3 Mon Sep 17 00:00:00 2001 From: lcdr Date: Fri, 6 Oct 2023 19:08:51 +0200 Subject: [PATCH] Use mission list component where possible Also adds the mission separator and task tooltips to the mission list component. --- src/app/gui/mission-list/mission-list.component.css | 6 ++++++ src/app/gui/mission-list/mission-list.component.html | 9 +++++---- src/app/gui/mission-list/mission-list.component.ts | 12 +++++++++--- src/app/gui/mission/mission.component.css | 1 + src/app/missions/by-subtype/by-subtype.component.css | 5 ----- .../missions/by-subtype/by-subtype.component.html | 9 ++++----- src/app/missions/by-type/by-type.component.css | 12 ------------ src/app/missions/by-type/by-type.component.html | 7 ++----- src/app/missions/detail/detail.component.html | 6 ++---- .../tasks/mission-task/mission-task.component.html | 5 +---- .../tasks/mission-task/mission-task.component.ts | 3 +++ .../tasks/racing-task/racing-task.component.html | 12 ++---------- .../tasks/racing-task/racing-task.component.ts | 2 ++ .../collectible-component.component.html | 6 +++--- .../components/used-by/used-by.component.html | 9 ++------- src/app/skills/skill/skill.component.html | 4 ++-- src/defs/locale.ts | 1 + 17 files changed, 45 insertions(+), 64 deletions(-) diff --git a/src/app/gui/mission-list/mission-list.component.css b/src/app/gui/mission-list/mission-list.component.css index b0c83948..d6bb817a 100644 --- a/src/app/gui/mission-list/mission-list.component.css +++ b/src/app/gui/mission-list/mission-list.component.css @@ -10,3 +10,9 @@ ul.mission-list { ul.mission-list li { display: inline-block; } + +.mission-separator { + flex-basis: 100%; + height: 2rem; + order: 0; +} diff --git a/src/app/gui/mission-list/mission-list.component.html b/src/app/gui/mission-list/mission-list.component.html index d6107553..54571765 100644 --- a/src/app/gui/mission-list/mission-list.component.html +++ b/src/app/gui/mission-list/mission-list.component.html @@ -1,9 +1,10 @@ \ No newline at end of file +
  • + diff --git a/src/app/gui/mission-list/mission-list.component.ts b/src/app/gui/mission-list/mission-list.component.ts index 95ea9c8d..e567c934 100644 --- a/src/app/gui/mission-list/mission-list.component.ts +++ b/src/app/gui/mission-list/mission-list.component.ts @@ -2,7 +2,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { Observable, of, ReplaySubject } from 'rxjs'; import { map, shareReplay, switchMap } from 'rxjs/operators'; import { DB_Icons, DB_MissionTasks } from '../../../defs/cdclient'; -import { Locale_Missions } from '../../../defs/locale'; +import { Locale_Missions, Locale_MissionText } from '../../../defs/locale'; import { mapRec, mapToDict, mapToMultiDict, pick, recToSet, values } from '../../../defs/rx'; import { LuCoreDataService } from '../../services'; @@ -38,10 +38,11 @@ class Mission { public $table: Observable, public $missionIcon: Observable, public $loc: Observable, + public $locText: Observable, ) { } get $sortOrder(): Observable { - return this.$table.pipe(map(m => m ? -m.isMission * 10000 + m.UISortOrder : 0)) + return this.$table.pipe(map(m => m ? -m.isMission * 10000 + m.UISortOrder + 1 : 0)) } } @@ -72,6 +73,10 @@ export class MissionListComponent implements OnInit { cd.queryLocaleNum$("Missions", ["name"]), shareReplay(1), ); + let $missionTextLocale = this.$missionIds.pipe( + cd.queryLocaleNum$("MissionText", ["in_progress", "description"]), + shareReplay(1), + ); let $missionIcons = $missionsTable.pipe( values(), map(data => Array.from(data, d => d.missionIconID).filter(v => v)), @@ -109,7 +114,8 @@ export class MissionListComponent implements OnInit { let $table = $missionsTable.pipe(pick(id), shareReplay(1)); let $missionIcon = $table.pipe(switchMap(iconForMission)); let $loc = $missionsLocale.pipe(pick(id), shareReplay(1)); - return new Mission(id, $table, $missionIcon, $loc); + let $locText = $missionTextLocale.pipe(pick(id), shareReplay(1)); + return new Mission(id, $table, $missionIcon, $loc, $locText); })) ); } diff --git a/src/app/gui/mission/mission.component.css b/src/app/gui/mission/mission.component.css index cbe4086c..17f3bec1 100644 --- a/src/app/gui/mission/mission.component.css +++ b/src/app/gui/mission/mission.component.css @@ -92,4 +92,5 @@ a { color: #ccc; font-weight: 600; text-align: center; + white-space: pre-wrap; } diff --git a/src/app/missions/by-subtype/by-subtype.component.css b/src/app/missions/by-subtype/by-subtype.component.css index 3ea257cc..e69de29b 100644 --- a/src/app/missions/by-subtype/by-subtype.component.css +++ b/src/app/missions/by-subtype/by-subtype.component.css @@ -1,5 +0,0 @@ -.mission-separator { - flex-basis: 100%; - height: 2rem; - order: 0; -} diff --git a/src/app/missions/by-subtype/by-subtype.component.html b/src/app/missions/by-subtype/by-subtype.component.html index 1127e22c..318e2212 100644 --- a/src/app/missions/by-subtype/by-subtype.component.html +++ b/src/app/missions/by-subtype/by-subtype.component.html @@ -8,8 +8,7 @@

    Missions {{d.type}} - {{d.subtype}}

    -
    -
    - -
    - \ No newline at end of file + + + + diff --git a/src/app/missions/by-type/by-type.component.css b/src/app/missions/by-type/by-type.component.css index 0c755c02..e69de29b 100644 --- a/src/app/missions/by-type/by-type.component.css +++ b/src/app/missions/by-type/by-type.component.css @@ -1,12 +0,0 @@ -.mission-list { - display: flex; - flex-wrap: wrap; - gap: 4px; -} - -.mission-separator { - break-before: always; - break-after: always; - height: 2rem; - order: 0; -} diff --git a/src/app/missions/by-type/by-type.component.html b/src/app/missions/by-type/by-type.component.html index b37ff3ff..2804c6a6 100644 --- a/src/app/missions/by-type/by-type.component.html +++ b/src/app/missions/by-type/by-type.component.html @@ -22,10 +22,7 @@

    Subtypes

    Missions

    -
    -
    - -
    +
    - \ No newline at end of file + diff --git a/src/app/missions/detail/detail.component.html b/src/app/missions/detail/detail.component.html index 36fbc12c..69685763 100644 --- a/src/app/missions/detail/detail.component.html +++ b/src/app/missions/detail/detail.component.html @@ -57,9 +57,7 @@

    Prerequisites

    Prerequisite For

    -
    - -
    +
    @@ -315,4 +313,4 @@

    Details

    Details

    - \ No newline at end of file + diff --git a/src/app/missions/tasks/mission-task/mission-task.component.html b/src/app/missions/tasks/mission-task/mission-task.component.html index 5b1e609f..4cca9f74 100644 --- a/src/app/missions/tasks/mission-task/mission-task.component.html +++ b/src/app/missions/tasks/mission-task/mission-task.component.html @@ -2,10 +2,7 @@

    {{task.uid}}: MissionComplete Task (16)

    The player needs to complete any {{task.targetValue}} of the following missions: - {{task.target}}, {{target}} - . + the mission
    diff --git a/src/app/missions/tasks/mission-task/mission-task.component.ts b/src/app/missions/tasks/mission-task/mission-task.component.ts index 080abedd..462ea2b5 100644 --- a/src/app/missions/tasks/mission-task/mission-task.component.ts +++ b/src/app/missions/tasks/mission-task/mission-task.component.ts @@ -9,10 +9,13 @@ import { DB_MissionTasks } from '../../../../defs/cdclient'; export class MissionTaskComponent implements OnInit { @Input() task: DB_MissionTasks; + missionList: number[] = []; constructor() { } ngOnInit() { + this.missionList = this.task.targetGroup ? this.task.targetGroup.split(',').map(Number) : []; + this.missionList.push(this.task.target); } } diff --git a/src/app/missions/tasks/racing-task/racing-task.component.html b/src/app/missions/tasks/racing-task/racing-task.component.html index c96613c0..1c3a5064 100644 --- a/src/app/missions/tasks/racing-task/racing-task.component.html +++ b/src/app/missions/tasks/racing-task/racing-task.component.html @@ -15,19 +15,11 @@

    {{task.uid}}: Racing Task (23)

    complete any {{task.targetValue}} of the following missions: - + complete any {{task.targetValue}} of the following missions: - + swap out every module on their car in a single modular build session (excluding chassis). diff --git a/src/app/missions/tasks/racing-task/racing-task.component.ts b/src/app/missions/tasks/racing-task/racing-task.component.ts index b6d62182..7877af06 100644 --- a/src/app/missions/tasks/racing-task/racing-task.component.ts +++ b/src/app/missions/tasks/racing-task/racing-task.component.ts @@ -9,10 +9,12 @@ import { DB_MissionTasks } from '../../../../defs/cdclient'; export class RacingTaskComponent implements OnInit { @Input() task: DB_MissionTasks; + targetList: number[] = []; constructor() { } ngOnInit() { + this.targetList = this.task.targetGroup ? this.task.targetGroup.split(',').map(Number) : []; } } diff --git a/src/app/objects/components/collectible-component/collectible-component.component.html b/src/app/objects/components/collectible-component/collectible-component.component.html index 642a070f..a557d2ad 100644 --- a/src/app/objects/components/collectible-component/collectible-component.component.html +++ b/src/app/objects/components/collectible-component/collectible-component.component.html @@ -1,11 +1,11 @@

    Collectible Component ({{id}})

    -

    This object is a collectible for the mission - {{collectible.requirement_mission}} +

    This object is a collectible for the mission
    +

    Details

    Loading... - \ No newline at end of file +
    diff --git a/src/app/objects/components/used-by/used-by.component.html b/src/app/objects/components/used-by/used-by.component.html index 34427c47..17724d67 100644 --- a/src/app/objects/components/used-by/used-by.component.html +++ b/src/app/objects/components/used-by/used-by.component.html @@ -39,12 +39,7 @@

    Item Sets

    Missions

    Reward Items for
    - +
    - \ No newline at end of file + diff --git a/src/app/skills/skill/skill.component.html b/src/app/skills/skill/skill.component.html index 74832ace..6dee10b7 100644 --- a/src/app/skills/skill/skill.component.html +++ b/src/app/skills/skill/skill.component.html @@ -54,7 +54,7 @@

    UseSkill MissionTasks

    -
    Mission #{{task.id}}:
    +
    @@ -78,4 +78,4 @@

    Details

    --> Loading... - \ No newline at end of file + diff --git a/src/defs/locale.ts b/src/defs/locale.ts index 7c91a96d..bfa30fc9 100644 --- a/src/defs/locale.ts +++ b/src/defs/locale.ts @@ -68,6 +68,7 @@ export interface Locale_PropertyTemplate { export interface Locale { ItemSets: Record, Missions: Record, + MissionText: Record, Preconditions: Record, PropertyTemplate: Record, RewardCodes: Record,