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
760bff28
Commit
760bff28
authored
Jan 31, 2024
by
Romain DELEAU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Traces on task reward (+ fix on newsupplementaryRole trace)
parent
a11ce600
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
6 deletions
+33
-6
role.component.ts
src/app/pieces/role/role.component.ts
+1
-1
rewards.component.html
src/app/sider-pieces/rewards/rewards.component.html
+4
-4
rewards.component.ts
src/app/sider-pieces/rewards/rewards.component.ts
+28
-1
No files found.
src/app/pieces/role/role.component.ts
View file @
760bff28
...
...
@@ -200,7 +200,7 @@ export class RoleComponent implements OnInit {
addSupplementaryRole
():
void
{
this
.
role
.
supplementaryRoles
.
push
(
new
SupplementaryRole
());
this
.
scenario
.
traces
.
push
(
new
Trace
(
this
.
scenario
.
traces
.
length
,
'new'
,
this
.
missionIndex
,
this
.
i
,
'Secondary_role_['
+
this
.
role
.
supplementaryRoles
.
length
+
']'
,
'Role_['
+
this
.
i
+
']'
,
'#9AD5EC'
,
'*'
));
this
.
scenario
.
traces
.
push
(
new
Trace
(
this
.
scenario
.
traces
.
length
,
'new'
,
this
.
missionIndex
,
this
.
i
,
'Secondary_role_['
+
(
this
.
role
.
supplementaryRoles
.
length
-
1
)
+
']'
,
'Role_['
+
this
.
i
+
']'
,
'#9AD5EC'
,
'*'
));
this
.
minimapService
.
reset
();
}
...
...
src/app/sider-pieces/rewards/rewards.component.html
View file @
760bff28
...
...
@@ -6,7 +6,7 @@ matTooltipPosition="before" [matTooltipDisabled]="!tooltipService.activatedToolt
<div
class=
"piece-form-content"
>
<div
class=
"piece-form-content-type"
>
<label
for=
"type"
>
{{'rewards_type_label'| translate}}
</label>
<select
name=
"type"
[(
ngModel
)]="
task
.
rewardType
"
(
change
)="
resetReward
()"
>
<select
name=
"type"
[(
ngModel
)]="
task
.
rewardType
"
(
change
)="
resetReward
(
$
event
)"
>
<option
value=
"none"
selected
>
{{'rewards_type_none' | translate}}
</option>
<option
value=
"object"
>
{{'rewards_type_object' | translate}}
</option>
<option
value=
"character"
>
{{'rewards_type_character' | translate}}
</option>
...
...
@@ -22,7 +22,7 @@ matTooltipPosition="before" [matTooltipDisabled]="!tooltipService.activatedToolt
-->
<div
class=
"piece-form-content-object"
*
ngIf=
"task.rewardType == 'object'"
>
<input
type=
"number"
name=
"quantity"
[(
ngModel
)]="
task
.
rewardQuantity
"
/>
<select
name=
"object_name"
[(
ngModel
)]="
task
.
reward
"
>
<select
name=
"object_name"
[(
ngModel
)]="
task
.
reward
"
(
change
)="
editTrace
($
event
,'
task_reward
')"
>
<option
value=
"null"
selected
disabled
>
{{'rewards_object_placeholder' | translate}}
</option>
<ng-container
*
ngFor=
"let ressource of scenario.ressources"
>
<option
*
ngIf=
"ressource.type == 'ressource'"
[
ngValue
]="
ressource
"
>
{{ressource.name}}
</option>
...
...
@@ -33,14 +33,14 @@ matTooltipPosition="before" [matTooltipDisabled]="!tooltipService.activatedToolt
</select>
</div>
<div
class=
"piece-form-content-character"
*
ngIf=
"task.rewardType == 'character'"
>
<select
name=
"character"
[(
ngModel
)]="
task
.
reward
"
>
<select
name=
"character"
[(
ngModel
)]="
task
.
reward
"
(
change
)="
editTrace
($
event
,'
task_reward
')"
>
<option
value=
"null"
selected
disabled
>
{{'rewards_character_placeholder' | translate}}
</option>
<option
*
ngFor=
"let character of scenario.characters"
[
ngValue
]="
character
"
>
{{character.name}}
</option>
</select>
</div>
<div
class=
"piece-form-content-skill"
*
ngIf=
"task.rewardType == 'skill'"
>
<input
type=
"number"
name=
"quantity"
[(
ngModel
)]="
task
.
rewardQuantity
"
/>
<select
name=
"skill"
[(
ngModel
)]="
task
.
reward
"
>
<select
name=
"skill"
[(
ngModel
)]="
task
.
reward
"
(
change
)="
editTrace
($
event
,'
task_reward
')"
>
<option
value=
"null"
selected
disabled
>
{{'rewards_skill_placeholder' | translate}}
</option>
<ng-container
*
ngFor=
"let ressource of pieceDetailsService.parentAsRole().ressources"
>
<option
*
ngIf=
"ressource.type == 'attribut'"
[
ngValue
]="
ressource
"
>
{{ressource.name}}
</option>
...
...
src/app/sider-pieces/rewards/rewards.component.ts
View file @
760bff28
...
...
@@ -3,6 +3,7 @@ import { TranslateService } from '@ngx-translate/core';
import
{
Role
}
from
'src/app/class/role/role'
;
import
{
Scenario
}
from
'src/app/class/scenario/scenario'
;
import
{
Task
}
from
'src/app/class/task/task'
;
import
{
Trace
}
from
'src/app/class/trace/trace'
;
import
{
PieceDetailsService
}
from
'src/app/services/piece-details/piece-details.service'
;
import
{
TooltipService
}
from
'src/app/services/tooltip/tooltip.service'
;
...
...
@@ -22,7 +23,33 @@ export class RewardsComponent implements OnInit {
ngOnInit
():
void
{
}
resetReward
()
{
resetReward
(
event
:
any
)
{
this
.
task
.
resetReward
();
this
.
editTrace
(
event
,
'task_reward'
);
}
formatTraceTarget
():
string
{
let
res
:
string
=
''
;
if
(
this
.
pieceDetailsService
.
piece
instanceof
Task
)
{
switch
(
this
.
pieceDetailsService
.
piece
.
type
)
{
case
'normal'
:
res
=
'Task_['
+
this
.
pieceDetailsService
.
pieceIndex
+
']'
;
break
;
case
'annexe'
:
res
=
'Side_task_['
+
this
.
pieceDetailsService
.
pieceIndex
+
']'
;
break
;
case
'final'
:
res
=
'Final_task_['
+
this
.
pieceDetailsService
.
pieceIndex
+
']'
;
break
;
case
'optionnal'
:
res
=
'Opt_task_['
+
this
.
pieceDetailsService
.
pieceIndex
+
']'
;
break
;
case
'event'
:
res
=
'Event_task_['
+
this
.
pieceDetailsService
.
pieceIndex
+
']'
;
break
;
case
'repeat'
:
res
=
'Repeat_task_['
+
this
.
pieceDetailsService
.
pieceIndex
+
']'
;
break
;
}
}
return
res
;
}
editTrace
(
event
:
any
,
source
:
string
):
void
{
if
(
this
.
task
.
reward
!=
undefined
)
{
this
.
scenario
.
traces
.
push
(
new
Trace
(
this
.
scenario
.
traces
.
length
,
'Select_task_reward_'
+
this
.
task
.
rewardType
,
this
.
pieceDetailsService
.
missionIndex
,
this
.
pieceDetailsService
.
roleIndex
,
source
,
this
.
formatTraceTarget
(),
'#CFE3B9'
));
}
else
{
this
.
scenario
.
traces
.
push
(
new
Trace
(
this
.
scenario
.
traces
.
length
,
'Deselect_task_reward'
,
this
.
pieceDetailsService
.
missionIndex
,
this
.
pieceDetailsService
.
roleIndex
,
source
,
this
.
formatTraceTarget
(),
'#CFE3B9'
));
}
}
}
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