Ver código fonte

fixed errors in character picker

Warafear 1 ano atrás
pai
commit
2d155c5142

+ 180 - 0
.nx/cache/d/daemon.log

@@ -463906,3 +463906,183 @@ To fix this, set a unique name for each project in a project.json inside the pro
     at async processFilesAndCreateAndSerializeProjectGraph (c:\Softwareprojekte\DnD\node_modules\nx\src\daemon\server\project-graph-incremental-recomputation.js:138:17)
 [NX Daemon Server] - 2024-01-31T15:12:33.702Z - Time taken for 'hash changed files from watcher' 335.5688000023365ms
 [NX Daemon Server] - 2024-01-31T15:12:33.703Z - Done responding to the client null
+[NX Daemon Server] - 2024-02-02T08:44:45.102Z - Started listening on: \\.\pipe\nx\C:\Users\chris\AppData\Local\Temp\83d14e7134fc08a15480\d.sock
+[NX Daemon Server] - 2024-02-02T08:44:45.110Z - [WATCHER]: Subscribed to changes within: c:\Softwareprojekte\DnD (native)
+[NX Daemon Server] - 2024-02-02T08:44:45.125Z - Established a connection. Number of open connections: 1
+[NX Daemon Server] - 2024-02-02T08:44:45.130Z - Closed a connection. Number of open connections: 0
+[NX Daemon Server] - 2024-02-02T08:44:45.130Z - Established a connection. Number of open connections: 1
+[NX Daemon Server] - 2024-02-02T08:44:45.135Z - [REQUEST]: Client Request for Project Graph Received
+[NX Daemon Server] - 2024-02-02T08:44:47.103Z - Error detected when recomputing project file map: The following projects are defined in multiple locations:
+- DnDTools: 
+  - 
+  - .
+
+To fix this, set a unique name for each project in a project.json inside the project's root. If the project does not currently have a project.json, you can create one that contains only a name.
+[NX Daemon Server] - 2024-02-02T08:44:47.103Z - [REQUEST]: Responding to the client with an error. Error when preparing serialized project graph. The following projects are defined in multiple locations:
+- DnDTools: 
+  - 
+  - .
+
+To fix this, set a unique name for each project in a project.json inside the project's root. If the project does not currently have a project.json, you can create one that contains only a name.
+Error: The following projects are defined in multiple locations:
+- DnDTools: 
+  - 
+  - .
+
+To fix this, set a unique name for each project in a project.json inside the project's root. If the project does not currently have a project.json, you can create one that contains only a name.
+    at readProjectConfigurationsFromRootMap (c:\Softwareprojekte\DnD\node_modules\nx\src\project-graph\utils\project-configuration-utils.js:97:15)
+    at buildProjectsConfigurationsFromProjectPathsAndPlugins (c:\Softwareprojekte\DnD\node_modules\nx\src\project-graph\utils\project-configuration-utils.js:70:19)
+    at createProjectConfigurations (c:\Softwareprojekte\DnD\node_modules\nx\src\project-graph\utils\retrieve-workspace-files.js:131:129)
+    at WorkspaceContext.<anonymous> (c:\Softwareprojekte\DnD\node_modules\nx\src\project-graph\utils\retrieve-workspace-files.js:82:39)
+    at getProjectConfigurationsFromContext (c:\Softwareprojekte\DnD\node_modules\nx\src\utils\workspace-context.js:26:29)
+    at _retrieveProjectConfigurations (c:\Softwareprojekte\DnD\node_modules\nx\src\project-graph\utils\retrieve-workspace-files.js:81:72)
+    at retrieveProjectConfigurations (c:\Softwareprojekte\DnD\node_modules\nx\src\project-graph\utils\retrieve-workspace-files.js:58:12)
+    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
+    at async processCollectedUpdatedAndDeletedFiles (c:\Softwareprojekte\DnD\node_modules\nx\src\daemon\server\project-graph-incremental-recomputation.js:102:34)
+    at async processFilesAndCreateAndSerializeProjectGraph (c:\Softwareprojekte\DnD\node_modules\nx\src\daemon\server\project-graph-incremental-recomputation.js:138:17)
+[NX Daemon Server] - 2024-02-02T08:44:47.106Z - Time taken for 'hash changed files from watcher' 550.1582000255585ms
+[NX Daemon Server] - 2024-02-02T08:44:47.107Z - Done responding to the client null
+[NX Daemon Server] - 2024-02-02T17:44:42.168Z - Started listening on: \\.\pipe\nx\C:\Users\chris\AppData\Local\Temp\83d14e7134fc08a15480\d.sock
+[NX Daemon Server] - 2024-02-02T17:44:42.172Z - [WATCHER]: Subscribed to changes within: c:\Softwareprojekte\DnD (native)
+[NX Daemon Server] - 2024-02-02T17:44:42.173Z - Established a connection. Number of open connections: 1
+[NX Daemon Server] - 2024-02-02T17:44:42.174Z - Established a connection. Number of open connections: 2
+[NX Daemon Server] - 2024-02-02T17:44:42.175Z - Closed a connection. Number of open connections: 1
+[NX Daemon Server] - 2024-02-02T17:44:42.177Z - [REQUEST]: Client Request for Project Graph Received
+[NX Daemon Server] - 2024-02-02T17:44:43.344Z - Error detected when recomputing project file map: The following projects are defined in multiple locations:
+- DnDTools: 
+  - 
+  - .
+
+To fix this, set a unique name for each project in a project.json inside the project's root. If the project does not currently have a project.json, you can create one that contains only a name.
+[NX Daemon Server] - 2024-02-02T17:44:43.345Z - [REQUEST]: Responding to the client with an error. Error when preparing serialized project graph. The following projects are defined in multiple locations:
+- DnDTools: 
+  - 
+  - .
+
+To fix this, set a unique name for each project in a project.json inside the project's root. If the project does not currently have a project.json, you can create one that contains only a name.
+Error: The following projects are defined in multiple locations:
+- DnDTools: 
+  - 
+  - .
+
+To fix this, set a unique name for each project in a project.json inside the project's root. If the project does not currently have a project.json, you can create one that contains only a name.
+    at readProjectConfigurationsFromRootMap (c:\Softwareprojekte\DnD\node_modules\nx\src\project-graph\utils\project-configuration-utils.js:97:15)
+    at buildProjectsConfigurationsFromProjectPathsAndPlugins (c:\Softwareprojekte\DnD\node_modules\nx\src\project-graph\utils\project-configuration-utils.js:70:19)
+    at createProjectConfigurations (c:\Softwareprojekte\DnD\node_modules\nx\src\project-graph\utils\retrieve-workspace-files.js:131:129)
+    at WorkspaceContext.<anonymous> (c:\Softwareprojekte\DnD\node_modules\nx\src\project-graph\utils\retrieve-workspace-files.js:82:39)
+    at getProjectConfigurationsFromContext (c:\Softwareprojekte\DnD\node_modules\nx\src\utils\workspace-context.js:26:29)
+    at _retrieveProjectConfigurations (c:\Softwareprojekte\DnD\node_modules\nx\src\project-graph\utils\retrieve-workspace-files.js:81:72)
+    at retrieveProjectConfigurations (c:\Softwareprojekte\DnD\node_modules\nx\src\project-graph\utils\retrieve-workspace-files.js:58:12)
+    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
+    at async processCollectedUpdatedAndDeletedFiles (c:\Softwareprojekte\DnD\node_modules\nx\src\daemon\server\project-graph-incremental-recomputation.js:102:34)
+    at async processFilesAndCreateAndSerializeProjectGraph (c:\Softwareprojekte\DnD\node_modules\nx\src\daemon\server\project-graph-incremental-recomputation.js:138:17)
+[NX Daemon Server] - 2024-02-02T17:44:43.346Z - Time taken for 'hash changed files from watcher' 368.2871000000014ms
+[NX Daemon Server] - 2024-02-02T17:44:43.346Z - Done responding to the client null
+[NX Daemon Server] - 2024-02-03T10:39:45.185Z - Started listening on: \\.\pipe\nx\C:\Users\chris\AppData\Local\Temp\83d14e7134fc08a15480\d.sock
+[NX Daemon Server] - 2024-02-03T10:39:45.187Z - [WATCHER]: Subscribed to changes within: c:\Softwareprojekte\DnD (native)
+[NX Daemon Server] - 2024-02-03T10:39:45.194Z - Established a connection. Number of open connections: 1
+[NX Daemon Server] - 2024-02-03T10:39:45.195Z - Closed a connection. Number of open connections: 0
+[NX Daemon Server] - 2024-02-03T10:39:45.195Z - Established a connection. Number of open connections: 1
+[NX Daemon Server] - 2024-02-03T10:39:45.197Z - [REQUEST]: Client Request for Project Graph Received
+[NX Daemon Server] - 2024-02-03T10:39:45.838Z - Error detected when recomputing project file map: The following projects are defined in multiple locations:
+- DnDTools: 
+  - 
+  - .
+
+To fix this, set a unique name for each project in a project.json inside the project's root. If the project does not currently have a project.json, you can create one that contains only a name.
+[NX Daemon Server] - 2024-02-03T10:39:45.838Z - [REQUEST]: Responding to the client with an error. Error when preparing serialized project graph. The following projects are defined in multiple locations:
+- DnDTools: 
+  - 
+  - .
+
+To fix this, set a unique name for each project in a project.json inside the project's root. If the project does not currently have a project.json, you can create one that contains only a name.
+Error: The following projects are defined in multiple locations:
+- DnDTools: 
+  - 
+  - .
+
+To fix this, set a unique name for each project in a project.json inside the project's root. If the project does not currently have a project.json, you can create one that contains only a name.
+    at readProjectConfigurationsFromRootMap (c:\Softwareprojekte\DnD\node_modules\nx\src\project-graph\utils\project-configuration-utils.js:97:15)
+    at buildProjectsConfigurationsFromProjectPathsAndPlugins (c:\Softwareprojekte\DnD\node_modules\nx\src\project-graph\utils\project-configuration-utils.js:70:19)
+    at createProjectConfigurations (c:\Softwareprojekte\DnD\node_modules\nx\src\project-graph\utils\retrieve-workspace-files.js:131:129)
+    at WorkspaceContext.<anonymous> (c:\Softwareprojekte\DnD\node_modules\nx\src\project-graph\utils\retrieve-workspace-files.js:82:39)
+    at getProjectConfigurationsFromContext (c:\Softwareprojekte\DnD\node_modules\nx\src\utils\workspace-context.js:26:29)
+    at _retrieveProjectConfigurations (c:\Softwareprojekte\DnD\node_modules\nx\src\project-graph\utils\retrieve-workspace-files.js:81:72)
+    at retrieveProjectConfigurations (c:\Softwareprojekte\DnD\node_modules\nx\src\project-graph\utils\retrieve-workspace-files.js:58:12)
+    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
+    at async processCollectedUpdatedAndDeletedFiles (c:\Softwareprojekte\DnD\node_modules\nx\src\daemon\server\project-graph-incremental-recomputation.js:102:34)
+    at async processFilesAndCreateAndSerializeProjectGraph (c:\Softwareprojekte\DnD\node_modules\nx\src\daemon\server\project-graph-incremental-recomputation.js:138:17)
+[NX Daemon Server] - 2024-02-03T10:39:45.839Z - Time taken for 'hash changed files from watcher' 15.241700001060963ms
+[NX Daemon Server] - 2024-02-03T10:39:45.839Z - Done responding to the client null
+[NX Daemon Server] - 2024-02-03T13:07:16.014Z - Started listening on: \\.\pipe\nx\C:\Users\chris\AppData\Local\Temp\83d14e7134fc08a15480\d.sock
+[NX Daemon Server] - 2024-02-03T13:07:16.031Z - [WATCHER]: Subscribed to changes within: c:\Softwareprojekte\DnD (native)
+[NX Daemon Server] - 2024-02-03T13:07:16.031Z - Established a connection. Number of open connections: 1
+[NX Daemon Server] - 2024-02-03T13:07:16.032Z - Established a connection. Number of open connections: 2
+[NX Daemon Server] - 2024-02-03T13:07:16.032Z - Closed a connection. Number of open connections: 1
+[NX Daemon Server] - 2024-02-03T13:07:16.034Z - [REQUEST]: Client Request for Project Graph Received
+[NX Daemon Server] - 2024-02-03T13:07:18.022Z - Error detected when recomputing project file map: The following projects are defined in multiple locations:
+- DnDTools: 
+  - 
+  - .
+
+To fix this, set a unique name for each project in a project.json inside the project's root. If the project does not currently have a project.json, you can create one that contains only a name.
+[NX Daemon Server] - 2024-02-03T13:07:18.022Z - [REQUEST]: Responding to the client with an error. Error when preparing serialized project graph. The following projects are defined in multiple locations:
+- DnDTools: 
+  - 
+  - .
+
+To fix this, set a unique name for each project in a project.json inside the project's root. If the project does not currently have a project.json, you can create one that contains only a name.
+Error: The following projects are defined in multiple locations:
+- DnDTools: 
+  - 
+  - .
+
+To fix this, set a unique name for each project in a project.json inside the project's root. If the project does not currently have a project.json, you can create one that contains only a name.
+    at readProjectConfigurationsFromRootMap (c:\Softwareprojekte\DnD\node_modules\nx\src\project-graph\utils\project-configuration-utils.js:97:15)
+    at buildProjectsConfigurationsFromProjectPathsAndPlugins (c:\Softwareprojekte\DnD\node_modules\nx\src\project-graph\utils\project-configuration-utils.js:70:19)
+    at createProjectConfigurations (c:\Softwareprojekte\DnD\node_modules\nx\src\project-graph\utils\retrieve-workspace-files.js:131:129)
+    at WorkspaceContext.<anonymous> (c:\Softwareprojekte\DnD\node_modules\nx\src\project-graph\utils\retrieve-workspace-files.js:82:39)
+    at getProjectConfigurationsFromContext (c:\Softwareprojekte\DnD\node_modules\nx\src\utils\workspace-context.js:26:29)
+    at _retrieveProjectConfigurations (c:\Softwareprojekte\DnD\node_modules\nx\src\project-graph\utils\retrieve-workspace-files.js:81:72)
+    at retrieveProjectConfigurations (c:\Softwareprojekte\DnD\node_modules\nx\src\project-graph\utils\retrieve-workspace-files.js:58:12)
+    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
+    at async processCollectedUpdatedAndDeletedFiles (c:\Softwareprojekte\DnD\node_modules\nx\src\daemon\server\project-graph-incremental-recomputation.js:102:34)
+    at async processFilesAndCreateAndSerializeProjectGraph (c:\Softwareprojekte\DnD\node_modules\nx\src\daemon\server\project-graph-incremental-recomputation.js:138:17)
+[NX Daemon Server] - 2024-02-03T13:07:18.023Z - Time taken for 'hash changed files from watcher' 583.068599998951ms
+[NX Daemon Server] - 2024-02-03T13:07:18.023Z - Done responding to the client null
+[NX Daemon Server] - 2024-02-06T09:02:25.233Z - Started listening on: \\.\pipe\nx\C:\Users\chris\AppData\Local\Temp\83d14e7134fc08a15480\d.sock
+[NX Daemon Server] - 2024-02-06T09:02:25.241Z - [WATCHER]: Subscribed to changes within: c:\Softwareprojekte\DnD (native)
+[NX Daemon Server] - 2024-02-06T09:02:25.242Z - Established a connection. Number of open connections: 1
+[NX Daemon Server] - 2024-02-06T09:02:25.243Z - Established a connection. Number of open connections: 2
+[NX Daemon Server] - 2024-02-06T09:02:25.243Z - Closed a connection. Number of open connections: 1
+[NX Daemon Server] - 2024-02-06T09:02:25.248Z - [REQUEST]: Client Request for Project Graph Received
+[NX Daemon Server] - 2024-02-06T09:02:26.371Z - Error detected when recomputing project file map: The following projects are defined in multiple locations:
+- DnDTools: 
+  - 
+  - .
+
+To fix this, set a unique name for each project in a project.json inside the project's root. If the project does not currently have a project.json, you can create one that contains only a name.
+[NX Daemon Server] - 2024-02-06T09:02:26.371Z - [REQUEST]: Responding to the client with an error. Error when preparing serialized project graph. The following projects are defined in multiple locations:
+- DnDTools: 
+  - 
+  - .
+
+To fix this, set a unique name for each project in a project.json inside the project's root. If the project does not currently have a project.json, you can create one that contains only a name.
+Error: The following projects are defined in multiple locations:
+- DnDTools: 
+  - 
+  - .
+
+To fix this, set a unique name for each project in a project.json inside the project's root. If the project does not currently have a project.json, you can create one that contains only a name.
+    at readProjectConfigurationsFromRootMap (c:\Softwareprojekte\DnD\node_modules\nx\src\project-graph\utils\project-configuration-utils.js:97:15)
+    at buildProjectsConfigurationsFromProjectPathsAndPlugins (c:\Softwareprojekte\DnD\node_modules\nx\src\project-graph\utils\project-configuration-utils.js:70:19)
+    at createProjectConfigurations (c:\Softwareprojekte\DnD\node_modules\nx\src\project-graph\utils\retrieve-workspace-files.js:131:129)
+    at WorkspaceContext.<anonymous> (c:\Softwareprojekte\DnD\node_modules\nx\src\project-graph\utils\retrieve-workspace-files.js:82:39)
+    at getProjectConfigurationsFromContext (c:\Softwareprojekte\DnD\node_modules\nx\src\utils\workspace-context.js:26:29)
+    at _retrieveProjectConfigurations (c:\Softwareprojekte\DnD\node_modules\nx\src\project-graph\utils\retrieve-workspace-files.js:81:72)
+    at retrieveProjectConfigurations (c:\Softwareprojekte\DnD\node_modules\nx\src\project-graph\utils\retrieve-workspace-files.js:58:12)
+    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
+    at async processCollectedUpdatedAndDeletedFiles (c:\Softwareprojekte\DnD\node_modules\nx\src\daemon\server\project-graph-incremental-recomputation.js:102:34)
+    at async processFilesAndCreateAndSerializeProjectGraph (c:\Softwareprojekte\DnD\node_modules\nx\src\daemon\server\project-graph-incremental-recomputation.js:138:17)
+[NX Daemon Server] - 2024-02-06T09:02:26.371Z - Time taken for 'hash changed files from watcher' 350.1765000000596ms
+[NX Daemon Server] - 2024-02-06T09:02:26.371Z - Done responding to the client null

