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
2757521d
Commit
2757521d
authored
Sep 29, 2023
by
Romain DELEAU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Traces on Characters/Rules pieces
parent
fb73c7b0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
13 deletions
+42
-13
game-characters.component.html
...app/pieces/game-characters/game-characters.component.html
+6
-6
game-characters.component.ts
src/app/pieces/game-characters/game-characters.component.ts
+17
-3
rules.component.html
src/app/pieces/rules/rules.component.html
+3
-3
rules.component.ts
src/app/pieces/rules/rules.component.ts
+16
-1
No files found.
src/app/pieces/game-characters/game-characters.component.html
View file @
2757521d
...
@@ -16,18 +16,18 @@
...
@@ -16,18 +16,18 @@
<mat-icon
fontIcon=
"person_add"
></mat-icon>
<mat-icon
fontIcon=
"person_add"
></mat-icon>
<div
class=
"piece-form-character-create-top-name"
>
<div
class=
"piece-form-character-create-top-name"
>
<label
for=
"name"
>
Nom
</label>
<label
for=
"name"
>
Nom
</label>
<input
name=
"name"
type=
"text"
[(
ngModel
)]="
newCharacter
.
name
"
/>
<input
name=
"name"
type=
"text"
[(
ngModel
)]="
newCharacter
.
name
"
(
change
)="
editTrace
($
event
,'
newCharacter_name
')"
/>
</div>
</div>
</div>
</div>
<div
class=
"piece-form-create-infos"
>
<div
class=
"piece-form-create-infos"
>
<div
class=
"piece-form-character-create-infos-description"
>
<div
class=
"piece-form-character-create-infos-description"
>
<label
for=
"description"
>
Description
</label>
<label
for=
"description"
>
Description
</label>
<textarea
class=
"background"
name=
"description"
[(
ngModel
)]="
newCharacter
.
description
"
></textarea>
<textarea
class=
"background"
name=
"description"
[(
ngModel
)]="
newCharacter
.
description
"
(
change
)="
editTrace
($
event
,'
newCharacter_description
')"
></textarea>
</div>
</div>
<div
class=
"piece-form-character-create-infos-color"
>
<div
class=
"piece-form-character-create-infos-color"
>
<label
for=
"color"
>
Couleur
</label>
<label
for=
"color"
>
Couleur
</label>
<input
name=
"color"
type=
"color"
[(
ngModel
)]="
newCharacter
.
color
"
/>
<input
name=
"color"
type=
"color"
[(
ngModel
)]="
newCharacter
.
color
"
(
change
)="
editTrace
($
event
,'
newCharacter_color
')"
/>
</div>
</div>
</div>
</div>
<button
mat-button
(
click
)="
createCharacter
()"
>
Créer
</button>
<button
mat-button
(
click
)="
createCharacter
()"
>
Créer
</button>
...
@@ -39,18 +39,18 @@
...
@@ -39,18 +39,18 @@
<mat-icon
fontIcon=
"person"
></mat-icon>
<mat-icon
fontIcon=
"person"
></mat-icon>
<div
class=
"piece-form-character-create-top-name"
>
<div
class=
"piece-form-character-create-top-name"
>
<label
for=
"name"
>
Nom
</label>
<label
for=
"name"
>
Nom
</label>
<input
name=
"name"
type=
"text"
[(
ngModel
)]="
character
.
name
"
/>
<input
name=
"name"
type=
"text"
[(
ngModel
)]="
character
.
name
"
(
change
)="
editTrace
($
event
,'
Character_
['+
index
+']
_name
')"
/>
</div>
</div>
</div>
</div>
<div
class=
"piece-form-create-infos"
>
<div
class=
"piece-form-create-infos"
>
<div
class=
"piece-form-character-create-infos-description"
>
<div
class=
"piece-form-character-create-infos-description"
>
<label
for=
"description"
>
Description
</label>
<label
for=
"description"
>
Description
</label>
<textarea
name=
"description"
[(
ngModel
)]="
character
.
description
"
></textarea>
<textarea
name=
"description"
[(
ngModel
)]="
character
.
description
"
(
change
)="
editTrace
($
event
,'
Character_
['+
index
+']
_description
')"
></textarea>
</div>
</div>
<div
class=
"piece-form-character-create-infos-color"
>
<div
class=
"piece-form-character-create-infos-color"
>
<label
for=
"color"
>
Couleur
</label>
<label
for=
"color"
>
Couleur
</label>
<input
name=
"color"
type=
"color"
[(
ngModel
)]="
character
.
color
"
/>
<input
name=
"color"
type=
"color"
[(
ngModel
)]="
character
.
color
"
(
change
)="
editTrace
($
event
,'
Character_
['+
index
+']
_color
')"
/>
</div>
</div>
</div>
</div>
<button
mat-button
(
click
)="
deleteCharacter
(
index
)"
>
Supprimer
</button>
<button
mat-button
(
click
)="
deleteCharacter
(
index
)"
>
Supprimer
</button>
...
...
src/app/pieces/game-characters/game-characters.component.ts
View file @
2757521d
...
@@ -7,6 +7,7 @@ import { SuppressDialogComponent } from 'src/app/components/dialogs/suppress-dia
...
@@ -7,6 +7,7 @@ import { SuppressDialogComponent } from 'src/app/components/dialogs/suppress-dia
import
{
Character
}
from
'src/app/class/character/character'
;
import
{
Character
}
from
'src/app/class/character/character'
;
import
{
CleanDialogComponent
}
from
'src/app/components/dialogs/clean-dialog/clean-dialog.component'
;
import
{
CleanDialogComponent
}
from
'src/app/components/dialogs/clean-dialog/clean-dialog.component'
;
import
{
Task
}
from
'src/app/class/task/task'
;
import
{
Task
}
from
'src/app/class/task/task'
;
import
{
Trace
}
from
'src/app/class/trace/trace'
;
@
Component
({
@
Component
({
selector
:
'app-game-characters'
,
selector
:
'app-game-characters'
,
...
@@ -44,7 +45,10 @@ export class GameCharactersComponent implements OnInit {
...
@@ -44,7 +45,10 @@ export class GameCharactersComponent implements OnInit {
});
});
});
});
});
});
});
});
this
.
scenario
.
traces
.
push
(
new
Trace
(
this
.
scenario
.
traces
.
length
,
'erase'
,
undefined
,
undefined
,
'all'
,
'Characters'
,
'#CE7B66'
));
}
else
{
this
.
scenario
.
traces
.
push
(
new
Trace
(
this
.
scenario
.
traces
.
length
,
'cancel_erase'
,
undefined
,
undefined
,
'all'
,
'Characters'
,
'#CE7B66'
));
}
}
});
});
}
}
...
@@ -52,7 +56,8 @@ export class GameCharactersComponent implements OnInit {
...
@@ -52,7 +56,8 @@ export class GameCharactersComponent implements OnInit {
createCharacter
():
void
{
createCharacter
():
void
{
if
(
this
.
newCharacter
.
name
!=
''
)
{
if
(
this
.
newCharacter
.
name
!=
''
)
{
this
.
scenario
.
characters
.
push
(
this
.
newCharacter
);
this
.
scenario
.
characters
.
push
(
this
.
newCharacter
);
this
.
newCharacter
=
new
Character
();
this
.
newCharacter
=
new
Character
();
this
.
scenario
.
traces
.
push
(
new
Trace
(
this
.
scenario
.
traces
.
length
,
'new'
,
undefined
,
undefined
,
'all'
,
'Characters_['
+
(
this
.
scenario
.
characters
.
length
-
1
)
+
']'
,
'#CE7B66'
));
}
}
}
}
...
@@ -73,9 +78,18 @@ export class GameCharactersComponent implements OnInit {
...
@@ -73,9 +78,18 @@ export class GameCharactersComponent implements OnInit {
});
});
});
});
this
.
scenario
.
characters
.
splice
(
index
,
1
);
this
.
scenario
.
characters
.
splice
(
index
,
1
);
this
.
scenario
.
traces
.
push
(
new
Trace
(
this
.
scenario
.
traces
.
length
,
'delete'
,
undefined
,
undefined
,
'all'
,
'Characters_['
+
index
+
']'
,
'#CE7B66'
));
}
else
{
this
.
scenario
.
traces
.
push
(
new
Trace
(
this
.
scenario
.
traces
.
length
,
'cancel_delete'
,
undefined
,
undefined
,
'all'
,
'Characters_['
+
index
+
']'
,
'#CE7B66'
));
}
}
});
});
}
}
editTrace
(
event
:
any
,
source
:
string
):
void
{
if
(
event
.
target
.
value
!=
''
)
{
this
.
scenario
.
traces
.
push
(
new
Trace
(
this
.
scenario
.
traces
.
length
,
'write'
,
undefined
,
undefined
,
source
,
'Characters'
,
'#EAC19B'
));
}
else
{
this
.
scenario
.
traces
.
push
(
new
Trace
(
this
.
scenario
.
traces
.
length
,
'erase'
,
undefined
,
undefined
,
source
,
'Characters'
,
'#EAC19B'
));
}
}
}
}
src/app/pieces/rules/rules.component.html
View file @
2757521d
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
<div
class=
"piece-form"
>
<div
class=
"piece-form"
>
<div
class=
"piece-form-rules"
>
<div
class=
"piece-form-rules"
>
<div
class=
"piece-form-title"
>
Règles du jeu
</div>
<div
class=
"piece-form-title"
>
Règles du jeu
</div>
<textarea
[(
ngModel
)]="
scenario
.
gameRules
"
<textarea
[(
ngModel
)]="
scenario
.
gameRules
"
(
change
)="
editTrace
($
event
,'
rules
')"
matTooltip=
"Éléments importants à prendre en compte dans les règles du jeu"
matTooltip=
"Éléments importants à prendre en compte dans les règles du jeu"
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></textarea>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
></textarea>
</div>
</div>
...
@@ -22,11 +22,11 @@
...
@@ -22,11 +22,11 @@
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
>
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
>
<div
class=
"piece-form-ressources-object-infos-name"
>
<div
class=
"piece-form-ressources-object-infos-name"
>
<label
for=
"name"
>
Nom
</label>
<label
for=
"name"
>
Nom
</label>
<input
name=
"name"
type=
"text"
[(
ngModel
)]="
ressource
.
name
"
/>
<input
name=
"name"
type=
"text"
[(
ngModel
)]="
ressource
.
name
"
(
change
)="
editTrace
($
event
,'
Ressource_
['+
i
+']
_name
')"
/>
</div>
</div>
<div
class=
"piece-form-ressources-object-infos-quantity"
>
<div
class=
"piece-form-ressources-object-infos-quantity"
>
<label
for=
"quantity"
>
Quantité
</label>
<label
for=
"quantity"
>
Quantité
</label>
<input
name=
"quantity"
type=
"number"
min=
"1"
[(
ngModel
)]="
ressource
.
number
"
/>
<input
name=
"quantity"
type=
"number"
min=
"1"
[(
ngModel
)]="
ressource
.
number
"
(
change
)="
editTrace
($
event
,'
Ressource_
['+
i
+']
_quantity
')"
/>
</div>
</div>
<button
mat-button
(
click
)="
removeRessource
(
i
)"
><mat-icon
fontIcon=
"remove"
></mat-icon></button>
<button
mat-button
(
click
)="
removeRessource
(
i
)"
><mat-icon
fontIcon=
"remove"
></mat-icon></button>
</div>
</div>
...
...
src/app/pieces/rules/rules.component.ts
View file @
2757521d
...
@@ -7,6 +7,7 @@ import { SuppressDialogComponent } from 'src/app/components/dialogs/suppress-dia
...
@@ -7,6 +7,7 @@ import { SuppressDialogComponent } from 'src/app/components/dialogs/suppress-dia
import
{
CleanDialogComponent
}
from
'src/app/components/dialogs/clean-dialog/clean-dialog.component'
;
import
{
CleanDialogComponent
}
from
'src/app/components/dialogs/clean-dialog/clean-dialog.component'
;
import
{
PieceDetailsService
}
from
'src/app/services/piece-details/piece-details.service'
;
import
{
PieceDetailsService
}
from
'src/app/services/piece-details/piece-details.service'
;
import
{
Task
}
from
'src/app/class/task/task'
;
import
{
Task
}
from
'src/app/class/task/task'
;
import
{
Trace
}
from
'src/app/class/trace/trace'
;
@
Component
({
@
Component
({
selector
:
'app-rules'
,
selector
:
'app-rules'
,
...
@@ -32,7 +33,6 @@ export class RulesComponent implements OnInit {
...
@@ -32,7 +33,6 @@ export class RulesComponent implements OnInit {
dialogRef
.
afterClosed
().
subscribe
(
result
=>
{
dialogRef
.
afterClosed
().
subscribe
(
result
=>
{
if
(
result
==
true
)
{
if
(
result
==
true
)
{
this
.
scenario
.
gameRules
=
''
;
this
.
scenario
.
gameRules
=
''
;
//this.scenario.ressources = [];
this
.
scenario
.
ressources
.
forEach
((
ressource
,
i
)
=>
{
this
.
scenario
.
ressources
.
forEach
((
ressource
,
i
)
=>
{
this
.
scenario
.
missions
.
forEach
(
mission
=>
{
this
.
scenario
.
missions
.
forEach
(
mission
=>
{
mission
.
roles
.
forEach
(
role
=>
{
mission
.
roles
.
forEach
(
role
=>
{
...
@@ -51,12 +51,16 @@ export class RulesComponent implements OnInit {
...
@@ -51,12 +51,16 @@ export class RulesComponent implements OnInit {
});
});
});
});
this
.
scenario
.
ressources
=
[];
this
.
scenario
.
ressources
=
[];
this
.
scenario
.
traces
.
push
(
new
Trace
(
this
.
scenario
.
traces
.
length
,
'erase'
,
undefined
,
undefined
,
'all'
,
'Rules'
,
'#C6C2BD'
));
}
else
{
this
.
scenario
.
traces
.
push
(
new
Trace
(
this
.
scenario
.
traces
.
length
,
'cancel_erase'
,
undefined
,
undefined
,
'all'
,
'Rules'
,
'#C6C2BD'
));
}
}
});
});
}
}
addRessource
():
void
{
addRessource
():
void
{
this
.
scenario
.
ressources
.
push
(
new
Ressource
());
this
.
scenario
.
ressources
.
push
(
new
Ressource
());
this
.
scenario
.
traces
.
push
(
new
Trace
(
this
.
scenario
.
traces
.
length
,
'new'
,
undefined
,
undefined
,
'Ressource_['
+
(
this
.
scenario
.
traces
.
length
-
1
)
+
']'
,
'Rules'
,
'#C6C2BD'
));
}
}
removeRessource
(
index
:
number
):
void
{
removeRessource
(
index
:
number
):
void
{
...
@@ -77,7 +81,18 @@ export class RulesComponent implements OnInit {
...
@@ -77,7 +81,18 @@ export class RulesComponent implements OnInit {
});
});
});
});
this
.
scenario
.
ressources
.
splice
(
index
,
1
);
this
.
scenario
.
ressources
.
splice
(
index
,
1
);
this
.
scenario
.
traces
.
push
(
new
Trace
(
this
.
scenario
.
traces
.
length
,
'delete'
,
undefined
,
undefined
,
'Ressource_['
+
index
+
']'
,
'Rules'
,
'#C6C2BD'
));
}
else
{
this
.
scenario
.
traces
.
push
(
new
Trace
(
this
.
scenario
.
traces
.
length
,
'cancel_delete'
,
undefined
,
undefined
,
'Ressource_['
+
index
+
']'
,
'Rules'
,
'#C6C2BD'
));
}
}
});
});
}
}
editTrace
(
event
:
any
,
source
:
string
):
void
{
if
(
event
.
target
.
value
!=
''
)
{
this
.
scenario
.
traces
.
push
(
new
Trace
(
this
.
scenario
.
traces
.
length
,
'write'
,
undefined
,
undefined
,
source
,
'Rules'
,
'#C6C2BD'
));
}
else
{
this
.
scenario
.
traces
.
push
(
new
Trace
(
this
.
scenario
.
traces
.
length
,
'erase'
,
undefined
,
undefined
,
source
,
'Rules'
,
'#C6C2BD'
));
}
}
}
}
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