This commit is contained in:
Chris Chen
2024-02-28 15:17:41 -08:00
parent 42e7ee39be
commit 6301d6008b
124 changed files with 2655 additions and 667 deletions
+6 -6
View File
@@ -8,12 +8,12 @@ import * as signalR from "@microsoft/signalr"
import { StringUtils } from '../../utilities/string-utils';
import { ActivatedRoute } from '@angular/router';
import { MsgBoxService } from '../../services/msg-box.service';
import { ADButtons, ADIcon } from '../../ui/alert-dlg/alert-dlg.component';
import { UuidUtils } from '../../utilities/uuid-utils';
import { ObjectUtils } from '../../utilities/object-utils';
import { NbToastrService } from '@nebular/theme';
import { AvalonBase } from './avalonBase';
import { HeaderService } from '../../services/header.service';
import { ADIcon, ADButtons } from '../../ui/alert-dlg/alert-dlg.model';
const minimumPlayers = 5;
const maximumPlayers = 10;
@@ -181,7 +181,7 @@ export class AvalonComponent extends AvalonBase implements OnInit {
public showMyRole() {
let roleInfo = this.getRoleInfoByRole(this.me.role);
this.msgBoxService.show(roleInfo.name, roleInfo.description, ADIcon.INFO)
this.msgBoxService.show(roleInfo.name, { text: roleInfo.description, icon: ADIcon.INFO });
}
public showMySecret() {
//let roleInfo = this.getRoleInfoByRole(this.me.role);
@@ -208,7 +208,7 @@ export class AvalonComponent extends AvalonBase implements OnInit {
break;
}
this.msgBoxService.show('噓...', description, ADIcon.INFO);
this.msgBoxService.show('噓...', { text: description, icon: ADIcon.INFO });
}
private initializeQuestInfo() {
@@ -251,7 +251,7 @@ export class AvalonComponent extends AvalonBase implements OnInit {
previousStage() {
this.msgBoxService.show('上一棟', '你確定?', ADIcon.QUESTION, ADButtons.YesNo).pipe(first()).subscribe(result => {
this.msgBoxService.show('上一棟', { text: '你確定?', icon: ADIcon.QUESTION, buttons: ADButtons.YesNo }).pipe(first()).subscribe(result => {
if (result) {
this.avalonService.data.stage -= 1;
this.clearVoteStatus();
@@ -264,14 +264,14 @@ export class AvalonComponent extends AvalonBase implements OnInit {
switch (this.avalonService.data.stage) {
case AvalonStage.JoinGame:
if (this.players.length < 5) {
this.msgBoxService.show("人數不足!", "遊戲最少需要五人");
this.msgBoxService.show("人數不足!", { text: "遊戲最少需要五人" });
return;
}
this.gameSize = Math.max(0, this.players.length - 6);
if (this.avalonService.data.roles.filter(r => r.enabled && false == r.isGood).length != players_evil[this.gameSize]) {
this.msgBoxService.show("反派人數錯誤!", "反派人數需要 " + players_evil[this.gameSize].toString() + " 人");
this.msgBoxService.show("反派人數錯誤!", { text: "反派人數需要 " + players_evil[this.gameSize].toString() + " 人" });
return;
}
@@ -4,7 +4,7 @@ import { first } from 'rxjs/operators';
import { GameInfo, Player, Role, RoleInfo } from '../../../entity/Avalon';
import { AvalonService } from '../../../services/avalon.service';
import { MsgBoxService } from '../../../services/msg-box.service';
import { ADButtons, ADIcon } from '../../../ui/alert-dlg/alert-dlg.component';
import { ADButtons, ADIcon } from '../../../ui/alert-dlg/alert-dlg.model';
import { AvalonBase } from '../avalonBase';
@Component({
@@ -38,7 +38,7 @@ export class ChooseCharacterComponent extends AvalonBase implements OnInit {
// return;
this.ngZone.run(
_ => {
this.msgBoxService.show(roleInfo.name, roleInfo.description + '<br>你確定你是?', ADIcon.QUESTION, ADButtons.YesNo).pipe(first()).subscribe(result => {
this.msgBoxService.show(roleInfo.name, { text: roleInfo.description + '<br>你確定你是?', icon: ADIcon.QUESTION, buttons: ADButtons.YesNo }).pipe(first()).subscribe(result => {
if (result) {
if (this.players.find(p => p.role == roleInfo.role) && roleInfo.role != Role.ArthurKnight) {
this.toastrService.danger('腳色重複:' + roleInfo.name, '你確定沒有選錯腳色??')
@@ -2,7 +2,7 @@ import { ChangeDetectorRef, Component, NgZone, OnInit } from '@angular/core';
import { Player, AvalonStage } from '../../../entity/Avalon';
import { AvalonService } from '../../../services/avalon.service';
import { MsgBoxService } from '../../../services/msg-box.service';
import { ADIcon } from '../../../ui/alert-dlg/alert-dlg.component';
import { ADIcon } from '../../../ui/alert-dlg/alert-dlg.model';
import { AvalonBase } from '../avalonBase';
@Component({
@@ -38,7 +38,7 @@ export class PickTeammateComponent extends AvalonBase implements OnInit {
this.avalonService.applyCdChange$.next();
} else {
this.ngZone.run(_ => {
this.msgBoxService.show('任務編組錯誤!', `本次任務出場人數為 ${this.currentQuest.teamSize} 人!`, ADIcon.WARNING);
this.msgBoxService.show('任務編組錯誤!', { text: `本次任務出場人數為 ${this.currentQuest.teamSize} 人!`, icon: ADIcon.WARNING });
});
}
}