generated from maximegris/angular-electron
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
310 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/app/shared/components/input-damageclass/input-damageclass.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<div class="relative"> | ||
<ng-select class="form-control" [items]="values" groupBy="category" [(ngModel)]="damageClass" | ||
placeholder="Select damage class..." (change)="change.emit($event.value)"></ng-select> | ||
|
||
<app-input-floating-label>Damage Class</app-input-floating-label> | ||
</div> |
Empty file.
14 changes: 14 additions & 0 deletions
14
src/app/shared/components/input-damageclass/input-damageclass.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Component, model, output } from '@angular/core'; | ||
import { DamageClass, DamageClassType } from '../../../../interfaces'; | ||
|
||
@Component({ | ||
selector: 'app-input-damageclass', | ||
templateUrl: './input-damageclass.component.html', | ||
styleUrl: './input-damageclass.component.scss', | ||
}) | ||
export class InputDamageclassComponent { | ||
public damageClass = model.required<DamageClassType>(); | ||
public change = output<DamageClass>(); | ||
|
||
public values = [...Object.values(DamageClass)]; | ||
} |
29 changes: 29 additions & 0 deletions
29
src/app/shared/components/input-item/input-item.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<div class="relative"> | ||
<ng-select class="form-control" [items]="values()" bindValue="data" groupBy="category" [(ngModel)]="item" | ||
placeholder="Select item..." (change)="change.emit($event.value)"> | ||
|
||
<ng-template ng-label-tmp let-item="item"> | ||
<div class="relative"> | ||
@if(item.data) { | ||
<app-sprite class="absolute -top-5 -left-5" [scale]="0.5" [type]="'items'" | ||
[sprite]="item.data.sprite"></app-sprite> | ||
} | ||
<div class="ml-7 text-white"> | ||
{{ item.data.name }} | ||
</div> | ||
</div> | ||
</ng-template> | ||
|
||
<ng-template ng-option-tmp let-item="item"> | ||
<div class="relative"> | ||
<app-sprite class="absolute -top-5 -left-7" [scale]="0.5" [type]="'items'" | ||
[sprite]="item.data.sprite"></app-sprite> | ||
<div class="ml-5 text-white"> | ||
{{ item.data.name }} | ||
</div> | ||
</div> | ||
</ng-template> | ||
</ng-select> | ||
|
||
<app-input-floating-label>Item</app-input-floating-label> | ||
</div> |
Empty file.
27 changes: 27 additions & 0 deletions
27
src/app/shared/components/input-item/input-item.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { Component, computed, inject, model, output } from '@angular/core'; | ||
import { IItemDefinition } from '../../../../interfaces'; | ||
import { ModService } from '../../../services/mod.service'; | ||
|
||
@Component({ | ||
selector: 'app-input-item', | ||
templateUrl: './input-item.component.html', | ||
styleUrl: './input-item.component.scss', | ||
}) | ||
export class InputItemComponent { | ||
private modService = inject(ModService); | ||
|
||
public item = model.required<IItemDefinition | undefined>(); | ||
public change = output<string>(); | ||
|
||
public values = computed(() => { | ||
const mod = this.modService.mod(); | ||
|
||
return [ | ||
...mod.items.map((i) => ({ | ||
category: 'My Mod Items', | ||
data: i, | ||
value: i.name, | ||
})), | ||
]; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<img [src]="'file://./resources/maps/__assets/spritesheets/' + type() + '.png'" class="sprite" | ||
[style.object-position]="objectPosition()" /> | ||
[style.object-position]="objectPosition()" [style.transform]="'scale(' + scale() + ')'" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.