Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RLG Maker
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Romain DELEAU
RLG Maker
Commits
c33e8cc1
Commit
c33e8cc1
authored
Apr 03, 2024
by
Romain DELEAU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add discussion reward in role, discussion, sentence, response
parent
f9ff153d
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
206 additions
and
6 deletions
+206
-6
app.component.ts
src/app/app.component.ts
+13
-0
discussion.ts
src/app/class/discussion/discussion.ts
+8
-0
response.ts
src/app/class/response/response.ts
+8
-0
discussion-reward.spec.ts
...class/rewards/discussion-reward/discussion-reward.spec.ts
+7
-0
discussion-reward.ts
src/app/class/rewards/discussion-reward/discussion-reward.ts
+10
-0
role.ts
src/app/class/role/role.ts
+9
-0
sentence.ts
src/app/class/sentence/sentence.ts
+8
-0
discussion-dialog.component.html
...ialogs/discussion-dialog/discussion-dialog.component.html
+64
-4
discussion-dialog.component.scss
...ialogs/discussion-dialog/discussion-dialog.component.scss
+1
-1
role.component.html
src/app/pieces/role/role.component.html
+17
-1
role.component.ts
src/app/pieces/role/role.component.ts
+8
-0
discussions.component.ts
src/app/sider-pieces/discussions/discussions.component.ts
+47
-0
en.json
src/assets/lang/en.json
+3
-0
fr.json
src/assets/lang/fr.json
+3
-0
No files found.
src/app/app.component.ts
View file @
c33e8cc1
...
...
@@ -48,6 +48,7 @@ import { Sentence } from './class/sentence/sentence';
import
{
InterrogativeSentence
}
from
'./class/sentence/interrogativeSentence/interrogative-sentence'
;
import
{
DeclarativeSentence
}
from
'./class/sentence/declarativeSentence/declarative-sentence'
;
import
{
ObjectReward
}
from
'./class/rewards/object-reward/object-reward'
;
import
{
DiscussionReward
}
from
'./class/rewards/discussion-reward/discussion-reward'
;
@
Component
({
selector
:
'app-root'
,
...
...
@@ -279,6 +280,9 @@ export class AppComponent {
if
(
rewardData
.
type
==
'object'
)
{
return
Object
.
assign
(
new
ObjectReward
(),
rewardData
);
}
if
(
rewardData
.
type
==
'discussion'
)
{
return
Object
.
assign
(
new
DiscussionReward
(),
rewardData
);
}
});
role
.
rewards
.
forEach
((
reward
:
Reward
,
index
:
number
)
=>
{
if
(
reward
instanceof
SkillReward
)
{
...
...
@@ -328,6 +332,9 @@ export class AppComponent {
if
(
rewardData
.
type
==
'object'
)
{
return
Object
.
assign
(
new
ObjectReward
(),
rewardData
);
}
if
(
rewardData
.
type
==
'discussion'
)
{
return
Object
.
assign
(
new
DiscussionReward
(),
rewardData
);
}
});
discussion
.
rewards
.
forEach
((
reward
:
Reward
,
index
:
number
)
=>
{
if
(
reward
instanceof
SkillReward
)
{
...
...
@@ -371,6 +378,9 @@ export class AppComponent {
if
(
rewardData
.
type
==
'object'
)
{
return
Object
.
assign
(
new
ObjectReward
(),
rewardData
);
}
if
(
rewardData
.
type
==
'discussion'
)
{
return
Object
.
assign
(
new
DiscussionReward
(),
rewardData
);
}
});
sentence
.
rewards
.
forEach
((
reward
:
Reward
,
index
:
number
)
=>
{
if
(
reward
instanceof
SkillReward
)
{
...
...
@@ -407,6 +417,9 @@ export class AppComponent {
if
(
rewardData
.
type
==
'object'
)
{
return
Object
.
assign
(
new
ObjectReward
(),
rewardData
);
}
if
(
rewardData
.
type
==
'discussion'
)
{
return
Object
.
assign
(
new
DiscussionReward
(),
rewardData
);
}
});
response
.
rewards
.
forEach
((
reward
:
Reward
,
index
:
number
)
=>
{
if
(
reward
instanceof
SkillReward
)
{
...
...
src/app/class/discussion/discussion.ts
View file @
c33e8cc1
import
{
Character
}
from
"../character/character"
;
import
{
CharacterReward
}
from
"../rewards/character-reward/character-reward"
;
import
{
DiscussionReward
}
from
"../rewards/discussion-reward/discussion-reward"
;
import
{
ObjectReward
}
from
"../rewards/object-reward/object-reward"
;
import
{
QuestReward
}
from
"../rewards/quest-reward/quest-reward"
;
import
{
Reward
}
from
"../rewards/reward"
;
...
...
@@ -40,6 +41,9 @@ export class Discussion {
case
'object'
:
this
.
rewards
[
index
]
=
new
ObjectReward
();
//this.scenario.traces.push(new Trace(this.scenario.traces.length,'transform',this.missionIndex,this.i,'Reward_['+index+']_transform_into_[ObjectReward]', 'Role_['+this.i+']', '#9AD5EC', '*'));
break
;
case
'discussion'
:
this
.
rewards
[
index
]
=
new
DiscussionReward
();
//this.scenario.traces.push(new Trace(this.scenario.traces.length,'transform',this.missionIndex,this.i,'Reward_['+index+']_transform_into_[DiscussionReward]', 'Role_['+this.i+']', '#9AD5EC', '*'));
break
;
}
}
...
...
@@ -71,6 +75,10 @@ export class Discussion {
return
this
.
rewards
[
index
]
as
ObjectReward
;
}
getDiscussionReward
(
index
:
number
):
DiscussionReward
{
return
this
.
rewards
[
index
]
as
DiscussionReward
;
}
changeQuestReward
(
roleIntitule
:
string
,
index
:
number
,
event
:
any
)
{
let
value
:
string
=
event
.
target
.
value
;
let
reward
=
new
QuestReward
();
...
...
src/app/class/response/response.ts
View file @
c33e8cc1
import
{
CharacterReward
}
from
"../rewards/character-reward/character-reward"
;
import
{
DiscussionReward
}
from
"../rewards/discussion-reward/discussion-reward"
;
import
{
ObjectReward
}
from
"../rewards/object-reward/object-reward"
;
import
{
QuestReward
}
from
"../rewards/quest-reward/quest-reward"
;
import
{
Reward
}
from
"../rewards/reward"
;
...
...
@@ -35,6 +36,9 @@ export class Response {
case
'object'
:
this
.
rewards
[
index
]
=
new
ObjectReward
();
//this.scenario.traces.push(new Trace(this.scenario.traces.length,'transform',this.missionIndex,this.i,'Reward_['+index+']_transform_into_[ObjectReward]', 'Role_['+this.i+']', '#9AD5EC', '*'));
break
;
case
'discussion'
:
this
.
rewards
[
index
]
=
new
DiscussionReward
();
//this.scenario.traces.push(new Trace(this.scenario.traces.length,'transform',this.missionIndex,this.i,'Reward_['+index+']_transform_into_[DiscussionReward]', 'Role_['+this.i+']', '#9AD5EC', '*'));
break
;
}
}
...
...
@@ -66,6 +70,10 @@ export class Response {
return
this
.
rewards
[
index
]
as
ObjectReward
;
}
getDiscussionReward
(
index
:
number
):
DiscussionReward
{
return
this
.
rewards
[
index
]
as
DiscussionReward
;
}
changeQuestReward
(
roleIntitule
:
string
,
index
:
number
,
event
:
any
)
{
let
value
:
string
=
event
.
target
.
value
;
let
reward
=
new
QuestReward
();
...
...
src/app/class/rewards/discussion-reward/discussion-reward.spec.ts
0 → 100644
View file @
c33e8cc1
import
{
DiscussionReward
}
from
'./discussion-reward'
;
describe
(
'DiscussionReward'
,
()
=>
{
it
(
'should create an instance'
,
()
=>
{
expect
(
new
DiscussionReward
()).
toBeTruthy
();
});
});
src/app/class/rewards/discussion-reward/discussion-reward.ts
0 → 100644
View file @
c33e8cc1
import
{
Reward
}
from
"../reward"
;
export
class
DiscussionReward
extends
Reward
{
constructor
()
{
super
(
'discussion'
);
}
discussionId
:
number
=
-
1
;
}
src/app/class/role/role.ts
View file @
c33e8cc1
...
...
@@ -9,6 +9,7 @@ import { Comment } from "../comment/comment";
import
{
Discussion
}
from
"../discussion/discussion"
;
import
{
Sentence
}
from
"../sentence/sentence"
;
import
{
Response
}
from
"../response/response"
;
import
{
Character
}
from
"../character/character"
;
export
class
Role
{
...
...
@@ -275,4 +276,12 @@ export class Role {
return
cpt
;
}
characterHasDiscussion
(
char
:
Character
):
boolean
{
if
(
this
.
discussions
.
find
(
discussion
=>
discussion
.
character
==
char
)
!=
undefined
)
{
return
true
;
}
else
{
return
false
;
}
}
}
src/app/class/sentence/sentence.ts
View file @
c33e8cc1
import
{
CharacterReward
}
from
"../rewards/character-reward/character-reward"
;
import
{
DiscussionReward
}
from
"../rewards/discussion-reward/discussion-reward"
;
import
{
ObjectReward
}
from
"../rewards/object-reward/object-reward"
;
import
{
QuestReward
}
from
"../rewards/quest-reward/quest-reward"
;
import
{
Reward
}
from
"../rewards/reward"
;
...
...
@@ -34,6 +35,9 @@ export abstract class Sentence {
case
'object'
:
this
.
rewards
[
index
]
=
new
ObjectReward
();
//this.scenario.traces.push(new Trace(this.scenario.traces.length,'transform',this.missionIndex,this.i,'Reward_['+index+']_transform_into_[ObjectReward]', 'Role_['+this.i+']', '#9AD5EC', '*'));
break
;
case
'discussion'
:
this
.
rewards
[
index
]
=
new
DiscussionReward
();
//this.scenario.traces.push(new Trace(this.scenario.traces.length,'transform',this.missionIndex,this.i,'Reward_['+index+']_transform_into_[DiscussionReward]', 'Role_['+this.i+']', '#9AD5EC', '*'));
break
;
}
}
...
...
@@ -65,6 +69,10 @@ export abstract class Sentence {
return
this
.
rewards
[
index
]
as
ObjectReward
;
}
getDiscussionReward
(
index
:
number
):
DiscussionReward
{
return
this
.
rewards
[
index
]
as
DiscussionReward
;
}
changeQuestReward
(
roleIntitule
:
string
,
index
:
number
,
event
:
any
)
{
let
value
:
string
=
event
.
target
.
value
;
let
reward
=
new
QuestReward
();
...
...
src/app/components/dialogs/discussion-dialog/discussion-dialog.component.html
View file @
c33e8cc1
...
...
@@ -30,7 +30,7 @@
<option
value=
"skill"
>
{{'role_reward_type_skill' | translate}}
</option>
<option
value=
"character"
>
{{'role_reward_type_character' | translate}}
</option>
<option
value=
"object"
>
{{'role_reward_type_object' | translate}}
</option>
<
!--<option value="discuss">Changer de discussion</option>--
>
<
option
value=
"discussion"
>
{{'role_reward_type_discussion' | translate}}
</option
>
</select>
</div>
...
...
@@ -69,6 +69,21 @@
</select>
</div>
<div
class=
"form-result-results-result-discussion"
*
ngIf=
"reward.type == 'discussion'"
>
<select
[(
ngModel
)]="
discussion
.
getDiscussionReward
(
rewardIndex
).
discussionId
"
[
matTooltip
]="
translate
.
instant
('
role_reward_type_discussion_tooltip
')"
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
>
<option
[
ngValue
]="
-1
"
selected
disabled
>
{{'role_reward_type_discussion_placeholder' | translate}}
</option>
<ng-container
*
ngFor=
"let character of scenario.characters"
>
<optgroup
[
label
]="
character
.
name
"
*
ngIf=
"role.characterHasDiscussion(character)"
>
<ng-container
*
ngFor=
"let discuss of role.discussions"
>
<option
[
ngValue
]="
discuss
.
ID
"
*
ngIf=
"discuss.character == character && discussion.ID != discuss.ID"
>
{{discuss.name}}
</option>
</ng-container>
</optgroup>
</ng-container>
</select>
</div>
<div
class=
"form-result-results-result-object"
*
ngIf=
"reward.type == 'object'"
>
<input
type=
"number"
[(
ngModel
)]="
discussion
.
getObjectReward
(
rewardIndex
).
quantity
"
/>
<select
[(
ngModel
)]="
discussion
.
getObjectReward
(
rewardIndex
).
object
"
...
...
@@ -148,7 +163,7 @@
<option
value=
"skill"
>
{{'role_reward_type_skill' | translate}}
</option>
<option
value=
"character"
>
{{'role_reward_type_character' | translate}}
</option>
<option
value=
"object"
>
{{'role_reward_type_object' | translate}}
</option>
<
!--<option value="discuss">Changer de discussion</option>--
>
<
option
value=
"discussion"
>
{{'role_reward_type_discussion' | translate}}
</option
>
</select>
</div>
...
...
@@ -186,6 +201,21 @@
<option
[
ngValue
]="
character
"
*
ngFor=
"let character of scenario.characters"
>
{{character.name}}
</option>
</select>
</div>
<div
class=
"form-result-results-result-discussion"
*
ngIf=
"reward.type == 'discussion'"
>
<select
[(
ngModel
)]="
sentence
.
getDiscussionReward
(
rewardIndex
).
discussionId
"
[
matTooltip
]="
translate
.
instant
('
role_reward_type_discussion_tooltip
')"
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
>
<option
[
ngValue
]="
-1
"
selected
disabled
>
{{'role_reward_type_discussion_placeholder' | translate}}
</option>
<ng-container
*
ngFor=
"let character of scenario.characters"
>
<optgroup
[
label
]="
character
.
name
"
*
ngIf=
"role.characterHasDiscussion(character)"
>
<ng-container
*
ngFor=
"let discuss of role.discussions"
>
<option
[
ngValue
]="
discuss
.
ID
"
*
ngIf=
"discuss.character == character && discussion.ID != discuss.ID"
>
{{discuss.name}}
</option>
</ng-container>
</optgroup>
</ng-container>
</select>
</div>
<div
class=
"form-result-results-result-object"
*
ngIf=
"reward.type == 'object'"
>
<input
type=
"number"
[(
ngModel
)]="
sentence
.
getObjectReward
(
rewardIndex
).
quantity
"
/>
...
...
@@ -249,7 +279,7 @@
<option
value=
"skill"
>
{{'role_reward_type_skill' | translate}}
</option>
<option
value=
"character"
>
{{'role_reward_type_character' | translate}}
</option>
<option
value=
"object"
>
{{'role_reward_type_object' | translate}}
</option>
<
!--<option value="discuss">Changer de discussion</option>--
>
<
option
value=
"discussion"
>
{{'role_reward_type_discussion' | translate}}
</option
>
</select>
</div>
...
...
@@ -287,6 +317,21 @@
<option
[
ngValue
]="
character
"
*
ngFor=
"let character of scenario.characters"
>
{{character.name}}
</option>
</select>
</div>
<div
class=
"form-result-results-result-discussion"
*
ngIf=
"reward.type == 'discussion'"
>
<select
[(
ngModel
)]="
sentence
.
getDiscussionReward
(
rewardIndex
).
discussionId
"
[
matTooltip
]="
translate
.
instant
('
role_reward_type_discussion_tooltip
')"
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
>
<option
[
ngValue
]="
-1
"
selected
disabled
>
{{'role_reward_type_discussion_placeholder' | translate}}
</option>
<ng-container
*
ngFor=
"let character of scenario.characters"
>
<optgroup
[
label
]="
character
.
name
"
*
ngIf=
"role.characterHasDiscussion(character)"
>
<ng-container
*
ngFor=
"let discuss of role.discussions"
>
<option
[
ngValue
]="
discuss
.
ID
"
*
ngIf=
"discuss.character == character && discussion.ID != discuss.ID"
>
{{discuss.name}}
</option>
</ng-container>
</optgroup>
</ng-container>
</select>
</div>
<div
class=
"form-result-results-result-object"
*
ngIf=
"reward.type == 'object'"
>
<input
type=
"number"
[(
ngModel
)]="
sentence
.
getObjectReward
(
rewardIndex
).
quantity
"
/>
...
...
@@ -348,7 +393,7 @@
<option
value=
"skill"
>
{{'role_reward_type_skill' | translate}}
</option>
<option
value=
"character"
>
{{'role_reward_type_character' | translate}}
</option>
<option
value=
"object"
>
{{'role_reward_type_object' | translate}}
</option>
<
!--<option value="discuss">Changer de discussion</option>--
>
<
option
value=
"discussion"
>
{{'role_reward_type_discussion' | translate}}
</option
>
</select>
</div>
...
...
@@ -386,6 +431,21 @@
<option
[
ngValue
]="
character
"
*
ngFor=
"let character of scenario.characters"
>
{{character.name}}
</option>
</select>
</div>
<div
class=
"form-result-results-result-discussion"
*
ngIf=
"reward.type == 'discussion'"
>
<select
[(
ngModel
)]="
response
.
getDiscussionReward
(
rewardIndex
).
discussionId
"
[
matTooltip
]="
translate
.
instant
('
role_reward_type_discussion_tooltip
')"
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
>
<option
[
ngValue
]="
-1
"
selected
disabled
>
{{'role_reward_type_discussion_placeholder' | translate}}
</option>
<ng-container
*
ngFor=
"let character of scenario.characters"
>
<optgroup
[
label
]="
character
.
name
"
*
ngIf=
"role.characterHasDiscussion(character)"
>
<ng-container
*
ngFor=
"let discuss of role.discussions"
>
<option
[
ngValue
]="
discuss
.
ID
"
*
ngIf=
"discuss.character == character && discussion.ID != discuss.ID"
>
{{discuss.name}}
</option>
</ng-container>
</optgroup>
</ng-container>
</select>
</div>
<div
class=
"form-result-results-result-object"
*
ngIf=
"reward.type == 'object'"
>
<input
type=
"number"
[(
ngModel
)]="
response
.
getObjectReward
(
rewardIndex
).
quantity
"
/>
...
...
src/app/components/dialogs/discussion-dialog/discussion-dialog.component.scss
View file @
c33e8cc1
...
...
@@ -92,7 +92,7 @@ mat-dialog-actions {
}
}
&
-character
,
&
-quest
{
&
-character
,
&
-quest
,
&
-discussion
{
margin-top
:
3px
;
width
:
250px
;
...
...
src/app/pieces/role/role.component.html
View file @
c33e8cc1
...
...
@@ -71,7 +71,7 @@ matTooltipPosition="left" [matTooltipDisabled]="!tooltipService.activatedTooltip
<option
value=
"objective"
>
{{'role_reward_type_objective' | translate}}
</option>
<option
value=
"objects"
hidden
>
{{'role_reward_type_object' | translate}}
</option>
<option
value=
"object"
>
{{'role_reward_type_object' | translate}}
</option>
<
!--<option value="discuss">Changer de discussion</option>--
>
<
option
value=
"discussion"
>
{{'role_reward_type_discussion' | translate}}
</option
>
<option
value=
"other"
>
{{'role_reward_type_other' | translate}}
</option>
</select>
</div>
...
...
@@ -92,6 +92,22 @@ matTooltipPosition="left" [matTooltipDisabled]="!tooltipService.activatedTooltip
<button
mat-button
(
click
)="
removeReward
(
i
)"
><mat-icon
fontIcon=
"remove"
></mat-icon></button>
</div>
<div
class=
"piece-form-rewards-reward-discussion"
*
ngIf=
"reward.type == 'discussion'"
>
<select
[(
ngModel
)]="
getDiscussionReward
(
i
).
discussionId
"
(
change
)="
editTrace
($
event
,
'
Reward_
['+
i
+']
_discussion
')"
[
matTooltip
]="
translate
.
instant
('
role_reward_type_discussion_tooltip
')"
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
>
<option
[
ngValue
]="
-1
"
selected
disabled
>
{{'role_reward_type_discussion_placeholder' | translate}}
</option>
<ng-container
*
ngFor=
"let character of scenario.characters"
>
<optgroup
[
label
]="
character
.
name
"
*
ngIf=
"role.characterHasDiscussion(character)"
>
<ng-container
*
ngFor=
"let discussion of role.discussions"
>
<option
[
ngValue
]="
discussion
.
ID
"
*
ngIf=
"discussion.character == character"
>
{{discussion.name}}
</option>
</ng-container>
</optgroup>
</ng-container>
</select>
<button
mat-button
(
click
)="
removeReward
(
i
)"
><mat-icon
fontIcon=
"remove"
></mat-icon></button>
</div>
<!--
<div class="piece-form-rewards-reward-discussion" *ngIf="reward.type == 'discuss'">
<select>
...
...
src/app/pieces/role/role.component.ts
View file @
c33e8cc1
...
...
@@ -29,6 +29,7 @@ import { CopyRoleSuccessComponent } from 'src/app/components/snackbars/copy-role
import
{
RoleOccurrence
}
from
'src/app/class/role-occurrence/role-occurrence'
;
import
{
ObjectReward
}
from
'src/app/class/rewards/object-reward/object-reward'
;
import
{
Reward
}
from
'src/app/class/rewards/reward'
;
import
{
DiscussionReward
}
from
'src/app/class/rewards/discussion-reward/discussion-reward'
;
@
Component
({
selector
:
'app-role'
,
...
...
@@ -613,6 +614,9 @@ export class RoleComponent implements OnInit {
case
'object'
:
this
.
role
.
rewards
[
index
]
=
new
ObjectReward
();
this
.
scenario
.
traces
.
push
(
new
Trace
(
this
.
scenario
.
traces
.
length
,
'transform'
,
this
.
missionIndex
,
this
.
i
,
'Reward_['
+
index
+
']_transform_into_[ObjectReward]'
,
'Role_['
+
this
.
i
+
']'
,
'#9AD5EC'
,
'*'
));
break
;
case
'discussion'
:
this
.
role
.
rewards
[
index
]
=
new
DiscussionReward
();
this
.
scenario
.
traces
.
push
(
new
Trace
(
this
.
scenario
.
traces
.
length
,
'transform'
,
this
.
missionIndex
,
this
.
i
,
'Reward_['
+
index
+
']_transform_into_[DiscussionReward]'
,
'Role_['
+
this
.
i
+
']'
,
'#9AD5EC'
,
'*'
));
break
;
}
}
...
...
@@ -657,6 +661,10 @@ export class RoleComponent implements OnInit {
return
this
.
role
.
rewards
[
index
]
as
ObjectsReward
;
}
getDiscussionReward
(
index
:
number
):
DiscussionReward
{
return
this
.
role
.
rewards
[
index
]
as
DiscussionReward
;
}
addObject
(
index
:
number
):
void
{
this
.
getObjectsReward
(
index
).
objects
.
push
(
new
Ressource
);
this
.
scenario
.
traces
.
push
(
new
Trace
(
this
.
scenario
.
traces
.
length
,
'new'
,
this
.
missionIndex
,
this
.
i
,
'Reward_['
+
index
+
']_object_['
+
this
.
getObjectsReward
(
index
).
objects
.
length
+
']'
,
'Role_['
+
this
.
i
+
']'
,
'#9AD5EC'
,
'*'
));
...
...
src/app/sider-pieces/discussions/discussions.component.ts
View file @
c33e8cc1
...
...
@@ -3,7 +3,10 @@ import { MatDialog } from '@angular/material/dialog';
import
{
TranslateService
}
from
'@ngx-translate/core'
;
import
{
Character
}
from
'src/app/class/character/character'
;
import
{
Discussion
}
from
'src/app/class/discussion/discussion'
;
import
{
Mission
}
from
'src/app/class/mission/mission'
;
import
{
Response
}
from
'src/app/class/response/response'
;
import
{
DiscussionReward
}
from
'src/app/class/rewards/discussion-reward/discussion-reward'
;
import
{
Reward
}
from
'src/app/class/rewards/reward'
;
import
{
Role
}
from
'src/app/class/role/role'
;
import
{
Scenario
}
from
'src/app/class/scenario/scenario'
;
import
{
DeclarativeSentence
}
from
'src/app/class/sentence/declarativeSentence/declarative-sentence'
;
...
...
@@ -73,6 +76,50 @@ export class DiscussionsComponent implements OnInit {
}
}
this
.
role
.
discussions
.
splice
(
discussionIndex
,
1
);
for
(
let
rewardIndex
:
number
=
0
;
rewardIndex
<
this
.
role
.
rewards
.
length
;
rewardIndex
++
)
{
let
reward
:
Reward
=
this
.
role
.
rewards
[
rewardIndex
];
if
(
reward
.
type
==
'discussion'
)
{
if
((
reward
as
DiscussionReward
).
discussionId
==
discussion
.
ID
)
{
this
.
role
.
rewards
.
splice
(
rewardIndex
,
1
);
rewardIndex
--
;
}
}
}
this
.
role
.
discussions
.
forEach
(
discuss
=>
{
for
(
let
rewardIndex
:
number
=
0
;
rewardIndex
<
discuss
.
rewards
.
length
;
rewardIndex
++
)
{
let
reward
:
Reward
=
discuss
.
rewards
[
rewardIndex
];
if
(
reward
.
type
==
'discussion'
)
{
if
((
reward
as
DiscussionReward
).
discussionId
==
discussion
.
ID
)
{
discuss
.
rewards
.
splice
(
rewardIndex
,
1
);
rewardIndex
--
;
}
}
}
});
this
.
role
.
sentences
.
forEach
(
sentence
=>
{
for
(
let
rewardIndex
:
number
=
0
;
rewardIndex
<
sentence
.
rewards
.
length
;
rewardIndex
++
)
{
let
reward
:
Reward
=
sentence
.
rewards
[
rewardIndex
];
if
(
reward
.
type
==
'discussion'
)
{
if
((
reward
as
DiscussionReward
).
discussionId
==
discussion
.
ID
)
{
sentence
.
rewards
.
splice
(
rewardIndex
,
1
);
rewardIndex
--
;
}
}
}
});
this
.
role
.
discussions
.
forEach
(
response
=>
{
for
(
let
rewardIndex
:
number
=
0
;
rewardIndex
<
response
.
rewards
.
length
;
rewardIndex
++
)
{
let
reward
:
Reward
=
response
.
rewards
[
rewardIndex
];
if
(
reward
.
type
==
'discussion'
)
{
if
((
reward
as
DiscussionReward
).
discussionId
==
discussion
.
ID
)
{
response
.
rewards
.
splice
(
rewardIndex
,
1
);
rewardIndex
--
;
}
}
}
});
}
});
}
...
...
src/assets/lang/en.json
View file @
c33e8cc1
...
...
@@ -150,6 +150,9 @@
"role_reward_type_object_delete"
:
"this Object of the Reward"
,
"role_reward_type_object_tooltip"
:
"Choose a created object"
,
"role_reward_type_other"
:
"Other"
,
"role_reward_type_discussion_placeholder"
:
"Name of the discussion"
,
"role_reward_type_discussion"
:
"Unlock a discussion"
,
"role_reward_type_discussion_tooltip"
:
"Choose the name of the discussion"
,
"role_reward_delete"
:
"this Reward"
,
"role_personnalization_title"
:
"Customization"
,
"role_personnalization_label"
:
"Appearance, equipment"
,
...
...
src/assets/lang/fr.json
View file @
c33e8cc1
...
...
@@ -150,6 +150,9 @@
"role_reward_type_object_tooltip"
:
"Choisir un objet créé"
,
"role_reward_type_object_delete"
:
"cet Objet de la Récompense"
,
"role_reward_type_other"
:
"Autre"
,
"role_reward_type_discussion_placeholder"
:
"Nom de la discussion"
,
"role_reward_type_discussion"
:
"Débloquer une discussion"
,
"role_reward_type_discussion_tooltip"
:
"Choisir le nom de la discussion"
,
"role_reward_delete"
:
"cette Récompense"
,
"role_personnalization_title"
:
"Personnalisation"
,
"role_personnalization_label"
:
"Apparence, équipement"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment