Procházet zdrojové kódy

reworked inventory

Warafear před 1 rokem
rodič
revize
a0feaa46d8

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

@@ -463330,3 +463330,75 @@ To fix this, set a unique name for each project in a project.json inside the pro
 [NX Daemon Server] - 2024-01-24T17:26:21.011Z - Time taken for 'hash changed files from watcher' 261.5383999943733ms
 [NX Daemon Server] - 2024-01-24T17:26:21.012Z - [WATCHER]: Processing file changes in outputs
 [NX Daemon Server] - 2024-01-24T17:26:21.012Z - Done responding to the client null
+[NX Daemon Server] - 2024-01-25T19:42:57.792Z - Started listening on: \\.\pipe\nx\C:\Users\chris\AppData\Local\Temp\83d14e7134fc08a15480\d.sock
+[NX Daemon Server] - 2024-01-25T19:42:57.799Z - [WATCHER]: Subscribed to changes within: c:\Softwareprojekte\DnD (native)
+[NX Daemon Server] - 2024-01-25T19:42:57.801Z - Established a connection. Number of open connections: 1
+[NX Daemon Server] - 2024-01-25T19:42:57.804Z - Established a connection. Number of open connections: 2
+[NX Daemon Server] - 2024-01-25T19:42:57.805Z - Closed a connection. Number of open connections: 1
+[NX Daemon Server] - 2024-01-25T19:42:57.807Z - [REQUEST]: Client Request for Project Graph Received
+[NX Daemon Server] - 2024-01-25T19:42:59.768Z - 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-01-25T19:42:59.768Z - [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-01-25T19:42:59.772Z - Time taken for 'hash changed files from watcher' 455.7669000029564ms
+[NX Daemon Server] - 2024-01-25T19:42:59.774Z - Done responding to the client null
+[NX Daemon Server] - 2024-01-26T06:34:52.437Z - Started listening on: \\.\pipe\nx\C:\Users\chris\AppData\Local\Temp\83d14e7134fc08a15480\d.sock
+[NX Daemon Server] - 2024-01-26T06:34:52.444Z - [WATCHER]: Subscribed to changes within: c:\Softwareprojekte\DnD (native)
+[NX Daemon Server] - 2024-01-26T06:34:52.455Z - Established a connection. Number of open connections: 1
+[NX Daemon Server] - 2024-01-26T06:34:52.458Z - Closed a connection. Number of open connections: 0
+[NX Daemon Server] - 2024-01-26T06:34:52.458Z - Established a connection. Number of open connections: 1
+[NX Daemon Server] - 2024-01-26T06:34:52.460Z - [REQUEST]: Client Request for Project Graph Received
+[NX Daemon Server] - 2024-01-26T06:34:52.559Z - 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-01-26T06:34:52.560Z - [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-01-26T06:34:52.561Z - Time taken for 'hash changed files from watcher' 26.63969999551773ms
+[NX Daemon Server] - 2024-01-26T06:34:52.561Z - Done responding to the client null

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

@@ -1 +1 @@
-{"processId":9388}
+{"processId":1292}

+ 6 - 0
src/app/character/character-picker/character-picker.component.scss

@@ -7,6 +7,9 @@
     display: flex;
     align-items: center;
     justify-content: center;
+    @media (height < 900px) {
+        height: 6rem;
+    }
 }
 
 ::ng-deep body {
@@ -24,6 +27,9 @@
     row-gap: 2.5rem;
     overflow: auto;
     height: calc(100% - 8rem);
+    @media (height < 900px) {
+        height: calc(100% - 6rem);
+    }
     background-color: var(--background-color);
 }
 

+ 12 - 1
src/app/journal/journal-home/journal-home.component.html

@@ -1,7 +1,18 @@
-<div class="journal-container">
+<div style="position: relative" class="journal-container">
   <!-- Here the different pages are rendered -->
   <router-outlet></router-outlet>
   <details-panel></details-panel>
   <navigation-panel></navigation-panel>
   <modal></modal>
+
+  <div
+    style="
+      position: absolute;
+      left: 0;
+      top: 864px;
+      z-index: 10000;
+      border: 2px solid black;
+      width: 100%;
+    "
+  ></div>
 </div>

+ 8 - 26
src/app/journal/journal-inventory/journal-inventory.component.html

@@ -30,12 +30,9 @@
     } @case(2){
     <ng-container [ngTemplateOutlet]="miscTemplate"></ng-container>
     }}
-    <!-- TODO: Überarbeiten -->
 
-    <div class="button-container">
-      <button class="add-button" (click)="addItem('items')">
-        Eintrag hinzufügen
-      </button>
+    <div class="footer">
+      <button (click)="addItem('items')">Eintrag hinzufügen</button>
     </div>
   </div>
   <div class="right-column">
@@ -60,7 +57,9 @@
       </div>
       <div class="heading-row">
         <div class="heading">Name</div>
-        <div class="heading">Fertig</div>
+        <div class="heading">
+          {{ foodActive === 1 ? "Verzehrfertig" : "Wert" }}
+        </div>
         <div class="heading">Gewicht</div>
         <div class="heading">Anzahl</div>
       </div>
