Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Tabu
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dennis Willers
Tabu
Commits
b89fc821
Commit
b89fc821
authored
Feb 08, 2021
by
Dennis Willers
🏀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tabooh Button gets disabled, if someone pressed it for 1500ms.
parent
9e5c3b77
Pipeline
#367
passed with stages
in 5 minutes and 35 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
1 deletion
+21
-1
socketDataService.ts
src/app/dao/socketDataService.ts
+12
-0
game.component.html
src/app/game/game.component.html
+1
-1
game.component.ts
src/app/game/game.component.ts
+8
-0
No files found.
src/app/dao/socketDataService.ts
View file @
b89fc821
...
@@ -74,4 +74,16 @@ export class SocketDataService {
...
@@ -74,4 +74,16 @@ export class SocketDataService {
});
});
});
});
}
}
getCanPressTabooh
(
sessionName
:
string
):
Observable
<
any
>
{
if
(
!
this
.
isConnected
)
{
this
.
connect
(
sessionName
);
}
this
.
sessionName
=
sessionName
;
return
new
Observable
(
observer
=>
{
this
.
socket
.
on
(
this
.
sessionName
+
'
:canPressTabooh
'
,
(
res
:
any
)
=>
{
observer
.
next
(
res
);
});
});
}
}
}
src/app/game/game.component.html
View file @
b89fc821
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
<br>
<br>
<button
*ngIf=
"isExplainer"
mat-raised-button
color=
"primary"
(click)=
"rightAnswer()"
>
Richtig
✔
</button>
<button
*ngIf=
"isExplainer"
mat-raised-button
color=
"primary"
(click)=
"rightAnswer()"
>
Richtig
✔
</button>
<button
*ngIf=
"isExplainer"
mat-raised-button
color=
"accent"
style=
"margin: 40px"
(click)=
"newCard()"
>
Überspringen
»
</button>
<button
*ngIf=
"isExplainer"
mat-raised-button
color=
"accent"
style=
"margin: 40px"
(click)=
"newCard()"
>
Überspringen
»
</button>
<button
mat-raised-button
color=
"warn"
(click)=
"wrongAnswer()"
>
Tabooh
✘
</button>
<button
mat-raised-button
color=
"warn"
[disabled]=
"PressTaboohDisabled"
(click)=
"wrongAnswer()"
>
Tabooh
✘
</button>
<br>
<br>
<br>
<br>
<mat-card
class=
"transparent"
>
<mat-card
class=
"transparent"
>
...
...
src/app/game/game.component.ts
View file @
b89fc821
...
@@ -19,6 +19,8 @@ export class GameComponent implements OnInit, OnDestroy {
...
@@ -19,6 +19,8 @@ export class GameComponent implements OnInit, OnDestroy {
private
ngUnsubscribe
=
new
Subject
();
private
ngUnsubscribe
=
new
Subject
();
subNewCard
:
any
;
subNewCard
:
any
;
subEndRound
:
any
;
subEndRound
:
any
;
subCanPressTabooh
:
any
;
PressTaboohDisabled
=
false
;
sessionName
=
''
;
sessionName
=
''
;
isWatchdog
=
false
;
isWatchdog
=
false
;
isExplainer
=
false
;
isExplainer
=
false
;
...
@@ -109,6 +111,12 @@ export class GameComponent implements OnInit, OnDestroy {
...
@@ -109,6 +111,12 @@ export class GameComponent implements OnInit, OnDestroy {
this
.
router
.
navigate
([
this
.
sessionName
+
'
/
'
+
this
.
team
]);
this
.
router
.
navigate
([
this
.
sessionName
+
'
/
'
+
this
.
team
]);
}
}
});
});
this
.
subCanPressTabooh
=
this
.
socketDataService
.
getCanPressTabooh
(
this
.
sessionName
)
.
pipe
(
takeUntil
(
this
.
ngUnsubscribe
))
.
subscribe
(
data
=>
{
console
.
log
(
'
Status Tabooh can pressed:
'
,
data
);
this
.
PressTaboohDisabled
=
!
JSON
.
parse
(
data
);
});
}
}
onTimesUp
():
void
{
onTimesUp
():
void
{
...
...
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