mirror of
https://github.com/tiennm99/noitu.git
synced 2026-10-15 10:15:24 +00:00
feat(online): seat the chat beside the game and score the series
A room screen wide enough for it is two columns now: the game or the lobby on one side and the room's conversation on the other, so neither has to be scrolled past to reach the other. A phone keeps one column, the game first, with the chat folded behind an unread count while a game is on. One chat panel spans both phases by staying in the same place in the markup — a remounted panel reopened having read nothing, and handed the reader the lobby's conversation back as unread mail. The room also keeps the score of the series. PlayerSlot carries the games a seat has won since the room opened, credited before the lobby is broadcast so the players see it the moment a game ends, and shown in the lobby and beside each player's score on the board. It belongs to the seat rather than to the room, because vacating one is exactly when the name on it stops meaning the same person. The conversation reads as a log — one line per message, "name: text", each seat in its own colour — rather than as a stack of bubbles, which stops being legible once four people are talking. ChatMessage carries the seat that spoke, so a line is coloured by what the server said rather than by matching display names, and a line whose seat has been vacated is in nobody's colour. The board's word button gets a test id of its own: it and the chat's send button both read "Gửi", and the two are now on screen together.
This commit is contained in:
1 parent
4e2e9e1433
commit
e19b083dc0
24 files changed
+521
-104
No files matched your search
@@ -192,6 +192,11 @@ message PlayerSlot {
|
||||
bool ready = 5;
|
||||
// False while this player is inside their reconnect window.
|
||||
bool connected = 6;
|
||||
// How many games this seat has won since the room opened. A room outlives
|
||||
// its games, so the tally belongs to the seat rather than to any one of
|
||||
// them; it starts again when the seat is vacated, because by then the name
|
||||
// on it no longer means the same person.
|
||||
uint32 wins = 7;
|
||||
}
|
||||
|
||||
// PlayerScore is one player in a running or finished game.
|
||||
@@ -353,6 +358,10 @@ message ChatMessage {
|
||||
string text = 3;
|
||||
// Server clock. The client renders it; it never orders by its own clock.
|
||||
int64 sent_unix_ms = 4;
|
||||
// Which seat spoke, so the client can colour a line by its author instead
|
||||
// of by matching display names. Cleared with the author for a line whose
|
||||
// seat has been vacated.
|
||||
string player_id = 5;
|
||||
}
|
||||
|
||||
// ChatHistory is the whole panel, oldest first, sent when a player is seated in
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
rl
|
||||
,Ngưá»�i chÆ¡iBắt đầu nhé €»÷©‘3
|
||||
"Khách má»�iSẵn sà ng Ⱦ÷©‘3
|
||||
rt
|
||||
0Ngưá»�i chÆ¡iBắt đầu nhé €»÷©‘3*p1
|
||||
&Khách má»�iSẵn sà ng Ⱦ÷©‘3*p2
|
||||
Tôi phải Ä‘i •Á÷©‘3
|
||||
+1
-1
@@ -1 +1 @@
|
||||
j;Khách má»�i$Tiếng “sinhâ€� khó nối lắm. û»÷©‘3
|
||||
j?Khách má»�i$Tiếng “sinhâ€� khó nối lắm. û»÷©‘3*p2
|
||||
Vendored
+4
-4
@@ -1,5 +1,5 @@
|
||||
bV
|
||||
K7QXJ
|
||||
p1Người chơi 0J
|
||||
p2Khách mời(0J
|
||||
bZ
|
||||
K7QXJ
|
||||
p1Người chơi 08J
|
||||
p2Khách mời(08J
|
||||
p3Kh獺ch 2(PX`國
|
||||
Reference in new issue
Block a user