@@ -69,26 +68,9 @@
       } @case(2){
       <ng-container [ngTemplateOutlet]="consumablesTemplate"></ng-container>
       } }
-      <!-- <div
-        cdkDropList
-        class="item-list table-content"
-        (cdkDropListDropped)="drop($event, food, 'food')"
-      >
-        @for (item of food; let index = $index; track item) {
-        <div class="item" cdkDrag (click)="openFoodDetails(index)">
-          <div class="item-property">{{ item.name }}</div>
-          <div class="item-property">@if(item.isReady){Ja} @else {Nein}</div>
-          <div class="item-property">{{ item.weight }} lb.</div>
-          <div class="item-property">{{ item.quantity }}</div>
-        </div>
-        } @empty {
-        <div class="empty-list">Kein Eintrag</div>
-        }
-      </div>-->
-      <div class="button-container">
-        <button class="add-button" (click)="addItem('consumables')">
-          Eintrag hinzufügen
-        </button>
+
+      <div class="footer">
+        <button (click)="addItem('consumables')">Eintrag hinzufügen</button>
       </div>
     </div>
 

+ 5 - 21
src/app/journal/journal-inventory/journal-inventory.component.scss

@@ -247,31 +247,15 @@
   font-weight: 600;
 }
 
-.button-container {
-  height: 5rem;
-  display: flex;
-  justify-content: center;
-  align-items: center;
-}
-
-.add-button {
-  width: 18rem;
-  height: 3rem;
-  font-size: 1.25rem;
-  font-weight: 600;
-  border-radius: 10px;
-  border: var(--border-color);
-  background-color: var(--accept);
-  box-shadow: var(--shadow);
-  transition: all 0.25s ease-in-out;
-  &:hover {
-    background-color: var(--accept-hover);
+.footer {
+  button {
+    width: 22rem;
   }
 }
+
 // Drag and Drop
 .item-list {
-  max-width: 100%;
-  min-height: 60px;
+  width: 100%;
   display: flex;
   flex-direction: column;
   gap: 0.75rem;

+ 8 - 0
src/app/journal/journal-inventory/journal-inventory.component.ts

@@ -94,6 +94,8 @@ export class JournalInventoryComponent {
           this.updateDatabase(listName);
         } else if (result.state === 'update') {
           this.openItemModal(true, listName, list, index);
+        } else if (result.state === 'dismiss') {
+          // Do nothing
         } else {
           throw new Error('DND-Error: Unknown state: ' + result.state);
         }
@@ -113,6 +115,8 @@ export class JournalInventoryComponent {
           this.dataAccessor.food = this.food;
         } else if (result.state === 'update') {
           this.openFoodModal(true, index);
+        } else if (result.state === 'dismiss') {
+          // Do nothing
         } else {
           throw new Error('DND-Error: Unknown state: ' + result.state);
         }
@@ -138,6 +142,8 @@ export class JournalInventoryComponent {
         } else if (result.state === 'add') {
           this.food.push(result.data);
           this.updateFood();
+        } else if (result.state === 'dismiss') {
+          // Do nothing
         } else {
           throw new Error('DND-Error: Unknown state: ' + result.state);
         }
@@ -167,6 +173,8 @@ export class JournalInventoryComponent {
         } else if (result.state === 'add') {
           list!.push(result.data);
           this.updateDatabase(listname);
+        } else if (result.state === 'cancel') {
+          // Do nothing
         } else {
           throw new Error('DND-Error: Unknown state: ' + result.state);
         }

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

@@ -12,6 +12,7 @@
     display: flex;
     flex: 0 0 3rem;
     box-shadow: var(--shadow-bottom);
+    border-radius: 10px;
     > * {
         flex: 1 1 0;
     }

+ 26 - 1
src/styles.scss

@@ -73,6 +73,7 @@
 
     --border: 1px solid var(--border-color);
 
+    // Responsiveness
     .responsive-small {
         display: none;
     }
@@ -90,6 +91,12 @@
         }
     }
 
+    @media (height < 934px) {
+        .item-list {
+            background-color: red;
+        }
+    }
+
     // LISTS
 
     .item-list {
@@ -129,6 +136,8 @@
         button {
             height: 3rem;
             width: 80%;
+            font-size: 1.25rem;
+            font-weight: 600;
             border-radius: 10px;
             background: var(--accept);
             transition: background-color 0.2s ease-in-out;
@@ -145,6 +154,7 @@
     .cdk-drag-preview {
         box-sizing: border-box;
         border-radius: 10px;
+        background-color: var(--items-hover);
         box-shadow:
             0 5px 5px -3px rgba(0, 0, 0, 0.2),
             0 8px 10px 1px rgba(0, 0, 0, 0.14),
@@ -163,7 +173,13 @@
         transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
     }
 
-    // TODO: Check which of the below are still used
+    // GENERAL STYLES
+
+    //  Checkbox
+
+    input[type="checkbox"] {
+        accent-color: var(--accept) !important;
+    }
 
     // Scrollbar
     ::-webkit-scrollbar {
@@ -188,6 +204,15 @@
     }
 }
 
+// Line styles
+
+.centered-line {
+    display: flex;
+    align-items: center;
+}
+
+// TODO: Check which of the below are still used
+
 //  Info Row
 
 .info-container {