Skip to content

Commit

Permalink
feat(explore): job change now has a dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyria committed Sep 18, 2023
1 parent a652d4f commit ffc87a9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion client/src/app/pages/explore/explore.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@
<ion-col sizeXs="4" class="action-action">
<ion-button
color="secondary"
(click)="actionsService.doAction(actionInfo)"
(click)="confirmClassChange(actionInfo)"
>
{{ actionInfo.text }}
</ion-button>
Expand Down
24 changes: 24 additions & 0 deletions client/src/app/pages/explore/explore.page.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Component, DestroyRef, OnInit, inject } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { IFight, INotificationAction, IPlayerLocation } from '@interfaces';
import { AlertController } from '@ionic/angular';
import { Select, Store } from '@ngxs/store';
import { ActionsService } from '@services/actions.service';
import { ContentService } from '@services/content.service';
Expand Down Expand Up @@ -31,6 +32,7 @@ export class ExplorePage implements OnInit {

constructor(
private store: Store,
private alertCtrl: AlertController,
private gameplayService: GameplayService,
private contentService: ContentService,
public actionsService: ActionsService,
Expand Down Expand Up @@ -72,4 +74,26 @@ export class ExplorePage implements OnInit {
getMonster(monsterId: string) {
return this.contentService.getMonster(monsterId)!;
}

async confirmClassChange(action: INotificationAction) {
const alert = await this.alertCtrl.create({
header: 'Change Job',
message: `Are you sure you want to change your job to ${action.actionData.newJob}? Your equipment will switch to that jobs equipment and you will change your level to that jobs level (level 1 if you have not been that job).`,
buttons: [
{
text: 'Cancel',
role: 'cancel',
},
{
text: 'Yes, Change',
handler: async () => {
this.actionsService.doAction(action);
},
},
],
});

await alert.present();
console.log(action);
}
}

0 comments on commit ffc87a9

Please sign in to comment.