docs
This commit is contained in:
@@ -50,11 +50,11 @@ export class LocationPageComponent implements OnInit {
|
||||
}
|
||||
|
||||
protected activatePoi(poi: LocationPointOfInterest): void {
|
||||
this.dispatch(poi.type, poi.key);
|
||||
this.dispatch(poi.type, poi.key, poi.npcKey);
|
||||
}
|
||||
|
||||
protected activateAction(action: LocationPrimaryAction): void {
|
||||
this.dispatch(action.type, action.poiKey ?? action.key);
|
||||
this.dispatch(action.type, action.poiKey ?? action.key, action.npcKey);
|
||||
}
|
||||
|
||||
protected runtimeArtwork(artworkPath: string): string | undefined {
|
||||
@@ -75,7 +75,11 @@ export class LocationPageComponent implements OnInit {
|
||||
* for the screen that owns them; every other type asks the server what
|
||||
* happened. Unimplemented types are ignored rather than faked.
|
||||
*/
|
||||
private dispatch(type: LocationInteractionType, interactionKey: string): void {
|
||||
private dispatch(
|
||||
type: LocationInteractionType,
|
||||
interactionKey: string,
|
||||
npcKey?: string,
|
||||
): void {
|
||||
switch (type) {
|
||||
case 'HUNT':
|
||||
void this.router.navigate(['/hunt']);
|
||||
@@ -87,8 +91,20 @@ export class LocationPageComponent implements OnInit {
|
||||
case 'INVESTIGATE':
|
||||
case 'SEARCH':
|
||||
case 'NPC':
|
||||
// A hotspot that names an NPC opens that person's screen; one that
|
||||
// does not is scenery with a line of authored text behind it, and
|
||||
// still goes through the interaction endpoint.
|
||||
if (npcKey) {
|
||||
void this.router.navigate(['/npc', npcKey]);
|
||||
return;
|
||||
}
|
||||
void this.store.runInteraction(interactionKey);
|
||||
return;
|
||||
case 'SHOP':
|
||||
if (npcKey) {
|
||||
void this.router.navigate(['/npc', npcKey]);
|
||||
}
|
||||
return;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user