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
25 changed files
with
1,074 additions
and
197 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { INPCScript } from '../../interfaces'; | ||
import { id } from './id'; | ||
|
||
export const defaultNPCScript: () => INPCScript = () => ({ | ||
_id: id(), | ||
tag: undefined as unknown as string, | ||
name: '', | ||
affiliation: '', | ||
hostility: 'Never', | ||
allegiance: 'Adventurers', | ||
alignment: 'neutral', | ||
level: 1, | ||
hp: { | ||
min: 100000, | ||
max: 100000, | ||
}, | ||
mp: { | ||
min: 10000, | ||
max: 10000, | ||
}, | ||
otherStats: {}, | ||
usableSkills: [], | ||
items: { | ||
equipment: { | ||
rightHand: undefined as unknown as string, | ||
leftHand: undefined as unknown as string, | ||
head: undefined as unknown as string, | ||
neck: undefined as unknown as string, | ||
ear: undefined as unknown as string, | ||
waist: undefined as unknown as string, | ||
wrists: undefined as unknown as string, | ||
ring1: undefined as unknown as string, | ||
ring2: undefined as unknown as string, | ||
hands: undefined as unknown as string, | ||
feet: undefined as unknown as string, | ||
armor: undefined as unknown as string, | ||
robe1: undefined as unknown as string, | ||
robe2: undefined as unknown as string, | ||
trinket: undefined as unknown as string, | ||
potion: undefined as unknown as string, | ||
ammo: undefined as unknown as string, | ||
}, | ||
}, | ||
dialog: { | ||
keyword: {}, | ||
}, | ||
behaviors: [], | ||
}); |
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
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-mapnpc/input-mapnpc.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()" [(ngModel)]="tag" placeholder="Select NPC tag..." | ||
(change)="change.emit($event)"></ng-select> | ||
|
||
<app-input-floating-label>Map NPC Tag</app-input-floating-label> | ||
</div> |
Empty file.
28 changes: 28 additions & 0 deletions
28
src/app/shared/components/input-mapnpc/input-mapnpc.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,28 @@ | ||
import { Component, computed, inject, model, output } from '@angular/core'; | ||
import { ModService } from '../../../services/mod.service'; | ||
|
||
@Component({ | ||
selector: 'app-input-mapnpc', | ||
templateUrl: './input-mapnpc.component.html', | ||
styleUrl: './input-mapnpc.component.scss', | ||
}) | ||
export class InputMapnpcComponent { | ||
private modService = inject(ModService); | ||
|
||
public tag = model.required<string | undefined>(); | ||
public change = output<string>(); | ||
|
||
public values = computed(() => { | ||
const maps = this.modService.availableMaps(); | ||
return [ | ||
...new Set( | ||
maps.flatMap( | ||
(m) => | ||
m.map.layers[9].objects.map( | ||
(npc: any) => npc.properties.tag as string | ||
) as string | ||
) | ||
), | ||
].sort(); | ||
}); | ||
} |
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.