All fixes'

This commit is contained in:
2022-01-10 08:00:27 +01:00
parent 9fbbd93a2e
commit 6387426b73
9 changed files with 184 additions and 47 deletions

View File

@ -105,7 +105,20 @@ export class PegasusActorCreate {
this.currentRole = role;
this.nbRoleStat = 2;
this.roleStats = duplicate(role.data.statincreasechoice)
this.showRoleStat( );
this.showRoleStartSpec( );
}
if ( step == 'select-role-start-spec') {
PegasusUtility.removeChatMessageId(PegasusUtility.findChatMessageId(event.currentTarget));
let spec = this.roleSpecStart.find( item => item._id == itemId);
this.actor.addIncSpec(spec, 1);
this.nbRoleSpecStart--;
this.roleSpecStart = this.roleSpecStart.filter( item => item._id != itemId);//Remove selected spec
if( this.nbRoleSpecStart == 0) {
this.showRoleStat( );
} else {
this.showRoleStartSpec( );
}
}
if ( step == 'select-role-stat') {
@ -261,7 +274,19 @@ export class PegasusActorCreate {
this.renderChatMessage( formData)
}
/* -------------------------------------------- */
/* ------------------------------- ------------- */
async showRoleStartSpec() {
if ( !this.roleSpecStart) {
this.roleSpecStart = duplicate(this.currentRole.data.specialisationsplus1)
this.nbRoleSpecStart = 2;
}
let formData = this.createFormData("select-role-start-spec")
formData.rolestartspec = this.roleSpecStart
formData.nbrolespecstart = this.nbRoleSpecStart;
this.renderChatMessage( formData)
}
/* ------------------------------- ------------- */
async showRoleStat( ) {
let formData = this.createFormData("select-role-stat")
formData.rolestats = []