Skip to content

Commit

Permalink
Use scss for hiding the side UI rating in game
Browse files Browse the repository at this point in the history
  • Loading branch information
yahya-lafhal committed Dec 15, 2024
1 parent 178eee1 commit e41563b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion modules/round/src/main/JsonView.scala
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ final class JsonView(
.add("confirmResign" -> (!flags.nvui && pref.confirmResign == Pref.ConfirmResign.YES))
.add("keyboardMove" -> (!flags.nvui && pref.hasKeyboardMove))
.add("voiceMove" -> (!flags.nvui && pref.hasVoice))
.add("hideRatingsInGame" -> pref.hideRatingsInGame)
.add("rookCastle" -> (pref.rookCastle == Pref.RookCastle.YES))
.add("highlight" -> pref.highlight)
.add("destination" -> pref.destination)
Expand Down
3 changes: 3 additions & 0 deletions ui/round/css/_user.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
margin: 0 0.25em 0 0.3em;
color: $c-font-dim;
letter-spacing: -0.5px;
body.no-rating & {
display: none;
}
}

.line {
Expand Down
1 change: 0 additions & 1 deletion ui/round/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ export interface Pref {
highlight: boolean;
is3d: boolean;
keyboardMove: boolean;
hideRatingsInGame: boolean;
voiceMove: boolean;
moveEvent: Prefs.MoveEvent;
ratings: boolean;
Expand Down
3 changes: 1 addition & 2 deletions ui/round/src/view/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export function userHtml(ctrl: RoundController, player: Player, position: Positi
user = player.user,
perf = (user?.perfs || {})[d.game.perf],
rating = player.rating || perf?.rating,
showRating = d.pref.hideRatingsInGame ? !ctrl.isPlaying() : !!rating,
signal = user?.id === d.opponent.user?.id ? d.opponentSignal : undefined;

if (user) {
Expand Down Expand Up @@ -43,7 +42,7 @@ export function userHtml(ctrl: RoundController, player: Player, position: Positi
line: false,
}),
!!signal && signalBars(signal),
showRating && h('rating', rating + (player.provisional ? '?' : '')),
!!rating && h('rating', rating + (player.provisional ? '?' : '')),
!!rating && ratingDiff(player),
player.engine &&
h('span', {
Expand Down

0 comments on commit e41563b

Please sign in to comment.