+ 1 - 1
.nx/cache/d/server-process.json

@@ -1 +1 @@
-{"processId":1412}
+{"processId":11728}

+ 8 - 3
src/app/character/character-picker/character-card/character-card.component.html

@@ -12,17 +12,22 @@
   <!-- The characterData is not loaded initially, so this is a workaround. Maybe add a resolver first -->
   @if(image){
   <img [src]="image" alt="portrait" />
-  } @else {
+  } @else if (characterData !== undefined) {
   <img
     [src]="'assets/images/' + characterData.gender.toLowerCase() + '.jpg'"
     alt="character"
   />
-  }
+  } @if(characterData !== undefined){
   <div class="content">
+    <!-- <div>{{ image }}</div> -->
     <div class="name">{{ character }}</div>
     <div class="level">Stufe {{ characterData.level }}</div>
     <div class="species">{{ races[characterData.race].display }}</div>
-    <div class="class">{{ classes[characterData.class].display }}</div>
+    <div class="class">
+      {{ classes[characterData.class].display }}
+    </div>
+
     <!-- <div class="subclass">{{ characterData.class }}</div> -->
   </div>
+  }
 </div>

+ 11 - 4
src/app/character/character-picker/character-card/character-card.component.ts

@@ -11,7 +11,7 @@ export class CharacterCardComponent {
   @Input() character: string = '';
   @Output() delete: EventEmitter<string> = new EventEmitter<string>();
   @Output() select: EventEmitter<string> = new EventEmitter<string>();
-  public characterData: any = {};
+  public characterData: any = undefined;
   public image: any;
   public races: any;
   public classes: any;
@@ -19,15 +19,22 @@ export class CharacterCardComponent {
   constructor(
     private dataAccessor: DataService,
     private translator: TranslatorService
-  ) {}
-
-  ngOnInit() {
+  ) {
     this.races = this.translator.races;
     this.classes = this.translator.classes;
+  }
+
+  ngOnInit() {
+    this.loadCharacterData();
+  }
+
+  public loadCharacterData(): void {
+    console.log(this.characterData);
     this.dataAccessor
       .getData(this.character, 'characterData')
       .then((characterData: any) => {
         this.characterData = characterData;
+        console.log(this.characterData);
       });
     this.dataAccessor.getData(this.character, 'image').then((image: any) => {
       this.image = image.value;

+ 17 - 2
src/app/character/character-picker/character-picker.component.ts

@@ -1,7 +1,14 @@
-import { Component, inject, TemplateRef } from '@angular/core';
+import {
+  Component,
+  inject,
+  QueryList,
+  TemplateRef,
+  ViewChildren,
+} from '@angular/core';
 import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
 import { DataService } from 'src/services/data/data.service';
 import { Router } from '@angular/router';
+import { CharacterCardComponent } from './character-card/character-card.component';
 
 @Component({
   selector: 'app-character-picker',
@@ -13,6 +20,9 @@ export class CharacterPickerComponent {
   public currentCharacter: string = '';
   private modalService = inject(NgbModal);
 
+  @ViewChildren(CharacterCardComponent)
+  characterCards!: QueryList<CharacterCardComponent>;
+
   public constructor(public dataService: DataService, private Router: Router) {
     this.dataService.dataLoaded = false;
     this.dataService.getCollection('characters').then((characters: any) => {
@@ -44,7 +54,12 @@ export class CharacterPickerComponent {
     this.dataService.deleteCollection('characters');
     setTimeout(() => {
       this.dataService.setCollection('characters', this.characters);
-    }, 1000);
+    }, 200);
+    setTimeout(() => {
+      this.characterCards.forEach((card) => {
+        card.loadCharacterData();
+      });
+    }, 500);
   }
 
   public selectCharacter(character: any) {

+ 5 - 4
src/app/journal/journal-stats/ability-panel/ability-table/ability-details/ability-details.component.scss

@@ -1,8 +1,9 @@
-.details-cost-charge{
+.details-cost-charge {
     display: flex;
     background-color: var(--secondary-color);
     justify-content: space-between;
-    margin: 1rem;
-    padding:0.5rem 2rem;
+    margin: 0, 875rem;
+    font-size: 600;
+    padding: 0.5rem 2rem;
     border-radius: 10px;
-}
+}

+ 2 - 1
src/app/journal/journal-stats/ability-panel/ability-table/ability-table.component.scss

@@ -3,7 +3,8 @@
 }
 
 .item-list {
-  height: calc(100% - 5rem);
+  // height: calc(100% - 5rem);
+  height: 40rem; //TODO: Only mocked to fit
 }
 
 .item {

+ 1 - 1
src/app/journal/journal-stats/ability-panel/ability-table/ability-table.component.ts

@@ -22,7 +22,7 @@ export class AbilityTableComponent {
 
   public costTranslator: any = {
     action: 'Aktion',
-    bonus: 'Bonusaktion',
+    bonus: 'Bonus',
     reaction: 'Reaktion',
   };
 

+ 1 - 0
src/app/journal/journal-stats/weapons-container/weapon-table/weapon-table.component.ts

@@ -83,6 +83,7 @@ export class WeaponTableComponent {
     }
     if (weapon.isMagical) {
       bonus = weapon.magicBonus!;
+      console.log(typeof weapon.magicBonus);
     }
     this.damageModifiers[index] = this.calculateModifier(value, bonus);
   }

+ 1 - 1
src/services/translator/translator.service.ts

@@ -27,7 +27,7 @@ export class TranslatorService {
     Goliath: { display: 'Goliath', value: 'Goliath' },
     HalfElf: { display: 'Halbelf', value: 'HalfElf' },
     HalfElfDetection: {
-      view: 'Halbelf (Mal des Entdeckens)',
+      display: 'Halbelf (Mal des Entdeckens)',
       value: 'HalfElfDetection',
     },
     HalfOrc: { display: 'Halbork', value: 'HalfOrc' },