|
@@ -22,20 +22,40 @@
|
|
|
|
|
|
<div class="charges-box" *ngIf="ability.charges != 0">
|
|
<div class="charges-box" *ngIf="ability.charges != 0">
|
|
{{ "abilities.uses" | translate }}
|
|
{{ "abilities.uses" | translate }}
|
|
- @for (
|
|
|
|
- _ of getArray(ability.charges);
|
|
|
|
- let chargeIndex = $index;
|
|
|
|
- track _
|
|
|
|
- ) {
|
|
|
|
- <input
|
|
|
|
- [id]="'checkbox' + index + '-' + chargeIndex"
|
|
|
|
- type="checkbox"
|
|
|
|
- (click)="$event.stopPropagation()"
|
|
|
|
- (change)="
|
|
|
|
- $event.stopPropagation();
|
|
|
|
- handleChangedCharges(index, $event.target)
|
|
|
|
- "
|
|
|
|
- />
|
|
|
|
|
|
+ @if (ability.charges > 9) {
|
|
|
|
+ <div class="usage-box">
|
|
|
|
+ <icon-button
|
|
|
|
+ [icon]="'remove'"
|
|
|
|
+ [disabled]="ability.currentlyUsedCharges === ability.charges"
|
|
|
|
+ (click)="addUsage(index); $event.stopPropagation()"
|
|
|
|
+ ></icon-button>
|
|
|
|
+ <div class="usage">
|
|
|
|
+ {{ ability.charges - ability.currentlyUsedCharges }}/{{
|
|
|
|
+ ability.charges
|
|
|
|
+ }}
|
|
|
|
+ </div>
|
|
|
|
+ <icon-button
|
|
|
|
+ [icon]="'add'"
|
|
|
|
+ [disabled]="ability.currentlyUsedCharges === 0"
|
|
|
|
+ (click)="removeUsage(index); $event.stopPropagation()"
|
|
|
|
+ ></icon-button>
|
|
|
|
+ </div>
|
|
|
|
+ } @else {
|
|
|
|
+ @for (
|
|
|
|
+ _ of getArray(ability.charges);
|
|
|
|
+ let chargeIndex = $index;
|
|
|
|
+ track _
|
|
|
|
+ ) {
|
|
|
|
+ <input
|
|
|
|
+ [id]="'checkbox' + index + '-' + chargeIndex"
|
|
|
|
+ type="checkbox"
|
|
|
|
+ (click)="$event.stopPropagation()"
|
|
|
|
+ (change)="
|
|
|
|
+ $event.stopPropagation();
|
|
|
|
+ handleChangedCharges(index, $event.target)
|
|
|
|
+ "
|
|
|
|
+ />
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|