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
29 changed files
with
441 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { IDroptable } from '../../interfaces'; | ||
|
||
export const defaultDroptable: () => IDroptable = () => ({ | ||
isGlobal: false, | ||
mapName: null as unknown as string, | ||
maxChance: 0, | ||
noLuckBonus: false, | ||
regionName: null as unknown as string, | ||
requireHoliday: null as unknown as string, | ||
result: null as unknown as string, | ||
}); |
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
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
2 changes: 1 addition & 1 deletion
2
src/app/shared/components/cell-sprite/cell-sprite.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 |
---|---|---|
@@ -1 +1 @@ | ||
<app-sprite [type]="params.type" [sprite]="params.data.sprite"></app-sprite> | ||
<app-sprite [type]="params.type" [sprite]="spriteId()"></app-sprite> |
16 changes: 15 additions & 1 deletion
16
src/app/shared/components/cell-sprite/cell-sprite.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
23 changes: 23 additions & 0 deletions
23
src/app/shared/components/input-holiday/input-holiday.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,23 @@ | ||
<div class="relative"> | ||
<ng-select class="form-control" [items]="values()" [bindValue]="'value'" [(ngModel)]="holiday" | ||
placeholder="Select holiday..." (change)="change.emit($event?.value)"> | ||
|
||
<ng-template ng-label-tmp let-item="item"> | ||
<div class="text-white"> | ||
{{ item.value }} | ||
</div> | ||
</ng-template> | ||
|
||
<ng-template ng-option-tmp let-item="item"> | ||
<div class="relative"> | ||
<div class="text-white"> | ||
{{ item.value }} | ||
</div> | ||
|
||
<p class="text-white text-sm italic">{{ item.desc }}</p> | ||
</div> | ||
</ng-template> | ||
</ng-select> | ||
|
||
<app-input-floating-label>{{ label() }}</app-input-floating-label> | ||
</div> |
Empty file.
41 changes: 41 additions & 0 deletions
41
src/app/shared/components/input-holiday/input-holiday.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,41 @@ | ||
import { | ||
Component, | ||
computed, | ||
inject, | ||
input, | ||
model, | ||
output, | ||
} from '@angular/core'; | ||
import { ElectronService } from '../../../services/electron.service'; | ||
import { ModService } from '../../../services/mod.service'; | ||
|
||
@Component({ | ||
selector: 'app-input-holiday', | ||
templateUrl: './input-holiday.component.html', | ||
styleUrl: './input-holiday.component.scss', | ||
}) | ||
export class InputHolidayComponent { | ||
private electronService = inject(ElectronService); | ||
private modService = inject(ModService); | ||
|
||
public holiday = model.required<string>(); | ||
public label = input<string>('Holiday'); | ||
public change = output<string>(); | ||
|
||
public values = computed(() => { | ||
const holidayObj = this.modService.json()['holidaydescs'] as Record< | ||
string, | ||
any | ||
>; | ||
return Object.keys(holidayObj ?? {}) | ||
.sort() | ||
.map((t) => ({ | ||
value: t, | ||
desc: holidayObj[t].duration ?? 'No description', | ||
})); | ||
}); | ||
|
||
constructor() { | ||
this.electronService.requestJSON('holidaydescs'); | ||
} | ||
} |
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)]="map" placeholder="Select map..." | ||
(change)="change.emit($event?.value)"></ng-select> | ||
|
||
<app-input-floating-label>Map</app-input-floating-label> | ||
</div> |
Empty file.
19 changes: 19 additions & 0 deletions
19
src/app/shared/components/input-map/input-map.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,19 @@ | ||
import { Component, computed, inject, model, output } from '@angular/core'; | ||
import { uniq } from 'lodash'; | ||
import { ModService } from '../../../services/mod.service'; | ||
|
||
@Component({ | ||
selector: 'app-input-map', | ||
templateUrl: './input-map.component.html', | ||
styleUrl: './input-map.component.scss', | ||
}) | ||
export class InputMapComponent { | ||
private modService = inject(ModService); | ||
|
||
public map = model.required<string>(); | ||
public change = output<string>(); | ||
|
||
public values = computed(() => | ||
uniq(this.modService.mod().maps.map((m) => m.name)).sort() | ||
); | ||
} |
6 changes: 6 additions & 0 deletions
6
src/app/shared/components/input-region/input-region.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)]="region" | ||
placeholder="Select region..." (change)="change.emit($event?.value)"></ng-select> | ||
|
||
<app-input-floating-label>Region</app-input-floating-label> | ||
</div> |
Empty file.
21 changes: 21 additions & 0 deletions
21
src/app/shared/components/input-region/input-region.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,21 @@ | ||
import { Component, computed, inject, model, output } from '@angular/core'; | ||
import { uniq } from 'lodash'; | ||
import { ModService } from '../../../services/mod.service'; | ||
|
||
@Component({ | ||
selector: 'app-input-region', | ||
templateUrl: './input-region.component.html', | ||
styleUrl: './input-region.component.scss', | ||
}) | ||
export class InputRegionComponent { | ||
private modService = inject(ModService); | ||
|
||
public region = model.required<string>(); | ||
public change = output<string>(); | ||
|
||
public values = computed(() => | ||
uniq( | ||
this.modService.mod().maps.map((m) => m.map.properties.region 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.