Gray out the Card Czar's hand and display a message over it.
This commit is contained in:
parent
9a9202e1ce
commit
463432e369
|
@ -283,6 +283,22 @@ span.debug {
|
|||
*/
|
||||
}
|
||||
|
||||
.game_hand_filter {
|
||||
height: 100%;
|
||||
position: relative;
|
||||
background: rgba(192, 192, 192, .5);
|
||||
z-index: 100;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.game_hand_filter_text {
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
font-size: 300%;
|
||||
margin-top: -30px;
|
||||
}
|
||||
|
||||
.game_hand_cards {
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
|
|
|
@ -201,6 +201,9 @@ HttpSession hSession = request.getSession(true);
|
|||
</div>
|
||||
</div>
|
||||
<div class="game_hand">
|
||||
<div class="game_hand_filter hide">
|
||||
<span class="game_hand_filter_text"></span>
|
||||
</div>
|
||||
<span class="header">Your Hand</span>
|
||||
<div class="game_hand_cards">
|
||||
</div>
|
||||
|
|
|
@ -170,7 +170,7 @@ cah.$.GamePlayerStatus_msg_2['playing'] = "Select a card to play.";
|
|||
cah.$.GamePlayerStatus_msg_2['idle'] = "Waiting for players...";
|
||||
cah.$.GamePlayerStatus_msg_2['judging'] = "Select a winning card.";
|
||||
cah.$.GamePlayerStatus_msg_2['host'] = "Wait for players then click Start Game.";
|
||||
cah.$.GamePlayerStatus_msg_2['judge'] = "You are the Card Czar this round.";
|
||||
cah.$.GamePlayerStatus_msg_2['judge'] = "You are the Card Czar.";
|
||||
cah.$.GamePlayerStatus_msg_2['winner'] = "You have won!";
|
||||
|
||||
cah.$.GameState = function() {
|
||||
|
|
|
@ -558,6 +558,7 @@ cah.Game.prototype.updateUserStatus = function(playerInfo) {
|
|||
|
||||
if (playerName == cah.nickname) {
|
||||
$(".game_message", this.element_).text(cah.$.GamePlayerStatus_msg_2[playerStatus]);
|
||||
|
||||
if (playerStatus == cah.$.GamePlayerStatus.PLAYING && this.handSelectedCard_ != null) {
|
||||
$(".confirm_card", this.element_).removeAttr("disabled");
|
||||
} else if (playerStatus == cah.$.GamePlayerStatus.JUDGING && this.roundSelectedCard_ != null) {
|
||||
|
@ -565,6 +566,7 @@ cah.Game.prototype.updateUserStatus = function(playerInfo) {
|
|||
} else {
|
||||
$(".confirm_card", this.element_).attr("disabled", "disabled");
|
||||
}
|
||||
|
||||
if (playerStatus != cah.$.GamePlayerStatus.PLAYING) {
|
||||
if (this.handSelectedCard_ != null) {
|
||||
// we have a card selected, but we're changing state. this almost certainly is an
|
||||
|
@ -574,9 +576,19 @@ cah.Game.prototype.updateUserStatus = function(playerInfo) {
|
|||
this.handSelectedCard_ = null;
|
||||
$(".selected", $(".game_hand", this.element_)).removeClass("selected");
|
||||
}
|
||||
|
||||
if (playerStatus == cah.$.GamePlayerStatus.HOST) {
|
||||
$("#start_game").show();
|
||||
}
|
||||
|
||||
if (playerStatus == cah.$.GamePlayerStatus.JUDGE) {
|
||||
$(".game_hand_filter", this.element_).removeClass("hide");
|
||||
$(".game_hand_filter_text", this.element_).text(cah.$.GamePlayerStatus_msg_2[playerStatus]);
|
||||
// We need to kick it to properly re-center the text.
|
||||
$(".game_hand_filter").width($(".game_hand_filter").width());
|
||||
} else if (playerStatus == cah.$.GamePlayerStatus.PLAYING) {
|
||||
$(".game_hand_filter", this.element_).addClass("hide");
|
||||
}
|
||||
}
|
||||
|
||||
if (playerStatus == cah.$.GamePlayerStatus.JUDGE
|
||||
|
|
|
@ -488,7 +488,7 @@ public class Constants {
|
|||
public enum GamePlayerStatus implements DoubleLocalizable {
|
||||
HOST("host", "Host", "Wait for players then click Start Game."),
|
||||
IDLE("idle", "", "Waiting for players..."),
|
||||
JUDGE("judge", "Card Czar", "You are the Card Czar this round."),
|
||||
JUDGE("judge", "Card Czar", "You are the Card Czar."),
|
||||
JUDGING("judging", "Selecting", "Select a winning card."),
|
||||
PLAYING("playing", "Playing", "Select a card to play."),
|
||||
WINNER("winner", "Winner!", "You have won!");
|
||||
|
|
Loading…
Reference in New Issue