Skip to content

Commit

Permalink
finish item editor
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyria committed Aug 7, 2024
1 parent 9d9a116 commit aa98482
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/app/tabs/items/items-editor/items-editor.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -445,11 +445,26 @@

@case (2) {
<div class="flex flex-row gap-2">
<div class="form-column">

<div class="form-row">
<app-input-floating-label>Cosmetic Name</app-input-floating-label>
<input [(ngModel)]="editingData.cosmetic!.name" type="text" placeholder="Enter cosmetic name..."
class="form-input" />
</div>

<div class="form-row">
<label class="label cursor-pointer" floatUi="Whether or not the cosmetic can be taken off of the item.">
<input type="checkbox" [(ngModel)]="editingData.cosmetic!.isPermanent" class="checkbox" />
<span class="label-text">Is Permanent Cosmetic</span>
</label>
</div>
</div>

<div class="form-column">
</div>
<div class="form-column">
</div>
</div>
}
}

<br>
{{ editingData | json }}
5 changes: 5 additions & 0 deletions src/app/tabs/items/items-editor/items-editor.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export class ItemsEditorComponent
item.equipEffect ??= { name: '', potency: 0 };
item.breakEffect ??= { name: '', potency: 0 };
item.requirements ??= { baseClass: undefined, level: 0 };
item.cosmetic ??= { name: '', isPermanent: false };

this.editing.set(item);
}
Expand Down Expand Up @@ -313,6 +314,10 @@ export class ItemsEditorComponent
) {
delete item.requirements;
}

if (item.cosmetic && !item.cosmetic.name) {
delete item.cosmetic;
}
}

public doSave() {
Expand Down

0 comments on commit aa98482

Please sign in to comment.